nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Receiver implements Runnable { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private boolean active ; private final QueueSession session ; private final QueueReceiver consumer ; private final QueueConnection conn ; private Receiver ( QueueConnectionFactory factory , Queue receiveQueue , String principal , String credentials ) throws JMSException { } public static Receiver createReceiver ( QueueConnectionFactory factory , Queue receiveQueue , String principal , String credentials ) throws JMSException { } public void run ( ) { activate ( ) ; Message reply ; while ( isActive ( ) ) { reply = null ; try { reply = consumer . receive ( 5000 ) ; if ( reply != null ) { if ( Receiver . log . isDebugEnabled ( ) ) { Receiver . log . debug ( ( "Received<seq2seq4repair_space>message,<seq2seq4repair_space>correlation<seq2seq4repair_space>id:" + ( reply . getJMSCorrelationID ( ) ) ) ) ; } if ( ( reply . getJMSCorrelationID ( ) ) == null ) { Receiver . log . warn ( "Received<seq2seq4repair_space>message<seq2seq4repair_space>with<seq2seq4repair_space>correlation<seq2seq4repair_space>id<seq2seq4repair_space>null.<seq2seq4repair_space>Discarding<seq2seq4repair_space>message<seq2seq4repair_space>..." ) ; } else { <START_BUG> MessageAdmin . getAdmin ( ) . putReply ( reply . getJMSMessageID ( ) , reply ) ; <END_BUG> } } } catch ( JMSException e1 ) { Receiver . log . error ( "Error<seq2seq4repair_space>handling<seq2seq4repair_space>receive" , e1 ) ; } } if ( ( consumer ) != null ) { try { consumer . close ( ) ; } catch ( JMSException e ) { Receiver . log . error ( "Error<seq2seq4repair_space>closing<seq2seq4repair_space>connection" , e ) ; } } try { session . close ( ) ; } catch ( JMSException e ) { Receiver . log . error ( "Error<seq2seq4repair_space>closing<seq2seq4repair_space>session" , e ) ; } try { conn . close ( ) ; } catch ( JMSException e ) { Receiver . log . error ( "Error<seq2seq4repair_space>closing<seq2seq4repair_space>connection" , e ) ; } } public synchronized void activate ( ) { } public synchronized void deactivate ( ) { } private synchronized boolean isActive ( ) { } }

