nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class Member extends SourceRefElement implements IMember { protected Member ( JavaElement parent , String name ) { } protected boolean areSimilarMethods ( String name1 , String [ ] params1 , String name2 , String [ ] params2 , String [ ] simpleNames1 ) { } protected static Object convertConstant ( Constant constant ) { } protected boolean equalsDOMNode ( IDOMNode node ) { } protected IMethod [ ] findMethods ( IMethod method , IMethod [ ] methods ) { } public IClassFile getClassFile ( ) { } public IType getDeclaringType ( ) { } public int getFlags ( ) throws JavaModelException { } public IJavaElement getHandleFromMemento ( String token , StringTokenizer memento , WorkingCopyOwner workingCopyOwner ) { } protected char getHandleMementoDelimiter ( ) { } public Member getInnerMostDeclaringMember ( ) { switch ( fParent . getElementType ( ) ) { case IJavaElement . COMPILATION_UNIT : return null ; case IJavaElement . TYPE : Member declaringMember = ( ( Member ) ( fParent ) ) . getInnerMostDeclaringMember ( ) ; <START_BUG> if ( declaringMember == null ) { <END_BUG> return this ; } else { return declaringMember ; } case IJavaElement . INITIALIZER : case IJavaElement . FIELD : case IJavaElement . METHOD : return ( ( Member ) ( fParent ) ) . getInnerMostDeclaringMember ( ) ; } return null ; } public ISourceRange getNameRange ( ) throws JavaModelException { } public IType getType ( String name , int count ) { } public boolean isBinary ( ) { } protected boolean isMainMethod ( IMethod method ) throws JavaModelException { } public boolean isReadOnly ( ) { } public String readableName ( ) { } protected void updateNameRange ( int nameStart , int nameEnd ) { } }

Fix:
if ( ( declaringMember == null ) && ( ( getElementType ( ) ) != ( IJavaElement . TYPE ) ) ) {
Buggy code:
public class PictureTester { public static void testZeroBlue ( ) { <START_BUG> Picture beach = new Picture ( "beach.jpg" ) ; <END_BUG> beach . explore ( ) ; beach . zeroBlue ( ) ; beach . explore ( ) ; } public static void testMirrorVertical ( ) { } public static void testMirrorTemple ( ) { } public static void testCollage ( ) { } public static void testEdgeDetection ( ) { } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
Picture beach = new Picture ( "resources//PicLab//img//beach.jpg" ) ;
Buggy code:
public class Joiner { private static final double MIN_NAME_MATCH = 0.75 ; private static final double SURE_GEO_MATCH = 0.95 ; private List < AdminEntity > entities ; private List < ImportFeature > features ; private int nameAttributeIndex = - 1 ; public Joiner ( List < AdminEntity > entities , List < ImportFeature > features ) { } public List < AdminEntity > joinParents ( ) { } public List < Join > joinOneToOne ( ) { List < Join > joins = Lists . newArrayList ( ) ; Set < ImportFeature > unmatchedFeatures = Sets . newHashSet ( features ) ; Set < AdminEntity > unmatchedEntities = Sets . newHashSet ( entities ) ; for ( AdminEntity unit : entities ) { ImportFeature match = matchExactlyByName ( unit ) ; <START_BUG> if ( ( match != null ) && ( unmatchedEntities . contains ( match ) ) ) { <END_BUG> joins . add ( new Join ( unit , match ) ) ; unmatchedEntities . remove ( unit ) ; unmatchedFeatures . remove ( match ) ; } } for ( AdminEntity entity : Lists . newArrayList ( unmatchedEntities ) ) { ImportFeature match = findBestMatch ( entity , unmatchedFeatures ) ; if ( match != null ) { joins . add ( new Join ( entity , match ) ) ; unmatchedEntities . remove ( entity ) ; unmatchedFeatures . remove ( match ) ; } } for ( AdminEntity entity : unmatchedEntities ) { joins . add ( new Join ( entity , null ) ) ; } for ( ImportFeature feature : unmatchedFeatures ) { joins . add ( new Join ( null , feature ) ) ; } sortJoinsByAdminName ( joins ) ; return joins ; } private void sortJoinsByAdminName ( List < Join > joins ) { } private ImportFeature findBestMatch ( AdminEntity entity , Iterable < ImportFeature > features ) { } private ImportFeature matchExactlyByName ( AdminEntity entity ) { } private AdminEntity findBestMatchingParentEntity ( ImportFeature feature ) { } public double scorePotentialParent ( AdminEntity entity , ImportFeature feature ) { } private String featureName ( ImportFeature feature ) { } public static double areaOfIntersection ( AdminEntity entity , ImportFeature feature ) { } public static double scoreOverlap ( AdminEntity entity , ImportFeature feature ) { } public static double scoreContainment ( ImportFeature feature , AdminEntity entity ) { } public double scoreName ( AdminEntity entity , ImportFeature feature ) { } public void setNameAttributeIndex ( int attributeIndex ) { } }

Fix:
if ( ( match != null ) && ( unmatchedFeatures . contains ( match ) ) ) {
Buggy code:
public class HasClassMatcher extends TypeSafeMatcher < WebElement > { private final String className ; public HasClassMatcher ( String className ) { } @ Override public boolean matchesSafely ( WebElement item ) { } public void describeTo ( Description description ) { <START_BUG> description . appendText ( "element<seq2seq4repair_space>has<seq2seq4repair_space>" ) . appendValue ( className ) ; <END_BUG> } @ Override protected void describeMismatchSafely ( WebElement item , Description mismatchDescription ) { } @ Factory public static Matcher < WebElement > hasClass ( final String className ) { } }

Fix:
description . appendText ( "element<seq2seq4repair_space>has<seq2seq4repair_space>class<seq2seq4repair_space>" ) . appendValue ( className ) ;
Buggy code:
public class FlightReserver { private GridBagConstraints c ; private JPanel panel ; private static int MINIMUM_SEATNO = 1 ; private static int MAXIMUM_CONFNO = Integer . MAX_VALUE ; private int seatCapacity = 0 ; private int seatNumber = 0 ; private int confirmationNo ; private String reservedFlightNo ; private String passportNo = "N239942" ; private String insertClause = "insert<seq2seq4repair_space>into<seq2seq4repair_space>reserves<seq2seq4repair_space>values" ; public void init ( String reservedFlightNo ) { this . reservedFlightNo = reservedFlightNo ; panel = new JPanel ( ) ; c = new GridBagConstraints ( ) ; panel . setLayout ( new GridBagLayout ( ) ) ; frame . add ( panel ) ; bookFlight ( ) ; c . fill = GridBagConstraints . HORIZONTAL ; c . gridx = 0 ; c . gridy = 0 ; c . gridwidth = 5 ; JLabel thankYouLabel = new JLabel ( "Thank<seq2seq4repair_space>you<seq2seq4repair_space>for<seq2seq4repair_space>reserving<seq2seq4repair_space>a<seq2seq4repair_space>flight!" ) ; panel . add ( thankYouLabel , c ) ; c . fill = GridBagConstraints . HORIZONTAL ; c . gridx = 0 ; c . gridy = 1 ; JButton showFlights = new JButton ( "Show<seq2seq4repair_space>My<seq2seq4repair_space>Flights" ) ; showFlights . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent e ) { <START_BUG> Passenger . MyFlights mf = new Passenger . MyFlights ( ) ; <END_BUG> mf . init ( passportNo ) ; panel . setVisible ( false ) ; } } ) ; panel . add ( showFlights , c ) ; c . fill = GridBagConstraints . HORIZONTAL ; c . gridx = 0 ; c . gridy = 2 ; JButton backButton = new JButton ( "Back" ) ; backButton . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent e ) { panel . setVisible ( false ) ; Main . panel . setVisible ( true ) ; } } ) ; panel . add ( backButton , c ) ; } public void bookFlight ( ) { } private void updateAvailableSeats ( ) { } private String generateUpdateClause ( ) { } private void generateValidSeatNo ( ) { } private void generateValidConfirmationNo ( ) { } private String generateInsertClause ( ) { } private void getAvailableSeats ( ) { } }

