nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TestFileSwitchDirectory extends LuceneTestCase { public void testBasic ( ) throws IOException { Set < String > fileExtensions = new HashSet < > ( ) ; fileExtensions . add ( FIELDS_EXTENSION ) ; fileExtensions . add ( FIELDS_INDEX_EXTENSION ) ; MockDirectoryWrapper primaryDir = new MockDirectoryWrapper ( random ( ) , new RAMDirectory ( ) ) ; primaryDir . setCheckIndexOnClose ( false ) ; MockDirectoryWrapper secondaryDir = new MockDirectoryWrapper ( random ( ) , new RAMDirectory ( ) ) ; secondaryDir . setCheckIndexOnClose ( false ) ; FileSwitchDirectory fsd = new FileSwitchDirectory ( fileExtensions , primaryDir , secondaryDir , true ) ; boolean oldValue = OLD_FORMAT_IMPERSONATION_IS_ACTIVE ; OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true ; IndexWriter writer = new IndexWriter ( fsd , new org . apache . lucene . index . IndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setMergePolicy ( newLogMergePolicy ( false ) ) . setCodec ( Codec . forName ( "Lucene40" ) ) . setUseCompoundFile ( false ) ) ; TestIndexWriterReader . createIndexNoClose ( true , "ram" , writer ) ; IndexReader reader = DirectoryReader . open ( writer , true ) ; assertEquals ( 100 , reader . maxDoc ( ) ) ; writer . commit ( ) ; String [ ] files = primaryDir . listAll ( ) ; assertTrue ( ( ( files . length ) > 0 ) ) ; for ( int x = 0 ; x < ( files . length ) ; x ++ ) { String ext = FileSwitchDirectory . getExtension ( files [ x ] ) ; assertTrue ( fileExtensions . contains ( ext ) ) ; } files = secondaryDir . listAll ( ) ; assertTrue ( ( ( files . length ) > 0 ) ) ; for ( int x = 0 ; x < ( files . length ) ; x ++ ) { String ext = FileSwitchDirectory . getExtension ( files [ x ] ) ; assertFalse ( fileExtensions . contains ( ext ) ) ; } reader . close ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> files = fsd . listAll ( ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { assertNotNull ( files [ i ] ) ; } fsd . close ( ) ; OLD_FORMAT_IMPERSONATION_IS_ACTIVE = oldValue ; } private Directory newFSSwitchDirectory ( Set < String > primaryExtensions ) throws IOException { } private Directory newFSSwitchDirectory ( File aDir , File bDir , Set < String > primaryExtensions ) throws IOException { } public void testNoDir ( ) throws Throwable { } public void testDirectoryFilter ( ) throws IOException { } public void testCompoundFileAppendTwice ( ) throws IOException { } private void createSequenceFile ( Directory dir , String name , byte start , int size ) throws IOException { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public final class EndToEndTest { private static final RelativeUrl urls = new RelativeUrl ( EndToEndTest . class ) ; private final String efPrefix ; public EndToEndTest ( ) throws IOException { } @ DataProvider ( name = "files" ) public static Object [ ] [ ] getBaseNames ( ) throws IOException { String regexPattern = System . getProperty ( "test.regex" , "" ) ; String suffixRegex = ( "^(.*" + regexPattern ) + ".*)\\.(ef|ir|err|out)$" ; <START_BUG> return Resources . readLines ( EndToEndTest . urls . get ( "." ) , Charsets . UTF_8 ) . stream ( ) . flatMap ( ( ( Function < String , Stream < String > > ) ( EndToEndTest :: readFileOrDir ) ) ) . filter ( ( s ) -> ( ! ( "_prefix.ef" . equals ( s ) ) ) && ( s . matches ( suffixRegex ) ) ) . map ( ( s ) -> s . replaceFirst ( suffixRegex , "$1" ) ) . distinct ( ) . map ( ( s ) -> new Object [ ] { s } ) . collect ( Collectors . toList ( ) ) . toArray ( new Object [ 0 ] [ ] ) ; <END_BUG> } private static Stream < String > readFileOrDir ( String file ) { } @ Test ( dataProvider = "files" ) public void compile ( String fileBaseName ) throws IOException { } private CompilationUnitContext getParser ( String fileBaseName ) throws IOException { } @ Test ( dataProvider = "files" ) public void run ( String fileBaseName ) throws IOException { } private String printIr ( MethodsRegistry < Block > compiledMethods ) { } private String readIfExists ( String fileName ) throws IOException { } private static class NodeStateToString implements NodeStateVisitor { private final StringBuilder out ; private int depth = 0 ; private NodeStateToString ( StringBuilder out ) { } @ Override public void visitChild ( Object label , Node child ) { } @ Override public void visitChild ( Node child ) { } @ Override public void visitScalar ( Object label , Object value ) { } private StringBuilder indent ( ) { } } }

Fix:
return Resources . readLines ( EndToEndTest . urls . get ( "." ) , Charsets . UTF_8 ) . stream ( ) . flatMap ( EndToEndTest :: readFileOrDir ) . filter ( ( s ) -> ( ! ( "_prefix.ef" . equals ( s ) ) ) && ( s . matches ( suffixRegex ) ) ) . map ( ( s ) -> s . replaceFirst ( suffixRegex , "$1" ) ) . distinct ( ) . map ( ( s ) -> new Object [ ] { s } ) . collect ( Collectors . toList ( ) ) . toArray ( new Object [ 0 ] [ ] ) ;
Buggy code:
public class CreateBook extends WebPage { private static final long serialVersionUID = 1L ; private Book book = new Book ( null , null ) ; public CreateBook ( ) { } public class CreateForm extends Form { private static final long serialVersionUID = 1L ; public CreateForm ( String id ) { } public void onSubmit ( ) { try { Page page = new SuccessPage ( ) ; page . info ( getString ( "book.save.success" , new wicket . model . Model ( book ) ) ) ; setResponsePage ( page ) ; } finally { <START_BUG> getSession ( ) . remove ( getPage ( ) ) ; <END_BUG> } } } }

Fix:
getPage ( ) . getPageMap ( ) . remove ( getPage ( ) ) ;
Buggy code:
public class GooglePlayServicesLocationProvider implements GoogleApiClient . ConnectionCallbacks , GoogleApiClient . OnConnectionFailedListener , ResultCallback < Status > , LocationListener , LocationProvider { private static final String PROVIDER_FILE = "GMSPROVIDER_PREFS" ; private static final String LAST_ID = "last" ; private GoogleApiClient client ; private LocationRequest locationRequest ; private Logger logger ; private OnLocationUpdatedListener listener ; private boolean shouldStart = false ; private SharedPreferences sharedPreferences ; @ Override public void init ( Context context , SmartLocation . OnLocationUpdatedListener listener , LocationParams params , boolean singleUpdate , Logger logger ) { } private LocationRequest createRequest ( LocationParams params , boolean singleUpdate ) { } @ Override public void start ( ) { } private void startUpdating ( ) { } @ Override public void stopUpdates ( ) { } @ Override public Location getLastLocation ( ) { Location location = Utils . getLocationFromPreferences ( sharedPreferences , GooglePlayServicesLocationProvider . LAST_ID ) ; if ( location != null ) { return location ; } <START_BUG> return client . isConnected ( ) ? FusedLocationApi . getLastLocation ( client ) : null ; <END_BUG> } @ Override public void onConnected ( Bundle bundle ) { } @ Override public void onConnectionSuspended ( int i ) { } @ Override public void onConnectionFailed ( ConnectionResult connectionResult ) { } @ Override public void onLocationChanged ( Location location ) { } @ Override public void onResult ( Status status ) { } }

Fix:
return ( ( client ) != null ) && ( client . isConnected ( ) ) ? FusedLocationApi . getLastLocation ( client ) : null ;
Buggy code:
public class RetournesessionServlet extends HttpServlet { private static final long serialVersionUID = 1L ; public RetournesessionServlet ( ) { } @ Override public void init ( ) throws ServletException { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { response . setContentType ( "text//html" ) ; JSONObject json = new JSONObject ( ) ; HttpSession session = request . getSession ( ) ; String login = ( ( String ) ( session . getAttribute ( "login" ) ) ) ; if ( login != null ) { <START_BUG> String score = ( ( String ) ( session . getAttribute ( "score" ) ) ) ; <END_BUG> try { json . put ( "response" , "true" ) ; json . put ( "login" , login ) ; json . put ( "score" , score ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } else { try { json . put ( "response" , "false" ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } PrintWriter out = response . getWriter ( ) ; out . print ( json ) ; out . flush ( ) ; } }

Fix:
long score = ( ( long ) ( session . getAttribute ( "score" ) ) ) ;
Buggy code:
public class TestQueryCompilationCache extends TestCase { public void testDynamicJPQLWithNamedEntity ( ) { <START_BUG> Map props = new HashMap ( ) ; <END_BUG> props . put ( "openjpa.MetaDataFactory" , ( ( "jpa(Types=" + ( NamedEntity . class . getName ( ) ) ) + ")" ) ) ; OpenJPAEntityManagerFactory emf = OpenJPAPersistence . cast ( Persistence . createEntityManagerFactory ( "test" , props ) ) ; Map cache = emf . getConfiguration ( ) . getQueryCompilationCacheInstance ( ) ; cache . clear ( ) ; OpenJPAEntityManager em = emf . createEntityManager ( ) ; OpenJPAQuery q = em . createQuery ( "select<seq2seq4repair_space>o<seq2seq4repair_space>from<seq2seq4repair_space>named<seq2seq4repair_space>o" ) ; q . compile ( ) ; em . close ( ) ; assertEquals ( 1 , cache . size ( ) ) ; Compilation comp = ( ( Compilation ) ( cache . values ( ) . iterator ( ) . next ( ) ) ) ; assertEquals ( NamedEntity . class , ( ( org . apache . openjpa . kernel . jpql . JPQLExpressionBuilder . ParsedJPQL ) ( comp . storeData ) ) . getCandidateType ( ) ) ; emf . close ( ) ; } }

Fix:
Map props = new HashMap ( System . getProperties ( ) ) ;
Buggy code:
public class MultipartUrlConfig implements Serializable { public static final String MULTIPART_FORM = "multipart//form-data" ; private String boundary ; private String filename ; private String fileField ; private String mimetype ; private Arguments args ; public MultipartUrlConfig ( ) { } public MultipartUrlConfig ( String boundary ) { } public void setBoundary ( String boundary ) { } public String getBoundary ( ) { } public void setFilename ( String filename ) { } public String getFilename ( ) { } public Arguments getArguments ( ) { } public void setFileFieldName ( String name ) { } public String getFileFieldName ( ) { } public void setMimeType ( String type ) { } public String getMimeType ( ) { } public void addArgument ( String name , String value ) { } public void addArgument ( String name , String value , String metadata ) { } public void addEncodedArgument ( String name , String value ) { } public void parseArguments ( String queryString ) { String [ ] parts = JOrphanUtils . split ( queryString , ( "--" + ( getBoundary ( ) ) ) ) ; for ( int i = 0 ; i < ( parts . length ) ; i ++ ) { if ( ( parts [ i ] . indexOf ( "filename=" ) ) > ( - 1 ) ) { int index = ( parts [ i ] . indexOf ( "name=\"" ) ) + 6 ; String name = parts [ i ] . substring ( index , parts [ i ] . indexOf ( "\"" , index ) ) ; index = ( parts [ i ] . indexOf ( "filename=\"" ) ) + 10 ; String fn = parts [ i ] . substring ( index , parts [ i ] . indexOf ( "\"" , index ) ) ; index = parts [ i ] . indexOf ( "\n" , index ) ; index = ( parts [ i ] . indexOf ( ":" , index ) ) + 1 ; String mt = parts [ i ] . substring ( index , parts [ i ] . indexOf ( "\n" , index ) ) . trim ( ) ; this . setFileFieldName ( name ) ; this . setFilename ( fn ) ; this . setMimeType ( mt ) ; } else if ( ( parts [ i ] . indexOf ( "name=" ) ) > ( - 1 ) ) { int index = ( parts [ i ] . indexOf ( "name=\"" ) ) + 6 ; String name = parts [ i ] . substring ( index , parts [ i ] . indexOf ( "\"" , index ) ) ; index = ( parts [ i ] . indexOf ( "\n" , index ) ) + 2 ; String value = parts [ i ] . substring ( index ) . trim ( ) ; <START_BUG> this . addEncodedArgument ( name , value ) ; <END_BUG> } } } }

Fix:
this . addArgument ( name , value ) ;
Buggy code:
public class TypeDeclarationPattern extends JavaSearchPattern implements IIndexConstants { public char [ ] simpleName ; public char [ ] pkg ; public char [ ] [ ] enclosingTypeNames ; public char typeSuffix ; public int modifiers ; public boolean secondary = false ; protected static char [ ] [ ] CATEGORIES = new char [ ] [ ] { IIndexConstants . TYPE_DECL } ; static TypeDeclarationPattern . PackageNameSet internedPackageNames = new TypeDeclarationPattern . PackageNameSet ( 1001 ) ; static class PackageNameSet { public char [ ] [ ] names ; public int elementSize ; public int threshold ; PackageNameSet ( int size ) { } char [ ] add ( char [ ] name ) { } void rehash ( ) { } } public static char [ ] createIndexKey ( int modifiers , char [ ] typeName , char [ ] packageName , char [ ] [ ] enclosingTypeNames , boolean secondary ) { int typeNameLength = ( typeName == null ) ? 0 : typeName . length ; int packageLength = ( packageName == null ) ? 0 : packageName . length ; int enclosingNamesLength = 0 ; if ( enclosingTypeNames != null ) { for ( int i = 0 , length = enclosingTypeNames . length ; i < length ; ) { enclosingNamesLength += enclosingTypeNames [ i ] . length ; if ( ( ++ i ) < length ) enclosingNamesLength ++ ; } } int resultLength = ( ( typeNameLength + packageLength ) + enclosingNamesLength ) + 4 ; if ( secondary ) resultLength += 2 ; char [ ] result = new char [ resultLength ] ; int pos = 0 ; if ( typeNameLength > 0 ) { System . arraycopy ( typeName , 0 , result , pos , typeNameLength ) ; pos += typeNameLength ; } result [ ( pos ++ ) ] = IIndexConstants . SEPARATOR ; if ( packageLength > 0 ) { System . arraycopy ( packageName , 0 , result , pos , packageLength ) ; pos += packageLength ; } result [ ( pos ++ ) ] = IIndexConstants . SEPARATOR ; <START_BUG> if ( enclosingNamesLength > 0 ) { <END_BUG> for ( int i = 0 , length = enclosingTypeNames . length ; i < length ; ) { char [ ] enclosingName = enclosingTypeNames [ i ] ; int itsLength = enclosingName . length ; System . arraycopy ( enclosingName , 0 , result , pos , itsLength ) ; pos += itsLength ; if ( ( ++ i ) < length ) result [ ( pos ++ ) ] = '.' ; } } result [ ( pos ++ ) ] = IIndexConstants . SEPARATOR ; result [ pos ] = ( ( char ) ( modifiers ) ) ; if ( secondary ) { result [ ( ++ pos ) ] = IIndexConstants . SEPARATOR ; result [ ( ++ pos ) ] = 'S' ; } return result ; } public TypeDeclarationPattern ( char [ ] pkg , char [ ] [ ] enclosingTypeNames , char [ ] simpleName , char typeSuffix , int matchRule ) { } TypeDeclarationPattern ( int matchRule ) { } public void decodeIndexKey ( char [ ] key ) { } protected void decodeModifiers ( char value ) { } public SearchPattern getBlankPattern ( ) { } public char [ ] [ ] getIndexCategories ( ) { } public boolean matchesDecodedKey ( SearchPattern decodedPattern ) { } EntryResult [ ] queryIn ( Index index ) throws IOException { } protected StringBuffer print ( StringBuffer output ) { } }

Fix:
if ( ( enclosingTypeNames != null ) && ( enclosingNamesLength > 0 ) ) {
Buggy code:
public class TestModule { private final ByteArrayOutputStream outStream = new ByteArrayOutputStream ( ) ; @ Before public void setupStreams ( ) { } @ After public void cleanupStreams ( ) { } @ Test public void testSimpleForLoops ( ) throws SymbolException { Symbol . executeFile ( "testModule.symb" ) ; <START_BUG> assertEquals ( "Test<seq2seq4repair_space>Simple<seq2seq4repair_space>Math<seq2seq4repair_space>Module" , "3\n8\n" , outStream . toString ( ) ) ; <END_BUG> } }

Fix:
assertEquals ( "Test<seq2seq4repair_space>Simple<seq2seq4repair_space>Math<seq2seq4repair_space>Module" , "3\n8\n3\n8\n" , outStream . toString ( ) ) ;
Buggy code:
public class WorkbenchPreferenceNode extends PreferenceNode implements IPluginContribution { public static final String ATT_CONTRIBUTOR_CLASS = "class" ; private String category ; private IConfigurationElement configurationElement ; private IWorkbench workbench ; public WorkbenchPreferenceNode ( String nodeId , String nodeLabel , String category , ImageDescriptor nodeImage , IConfigurationElement element , IWorkbench newWorkbench ) { } public void createPage ( ) { IWorkbenchPreferencePage page ; try { page = ( ( IWorkbenchPreferencePage ) ( WorkbenchPlugin . createExtension ( configurationElement , WorkbenchPreferenceNode . ATT_CONTRIBUTOR_CLASS ) ) ) ; } catch ( CoreException e ) { ErrorDialog . openError ( ( ( Shell ) ( null ) ) , WorkbenchMessages . getString ( "PreferenceNode.errorTitle" ) , WorkbenchMessages . getString ( "PreferenceNode.errorMessage" ) , e . getStatus ( ) ) ; <START_BUG> page = new EmptyPreferencePage ( ) ; <END_BUG> } page . init ( workbench ) ; if ( ( getLabelImage ( ) ) != null ) page . setImageDescriptor ( getImageDescriptor ( ) ) ; page . setTitle ( getLabelText ( ) ) ; setPage ( page ) ; } public boolean fromPlugin ( ) { } public String getCategory ( ) { } public String getLocalId ( ) { } public String getPluginId ( ) { } }

Fix:
page = new ErrorPreferencePage ( ) ;
Buggy code:
public class Label extends Control { String text ; Image image ; boolean isImage ; NSTextField textView ; NSImageView imageView ; public Label ( Composite parent , int style ) { } int accessibilityAttributeNames ( int id , int sel ) { } boolean accessibilityIsIgnored ( int id , int sel ) { } void addRelation ( Control control ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { state |= THEME_BACKGROUND ; NSBox widget = ( ( NSBox ) ( new SWTBox ( ) . alloc ( ) ) ) ; widget . init ( ) ; widget . setTitle ( NSString . string ( ) ) ; if ( ( ( style ) & ( SWT . SEPARATOR ) ) != 0 ) { widget . setBoxType ( NSBoxSeparator ) ; <START_BUG> NSView child = ( ( NSView ) ( new SWTView ( ) . alloc ( ) . init ( ) ) ) ; <END_BUG> widget . setContentView ( child ) ; child . release ( ) ; } else { widget . setBorderType ( NSNoBorder ) ; widget . setBorderWidth ( 0 ) ; widget . setBoxType ( NSBoxCustom ) ; NSSize offsetSize = new NSSize ( ) ; widget . setContentViewMargins ( offsetSize ) ; NSImageView imageWidget = ( ( NSImageView ) ( new SWTImageView ( ) . alloc ( ) ) ) ; imageWidget . init ( ) ; imageWidget . setImageScaling ( NSScaleNone ) ; NSTextField textWidget = ( ( NSTextField ) ( new SWTTextField ( ) . alloc ( ) ) ) ; textWidget . init ( ) ; textWidget . setBordered ( false ) ; textWidget . setEditable ( false ) ; textWidget . setDrawsBackground ( false ) ; NSTextFieldCell cell = new NSTextFieldCell ( textWidget . cell ( ) ) ; cell . setWraps ( ( ( ( style ) & ( SWT . WRAP ) ) != 0 ) ) ; widget . addSubview ( imageWidget ) ; widget . addSubview ( textWidget ) ; widget . setContentView ( textWidget ) ; imageView = imageWidget ; textView = textWidget ; _setAlignment ( ) ; } view = widget ; } void createWidget ( ) { } NSAttributedString createString ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } NSView eventView ( ) { } public int getAlignment ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public String getText ( ) { } boolean isDescribedByLabel ( ) { } void register ( ) { } void releaseHandle ( ) { } void removeRelation ( ) { } public void setAlignment ( int alignment ) { } void setBackgroundColor ( NSColor nsColor ) { } void setBackgroundImage ( NSImage image ) { } void _setAlignment ( ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } boolean setTabItemFocus ( ) { } public void setImage ( Image image ) { } public void setText ( String string ) { } }

Fix:
NSView child = ( ( NSView ) ( new NSView ( ) . alloc ( ) . init ( ) ) ) ;
Buggy code:
public class ReferencesDaoImpl extends MySqlBaseDao implements IReferencesDao { public ReferencesDaoImpl ( ) { } @ Override public CustomPaginatedList < ReferenceDTO > getReferences ( int page , int defaltPageSize , String sort , String dir , String like ) { } private int getReferencesCnt ( String like ) { } @ Override public List < DcLinkDTO > getLinks ( String idDc ) { List < DcLinkDTO > ret = new ArrayList < DcLinkDTO > ( ) ; Connection con = null ; PreparedStatement preparedStatement = null ; ResultSet rs = null ; try { con = getConnection ( ) ; <START_BUG> preparedStatement = con . prepareStatement ( "select<seq2seq4repair_space>ID_DC,<seq2seq4repair_space>LINK,<seq2seq4repair_space>LINKTEXT<seq2seq4repair_space>from<seq2seq4repair_space>DC_LINKS<seq2seq4repair_space>where<seq2seq4repair_space>ID_DC=?" ) ; <END_BUG> preparedStatement . setString ( 1 , idDc ) ; rs = preparedStatement . executeQuery ( ) ; while ( rs . next ( ) ) { String link = rs . getString ( "LINK" ) ; String linkText = rs . getString ( "LINKTEXT" ) ; DcLinkDTO attr = new DcLinkDTO ( idDc , link , linkText ) ; ret . add ( attr ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { closeAllResources ( con , preparedStatement , rs ) ; } return ret ; } @ Override public List < AttributeDto > getDcAttributes ( String idDc ) { } @ Override public DcIndexDTO getDcIndex ( String id ) { } @ Override public List < DcIndexDTO > getDcObjects ( ) { } @ Override public Integer insertSource ( String title , String source , String publisher , String editor , String url , String year ) throws Exception { } private int getId ( String query ) throws ParseException { } @ Override public DesignationDcObjectDTO getDesignationDcObject ( String idDesig , String idGeo ) throws Exception { } @ Override public List < PairDTO > getRedListSources ( ) throws Exception { } public List < DcIndexDTO > getChildren ( String idDc ) { } }

Fix:
preparedStatement = con . prepareStatement ( "select<seq2seq4repair_space>ID_DC,<seq2seq4repair_space>LINK,<seq2seq4repair_space>LINKTEXT<seq2seq4repair_space>from<seq2seq4repair_space>dc_links<seq2seq4repair_space>where<seq2seq4repair_space>ID_DC=?" ) ;
Buggy code:
public abstract class SSTable { private static final Logger logger = Logger . getLogger ( SSTable . class ) ; public static final int FILES_ON_DISK = 3 ; protected String path ; protected IPartitioner partitioner ; protected BloomFilter bf ; protected List < SSTable . KeyPosition > indexPositions ; protected String columnFamilyName ; public static final int INDEX_INTERVAL = 128 ; public static final String TEMPFILE_MARKER = "tmp" ; public SSTable ( String filename , IPartitioner partitioner ) { } protected static String indexFilename ( String dataFile ) { } public String indexFilename ( ) { } protected static String compactedFilename ( String dataFile ) { } public static boolean deleteIfCompacted ( String dataFilename ) throws IOException { } protected String compactedFilename ( ) { } protected static String filterFilename ( String dataFile ) { } public String filterFilename ( ) { } public String getFilename ( ) { } public List < String > getAllFilenames ( ) { } public String getColumnFamilyName ( ) { } public String getTableName ( ) { } public static String parseTableName ( String filename ) { } static void delete ( String path ) throws IOException { } class KeyPosition implements Comparable < SSTable . KeyPosition > { public final DecoratedKey key ; public final long position ; public KeyPosition ( DecoratedKey key , long position ) { } public int compareTo ( SSTable . KeyPosition kp ) { <START_BUG> return partitioner . getDecoratedKeyComparator ( ) . compare ( key , kp . key ) ; <END_BUG> } public String toString ( ) { } } public long bytesOnDisk ( ) { } @ Override public String toString ( ) { } }

Fix:
return key . compareTo ( kp . key ) ;
Buggy code:
public class AssistImportDeclaration extends ImportDeclaration { private Map infoCache ; public AssistImportDeclaration ( ImportContainer parent , String name , boolean isOnDemand , Map infoCache ) { } public Object getElementInfo ( IProgressMonitor monitor ) throws JavaModelException { <START_BUG> return infoCache . get ( this ) ; <END_BUG> } }

Fix:
return this . infoCache . get ( this ) ;
Buggy code:
public final class FramedTransport implements Transport { private static final List < ByteString > SPDY_3_PROHIBITED_HEADERS = Util . immutableList ( ByteString . encodeUtf8 ( "connection" ) , ByteString . encodeUtf8 ( "host" ) , ByteString . encodeUtf8 ( "keep-alive" ) , ByteString . encodeUtf8 ( "proxy-connection" ) , ByteString . encodeUtf8 ( "transfer-encoding" ) ) ; private static final List < ByteString > HTTP_2_PROHIBITED_HEADERS = Util . immutableList ( ByteString . encodeUtf8 ( "connection" ) , ByteString . encodeUtf8 ( "host" ) , ByteString . encodeUtf8 ( "keep-alive" ) , ByteString . encodeUtf8 ( "proxy-connection" ) , ByteString . encodeUtf8 ( "te" ) , ByteString . encodeUtf8 ( "transfer-encoding" ) , ByteString . encodeUtf8 ( "encoding" ) , ByteString . encodeUtf8 ( "upgrade" ) ) ; private final HttpEngine httpEngine ; private final FramedConnection framedConnection ; private FramedStream stream ; public FramedTransport ( HttpEngine httpEngine , FramedConnection framedConnection ) { } @ Override public Sink createRequestBody ( Request request , long contentLength ) throws IOException { } @ Override public void writeRequestHeaders ( Request request ) throws IOException { if ( ( stream ) != null ) return ; httpEngine . writingRequestHeaders ( ) ; <START_BUG> boolean permitsRequestBody = httpEngine . permitsRequestBody ( ) ; <END_BUG> boolean hasResponseBody = true ; String version = RequestLine . version ( httpEngine . getConnection ( ) . getProtocol ( ) ) ; stream = framedConnection . newStream ( FramedTransport . writeNameValueBlock ( request , framedConnection . getProtocol ( ) , version ) , permitsRequestBody , hasResponseBody ) ; stream . readTimeout ( ) . timeout ( httpEngine . client . getReadTimeout ( ) , TimeUnit . MILLISECONDS ) ; } @ Override public void writeRequestBody ( RetryableSink requestBody ) throws IOException { } @ Override public void finishRequest ( ) throws IOException { } @ Override public Builder readResponseHeaders ( ) throws IOException { } public static List < Header > writeNameValueBlock ( Request request , Protocol protocol , String version ) { } private static String joinOnNull ( String first , String second ) { } public static Builder readNameValueBlock ( List < Header > headerBlock , Protocol protocol ) throws IOException { } @ Override public ResponseBody openResponseBody ( Response response ) throws IOException { } @ Override public void releaseConnectionOnIdle ( ) { } @ Override public void disconnect ( HttpEngine engine ) throws IOException { } @ Override public boolean canReuseConnection ( ) { } private static boolean isProhibitedHeader ( Protocol protocol , ByteString name ) { } }

Fix:
boolean permitsRequestBody = httpEngine . permitsRequestBody ( request ) ;
Buggy code:
public class GraphicsEngine extends JPanel { private static final long serialVersionUID = 1756239984776600738L ; private final Environment m_environnement ; private final AffineTransform m_affineTransform ; public GraphicsEngine ( final Environment _environnement ) { } @ Override public void paint ( final Graphics _g ) { } private void drawMap ( final Graphics _g ) { } private void drawEntities ( final Graphics _g ) { } public void drawSprite ( final Sprite _sprite , final Graphics _g ) { Graphics2D g2d = ( ( Graphics2D ) ( _g ) ) ; m_affineTransform . setToIdentity ( ) ; if ( ( _sprite . getTexture ( ) ) != null ) { Rectangle2i blitRect = _sprite . getSpriteRect ( ) ; Rectangle2f drawRect = _sprite . getWorldRect ( ) ; Image img = _sprite . getTexture ( ) . getImage ( ) . getSubimage ( blitRect . getMinX ( ) , blitRect . getMinY ( ) , blitRect . getWidth ( ) , blitRect . getHeight ( ) ) ; double sx = ( drawRect . getWidth ( ) ) // ( blitRect . getWidth ( ) ) ; double sy = ( drawRect . getHeight ( ) ) // ( blitRect . getHeight ( ) ) ; m_affineTransform . scale ( sx , sy ) ; <START_BUG> m_affineTransform . translate ( blitRect . getMinX ( ) , blitRect . getMinY ( ) ) ; <END_BUG> g2d . drawImage ( img , m_affineTransform , null ) ; } else { Rectangle2f drawRect = _sprite . getWorldRect ( ) ; g2d . setColor ( Color . CYAN ) ; g2d . fillRect ( ( ( int ) ( drawRect . getMinX ( ) ) ) , ( ( int ) ( drawRect . getMinY ( ) ) ) , ( ( int ) ( drawRect . getWidth ( ) ) ) , ( ( int ) ( drawRect . getHeight ( ) ) ) ) ; g2d . setColor ( Color . WHITE ) ; } } }

Fix:
m_affineTransform . translate ( drawRect . getMinX ( ) , drawRect . getMinY ( ) ) ;
Buggy code:
public class FlowGraphTest extends StreamTest { public FlowGraphTest ( ) { } @ ClassRule public static AkkaJUnitActorSystemResource actorSystemResource = new AkkaJUnitActorSystemResource ( "FlowGraphTest" , AkkaSpec . testConf ( ) ) ; public < T > Creator < Stage < T , T > > op ( ) { } @ Test public void mustBeAbleToUseMerge ( ) throws Exception { } @ Test public void mustBeAbleToUseZip ( ) { } @ Test public void mustBeAbleToUseUnzip ( ) { } @ Test public void mustBeAbleToUseZipWith ( ) throws Exception { } @ Test public void mustBeAbleToUseZip4With ( ) throws Exception { final Source < Integer , BoxedUnit > in1 = Source . single ( 1 ) ; final Source < Integer , BoxedUnit > in2 = Source . single ( 10 ) ; final Source < Integer , BoxedUnit > in3 = Source . single ( 100 ) ; final Source < Integer , BoxedUnit > in4 = Source . single ( 1000 ) ; <START_BUG> final Graph < FanInShape4 < Integer , Integer , Integer , Integer , Integer > , BoxedUnit > sumZip = ZipWith . create ( new Function4 < Integer , Integer , Integer , Integer , Integer > ( ) { <END_BUG> @ Override public Integer apply ( Integer i1 , Integer i2 , Integer i3 , Integer i4 ) throws Exception { return ( ( i1 + i2 ) + i3 ) + i4 ; } } ) ; final Future < Integer > future = FlowGraph . factory ( ) . closed ( Sink . < Integer > head ( ) , new Procedure2 < Builder < Future < Integer > > , SinkShape < Integer > > ( ) { @ Override public void apply ( Builder < Future < Integer > > b , SinkShape < Integer > out ) throws Exception { final FanInShape4 < Integer , Integer , Integer , Integer , Integer > zip = b . graph ( sumZip ) ; b . edge ( b . source ( in1 ) , zip . in0 ( ) ) ; b . edge ( b . source ( in2 ) , zip . in1 ( ) ) ; b . edge ( b . source ( in3 ) , zip . in2 ( ) ) ; b . edge ( b . source ( in4 ) , zip . in3 ( ) ) ; b . edge ( zip . out ( ) , out . inlet ( ) ) ; } } ) . run ( materializer ) ; final Integer result = Await . result ( future , Duration . create ( 300 , TimeUnit . MILLISECONDS ) ) ; assertEquals ( 1111 , ( ( int ) ( result ) ) ) ; } @ Test public void mustBeAbleToUseMatValue ( ) throws Exception { } }

Fix:
final Graph < FanInShape4 < Integer , Integer , Integer , Integer , Integer > , BoxedUnit > sumZip = ZipWith . create4 ( new Function4 < Integer , Integer , Integer , Integer , Integer > ( ) {
Buggy code:
public class LoginModulesAttributeDefinition extends ListAttributeDefinition { public static final ParameterValidator validator ; public static final ParameterValidator fieldValidator ; public LoginModulesAttributeDefinition ( String name , String xmlName ) { } @ Override protected void addValueTypeDescription ( ModelNode node , ResourceBundle bundle ) { } @ Override protected void addAttributeValueTypeDescription ( ModelNode node , ResourceDescriptionResolver resolver , Locale locale , ResourceBundle bundle ) { } @ Override protected void addOperationParameterValueTypeDescription ( ModelNode node , String operationName , ResourceDescriptionResolver resolver , Locale locale , ResourceBundle bundle ) { } public static ModelNode parseField ( String name , String value , XMLStreamReader reader ) throws XMLStreamException { } @ Override public void marshallAsElement ( ModelNode resourceModel , XMLStreamWriter writer ) throws XMLStreamException { } private ModelNode getNoTextValueTypeDescription ( final ModelNode parent ) { final ModelNode valueType = parent . get ( VALUE_TYPE ) ; final ModelNode code = valueType . get ( CODE ) ; code . get ( DESCRIPTION ) ; code . get ( TYPE ) . set ( STRING ) ; code . get ( NILLABLE ) . set ( false ) ; code . get ( MIN_LENGTH ) . set ( 1 ) ; final ModelNode flag = valueType . get ( FLAG ) ; flag . get ( DESCRIPTION ) ; flag . get ( TYPE ) . set ( STRING ) ; flag . get ( NILLABLE ) . set ( false ) ; for ( ModuleFlag value : ModuleFlag . values ( ) ) <START_BUG> flag . get ( ALLOWED ) . add ( value . name ( ) ) ; <END_BUG> final ModelNode moduleOptions = valueType . get ( MODULE_OPTIONS ) ; moduleOptions . get ( DESCRIPTION ) ; moduleOptions . get ( TYPE ) . set ( OBJECT ) ; moduleOptions . get ( VALUE_TYPE ) . set ( STRING ) ; moduleOptions . get ( NILLABLE ) . set ( true ) ; return valueType ; } }

Fix:
flag . get ( ALLOWED ) . add ( value . toString ( ) ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { public static final int MAIN_LOADALLONLINEDATA = 100 ; public static final int MAIN_LOADONLINECONTACTLIST = 101 ; public static final int SHOWTOAST = 102 ; public static final int MAIN_HANDLENEWMESSAGES = 103 ; public int currentPage = NavBarButton . CHATS ; protected NavBarButton navBarChats = null ; protected NavBarButton navBarContacts = null ; protected NavBarButton navBarDiscovery = null ; protected NavBarButton navBarMe = null ; protected MainAsyncTask asyncTask = null ; public MainActivity . MainActivityHandler handler = new MainActivity . MainActivityHandler ( ) ; protected ViewPager mainViewPager = null ; protected View chatsView = null ; protected View friendsView = null ; protected View discoveryView = null ; protected View meView = null ; protected AnimatedExpandableListView contactListView = null ; protected Users usersAPI = null ; protected ListView chatList = null ; protected boolean isNotifierServiceBound = false ; protected ReloginReceiver reloginReceiver = null ; protected NewMessageReceiver newMessageReceiver = null ; protected Messages messagesAPI = null ; protected Chats chatsAPI = null ; public void test ( ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } public void loadAllOnlineData ( ) { } public void loadCachedData ( ) { } public void loadContactViewList ( List < ContentValues > contactsInfo ) { } @ Override protected void onDestroy ( ) { } public void updateChatList ( ) { <START_BUG> chatsAPI . importFromNewMessages ( messagesAPI . getCachedNonHandledMessages ( "" , "" , "" ) ) ; <END_BUG> List < ContentValues > list = chatsAPI . getChatList ( ) ; Log . d ( "test" , ( ( list . size ( ) ) + "" ) ) ; chatList . setAdapter ( new ChatListAdapter ( this , list ) ) ; } public void initNotifierService ( ) { } protected class MainActivityHandler extends Handler { @ Override public void handleMessage ( Message msg ) { } } ServiceConnection conn = new ServiceConnection ( ) { @ Override public void onServiceConnected ( ComponentName name , IBinder service ) { } @ Override public void onServiceDisconnected ( ComponentName name ) { } } ; private OnPageChangeListener mainViewPagerListener = new ViewPager . OnPageChangeListener ( ) { @ Override public void onPageSelected ( int pageIndex ) { } @ Override public void onPageScrolled ( int arg0 , float arg1 , int arg2 ) { } @ Override public void onPageScrollStateChanged ( int arg0 ) { } } ; protected void initNavBar ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void onPageChanged ( int page , boolean changePage ) { } }

Fix:
chatsAPI . importFromNewMessages ( messagesAPI . getAllCachedNonHandledMessage ( ) ) ;
Buggy code:
public abstract class WorkbenchPart implements IExecutableExtension , IWorkbenchPart2 , IWorkbenchPartOrientation { private String title = "" ; private ImageDescriptor imageDescriptor ; private Image titleImage ; private String toolTip = "" ; private IConfigurationElement configElement ; private IWorkbenchPartSite partSite ; private ListenerList propChangeListeners = new ListenerList ( 2 ) ; private String partName = "" ; private String contentDescription = "" ; protected WorkbenchPart ( ) { } public void addPropertyListener ( IPropertyListener l ) { } public abstract void createPartControl ( Composite parent ) { } public void dispose ( ) { } protected void firePropertyChange ( final int propertyId ) { } public Object getAdapter ( Class adapter ) { } protected IConfigurationElement getConfigurationElement ( ) { } protected Image getDefaultImage ( ) { } public IWorkbenchPartSite getSite ( ) { } public String getTitle ( ) { } public Image getTitleImage ( ) { } public String getTitleToolTip ( ) { } public void removePropertyListener ( IPropertyListener l ) { } public abstract void setFocus ( ) { } public void setInitializationData ( IConfigurationElement cfig , String propertyName , Object data ) { configElement = cfig ; partName = Util . safeString ( cfig . getAttribute ( "name" ) ) ; title = partName ; String strIcon = cfig . getAttribute ( "icon" ) ; if ( strIcon == null ) return ; <START_BUG> imageDescriptor = AbstractUIPlugin . imageDescriptorFromPlugin ( configElement . getDeclaringExtension ( ) . getNamespace ( ) , strIcon ) ; <END_BUG> if ( ( imageDescriptor ) == null ) return ; titleImage = JFaceResources . getResources ( ) . createImageWithDefault ( imageDescriptor ) ; } protected void setSite ( IWorkbenchPartSite site ) { } protected void checkSite ( IWorkbenchPartSite site ) { } protected void setTitle ( String title ) { } protected void setTitleImage ( Image titleImage ) { } protected void setTitleToolTip ( String toolTip ) { } public void showBusy ( boolean busy ) { } public String getPartName ( ) { } protected void setPartName ( String partName ) { } void setDefaultTitle ( ) { } public String getContentDescription ( ) { } protected void setContentDescription ( String description ) { } void internalSetContentDescription ( String description ) { } void internalSetPartName ( String partName ) { } public int getOrientation ( ) { } }

Fix:
imageDescriptor = AbstractUIPlugin . imageDescriptorFromPlugin ( configElement . getNamespace ( ) , strIcon ) ;
Buggy code:
public class PageParametersTest extends TestCase { public void test_1 ( ) { } public void test_2 ( ) { } public void test_3 ( ) { } public void test_4 ( ) { try { <START_BUG> PageParameters parameters = new PageParameters ( "=test" ) ; <END_BUG> fail ( "Expected<seq2seq4repair_space>an<seq2seq4repair_space>exception:<seq2seq4repair_space>invalid<seq2seq4repair_space>URL<seq2seq4repair_space>parameter" ) ; } catch ( IllegalArgumentException ex ) { } } public void testArray1 ( ) { } public void testNegativeNumberParameter ( ) { } }

Fix:
new PageParameters ( "=test" ) ;
Buggy code:
class ClassFileInfo extends OpenableElementInfo implements SuffixConstants { protected JavaElement [ ] binaryChildren = null ; protected ITypeParameter [ ] typeParameters ; protected ClassFile classFile = null ; ClassFileInfo ( ClassFile classFile ) { } private void generateFieldInfos ( IType type , IBinaryType typeInfo , HashMap newElements , ArrayList childrenHandles ) { } private void generateInnerClassHandles ( IType type , IBinaryType typeInfo , ArrayList childrenHandles ) { IBinaryNestedType [ ] innerTypes = typeInfo . getMemberTypes ( ) ; if ( innerTypes != null ) { for ( int i = 0 , typeCount = innerTypes . length ; i < typeCount ; i ++ ) { IBinaryNestedType binaryType = innerTypes [ i ] ; IClassFile parentClassFile = ( ( IPackageFragment ) ( this . classFile . getParent ( ) ) ) . getClassFile ( ( ( new String ( ClassFile . unqualifiedName ( binaryType . getName ( ) ) ) ) + ( SuffixConstants . SUFFIX_STRING_class ) ) ) ; <START_BUG> IType innerType = new BinaryType ( ( ( JavaElement ) ( parentClassFile ) ) , new String ( ClassFile . simpleName ( binaryType . getName ( ) ) ) ) ; <END_BUG> childrenHandles . add ( innerType ) ; } } } private void generateMethodInfos ( IType type , IBinaryType typeInfo , HashMap newElements , ArrayList childrenHandles , ArrayList typeParameterHandles ) { } private void generateTypeParameterInfos ( BinaryMember parent , char [ ] signature , HashMap newElements , ArrayList typeParameterHandles ) { } IJavaElement [ ] getBinaryChildren ( HashMap newElements ) { } boolean hasReadBinaryChildren ( ) { } protected void readBinaryChildren ( HashMap newElements , IBinaryType typeInfo ) { } void removeBinaryChildren ( ) throws JavaModelException { } }

Fix:
IType innerType = new BinaryType ( ( ( JavaElement ) ( parentClassFile ) ) , ClassFile . simpleName ( binaryType . getName ( ) ) ) ;
Buggy code:
public class EclipseFileTransferAndLaunch extends EclipseFileTransfer { private static final long serialVersionUID = - 7524767418102487435L ; public EclipseFileTransferAndLaunch ( ) { } public void sendDone ( FileTransferSharedObject obj , Exception e ) { } private void launchFile ( String fileName ) { try { Program . launch ( fileName ) ; } catch ( final IllegalArgumentException e1 ) { <START_BUG> ClientPlugin . log ( ( ( MessageLoader . getString ( "EclipseFileTransferAndLaunch.EXCEPTION_LAUNCHING" ) ) + ( localFile ) ) , e1 ) ; <END_BUG> Display . getDefault ( ) . asyncExec ( new Runnable ( ) { public void run ( ) { MessageDialog . openInformation ( null , MessageLoader . getString ( MessageLoader . getString ( "EclipseFileTransferAndLaunch.PROGRAM_LAUNCH_MSGBOX_TITLE" ) ) , MessageLoader . getString ( NLS . bind ( MessageLoader . getString ( "EclipseFileTransferAndLaunch.PROGRAM_LAUNCH_MSGBOX_TEXT" ) , localFile . getAbsolutePath ( ) , e1 . getMessage ( ) ) ) ) ; } } ) ; } } public void receiveDone ( FileTransferSharedObject obj , Exception e ) { } }

Fix:
ClientPlugin . log ( MessageLoader . getFormattedString ( "EclipseFileTransferAndLaunch.EXCEPTION_LAUNCHING" , localFile ) , e1 ) ;
Buggy code:
public final class PegasusSolverTest extends BaseSecantSolverAbstractTest { @ Override <START_BUG> protected UnivariateRealSolver getSolver ( ) { <END_BUG> return new PegasusSolver ( ) ; } @ Override protected int [ ] getQuinticEvalCounts ( ) { } }

Fix:
protected UnivariateSolver getSolver ( ) {
Buggy code:
public class OutboxFolder extends CachedMHFolder { private SendListManager [ ] sendListManager = new SendListManager [ 2 ] ; private int actSender ; private boolean isSending ; protected OutboxFolder . OutboxHeaderCache cache ; public OutboxFolder ( FolderItem item ) { } public AbstractMessage getMessage ( Object uid , WorkerStatusController worker ) throws Exception { if ( ( aktMessage ) != null ) { if ( aktMessage . getUID ( ) . equals ( uid ) ) { log . info ( "using<seq2seq4repair_space>already<seq2seq4repair_space>cached<seq2seq4repair_space>message.." ) ; return aktMessage ; } } String source = getMessageSource ( uid , worker ) ; <START_BUG> AbstractMessage message = new Rfc822Parser ( ) . parse ( source , true , null , 0 ) ; <END_BUG> message . setUID ( uid ) ; SendableHeader header = ( ( SendableHeader ) ( getHeaderList ( worker ) . get ( uid ) ) ) ; SendableMessage sendableMessage = new SendableMessage ( ) ; sendableMessage . setHeader ( header ) ; sendableMessage . setMimePartTree ( message . getMimePartTree ( ) ) ; sendableMessage . setSource ( source ) ; aktMessage = sendableMessage ; return sendableMessage ; } public String getDefaultChild ( ) { } private void swapListManagers ( ) throws Exception { } public void stoppedSending ( ) { } public void save ( WorkerStatusController worker ) throws Exception { } class OutboxHeaderCache extends LocalHeaderCache { public OutboxHeaderCache ( CachedFolder folder ) { } public HeaderInterface createHeaderInstance ( ) { } protected void loadHeader ( ObjectInputStream p , HeaderInterface h ) throws Exception { } protected void saveHeader ( ObjectOutputStream p , HeaderInterface h ) throws Exception { } } }

Fix:
AbstractMessage message = new Rfc822Parser ( ) . parse ( source , null ) ;
Buggy code:
public class MarshallingView extends AbstractView { public static final String DEFAULT_CONTENT_TYPE = "application//xml" ; private Marshaller marshaller ; private String modelKey ; public MarshallingView ( ) { } public MarshallingView ( Marshaller marshaller ) { } public void setMarshaller ( Marshaller marshaller ) { } public void setModelKey ( String modelKey ) { } @ Override protected void initApplicationContext ( ) { } @ Override protected void renderMergedOutputModel ( Map < String , Object > model , HttpServletRequest request , HttpServletResponse response ) throws Exception { Object toBeMarshalled = locateToBeMarshalled ( model ) ; if ( toBeMarshalled == null ) { throw new IllegalStateException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>object<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>marshalled<seq2seq4repair_space>in<seq2seq4repair_space>model:<seq2seq4repair_space>" + model ) ) ; } <START_BUG> ByteArrayOutputStream bos = new ByteArrayOutputStream ( 2048 ) ; <END_BUG> this . marshaller . marshal ( toBeMarshalled , new StreamResult ( bos ) ) ; setResponseContentType ( request , response ) ; response . setContentLength ( bos . size ( ) ) ; StreamUtils . copy ( bos . toByteArray ( ) , response . getOutputStream ( ) ) ; } protected Object locateToBeMarshalled ( Map < String , Object > model ) throws IllegalStateException { } }

Fix:
ByteArrayOutputStream bos = new ByteArrayOutputStream ( 1024 ) ;
Buggy code:
public class PawnSpawnHandler extends BaseClientRequestHandler { @ Override public void handleClientRequest ( User user , ISFSObject data ) { PawnModel pawnModel = ( ( PawnModel ) ( data . getClass ( "pawn" ) ) ) ; Pawn pawn = new Pawn ( pawnModel ) ; pawn . stims = data . getIntArray ( "stims" ) ; MainExtension extension = ( ( MainExtension ) ( getParentExtension ( ) ) ) ; extension . viewManager . addView ( pawn ) ; ISFSObject res = new SFSObject ( ) ; if ( data . getBool ( "Scene" ) ) { pawn . owner = null ; pawn . player = null ; pawn . isAi = data . getBool ( "isAI" ) ; if ( pawn . isAi ) { pawn . aiSwarmId = data . getInt ( "group" ) ; pawn . aihome = data . getInt ( "home" ) ; extension . gameRule . director . AddPawn ( pawn ) ; } } else { res . putInt ( "ownerId" , user . getId ( ) ) ; pawn . owner = user ; pawn . setPlayer ( ( ( Player ) ( user . getProperty ( "player" ) ) ) ) ; if ( ! ( data . getBool ( "isAI" ) ) ) { extension . gameRule . spawn ( pawn . team ) ; } pawnModel . team = pawn . team ; pawn . isAi = data . getBool ( "isAI" ) ; } if ( data . containsKey ( "bonus" ) ) { res . put ( "bonus" , data . get ( "bonus" ) ) ; } ISFSArray weapons = data . getSFSArray ( "weapons" ) ; for ( int i = 0 ; i < ( weapons . size ( ) ) ; i ++ ) { WeaponModel weaponModel = ( ( WeaponModel ) ( weapons . getClass ( i ) ) ) ; Weapon weapon = new Weapon ( weaponModel ) ; extension . viewManager . addView ( weapon ) ; weapon . owner = pawn ; } <START_BUG> res . putClass ( "weapons" , weapons ) ; <END_BUG> res . putBool ( "isAI" , data . getBool ( "isAI" ) ) ; res . putClass ( "pawn" , pawnModel ) ; res . putIntArray ( "stims" , pawn . stims ) ; send ( RequestName_PawnSpawn , res , extension . getOther ( user ) ) ; extension . checkOwner ( user , pawn ) ; } }

Fix:
res . putSFSArray ( "weapons" , weapons ) ;