nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ActionAddExistingEdge extends UMLAction { Object _edge = null ; public ActionAddExistingEdge ( String tabName , Object edge ) { } public void actionPerformed ( ActionEvent arg0 ) { super . actionPerformed ( arg0 ) ; if ( ( _edge ) == null ) return ; MutableGraphModel gm = ( ( MutableGraphModel ) ( ProjectManager . getManager ( ) . getCurrentProject ( ) . getActiveDiagram ( ) . getGraphModel ( ) ) ) ; if ( gm . canAddEdge ( _edge ) ) { <START_BUG> gm . addNodeRelatedEdges ( gm . getSourcePort ( _edge ) ) ; <END_BUG> } } public boolean shouldBeEnabled ( ) { } }

Fix:
gm . addEdge ( _edge ) ;
Buggy code:
public class IterationCounter extends AbstractFunction { private static final List < String > desc = new LinkedList < String > ( ) ; private static final String KEY = "__counter" ; private ThreadLocal < Integer > perThreadInt ; private Object [ ] variables ; private int globalCounter ; private void init ( ) { } public IterationCounter ( ) { } @ Override public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { ( globalCounter ) ++ ; JMeterVariables vars = getVariables ( ) ; <START_BUG> boolean perThread = Boolean . valueOf ( ( ( CompoundVariable ) ( variables [ 0 ] ) ) . execute ( ) ) . booleanValue ( ) ; <END_BUG> String varName = "" ; if ( ( variables . length ) >= 2 ) { varName = ( ( CompoundVariable ) ( variables [ 1 ] ) ) . execute ( ) . trim ( ) ; } String counterString = "" ; if ( perThread ) { int threadCounter ; threadCounter = ( perThreadInt . get ( ) . intValue ( ) ) + 1 ; perThreadInt . set ( Integer . valueOf ( threadCounter ) ) ; counterString = String . valueOf ( threadCounter ) ; } else { counterString = String . valueOf ( globalCounter ) ; } if ( ( vars != null ) && ( ( varName . length ( ) ) > 0 ) ) { vars . put ( varName , counterString ) ; } return counterString ; } @ Override public synchronized void setParameters ( Collection < CompoundVariable > parameters ) throws InvalidVariableException { } @ Override public String getReferenceKey ( ) { } public List < String > getArgumentDesc ( ) { } }

Fix:
boolean perThread = Boolean . parseBoolean ( ( ( CompoundVariable ) ( variables [ 0 ] ) ) . execute ( ) ) ;
Buggy code:
@ Service public class ScheduleService { @ Resource private ScheduleDao scheduleDao ; @ Resource private TeacherService teacherService ; @ Resource private StudentDao studentDao ; public void addSchedule ( Schedule schedule ) { } public Map < String , Map < Integer , Map < String , List < Schedule > > > > getSchedule ( String beginDate , String endDate , User user ) { List < Schedule > list = null ; if ( ( user . getPriority ( ) ) == 100 ) { list = scheduleDao . getSchedule ( beginDate , endDate ) ; } else { list = scheduleDao . getScheduleByTeacher ( beginDate , endDate , user . getName ( ) ) ; } Map < String , Map < Integer , Map < String , List < Schedule > > > > map = Maps . newHashMap ( ) ; for ( Schedule schedule : list ) { String teacher = schedule . getTeacher ( ) ; Map < Integer , Map < String , List < Schedule > > > tMap ; if ( map . containsKey ( teacher ) ) { tMap = map . get ( teacher ) ; } else { tMap = Maps . newTreeMap ( ) ; <START_BUG> for ( int i = 1 ; i <= 5 ; i ++ ) { <END_BUG> Map < String , List < Schedule > > lMap = Maps . newHashMap ( ) ; tMap . put ( i , lMap ) ; } map . put ( teacher , tMap ) ; } Map < String , List < Schedule > > lMap = tMap . get ( schedule . getScope ( ) ) ; String date = schedule . getDate ( ) ; List < Schedule > sl ; if ( lMap . containsKey ( date ) ) { sl = lMap . get ( date ) ; } else { sl = Lists . newArrayList ( ) ; lMap . put ( date , sl ) ; } sl . add ( schedule ) ; } Map < String , Map < Integer , Map < String , List < Schedule > > > > returnMap = Maps . newHashMap ( ) ; for ( String teacherName : map . keySet ( ) ) { Teacher teacher = teacherService . getTeacherByName ( teacherName ) ; String teacherDisplay = ( ( ( teacherName + "<seq2seq4repair_space>(" ) + ( teacher . getCourse ( ) ) ) + ")<seq2seq4repair_space>" ) + ( teacher . getPhone ( ) ) ; returnMap . put ( teacherDisplay , map . get ( teacherName ) ) ; } return returnMap ; } public List < Schedule > getNeedActionSchedule ( ) { } public List < Schedule > getScheduleByStudent ( String student ) { } public Schedule getScheduleById ( int id ) { } public void offCourse ( int id ) { } public void delete ( int id ) { } @ Transactional public void confirm ( int id ) { } @ Transactional public void lackConfirm ( int id , int fact ) { } }