Fix:
MyFlights mf = new MyFlights ( ) ;
Buggy code:
public class SimpleConfigGui extends AbstractConfigGui implements ActionListener { private JTable table ; private PowerTableModel tableModel ; private JButton add ; private JButton delete ; private static final String ADD = "add" ; private static final String DELETE = "delete" ; private boolean displayName = true ; public static final String [ ] COLUMN_NAMES = new String [ ] { JMeterUtils . getResString ( "name" ) , JMeterUtils . getResString ( "value" ) , JMeterUtils . getResString ( "metadata" ) } ; public SimpleConfigGui ( ) { } public SimpleConfigGui ( boolean displayName ) { } public String getStaticLabel ( ) { <START_BUG> return JMeterUtils . getResString ( "Simple<seq2seq4repair_space>Config<seq2seq4repair_space>Element" ) ; <END_BUG> } public void configure ( TestElement el ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement el ) { } private void init ( ) { } public void actionPerformed ( ActionEvent e ) { } private Component createTablePanel ( ) { } private JPanel createButtonPanel ( ) { } protected void checkDeleteStatus ( ) { } protected void addArgument ( ) { } protected void stopTableEditing ( ) { } protected void deleteArgument ( ) { } }

Fix:
return JMeterUtils . getResString ( "simple_config_element" ) ;
Buggy code:
public abstract class Logger extends LogHandler { protected static PrintWriter defaultSink = new PrintWriter ( new OutputStreamWriter ( System . err ) ) ; protected long day ; private static final String separator = System . getProperty ( "line.separator" , "\n" ) ; public static final char [ ] NEWLINE = Logger . separator . toCharArray ( ) ; public static void setDefaultSink ( Writer w ) { } protected boolean custom = true ; protected String path ; protected boolean timestamp = true ; protected boolean timestampRaw = false ; protected String timestampFormat = "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss" ; protected DateFormat timestampFormatter = new FastDateFormat ( new SimpleDateFormat ( timestampFormat ) ) ; public void setPath ( String path ) { } public String getPath ( ) { } public void open ( ) { if ( ( path ) == null ) return ; long date = System . currentTimeMillis ( ) ; day = getDay ( date ) ; try { File file = new File ( path ) ; String logName = ( ( file . getParent ( ) ) + ( File . separator ) ) + ( getDatePrefix ( date , file . getName ( ) ) ) ; file = new File ( logName ) ; if ( ! ( file . exists ( ) ) ) new File ( file . getParent ( ) ) . mkdirs ( ) ; <START_BUG> this . sink = new PrintWriter ( new FileWriter ( logName ) ) ; <END_BUG> } catch ( IOException ex ) { System . err . print ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>open<seq2seq4repair_space>log<seq2seq4repair_space>file:<seq2seq4repair_space>" + ( path ) ) + "!<seq2seq4repair_space>" ) ) ; System . err . println ( "<seq2seq4repair_space>Using<seq2seq4repair_space>stderr<seq2seq4repair_space>as<seq2seq4repair_space>the<seq2seq4repair_space>default." ) ; this . sink = Logger . defaultSink ; } } public void setVerbosityLevel ( String level ) { } public void setVerbosityLevel ( int level ) { } public int getVerbosityLevel ( ) { } public int getLevel ( ) { } public void setTimestamp ( String value ) { } public boolean isTimestamp ( ) { } public void setTimestampFormat ( String value ) { } public String getTimestampFormat ( ) { } protected String formatTimestamp ( long msec ) { } private static FieldPosition position = new FieldPosition ( DateFormat . YEAR_FIELD ) ; protected void formatTimestamp ( long msec , StringBuffer buf ) { } static final String START_FORMAT = "${" ; static final String END_FORMAT = "}" ; protected String getDatePrefix ( long millis , String format ) { } protected long getDay ( long millis ) { } public static String throwableToString ( Throwable t ) { } public static final int MAX_THROWABLE_DEPTH = 3 ; public static String throwableToString ( Throwable t , String rootcause ) { } private static Object [ ] emptyObjectArray = new Object [ 0 ] ; private static void printThrowable ( PrintWriter w , Throwable t , String rootcause , int depth ) { } }

Fix:
this . sink = new PrintWriter ( new FileWriter ( logName ) , true ) ;
Buggy code:
public class ParameterizedQualifiedTypeReference extends ArrayQualifiedTypeReference { public TypeReference [ ] [ ] typeArguments ; private boolean didResolve = false ; public ParameterizedQualifiedTypeReference ( char [ ] [ ] tokens , TypeReference [ ] [ ] typeArguments , int dim , long [ ] positions ) { } public void checkBounds ( Scope scope ) { if ( ( this . resolvedType ) == null ) return ; <START_BUG> checkBounds ( ( ( ReferenceBinding ) ( this . resolvedType . isArrayType ( ) ? this . resolvedType . leafComponentType ( ) : this . resolvedType ) ) , scope , ( ( this . typeArguments . length ) - 1 ) ) ; <END_BUG> } public void checkBounds ( ReferenceBinding type , Scope scope , int index ) { } public TypeReference copyDims ( int dim ) { } public char [ ] [ ] getParameterizedTypeName ( ) { } protected TypeBinding getTypeBinding ( Scope scope ) { } private TypeBinding internalResolveType ( Scope scope ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public TypeBinding resolveType ( ClassScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } }

Fix:
checkBounds ( ( ( ReferenceBinding ) ( this . resolvedType . leafComponentType ( ) ) ) , scope , ( ( this . typeArguments . length ) - 1 ) ) ;
Buggy code:
public class AbstractSockJsServiceTests extends AbstractHttpRequestTests { private AbstractSockJsServiceTests . TestSockJsService service ; private WebSocketHandler handler ; @ Override @ Before public void setUp ( ) { } @ Test public void getSockJsPathForGreetingRequest ( ) throws Exception { } @ Test public void getSockJsPathForInfoRequest ( ) throws Exception { } @ Test public void getSockJsPathForTransportRequest ( ) throws Exception { } @ Test public void getSockJsPathForTransportRequestWithConfiguredPrefix ( ) throws Exception { } @ Test public void validateRequest ( ) throws Exception { } @ Test public void handleInfoGet ( ) throws Exception { handleRequest ( "GET" , "//a//info" , OK ) ; assertEquals ( "application//json;charset=UTF-8" , this . servletResponse . getContentType ( ) ) ; assertEquals ( "*" , this . servletResponse . getHeader ( "Access-Control-Allow-Origin" ) ) ; assertEquals ( "true" , this . servletResponse . getHeader ( "Access-Control-Allow-Credentials" ) ) ; assertEquals ( "no-store,<seq2seq4repair_space>no-cache,<seq2seq4repair_space>must-revalidate,<seq2seq4repair_space>max-age=0" , this . servletResponse . getHeader ( "Cache-Control" ) ) ; String body = this . servletResponse . getContentAsString ( ) ; assertEquals ( "{\"entropy\"" , body . substring ( 0 , body . indexOf ( ':' ) ) ) ; assertEquals ( ",\"origins\":[\"*:*\"],\"cookie_needed\":false,\"websocket\":true}" , body . substring ( body . indexOf ( ',' ) ) ) ; <START_BUG> this . service . setDummySessionCookieEnabled ( false ) ; <END_BUG> this . service . setWebSocketsEnabled ( false ) ; handleRequest ( "GET" , "//a//info" , OK ) ; body = this . servletResponse . getContentAsString ( ) ; assertEquals ( ",\"origins\":[\"*:*\"],\"cookie_needed\":false,\"websocket\":false}" , body . substring ( body . indexOf ( ',' ) ) ) ; } @ Test public void handleInfoOptions ( ) throws Exception { } @ Test public void handleIframeRequest ( ) throws Exception { } @ Test public void handleIframeRequestNotModified ( ) throws Exception { } @ Test public void handleRawWebSocketRequest ( ) throws Exception { } private void handleRequest ( String httpMethod , String uri , HttpStatus httpStatus ) throws IOException { } @ Test public void handleEmptyContentType ( ) throws Exception { } private static class TestSockJsService extends AbstractSockJsService { private String sessionId ; private String transport ; private WebSocketHandler handler ; public TestSockJsService ( TaskScheduler scheduler ) { } @ Override protected void handleRawWebSocketRequest ( ServerHttpRequest req , ServerHttpResponse res , WebSocketHandler handler ) throws IOException { } @ Override protected void handleTransportRequest ( ServerHttpRequest req , ServerHttpResponse res , WebSocketHandler handler , String sessionId , String transport ) throws SockJsException { } @ Override protected boolean isValidTransportType ( String transportType ) { } } }

Fix:
this . service . setSessionCookieNeeded ( false ) ;
Buggy code:
public class Results { ArrayList < Person > players ; Dealer dealer ; public Results ( ArrayList < Person > players ) { } private void resultsEngine ( ) { } private void checkIfWon ( Person p ) { Player player = ( ( Player ) ( p ) ) ; Hand dealerHand = dealer . hands . get ( 0 ) ; for ( Hand h : p . hands ) { if ( ( ( ( h . getTotal ( ) ) > ( dealerHand . getTotal ( ) ) ) && ( ! ( h . busted ) ) ) || ( ( ( dealerHand . getTotal ( ) ) > 21 ) && ( ! ( h . busted ) ) ) ) { System . out . println ( ( ( ( ( ( p . name ) + "<seq2seq4repair_space>won<seq2seq4repair_space>" ) + ( h . bet ) ) + "<seq2seq4repair_space>with<seq2seq4repair_space>hand:<seq2seq4repair_space>\n" ) + ( h . cards . toString ( ) ) ) ) ; <START_BUG> player . addChips ( h . bet ) ; <END_BUG> } else if ( ( ( h . getTotal ( ) ) == ( dealerHand . getTotal ( ) ) ) && ( ! ( h . busted ) ) ) { System . out . println ( ( ( ( p . name ) + "<seq2seq4repair_space>pushed<seq2seq4repair_space>with<seq2seq4repair_space>hand:<seq2seq4repair_space>\n" ) + ( h . cards . toString ( ) ) ) ) ; ( ( Player ) ( p ) ) . addHand ( 0 ) ; } else { System . out . println ( ( ( ( ( ( p . name ) + "<seq2seq4repair_space>lost<seq2seq4repair_space>" ) + ( h . bet ) ) + "<seq2seq4repair_space>with<seq2seq4repair_space>hand:<seq2seq4repair_space>\n" ) + ( h . cards . toString ( ) ) ) ) ; player . removeChips ( h . bet ) ; } } } private void findDealer ( ) { } }

Fix:
player . addChips ( h . bet , false ) ;
Buggy code:
public class HBaseState implements State { private static final Logger LOG = LoggerFactory . getLogger ( HBaseState . class ) ; private HBaseState . Options options ; private HBaseClient hBaseClient ; private Map map ; private int numPartitions ; private int partitionIndex ; protected HBaseState ( Map map , int partitionIndex , int numPartitions , HBaseState . Options options ) { } public static class Options implements Serializable { private TridentHBaseMapper mapper ; private Durability durability = Durability . SKIP_WAL ; private HBaseProjectionCriteria projectionCriteria ; private HBaseValueMapper rowToStormValueMapper ; private String configKey ; private String tableName ; public HBaseState . Options withDurability ( Durability durability ) { } public HBaseState . Options withProjectionCriteria ( HBaseProjectionCriteria projectionCriteria ) { } public HBaseState . Options withConfigKey ( String configKey ) { } public HBaseState . Options withTableName ( String tableName ) { } public HBaseState . Options withRowToStormValueMapper ( HBaseValueMapper rowToStormValueMapper ) { } public HBaseState . Options withMapper ( TridentHBaseMapper mapper ) { } } protected void prepare ( ) { final Configuration hbConfig = HBaseConfiguration . create ( ) ; Map < String , Object > conf = ( ( Map < String , Object > ) ( map . get ( options . configKey ) ) ) ; if ( conf == null ) { HBaseState . LOG . info ( ( ( "HBase<seq2seq4repair_space>configuration<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>using<seq2seq4repair_space>key<seq2seq4repair_space>'" + ( options . configKey ) ) + "'" ) ) ; HBaseState . LOG . info ( "Using<seq2seq4repair_space>HBase<seq2seq4repair_space>config<seq2seq4repair_space>from<seq2seq4repair_space>first<seq2seq4repair_space>hbase-site.xml<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>classpath." ) ; } else { if ( ( conf . get ( "hbase.rootdir" ) ) == null ) { HBaseState . LOG . warn ( "No<seq2seq4repair_space>'hbase.rootdir'<seq2seq4repair_space>value<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>configuration!<seq2seq4repair_space>Using<seq2seq4repair_space>HBase<seq2seq4repair_space>defaults." ) ; } for ( String key : conf . keySet ( ) ) { <START_BUG> hbConfig . set ( key , String . valueOf ( map . get ( key ) ) ) ; <END_BUG> } } Map < String , Object > hbaseConfMap = new HashMap < String , Object > ( conf ) ; hbaseConfMap . put ( TOPOLOGY_AUTO_CREDENTIALS , map . get ( TOPOLOGY_AUTO_CREDENTIALS ) ) ; this . hBaseClient = new HBaseClient ( hbaseConfMap , hbConfig , options . tableName ) ; } @ Override public void beginCommit ( Long aLong ) { } @ Override public void commit ( Long aLong ) { } public void updateState ( List < TridentTuple > tuples , TridentCollector collector ) { } public List < List < Values > > batchRetrieve ( List < TridentTuple > tridentTuples ) { } }

Fix:
hbConfig . set ( key , String . valueOf ( conf . get ( key ) ) ) ;
Buggy code:
public class TeamHandler { private final ConnectionManager cm ; private HashMap < String , Integer > idbindteam ; public TeamHandler ( Team parent , String database , String user , String password ) throws ClassNotFoundException , SQLException { } public ConnectionManager ConnectionManager ( ) { } private void initTables ( ) throws SQLException { <START_BUG> cm . executeUpdate ( "create<seq2seq4repair_space>table<seq2seq4repair_space>if<seq2seq4repair_space>not<seq2seq4repair_space>exists<seq2seq4repair_space>teams<seq2seq4repair_space>(id<seq2seq4repair_space>INTEGER<seq2seq4repair_space>PRIMARY<seq2seq4repair_space>KEY,<seq2seq4repair_space>name<seq2seq4repair_space>CHAR(8),<seq2seq4repair_space>desc<seq2seq4repair_space>TEXT,<seq2seq4repair_space>motd<seq2seq4repair_space>TEXT)" ) ; <END_BUG> cm . executeUpdate ( "create<seq2seq4repair_space>table<seq2seq4repair_space>if<seq2seq4repair_space>not<seq2seq4repair_space>exists<seq2seq4repair_space>players<seq2seq4repair_space>(id<seq2seq4repair_space>INTEGER<seq2seq4repair_space>PRIMARY<seq2seq4repair_space>KEY,<seq2seq4repair_space>name<seq2seq4repair_space>TEXT,<seq2seq4repair_space>teamid<seq2seq4repair_space>INTEGER);" ) ; } private void initStatements ( ) throws SQLException { } private void populateMap ( ) throws SQLException { } public void close ( boolean graceful ) throws SQLException { } public ResultSet teamGet ( String name ) throws SQLException { } public ResultSet teamGet ( Integer id ) throws SQLException { } public int teamCreate ( String name ) throws SQLException { } public boolean teamDelete ( String name ) throws SQLException { } public boolean teamDelete ( Integer id ) throws SQLException { } public Integer teamGetID ( String name ) { } public boolean teamExists ( String name ) { } public boolean teamExists ( Integer id ) { } public boolean teamSetDescription ( String name , String description ) throws SQLException { } public boolean teamSetDescription ( Integer id , String description ) throws SQLException { } public String teamGetDescription ( String name ) throws SQLException { } public String teamGetDescription ( Integer id ) throws SQLException { } public boolean teamSetMotd ( String name , String motd ) throws SQLException { } public boolean teamSetMotd ( Integer id , String motd ) throws SQLException { } public String teamGetMotd ( String name ) throws SQLException { } public String teamGetMotd ( Integer id ) throws SQLException { } public ArrayList < String > teamGetList ( ) throws SQLException { } public boolean playerCreate ( String name ) throws SQLException { } public boolean playerDelete ( String name ) throws SQLException { } public boolean playerExists ( String name ) throws SQLException { } }

Fix:
cm . executeUpdate ( "create<seq2seq4repair_space>table<seq2seq4repair_space>if<seq2seq4repair_space>not<seq2seq4repair_space>exists<seq2seq4repair_space>teams<seq2seq4repair_space>(id<seq2seq4repair_space>INTEGER<seq2seq4repair_space>PRIMARY<seq2seq4repair_space>KEY,<seq2seq4repair_space>name<seq2seq4repair_space>CHAR(8),<seq2seq4repair_space>desc<seq2seq4repair_space>TEXT,<seq2seq4repair_space>motd<seq2seq4repair_space>TEXT);" ) ;
Buggy code:
public class IdentifierImpl implements Serializable , Identifier { private String _name = null ; protected IdentifierImpl ( ) { } public IdentifierImpl ( String name ) { } public void setName ( String name ) { } public String getName ( ) { } public String toString ( ) { } public int hashCode ( ) { if ( ( _name ) == null ) { return super . hashCode ( ) ; } <START_BUG> return _name . hashCode ( ) ; <END_BUG> } public int length ( ) { } public int compareTo ( Identifier o ) { } }

Fix:
return _name . toUpperCase ( ) . hashCode ( ) ;
Buggy code:
public final class SignInSession extends WebSession { private String user ; protected SignInSession ( Application application ) { } public final boolean authenticate ( final String username , final String password ) { if ( ( user ) == null ) { <START_BUG> if ( ( "jonathan" . equalsIgnoreCase ( username ) ) && ( "password" . equalsIgnoreCase ( password ) ) ) { <END_BUG> user = username ; } } return ( user ) != null ; } public boolean isSignedIn ( ) { } public String getUser ( ) { } public void setUser ( final String user ) { } }

Fix:
if ( ( "wicket" . equalsIgnoreCase ( username ) ) && ( "wicket" . equalsIgnoreCase ( password ) ) ) {
Buggy code:
public abstract class AbstractFolder extends AddressbookTreeNode implements ContactStorage { private static final Logger LOG = Logger . getLogger ( "org.columba.addressbook.folder" ) ; protected EventListenerList listenerList = new EventListenerList ( ) ; protected int nextMessageUid ; private File directoryFile ; private ContactItemCacheStorage cacheStorage ; public AbstractFolder ( String name , String dir ) { } public AbstractFolder ( FolderItem item ) { } public void addFolderListener ( FolderListener l ) { } public void removeFolderListener ( FolderListener l ) { } protected void fireItemAdded ( Object uid ) { } protected void fireItemRemoved ( Object uid ) { } protected void fireItemChanged ( Object uid ) { } public File getDirectoryFile ( ) { } public void createChildren ( WorkerStatusController worker ) { } public ContactItemMap getContactItemMap ( ) throws Exception { } public Object exists ( String contact ) throws Exception { } public void save ( ) throws Exception { } public void load ( ) throws Exception { } public Object add ( Contact contact ) throws Exception { <START_BUG> Object uid = generateNextFolderUid ( ) ; <END_BUG> ContactItem item = new ContactItem ( contact ) ; item . setUid ( uid ) ; cacheStorage . add ( uid , item ) ; fireItemAdded ( uid ) ; return uid ; } public void modify ( Object uid , Contact contact ) throws Exception { } public void remove ( Object uid ) throws Exception { } public abstract Contact get ( Object uid ) throws Exception { } public int count ( ) { } public boolean exists ( Object uid ) { } public HeaderItemList getHeaderItemList ( ) throws Exception { } public int getNextMessageUid ( ) { } public void setNextMessageUid ( int messageUid ) { } public Integer generateNextMessageUid ( ) { } }

Fix:
Object uid = generateNextMessageUid ( ) ;
Buggy code:
public class TestSQLDateId extends SingleEMFTestCase { public void setUp ( ) { } public void testPersist ( ) { } public static void main ( String [ ] args ) { <START_BUG> TestRunner . run ( SQLDateIdEntity . class ) ; <END_BUG> } }

Fix:
TestRunner . run ( TestSQLBigIntegerId . class ) ;
Buggy code:
public class Spring3WebappClassloading extends ASIntegrationTest { private static ServerConfigurationManager serverConfigurationManager ; private TestUserMode userMode ; private WebAppAdminClient webAppAdminClient ; private SqlDataSourceUtil sqlDataSource ; private String webAppName = "spring3-restful-webapp-classloading" ; private String endpointURL = "//student" ; private String webappClassloadingEnv = "webapp-classloading-environments.xml" ; private static File destRuntimeLibDir ; private static File destWebappClassloadingDir ; private static int isRestarted = 0 ; @ Factory ( dataProvider = "userModeProvider" ) public Spring3WebappClassloading ( TestUserMode userMode ) { } @ DataProvider private static TestUserMode [ ] [ ] userModeProvider ( ) { } @ BeforeClass ( alwaysRun = true ) public void init ( ) throws Exception { } @ Test ( groups = "wso2.as" , description = "Upload<seq2seq4repair_space>Spring<seq2seq4repair_space>3<seq2seq4repair_space>WAR<seq2seq4repair_space>and<seq2seq4repair_space>verify<seq2seq4repair_space>deployment" ) public void testSpringWARUpload ( ) throws Exception { } @ Test ( groups = "wso2.as" , description = "Verify<seq2seq4repair_space>Get<seq2seq4repair_space>Operation" , dependsOnMethods = "testSpringWARUpload" ) public void testGetOperation ( ) throws Exception { } @ AfterClass ( alwaysRun = true ) public void restoreServer ( ) throws Exception { } private void createTable ( ) throws Exception { sqlDataSource = new SqlDataSourceUtil ( sessionCookie , asServer . getContextUrls ( ) . getBackEndUrl ( ) ) ; File sqlFile = new File ( ( ( ( ( ( ( ( ( TestConfigurationProvider . getResourceLocation ( ) ) + "artifacts" ) + ( File . separator ) ) + "AS" ) + ( File . separator ) ) + "spring" ) + ( File . separator ) ) + "studentDb.sql" ) ) ; List < File > sqlFileList = new ArrayList < > ( ) ; sqlFileList . add ( sqlFile ) ; <START_BUG> sqlDataSource . createDataSource ( sqlFileList ) ; <END_BUG> } }

Fix:
sqlDataSource . createDataSource ( sqlFileList , "dataService" ) ;
Buggy code:
public class HistoryAdapter extends RecyclerView . Adapter < HistoryAdapter . ViewHolder > { List < String > history ; AppCompatActivity mActivity ; HistoryAdapter ( List < String > history , AppCompatActivity activity ) { } @ Override public int getItemCount ( ) { } @ Override public HistoryAdapter . ViewHolder onCreateViewHolder ( ViewGroup viewGroup , int i ) { View v = LayoutInflater . from ( viewGroup . getContext ( ) ) . inflate ( history_item , viewGroup , false ) ; v . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Display display = ( ( Display ) ( v . findViewById ( history_display ) ) ) ; String source = display . getSource ( ) ; <START_BUG> InputManager . setCurrent ( ( ( source . substring ( 0 , source . indexOf ( '<seq2seq4repair_space>' ) ) ) + "|" ) ) ; <END_BUG> if ( ( mActivity ) != null ) mActivity . finish ( ) ; } } ) ; return new HistoryAdapter . ViewHolder ( v ) ; } @ Override public void onBindViewHolder ( HistoryAdapter . ViewHolder viewHolder , int i ) { } @ Override public void onAttachedToRecyclerView ( RecyclerView recyclerView ) { } public static class ViewHolder extends RecyclerView . ViewHolder { Display display ; TextView result ; ViewHolder ( View data ) { } } }

Fix:
InputManager . setCurrent ( ( source + "|" ) ) ;
Buggy code:
public interface EmployeeMapper { <START_BUG> @ Select ( "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>employees" ) <END_BUG> @ Options ( statementType = StatementType . CALLABLE ) List < Employee > getEmployees ( ) ; @ Select ( "CALL<seq2seq4repair_space>addEmployee(#{dateOfBirth},<seq2seq4repair_space>#{fName},<seq2seq4repair_space>#{lName},<seq2seq4repair_space>#{title},<seq2seq4repair_space>#{picture},<seq2seq4repair_space>#{salary})" ) @ Options ( statementType = StatementType . CALLABLE ) Employee addEmployee ( Employee employee ) { } @ Select ( "CALL<seq2seq4repair_space>updateEmployee(#{id},<seq2seq4repair_space>#{dateOfBirth},<seq2seq4repair_space>#{fName},#{lName},#{title},#{picture},#{salary})" ) @ Options ( statementType = StatementType . CALLABLE ) Employee updateEmployee ( Employee employee ) { } @ Select ( "Call<seq2seq4repair_space>deleteEmployee(#{id})" ) @ Options ( statementType = StatementType . CALLABLE ) boolean deleteEmployee ( Employee employee ) { } }

Fix:
@ Select ( "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>employee" )
Buggy code:
public class LogFragment extends Fragment { private TextView logTextView ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { int id = item . getItemId ( ) ; switch ( id ) { case id . action_clear_log : LogFile . delete ( getActivity ( ) ) ; logTextView . setText ( "" ) ; <START_BUG> Toast . makeText ( getActivity ( ) , "Log<seq2seq4repair_space>deleted" , LENGTH_SHORT ) . show ( ) ; <END_BUG> break ; default : break ; } return super . onOptionsItemSelected ( item ) ; } public static String convertStreamToString ( InputStream is ) throws Exception { } private class LogLoadAsyncTask extends AsyncTask < Void , Void , String > { @ Override protected String doInBackground ( Void ... params ) { } @ Override protected void onPostExecute ( String s ) { } } }

Fix:
Toast . makeText ( getActivity ( ) , log_deleted , LENGTH_SHORT ) . show ( ) ;
Buggy code:
public class LagDetector extends Thread { private long incr = ( LagDetector . MAX_SLEEP ) // ( LagDetector . DIV ) ; private long totalLag ; private int count ; private boolean running ; public static final long MAX_SLEEP = 500 ; private static final long DIV = 3 ; public LagDetector ( ) { } public float getAveLag ( ) { } public float getLagRatio ( ) { } public void stopRunning ( ) { } public void run ( ) { running = true ; long totalTime = 0 ; long time ; totalLag = 0 ; count = 0 ; while ( running ) { time = System . currentTimeMillis ( ) ; try { <START_BUG> Thread . currentThread ( ) . sleep ( incr ) ; <END_BUG> } catch ( Exception e ) { } time = ( System . currentTimeMillis ( ) ) - time ; totalLag += time - ( incr ) ; ( count ) ++ ; } } }

Fix:
Thread . sleep ( incr ) ;
Buggy code:
public class Main { static void welcome ( ) { } public static void main ( String [ ] argv ) { Main . welcome ( ) ; Connect4 NewGame = new Connect4 ( ) ; int state ; Scanner Input = new Scanner ( System . in ) ; do { System . out . println ( ( ( "player" + ( NewGame . getPlayer ( ) ) ) + ":" ) ) ; int IntInput = Input . nextInt ( ) ; state = NewGame . insertCoin ( IntInput ) ; int [ ] [ ] Array = NewGame . getArray ( ) ; int i ; int j ; for ( i = 0 ; i < ( Connect4 . ROWS ) ; i ++ ) { System . out . println ( "......................." ) ; System . out . print ( "||" ) ; for ( j = 0 ; j < ( Connect4 . COLUMNS ) ; j ++ ) System . out . print ( ( ( ( Array [ i ] [ j ] ) == 0 ? "<seq2seq4repair_space>" : Array [ i ] [ j ] ) + "||" ) ) ; System . out . println ( "" ) ; } System . out . println ( "......................." ) ; <START_BUG> } while ( state == 0 ) ; <END_BUG> Input . close ( ) ; System . out . println ( ( state != ( - 1 ) ? "Winner<seq2seq4repair_space>is<seq2seq4repair_space>player" + state : "Draw!" ) ) ; } }

Fix:
} while ( ( state == 0 ) || ( state == ( - 2 ) ) ) ;
Buggy code:
public class TestSwedishLightStemFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testVocabulary ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class CompositeFormat { private CompositeFormat ( ) { } public static NumberFormat getDefaultNumberFormat ( ) { } public static NumberFormat getDefaultNumberFormat ( final Locale locale ) { final NumberFormat nf = NumberFormat . getInstance ( locale ) ; <START_BUG> nf . setMaximumFractionDigits ( 8 ) ; <END_BUG> return nf ; } public static void parseAndIgnoreWhitespace ( final String source , final ParsePosition pos ) { } public static char parseNextCharacter ( final String source , final ParsePosition pos ) { } private static Number parseNumber ( final String source , final double value , final ParsePosition pos ) { } public static Number parseNumber ( final String source , final NumberFormat format , final ParsePosition pos ) { } public static boolean parseFixedstring ( final String source , final String expected , final ParsePosition pos ) { } public static StringBuffer formatDouble ( final double value , final NumberFormat format , final StringBuffer toAppendTo , final FieldPosition pos ) { } }

Fix:
nf . setMaximumFractionDigits ( 2 ) ;
Buggy code:
public class KeyGenerator { private static String randomKey ( Random r ) { <START_BUG> StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> for ( int j = 0 ; j < 16 ; j ++ ) { buffer . append ( ( ( char ) ( r . nextInt ( ) ) ) ) ; } return buffer . toString ( ) ; } static class RandomStringGenerator implements ResetableIterator < String > { int i ; int n ; int seed ; Random random ; RandomStringGenerator ( int seed , int n ) { } public int size ( ) { } public void reset ( ) { } public boolean hasNext ( ) { } public String next ( ) { } public void remove ( ) { } } static class IntGenerator implements ResetableIterator < String > { private int i ; private int start ; private int n ; IntGenerator ( int n ) { } IntGenerator ( int start , int n ) { } public int size ( ) { } public void reset ( ) { } public boolean hasNext ( ) { } public String next ( ) { } public void remove ( ) { } } static class WordGenerator implements ResetableIterator < String > { static int WORDS ; BufferedReader reader ; private int modulo ; private int skip ; String next ; WordGenerator ( int skip , int modulo ) { } public int size ( ) { } public void reset ( ) { } public boolean hasNext ( ) { } public String next ( ) { } public void remove ( ) { } } }

Fix:
StringBuilder buffer = new StringBuilder ( ) ;
Buggy code:
public class SimpleSublinearTFIDFMapper extends SimpleTFIDFMapper { @ Override protected double calculateTFIDF ( int frequency , double wordIDF ) { if ( frequency > 0 ) { <START_BUG> return ( 1 + ( Math . log10 ( frequency ) ) ) * wordIDF ; <END_BUG> } else { return 0 ; } } }

Fix:
return ( 1 + ( Math . log ( frequency ) ) ) * wordIDF ;
Buggy code:
public class EncodeCaseInsensitiveKey implements Function < String , String > { @ Override public String apply ( final String input ) { String res = "" ; for ( int i = 0 ; i < ( input . length ( ) ) ; i ++ ) { final char testChar = input . charAt ( i ) ; <START_BUG> if ( ( Character . isLowerCase ( testChar ) ) || ( testChar == '_' ) ) { <END_BUG> res += testChar ; } else { res += "^" + testChar ; } } return res ; } }

Fix:
if ( ( ( ( Character . isLowerCase ( testChar ) ) || ( testChar == '_' ) ) || ( testChar == '//' ) ) || ( testChar == '-' ) ) {
Buggy code:
public class NameEnvironment implements INameEnvironment { boolean isIncrementalBuild ; ClasspathMultiDirectory [ ] sourceLocations ; ClasspathLocation [ ] binaryLocations ; String [ ] initialTypeNames ; SourceFile [ ] additionalUnits ; NameEnvironment ( IWorkspaceRoot root , JavaProject javaProject , SimpleLookupTable binaryLocationsPerProject ) throws CoreException { } public NameEnvironment ( IJavaProject javaProject ) { } private void computeClasspathLocations ( IWorkspaceRoot root , JavaProject javaProject , SimpleLookupTable binaryLocationsPerProject ) throws CoreException { } public void cleanup ( ) { } void createFolder ( IContainer folder , IProject p ) throws CoreException { if ( ! ( folder . exists ( ) ) ) { IContainer parent = folder . getParent ( ) ; <START_BUG> if ( ( p . getFullPath ( ) ) != ( parent . getFullPath ( ) ) ) <END_BUG> createFolder ( parent , p ) ; ( ( IFolder ) ( folder ) ) . create ( true , true , null ) ; } } private NameEnvironmentAnswer findClass ( String qualifiedTypeName , char [ ] typeName ) { } public NameEnvironmentAnswer findType ( char [ ] [ ] compoundName ) { } public NameEnvironmentAnswer findType ( char [ ] typeName , char [ ] [ ] packageName ) { } public boolean isPackage ( char [ ] [ ] compoundName , char [ ] packageName ) { } public boolean isPackage ( String qualifiedPackageName ) { } void setNames ( String [ ] initialTypeNames , SourceFile [ ] additionalUnits ) { } }

Fix:
if ( ! ( p . getFullPath ( ) . equals ( parent . getFullPath ( ) ) ) )
Buggy code:
public interface Router extends Buildable < RouterBuilder > , Resource { List < ? extends HostRoute > getRoutes ( ) { } boolean isAdminStateUp ( ) { } State getStatus ( ) { } <START_BUG> ExternalGateway getExternalGatewayInfo ( ) ; <END_BUG> }

Fix:
ExternalGatewayInfo getExternalGatewayInfo ( ) ;
Buggy code:
public class Pipeline { public static void main ( String [ ] args ) { Pipeline p = new Pipeline ( ) ; <START_BUG> p . execute ( 1 , 30 ) ; <END_BUG> } public void execute ( int startId , int endId ) { } public void initDataDir ( ) { } public void callFileFetcher ( int startId , int endId ) throws Exception { } public void callFileParser ( int startId , int endId ) throws Exception { } public void callBatchFormulaCalculater ( int startId , int endId ) throws Exception { } public void callShortestUniquePrefixFinder ( ) throws Exception { } No newline ; at end ; of file ; }

Fix:
p . execute ( 1 , Integer . valueOf ( Config . getAttri ( "TARGET_END_ID" ) ) ) ;
Buggy code:
public class JodaDateTimeFormatAnnotationFormatterFactory implements EmbeddedValueResolverAware , AnnotationFormatterFactory < DateTimeFormat > { private static final Set < Class < ? > > FIELD_TYPES ; private StringValueResolver embeddedValueResolver ; public final Set < Class < ? > > getFieldTypes ( ) { } public void setEmbeddedValueResolver ( StringValueResolver resolver ) { } protected String resolveEmbeddedValue ( String value ) { } public Printer < ? > getPrinter ( DateTimeFormat annotation , Class < ? > fieldType ) { } public Parser < DateTime > getParser ( DateTimeFormat annotation , Class < ? > fieldType ) { } protected DateTimeFormatter getFormatter ( DateTimeFormat annotation , Class < ? > fieldType ) { DateTimeFormatterFactory factory = new DateTimeFormatterFactory ( ) ; factory . setStyle ( resolveEmbeddedValue ( annotation . style ( ) ) ) ; factory . setIso ( annotation . iso ( ) ) ; factory . setPattern ( resolveEmbeddedValue ( annotation . pattern ( ) ) ) ; <START_BUG> return factory . getDateTimeFormatter ( ) ; <END_BUG> } }

Fix:
return factory . createDateTimeFormatter ( ) ;
Buggy code:
public class ServerGroupDeploymentReplaceHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = REPLACE_DEPLOYMENT ; static final ModelNode getOperation ( ModelNode address ) { } private final HostFileRepository fileRepository ; private final ParametersValidator validator = new ParametersValidator ( ) ; public ServerGroupDeploymentReplaceHandler ( final HostFileRepository fileRepository ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { <START_BUG> return DeploymentDescription . getDeployDeploymentOperation ( locale ) ; <END_BUG> } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } private static OperationFailedException operationFailed ( String msg ) { } }

Fix:
return DeploymentDescription . getReplaceDeploymentOperation ( locale ) ;
Buggy code:
public class GroupAwareCacheFactory < K extends Serializable , V extends Cacheable < K > > implements CacheFactory < K , V > , BackingCacheLifecycleListener { private final AtomicReference < PassivatingBackingCache < UUID , Cacheable < UUID > , SerializationGroup < K , V , UUID > > > groupCacheRef = new AtomicReference < PassivatingBackingCache < UUID , Cacheable < UUID > , SerializationGroup < K , V , UUID > > > ( ) ; private final AtomicInteger memberCounter = new AtomicInteger ( ) ; private final BackingCacheEntryStoreSource < K , V , UUID > storeSource ; public GroupAwareCacheFactory ( BackingCacheEntryStoreSource < K , V , UUID > storeSource ) { } @ Override public Cache < K , V > createCache ( String beanName , StatefulObjectFactory < V > factory , PassivationManager < K , V > passivationManager , StatefulTimeoutInfo timeout ) { PassivatingBackingCache < UUID , Cacheable < UUID > , SerializationGroup < K , V , UUID > > groupCache = this . groupCacheRef . get ( ) ; if ( groupCache == null ) { groupCache = this . createGroupCache ( passivationManager , timeout ) ; if ( ! ( groupCacheRef . compareAndSet ( null , groupCache ) ) ) { groupCache = this . groupCacheRef . get ( ) ; } } SerializationGroupMemberContainer < K , V , UUID > container = new SerializationGroupMemberContainer < K , V , UUID > ( passivationManager , groupCache , this . storeSource ) ; BackingCacheEntryStore < K , V , SerializationGroupMember < K , V , UUID > > store = storeSource . createIntegratedObjectStore ( beanName , container , timeout ) ; container . setBackingCacheEntryStore ( store ) ; GroupAwareBackingCache < K , V , UUID , SerializationGroupMember < K , V , UUID > > backingCache = new org . jboss . as . ejb3 . cache . impl . backing . GroupAwareBackingCacheImpl < K , V , UUID > ( factory , container , groupCache , Executors . newScheduledThreadPool ( 1 , Executors . defaultThreadFactory ( ) ) ) ; backingCache . addLifecycleListener ( this ) ; <START_BUG> return new org . jboss . as . ejb3 . cache . impl . GroupAwareCache < K , V , UUID , SerializationGroupMember < K , V , UUID > > ( this . storeSource , backingCache , true ) ; <END_BUG> } private PassivatingBackingCache < UUID , Cacheable < UUID > , SerializationGroup < K , V , UUID > > createGroupCache ( PassivationManager < K , V > passivationManager , StatefulTimeoutInfo timeout ) { } @ Override public void lifecycleChange ( LifecycleState newState ) { } }

Fix:
return new org . jboss . as . ejb3 . cache . impl . GroupAwareCache < K , V , UUID , SerializationGroupMember < K , V , UUID > > ( backingCache , true ) ;
Buggy code:
public class WebPagesSessionController extends AbstractComponentSessionController { public WebPagesSessionController ( MainSessionController mainSessionCtrl , ComponentContext componentContext ) { } public String getProfile ( ) { } public boolean haveGotWysiwygNotEmpty ( ) { } public void index ( ) throws WebPagesException { } public synchronized void removeSubscription ( ) { } public synchronized void addSubscription ( ) { } public boolean isSubscriber ( ) { } private NodePK getNodePK ( ) { } private SubscriptionService getSubscribeBm ( ) { } public boolean isSubscriptionUsed ( ) { } private String getUsedXMLTemplate ( ) { } private String getUsedXMLTemplateShortname ( ) { } public boolean isXMLTemplateUsed ( ) { } private PublicationTemplate getXMLTemplate ( ) throws WebPagesException { } public DataRecord getDataRecord ( ) throws WebPagesException { } public boolean isXMLContentDefined ( ) throws WebPagesException { } public Form getViewForm ( ) throws WebPagesException { } public Form getUpdateForm ( ) throws WebPagesException { } public void saveDataRecord ( List < FileItem > items ) throws WebPagesException { RecordSet set ; try { PublicationTemplate pub = getXMLTemplate ( ) ; set = pub . getRecordSet ( ) ; Form form = pub . getUpdateForm ( ) ; DataRecord data = set . getRecord ( "0" ) ; if ( data == null ) { data = set . getEmptyRecord ( ) ; data . setId ( "0" ) ; } PagesContext context = new PagesContext ( "useless" , "0" , getLanguage ( ) , false , getComponentId ( ) , getUserId ( ) ) ; context . setEncoding ( "UTF-8" ) ; context . setObjectId ( "0" ) ; <START_BUG> context . setContentLanguage ( getLanguage ( ) ) ; <END_BUG> form . update ( items , data , context ) ; set . save ( data ) ; } catch ( Exception e ) { throw new WebPagesException ( "WebPagesSessionController.saveDataRecord()" , SilverpeasException . ERROR , "webPages.EX_CANT_SAVE_DATA" , e ) ; } WebPagesUserNotifier . notify ( getNodePK ( ) , getUserId ( ) ) ; indexForm ( set ) ; } private void indexForm ( RecordSet recordSet ) throws WebPagesException { } No newline ; at end ; of file ; }

Fix:
context . setContentLanguage ( defaultLanguage ) ;
Buggy code:
public abstract class BasicFactory extends Factory { private static final long serialVersionUID = 4071505L ; @ Override public Vector createVector ( ) { } @ Override public Vector createVector ( int length ) { } @ Override public Vector createVector ( double [ ] array ) { } @ Override public Vector createVector ( Vector vector ) { } @ Override public Vector createVector ( VectorSource source ) { <START_BUG> return BasicVector . fromSource ( source ) ; <END_BUG> } @ Override public Vector createConstantVector ( int length , double value ) { } @ Override public Vector createRandomVector ( int length , Random random ) { } }

Fix:
return new org . la4j . vector . dense . BasicVector ( source ) ;