Fix:
MessageAdmin . getAdmin ( ) . putReply ( reply . getJMSCorrelationID ( ) , reply ) ;
Buggy code:
public class IntLiteral extends NumberLiteral { public int value ; public static final IntLiteral One = new IntLiteral ( new char [ ] { '1' } , 0 , 0 , 1 ) ; static final Constant FORMAT_ERROR = new DoubleConstant ( ( 1.0 // 0.0 ) ) ; public IntLiteral ( char [ ] token , int s , int e ) { } public IntLiteral ( char [ ] token , int s , int e , int value ) { } public IntLiteral ( int intValue ) { } public void computeConstant ( ) { long MAX = Integer . MAX_VALUE ; if ( ( this ) == ( IntLiteral . One ) ) { constant = One ; return ; } int length = source . length ; long computedValue = 0L ; if ( ( source [ 0 ] ) == '0' ) { MAX = 4294967295L ; if ( length == 1 ) { constant = Constant . fromValue ( 0 ) ; return ; } final int shift ; final int radix ; int j ; <START_BUG> if ( ( ( source [ 1 ] ) == 'x' ) | ( ( source [ 1 ] ) == 'X' ) ) { <END_BUG> shift = 4 ; j = 2 ; radix = 16 ; } else { shift = 3 ; j = 1 ; radix = 8 ; } while ( ( source [ j ] ) == '0' ) { j ++ ; if ( j == length ) { constant = Constant . fromValue ( ( value = ( ( int ) ( computedValue ) ) ) ) ; return ; } } while ( j < length ) { int digitValue ; if ( ( digitValue = Character . digit ( source [ ( j ++ ) ] , radix ) ) < 0 ) { constant = IntLiteral . FORMAT_ERROR ; return ; } computedValue = ( computedValue << shift ) | digitValue ; if ( computedValue > MAX ) return ; } } else { for ( int i = 0 ; i < length ; i ++ ) { int digitValue ; if ( ( digitValue = Character . digit ( source [ i ] , 10 ) ) < 0 ) { constant = IntLiteral . FORMAT_ERROR ; return ; } computedValue = ( 10 * computedValue ) + digitValue ; if ( computedValue > MAX ) return ; } } constant = Constant . fromValue ( ( value = ( ( int ) ( computedValue ) ) ) ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding literalType ( BlockScope scope ) { } public final boolean mayRepresentMIN_VALUE ( ) { } public TypeBinding resolveType ( BlockScope scope ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ( ( source [ 1 ] ) == 'x' ) || ( ( source [ 1 ] ) == 'X' ) ) {
Buggy code:
public class PageLink extends Link { private static final long serialVersionUID = 8530958543148278216L ; private final IPageLink pageLink ; public PageLink ( final String id , final Class c ) { } public PageLink ( final String id , final IPageLink pageLink ) { } public boolean linksTo ( final Page page ) { } public void onClick ( ) { <START_BUG> getRequestCycle ( ) . setResponsePage ( pageLink . getPage ( ) ) ; <END_BUG> } }

Fix:
setResponsePage ( pageLink . getPage ( ) ) ;
Buggy code:
public class JdrZipFile { ZipOutputStream zos ; String jbossHome ; JdrEnvironment env ; String name ; String baseName ; public JdrZipFile ( JdrEnvironment env ) throws Exception { } public String name ( ) { } public void add ( InputStream is , String path ) { } public void add ( VirtualFile file , InputStream is ) throws Exception { <START_BUG> String name = "JBOSS_HOME" + ( file . getPhysicalFile ( ) . getAbsolutePath ( ) . substring ( this . jbossHome . length ( ) ) ) ; <END_BUG> this . add ( is , name ) ; } public void add ( String content , String path ) throws Exception { } public void addLog ( String content , String logName ) throws Exception { } public void close ( ) throws Exception { } }

Fix:
String name = "JBOSS_HOME" + ( file . getPathName ( ) . substring ( this . jbossHome . length ( ) ) ) ;
Buggy code:
public class ThrowStatement extends Statement { private Expression expression = null ; ThrowStatement ( AST ast ) { } public int getNodeType ( ) { } ASTNode clone ( AST target ) { ThrowStatement result = new ThrowStatement ( target ) ; result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <START_BUG> result . setLeadingComment ( getLeadingComment ( ) ) ; <END_BUG> result . setExpression ( ( ( Expression ) ( getExpression ( ) . clone ( target ) ) ) ) ; return result ; } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { } public void setExpression ( Expression expression ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . copyLeadingComment ( this ) ;
Buggy code:
public class ATLTransformation { private ATLResources atlResources ; public ATLTransformation ( ATLResources atlResources ) { } public void executeTransformation ( PapilioDiagram diagram , IProgressMonitor progressMonitor , Model model , IJavaProject javaProject ) throws IOException , CoreException , ATLCoreException { String workingModelPath = serializeModel ( model , javaProject , diagram ) ; IInjector injector = null ; IExtractor extractor = null ; try { injector = CoreService . getInjector ( "EMF" ) ; extractor = CoreService . getExtractor ( "EMF" ) ; } catch ( ATLCoreException e ) { e . printStackTrace ( ) ; } ModelFactory factory = CoreService . getModelFactory ( "EMF" ) ; IReferenceModel umlMetamodel = factory . newReferenceModel ( ) ; IReferenceModel javaMetamodel = factory . newReferenceModel ( ) ; injector . inject ( umlMetamodel , atlResources . getUMLMetamodelPath ( ) ) ; <START_BUG> injector . inject ( umlMetamodel , atlResources . getJavaMetamodelPath ( ) ) ; <END_BUG> ILauncher launcher = null ; launcher = CoreService . getLauncher ( "EMF-specific<seq2seq4repair_space>VM" ) ; launcher . initialize ( Collections . < String , Object > emptyMap ( ) ) ; IModel javaModel = factory . newModel ( javaMetamodel ) ; IModel umlModel = factory . newModel ( umlMetamodel ) ; injector . inject ( javaModel , workingModelPath ) ; launcher . addOutModel ( umlModel , "OUT" , "UML" ) ; launcher . addInModel ( javaModel , "IN" , "java" ) ; launcher . launch ( RUN_MODE , progressMonitor , Collections . < String , Object > emptyMap ( ) , atlResources . getClassDiagramTransformationURL ( ) . openStream ( ) ) ; IProject project = javaProject . getProject ( ) ; IPath projectPath = project . getFullPath ( ) ; String modelName = ( ( ( model . getName ( ) ) + "_" ) + ( diagram . getName ( ) ) ) + ".uml" ; projectPath = projectPath . append ( "javamodel" ) ; projectPath = projectPath . append ( modelName ) ; extractor . extract ( umlModel , projectPath . toString ( ) ) ; project . refreshLocal ( IProject . DEPTH_INFINITE , null ) ; } public String serializeModel ( Model model , IJavaProject javaProject , PapilioDiagram diagram ) { } }

Fix:
injector . inject ( javaMetamodel , atlResources . getJavaMetamodelPath ( ) ) ;
Buggy code:
public class JsonSerializer implements ISerializer { private DataOutputStream processIn ; private BufferedReader processOut ; public void initialize ( OutputStream processIn , InputStream processOut ) { } public Number connect ( Map conf , TopologyContext context ) throws NoOutputException , IOException { } public void writeBoltMsg ( BoltMsg boltMsg ) throws IOException { } public void writeSpoutMsg ( SpoutMsg msg ) throws IOException { } public void writeTaskIds ( List < Integer > taskIds ) throws IOException { } private void writeMessage ( Object msg ) throws IOException { } private void writeString ( String str ) throws IOException { } public ShellMsg readShellMsg ( ) throws NoOutputException , IOException { JSONObject msg = ( ( JSONObject ) ( readMessage ( ) ) ) ; ShellMsg shellMsg = new ShellMsg ( ) ; String command = ( ( String ) ( msg . get ( "command" ) ) ) ; shellMsg . setCommand ( command ) ; <START_BUG> String id = ( ( String ) ( msg . get ( "id" ) ) ) ; <END_BUG> shellMsg . setId ( id ) ; String log = ( ( String ) ( msg . get ( "msg" ) ) ) ; shellMsg . setMsg ( log ) ; String stream = ( ( String ) ( msg . get ( "stream" ) ) ) ; if ( stream == null ) stream = Utils . DEFAULT_STREAM_ID ; shellMsg . setStream ( stream ) ; Object taskObj = msg . get ( "task" ) ; if ( taskObj != null ) { shellMsg . setTask ( ( ( Long ) ( taskObj ) ) ) ; } else { shellMsg . setTask ( 0 ) ; } Object need_task_ids = msg . get ( "need_task_ids" ) ; if ( ( need_task_ids == null ) || ( ( ( Boolean ) ( need_task_ids ) ) . booleanValue ( ) ) ) { shellMsg . setNeedTaskIds ( true ) ; } else { shellMsg . setNeedTaskIds ( false ) ; } shellMsg . setTuple ( ( ( List ) ( msg . get ( "tuple" ) ) ) ) ; List < Tuple > anchors = new ArrayList < Tuple > ( ) ; Object anchorObj = msg . get ( "anchors" ) ; if ( anchorObj != null ) { if ( anchorObj instanceof String ) { anchorObj = Arrays . asList ( anchorObj ) ; } for ( Object o : ( ( List ) ( anchorObj ) ) ) { shellMsg . addAnchor ( ( ( String ) ( o ) ) ) ; } } return shellMsg ; } private Object readMessage ( ) throws NoOutputException , IOException { } private String readString ( ) throws NoOutputException , IOException { } }

Fix:
Object id = msg . get ( "id" ) ;
Buggy code:
public class BinaryMemtable implements IFlushable { private static final Logger logger = LoggerFactory . getLogger ( BinaryMemtable . class ) ; private final int threshold = ( ( DatabaseDescriptor . getBMTThreshold ( ) ) * 1024 ) * 1024 ; private final AtomicInteger currentSize = new AtomicInteger ( 0 ) ; private boolean isFrozen = false ; private final Map < DecoratedKey , byte [ ] > columnFamilies = new org . cliffc . high_scale_lib . NonBlockingHashMap < DecoratedKey , byte [ ] > ( ) ; private final Lock lock = new ReentrantLock ( ) ; Condition condition ; private final IPartitioner partitioner = StorageService . getPartitioner ( ) ; private final ColumnFamilyStore cfs ; public BinaryMemtable ( ColumnFamilyStore cfs ) { } boolean isThresholdViolated ( ) { } void put ( DecoratedKey key , byte [ ] buffer ) { } public boolean isClean ( ) { } private void resolve ( DecoratedKey key , byte [ ] buffer ) { } private List < DecoratedKey > getSortedKeys ( ) { } private SSTableReader writeSortedContents ( List < DecoratedKey > sortedKeys ) throws IOException { BinaryMemtable . logger . info ( ( "Writing<seq2seq4repair_space>" + ( this ) ) ) ; String path = cfs . getFlushPath ( ) ; <START_BUG> SSTableWriter writer = new SSTableWriter ( path , sortedKeys . size ( ) , StorageService . getPartitioner ( ) ) ; <END_BUG> for ( DecoratedKey key : sortedKeys ) { byte [ ] bytes = columnFamilies . get ( key ) ; assert ( bytes . length ) > 0 ; writer . append ( key , bytes ) ; } SSTableReader sstable = writer . closeAndOpenReader ( ) ; BinaryMemtable . logger . info ( ( "Completed<seq2seq4repair_space>flushing<seq2seq4repair_space>" + ( writer . getFilename ( ) ) ) ) ; return sstable ; } public void flushAndSignal ( final CountDownLatch latch , ExecutorService sorter , final ExecutorService writer ) { } }

Fix:
SSTableWriter writer = new SSTableWriter ( path , sortedKeys . size ( ) , cfs . metadata , cfs . partitioner_ ) ;
Buggy code:
public class ModelUtilities { private static TreeMap < String , Integer > renameMap = new TreeMap < String , Integer > ( ) ; private static TreeMap < Integer , String > invRenameMap = new TreeMap < Integer , String > ( ) ; private static TreeMap < String , Integer > wordWeight = new TreeMap < String , Integer > ( ) ; public static void addWordWeight ( TreeMap < String , Integer > w ) { } public static int rename ( String token ) { } public static String sieveString ( String s ) { } public static String [ ] ignoreToken = new String [ ] { "the" , "are" , "is" , "i" , "it" , "he" , "she" , "-" , "a" , "an" } ; public static boolean sieveToken ( String s ) { } public static ArrayList < nGram > transformNgram ( String s , int n ) { } public static double [ ] getCharacteristicVector ( String s , int n , ArrayList < nGram > vec ) { } public static double [ ] getCharacteristicWeightVector ( String s , int n , ArrayList < nGram > vec ) { } public static String getWordName ( int id ) { } public static int scoreNgram ( nGram e ) { } public static void printTable ( String tableName , int [ ] [ ] table ) { System . out . printf ( "Table<seq2seq4repair_space>`%s`\n\n" , tableName ) ; System . out . printf ( "|%16s|%15s|%15s|\n" , "Truth\\Classifier" , "Classifier<seq2seq4repair_space>no" , "Classifier<seq2seq4repair_space>yes" ) ; System . out . printf ( "|%16s|%15s|%15s|\n" , "----------------" , "---------------" , "---------------" ) ; System . out . printf ( "|%16s|%15d|%15d|\n" , "Truth<seq2seq4repair_space>no" , table [ 0 ] [ 0 ] , table [ 0 ] [ 1 ] ) ; System . out . printf ( "|%16s|%15d|%15d|\n" , "Truth<seq2seq4repair_space>yes" , table [ 1 ] [ 0 ] , table [ 1 ] [ 1 ] ) ; double P ; double R ; double F1 ; double beta = 1 ; P = ( ( double ) ( table [ 1 ] [ 1 ] ) ) // ( ( table [ 1 ] [ 0 ] ) + ( table [ 1 ] [ 1 ] ) ) ; R = ( ( double ) ( table [ 1 ] [ 1 ] ) ) // ( ( table [ 0 ] [ 1 ] ) + ( table [ 1 ] [ 1 ] ) ) ; F1 = ( ( ( ( beta * beta ) + 1 ) * P ) * R ) // ( ( ( beta * beta ) * P ) + R ) ; <START_BUG> System . out . printf ( "\nP<seq2seq4repair_space>%f<seq2seq4repair_space>%%,<seq2seq4repair_space>R<seq2seq4repair_space>%f<seq2seq4repair_space>%%,<seq2seq4repair_space>F1<seq2seq4repair_space>%f<seq2seq4repair_space>%%\n" , P , R , F1 ) ; <END_BUG> System . out . println ( ) ; } public static ArrayList < nGram > mergePick ( ArrayList < nGram > a , ArrayList < nGram > b , int n ) { } }

Fix:
System . out . printf ( "\nP<seq2seq4repair_space>%f<seq2seq4repair_space>%%,<seq2seq4repair_space>R<seq2seq4repair_space>%f<seq2seq4repair_space>%%,<seq2seq4repair_space>F1<seq2seq4repair_space>%f<seq2seq4repair_space>%%\n" , ( P * 100 ) , ( R * 100 ) , ( F1 * 100 ) ) ;
Buggy code:
public class ReduceDocsWithSameSourceId extends Reducer < Writable , BytesWritable , Text , BytesWritable > { @ Override protected void reduce ( Writable key , Iterable < BytesWritable > values , Context context ) throws IOException , InterruptedException { ArrayList < String > docIds = new ArrayList < String > ( ) ; HashSet < String > issns = new HashSet < String > ( ) ; HashSet < String > isbns = new HashSet < String > ( ) ; HashSet < String > titles = new HashSet < String > ( ) ; for ( BytesWritable value : values ) { DocumentProtos . DocumentWrapper docWrapper = DocumentWrapper . parseFrom ( value . copyBytes ( ) ) ; docIds . add ( docWrapper . getRowId ( ) ) ; String issn = null ; String isbn = null ; if ( ( docWrapper . hasDocumentMetadata ( ) ) && ( docWrapper . getDocumentMetadata ( ) . hasBasicMetadata ( ) ) ) { DocumentProtos . BasicMetadataOrBuilder bm = docWrapper . getDocumentMetadata ( ) . getBasicMetadataOrBuilder ( ) ; if ( bm . hasIssn ( ) ) { issn = bm . getIssn ( ) ; } if ( bm . hasIsbn ( ) ) { isbn = bm . getIsbn ( ) ; } if ( StringUtils . isNotBlank ( isbn ) ) { isbn = isbn . trim ( ) . toUpperCase ( ) ; isbns . add ( isbn ) ; } if ( StringUtils . isNotBlank ( issn ) ) { issn = issn . trim ( ) . toUpperCase ( ) ; issns . add ( issn ) ; } if ( bm . hasJournal ( ) ) { String title = bm . getJournal ( ) . trim ( ) ; if ( StringUtils . isNotBlank ( title ) ) { titles . add ( title ) ; } } } } String issn = null ; String isbn = null ; ArrayList < String > titleA = new ArrayList < String > ( titles ) ; Collections . sort ( titleA , new Comparator < String > ( ) { @ Override public int compare ( String o1 , String o2 ) { return ( o2 . length ( ) ) - ( o1 . length ( ) ) ; } } ) ; if ( ( issns . size ( ) ) > 0 ) { issn = issns . iterator ( ) . next ( ) ; } if ( ( isbns . size ( ) ) > 0 ) { <START_BUG> isbn = issns . iterator ( ) . next ( ) ; <END_BUG> } String id = "http:////comac.ceon.pl//source-" ; if ( issn != null ) { id += "issn-" + issn ; if ( isbn != null ) { id += "-" ; } } if ( isbn != null ) { id += "isbn-" + isbn ; } for ( String docId : docIds ) { ParentModelProtos . ParentDisambiguationOut . Builder parent = ParentModelProtos . ParentDisambiguationOut . newBuilder ( ) ; parent . setDocId ( docId ) ; parent . setParentId ( id ) ; parent . addAllParentName ( titles ) ; context . write ( new Text ( docId ) , new BytesWritable ( parent . build ( ) . toByteArray ( ) ) ) ; } } }

Fix:
isbn = isbns . iterator ( ) . next ( ) ;
Buggy code:
public class TestIndexWriterMerging extends LuceneTestCase { public void testLucene ( ) throws IOException { } private boolean verifyIndex ( Directory directory , int startAt ) throws IOException { boolean fail = false ; <START_BUG> IndexReader reader = IndexReader . open ( directory ) ; <END_BUG> int max = reader . maxDoc ( ) ; for ( int i = 0 ; i < max ; i ++ ) { Document temp = reader . document ( i ) ; if ( ! ( temp . getField ( "count" ) . stringValue ( ) . equals ( ( ( i + startAt ) + "" ) ) ) ) { fail = true ; System . out . println ( ( ( ( "Document<seq2seq4repair_space>" + ( i + startAt ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>returning<seq2seq4repair_space>document<seq2seq4repair_space>" ) + ( temp . getField ( "count" ) . stringValue ( ) ) ) ) ; } } reader . close ( ) ; return fail ; } private void fillIndex ( Directory dir , int start , int numDocs ) throws IOException { } }

Fix:
IndexReader reader = IndexReader . open ( directory , true ) ;
Buggy code:
public class Base32Test extends TestCase { private static final String [ ] [ ] BASE32_TEST_CASES = new String [ ] [ ] { new String [ ] { "" , "" } , new String [ ] { "f" , "MY======" } , new String [ ] { "fo" , "MZXQ====" } , new String [ ] { "foo" , "MZXW6===" } , new String [ ] { "foob" , "MZXW6YQ=" } , new String [ ] { "fooba" , "MZXW6YTB" } , new String [ ] { "foobar" , "MZXW6YTBOI======" } } ; private static final String [ ] [ ] BASE32HEX_TEST_CASES = new String [ ] [ ] { new String [ ] { "" , "" } , new String [ ] { "f" , "CO======" } , new String [ ] { "fo" , "CPNG====" } , new String [ ] { "foo" , "CPNMU===" } , new String [ ] { "foob" , "CPNMUOG=" } , new String [ ] { "fooba" , "CPNMUOJ1" } , new String [ ] { "foobar" , "CPNMUOJ1E8======" } } ; private static final String [ ] [ ] BASE32_TEST_CASES_CHUNKED = new String [ ] [ ] { new String [ ] { "" , "" } , new String [ ] { "f" , "MY======\r\n" } , new String [ ] { "fo" , "MZXQ====\r\n" } , new String [ ] { "foo" , "MZXW6===\r\n" } , new String [ ] { "foob" , "MZXW6YQ=\r\n" } , new String [ ] { "fooba" , "MZXW6YTB\r\n" } , new String [ ] { "foobar" , "MZXW6YTBOI======\r\n" } } ; public void testBase32Samples ( ) throws Exception { } public void testBase32HexSamples ( ) throws Exception { } public void testBase32Chunked ( ) throws Exception { } public void testSingleCharEncoding ( ) { for ( int i = 0 ; i < 20 ; i ++ ) { Base32 codec = new Base32 ( ) ; byte [ ] unencoded = new byte [ i ] ; byte [ ] allInOne = codec . encode ( unencoded ) ; codec = new Base32 ( ) ; for ( int j = 0 ; j < ( unencoded . length ) ; j ++ ) { codec . encode ( unencoded , j , 1 ) ; } codec . encode ( unencoded , 0 , ( - 1 ) ) ; byte [ ] singly = new byte [ allInOne . length ] ; <START_BUG> int bytes = codec . readResults ( singly , 0 , 100 ) ; <END_BUG> if ( ! ( Arrays . equals ( allInOne , singly ) ) ) { fail ( ) ; } } } public void testRandomBytes ( ) { } public void testRandomBytesChunked ( ) { } public void testRandomBytesHex ( ) { } }

Fix:
codec . readResults ( singly , 0 , 100 ) ;
Buggy code:
public class VisibleRecipientChip extends ImageSpan implements DrawableRecipientChip { private final SimpleRecipientChip mDelegate ; private int initialDescent = 0 ; private int extraSpace = 0 ; public VisibleRecipientChip ( final Drawable drawable , final RecipientEntry entry ) { } public VisibleRecipientChip ( final Drawable drawable , final RecipientEntry entry , final int verticalAlignment ) { } @ Override public void setSelected ( final boolean selected ) { } @ Override public boolean isSelected ( ) { } @ Override public CharSequence getDisplay ( ) { } @ Override public CharSequence getValue ( ) { } @ Override public long getContactId ( ) { } @ Override public Long getDirectoryId ( ) { } @ Override public String getLookupKey ( ) { } @ Override public long getDataId ( ) { } @ Override public RecipientEntry getEntry ( ) { } @ Override public void setOriginalText ( final String text ) { } @ Override public CharSequence getOriginalText ( ) { } @ Override public Rect getBounds ( ) { } @ Override public void draw ( final Canvas canvas ) { } @ Override public String toString ( ) { } @ Override public int getSize ( Paint paint , CharSequence text , int start , int end , Paint . FontMetricsInt fm ) { Drawable d = getCachedDrawable ( ) ; Rect rect = d . getBounds ( ) ; if ( fm != null ) { <START_BUG> if ( ( ( rect . bottom ) - ( ( fm . descent ) - ( fm . ascent ) ) ) > 0 ) { <END_BUG> initialDescent = fm . descent ; extraSpace = ( rect . bottom ) - ( ( fm . descent ) - ( fm . ascent ) ) ; } fm . descent = ( ( extraSpace ) // 2 ) + ( initialDescent ) ; fm . bottom = fm . descent ; fm . ascent = ( - ( rect . bottom ) ) + ( fm . descent ) ; fm . top = fm . ascent ; } return rect . right ; } private Drawable getCachedDrawable ( ) { } private WeakReference < Drawable > mDrawableRef ; }

Fix:
if ( ( ( rect . bottom ) - ( ( fm . descent ) - ( fm . ascent ) ) ) >= 0 ) {
Buggy code:
public abstract class VariableDeclaration extends ASTNode { VariableDeclaration ( AST ast ) { } public abstract SimpleName getName ( ) { } public abstract void setName ( SimpleName variableName ) { } public abstract int getExtraDimensions ( ) { } public abstract void setExtraDimensions ( int dimensions ) { } public abstract Expression getInitializer ( ) { } public abstract void setInitializer ( Expression initializer ) { } public IVariableBinding resolveBinding ( ) { <START_BUG> return getAST ( ) . getBindingResolver ( ) . resolveVariable ( this ) ; <END_BUG> } }

Fix:
return this . ast . getBindingResolver ( ) . resolveVariable ( this ) ;
Buggy code:
public class RedirectView extends AbstractUrlBasedView { private boolean contextRelative = false ; private boolean http10Compatible = true ; private boolean exposeModelAttributes = true ; private String encodingScheme ; private HttpStatus statusCode ; public RedirectView ( ) { } public RedirectView ( String url ) { } public RedirectView ( String url , boolean contextRelative ) { } public RedirectView ( String url , boolean contextRelative , boolean http10Compatible ) { } public RedirectView ( String url , boolean contextRelative , boolean http10Compatible , boolean exposeModelAttributes ) { } public void setContextRelative ( boolean contextRelative ) { } public void setHttp10Compatible ( boolean http10Compatible ) { } public void setExposeModelAttributes ( final boolean exposeModelAttributes ) { } public void setEncodingScheme ( String encodingScheme ) { } public void setStatusCode ( HttpStatus statusCode ) { } @ Override protected void renderMergedOutputModel ( Map < String , Object > model , HttpServletRequest request , HttpServletResponse response ) throws IOException { String encoding = getEncoding ( request ) ; StringBuilder targetUrl = new StringBuilder ( ) ; if ( ( this . contextRelative ) && ( getUrl ( ) . startsWith ( "//" ) ) ) { targetUrl . append ( UriUtils . encodePath ( request . getContextPath ( ) , encoding ) ) ; <START_BUG> targetUrl . append ( UriUtils . encodePath ( getUrl ( ) , encoding ) ) ; <END_BUG> } else { targetUrl . append ( UriUtils . encodeUri ( getUrl ( ) , encoding ) ) ; } if ( this . exposeModelAttributes ) { appendQueryProperties ( targetUrl , model , encoding ) ; } sendRedirect ( request , response , targetUrl . toString ( ) , this . http10Compatible ) ; } private String getEncoding ( HttpServletRequest request ) { } protected void appendQueryProperties ( StringBuilder targetUrl , Map < String , Object > model , String encodingScheme ) throws UnsupportedEncodingException { } protected Map < String , Object > queryProperties ( Map < String , Object > model ) { } protected boolean isEligibleProperty ( String key , Object value ) { } protected boolean isEligibleValue ( Object value ) { } protected void sendRedirect ( HttpServletRequest request , HttpServletResponse response , String targetUrl , boolean http10Compatible ) throws IOException { } protected HttpStatus getHttp11StatusCode ( HttpServletRequest request , HttpServletResponse response , String targetUrl ) { } }

Fix:
targetUrl . append ( UriUtils . encodeUri ( getUrl ( ) , encoding ) ) ;
Buggy code:
public class DatagramReceiveTester { public static void main ( String [ ] args ) { try { DatagramSocket ds = new DatagramSocket ( 54321 ) ; <START_BUG> DatagramPacket dg = new dg ( new byte [ 512 ] , 512 ) ; <END_BUG> DatagramPacket [ ] dgArray = new DatagramPacket [ 10 ] ; int i = 0 ; while ( i < 10 ) { ds . receive ( dg ) ; System . out . println ( ( dg + "<seq2seq4repair_space>we<seq2seq4repair_space>received<seq2seq4repair_space>a<seq2seq4repair_space>packet<seq2seq4repair_space>a<seq2seq4repair_space>packet" ) ) ; dgArray [ i ] = dg ; i ++ ; } for ( i = 0 ; i < ( dgArray . length ) ; i ++ ) { for ( int j = 0 ; j < ( dgArray [ i ] . getData ( ) . length ) ; j ++ ) { System . out . print ( dgArray [ i ] . getData ( ) [ j ] ) ; } System . out . println ( ) ; } } catch ( SocketException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } }

Fix:
DatagramPacket dg = new DatagramPacket ( new byte [ 512 ] , 512 ) ;
Buggy code:
public class generateDistributionRange { private static final String EMPTY_STRING = "" ; private static final String NULL_STRING = null ; private static final Exception NULL_EXCEPTION = null ; private static final int DEFAULT_LENGTH = 1 ; private static final String DEFAULT_GRID_COUNT = "1" ; public static void main ( String ... parameterList ) { } public static final Stack < BigInteger [ ] > generateDistributionRange ( String dictionary , int length , String gridCount , String separator ) throws Exception { String [ ] dictionaryList = dictionary . split ( separator ) ; int dictionaryListLength = dictionaryList . length ; String endingSequence = new String ( new char [ length ] ) . replace ( "" , dictionaryList [ ( dictionaryListLength - 1 ) ] ) ; BigInteger totalSequenceCount = convertToSequenceIndex . convertToSequenceIndex ( endingSequence , dictionary , separator ) ; BigInteger gridFactor = new BigInteger ( gridCount ) ; BigInteger allowableRoot = nthRoot . nthRoot ( totalSequenceCount . toString ( ) , gridFactor . toString ( ) , "4" , 2 ) . toBigInteger ( ) ; if ( ( allowableRoot . compareTo ( BigInteger . ONE ) ) == 0 ) { Exception exception = new Exception ( "Grid<seq2seq4repair_space>is<seq2seq4repair_space>too<seq2seq4repair_space>big<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>generated<seq2seq4repair_space>paritition." ) ; throw exception ; } BigInteger partitionSize = new BigDecimal ( totalSequenceCount ) . divide ( new BigDecimal ( gridFactor ) , 0 , RoundingMode . FLOOR ) . toBigInteger ( ) ; <START_BUG> BigInteger allowableIndex = convertToSequenceIndex . convertToSequenceIndex ( "zzzzz" , dictionary , separator ) ; <END_BUG> BigInteger newGridFactor = gridFactor ; BigInteger newPartitionSize = partitionSize ; if ( ( partitionSize . compareTo ( allowableIndex ) ) > 0 ) { while ( ( partitionSize . compareTo ( allowableIndex ) ) > 0 ) { newGridFactor = newGridFactor . add ( gridFactor ) ; newPartitionSize = new BigDecimal ( totalSequenceCount ) . divide ( new BigDecimal ( newGridFactor ) , 0 , RoundingMode . FLOOR ) . toBigInteger ( ) ; gridFactor = newGridFactor ; partitionSize = newPartitionSize ; } } Stack < BigInteger [ ] > partitionRangeList = new Stack < > ( ) ; BigInteger index = BigInteger . ONE ; BigInteger startIndex = BigInteger . ONE ; BigInteger endIndex = BigInteger . ZERO ; if ( ( index . compareTo ( gridFactor ) ) == 0 ) { startIndex = BigInteger . ONE ; endIndex = totalSequenceCount ; partitionRangeList . push ( new BigInteger [ ] { startIndex , endIndex } ) ; } else { while ( ( index . compareTo ( gridFactor ) ) < 1 ) { if ( ( index . compareTo ( gridFactor ) ) == 0 ) { endIndex = totalSequenceCount ; } else { endIndex = endIndex . add ( partitionSize ) ; } partitionRangeList . push ( new BigInteger [ ] { startIndex , endIndex } ) ; startIndex = endIndex . add ( BigInteger . ONE ) ; index = index . add ( BigInteger . ONE ) ; } } return partitionRangeList ; } No newline ; at end ; of file ; }

Fix:
BigInteger allowableIndex = convertToSequenceIndex . convertToSequenceIndex ( "zzzzzz" , dictionary , separator ) ;
Buggy code:
public class PropertyPopulator implements ICellPopulator { private static final long serialVersionUID = 1L ; private String property ; public PropertyPopulator ( String property ) { } public void populateItem ( Item cellItem , String componentId , IModel rowModel ) { <START_BUG> cellItem . add ( new Label ( componentId , new wicket . model . PropertyModel ( rowModel , property ) ) ) ; <END_BUG> } }

Fix:
cellItem . add ( new wicket . markup . html . basic . Label ( cellItem , componentId , new wicket . model . PropertyModel ( rowModel , property ) ) ) ;
Buggy code:
@ ContextConfiguration ( { "classpath*:spring//batch//job//readers//file//file-multiresource-simple-job.xml" , "classpath*:spring//batch//setup//**//*.xml" } ) @ RunWith ( SpringJUnit4ClassRunner . class ) public class SimpleMultiResourceJobConfigurationTest { private final Logger LOG = LoggerFactory . getLogger ( getClass ( ) ) ; private static final int READ_COUNT_OVERALL = 40 ; @ Autowired private JobLauncherTestUtils jobLauncherTestUtils ; @ Test public void launchJob ( ) throws Exception { Map < String , JobParameter > jobParametersMap = new HashMap < String , JobParameter > ( ) ; jobParametersMap . put ( "time" , new JobParameter ( System . currentTimeMillis ( ) ) ) ; jobParametersMap . put ( "input.files" , new JobParameter ( "file:src//test//resources//input//file//multiresource//*.txt" ) ) ; <START_BUG> jobParametersMap . put ( "output.file" , new JobParameter ( "file:target//test-outputs//readers//file//multiresource//output.txt" ) ) ; <END_BUG> JobExecution jobExecution = jobLauncherTestUtils . launchJob ( new org . springframework . batch . core . JobParameters ( jobParametersMap ) ) ; assertEquals ( COMPLETED , jobExecution . getStatus ( ) ) ; for ( StepExecution step : jobExecution . getStepExecutions ( ) ) { LOG . debug ( step . getSummary ( ) ) ; assertEquals ( "Read<seq2seq4repair_space>Count<seq2seq4repair_space>mismatch,<seq2seq4repair_space>changed<seq2seq4repair_space>input?" , SimpleMultiResourceJobConfigurationTest . READ_COUNT_OVERALL , step . getReadCount ( ) ) ; assertEquals ( "Write<seq2seq4repair_space>count<seq2seq4repair_space>mismatch." , SimpleMultiResourceJobConfigurationTest . READ_COUNT_OVERALL , step . getWriteCount ( ) ) ; } } }

Fix:
jobParametersMap . put ( "output.file" , new JobParameter ( "file:target//test-outputs//readers//file//multiresource-simple//output.txt" ) ) ;
Buggy code:
public class ExtensibleHashIndex implements Index { public static int NUM_BUCKETS = 100 ; private String idxname ; private Schema sch ; private Transaction tx ; private Constant searchkey = null ; private TableInfo indTi ; private int precision ; private int bucketPrecision ; private ExtensibleHashBucket bucket = null ; public ExtensibleHashIndex ( String idxname , Schema bucketSch , Transaction tx ) { } public void beforeFirst ( Constant searchkey ) { } public boolean next ( ) { } public RID getDataRid ( ) { } public void insert ( Constant val , RID rid ) { beforeFirst ( val ) ; <START_BUG> if ( ( precision ) < 32 ) { <END_BUG> if ( bucket . isFull ( ) ) { split ( ) ; } beforeFirst ( val ) ; } bucket . insert ( val , rid ) ; } public void delete ( Constant val , RID rid ) { } public void close ( ) { } public static int searchCost ( int numblocks , int rpb ) { } private int genBitmask ( ) { } private int genBitmask ( int precision ) { } private void split ( ) { } private void splitIndex ( ) { } private String genBucketName ( int hash , int precision ) { } }

Fix:
if ( ( bucketPrecision ) < 32 ) {
Buggy code:
@ Path ( path = "//mobile//bind" ) public class UserBindDeviceApi extends HandlerAdapter { private static final Logger logger = LoggerFactory . getLogger ( UserBindDeviceApi . class ) ; public Object rpc ( JSONObject req ) throws Exception { } public Object rpc ( RpcRequest req ) throws Exception { } private Object deal ( String ... args ) throws Exception { Map < Object , Object > r = new HashMap < Object , Object > ( ) ; r . put ( status , SYSERROR . toString ( ) ) ; String mac = args [ 0 ] ; String userId = CookieUtil . gotUserIdFromCookie ( args [ 1 ] ) ; UserBindDeviceApi . logger . info ( "begin<seq2seq4repair_space>BindHandler<seq2seq4repair_space>user:{}|mac:{}" , userId , mac ) ; String deviceId = "" ; Jedis j = null ; try { j = DataHelper . getJedis ( ) ; deviceId = j . hget ( "device:mactoid" , mac ) ; if ( null == deviceId ) { <START_BUG> r . put ( status , C0003 ) ; <END_BUG> UserBindDeviceApi . logger . info ( "There<seq2seq4repair_space>isn't<seq2seq4repair_space>this<seq2seq4repair_space>device.<seq2seq4repair_space>mac:{}|user:{}|status:{}" , mac , userId , r . get ( "status" ) ) ; return r ; } String mac2 = j . hget ( "device:mac2" , deviceId ) ; String owner = j . hget ( "device:owner" , deviceId ) ; if ( owner != null ) { r . put ( status , C0004 . toString ( ) ) ; UserBindDeviceApi . logger . info ( "The<seq2seq4repair_space>device<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>binded!<seq2seq4repair_space>mac:{}|user:{}|status:{}" , mac , userId , r . get ( "status" ) ) ; return r ; } else { j . hset ( "device:owner" , deviceId , userId ) ; j . sadd ( ( ( "u:" + userId ) + ":devices" ) , deviceId ) ; } StringBuilder sb = new StringBuilder ( ) ; sb . append ( deviceId ) . append ( "|" ) . append ( userId ) . append ( "|" ) . append ( "1" ) ; j . publish ( "PubDeviceUsers" , sb . toString ( ) ) ; j . publish ( "PubCommonMsg:0x36" . getBytes ( ) , Utils . genMsg ( ( userId + "|" ) , 7 , mac2 , "" ) ) ; } catch ( Exception e ) { DataHelper . returnBrokenJedis ( j ) ; UserBindDeviceApi . logger . error ( "Bind<seq2seq4repair_space>in<seq2seq4repair_space>error<seq2seq4repair_space>mac:{}|user:{}|status:{}" , mac , userId , r . get ( "status" ) , e ) ; return r ; } finally { DataHelper . returnJedis ( j ) ; } r . put ( status , SUCCESS . toString ( ) ) ; return r ; } }

Fix:
r . put ( status , C0003 . toString ( ) ) ;
Buggy code:
public class DB_Jar { public static final String copyrightNotice = Copyright . SHORT_2004 ; public static void doJars ( String dbName , Connection conn ) throws SQLException { String separator = System . getProperty ( "file.separator" ) ; Statement stmt = conn . createStatement ( ) ; ResultSet rs = stmt . executeQuery ( ( "SELECT<seq2seq4repair_space>FILENAME,<seq2seq4repair_space>SCHEMAID,<seq2seq4repair_space>" + "GENERATIONID<seq2seq4repair_space>FROM<seq2seq4repair_space>SYS.SYSFILES" ) ) ; boolean firstTime = true ; while ( rs . next ( ) ) { String jarName = dblook . addQuotes ( dblook . expandDoubleQuotes ( rs . getString ( 1 ) ) ) ; String schemaId = rs . getString ( 2 ) ; String schemaName = dblook . lookupSchemaId ( schemaId ) ; if ( dblook . isIgnorableSchema ( schemaName ) ) continue ; if ( firstTime ) { Logs . reportString ( "----------------------------------------------" ) ; <START_BUG> Logs . reportMessage ( "CSLOOK_Header" , "jars" ) ; <END_BUG> Logs . reportMessage ( "CSLOOK_Jar_Note" ) ; Logs . reportString ( "----------------------------------------------\n" ) ; } String genID = rs . getString ( 3 ) ; String schemaWithoutQuotes = dblook . stripQuotes ( schemaName ) ; StringBuffer jarFullName = new StringBuffer ( separator ) ; jarFullName . append ( dblook . stripQuotes ( jarName ) ) ; jarFullName . append ( ".jar.G" ) ; jarFullName . append ( genID ) ; StringBuffer oldJarPath = new StringBuffer ( ) ; oldJarPath . append ( dbName ) ; oldJarPath . append ( separator ) ; oldJarPath . append ( "jar" ) ; oldJarPath . append ( separator ) ; oldJarPath . append ( schemaWithoutQuotes ) ; oldJarPath . append ( jarFullName ) ; String absJarDir = null ; try { File jarDir = new File ( ( ( ( ( ( System . getProperty ( "user.dir" ) ) + separator ) + "CSJARS" ) + separator ) + schemaWithoutQuotes ) ) ; absJarDir = jarDir . getAbsolutePath ( ) ; jarDir . mkdirs ( ) ; FileInputStream oldJarFile = new FileInputStream ( oldJarPath . toString ( ) ) ; FileOutputStream newJarFile = new FileOutputStream ( ( absJarDir + jarFullName ) ) ; int st = 0 ; while ( true ) { if ( ( oldJarFile . available ( ) ) == 0 ) break ; byte [ ] bAr = new byte [ oldJarFile . available ( ) ] ; oldJarFile . read ( bAr ) ; newJarFile . write ( bAr ) ; } newJarFile . close ( ) ; oldJarFile . close ( ) ; } catch ( Exception e ) { Logs . debug ( "CSLOOK_FailedToLoadJar" , ( absJarDir + ( jarFullName . toString ( ) ) ) ) ; Logs . debug ( e ) ; firstTime = false ; continue ; } StringBuffer loadJarString = new StringBuffer ( ) ; loadJarString . append ( "CALL<seq2seq4repair_space>SQLJ.INSTALL_JAR('file:" ) ; loadJarString . append ( absJarDir ) ; loadJarString . append ( jarFullName ) ; loadJarString . append ( "',<seq2seq4repair_space>'" ) ; loadJarString . append ( schemaName ) ; loadJarString . append ( "." ) ; loadJarString . append ( jarName ) ; loadJarString . append ( "',<seq2seq4repair_space>0)" ) ; Logs . writeToNewDDL ( loadJarString . toString ( ) ) ; Logs . writeStmtEndToNewDDL ( ) ; Logs . writeNewlineToNewDDL ( ) ; firstTime = false ; } stmt . close ( ) ; rs . close ( ) ; } }

Fix:
Logs . reportMessage ( "CSLOOK_JarsHeader" ) ;
Buggy code:
public class InstagramDateDeserializer extends JsonDeserializer < Date > { @ Override public Date deserialize ( JsonParser jp , DeserializationContext ctxt ) throws IOException , JsonProcessingException { <START_BUG> return new Date ( Long . valueOf ( jp . getText ( ) ) ) ; <END_BUG> } }

Fix:
return new Date ( ( ( Long . valueOf ( jp . getText ( ) ) ) * 1000 ) ) ;
Buggy code:
public class ReferenceTest { protected Synchroniser synchroniser = new Synchroniser ( ) ; protected Mockery context = new Mockery ( ) { } ; private States tested ; private DataBasePullService pull_service ; private DataBasePushService push_service ; private CHMIProxySpec chmiProxy ; private EUDEInterpreter instance ; private EHMIProxyMock ehmiProxy ; @ Before public void setUp ( ) throws Exception { } @ Test public void testBuildReferences ( ) throws FileNotFoundException , IOException , JSONException { System . out . println ( "References" ) ; instance . addProgram ( TestUtilities . loadFileJSON ( "src//test//resources//prog//pgm.json" ) ) ; NodeProgram p = instance . getNodeProgram ( "pgm" ) ; Assert . assertNotNull ( p ) ; ReferenceTable references = p . getReferences ( ) ; Assert . assertNotNull ( references ) ; Set < String > devicesId = references . getDevicesId ( ) ; Assert . assertEquals ( 1 , devicesId . size ( ) ) ; Set < String > programsId = references . getProgramsId ( ) ; Assert . assertEquals ( 1 , programsId . size ( ) ) ; ReferenceTable . STATUS ret = references . checkReferences ( ) ; <START_BUG> Assert . assertEquals ( UNSTABLE , ret ) ; <END_BUG> } }

Fix:
Assert . assertEquals ( INVALID , ret ) ;
Buggy code:
public abstract class AbstractEEAnnotationProcessor implements DeploymentUnitProcessor { public final void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final CompositeIndex index = deploymentUnit . getAttachment ( COMPOSITE_ANNOTATION_INDEX ) ; <START_BUG> final Boolean replacement = deploymentUnit . getAttachment ( ANNOTATION_PROPERTY_REPLACEMENT ) ; <END_BUG> if ( ( index == null ) || ( eeModuleDescription == null ) ) { return ; } final List < ClassAnnotationInformationFactory > factories = annotationInformationFactories ( ) ; for ( final ClassAnnotationInformationFactory factory : factories ) { final Map < String , ClassAnnotationInformation < ? , ? > > data = factory . createAnnotationInformation ( index , replacement ) ; for ( Map . Entry < String , ClassAnnotationInformation < ? , ? > > entry : data . entrySet ( ) ) { EEModuleClassDescription clazz = eeModuleDescription . addOrGetLocalClassDescription ( entry . getKey ( ) ) ; clazz . addAnnotationInformation ( entry . getValue ( ) ) ; } } afterAnnotationsProcessed ( phaseContext , deploymentUnit ) ; } protected void afterAnnotationsProcessed ( final DeploymentPhaseContext phaseContext , final DeploymentUnit deploymentUnit ) { } protected abstract List < ClassAnnotationInformationFactory > annotationInformationFactories ( ) { } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
final Boolean replacement = deploymentUnit . getAttachment ( EJB_ANNOTATION_PROPERTY_REPLACEMENT ) ;
Buggy code:
abstract class AbstractBindingWriteHandler extends WriteAttributeHandlers . WriteAttributeOperationHandler { private static final ServiceName SOCKET_BINDING = SocketBinding . JBOSS_BINDING_NAME ; private final ParameterValidator resolvedValueValidator ; protected AbstractBindingWriteHandler ( ) { } protected AbstractBindingWriteHandler ( ParameterValidator valueValidator ) { } protected AbstractBindingWriteHandler ( ParameterValidator valueValidator , ParameterValidator resolvedValueValidator ) { } protected boolean requiresRestart ( ) { } abstract void handleRuntimeChange ( final ModelNode operation , final String attributeName , final ModelNode attributeValue , final SocketBinding binding ) throws OperationFailedException { } abstract void handleRuntimeRollback ( final ModelNode operation , final String attributeName , final ModelNode previousValue , final SocketBinding binding ) { } @ Override protected void modelChanged ( final OperationContext context , final ModelNode operation , final String attributeName , final ModelNode newValue , final ModelNode currentValue ) throws OperationFailedException { } protected boolean requiresRuntime ( OperationContext context ) { <START_BUG> return context . isNormalServer ( ) ; <END_BUG> } private void handleBindingReinstall ( OperationContext context , String bindingName , ModelNode bindingModel ) throws OperationFailedException { } private void revertBindingReinstall ( OperationContext context , String bindingName , ModelNode bindingModel , String attributeName , ModelNode previousValue ) { } }

Fix:
return true ;
Buggy code:
class DefaultPropertyConfigurer implements PropertyConfigurer { private static final Resources REZ = ResourceManager . getPackageResources ( DefaultPropertyConfigurer . class ) ; private final int m_propIndex ; private final Class m_type ; private final Method m_addMethod ; private final int m_maxCount ; public DefaultPropertyConfigurer ( final int propIndex , final Class type , final Method addMethod , final int maxCount ) { } public Class getType ( ) { } public void addValue ( final ConfigurationState state , final Object value ) throws ConfigurationException { <START_BUG> final DefaultConfigurationState defState = ( ( DefaultConfigurationState ) ( state ) ) ; <END_BUG> if ( ( defState . getPropertyCount ( m_propIndex ) ) >= ( m_maxCount ) ) { final String message = DefaultPropertyConfigurer . REZ . getString ( "too-many-values.error" ) ; throw new ConfigurationException ( message ) ; } defState . incPropertyCount ( m_propIndex ) ; try { if ( null != ( m_addMethod ) ) { m_addMethod . invoke ( defState . getObject ( ) , new Object [ ] { value } ) ; } } catch ( final InvocationTargetException ite ) { final Throwable cause = ite . getTargetException ( ) ; throw new ConfigurationException ( cause . getMessage ( ) , cause ) ; } catch ( final Exception e ) { throw new ConfigurationException ( e . getMessage ( ) , e ) ; } } private Class getComplexTypeFor ( final Class clazz ) { } }

Fix:
final ConfigurationState defState = ( ( ConfigurationState ) ( state ) ) ;
Buggy code:
public abstract class BaseEntityRef extends EntityRef { protected LowLevelEntityManager entityManager ; public BaseEntityRef ( LowLevelEntityManager entityManager ) { } @ Override public boolean isPersistent ( ) { } @ Override public void setPersistent ( boolean persistent ) { } @ Override public boolean isAlwaysRelevant ( ) { } @ Override public void setAlwaysRelevant ( boolean alwaysRelevant ) { } @ Override public EntityRef getOwner ( ) { } @ Override public void setOwner ( EntityRef owner ) { } @ Override public Prefab getParentPrefab ( ) { } @ Override public AssetUri getPrefabURI ( ) { if ( exists ( ) ) { EntityInfoComponent info = getComponent ( EntityInfoComponent . class ) ; <START_BUG> if ( ( info != null ) && ( ! ( info . parentPrefab . exists ( ) ) ) ) { <END_BUG> return new AssetUri ( AssetType . PREFAB , info . parentPrefab . getName ( ) ) ; } } return null ; } @ Override public boolean isActive ( ) { } @ Override public < T extends Component > T getComponent ( Class < T > componentClass ) { } @ Override public < T extends Component > T addComponent ( T component ) { } @ Override public void removeComponent ( Class < ? extends Component > componentClass ) { } @ Override public void saveComponent ( Component component ) { } @ Override public Iterable < Component > iterateComponents ( ) { } @ Override public void destroy ( ) { } @ Override public < T extends Event > T send ( T event ) { } @ Override public boolean hasComponent ( Class < ? extends Component > component ) { } @ Override public String toString ( ) { } public void invalidate ( ) { } private EntityInfoComponent getEntityInfo ( ) { } @ Override public String toFullDescription ( ) { } }

Fix:
if ( ( info != null ) && ( info . parentPrefab . exists ( ) ) ) {
Buggy code:
public class FieldData extends ItemData { Field field ; public FieldData ( Field field , String str ) { } public static String [ ] getAllFlags ( ) { <START_BUG> return new String [ ] { "no_gen" , "no_wince" } ; <END_BUG> } public String getAccessor ( ) { } public String getCast ( ) { } public String getExclude ( ) { } public Field getField ( ) { } public void setAccessor ( String str ) { } public void setCast ( String str ) { } public void setExclude ( String str ) { } }

Fix:
return new String [ ] { FLAG_NO_GEN , FLAG_NO_WINCE } ;
Buggy code:
public class PendingUpdateAdapter implements IAdaptable , IWorkbenchAdapter { boolean removed = false ; public boolean isRemoved ( ) { } public void setRemoved ( boolean removedValue ) { } public PendingUpdateAdapter ( ) { } public Object getAdapter ( Class adapter ) { } public Object [ ] getChildren ( Object o ) { } public ImageDescriptor getImageDescriptor ( Object object ) { } public String getLabel ( Object o ) { <START_BUG> return ProgressMessages . getString ( "PendingUpdateAdapter.PendingLabel" ) ; <END_BUG> } public Object getParent ( Object o ) { } }

Fix:
return ProgressMessages . PendingUpdateAdapter_PendingLabel ;