nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ModuleRegisterService implements Service < ModuleRegisterService > { private static final Logger log = Logger . getLogger ( "org.jboss.as.osgi" ) ; public static final ServiceName SERVICE_NAME_BASE = JBOSS . append ( "osgi" , "registration" ) ; private final Module module ; private final OSGiMetaData metadata ; private InjectedValue < BundleManagerService > injectedBundleManager = new InjectedValue < BundleManagerService > ( ) ; private ServiceName installedBundleName ; private ModuleRegisterService ( Module module , OSGiMetaData metadata ) { } public static void addService ( DeploymentPhaseContext phaseContext , Module module , OSGiMetaData metadata ) { final ModuleRegisterService service = new ModuleRegisterService ( module , metadata ) ; final ServiceName serviceName = ModuleRegisterService . getServiceName ( module . getIdentifier ( ) ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; ServiceBuilder < ModuleRegisterService > builder = serviceTarget . addService ( serviceName , service ) ; builder . addDependency ( BUNDLE_MANAGER , BundleManagerService . class , service . injectedBundleManager ) ; builder . addDependency ( ServiceModuleLoader . moduleServiceName ( module . getIdentifier ( ) ) ) ; <START_BUG> builder . addDependency ( FRAMEWORK_ACTIVE ) ; <END_BUG> builder . install ( ) ; } public static void removeService ( DeploymentUnit deploymentUnit ) { } public static ServiceName getServiceName ( ModuleIdentifier moduleIdentifier ) { } public synchronized void start ( StartContext context ) throws StartException { } public synchronized void stop ( StopContext context ) { } @ Override public ModuleRegisterService getValue ( ) throws IllegalStateException { } public ServiceName getInstalledBundleName ( ) { } }

Fix:
builder . addDependency ( FRAMEWORK_ACTIVATOR ) ;
Buggy code:
public class ClasspathSourceDirectory extends ClasspathLocation { IContainer sourceFolder ; String sourceLocation ; String encoding ; SimpleLookupTable directoryCache ; String [ ] missingPackageHolder = new String [ 1 ] ; char [ ] [ ] fullExclusionPatternChars ; char [ ] [ ] fulInclusionPatternChars ; ClasspathSourceDirectory ( IContainer sourceFolder , char [ ] [ ] fullExclusionPatternChars , char [ ] [ ] fulInclusionPatternChars ) { } public void cleanup ( ) { } String [ ] directoryList ( String qualifiedPackageName ) { } boolean doesFileExist ( String fileName , String qualifiedPackageName ) { } public boolean equals ( Object o ) { } public NameEnvironmentAnswer findClass ( String sourceFileWithoutExtension , String qualifiedPackageName , String qualifiedSourceFileWithoutExtension ) { String sourceFolderPath = ( this . sourceFolder . getFullPath ( ) . toString ( ) ) + ( IPath . SEPARATOR ) ; char [ ] [ ] javaLikeExtensions = Util . getJavaLikeExtensions ( ) ; for ( int i = 0 , length = javaLikeExtensions . length ; i < length ; i ++ ) { <START_BUG> String extension = new String ( javaLikeExtensions [ i ] ) ; <END_BUG> String sourceFileName = sourceFileWithoutExtension + extension ; if ( ! ( doesFileExist ( sourceFileName , qualifiedPackageName ) ) ) continue ; String qualifiedSourceFileName = qualifiedSourceFileWithoutExtension + extension ; String fullSourcePath = ( this . sourceLocation ) + qualifiedSourceFileName ; if ( org . eclipse . jdt . internal . compiler . util . Util . isExcluded ( ( sourceFolderPath + qualifiedSourceFileName ) . toCharArray ( ) , this . fulInclusionPatternChars , this . fullExclusionPatternChars , false ) ) continue ; IPath path = new Path ( qualifiedSourceFileName ) ; IFile file = this . sourceFolder . getFile ( path ) ; String fileEncoding = this . encoding ; try { fileEncoding = file . getCharset ( ) ; } catch ( CoreException ce ) { } return new NameEnvironmentAnswer ( new CompilationUnit ( null , fullSourcePath , fileEncoding ) , null ) ; } return null ; } public IPath getProjectRelativePath ( ) { } public boolean isPackage ( String qualifiedPackageName ) { } public void reset ( ) { } public String toString ( ) { } public String debugPathString ( ) { } }

Fix:
String extension = '.' + ( new String ( javaLikeExtensions [ i ] ) ) ;
Buggy code:
public class GoToMyLocationTest extends ActivityInstrumentationTestCase2 < TrackListActivity > { private Instrumentation instrumentation ; private TrackListActivity activityMyTracks ; @ TargetApi ( 8 ) public GoToMyLocationTest ( ) { } @ Override protected void setUp ( ) throws Exception { } public void testGotoMyLocation ( ) { EndToEndTestUtils . createTrackIfEmpty ( 1 , false ) ; EndToEndTestUtils . sendGps ( 30 ) ; instrumentation . waitForIdleSync ( ) ; View myLocation = SOLO . getCurrentActivity ( ) . findViewById ( map_my_location ) ; SOLO . clickOnView ( myLocation ) ; if ( EndToEndTestUtils . isEmulator ) { <START_BUG> SOLO . waitForText ( activityMyTracks . getString ( my_location_no_location ) , 1 , 1000 ) ; <END_BUG> } else { } } @ Override protected void tearDown ( ) throws Exception { } }

Fix:
SOLO . waitForText ( activityMyTracks . getString ( my_location_no_location ) , 1 , SHORT_WAIT_TIME ) ;
Buggy code:
public class PriorityTranslator { private static final String SCORE_KEY = "score" ; private static final String REASONS_KEY = "reasons" ; private static final String ITEM_PRIORITY_KEY = "priority" ; public Priority getPriority ( DBObject dbObject ) { Double score = null ; List < String > priorityScoreReasons = Lists . newArrayList ( ) ; if ( dbObject . containsField ( PriorityTranslator . ITEM_PRIORITY_KEY ) ) { <START_BUG> score = Double . parseDouble ( TranslatorUtils . toString ( dbObject , PriorityTranslator . ITEM_PRIORITY_KEY ) ) ; <END_BUG> } else { if ( dbObject . containsField ( PriorityTranslator . SCORE_KEY ) ) { score = TranslatorUtils . toDouble ( dbObject , PriorityTranslator . SCORE_KEY ) ; } if ( dbObject . containsField ( PriorityTranslator . REASONS_KEY ) ) { priorityScoreReasons = TranslatorUtils . toList ( dbObject , PriorityTranslator . REASONS_KEY ) ; } } return new Priority ( score , priorityScoreReasons ) ; } public void setPriority ( DBObject dbObject , Described entity ) { } }

Fix:
score = TranslatorUtils . toDouble ( dbObject , PriorityTranslator . ITEM_PRIORITY_KEY ) ;
Buggy code:
public class Shell extends Decorations { int shellHandle ; Menu activeMenu ; int blockedList ; Control lastActive ; Region region ; public Shell ( ) { } public Shell ( int style ) { } public Shell ( Display display ) { } public Shell ( Display display , int style ) { } Shell ( Display display , Shell parent , int style , int handle ) { } public Shell ( Shell parent ) { } public Shell ( Shell parent , int style ) { } public static Shell photon_new ( Display display , int handle ) { } public void addShellListener ( ShellListener listener ) { } void bringToTop ( boolean force ) { } static int checkStyle ( int style ) { } void closeWidget ( ) { } public void close ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( int index ) { } void deregister ( ) { } Composite findDeferredControl ( ) { } public void forceActive ( ) { } public Rectangle getBounds ( ) { } public int getImeInputMode ( ) { } public boolean isEnabled ( ) { } public Point getLocation ( ) { } public boolean getMaximized ( ) { } public boolean getMinimized ( ) { } public Point getMinimumSize ( ) { } public Region getRegion ( ) { } public Shell getShell ( ) { } public Shell [ ] getShells ( ) { } public Point getSize ( ) { } void hookEvents ( ) { } int hotkeyProc ( int w , int data , int info ) { } public void open ( ) { } int Pt_CB_RESIZE ( int widget , int info ) { } int Pt_CB_WINDOW ( int widget , int info ) { } void register ( ) { } void realizeWidget ( ) { } void releaseParent ( ) { } void releaseHandle ( ) { } void releaseChildren ( boolean destroy ) { Shell [ ] shells = getShells ( ) ; for ( int i = 0 ; i < ( shells . length ) ; i ++ ) { Shell shell = shells [ i ] ; if ( ( shell != null ) && ( ! ( shell . isDisposed ( ) ) ) ) { if ( ( ( shell . parent ) != null ) && ( ( OS . PtWidgetParent ( shell . shellHandle ) ) == 0 ) ) { shell . dispose ( ) ; } else { <START_BUG> shell . releaseChildren ( false ) ; <END_BUG> } } } super . releaseChildren ( destroy ) ; } void releaseWidget ( ) { } public void removeShellListener ( ShellListener listener ) { } public void setActive ( ) { } void setActiveControl ( Control control ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } public void setImeInputMode ( int mode ) { } public void setMaximized ( boolean maximized ) { } public void setMenuBar ( Menu menu ) { } public void setMinimized ( boolean minimized ) { } public void setRegion ( Region region ) { } public void setMinimumSize ( int width , int height ) { } public void setMinimumSize ( Point size ) { } public void setText ( String string ) { } public void setVisible ( boolean visible ) { } int topHandle ( ) { } boolean traverseEscape ( ) { } }

Fix:
shell . release ( false ) ;
Buggy code:
class ML { public static hsv [ ] [ ] img2RGB2HSV ( String ip ) throws IOException { } public static hsv [ ] [ ] img2RGB2HSV ( File input ) throws IOException { } public static void HSV2File ( hsv [ ] [ ] hsvImage , int width , int height ) throws IOException { } public static BitVector colorFeatureBuilder ( hsv [ ] [ ] hsvImage , int N , int C_h , int C_s , int C_v ) { } public static MyBitMatrix isInRange ( hsv [ ] [ ] hsvCell , int cellSize , float low , float high , int type ) { } public static boolean isAnyTrue ( MyBitMatrix temp ) { } public static fileData [ ] batchColorFeatureBuilder ( String ip , int N , int C_h , int C_s , int C_v ) throws IOException { } public static void main ( String [ ] args ) throws IOException { int N = 5 ; int C_h = 10 ; int C_s = 6 ; int C_v = 6 ; <START_BUG> BitVector colorFeatures = ML . colorFeatureBuilder ( ML . img2RGB2HSV ( "//home//shinchan//FinalProject//PaperImplementation//Eclipse//ML//input//cat.55.jpg" ) , N , C_h , C_s , C_v ) ; <END_BUG> String temp = "Single<seq2seq4repair_space>input<seq2seq4repair_space>Color<seq2seq4repair_space>features<seq2seq4repair_space>from<seq2seq4repair_space>Java.\n" ; int count = 0 ; for ( int i = 0 ; i < ( colorFeatures . size ( ) ) ; i ++ ) { if ( colorFeatures . get ( i ) ) { temp += ( Integer . toString ( count ) ) + "\n" ; } count ++ ; } System . out . print ( temp ) ; String ip = new String ( "//home//shinchan//FinalProject//PaperImplementation//Eclipse//ML//input//trainingImageData//" ) ; fileData [ ] allImageData = ML . batchColorFeatureBuilder ( ip , N , C_h , C_s , C_v ) ; for ( int i = 0 ; i < ( allImageData . length ) ; i ++ ) { System . out . println ( ( ( allImageData [ i ] . colorFeatureVector . toString ( ) ) + "\n" ) ) ; } } No newline ; at end ; of file ; }

Fix:
BitVector colorFeatures = ML . colorFeatureBuilder ( ML . img2RGB2HSV ( "//home//shinchan//FinalProject//PaperImplementation//Eclipse//ML//input//dog.55.jpg" ) , N , C_h , C_s , C_v ) ;
Buggy code:
public class ArrayElement extends AbstractJsonObject { public AbstractJsonObject parent ; public ArrayElement ( AbstractJsonObject parent ) { } @ Override public double similarity ( IElement anotherElement ) { } @ Override public String getText ( ) { <START_BUG> return ( this . parent . getText ( ) ) + "<seq2seq4repair_space>-><seq2seq4repair_space>[]" ; <END_BUG> } @ Override public int getMaxDependencies ( String dependencyID ) { } @ Override public int getMinDependencies ( String dependencyID ) { } }

Fix:
return ( this . parent . getText ( ) ) + "_[]" ;
Buggy code:
public class BSFSampler extends BSFTestElement implements Sampler , TestBean { private static final long serialVersionUID = 240L ; private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public BSFSampler ( ) { } public String getLabel ( ) { } public SampleResult sample ( Entry e ) { } public boolean applies ( ConfigTestElement configElement ) { <START_BUG> return true ; <END_BUG> } }

Fix:
return false ;
Buggy code:
public abstract class Pack extends Task { protected File source ; protected File zipFile ; public void setSrc ( File src ) { } public void setZipfile ( File zipFile ) { } public void execute ( ) throws TaskException { validate ( ) ; <START_BUG> log ( ( "Building:<seq2seq4repair_space>" + ( zipFile . getAbsolutePath ( ) ) ) ) ; <END_BUG> pack ( ) ; } protected abstract void pack ( ) throws TaskException { } protected void zipFile ( File file , OutputStream zOut ) throws IOException { } private void validate ( ) throws TaskException { } private void zipFile ( InputStream in , OutputStream zOut ) throws IOException { } }

Fix:
getLogger ( ) . info ( ( "Building:<seq2seq4repair_space>" + ( zipFile . getAbsolutePath ( ) ) ) ) ;
Buggy code:
public class Bill { LocalDate currentDate = LocalDate . now ( ) ; String biller ; BigDecimal amount ; int id ; LocalDate dueDate ; boolean dueSoon ; public Bill ( String biller , LocalDate dueDate , BigDecimal amount , int id ) { } public String getBiller ( ) { } public void setBiller ( String biller ) { } public BigDecimal getAmount ( ) { } public void setAmount ( BigDecimal amount ) { } public int getId ( ) { } public void setId ( int id ) { } public boolean isDueSoon ( ) { } public void setDueSoon ( boolean dueSoon ) { } public LocalDate getDueDate ( ) { } public void setDueDate ( LocalDate dueDate ) { } public void flipDueSoon ( ) { <START_BUG> if ( ( dueDate . isAfter ( currentDate ) ) && ( ( ( dueDate . getDayOfYear ( ) ) - ( currentDate . getDayOfYear ( ) ) ) < 10 ) ) { <END_BUG> setDueSoon ( true ) ; } else { setDueSoon ( false ) ; } } @ Override public String toString ( ) { } }

Fix:
if ( ( ( dueDate . isAfter ( currentDate ) ) && ( ( currentDate . getYear ( ) ) == ( dueDate . getYear ( ) ) ) ) && ( ( ( dueDate . getDayOfYear ( ) ) - ( currentDate . getDayOfYear ( ) ) ) < 10 ) ) {
Buggy code:
public class OpenIntToFieldHashMap < T extends FieldElement < T > > implements Serializable { protected static final byte FREE = 0 ; protected static final byte FULL = 1 ; protected static final byte REMOVED = 2 ; private static final long serialVersionUID = - 9179080286849120720L ; private static final float LOAD_FACTOR = 0.5F ; private static final int DEFAULT_EXPECTED_SIZE = 16 ; private static final int RESIZE_MULTIPLIER = 2 ; private static final int PERTURB_SHIFT = 5 ; private final Field < T > field ; private int [ ] keys ; private T [ ] values ; private byte [ ] states ; private final T missingEntries ; private int size ; private int mask ; private transient int count ; public OpenIntToFieldHashMap ( final Field < T > field ) { } public OpenIntToFieldHashMap ( final Field < T > field , final T missingEntries ) { } public OpenIntToFieldHashMap ( final Field < T > field , final int expectedSize ) { } public OpenIntToFieldHashMap ( final Field < T > field , final int expectedSize , final T missingEntries ) { } public OpenIntToFieldHashMap ( final OpenIntToFieldHashMap < T > source ) { } private static int computeCapacity ( final int expectedSize ) { } private static int nextPowerOfTwo ( final int i ) { } public T get ( final int key ) { } public boolean containsKey ( final int key ) { } public OpenIntToFieldHashMap < T > . Iterator iterator ( ) { } private static int perturb ( final int hash ) { } private int findInsertionIndex ( final int key ) { } private static int findInsertionIndex ( final int [ ] keys , final byte [ ] states , final int key , final int mask ) { } private static int probe ( final int perturb , final int j ) { } private static int changeIndexSign ( final int index ) { } public int size ( ) { } public T remove ( final int key ) { } private boolean containsKey ( final int key , final int index ) { } private T doRemove ( int index ) { } public T put ( final int key , final T value ) { } private void growTable ( ) { } private boolean shouldGrowTable ( ) { } private static int hashOf ( final int key ) { } public class Iterator { private final int referenceCount ; private int current ; private int next ; private Iterator ( ) { } public boolean hasNext ( ) { } public int key ( ) throws ConcurrentModificationException , NoSuchElementException { } public T value ( ) throws ConcurrentModificationException , NoSuchElementException { } public void advance ( ) throws ConcurrentModificationException , NoSuchElementException { } } private void readObject ( final ObjectInputStream stream ) throws IOException , ClassNotFoundException { } @ SuppressWarnings ( "unchecked" ) private T [ ] buildArray ( final int length ) { <START_BUG> return ( ( T [ ] ) ( Array . newInstance ( field . getZero ( ) . getClass ( ) , length ) ) ) ; <END_BUG> } }

Fix:
return ( ( T [ ] ) ( Array . newInstance ( field . getRuntimeClass ( ) , length ) ) ) ;
Buggy code:
public class ProxyControlGui extends AbstractJMeterGuiComponent implements ActionListener , FocusListener , KeyListener , JMeterGUIComponent , UnsharedComponent { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.gui" ) ; private JTextField portField ; private ProxyControl model ; private JTable excludeTable ; private PowerTableModel excludeModel ; private JTable includeTable ; private PowerTableModel includeModel ; private JButton stop ; private JButton start ; private JButton restart ; private static final String STOP = "stop" ; private static final String START = "start" ; private static final String RESTART = "restart" ; private static final String ADD_INCLUDE = "add_include" ; private static final String ADD_EXCLUDE = "add_exclude" ; private static final String DELETE_INCLUDE = "delete_include" ; private static final String DELETE_EXCLUDE = "delete_exclude" ; private static final String INCLUDE_COL = JMeterUtils . getResString ( "patterns_to_include" ) ; private static final String EXCLUDE_COL = JMeterUtils . getResString ( "patterns_to_exclude" ) ; public ProxyControlGui ( ) { } public JPopupMenu createPopupMenu ( ) { } public TestElement createTestElement ( ) { } protected ProxyControl makeProxyControl ( ) { } public void modifyTestElement ( TestElement el ) { } protected void setIncludeListInProxyControl ( ProxyControl element ) { } protected void setExcludeListInProxyControl ( ProxyControl element ) { } private List getDataList ( PowerTableModel model , String colName ) { } public String getStaticLabel ( ) { } public Collection getMenuCategories ( ) { } public void configure ( TestElement element ) { } private void populateTable ( PowerTableModel model , PropertyIterator iter ) { } public void focusLost ( FocusEvent e ) { } public void focusGained ( FocusEvent e ) { } public void actionPerformed ( ActionEvent action ) { } private void startProxy ( ) { } private void enableRestart ( ) { } public void keyPressed ( KeyEvent e ) { } public void keyTyped ( KeyEvent e ) { } public void keyReleased ( KeyEvent e ) { } private void init ( ) { } private JPanel createControls ( ) { } private JPanel createPortPanel ( ) { } private JPanel createIncludePanel ( ) { } private JPanel createExcludePanel ( ) { } private JPanel createTableButtonPanel ( String addCommand , String deleteCommand ) { JPanel buttonPanel = new JPanel ( ) ; JButton addButton = new JButton ( JMeterUtils . getResString ( "add" ) ) ; <START_BUG> addButton . setActionCommand ( ProxyControlGui . ADD_INCLUDE ) ; <END_BUG> addButton . addActionListener ( this ) ; buttonPanel . add ( addButton ) ; JButton deleteButton = new JButton ( JMeterUtils . getResString ( "delete" ) ) ; deleteButton . setActionCommand ( deleteCommand ) ; deleteButton . addActionListener ( this ) ; buttonPanel . add ( deleteButton ) ; return buttonPanel ; } public void setNode ( JMeterTreeNode node ) { } protected JTextField getPortField ( ) { } }

Fix:
addButton . setActionCommand ( addCommand ) ;
Buggy code:
class ImageList { int handle ; int style ; int refCount ; Image [ ] images ; static final int COLOR_FLAGS ; public ImageList ( int style ) { } public int add ( Image image ) { } int addRef ( ) { } int copyBitmap ( int hImage , int width , int height ) { } int copyIcon ( int hImage , int width , int height ) { if ( OS . IsWinCE ) SWT . error ( ERROR_NOT_IMPLEMENTED ) ; <START_BUG> int hIcon = OS . CopyImage ( hImage , IMAGE_ICON , width , height , LR_DEFAULTCOLOR ) ; <END_BUG> return hIcon != 0 ? hIcon : hImage ; } int copyWithAlpha ( int hBitmap , int background , byte [ ] alphaData , int destWidth , int destHeight ) { } int createMask ( int hBitmap , int destWidth , int destHeight , int background , int transparentPixel ) { } public void dispose ( ) { } public Image get ( int index ) { } public int getStyle ( ) { } public int getHandle ( ) { } public Point getImageSize ( ) { } public int indexOf ( Image image ) { } public void put ( int index , Image image ) { } public void remove ( int index ) { } int removeRef ( ) { } void set ( int index , Image image , int count ) { } public int size ( ) { } }

Fix:
int hIcon = OS . CopyImage ( hImage , IMAGE_ICON , width , height , 0 ) ;
Buggy code:
public class InstructionElement extends CodeElement { private final String opcode ; private final ArgumentElement [ ] argumentElements ; public InstructionElement ( Location location , String opcode , ArgumentElement [ ] argumentElements ) { } public String getOpcode ( ) { } public ArgumentElement [ ] getArgumentElements ( ) { } @ Override public String toString ( ) { String result = opcode ; <START_BUG> result += ( "<seq2seq4repair_space>l:" + ( location . getLine ( ) ) ) + ",<seq2seq4repair_space>" ; <END_BUG> int argsNum = argumentElements . length ; for ( int i = 0 ; i < argsNum ; ++ i ) { result += argumentElements [ i ] . toString ( ) ; if ( i < ( argsNum - 1 ) ) { result += ",<seq2seq4repair_space>" ; } } return result ; } public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } }

Fix:
result += ( "<seq2seq4repair_space>@<seq2seq4repair_space>" + ( location . toString ( ) ) ) + "<seq2seq4repair_space>" ;
Buggy code:
public class TestHighFrequencyDictionary extends LuceneTestCase { public void testEmpty ( ) throws Exception { Directory dir = newDirectory ( ) ; IndexWriter writer = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ) ; writer . commit ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> IndexReader ir = DirectoryReader . open ( dir ) ; Dictionary dictionary = new org . apache . lucene . search . spell . HighFrequencyDictionary ( ir , "bogus" , 0.1F ) ; BytesRefIterator tf = dictionary . getEntryIterator ( ) ; assertNull ( tf . next ( ) ) ; dir . close ( ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class GroupingHandlerAdd implements OperationStepHandler , DescriptionProvider { public static ModelNode getAddOperation ( final ModelNode address , ModelNode subModel ) { } public static final GroupingHandlerAdd INSTANCE = new GroupingHandlerAdd ( ) ; private GroupingHandlerAdd ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { PathAddress ourAddress = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; <START_BUG> final Resource subsystemRootResource = context . getRootResource ( ) . navigate ( ourAddress . subAddress ( 0 , ( ( ourAddress . size ( ) ) - 1 ) ) ) ; <END_BUG> if ( subsystemRootResource . hasChildren ( GROUPING_HANDLER ) ) { throw new OperationFailedException ( new ModelNode ( ) . set ( MessagingMessages . MESSAGES . childResourceAlreadyExists ( GROUPING_HANDLER ) ) ) ; } final Resource resource = context . createResource ( EMPTY_ADDRESS ) ; final ModelNode model = resource . getModel ( ) ; for ( final AttributeDefinition attributeDefinition : CommonAttributes . GROUPING_HANDLER_ATTRIBUTES ) { attributeDefinition . validateAndSet ( operation , model ) ; } if ( context . isNormalServer ( ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceRegistry registry = context . getServiceRegistry ( false ) ; final ServiceName hqServiceName = MessagingServices . getHornetQServiceName ( PathAddress . pathAddress ( operation . get ( ModelDescriptionConstants . OP_ADDR ) ) ) ; ServiceController < ? > hqService = registry . getService ( hqServiceName ) ; if ( hqService != null ) { context . reloadRequired ( ) ; } if ( ( context . completeStep ( ) ) == ( ResultAction . ROLLBACK ) ) { context . revertReloadRequired ( ) ; } } } , RUNTIME ) ; } context . completeStep ( ) ; } @ Override public ModelNode getModelDescription ( Locale locale ) { } static void addGroupingHandlerConfig ( final OperationContext context , final Configuration configuration , final ModelNode model ) throws OperationFailedException { } static GroupingHandlerConfiguration createGroupingHandlerConfiguration ( final OperationContext context , final String name , final ModelNode model ) throws OperationFailedException { } }

Fix:
final Resource subsystemRootResource = context . readResourceFromRoot ( ourAddress . subAddress ( 0 , ( ( ourAddress . size ( ) ) - 1 ) ) ) ;
Buggy code:
public abstract class BaseCacheOperation < A extends Annotation > implements JCacheOperation < A > { private final CacheMethodDetails < A > methodDetails ; private final CacheResolver cacheResolver ; protected final List < BaseCacheOperation . CacheParameterDetail > allParameterDetails ; protected BaseCacheOperation ( CacheMethodDetails < A > methodDetails , CacheResolver cacheResolver ) { } public abstract ExceptionTypeFilter getExceptionTypeFilter ( ) { } @ Override public Method getMethod ( ) { } @ Override public Set < Annotation > getAnnotations ( ) { } @ Override public A getCacheAnnotation ( ) { } @ Override public String getCacheName ( ) { } @ Override public Set < String > getCacheNames ( ) { } @ Override public CacheResolver getCacheResolver ( ) { } @ Override public CacheInvocationParameter [ ] getAllParameters ( Object ... values ) { } protected ExceptionTypeFilter createExceptionTypeFiler ( Class < ? extends Throwable > [ ] includes , Class < ? extends Throwable > [ ] excludes ) { } private static List < BaseCacheOperation . CacheParameterDetail > initializeAllParameterDetails ( Method method ) { List < BaseCacheOperation . CacheParameterDetail > result = new ArrayList < BaseCacheOperation . CacheParameterDetail > ( ) ; <START_BUG> for ( int i = 0 ; i < ( method . getParameterCount ( ) ) ; i ++ ) { <END_BUG> BaseCacheOperation . CacheParameterDetail detail = new BaseCacheOperation . CacheParameterDetail ( method , i ) ; result . add ( detail ) ; } return result ; } @ Override public String toString ( ) { } protected StringBuilder getOperationDescription ( ) { } protected static class CacheParameterDetail { private final Class < ? > rawType ; private final Set < Annotation > annotations ; private final int parameterPosition ; private final boolean isKey ; private final boolean isValue ; private CacheParameterDetail ( Method m , int parameterPosition ) { } public int getParameterPosition ( ) { } protected boolean isKey ( ) { } protected boolean isValue ( ) { } public CacheInvocationParameter toCacheInvocationParameter ( Object value ) { } } protected static class CacheInvocationParameterImpl implements CacheInvocationParameter { private final BaseCacheOperation . CacheParameterDetail detail ; private final Object value ; private CacheInvocationParameterImpl ( BaseCacheOperation . CacheParameterDetail detail , Object value ) { } @ Override public Class < ? > getRawType ( ) { } @ Override public Object getValue ( ) { } @ Override public Set < Annotation > getAnnotations ( ) { } @ Override public int getParameterPosition ( ) { } } }

Fix:
for ( int i = 0 ; i < ( method . getParameterTypes ( ) . length ) ; i ++ ) {
Buggy code:
@ Named @ Stateful @ RequestScoped @ Join ( path = "//workspace//{workspaceUrlName}//journal" , to = "//jsf//workspace//journal.jsf" ) @ LoggedIn public class WorkspaceJournalBackingBean { @ Parameter private String workspaceUrlName ; @ Inject private SessionController sessionController ; @ Inject private WorkspaceController workspaceController ; @ Inject private WorkspaceJournalController workspaceJournalController ; @ Inject @ Named private WorkspaceBackingBean workspaceBackingBean ; @ RequestAction public String init ( ) { } public void addWorkspaceJournalEntry ( ) { } public void editWorkspaceJournalEntry ( Long workspaceJournalEntryId ) { } public void deleteWorkspaceJournalEntry ( Long workspaceJournalEntryId ) { } public String getWorkspaceUrlName ( ) { } public void setWorkspaceUrlName ( String workspaceUrlName ) { } public Long getWorkspaceEntityId ( ) { } public String getWorkspaceJournalEntryTitle ( ) { } public void setWorkspaceJournalEntryTitle ( String workspaceJournalEntryTitle ) { } public String getWorkspaceJournalEntryHtml ( ) { } public void setWorkspaceJournalEntryHtml ( String workspaceJournalEntryHtml ) { } public Long getWorkspaceJournalEntryId ( ) { } public void setWorkspaceJournalEntryId ( Long workspaceJournalEntryId ) { } private Long workspaceEntityId ; public List < WorkspaceJournalEntry > getJournalEntries ( ) { WorkspaceEntity workspaceEntity = workspaceController . findWorkspaceEntityById ( workspaceEntityId ) ; UserEntity userEntity = sessionController . getLoggedUserEntity ( ) ; <START_BUG> if ( ! ( sessionController . hasCoursePermission ( LIST_ALL_JOURNAL_ENTRIES , workspaceEntity ) ) ) { <END_BUG> return workspaceJournalController . listEntries ( workspaceController . findWorkspaceEntityById ( workspaceEntityId ) ) ; } else { return workspaceJournalController . listEntriesByWorkspaceEntityAndUserEntity ( workspaceEntity , userEntity ) ; } } private String workspaceJournalEntryTitle ; private String workspaceJournalEntryHtml ; private Long workspaceJournalEntryId ; }

Fix:
if ( sessionController . hasCoursePermission ( LIST_ALL_JOURNAL_ENTRIES , workspaceEntity ) ) {
Buggy code:
public class KeyGenerator { private static ByteBuffer randomKey ( Random r ) { } static class RandomStringGenerator implements ResetableIterator < ByteBuffer > { int i ; int n ; int seed ; Random random ; RandomStringGenerator ( int seed , int n ) { } public int size ( ) { } public void reset ( ) { } public boolean hasNext ( ) { } public ByteBuffer next ( ) { ( i ) ++ ; return KeyGenerator . randomKey ( random ) ; } public void remove ( ) { } } static class IntGenerator implements ResetableIterator < ByteBuffer > { private int i ; private int start ; private int n ; IntGenerator ( int n ) { } IntGenerator ( int start , int n ) { } public int size ( ) { } public void reset ( ) { } public boolean hasNext ( ) { } public ByteBuffer next ( ) { <START_BUG> return ByteBuffer . wrap ( Integer . toString ( ( ( i ) ++ ) ) . getBytes ( ) ) ; <END_BUG> } public void remove ( ) { } } static class WordGenerator implements ResetableIterator < ByteBuffer > { static int WORDS ; BufferedReader reader ; private int modulo ; private int skip ; byte [ ] next ; WordGenerator ( int skip , int modulo ) { } public int size ( ) { } public void reset ( ) { } public boolean hasNext ( ) { } public ByteBuffer next ( ) { try { byte [ ] s = next ; for ( int i = 0 ; i < ( modulo ) ; i ++ ) { String line = reader . readLine ( ) ; next = ( line == null ) ? null : line . getBytes ( ) ; } return s == null ? null : ByteBuffer . wrap ( s ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } public void remove ( ) { } } }

Fix:
return ByteBufferUtil . bytes ( Integer . toString ( ( ( i ) ++ ) ) ) ;
Buggy code:
public class ContainerStore implements IContainerStore { static final String CONTAINER_NODE_NAME = "container" ; final IDStore idStore ; public ContainerStore ( IDStore idStore ) { } public IContainerEntry [ ] getContainerEntries ( ) { INamespaceEntry [ ] namespaceEntries = idStore . getNamespaceEntries ( ) ; List results = new ArrayList ( ) ; for ( int i = 0 ; i < ( namespaceEntries . length ) ; i ++ ) { IIDEntry [ ] idEntries = namespaceEntries [ i ] . getIDEntries ( ) ; for ( int j = 0 ; j < ( idEntries . length ) ; j ++ ) { ISecurePreferences pref = idEntries [ j ] . getPreferences ( ) ; String [ ] names = pref . childrenNames ( ) ; for ( int k = 0 ; k < ( names . length ) ; k ++ ) { if ( names [ k ] . equals ( ContainerStore . CONTAINER_NODE_NAME ) ) <START_BUG> results . add ( idEntries [ j ] ) ; <END_BUG> } } } return ( ( IContainerEntry [ ] ) ( results . toArray ( new IContainerEntry [ ] { } ) ) ) ; } public IContainerEntry store ( IStorableContainerAdapter containerAdapter ) { } public IContainerEntry retrieve ( ID containerID ) { } public IContainerEntry retrieve ( IIDEntry idEntry ) { } public Object getAdapter ( Class adapter ) { } }

Fix:
results . add ( new ContainerEntry ( idEntries [ j ] ) ) ;
Buggy code:
public class XaDataSourceService extends AbstractDataSourceService { private final InjectedValue < ModifiableXaDataSource > dataSourceConfig = new InjectedValue < ModifiableXaDataSource > ( ) ; public XaDataSourceService ( final String dsName , final String jndiName , final ClassLoader classLoader ) { } public XaDataSourceService ( final String dsName , final String jndiName ) { } @ Override protected synchronized void stopService ( ) { } @ Override public AS7DataSourceDeployer getDeployer ( ) throws ValidateException { <START_BUG> return new AS7DataSourceDeployer ( dataSourceConfig . getValue ( ) . getUnModifiableInstance ( ) ) ; <END_BUG> } public Injector < ModifiableXaDataSource > getDataSourceConfigInjector ( ) { } }

Fix:
return new AS7DataSourceDeployer ( dataSourceConfig . getValue ( ) . getUnModifiableInstance ( ) , dataSourceConfig . getValue ( ) . getProfile ( ) ) ;
Buggy code:
public class TempFolder extends Folder { protected HeaderList headerList ; protected Hashtable messageList ; protected int nextUid ; protected ColumbaMessage aktMessage ; protected DataStorageInterface dataStorage ; protected DefaultSearchEngine searchEngine ; public TempFolder ( ) { } public void clear ( ) { } public void expungeFolder ( ) throws Exception { } protected Object generateNextUid ( ) { } public void setNextUid ( int next ) { } public Object addMessage ( ColumbaMessage message ) throws Exception { } public Object addMessage ( String source ) throws Exception { } public boolean exists ( Object uid ) throws Exception { } public HeaderList getHeaderList ( ) throws Exception { } public void markMessage ( Object [ ] uids , int variant ) throws Exception { } public void removeMessage ( Object uid ) throws Exception { } public MimePart getMimePart ( Object uid , Integer [ ] address ) throws Exception { } public String getMessageSource ( Object uid ) throws Exception { } public MimeTree getMimePartTree ( Object uid ) throws Exception { } public ColumbaHeader getMessageHeader ( Object uid ) throws Exception { } public ColumbaMessage getMessage ( Object uid ) throws Exception { } public AbstractSearchEngine getSearchEngineInstance ( ) { } public Object [ ] searchMessages ( Filter filter , Object [ ] uids ) throws Exception { } public Object [ ] searchMessages ( Filter filter ) throws Exception { } public String getDefaultChild ( ) { } public String getName ( ) { } public String toString ( ) { } public Object addMessage ( InputStream in ) throws Exception { StringBuffer source = StreamUtils . readInString ( in ) ; Message message = MessageParser . parse ( new CharSequenceSource ( source ) ) ; Object newUid = generateNextUid ( ) ; log . debug ( ( "new<seq2seq4repair_space>UID=" + newUid ) ) ; ColumbaHeader h = new ColumbaHeader ( message . getHeader ( ) ) ; h . set ( "columba.uid" , newUid ) ; headerList . add ( h , newUid ) ; <START_BUG> messageList . put ( newUid , message ) ; <END_BUG> return newUid ; } public Object getAttribute ( Object uid , String key ) throws Exception { } public Flags getFlags ( Object uid ) throws Exception { } public Header getHeaderFields ( Object uid , String [ ] keys ) throws Exception { } public InputStream getMessageSourceStream ( Object uid ) throws Exception { } public InputStream getMimePartBodyStream ( Object uid , Integer [ ] address ) throws Exception { } public InputStream getMimePartSourceStream ( Object uid , Integer [ ] address ) throws Exception { } }

Fix:
messageList . put ( newUid , new ColumbaMessage ( h , message ) ) ;
Buggy code:
public class ConstantFoldingVisitor extends OptimizationVisitor < TargetValue > { protected boolean fixPoint = true ; public static final OptimizationVisitorFactory < TargetValue > FACTORY = new OptimizationVisitorFactory < TargetValue > ( ) { @ Override public OptimizationVisitor < TargetValue > create ( ) { } } ; protected HashMap < Node , TargetValue > targets = new HashMap < > ( ) ; @ Override public HashMap < Node , TargetValue > getLatticeValues ( ) { } @ Override public HashMap < Node , Node > getNodeReplacements ( ) { } private void setTargetValue ( Node node , TargetValue targetValue ) { } private TargetValue getTargetValue ( Node node ) { } private void binaryTransferFunction ( Node node , TargetValue leftTarget , TargetValue rightTarget , TargetValue newTargetValue ) { } private void unaryTransferFunction ( Node node , TargetValue target , TargetValue newTargetValue ) { } private void divTransferFunction ( Node node , TargetValue leftTarget , TargetValue rightTarget , TargetValue newTargetValue ) { } private void modTransferFunction ( Node node , TargetValue leftTarget , TargetValue rightTarget , TargetValue newTargetValue ) { } private void mulTransferFunction ( Node node , TargetValue leftTarget , TargetValue rightTarget , TargetValue newTargetValue ) { } @ Override public void visit ( Add add ) { } @ Override public void visit ( And and ) { } @ Override public void visit ( Const constant ) { } @ Override public void visit ( Conv conversion ) { TargetValue target = getTargetValue ( conversion . getOp ( ) ) ; TargetValue newTargetValue ; <START_BUG> if ( target . isNegative ( ) ) { <END_BUG> newTargetValue = TargetValue . getUnknown ( ) ; } else { newTargetValue = target . convertTo ( conversion . getMode ( ) ) ; } unaryTransferFunction ( conversion , target , newTargetValue ) ; } @ Override public void visit ( Div division ) { } @ Override public void visit ( Minus minus ) { } @ Override public void visit ( Mod mod ) { } @ Override public void visit ( Mul multiplication ) { } @ Override public void visit ( Not not ) { } @ Override public void visit ( Or or ) { } @ Override public void visit ( Phi phi ) { } @ Override public void visit ( Proj proj ) { } @ Override public void visit ( Shl shl ) { } @ Override public void visit ( Shr shr ) { } @ Override public void visit ( Shrs shrs ) { } @ Override public void visit ( Sub sub ) { } private class ConstantFoldingFixpointVisitor extends ConstantFoldingVisitor { private ConstantFoldingFixpointVisitor ( HashMap < Node , TargetValue > targets , LinkedList < Node > workList ) { } @ Override public void visit ( Phi phi ) { } } }

Fix:
if ( ( target . isLong ( ) ) && ( target . isNegative ( ) ) ) {
Buggy code:
public class CoreHelper { private CoreHelper ( ) { } private static CoreHelper SINGLETON = new CoreHelper ( ) ; public static CoreHelper getHelper ( ) { } public Collection getAllSupertypes ( MClassifier cls ) { } public Collection getSupertypes ( MClassifier cls ) { } public Collection getAssociateEnds ( MClassifier classifier ) { } public Collection getAssociateEndsInh ( MClassifier classifier ) { } public Collection getAttributes ( MClassifier classifier ) { } public Collection getOperations ( MClassifier classifier ) { } public Collection getAttributesInh ( MClassifier classifier ) { } public Collection getOperationsInh ( MClassifier classifier ) { } public MParameter getReturnParameter ( MOperation operation ) { } public Collection getReturnParameters ( MOperation operation ) { } public Collection getSpecifications ( MClassifier cls ) { } public Collection getSubtypes ( MClassifier cls ) { } public void setReturnParameter ( MOperation operation , MParameter newReturnParameter ) { } public MDependency buildSupportDependency ( MModelElement from , MModelElement to ) { } public Collection getAllBehavioralFeatures ( MModelElement element ) { } public Collection getAllBehavioralFeatures ( MClassifier clazz ) { } public Collection getAllBehavioralFeatures ( ) { } public Collection getAllInterfaces ( ) { } public Collection getAllInterfaces ( MNamespace ns ) { } public Collection getAllClasses ( ) { } public Collection getAllClasses ( MNamespace ns ) { } public Collection getRealizedInterfaces ( MClassifier clazz ) { } public MAbstraction getRealization ( MInterface source , MClassifier clazz ) { } public Collection getExtendedClasses ( MClassifier clazz ) { } public MGeneralization getGeneralization ( MGeneralizableElement child , MGeneralizableElement parent ) { } public Collection getExtendingClasses ( MClassifier clazz ) { if ( clazz == null ) return new ArrayList ( ) ; Iterator it = clazz . getSpecializations ( ) . iterator ( ) ; List list = new ArrayList ( ) ; while ( it . hasNext ( ) ) { MGeneralization gen = ( ( MGeneralization ) ( it . next ( ) ) ) ; MGeneralizableElement client = gen . getChild ( ) ; <START_BUG> if ( client instanceof MClass ) { <END_BUG> list . add ( client ) ; } } return list ; } }

Fix:
if ( client instanceof MClassifier ) {
Buggy code:
public class LabelIconPanel extends Panel { private static final long serialVersionUID = 1L ; public LabelIconPanel ( String id , IModel model , BaseTree tree ) { } protected void addComponents ( IModel model , BaseTree tree ) { } protected Component newImageComponent ( String componentId , final BaseTree tree , final IModel model ) { } protected Component newContentComponent ( String componentId , BaseTree tree , IModel model ) { } protected ResourceReference getImageResourceReference ( BaseTree tree , Object node ) { <START_BUG> TreeModel model = ( ( TreeModel ) ( tree . getModelObject ( ) ) ) ; <END_BUG> if ( model . isLeaf ( node ) ) { return getResourceItemLeaf ( node ) ; } else { if ( tree . getTreeState ( ) . isNodeExpanded ( node ) ) { return getResourceFolderOpen ( node ) ; } else { return getResourceFolderClosed ( node ) ; } } } protected IModel wrapNodeModel ( IModel nodeModel ) { } protected ResourceReference getResourceFolderClosed ( Object node ) { } protected ResourceReference getResourceFolderOpen ( Object node ) { } protected ResourceReference getResourceItemLeaf ( Object node ) { } private static final ResourceReference RESOURCE_FOLDER_OPEN = new ResourceReference ( LabelIconPanel . class , "res//folder-open.gif" ) ; private static final ResourceReference RESOURCE_FOLDER_CLOSED = new ResourceReference ( LabelIconPanel . class , "res//folder-closed.gif" ) ; private static final ResourceReference RESOURCE_ITEM = new ResourceReference ( LabelIconPanel . class , "res//item.gif" ) ; }

Fix:
TreeModel model = ( ( TreeModel ) ( tree . getDefaultModelObject ( ) ) ) ;
Buggy code:
public class ManagePanel extends JPanel { public ManagePanel ( PluginManager window ) { } public void update ( ) { } private JTable table ; private ManagePanel . PluginTableModel pluginModel ; private JButton remove ; private JButton help ; private PluginManager window ; class Entry { static final String ERROR = "error" ; static final String LOADED = "loaded" ; static final String NOT_LOADED = "not-loaded" ; String clazz ; String name ; String version ; String author ; String status ; String docs ; Vector jars ; String path ; boolean broken ; Entry ( String path , String clazz , boolean broken ) { } public String toString ( ) { } } class PluginTableModel extends AbstractTableModel { private ArrayList entries ; private int sortType = ManagePanel . EntryCompare . NAME ; public PluginTableModel ( ) { } public int getColumnCount ( ) { } public Class getColumnClass ( int columnIndex ) { } public String getColumnName ( int column ) { } public ManagePanel . Entry getEntry ( int rowIndex ) { } public int getRowCount ( ) { } public Object getValueAt ( int rowIndex , int columnIndex ) { } public boolean isCellEditable ( int rowIndex , int columnIndex ) { } public void setValueAt ( Object value , int rowIndex , int columnIndex ) { } public void setSortType ( int type ) { } public void sort ( int type ) { } public void update ( ) { } private void unloadPluginJAR ( PluginJAR jar ) { } } class TextRenderer extends DefaultTableCellRenderer { private DefaultTableCellRenderer tcr ; public TextRenderer ( DefaultTableCellRenderer tcr ) { } public Component getTableCellRendererComponent ( JTable table , Object value , boolean isSelected , boolean hasFocus , int row , int column ) { ManagePanel . Entry entry = pluginModel . getEntry ( row ) ; if ( entry . status . equals ( ManagePanel . Entry . ERROR ) ) tcr . setForeground ( Color . red ) ; else <START_BUG> tcr . setForeground ( Color . black ) ; <END_BUG> return tcr . getTableCellRendererComponent ( table , value , isSelected , false , row , column ) ; } } class RemoveButton extends JButton implements ActionListener , ListSelectionListener { public RemoveButton ( ) { } public void actionPerformed ( ActionEvent evt ) { } public void valueChanged ( ListSelectionEvent e ) { } } class HelpButton extends JButton implements ActionListener , ListSelectionListener { private URL docURL ; public HelpButton ( ) { } public void actionPerformed ( ActionEvent evt ) { } public void valueChanged ( ListSelectionEvent e ) { } } static class EntryCompare implements Comparator { public static final int NAME = 0 ; public static final int STATUS = 2 ; private int type ; public EntryCompare ( int type ) { } public int compare ( Object o1 , Object o2 ) { } } class HeaderMouseHandler extends MouseAdapter { public void mouseClicked ( MouseEvent evt ) { } } }

Fix:
tcr . setForeground ( UIManager . getColor ( "Table.foreground" ) ) ;
Buggy code:
public class WebParamModeHolderTypeRuleTest extends AbstractAnnotationValidationTest { @ Override public Annotation getAnnotation ( ) { } @ Override public String getPackageName ( ) { } @ Override public String getClassName ( ) { } @ Override public String getClassContents ( ) { } public void testWebParamModeHolderTypeRule ( ) { try { assertNotNull ( annotation ) ; assertEquals ( WebParam . class . getSimpleName ( ) , AnnotationUtils . getAnnotationName ( annotation ) ) ; IMethod method = source . findPrimaryType ( ) . getMethod ( "myMethod" , new String [ ] { "QString;" } ) ; assertNotNull ( method ) ; AnnotationUtils . addImportChange ( compilationUnit , WebParam . class , textFileChange , true ) ; SingleVariableDeclaration parameter = AnnotationUtils . getMethodParameter ( compilationUnit , method , 128 ) ; AnnotationUtils . createMethodParameterAnnotationChange ( source , compilationUnit , rewriter , parameter , method , annotation , textFileChange ) ; assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; <START_BUG> parameter = AnnotationUtils . getMethodParameter ( AnnotationUtils . getASTParser ( method . getCompilationUnit ( ) ) , method , 156 ) ; <END_BUG> assertTrue ( AnnotationUtils . isAnnotationPresent ( parameter , annotation ) ) ; Job . getJobManager ( ) . join ( ResourcesPlugin . FAMILY_AUTO_BUILD , null ) ; IMarker [ ] allmarkers = source . getResource ( ) . findMarkers ( IMarker . PROBLEM , true , IResource . DEPTH_INFINITE ) ; assertEquals ( 1 , allmarkers . length ) ; IMarker annotationProblemMarker = allmarkers [ 0 ] ; assertEquals ( source . getResource ( ) , annotationProblemMarker . getResource ( ) ) ; assertEquals ( WEBPARAM_MODE_OUT_INOUT_HOLDER_TYPE , annotationProblemMarker . getAttribute ( IMarker . MESSAGE ) ) ; } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } catch ( OperationCanceledException oce ) { fail ( oce . getLocalizedMessage ( ) ) ; } catch ( InterruptedException ie ) { fail ( ie . getLocalizedMessage ( ) ) ; } } }

Fix:
parameter = AnnotationUtils . getMethodParameter ( AnnotationUtils . getASTParser ( method . getCompilationUnit ( ) , false ) , method , 156 ) ;