Fix:
for ( int i = 1 ; i <= 6 ; i ++ ) {
Buggy code:
public class RedisCompressIndex extends CompressIndexNBT { private Jedis redis ; protected String prefix ; private static Logger logger = Logger . getLogger ( RedisCompressIndex . class ) ; public RedisCompressIndex ( GlobalDatabase global , ConfigServer config , String idStorage , String idTV ) { } public void blacklistVW ( String b ) { } public Map < String , Integer > getBlacklistedVW ( ) { <START_BUG> Map < String , Integer > blacklistedVW = new HashMap < String , Integer > ( redis . dbSize ( ) . intValue ( ) ) ; <END_BUG> Set < String > keys = redis . smembers ( this . prefix ) ; Iterator < String > it = keys . iterator ( ) ; while ( it . hasNext ( ) ) { String key = it . next ( ) ; blacklistedVW . put ( key , ( - 1 ) ) ; } return blacklistedVW ; } public boolean isBlackListed ( String b ) { } }

Fix:
Map < String , Integer > blacklistedVW = new HashMap < String , Integer > ( ) ;
Buggy code:
public class CompareTest { private float min = 0.0F ; private float max = 65.0F ; @ BeforeClass public static void setUpBeforeClass ( ) throws Exception { } @ AfterClass public static void tearDownAfterClass ( ) throws Exception { } @ Before public void setUp ( ) throws Exception { } @ After public void tearDown ( ) throws Exception { } @ Test public void CompareTest ( ) { Random rand = new Random ( ) ; AbstractDaoFactory daoFact = new DaoFactory ( ) ; CompareDao dao = daoFact . getCompareDao ( ) ; for ( int i = 0 ; i < 50 ; i ++ ) { <START_BUG> assertTrue ( dao . playerComparison ( ( ( ( rand . nextFloat ( ) ) * ( ( max ) - ( min ) ) ) + ( min ) ) , "RB" , "New<seq2seq4repair_space>York<seq2seq4repair_space>Jets" , 1 ) ) ; <END_BUG> } } }

Fix:
assertTrue ( ( ( dao . playerComparison ( ( ( ( rand . nextFloat ( ) ) * ( ( max ) - ( min ) ) ) + ( min ) ) , "RB" , "New<seq2seq4repair_space>York<seq2seq4repair_space>Jets" ) ) > 0 ) ) ;
Buggy code:
public class WhileStatement extends Statement { public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( WhileStatement . class , "expression" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor ( WhileStatement . class , "body" , Statement . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Expression expression = null ; private Statement body = null ; WhileStatement ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { WhileStatement result = new WhileStatement ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . copyLeadingComment ( this ) ; result . setExpression ( ( ( Expression ) ( getExpression ( ) . clone ( target ) ) ) ) ; result . setBody ( ( ( Statement ) ( getBody ( ) . clone ( target ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { } public void setExpression ( Expression expression ) { } public Statement getBody ( ) { } public void setBody ( Statement statement ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public final class ServiceInjectionSource extends InjectionSource { private final ServiceName serviceName ; public ServiceInjectionSource ( final ServiceName serviceName ) { } <START_BUG> public void getResourceValue ( final ComponentConfiguration componentConfiguration , final ServiceBuilder < ? > serviceBuilder , final DeploymentPhaseContext phaseContext , final Injector < ManagedReferenceFactory > injector ) { <END_BUG> serviceBuilder . addDependency ( serviceName , ManagedReferenceFactory . class , injector ) ; } private boolean equals ( final ServiceInjectionSource configuration ) { } public int hashCode ( ) { } }

Fix:
public void getResourceValue ( final ResolutionContext context , final ServiceBuilder < ? > serviceBuilder , final DeploymentPhaseContext phaseContext , final Injector < ManagedReferenceFactory > injector ) {
Buggy code:
public class CompactionsTest extends CleanupHelper { public static final String TABLE1 = "Keyspace1" ; public static final String TABLE2 = "Keyspace2" ; public static final InetAddress LOCAL = FBUtilities . getLocalAddress ( ) ; @ Test public void testCompactions ( ) throws IOException , InterruptedException , ExecutionException { instance . disableAutoCompaction ( ) ; Table table = Table . open ( CompactionsTest . TABLE1 ) ; ColumnFamilyStore store = table . getColumnFamilyStore ( "Standard1" ) ; final int ROWS_PER_SSTABLE = 10 ; Set < String > inserted = new HashSet < String > ( ) ; for ( int j = 0 ; j < ( ( ( SSTableReader . indexInterval ( ) ) * 3 ) // ROWS_PER_SSTABLE ) ; j ++ ) { for ( int i = 0 ; i < ROWS_PER_SSTABLE ; i ++ ) { String key = String . valueOf ( ( i % 2 ) ) ; RowMutation rm = new RowMutation ( CompactionsTest . TABLE1 , key ) ; rm . add ( new QueryPath ( "Standard1" , null , String . valueOf ( ( i // 2 ) ) . getBytes ( ) ) , new byte [ 0 ] , ( ( j * ROWS_PER_SSTABLE ) + i ) ) ; rm . apply ( ) ; inserted . add ( key ) ; } store . forceBlockingFlush ( ) ; Assert . assertEquals ( inserted . size ( ) , table . getColumnFamilyStore ( "Standard1" ) . getKeyRange ( "" , "" , 10000 ) . keys . size ( ) ) ; } while ( true ) { <START_BUG> Future < Integer > ft = instance . submitMinor ( store ) ; <END_BUG> if ( ( ft . get ( ) ) == 0 ) break ; } if ( ( store . getSSTables ( ) . size ( ) ) > 1 ) { instance . submitMajor ( store ) . get ( ) ; } Assert . assertEquals ( inserted . size ( ) , table . getColumnFamilyStore ( "Standard1" ) . getKeyRange ( "" , "" , 10000 ) . keys . size ( ) ) ; } @ Test public void testCompactionPurge ( ) throws IOException , InterruptedException , ExecutionException { } @ Test public void testCompactionPurgeOneFile ( ) throws IOException , InterruptedException , ExecutionException { } @ Test public void testCompactionReadonly ( ) throws IOException , InterruptedException , ExecutionException { } }

Fix:
Future < Integer > ft = instance . submitMinorIfNeeded ( store ) ;
Buggy code:
public class DefaultVelocityEngineTest extends AbstractMockingComponentTestCase { @ MockingRequirement private DefaultVelocityEngine engine ; @ Override public void configure ( ) throws Exception { } @ Test public void testEvaluateReader ( ) throws Exception { } @ Test public void testEvaluateString ( ) throws Exception { } @ Test public void testSecureUberspectorActiveByDefault ( ) throws Exception { this . engine . initialize ( new Properties ( ) ) ; StringWriter writer = new StringWriter ( ) ; <START_BUG> final Logger logger = getComponentManager ( ) . lookup ( Logger . class ) ; <END_BUG> getMockery ( ) . checking ( new Expectations ( ) { } ) ; this . engine . evaluate ( new VelocityContext ( ) , writer , "mytemplate" , ( "#set($foo<seq2seq4repair_space>=<seq2seq4repair_space>'test')#set($object<seq2seq4repair_space>=<seq2seq4repair_space>$foo.class.forName('java.util.ArrayList')" + ".newInstance())$object.size()" ) ) ; Assert . assertEquals ( "$object.size()" , writer . toString ( ) ) ; } @ Test public void testSettingNullAllowedByDefault ( ) throws Exception { } @ Test public void testOverrideConfiguration ( ) throws Exception { } @ Test public void testMacroIsolation ( ) throws Exception { } @ Test public void testConfigureMacrosToBeGlobal ( ) throws Exception { } }

Fix:
final Logger logger = getMockLogger ( ) ;
Buggy code:
public class GenericXMLWriter extends PrintWriter { private static final String XML_VERSION = "<?xml<seq2seq4repair_space>version=\"1.0\"<seq2seq4repair_space>encoding=\"UTF-8\"?>" ; private static void appendEscapedChar ( StringBuffer buffer , char c ) { } private static String getEscaped ( String s ) { } private static String getReplacement ( char c ) { } private String lineSeparator ; private int tab ; public GenericXMLWriter ( OutputStream stream , String lineSeparator , boolean printXmlVersion ) { } public GenericXMLWriter ( Writer writer , String lineSeparator , boolean printXmlVersion ) { } public void endTag ( String name , boolean insertTab , boolean insertNewLine ) { } public void printString ( String string , boolean insertTab , boolean insertNewLine ) { } private void printTabulation ( ) { } public void printTag ( String name , HashMap parameters , boolean insertTab , boolean insertNewLine , boolean closeTag ) { if ( insertTab ) { <START_BUG> this . printTabulation ( ) ; <END_BUG> } this . print ( '<' ) ; this . print ( name ) ; if ( parameters != null ) { int length = parameters . size ( ) ; Map . Entry [ ] entries = new Map . Entry [ length ] ; parameters . entrySet ( ) . toArray ( entries ) ; Arrays . sort ( entries , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { Map . Entry entry1 = ( ( Map . Entry ) ( o1 ) ) ; Map . Entry entry2 = ( ( Map . Entry ) ( o2 ) ) ; return ( ( String ) ( entry1 . getKey ( ) ) ) . compareTo ( ( ( String ) ( entry2 . getKey ( ) ) ) ) ; } } ) ; for ( int i = 0 ; i < length ; i ++ ) { this . print ( '<seq2seq4repair_space>' ) ; this . print ( entries [ i ] . getKey ( ) ) ; this . print ( "=\"" ) ; this . print ( GenericXMLWriter . getEscaped ( String . valueOf ( entries [ i ] . getValue ( ) ) ) ) ; this . print ( '\"' ) ; } } if ( closeTag ) { this . print ( "//>" ) ; } else { this . print ( ">" ) ; } if ( insertNewLine ) { print ( this . lineSeparator ) ; } if ( ( parameters != null ) && ( ! closeTag ) ) ( this . tab ) ++ ; } public void startTag ( String name , boolean insertTab ) { } }

Fix:
printTabulation ( ) ;
Buggy code:
public class WebPage extends Activity { WebView webView ; BroadcastReceiver receiver ; Button submit ; String js ; String otp ; TextView otpview ; Callback loadmoneycb ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ TargetApi ( VERSION_CODES . LOLLIPOP ) private void initwebview ( ) { } private class JsInterface { @ JavascriptInterface public void pgResponse ( String response ) { } @ JavascriptInterface public void loadWalletResponse ( String response ) { if ( response . contains ( ":" ) ) { String [ ] decodeResp = response . split ( ":" ) ; if ( ( decodeResp . length ) > 0 ) { <START_BUG> if ( TextUtils . equals ( decodeResp [ 0 ] , "SUCCESSFUL" ) ) { <END_BUG> Toast . makeText ( getApplicationContext ( ) , "Your<seq2seq4repair_space>wallet<seq2seq4repair_space>is<seq2seq4repair_space>loaded<seq2seq4repair_space>Successfully." , LENGTH_LONG ) . show ( ) ; finish ( ) ; } else { Toast . makeText ( getApplicationContext ( ) , "Wallet<seq2seq4repair_space>Load<seq2seq4repair_space>Failed." , LENGTH_LONG ) . show ( ) ; } } } } } No newline ; at end ; of file ; }

Fix:
if ( TextUtils . equals ( decodeResp [ 0 ] , "#SUCCESSFUL" ) ) {
Buggy code:
public class TemplateUtils { public static void copyTemplate ( File tmpl , File dest , HashMap < String , String > vars ) throws IOException { List < String > lines = new ArrayList < String > ( ) ; BufferedReader in = new BufferedReader ( new FileReader ( tmpl ) ) ; String line = in . readLine ( ) ; while ( line != null ) { for ( String var : vars . keySet ( ) ) { String orgStr = ( "\\$\\{" + var ) + "\\}" ; String destStr = vars . get ( var ) ; <START_BUG> line . replaceAll ( orgStr , destStr ) ; <END_BUG> } lines . add ( line ) ; line = in . readLine ( ) ; } in . close ( ) ; PrintWriter out = new PrintWriter ( dest ) ; for ( String l : lines ) out . println ( l ) ; out . close ( ) ; } }

Fix:
line = line . replaceAll ( orgStr , destStr ) ;
Buggy code:
public class RunningSample { private static DecimalFormat rateFormatter = new DecimalFormat ( "#.0" ) ; private static DecimalFormat errorFormatter = new DecimalFormat ( "#0.00%" ) ; private long counter ; private long runningSum ; private long max ; private long min ; private long errorCount ; private long firstTime ; private long lastTime ; private String label ; private int index ; private RunningSample ( ) { } public RunningSample ( String label , int index ) { } public RunningSample ( RunningSample src ) { } private void init ( ) { } public synchronized void clear ( ) { } public long getElapsed ( ) { } public double getRate ( ) { } public double getRatePerMin ( ) { } public String getRateString ( ) { double rate = getRate ( ) ; if ( rate == ( Double . MAX_VALUE ) ) { return "N//A" ; } String unit = "sec" ; if ( rate < 1.0 ) { rate *= 60.0 ; unit = "min" ; } if ( rate < 1.0 ) { rate *= 60.0 ; <START_BUG> unit = "//hour" ; <END_BUG> } String rval = ( ( RunningSample . rateFormatter . format ( rate ) ) + "//" ) + unit ; return rval ; } public String getLabel ( ) { } public int getIndex ( ) { } public synchronized void addSample ( SampleResult res ) { } public synchronized void addSample ( RunningSample rs ) { } public long getMin ( ) { } public long getMax ( ) { } public long getAverage ( ) { } public long getNumSamples ( ) { } public double getErrorPercentage ( ) { } public String getErrorPercentageString ( ) { } public String toString ( ) { } public long getErrorCount ( ) { } }

Fix:
unit = "hour" ;
Buggy code:
public class MemberRef extends ASTNode implements IDocElement { public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor ( MemberRef . class , "qualifier" , Name . class , ASTNode . OPTIONAL , ASTNode . NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( MemberRef . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Name optionalQualifier = null ; private SimpleName memberName = null ; MemberRef ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { MemberRef result = new MemberRef ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setQualifier ( ( ( Name ) ( ASTNode . copySubtree ( target , getQualifier ( ) ) ) ) ) ; result . setName ( ( ( SimpleName ) ( ASTNode . copySubtree ( target , getName ( ) ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Name getQualifier ( ) { } public void setQualifier ( Name name ) { } public SimpleName getName ( ) { } public void setName ( SimpleName name ) { } public final IBinding resolveBinding ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class HtmlProblemFinderTest extends TestCase { public void testProblemFinder ( ) { <START_BUG> final MarkupParser parser = new MarkupParser ( new XmlPullParser ( ) ) { <END_BUG> public void initFilterChain ( ) { appendMarkupFilter ( new HtmlProblemFinder ( HtmlProblemFinder . ERR_THROW_EXCEPTION ) ) ; } } ; try { parser . parse ( "<img<seq2seq4repair_space>src=\"\"//>" ) ; assertTrue ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>thrown<seq2seq4repair_space>an<seq2seq4repair_space>exception" , false ) ; } catch ( Exception ex ) { } } }

Fix:
final MarkupParser parser = new MarkupParser ( new XmlPullParser ( null ) ) {
Buggy code:
public class HTMLStripCharFilterTest extends BaseTokenStreamTestCase { private static Analyzer newTestAnalyzer ( ) { return new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { Tokenizer tokenizer = new MockTokenizer ( reader , MockTokenizer . WHITESPACE , false ) ; return new TokenStreamComponents ( tokenizer , tokenizer ) ; } @ Override <START_BUG> protected Reader initReader ( Reader reader ) { <END_BUG> return new HTMLStripCharFilter ( CharReader . get ( reader ) ) ; } } ; } public void test ( ) throws IOException { } public void testHTML ( ) throws Exception { } public void testMSWord14GeneratedHTML ( ) throws Exception { } public void testGamma ( ) throws Exception { } public void testEntities ( ) throws Exception { } public void testMoreEntities ( ) throws Exception { } public void testReserved ( ) throws Exception { } public void testMalformedHTML ( ) throws Exception { } public void testBufferOverflow ( ) throws Exception { } private void appendChars ( StringBuilder testBuilder , int numChars ) { } private void processBuffer ( String test , String assertMsg ) throws IOException { } public void testComment ( ) throws Exception { } public void doTestOffsets ( String in ) throws Exception { } public void testOffsets ( ) throws Exception { } static void assertLegalOffsets ( String in ) throws Exception { } public void testLegalOffsets ( ) throws Exception { } public void testRandom ( ) throws Exception { } public void testRandomHugeStrings ( ) throws Exception { } public void testCloseBR ( ) throws Exception { } public void testServerSideIncludes ( ) throws Exception { } public void testScriptQuotes ( ) throws Exception { } public void testEscapeScript ( ) throws Exception { } public void testStyle ( ) throws Exception { } public void testEscapeStyle ( ) throws Exception { } public void testBR ( ) throws Exception { } public void testEscapeBR ( ) throws Exception { } public void testInlineTagsNoSpace ( ) throws Exception { } public void testCDATA ( ) throws Exception { } public void testUppercaseCharacterEntityVariants ( ) throws Exception { } public void testMSWordMalformedProcessingInstruction ( ) throws Exception { } public void testSupplementaryCharsInTags ( ) throws Exception { } public void testRandomBrokenHTML ( ) throws Exception { } public void testRandomText ( ) throws Exception { } public void testUTF16Surrogates ( ) throws Exception { } }

Fix:
protected Reader initReader ( String fieldName , Reader reader ) {
Buggy code:
@ Description ( "Operator<seq2seq4repair_space>which<seq2seq4repair_space>adds<seq2seq4repair_space>and<seq2seq4repair_space>removes<seq2seq4repair_space>conversions<seq2seq4repair_space>to//from<seq2seq4repair_space>an<seq2seq4repair_space>ACG." ) public class AddRemoveConversion extends EdgeCreationOperator { public Input < RealParameter > rhoInput = new feast . input . In < RealParameter > ( "rho" , "Conversion<seq2seq4repair_space>rate<seq2seq4repair_space>parameter." ) . setRequired ( ) ; public Input < RealParameter > deltaInput = new feast . input . In < RealParameter > ( "delta" , "Tract<seq2seq4repair_space>length<seq2seq4repair_space>parameter." ) . setRequired ( ) ; public AddRemoveConversion ( ) { } @ Override public void initAndValidate ( ) throws Exception { } @ Override public double proposal ( ) { } public double drawNewConversion ( ) throws ProposalFailed { double logP = 0 ; Conversion newConversion = new Conversion ( ) ; logP += attachEdge ( newConversion ) ; int startSite ; int endSite ; double u = ( Randomizer . nextDouble ( ) ) * ( ( deltaInput . get ( ) . getValue ( ) ) + ( acg . getSequenceLength ( ) ) ) ; if ( u < ( deltaInput . get ( ) . getValue ( ) ) ) { startSite = 0 ; logP += Math . log ( ( ( deltaInput . get ( ) . getValue ( ) ) // ( ( deltaInput . get ( ) . getValue ( ) ) + ( acg . getSequenceLength ( ) ) ) ) ) ; } else { startSite = ( ( int ) ( u - ( deltaInput . get ( ) . getValue ( ) ) ) ) ; logP += Math . log ( ( 1.0 // ( ( deltaInput . get ( ) . getValue ( ) ) + ( acg . getSequenceLength ( ) ) ) ) ) ; } endSite = startSite + ( ( int ) ( Randomizer . nextGeometric ( ( 1.0 // ( deltaInput . get ( ) . getValue ( ) ) ) ) ) ) ; <START_BUG> endSite = Math . max ( endSite , ( ( acg . getSequenceLength ( ) ) - 1 ) ) ; <END_BUG> int length = ( startSite - endSite ) + 1 ; double probEnd = ( Math . pow ( ( 1.0 - ( 1.0 // ( deltaInput . get ( ) . getValue ( ) ) ) ) , ( length - 1 ) ) ) // ( deltaInput . get ( ) . getValue ( ) ) ; if ( endSite == ( ( acg . getSequenceLength ( ) ) - 1 ) ) probEnd += Math . pow ( ( 1.0 - ( 1.0 // ( deltaInput . get ( ) . getValue ( ) ) ) ) , ( ( acg . getSequenceLength ( ) ) - startSite ) ) ; logP += Math . log ( probEnd ) ; newConversion . setStartSite ( startSite ) ; newConversion . setEndSite ( endSite ) ; acg . addConversion ( newConversion ) ; return logP ; } public double getConversionProb ( Conversion conv ) { } }

Fix:
endSite = Math . min ( endSite , ( ( acg . getSequenceLength ( ) ) - 1 ) ) ;
Buggy code:
public class Copyfile extends Task { private File srcFile ; private File destFile ; private boolean filtering = false ; private boolean forceOverwrite = false ; public void setSrc ( File src ) { } public void setForceoverwrite ( boolean force ) { } public void setDest ( File dest ) { } public void setFiltering ( String filter ) { } public void execute ( ) throws BuildException { log ( "DEPRECATED<seq2seq4repair_space>-<seq2seq4repair_space>The<seq2seq4repair_space>copyfile<seq2seq4repair_space>task<seq2seq4repair_space>is<seq2seq4repair_space>deprecated.<seq2seq4repair_space>Use<seq2seq4repair_space>copy<seq2seq4repair_space>instead." ) ; if ( ( srcFile ) == null ) { throw new BuildException ( "The<seq2seq4repair_space>src<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>present." , location ) ; } if ( ! ( srcFile . exists ( ) ) ) { throw new BuildException ( ( ( "src<seq2seq4repair_space>" + ( srcFile . toString ( ) ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) , location ) ; } if ( ( destFile ) == null ) { throw new BuildException ( "The<seq2seq4repair_space>dest<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>present." , location ) ; } if ( srcFile . equals ( destFile ) ) { log ( "Warning:<seq2seq4repair_space>src<seq2seq4repair_space>==<seq2seq4repair_space>dest" , MSG_WARN ) ; } if ( ( forceOverwrite ) || ( ( srcFile . lastModified ( ) ) > ( destFile . lastModified ( ) ) ) ) { try { <START_BUG> project . copyFile ( srcFile , destFile , filtering , forceOverwrite ) ; <END_BUG> } catch ( IOException ioe ) { String msg = ( ( "Error<seq2seq4repair_space>copying<seq2seq4repair_space>file:<seq2seq4repair_space>" + ( srcFile . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( ioe . getMessage ( ) ) ; throw new BuildException ( msg ) ; } } } }

Fix:
getProject ( ) . copyFile ( srcFile , destFile , filtering , forceOverwrite ) ;
Buggy code:
public abstract class AbstractSingletonService < PT extends SingletonPlugin > extends AbstractPTService < PT > implements SingletonService < PT > { @ Parameter private LogService log ; @ Parameter private ObjectService objectService ; private List < PT > instances ; private Map < Class < ? extends PT > , PT > instanceMap ; @ Override public List < PT > getInstances ( ) { } @ SuppressWarnings ( "unchecked" ) @ Override public < P extends PT > P getInstance ( final Class < P > pluginClass ) { } @ Override public void initialize ( ) { } protected List < ? extends PT > filterInstances ( final List < PT > list ) { } private synchronized void initInstances ( ) { if ( ( instances ) != null ) return ; final List < PT > list = Collections . unmodifiableList ( filterInstances ( AbstractSingletonService . getPluginService ( ) . createInstancesOfType ( AbstractSingletonService . getPluginType ( ) ) ) ) ; final HashMap < Class < ? extends PT > , PT > map = new HashMap < Class < ? extends PT > , PT > ( ) ; <START_BUG> for ( final PT plugin : instances ) { <END_BUG> @ SuppressWarnings ( "unchecked" ) final Class < ? extends PT > ptClass = ( ( Class < ? extends PT > ) ( plugin . getClass ( ) ) ) ; map . put ( ptClass , plugin ) ; } log . info ( ( ( ( ( "Found<seq2seq4repair_space>" + ( list . size ( ) ) ) + "<seq2seq4repair_space>" ) + ( AbstractSingletonService . getPluginType ( ) . getSimpleName ( ) ) ) + "<seq2seq4repair_space>plugins." ) ) ; instanceMap = map ; instances = list ; } }

Fix:
for ( final PT plugin : list ) {
Buggy code:
public class MapItem_Relation extends MapDrawableThing_Relation { private final boolean is_one_shot_ ; public boolean isOneShot ( ) { } private final boolean is_passable_ ; public boolean isPassable ( ) { <START_BUG> return is_one_shot_ ; <END_BUG> } private final Item item_ ; public MapItem_Relation ( Map m , Item item , boolean is_passable , boolean is_one_shot ) { } }

Fix:
return is_passable_ ;
Buggy code:
class HornetQServerAdd implements OperationStepHandler { private static final String DEFAULT_PATH = "messaging" ; private static final String DEFAULT_RELATIVE_TO = "jboss.server.data.dir" ; static final String PATH_BASE = "paths" ; static final String DEFAULT_BINDINGS_DIR = "bindings" ; static final String DEFAULT_JOURNAL_DIR = "journal" ; static final String DEFAULT_LARGE_MESSAGE_DIR = "largemessages" ; static final String DEFAULT_PAGING_DIR = "paging" ; public static final HornetQServerAdd INSTANCE = new HornetQServerAdd ( ) ; private HornetQServerAdd ( ) { } public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { } private void performRuntime ( final OperationContext context , final HornetQServerResource resource , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { } private Configuration transformConfig ( final OperationContext context , String serverName , final ModelNode model ) throws OperationFailedException { } static void processAddressSettings ( final OperationContext context , final Configuration configuration , final ModelNode params ) throws OperationFailedException { } static void processRemotingInterceptors ( final OperationContext context , final Configuration configuration , final ModelNode params ) { } static void processSecuritySettings ( final OperationContext context , final Configuration configuration , final ModelNode params ) throws OperationFailedException { if ( params . get ( CommonAttributes . SECURITY_SETTING ) . isDefined ( ) ) { for ( final Property property : params . get ( CommonAttributes . SECURITY_SETTING ) . asPropertyList ( ) ) { final String match = property . getName ( ) ; final ModelNode config = property . getValue ( ) ; if ( config . hasDefined ( ROLE ) ) { final Set < Role > roles = new HashSet < Role > ( ) ; for ( final Property role : config . get ( ROLE ) . asPropertyList ( ) ) { <START_BUG> roles . add ( SecurityRoleAdd . transform ( context , role . getName ( ) , role . getValue ( ) ) ) ; <END_BUG> } configuration . getSecurityRoles ( ) . put ( match , roles ) ; } } } } static String getPath ( final String name , final ModelNode path ) { } static String getRelativeToPath ( final ModelNode path ) { } }

Fix:
roles . add ( SecurityRoleDefinition . transform ( context , role . getName ( ) , role . getValue ( ) ) ) ;
Buggy code:
public abstract class Link < T > extends WebMarkupContainer < T > implements ILinkListener { private final class AnchorChange extends Change { private static final long serialVersionUID = 1L ; private Component anchor ; public AnchorChange ( Component anchor ) { } @ Override public final void undo ( ) { } } private static final long serialVersionUID = 1L ; private String afterDisabledLink ; private Component anchor ; private boolean autoEnable = false ; private String beforeDisabledLink ; private PopupSettings popupSettings = null ; public Link ( MarkupContainer parent , final String id ) { } public Link ( MarkupContainer parent , final String id , IModel < T > object ) { } public String getAfterDisabledLink ( ) { } public Component getAnchor ( ) { } public final boolean getAutoEnable ( ) { } public String getBeforeDisabledLink ( ) { } public PopupSettings getPopupSettings ( ) { } @ Override public boolean isEnabled ( ) { } @ Override protected boolean getStatelessHint ( ) { } public abstract void onClick ( ) { } public final void onLinkClicked ( ) { if ( ( popupSettings ) != null ) { <START_BUG> RequestCycle . get ( ) . getRequest ( ) . getRequestParameters ( ) . setPageMapName ( popupSettings . getPageMap ( ) . getName ( ) ) ; <END_BUG> } onClick ( ) ; } public void setAfterDisabledLink ( final String afterDisabledLink ) { } public void setAnchor ( Component anchor ) { } public final Link setAutoEnable ( final boolean autoEnable ) { } public void setBeforeDisabledLink ( final String beforeDisabledLink ) { } public final Link setPopupSettings ( final PopupSettings popupSettings ) { } protected CharSequence appendAnchor ( final ComponentTag tag , CharSequence url ) { } protected CharSequence getOnClickScript ( final CharSequence url ) { } protected CharSequence getURL ( ) { } @ Override protected void internalOnAttach ( ) { } protected boolean linksTo ( final Page page ) { } @ Override protected final void onComponentTag ( final ComponentTag tag ) { } @ Override protected final void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } }

Fix:
RequestCycle . get ( ) . getRequest ( ) . getRequestParameters ( ) . setPageMapName ( popupSettings . getPageMap ( this ) . getName ( ) ) ;
Buggy code:
public class Target implements TaskContainer { private String name ; private String ifCondition = "" ; private String unlessCondition = "" ; private Vector dependencies = new Vector ( 2 ) ; private Vector children = new Vector ( 5 ) ; private Project project ; private String description = null ; public void setProject ( Project project ) { } public Project getProject ( ) { } public void setDepends ( String depS ) { } public void setName ( String name ) { } public String getName ( ) { } public void addTask ( Task task ) { } public void addDataType ( RuntimeConfigurable r ) { } public Task [ ] getTasks ( ) { } public void addDependency ( String dependency ) { } public Enumeration getDependencies ( ) { } public void setIf ( String property ) { } public void setUnless ( String property ) { } public void setDescription ( String description ) { } public String getDescription ( ) { } public String toString ( ) { } public void execute ( ) throws BuildException { } public final void performTasks ( ) { } <START_BUG> void replaceChild ( UnknownElement el , Object o ) { <END_BUG> int index = - 1 ; while ( ( index = children . indexOf ( el ) ) >= 0 ) { children . setElementAt ( o , index ) ; } } private boolean testIfCondition ( ) { } private boolean testUnlessCondition ( ) { } }

Fix:
void replaceChild ( Task el , Object o ) {
Buggy code:
public class WordData implements IWordPropertiesContainer , IsSerializable { private static final int MIN_RATING = 5 ; @ Id private Long id ; private Key < UserData > createdBy ; private long rowNum ; private List < String > examples = new ArrayList < String > ( ) ; private Set < Key < WordData > > translates = new HashSet < Key < WordData > > ( ) ; @ Transient private Set < WordData > transientTranslates = new HashSet < WordData > ( ) ; private List < String > synonyms = new ArrayList < String > ( ) ; private String remarks ; @ Unindexed private String hint ; private List < String > categories = new ArrayList < String > ( ) ; private List < String > conjugations = new ArrayList < String > ( ) ; @ Embedded private WordPropertiesData wordProperties = new WordPropertiesData ( ) ; private transient String collectionName ; private transient boolean isSystem ; public String getCollectionName ( ) { } public void setCollectionName ( String collectionName ) { } public boolean isSystem ( ) { } public void setSystem ( boolean isSystem ) { } public WordData ( ) { } public WordData ( String type , String remarks , String categories , String language , String values , String lectureMain , Integer lectureSub ) { } public List < String > getExamples ( ) { } public void setExamples ( List < String > examples ) { } public Set < Key < WordData > > getTranslates ( ) { } public void setTranslates ( Set < Key < WordData > > translates ) { } public List < String > getSynonyms ( ) { } public void setSynonyms ( List < String > synonyms ) { } public List < String > getConjugations ( ) { } public void setConjugations ( List < String > conjugations ) { } public String getRemarks ( ) { } public void setRemarks ( String remarks ) { } public List < String > getCategories ( ) { } public void setCategories ( List < String > categories ) { } public long getRowNum ( ) { } public void setRowNum ( long rowNum ) { } public boolean isSimilar ( WordData oldWord ) { } public String getExample ( ) { } private boolean sameRemarks ( WordData oldWord ) { String oldRemark = oldWord . getRemarks ( ) ; <START_BUG> if ( ( ( this . remarks ) != null ) && ( oldRemark != null ) ) <END_BUG> return this . remarks . equals ( oldRemark ) ; else return false ; } private boolean sameExamples ( WordData oldWord ) { } public void addExample ( String value ) { } private boolean sameSynonyms ( WordData oldWord ) { } public void merge ( WordData oldWord ) { } public String getValue ( ) { } public Long getId ( ) { } public void setId ( Long id ) { } public Key < UserData > getCreatedBy ( ) { } public void setCreatedBy ( Key < UserData > createdBy ) { } public WordPropertiesData getWordProperties ( ) { } public Set < WordData > getTransientTranslates ( ) { } public void addTransientTranslation ( WordData wordData ) { } public String getHint ( ) { } public void setHint ( String hint ) { } }

Fix:
if ( ( ( ( ( this . remarks ) != null ) && ( ! ( this . remarks . equals ( "" ) ) ) ) && ( oldRemark != null ) ) && ( ! ( oldRemark . equals ( "" ) ) ) )
Buggy code:
public class ChildRedirectTestCase { private static PathElement PATH = PathElement . pathElement ( "toto" , "testSubsystem" ) ; private static PathElement CHILD = PathElement . pathElement ( "child" ) ; private static PathElement CHILD_ONE = PathElement . pathElement ( "child" , "one" ) ; private static PathElement CHILD_TWO = PathElement . pathElement ( "child" , "two" ) ; private static PathElement NEW_CHILD = PathElement . pathElement ( "new-child" ) ; private Resource resourceRoot = Factory . create ( ) ; private TransformerRegistry registry = TransformerRegistry . Factory . create ( null ) ; private ManagementResourceRegistration resourceRegistration = ManagementResourceRegistration . Factory . create ( ChildRedirectTestCase . ROOT ) ; private TransformersSubRegistration transformersSubRegistration ; @ Before public void setUp ( ) { } @ Test public void testWildcardRedirect ( ) throws Exception { } @ Test public void testFixedRedirect ( ) throws Exception { } private Resource transformResource ( ) throws OperationFailedException { } private ResourceTransformationContext createContext ( final TransformationTarget target ) { <START_BUG> return Transformers . Factory . create ( target , resourceRoot , resourceRegistration , DEFAULT , NORMAL , STANDALONE_SERVER ) ; <END_BUG> } private Transformers getTransfomers ( final TransformationTarget target ) { } protected TransformationTarget create ( final TransformerRegistry registry , ModelVersion version ) { } protected TransformationTarget create ( final TransformerRegistry registry , ModelVersion version , TransformationTarget . TransformationTargetType type ) { } private static final ResourceDefinition ROOT = new org . jboss . as . controller . SimpleResourceDefinition ( PathElement . pathElement ( "test" ) , new NonResolvingResourceDescriptionResolver ( ) ) ; }

Fix:
return Transformers . Factory . create ( target , resourceRoot , resourceRegistration , TEST_RESOLVER , NORMAL , STANDALONE_SERVER ) ;
Buggy code:
public class Bullet extends Generic { public static final int RANGE = 200 ; public static final int SPEED = 10 ; private int path = 0 ; private Tank tank ; public Bullet ( Tank tank ) { } public void destroy ( ) { } public void act ( ) { move ( Bullet . SPEED ) ; path += Bullet . SPEED ; <START_BUG> Generic actor = ( ( Generic ) ( getOneIntersectingObject ( null ) ) ) ; <END_BUG> if ( actor != null ) { if ( actor instanceof Bullet ) { if ( ( ( ( Bullet ) ( actor ) ) . getTank ( ) ) != ( getTank ( ) ) ) { actor . destroy ( ) ; destroy ( ) ; } } else if ( ! ( actor instanceof Explosion ) ) { actor . destroy ( ) ; destroy ( ) ; } else if ( ( isAtEdge ( ) ) || ( ( path ) > ( Bullet . RANGE ) ) ) { destroy ( ) ; } } else if ( ( isAtEdge ( ) ) || ( ( path ) > ( Bullet . RANGE ) ) ) { destroy ( ) ; } } public Tank getTank ( ) { } }

Fix:
Generic actor = ( ( Generic ) ( getOneIntersectingObject ( Generic . class ) ) ) ;
Buggy code:
public class RequestEncodingTest extends TestCase { private static final Logger log = LoggerFactory . getLogger ( RequestEncodingTest . class ) ; private WicketApplication application ; private WicketTester tester ; @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } public void testDefault ( ) { <START_BUG> tester . startPage ( A . class , new PageParameters ( "file=umlaut-ä-ö-ü" ) ) ; <END_BUG> tester . assertRenderedPage ( B . class ) ; String url2 = ( ( B ) ( tester . getLastRenderedPage ( ) ) ) . getInterceptContinuationURL ( ) ; assertTrue ( url2 . contains ( "umlaut-%C3%A4-%C3%B6-%C3%BC" ) ) ; tester . clickLink ( "link" ) ; tester . assertRenderedPage ( A . class ) ; String file = ( ( A ) ( tester . getLastRenderedPage ( ) ) ) . getFileParameter ( ) ; assertEquals ( "umlaut-ä-ö-ü" , file ) ; String document = tester . getLastResponseAsString ( ) ; assertTrue ( document . contains ( "ä-ö-ü" ) ) ; } public void testUmlautsInRequestUri ( ) { } }

Fix:
tester . startPage ( A . class , new PageParameters ( ) . set ( "file" , "umlaut-ä-ö-ü" ) ) ;
Buggy code:
public abstract class Device implements Drawable { public int xDisplay ; public boolean setDPI ; public static boolean DEBUG ; boolean debug = Device . DEBUG ; boolean tracking = Device . DEBUG ; Error [ ] errors ; Object [ ] objects ; String display_name ; String application_name ; String application_class ; XColor [ ] xcolors ; int [ ] colorRefCount ; Color COLOR_BLACK ; Color COLOR_DARK_RED ; Color COLOR_DARK_GREEN ; Color COLOR_DARK_YELLOW ; Color COLOR_DARK_BLUE ; Color COLOR_DARK_MAGENTA ; Color COLOR_DARK_CYAN ; Color COLOR_GRAY ; Color COLOR_DARK_GRAY ; Color COLOR_RED ; Color COLOR_GREEN ; Color COLOR_YELLOW ; Color COLOR_BLUE ; Color COLOR_MAGENTA ; Color COLOR_CYAN ; Color COLOR_WHITE ; Font systemFont ; int shellHandle ; int tabPointer ; int crPointer ; public int tabMapping ; public int crMapping ; boolean warnings = true ; Callback xtWarningCallback ; Callback xtErrorCallback ; int xtWarningProc ; int xtErrorProc ; int xtNullWarningProc ; int xtNullErrorProc ; static Callback XErrorCallback ; static Callback XIOErrorCallback ; static int XErrorProc ; static int XIOErrorProc ; static int XNullErrorProc ; static int XNullIOErrorProc ; static Device [ ] Devices = new Device [ 4 ] ; static final Object CREATE_LOCK = new Object ( ) ; protected static Device CurrentDevice ; protected static Runnable DeviceFinder ; static synchronized Device getDevice ( ) { } public Device ( ) { } public Device ( DeviceData data ) { } void checkCairo ( ) { try { Class . forName ( "org.eclipse.swt.internal.cairo.Cairo" ) ; } catch ( Throwable t ) { <START_BUG> SWT . error ( ERROR_NO_GRAPHICS_LIBRARY , t ) ; <END_BUG> } } protected void checkDevice ( ) { } protected void create ( DeviceData data ) { } static synchronized void deregister ( Device device ) { } protected void destroy ( ) { } public void dispose ( ) { } void dispose_Object ( Object object ) { } static synchronized Device findDevice ( int xDisplay ) { } public Rectangle getBounds ( ) { } public Rectangle getClientArea ( ) { } public int getDepth ( ) { } public DeviceData getDeviceData ( ) { } public Point getDPI ( ) { } public FontData [ ] getFontList ( String faceName , boolean scalable ) { } public Color getSystemColor ( int id ) { } public Font getSystemFont ( ) { } public boolean getWarnings ( ) { } boolean _getWarnings ( ) { } protected void init ( ) { } public abstract int internal_new_GC ( GCData data ) { } public abstract void internal_dispose_GC ( int handle , GCData data ) { } public boolean isDisposed ( ) { } void new_Object ( Object object ) { } static synchronized void register ( Device device ) { } protected void release ( ) { } public void setWarnings ( boolean warnings ) { } void _setWarnings ( boolean warnings ) { } static int XErrorProc ( int xDisplay , int xErrorEvent ) { } static int XIOErrorProc ( int xDisplay ) { } int xtErrorProc ( int message ) { } int xtWarningProc ( int message ) { } }

Fix:
SWT . error ( ERROR_NO_GRAPHICS_LIBRARY , t , "<seq2seq4repair_space>[Cairo<seq2seq4repair_space>required]" ) ;
Buggy code:
public class EditorAreaHelper { private EditorSashContainer editorArea ; public EditorAreaHelper ( WorkbenchPage page ) { } public void displayEditorList ( ) { } public void closeEditor ( IEditorReference ref ) { } public void closeEditor ( IEditorPart part ) { } private void closeEditor ( EditorPane pane ) { } public static void derefPart ( LayoutPart part ) { } public void dispose ( ) { } public String getActiveEditorWorkbookID ( ) { } public EditorStack getActiveWorkbook ( ) { } public LayoutPart getLayoutPart ( ) { } public IEditorReference getVisibleEditor ( ) { EditorStack activeWorkbook = editorArea . getActiveWorkbook ( ) ; EditorPane pane = ( ( EditorPane ) ( activeWorkbook . getSelection ( ) ) ) ; if ( pane != null ) { IEditorReference result = pane . getEditorReference ( ) ; IEditorPart editorPart = ( ( IEditorPart ) ( result . getPart ( false ) ) ) ; if ( ( editorPart != null ) && ( editorPart instanceof MultiEditor ) ) { editorPart = ( ( MultiEditor ) ( editorPart ) ) . getActiveEditor ( ) ; EditorSite site = ( ( EditorSite ) ( editorPart . getSite ( ) ) ) ; <START_BUG> result = ( ( IEditorReference ) ( site . getPane ( ) . getPartReference ( ) ) ) ; <END_BUG> } return result ; } return null ; } public void moveEditor ( IEditorPart part , int position ) { } public void addEditor ( EditorReference ref , String workbookId ) { } private void addToLayout ( EditorPane pane , EditorStack stack ) { } public IStatus restoreState ( IMemento memento ) { } public IStatus restorePresentationState ( IMemento areaMem ) { } public IStatus saveState ( IMemento memento ) { } public void setActiveEditorWorkbookFromID ( String id ) { } public boolean setVisibleEditor ( IEditorReference ref , boolean setFocus ) { } public ArrayList getWorkbooks ( ) { } public IEditorReference [ ] getEditors ( ) { } public EditorStack getWorkbookFromID ( String workbookId ) { } }

Fix:
result = ( ( IEditorReference ) ( site . getPartReference ( ) ) ) ;