nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class ProtoFollowsExtendsChecker extends ContextTrackingChecker { private static final String PROTO_PROPERTY_NAME = "__proto__" ; private static final Set < String > IGNORED_SUPER_TYPES = new HashSet < > ( ) ; private final Set < TypeRecord > typesWithAssignedProto = new HashSet < > ( ) ; private final Set < FunctionRecord > functionsMissingSuperCall = new HashSet < > ( ) ; @ Override protected void enterNode ( Node node ) { } private void handleCall ( Node callNode ) { } private String validSuperConstructorName ( Node callNode ) { } @ Override protected void leaveNode ( Node node ) { } private void enterFunction ( ) { } private void leaveFunction ( ) { } private JSTypeExpression getExtendedTypeToCheck ( FunctionRecord function ) { } private void checkFinished ( ) { for ( TypeRecord record : getState ( ) . getTypeRecordsByTypeName ( ) . values ( ) ) { if ( ( record . isInterface ( ) ) || ( typesWithAssignedProto . contains ( record ) ) ) { continue ; } JSTypeExpression extendedType = record . getExtendedType ( ) ; if ( extendedType != null ) { <START_BUG> Node rootNode = extendedType . getRootNode ( ) ; <END_BUG> if ( ( ( rootNode . getType ( ) ) == ( Token . BANG ) ) && ( ( rootNode . getFirstChild ( ) ) != null ) ) { rootNode = rootNode . getFirstChild ( ) ; } getContext ( ) . reportErrorAtOffset ( rootNode . getSourceOffset ( ) , String . format ( "No<seq2seq4repair_space>__proto__<seq2seq4repair_space>assigned<seq2seq4repair_space>for<seq2seq4repair_space>type<seq2seq4repair_space>%s<seq2seq4repair_space>having<seq2seq4repair_space>@extends" , record . typeName ) ) ; } } } private void handleColonNode ( Node node ) { } private void handleAssignment ( Node assignment ) { } }

Fix:
Node rootNode = extendedType . getRoot ( ) ;
Buggy code:
public abstract class PropPanelStateVertex extends PropPanelModelElement { protected static ImageIcon _stateIcon = ResourceLoader . lookupIconResource ( "State" ) ; protected static ImageIcon _actionStateIcon = ResourceLoader . lookupIconResource ( "ActionState" ) ; protected static ImageIcon _compositeStateIcon = ResourceLoader . lookupIconResource ( "CompositeState" ) ; protected static ImageIcon _simpleStateIcon = ResourceLoader . lookupIconResource ( "SimpleState" ) ; protected static ImageIcon _shallowHistoryIcon = ResourceLoader . lookupIconResource ( "ShallowHistory" ) ; protected static ImageIcon _deepHistoryIcon = ResourceLoader . lookupIconResource ( "DeepHistory" ) ; protected static ImageIcon _finalStateIcon = ResourceLoader . lookupIconResource ( "FinalState" ) ; protected static ImageIcon _initialIcon = ResourceLoader . lookupIconResource ( "Initial" ) ; protected static ImageIcon _forkIcon = ResourceLoader . lookupIconResource ( "Fork" ) ; protected static ImageIcon _joinIcon = ResourceLoader . lookupIconResource ( "Join" ) ; protected static ImageIcon _transitionIcon = ResourceLoader . lookupIconResource ( "Transition" ) ; protected JScrollPane incomingScroll ; protected JScrollPane outgoingScroll ; public PropPanelStateVertex ( String name , int columns ) { } public PropPanelStateVertex ( String name , ImageIcon icon , int columns ) { } public void navigateUp ( ) { } public MStateMachine getStateMachine ( ) { } public List getIncomings ( ) { } public List getOutgoings ( ) { } public void removeElement ( ) { Object target = getTarget ( ) ; if ( target instanceof MStateVertex ) { MStateVertex sv = ( ( MStateVertex ) ( target ) ) ; Object newTarget = sv . getContainer ( ) ; <START_BUG> sv . remove ( ) ; <END_BUG> if ( newTarget != null ) { navigateTo ( newTarget ) ; } } } }

Fix:
UmlFactory . getFactory ( ) . delete ( sv ) ;
Buggy code:
public class JAXPUtilsTest extends TestCase { public JAXPUtilsTest ( String name ) { } public void testGetSystemId ( ) { File file = null ; if ( ( File . separatorChar ) == '\\' ) { file = new File ( "d:\\jdk" ) ; } else { file = new File ( "//user//local//bin" ) ; } String systemid = JAXPUtils . getSystemId ( file ) ; <START_BUG> assertTrue ( "SystemIDs<seq2seq4repair_space>should<seq2seq4repair_space>start<seq2seq4repair_space>by<seq2seq4repair_space>file://////" , systemid . startsWith ( "file://////" ) ) ; <END_BUG> assertTrue ( "SystemIDs<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>start<seq2seq4repair_space>with<seq2seq4repair_space>file:////////" , ( ! ( systemid . startsWith ( "file:////////" ) ) ) ) ; } }

Fix:
assertTrue ( "SystemIDs<seq2seq4repair_space>should<seq2seq4repair_space>start<seq2seq4repair_space>by<seq2seq4repair_space>file://" , systemid . startsWith ( "file://" ) ) ;
Buggy code:
public class Main extends HttpServlet { private static final long serialVersionUID = 1L ; protected static boolean LOCAL_RUN = false ; @ Override protected void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } private void showHome ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { } private void showDatabase ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { } private Connection getConnection ( ) throws URISyntaxException , SQLException { } public static void main ( String [ ] args ) throws Exception { <START_BUG> String para = null ; <END_BUG> if ( ( args . length ) > 0 ) para = args [ 0 ] . toLowerCase ( ) ; if ( para . equals ( "--local" ) ) Main . LOCAL_RUN = true ; int port = 8080 ; String portStr = System . getenv ( "PORT" ) ; if ( portStr != null ) port = Integer . valueOf ( portStr ) ; Server server = new Server ( port ) ; ServletContextHandler context = new ServletContextHandler ( ServletContextHandler . SESSIONS ) ; context . setContextPath ( "//" ) ; server . setHandler ( context ) ; context . addServlet ( new ServletHolder ( new Main ( ) ) , "//*" ) ; context . addServlet ( new ServletHolder ( new ApiServlet ( ) ) , "//api//*" ) ; server . start ( ) ; server . join ( ) ; } }

Fix:
String para = "" ;
Buggy code:
public class CommandUI implements UI { private static int TASKS_PER_PAGE = 20 ; private Scanner _scanner ; private Task [ ] _currentTaskList ; private static boolean _isInitialized ; private static boolean _isUIRunning ; private LocalDateTime _now ; public CommandUI ( ) { } public String readInput ( ) { } public void display ( Task task ) { } public void display ( Task [ ] tasks ) { _currentTaskList = tasks ; _now = LocalDateTime . now ( ) ; int numTasks = tasks . length ; int characters = String . valueOf ( numTasks ) . length ( ) ; int shown = 0 ; for ( int x = 0 ; x < numTasks ; x ++ ) { Task task = tasks [ x ] ; display ( ansi ( ) . fg ( CYAN ) . a ( ( ( "#" + ( padLeft ( String . valueOf ( ( x + 1 ) ) , characters , "0" ) ) ) + ":<seq2seq4repair_space>" ) ) . reset ( ) ) ; if ( ( task . getTaskType ( ) ) == ( TaskType . DEADLINE ) ) { if ( task . getEndDateTime ( ) . isBefore ( _now ) ) { display ( ansi ( ) . fg ( RED ) . a ( String . format ( "[!!!]<seq2seq4repair_space>%s<seq2seq4repair_space>[Overdue<seq2seq4repair_space>by<seq2seq4repair_space>%s]%n" , task . getTitle ( ) , prettyDates ( task . getEndDateTime ( ) ) ) ) . reset ( ) ) ; } else { display ( ansi ( ) . fg ( DEFAULT ) . a ( String . format ( "%s<seq2seq4repair_space>[Due<seq2seq4repair_space>in<seq2seq4repair_space>%s]%n" , task . getTitle ( ) , prettyDates ( task . getEndDateTime ( ) ) ) ) . reset ( ) ) ; } } else if ( ( task . getTaskType ( ) ) == ( TaskType . TIMED ) ) { if ( task . getEndDateTime ( ) . isBefore ( _now ) ) { display ( ansi ( ) . fg ( RED ) . a ( String . format ( "[!!!]<seq2seq4repair_space>%s<seq2seq4repair_space>[Started<seq2seq4repair_space>%s]%n" , task . getTitle ( ) , prettyDates ( task . getStartDateTime ( ) ) ) ) . reset ( ) ) ; } else { display ( ansi ( ) . fg ( DEFAULT ) . a ( String . format ( "%s<seq2seq4repair_space>[Starts<seq2seq4repair_space>in<seq2seq4repair_space>%s]%n" , task . getTitle ( ) , prettyDates ( task . getStartDateTime ( ) ) ) ) . reset ( ) ) ; } } else { <START_BUG> display ( task . getTitle ( ) ) ; <END_BUG> } shown ++ ; } display ( ansi ( ) . a ( String . format ( "---%nShowing<seq2seq4repair_space>%d<seq2seq4repair_space>out<seq2seq4repair_space>of<seq2seq4repair_space>%d<seq2seq4repair_space>tasks%n" , shown , numTasks , 0 ) ) . newline ( ) . reset ( ) ) ; } public void display ( String message ) { } public void display ( Ansi message ) { } public Task getTask ( int index ) throws InvalidTaskException { } public Task [ ] getCurrentTaskList ( ) throws InvalidTaskException { } private void printWelcomeMessage ( ) { } public void run ( ) { } public void exit ( ) { } public boolean isUIRunning ( ) { } public String loadSelectDirectoryDialog ( String currentDirectory ) { } private void printDateHeader ( LocalDate date ) { } private String padLeft ( String str , int length , String padding ) { } private String padRight ( String str , int length , String padding ) { } private String prettyDates ( LocalDateTime dateTime ) { } }

Fix:
display ( ( ( task . getTitle ( ) ) + ( Messages . NEWLINE ) ) ) ;
Buggy code:
public class DeploymentUnitTestCase extends AbstractDeploymentTest { private ServiceContainer serviceContainer ; private final DeploymentChain deploymentChain = new DeploymentChainImpl ( "test.chain" ) ; private static final byte [ ] BLANK_SHA1 = new byte [ 20 ] ; @ Before public void setup ( ) throws Exception { } @ After public void shutdown ( ) { } @ Test public void testDeployVirtualFile ( ) throws Exception { final VirtualFile virtualFile = VFS . getChild ( getResource ( "//test//testDeployment" ) ) ; final DeploymentUnitKey expectedKey = new DeploymentUnitKey ( virtualFile . getName ( ) , DeploymentUnitTestCase . BLANK_SHA1 ) ; <START_BUG> final String expectedDeploymentName = ( ( expectedKey . getName ( ) ) + '_' ) + ( expectedKey . getSha1HashAsHexString ( ) ) ; <END_BUG> final BatchBuilder batchBuilder = serviceContainer . batchBuilder ( ) ; final CountDownLatch latch = new CountDownLatch ( 1 ) ; final TimingServiceListener listener = new TimingServiceListener ( new Runnable ( ) { @ Override public void run ( ) { latch . countDown ( ) ; } } ) ; batchBuilder . addListener ( listener ) ; new org . jboss . as . model . ServerGroupDeploymentElement ( null , virtualFile . getName ( ) , DeploymentUnitTestCase . BLANK_SHA1 , true ) . activate ( new org . jboss . msc . service . ServiceActivatorContextImpl ( batchBuilder ) ) ; batchBuilder . install ( ) ; listener . finishBatch ( ) ; latch . await ( 1L , TimeUnit . SECONDS ) ; if ( ! ( listener . finished ( ) ) ) fail ( "Did<seq2seq4repair_space>not<seq2seq4repair_space>install<seq2seq4repair_space>deployment<seq2seq4repair_space>within<seq2seq4repair_space>1<seq2seq4repair_space>second." ) ; final ServiceController < ? > serviceController = serviceContainer . getService ( SERVICE_NAME . append ( expectedDeploymentName ) ) ; assertNotNull ( serviceController ) ; assertEquals ( UP , serviceController . getState ( ) ) ; } }

Fix:
final String expectedDeploymentName = ( ( expectedKey . getName ( ) ) + ":" ) + ( expectedKey . getSha1HashAsHexString ( ) ) ;
Buggy code:
public class ModificationWatcher implements IModificationWatcher { private static final Logger log = LoggerFactory . getLogger ( ModificationWatcher . class ) ; private final Map < IModifiable , ModificationWatcher . Entry > modifiableToEntry = new ConcurrentHashMap < IModifiable , ModificationWatcher . Entry > ( ) ; private Task task ; private static final class Entry { Time lastModifiedTime ; final ChangeListenerSet listeners = new ChangeListenerSet ( ) ; IModifiable modifiable ; } public ModificationWatcher ( ) { } public ModificationWatcher ( final Duration pollFrequency ) { } public final boolean add ( final IModifiable modifiable , final IChangeListener listener ) { final ModificationWatcher . Entry entry = modifiableToEntry . get ( modifiable ) ; if ( entry == null ) { Time lastModifiedTime = modifiable . lastModifiedTime ( ) ; if ( lastModifiedTime != null ) { final ModificationWatcher . Entry newEntry = new ModificationWatcher . Entry ( ) ; newEntry . modifiable = modifiable ; newEntry . lastModifiedTime = lastModifiedTime ; newEntry . listeners . add ( listener ) ; modifiableToEntry . put ( modifiable , newEntry ) ; } else { ModificationWatcher . log . info ( ( "Cannot<seq2seq4repair_space>track<seq2seq4repair_space>modifications<seq2seq4repair_space>to<seq2seq4repair_space>resource<seq2seq4repair_space>" + modifiable ) ) ; } return true ; } else { <START_BUG> return entry . listeners . add ( listener ) ; <END_BUG> } } public IModifiable remove ( final IModifiable modifiable ) { } public void start ( final Duration pollFrequency ) { } public void destroy ( ) { } public final Set < IModifiable > getEntries ( ) { } }

Fix:
return ! ( entry . listeners . add ( listener ) ) ;
Buggy code:
public class IsErleWaypointProcessorActivity extends BaseRoutableRosActivity { private static final String CONFIGURATION_PUBLISHER_NAME = "space.activity.routes.outputs" ; private static final String CONFIGURATION_SUBSCRIBER_NAME = "space.activity.routes.inputs" ; private static String [ ] publishers ; private static String [ ] subscribers ; private static final String FILE_NAME = "mission.txt" ; private static String fileWithDirectory ; private ManagedCommand fileThread ; private Date lastModified ; @ Override public void onActivitySetup ( ) { getLog ( ) . info ( "Activity<seq2seq4repair_space>is.erle.waypoint.processor<seq2seq4repair_space>setup" ) ; IsErleWaypointProcessorActivity . publishers = getConfiguration ( ) . getRequiredPropertyString ( IsErleWaypointProcessorActivity . CONFIGURATION_PUBLISHER_NAME ) . split ( ":" ) ; IsErleWaypointProcessorActivity . subscribers = getConfiguration ( ) . getRequiredPropertyString ( IsErleWaypointProcessorActivity . CONFIGURATION_SUBSCRIBER_NAME ) . split ( ":" ) ; IsErleWaypointProcessorActivity . fileWithDirectory = ( ( getSpaceEnvironment ( ) . getFilesystem ( ) . getTempDirectory ( ) . getAbsolutePath ( ) ) + "//" ) + ( IsErleWaypointProcessorActivity . FILE_NAME ) ; getLog ( ) . info ( ( "Mission<seq2seq4repair_space>File<seq2seq4repair_space>Source<seq2seq4repair_space>:<seq2seq4repair_space>" + ( IsErleWaypointProcessorActivity . fileWithDirectory ) ) ) ; fileThread = getManagedCommands ( ) . scheduleWithFixedDelay ( new Runnable ( ) { public void run ( ) { File mission = new File ( IsErleWaypointProcessorActivity . fileWithDirectory ) ; if ( mission . exists ( ) ) { if ( ( lastModified ) == null ) { lastModified = new Date ( mission . lastModified ( ) ) ; sendFly ( ) ; } else { Date current = new Date ( mission . lastModified ( ) ) ; if ( ! ( current . equals ( lastModified ) ) ) { sendFly ( ) ; } } } } <START_BUG> } , 25 , 1 , TimeUnit . SECONDS ) ; <END_BUG> } @ Override public void onActivityStartup ( ) { } @ Override public void onActivityPostStartup ( ) { } @ Override public void onActivityActivate ( ) { } @ Override public void onActivityDeactivate ( ) { } @ Override public void onActivityPreShutdown ( ) { } @ Override public void onActivityShutdown ( ) { } @ Override public void onActivityCleanup ( ) { } @ Override public void onNewInputJson ( String channelName , Map < String , Object > message ) { } private void sendFly ( ) { } }

Fix:
} , 20 , 1 , TimeUnit . SECONDS ) ;
Buggy code:
public class Lane extends BorderPane implements ComponentLoader , WrappedContainer { protected List < BinderAnchor > arguments ; protected ResultAnchor result ; protected boolean freshAnchorTypes ; protected boolean firstPhaseInProgress ; protected boolean finalPhaseInProgress ; protected ChoiceBlock parent ; private Pane resizer ; @ FXML protected Pane argumentSpace ; @ FXML protected Pane guardSpace ; @ FXML protected Pane resultSpace ; protected Set < Block > attachedBlocks ; public Lane ( ChoiceBlock wrapper ) { } public Pair < Case . Alternative , Set < OutputAnchor > > getAlternative ( ) { } public ResultAnchor getOutput ( ) { } @ Override public void refreshAnchorTypes ( ) { } @ Override public final void handleConnectionChanges ( boolean finalPhase ) { } public void invalidateVisualState ( ) { } private void setupResizer ( ) { } @ Override public void attachBlock ( Block block ) { } @ Override public void removeBlock ( Block block ) { } @ Override public Stream < Block > getAttachedBlocks ( ) { } @ Override public BlockContainer getParentContainer ( ) { } @ Override protected double computePrefWidth ( double height ) { } @ Override protected double computePrefHeight ( double width ) { } @ Override public Bounds getBoundsInScene ( ) { } @ Override public void deleteAllLinks ( ) { this . arguments . forEach ( OutputAnchor :: removeConnections ) ; this . result . removeConnections ( ) ; <START_BUG> this . attachedBlocks . forEach ( ( block ) -> block . moveIntoContainer ( this . getParentContainer ( ) ) ) ; <END_BUG> } }

Fix:
new java . util . ArrayList ( this . attachedBlocks ) . forEach ( ( block ) -> block . moveIntoContainer ( this . getParentContainer ( ) ) ) ;
Buggy code:
public class JavaModelException extends CoreException { private static final long serialVersionUID = - 760398656505871287L ; CoreException nestedCoreException ; public JavaModelException ( Throwable e , int code ) { } public JavaModelException ( CoreException exception ) { } public JavaModelException ( IJavaModelStatus status ) { } public Throwable getException ( ) { } public IJavaModelStatus getJavaModelStatus ( ) { <START_BUG> IStatus status = this . getStatus ( ) ; <END_BUG> if ( status instanceof IJavaModelStatus ) { return ( ( IJavaModelStatus ) ( status ) ) ; } else { return new JavaModelStatus ( this . nestedCoreException ) ; } } public boolean isDoesNotExist ( ) { } public void printStackTrace ( PrintStream output ) { } public void printStackTrace ( PrintWriter output ) { } public String toString ( ) { } }

Fix:
IStatus status = getStatus ( ) ;
Buggy code:
public class PropertyHelper { private static ApplicationPropertyBean appProperty ; public static BaUnitBean getBaUnitBeanForService ( ApplicationBean appBean , ApplicationServiceBean appService , ContentPanel window , boolean isNewPropertyService ) { } private static BaUnitBean prepareNewProperty ( ApplicationBean appBean , RequestTypeBean requestType ) { BaUnitBean result = new BaUnitBean ( ) ; PartyBean owner = new PartyBean ( ) ; owner . setId ( ( ( appBean . getContactPerson ( ) . getId ( ) ) + "_cp" ) ) ; owner = owner . getPartyBean ( ) ; <START_BUG> if ( owner . isNew ( ) ) { <END_BUG> owner = appBean . getContactPerson ( ) . copy ( ) ; owner . setId ( ( ( appBean . getContactPerson ( ) . getId ( ) ) + "_cp" ) ) ; owner . resetVersion ( ) ; owner . getRoleList ( ) . clear ( ) ; owner . saveParty ( ) ; } RrrShareBean share = new RrrShareBean ( ) ; share . setNominator ( Short . parseShort ( "1" ) ) ; share . setDenominator ( Short . parseShort ( "1" ) ) ; share . getRightHolderList ( ) . add ( owner ) ; String rrrTypeCode = RrrBean . CODE_OWNERSHIP ; if ( CODE_NEW_APARTMENT . equals ( requestType . getCode ( ) ) ) { rrrTypeCode = RrrBean . CODE_APARTMENT ; } else if ( CODE_NEW_STATE . equals ( requestType . getCode ( ) ) ) { rrrTypeCode = RrrBean . CODE_STATE_OWNERSHIP ; } RrrBean ownerRrr = new RrrBean ( ) ; ownerRrr . setTypeCode ( rrrTypeCode ) ; ownerRrr . setPrimary ( true ) ; ownerRrr . setStatusCode ( PENDING ) ; ownerRrr . getNotation ( ) . setNotationText ( requestType . getNotationTemplate ( ) ) ; ownerRrr . getRrrShareList ( ) . add ( share ) ; result . addRrr ( ownerRrr ) ; return result ; } }

Fix:
if ( ( owner == null ) || ( owner . isNew ( ) ) ) {
Buggy code:
public class HtmlParserTester extends TestCase { AnchorModifier parser = new AnchorModifier ( ) ; public HtmlParserTester ( String name ) { } public void testSimpleParse ( ) throws Exception { } public void testSimpleParse2 ( ) throws Exception { } public void testSimpleParse3 ( ) throws Exception { } public void testSimpleParse4 ( ) throws Exception { } public void testSimpleParse5 ( ) throws Exception { } public void testFailSimpleParse1 ( ) throws Exception { } public void testFailSimpleParse3 ( ) throws Exception { } public void testFailSimpleParse2 ( ) throws Exception { } public void testSimpleFormParse ( ) throws Exception { } public void testBadCharParse ( ) throws Exception { } private HTTPSampler makeContext ( String url ) throws MalformedURLException { } private HTTPSampler makeUrlConfig ( String path ) { HTTPSampler config = new HTTPSampler ( ) ; config . setDomain ( "www.apache.org" ) ; <START_BUG> config . setMethod ( config . GET ) ; <END_BUG> config . setPath ( path ) ; config . setPort ( 80 ) ; config . setProtocol ( "http" ) ; return config ; } }

Fix:
config . setMethod ( GET ) ;
Buggy code:
public class Fibonacci { public int fibonacci ( int n ) { } private int fibHelper ( int i , int j , int n ) { if ( n == 2 ) { <START_BUG> return i ; <END_BUG> } return fibHelper ( j , ( i + j ) , ( n - 1 ) ) ; } }

Fix:
return j ;
Buggy code:
public class Activator implements BundleActivator { static final String PLUGIN_ID = "org.eclipse.ecf.examples.updatesite.server" ; static final String UPDATE_SITE_SERVICE_TYPE = Messages . Activator_UPDATE_SITE_SERVICE ; static final String HTTP_SERVICE_TYPE = "http" ; public static final String DEFAULT_SERVICE_TYPE = ( ( ( "_" + ( Activator . UPDATE_SITE_SERVICE_TYPE ) ) + "._" ) + ( Activator . HTTP_SERVICE_TYPE ) ) + "._tcp.local." ; private static final String DEFAULT_SERVICE_PATH = "//update" ; private static final String DEFAULT_SERVICE_NAME_SUFFIX = "<seq2seq4repair_space>update<seq2seq4repair_space>site" ; private String username ; protected String serviceType ; private String serviceName ; private String servicePath ; private String updateSiteName ; private URL updateSiteLocation ; private static Activator plugin ; private BundleContext context ; private ServiceTracker httpServiceTracker ; private ServiceTracker discoveryTracker ; private IDiscoveryContainerAdapter discovery ; private IServiceInfo serviceInfo ; public static Activator getDefault ( ) { } public void setupProperties ( ) throws Exception { } public void setupDiscovery ( ) throws Exception { } public void start ( BundleContext ctxt ) throws Exception { } private void registerService ( String serviceType1 , String serviceName1 , String updateSiteName1 , String servicePath1 ) throws Exception { try { <START_BUG> serviceInfo = new ServiceInfo ( null , getServicePort ( ) , ServiceIDFactory . getDefault ( ) . createServiceID ( discovery . getServicesNamespace ( ) , serviceType1 , serviceName1 ) , new ServiceProperties ( new UpdateSiteProperties ( serviceName1 , servicePath1 ) . toProperties ( ) ) ) ; <END_BUG> discovery . registerService ( serviceInfo ) ; } catch ( final Exception e ) { e . printStackTrace ( ) ; throw e ; } } private int getServicePort ( ) { } public void registerHttpResource ( String alias , String servicePath1 , URL fileSystemLocation ) throws Exception { } public void stop ( BundleContext ctxt ) throws Exception { } public HttpService getHttpService ( ) { } public IDiscoveryService getDiscoveryService ( ) { } }

Fix:
serviceInfo = new ServiceInfo ( Activator . UPDATE_SITE_SERVICE_TYPE , null , getServicePort ( ) , ServiceIDFactory . getDefault ( ) . createServiceID ( discovery . getServicesNamespace ( ) , serviceType1 , serviceName1 ) , new ServiceProperties ( new UpdateSiteProperties ( serviceName1 , servicePath1 ) . toProperties ( ) ) ) ;
Buggy code:
public abstract class AbstractDefaultAjaxBehavior extends AbstractAjaxBehavior { private static final long serialVersionUID = 1L ; public static final ResourceReference INDICATOR = new PackageResourceReference ( AbstractDefaultAjaxBehavior . class , "indicator.gif" ) ; private static final ResourceReference JAVASCRIPT_DEBUG = new JavascriptResourceReference ( AbstractDefaultAjaxBehavior . class , "wicket-ajax-debug.js" ) ; @ Override protected void onBind ( ) { } @ Override public void renderHead ( IHeaderResponse response ) { } protected IAjaxCallDecorator getAjaxCallDecorator ( ) { } protected CharSequence getCallbackScript ( ) { } protected CharSequence getCallbackScript ( boolean onlyTargetActivePage ) { } protected CharSequence getPreconditionScript ( ) { } protected CharSequence getFailureScript ( ) { } protected CharSequence getSuccessScript ( ) { } protected CharSequence generateCallbackScript ( final CharSequence partialCall ) { } protected String getChannelName ( ) { } protected String findIndicatorId ( ) { } public final void onRequest ( ) { WebApplication app = ( ( WebApplication ) ( getComponent ( ) . getApplication ( ) ) ) ; AjaxRequestTarget target = app . newAjaxRequestTarget ( getComponent ( ) . getPage ( ) ) ; RequestCycle requestCycle = RequestCycle . get ( ) ; requestCycle . scheduleRequestHandlerAfterCurrent ( target ) ; Url oldBaseURL = requestCycle . getUrlRenderer ( ) . getBaseUrl ( ) ; WebRequest request = ( ( WebRequest ) ( requestCycle . getRequest ( ) ) ) ; <START_BUG> Url baseURL = Url . parse ( request . getHeader ( "Wicket-Ajax-BaseURL" ) , request . getCharset ( ) ) ; <END_BUG> requestCycle . getUrlRenderer ( ) . setBaseUrl ( baseURL ) ; respond ( target ) ; requestCycle . getUrlRenderer ( ) . setBaseUrl ( oldBaseURL ) ; } protected abstract void respond ( AjaxRequestTarget target ) { } public static CharSequence throttleScript ( CharSequence script , String throttleId , Duration throttleDelay ) { } }

Fix:
Url baseURL = Url . parse ( request . getAjaxBaseUrl ( ) , request . getCharset ( ) ) ;
Buggy code:
public class RunRobot { static Robot robot ; public static void main ( String [ ] args ) { <START_BUG> RunRobot . robot = new TeamFourRobot ( ) ; <END_BUG> RunRobot . robot . currentPos . setNearbyRadius ( 10 ) ; RunRobot . robot . commandList . forEach ( ( command ) -> command . run ( ) ) ; } }

Fix:
RunRobot . robot = new ExampleRobot ( ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class TaskManagementServiceImpl extends RemoteServiceServlet implements TaskManagementService { private static final PersistenceManagerFactory PMF = PMFSingleton . getInstance ( ) ; public TaskListClientView getTasksForDate ( Date date ) { PersistenceManager pm = getPersistenceManager ( ) ; TaskListClientView result = null ; try { Query q = pm . newQuery ( DateBoundTasks . class , "dateString<seq2seq4repair_space>==<seq2seq4repair_space>ds" ) ; q . declareParameters ( "java.lang.String<seq2seq4repair_space>ds" ) ; String key = ResolutionUtils . convertDateToKey ( date ) ; List < DateBoundTasks > tasks = ( ( List < DateBoundTasks > ) ( q . execute ( key ) ) ) ; if ( ( ( tasks . size ( ) ) == 0 ) || ( ( tasks . get ( 0 ) . getTaskDescription ( ) . length ) == 0 ) ) <START_BUG> return new TaskListClientView ( date , new SingleTaskClientView [ ] { } ) ; <END_BUG> DateBoundTasks taskInPersistantView = tasks . get ( 0 ) ; SingleTaskClientView [ ] clientTasks = new SingleTaskClientView [ taskInPersistantView . getTaskDescription ( ) . length ] ; for ( int i = 0 ; i < ( taskInPersistantView . getTaskDescription ( ) . length ) ; i ++ ) clientTasks [ i ] = new SingleTaskClientView ( taskInPersistantView . getTaskDescription ( ) [ i ] , taskInPersistantView . getIsComplete ( ) [ i ] ) ; result = new TaskListClientView ( date , clientTasks ) ; } finally { pm . close ( ) ; } return result ; } private PersistenceManager getPersistenceManager ( ) { } @ Override public void saveTaskList ( TaskListClientView taskList ) { } @ Override public void updateTaskStatus ( TaskListClientView taskList , SingleTaskClientView task , boolean isComplete ) { } @ Override public void addTaskToList ( TaskListClientView taskList , SingleTaskClientView newTask ) { } @ Override public void removeFromTasklist ( TaskListClientView taskList , SingleTaskClientView newTask ) { } }

Fix:
return null ;
Buggy code:
public class IOUtil { public static boolean saveObjectTo ( Object o , String path ) { } public static Object readObjectFrom ( String path ) { } public static String readTxt ( String path ) { } public static LinkedList < String [ ] > readCsv ( String path ) { } public static boolean saveTxt ( String path , String content ) { } public static boolean saveTxt ( String path , StringBuilder content ) { } public static < T > boolean saveCollectionToTxt ( Collection < T > collection , String path ) { } public static byte [ ] readBytes ( String path ) { } public static LinkedList < String > readLineList ( String path ) { } public static LinkedList < String > readLineListWithLessMemory ( String path ) { LinkedList < String > result = new LinkedList < String > ( ) ; String line = null ; try { <START_BUG> BufferedReader bw = new BufferedReader ( new InputStreamReader ( new FileInputStream ( path ) ) ) ; <END_BUG> while ( ( line = bw . readLine ( ) ) != null ) { result . add ( line ) ; } bw . close ( ) ; } catch ( Exception e ) { logger . warning ( ( ( ( "加载" + path ) + "失败，" ) + e ) ) ; } return result ; } public static boolean saveMapToTxt ( Map < Object , Object > map , String path ) { } public static boolean saveMapToTxt ( Map < Object , Object > map , String path , String separator ) { } public static boolean saveEntrySetToTxt ( Set < Map . Entry < Object , Object > > entrySet , String path , String separator ) { } public static IOUtil . LineIterator readLine ( String path ) { } public static class LineIterator implements Iterator < String > { BufferedReader bw ; String line ; public LineIterator ( String path ) { } public void close ( ) { } @ Override public boolean hasNext ( ) { } @ Override public String next ( ) { } @ Override public void remove ( ) { } } }

Fix:
BufferedReader bw = new BufferedReader ( new InputStreamReader ( new FileInputStream ( path ) , "UTF-8" ) ) ;
Buggy code:
final class TvInputHal implements Handler . Callback { private static final boolean DEBUG = false ; private static final String TAG = TvInputHal . class . getSimpleName ( ) ; public static final int SUCCESS = 0 ; public static final int ERROR_NO_INIT = - 1 ; public static final int ERROR_STALE_CONFIG = - 2 ; public static final int ERROR_UNKNOWN = - 3 ; public static final int EVENT_DEVICE_AVAILABLE = 1 ; public static final int EVENT_DEVICE_UNAVAILABLE = 2 ; public static final int EVENT_STREAM_CONFIGURATION_CHANGED = 3 ; public static final int EVENT_FIRST_FRAME_CAPTURED = 4 ; public interface Callback { public void onDeviceAvailable ( TvInputHardwareInfo info , TvStreamConfig [ ] configs ) { } public void onDeviceUnavailable ( int deviceId ) { } public void onStreamConfigurationChanged ( int deviceId , TvStreamConfig [ ] configs ) { } public void onFirstFrameCaptured ( int deviceId , int streamId ) { } } private native long nativeOpen ( MessageQueue queue ) { } private static native int nativeAddOrUpdateStream ( long ptr , int deviceId , int streamId , Surface surface ) { } private static native int nativeRemoveStream ( long ptr , int deviceId , int streamId ) { } private static native TvStreamConfig [ ] nativeGetStreamConfigs ( long ptr , int deviceId , int generation ) { } private static native void nativeClose ( long ptr ) { } private final Object mLock = new Object ( ) ; private long mPtr = 0 ; private final TvInputHal . Callback mCallback ; private final Handler mHandler ; private final SparseIntArray mStreamConfigGenerations = new SparseIntArray ( ) ; private final SparseArray < TvStreamConfig [ ] > mStreamConfigs = new SparseArray ( ) ; public TvInputHal ( TvInputHal . Callback callback ) { } public void init ( ) { } public int addOrUpdateStream ( int deviceId , Surface surface , TvStreamConfig streamConfig ) { } public int removeStream ( int deviceId , TvStreamConfig streamConfig ) { } public void close ( ) { } private void retrieveStreamConfigsLocked ( int deviceId ) { } private void deviceAvailableFromNative ( TvInputHardwareInfo info ) { } private void deviceUnavailableFromNative ( int deviceId ) { } private void streamConfigsChangedFromNative ( int deviceId ) { } private void firstFrameCapturedFromNative ( int deviceId , int streamId ) { <START_BUG> mHandler . sendMessage ( mHandler . obtainMessage ( TvInputHal . EVENT_STREAM_CONFIGURATION_CHANGED , deviceId , streamId ) ) ; <END_BUG> } private final Queue < Message > mPendingMessageQueue = new LinkedList < Message > ( ) ; @ Override public boolean handleMessage ( Message msg ) { } }

Fix:
mHandler . sendMessage ( mHandler . obtainMessage ( TvInputHal . EVENT_FIRST_FRAME_CAPTURED , deviceId , streamId ) ) ;
Buggy code:
public class Native2Ascii extends MatchingTask { private boolean reverse = false ; private String encoding = null ; private File srcDir = null ; private File destDir = null ; private String extension = null ; private Mapper mapper ; public void setDest ( File destDir ) { } public void setEncoding ( String encoding ) { } public void setExt ( String ext ) { } public void setReverse ( boolean reverse ) { } public void setSrc ( File srcDir ) { } public Mapper createMapper ( ) throws TaskException { } public void execute ( ) throws TaskException { Commandline baseCmd = null ; DirectoryScanner scanner = null ; String [ ] files ; if ( ( srcDir ) == null ) { srcDir = resolveFile ( "." ) ; } if ( ( destDir ) == null ) { throw new TaskException ( "The<seq2seq4repair_space>dest<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set." ) ; } if ( ( ( srcDir . equals ( destDir ) ) && ( ( extension ) == null ) ) && ( ( mapper ) == null ) ) { throw new TaskException ( ( "The<seq2seq4repair_space>ext<seq2seq4repair_space>attribute<seq2seq4repair_space>or<seq2seq4repair_space>a<seq2seq4repair_space>mapper<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set<seq2seq4repair_space>if" + "<seq2seq4repair_space>src<seq2seq4repair_space>and<seq2seq4repair_space>dest<seq2seq4repair_space>dirs<seq2seq4repair_space>are<seq2seq4repair_space>the<seq2seq4repair_space>same." ) ) ; } FileNameMapper m = null ; if ( ( mapper ) == null ) { if ( ( extension ) == null ) { m = new IdentityMapper ( ) ; } else { m = new Native2Ascii . ExtMapper ( ) ; } } else { m = mapper . getImplementation ( ) ; } scanner = getDirectoryScanner ( srcDir ) ; files = scanner . getIncludedFiles ( ) ; SourceFileScanner sfs = new SourceFileScanner ( this ) ; files = sfs . restrict ( files , srcDir , destDir , m ) ; int count = files . length ; if ( count == 0 ) { return ; } String message = ( ( ( "Converting<seq2seq4repair_space>" + count ) + "<seq2seq4repair_space>file" ) + ( count != 1 ? "s" : "" ) ) + "<seq2seq4repair_space>from<seq2seq4repair_space>" ; <START_BUG> log ( ( ( ( message + ( srcDir ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( destDir ) ) ) ; <END_BUG> for ( int i = 0 ; i < ( files . length ) ; i ++ ) { convert ( files [ i ] , m . mapFileName ( files [ i ] ) [ 0 ] ) ; } } private void convert ( String srcName , String destName ) throws TaskException { } private class ExtMapper implements FileNameMapper { public void setFrom ( String s ) { } public void setTo ( String s ) { } public String [ ] mapFileName ( String fileName ) { } } }

Fix:
getLogger ( ) . info ( ( ( ( message + ( srcDir ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( destDir ) ) ) ;
Buggy code:
public class ExperimentRunner { private final BackPropagationNetworkFactory networkFactory ; private final int numHiddenNodes ; private final int numIterations ; private final int numRestarts ; private final DataSet trainingData ; private final DataSet testingData ; public ExperimentRunner ( int numHiddenNodes , int numIterations , int numRestarts , DataSet trainingData , DataSet testingData ) { } private Experiment createExperiment ( PrintStream outputStream , Function < NeuralNetworkOptimizationProblem , OptimizationAlgorithm > algorithmFactory ) { } public void runWithRestarts ( String outputFilepath , Function < NeuralNetworkOptimizationProblem , OptimizationAlgorithm > algoFactory ) throws FileNotFoundException { } public void runOnce ( String outputFilepath , Function < NeuralNetworkOptimizationProblem , OptimizationAlgorithm > algoFactory ) throws FileNotFoundException { try ( PrintStream outputStream = new PrintStream ( new File ( outputFilepath ) ) ) { Experiment hillclimbingExp = createExperiment ( outputStream , algoFactory ) ; <START_BUG> hillclimbingExp . runOnce ( ) ; <END_BUG> } } }

Fix:
hillclimbingExp . runOnceWithTiming ( ) ;
Buggy code:
public abstract class AbstractStompEndpointRegistration < M > implements StompEndpointRegistration { private final String [ ] paths ; private final WebSocketHandler wsHandler ; private HandshakeHandler handshakeHandler ; private AbstractStompEndpointRegistration < M > . StompSockJsServiceRegistration sockJsServiceRegistration ; private final TaskScheduler sockJsTaskScheduler ; public AbstractStompEndpointRegistration ( String [ ] paths , WebSocketHandler webSocketHandler , TaskScheduler sockJsTaskScheduler ) { } @ Override public StompEndpointRegistration setHandshakeHandler ( HandshakeHandler handshakeHandler ) { } @ Override public SockJsServiceRegistration withSockJS ( ) { } protected final M getMappings ( ) { } protected abstract M createMappings ( ) { } private HandshakeHandler getOrCreateHandshakeHandler ( ) { } private static SubProtocolWebSocketHandler findSubProtocolWebSocketHandler ( WebSocketHandler webSocketHandler ) { } protected abstract void addSockJsServiceMapping ( M mappings , SockJsService sockJsService , WebSocketHandler wsHandler , String pathPattern ) { } protected abstract void addWebSocketHandlerMapping ( M mappings , WebSocketHandler wsHandler , HandshakeHandler handshakeHandler , String path ) { } private class StompSockJsServiceRegistration extends SockJsServiceRegistration { public StompSockJsServiceRegistration ( TaskScheduler defaultTaskScheduler ) { } protected SockJsService getSockJsService ( ) { <START_BUG> return super . getSockJsService ( paths ) ; <END_BUG> } } }

Fix:
return super . getSockJsService ( ) ;
Buggy code:
public class ImageAlbumListAdapter extends RecyclerView . Adapter < ImageAlbumListAdapter . ViewHolder > { private final int pickCount ; private List < Album > albumlist ; private List < String > thumbList = new ArrayList < String > ( ) ; private String thumPath ; public static class ViewHolder extends RecyclerView . ViewHolder { private ImageView imgAlbum ; private TextView txtAlbum ; private TextView txtAlbumCount ; private RelativeLayout areaAlbum ; public ViewHolder ( View view ) { } } public ImageAlbumListAdapter ( List < Album > albumList , int pickCount ) { } @ Override public ImageAlbumListAdapter . ViewHolder onCreateViewHolder ( ViewGroup parent , int viewType ) { } public void setThumbList ( List < String > thumbList ) { } @ Override public void onBindViewHolder ( final ImageAlbumListAdapter . ViewHolder holder , final int position ) { if ( ( ( thumbList ) != null ) && ( ( thumbList . size ( ) ) > position ) ) thumPath = thumbList . get ( position ) ; if ( ( thumbList ) != null ) { if ( ( thumbList . size ( ) ) > position ) { <START_BUG> Glide . with ( holder . imgAlbum . getContext ( ) ) . load ( thumPath ) . asBitmap ( ) . override ( ALBUM_THUMBNAIL_SIZE , ALBUM_THUMBNAIL_SIZE ) . placeholder ( loading_img ) . into ( holder . imgAlbum ) ; <END_BUG> } else { Glide . with ( holder . imgAlbum . getContext ( ) ) . load ( loading_img ) . into ( holder . imgAlbum ) ; } } holder . areaAlbum . setTag ( albumlist . get ( position ) ) ; Album a = ( ( Album ) ( holder . areaAlbum . getTag ( ) ) ) ; holder . txtAlbum . setText ( albumlist . get ( position ) . bucketname ) ; holder . txtAlbumCount . setText ( String . valueOf ( a . counter ) ) ; holder . areaAlbum . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Album a = ( ( Album ) ( v . getTag ( ) ) ) ; Intent i = new Intent ( holder . areaAlbum . getContext ( ) , ImageGalleryPickerActivity . class ) ; i . putExtra ( "album" , a ) ; i . putExtra ( "album_title" , albumlist . get ( position ) . bucketname ) ; i . putExtra ( "pickCount" , pickCount ) ; ( ( Activity ) ( holder . areaAlbum . getContext ( ) ) ) . startActivityForResult ( i , ENTER_ALBUM_REQUEST_CODE ) ; } } ) ; } @ Override public int getItemCount ( ) { } }

Fix:
Glide . with ( holder . imgAlbum . getContext ( ) ) . load ( thumPath ) . asBitmap ( ) . placeholder ( loading_img ) . into ( holder . imgAlbum ) ;
Buggy code:
public class FindMissedInfo { private static Logger LOG = LoggerFactory . getLogger ( FindMissedInfo . class ) ; public void findProfileInfo ( ArrayList < String > lines , Profile profile ) { int terminatingLine = 0 ; if ( ( lines . size ( ) ) < 15 ) { terminatingLine = lines . size ( ) ; } else { terminatingLine = 15 ; } String name = "" ; String email = null ; boolean chkCtr = false ; Pattern pattern = Pattern . compile ( "(([A-Z]\\.?\\s?)*([A-Z][a-z]+\\.?\\s?)+([A-Z]\\.?\\s?[a-z]*)*)" ) ; Matcher matcher = null ; for ( int a = 0 ; a < terminatingLine ; a ++ ) { matcher = pattern . matcher ( lines . get ( a ) ) ; String tmpEmail = "" ; chkCtr = false ; if ( ( matcher . matches ( ) ) && ( name . equals ( "" ) ) ) { name = matcher . group ( 0 ) ; chkCtr = true ; } if ( ( ! chkCtr ) && ( email == null ) ) { email = getEmail ( lines . get ( a ) ) ; if ( email != null ) { chkCtr = true ; } } if ( ! chkCtr ) { getOtherInfo ( lines . get ( a ) , profile ) ; } } <START_BUG> if ( ( email != null ) && ( ! ( name . equals ( "" ) ) ) ) { <END_BUG> profile . setEmail ( email ) ; profile . setName ( name ) ; } } public String getEmail ( String para ) { } public void getOtherInfo ( String para , Profile profile ) { } }

Fix:
if ( email != null ) {
Buggy code:
public abstract class AbstractDataGridView extends DataViewBase { private static final long serialVersionUID = 1L ; private static final String CELL_REPEATER_ID = "cells" ; private static final String CELL_ITEM_ID = "cell" ; private ICellPopulator [ ] populators ; private transient ArrayIteratorAdapter populatorsIteratorCache ; public AbstractDataGridView ( MarkupContainer parent , final String id , ICellPopulator [ ] populators , IDataProvider dataProvider ) { } private Iterator getPopulatorsIterator ( ) { if ( ( populatorsIteratorCache ) == null ) { populatorsIteratorCache = new ArrayIteratorAdapter ( internalGetPopulators ( ) ) { @ Override <START_BUG> protected IModel model ( Object object ) { <END_BUG> return new Model ( object ) ; } } ; } else { populatorsIteratorCache . reset ( ) ; } return populatorsIteratorCache ; } @ Override protected final void populateItem ( Item item ) { } protected final ICellPopulator [ ] internalGetPopulators ( ) { } @ Override protected final Item newItem ( MarkupContainer parent , final String id , int index , IModel model ) { } protected Item newRowItem ( MarkupContainer parent , final String id , int index , final IModel model ) { } protected Item newCellItem ( MarkupContainer cellContainer , final String id , int index , final IModel model ) { } }

Fix:
protected IModel model ( Object object , int index ) {
Buggy code:
public class RandomAI implements GameAgent { private Random gen = new Random ( ) ; @ Override public void takeTurn ( GameControls controls ) { List < PossibleMove > moves = controls . getValidMoves ( ) ; <START_BUG> PossibleMove move = moves . get ( gen . nextInt ( ) ) ; <END_BUG> controls . playCard ( move . toPlay , move . row , move . col ) ; } }

Fix:
PossibleMove move = moves . get ( gen . nextInt ( moves . size ( ) ) ) ;
Buggy code:
public class Logout extends TimerTask { private final String username ; public Logout ( String username ) { } @ Override public void run ( ) { ActiveUsers . removeUser ( username ) ; <START_BUG> System . out . println ( ( ( username ) + "<seq2seq4repair_space>Logged<seq2seq4repair_space>out" ) ) ; <END_BUG> JsonMessage send = new JsonMessage ( "usernames" , ActiveUsers . getUsernames ( ) ) ; ObjectMapper objectMapper = new ObjectMapper ( ) ; try { String strSend = objectMapper . writeValueAsString ( send ) ; ActiveUsers . broadcast ( strSend ) ; } catch ( IOException ex ) { Logger . getLogger ( Logout . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } ActiveChatRooms . removeUser ( username ) ; } }

Fix:
System . out . println ( ( ( username ) + "<seq2seq4repair_space>Timed<seq2seq4repair_space>out" ) ) ;
Buggy code:
class StructFieldDeclaration { final StructFieldDescription desc = new StructFieldDescription ( ) ; Method setter ; long index = - 1 ; long unionWith = - 1 ; Class < ? > valueClass ; Class < ? > declaringClass ; @ Override public String toString ( ) { } protected static boolean acceptFieldGetter ( Member member , boolean getter ) { } protected static List < StructFieldDeclaration > listFields ( Class < ? > structClass ) { } protected static StructFieldDeclaration fromField ( Field getter ) { StructFieldDeclaration field = StructFieldDeclaration . fromMember ( ( ( Member ) ( getter ) ) ) ; field . desc . field = getter ; <START_BUG> field . desc . valueType = getter . getGenericType ( ) ; <END_BUG> field . valueClass = getter . getType ( ) ; return field ; } protected static StructFieldDeclaration fromGetter ( Method getter ) { } private static StructFieldDeclaration fromMember ( Member member ) { } }

Fix:
field . desc . valueType = TypeResolvers . resolveType ( getter . getGenericType ( ) ) ;
Buggy code:
public class CMBuilder { private XSDeclarationPool fDeclPool = null ; private static XSEmptyCM fEmptyCM = new XSEmptyCM ( ) ; private int fLeafCount ; private int fParticleCount ; public CMBuilder ( ) { } public CMBuilder ( XSDeclarationPool pool ) { } public void setDeclPool ( XSDeclarationPool declPool ) { } public XSCMValidator getContentModel ( XSComplexTypeDecl typeDecl ) { } XSCMValidator createAllCM ( XSParticleDecl particle ) { } XSCMValidator createDFACM ( XSParticleDecl particle ) { } private CMNode buildSyntaxTree ( XSParticleDecl particle ) { } private CMNode expandContentModel ( CMNode node , int minOccurs , int maxOccurs ) { CMNode nodeRet = null ; if ( ( minOccurs == 1 ) && ( maxOccurs == 1 ) ) { nodeRet = node ; } else if ( ( minOccurs == 0 ) && ( maxOccurs == 1 ) ) { nodeRet = new XSCMUniOp ( XSParticleDecl . PARTICLE_ZERO_OR_ONE , node ) ; } else if ( ( minOccurs == 0 ) && ( maxOccurs == ( SchemaSymbols . OCCURRENCE_UNBOUNDED ) ) ) { nodeRet = new XSCMUniOp ( XSParticleDecl . PARTICLE_ZERO_OR_MORE , node ) ; } else if ( ( minOccurs == 1 ) && ( maxOccurs == ( SchemaSymbols . OCCURRENCE_UNBOUNDED ) ) ) { nodeRet = new XSCMUniOp ( XSParticleDecl . PARTICLE_ONE_OR_MORE , node ) ; } else if ( maxOccurs == ( SchemaSymbols . OCCURRENCE_UNBOUNDED ) ) { nodeRet = new XSCMUniOp ( XSParticleDecl . PARTICLE_ONE_OR_MORE , node ) ; for ( int i = 0 ; i < ( minOccurs - 1 ) ; i ++ ) { nodeRet = new XSCMBinOp ( XSModelGroupImpl . MODELGROUP_SEQUENCE , copyNode ( node ) , nodeRet ) ; } } else { if ( minOccurs > 0 ) { nodeRet = node ; for ( int i = 0 ; i < ( minOccurs - 1 ) ; i ++ ) { nodeRet = new XSCMBinOp ( XSModelGroupImpl . MODELGROUP_SEQUENCE , nodeRet , copyNode ( node ) ) ; } } if ( maxOccurs > minOccurs ) { node = new XSCMUniOp ( XSParticleDecl . PARTICLE_ZERO_OR_ONE , node ) ; if ( nodeRet == null ) { nodeRet = node ; } else { nodeRet = new XSCMBinOp ( XSModelGroupImpl . MODELGROUP_SEQUENCE , nodeRet , copyNode ( node ) ) ; } for ( int i = minOccurs ; i < ( maxOccurs - 1 ) ; i ++ ) { <START_BUG> nodeRet = new XSCMBinOp ( XSModelGroupImpl . MODELGROUP_SEQUENCE , nodeRet , node ) ; <END_BUG> } } } return nodeRet ; } private CMNode copyNode ( CMNode node ) { } }

Fix:
nodeRet = new XSCMBinOp ( XSModelGroupImpl . MODELGROUP_SEQUENCE , nodeRet , copyNode ( node ) ) ;
Buggy code:
@ Entity @ Table ( name = "user" , schema = "public" ) public class UserDataSet implements Serializable { private static final long serialVersionUID = - 8706689714326132798L ; @ Id @ Column ( name = "id" ) @ GeneratedValue ( strategy = GenerationType . IDENTITY ) private int id ; @ Column ( name = "login" ) private String name ; @ Column ( name = "password" ) private String password ; @ Column ( name = "email" ) private String email ; @ Column ( name = "score" ) private int score ; public UserDataSet ( ) { } public UserDataSet ( String name , String password , String email ) { } public int getId ( ) { } public String getName ( ) { } public String getPassword ( ) { } public String getEmail ( ) { } public int getScore ( ) { } public void setId ( int id ) { } public void setName ( String name ) { <START_BUG> this . name = this . name ; <END_BUG> } public void setPassword ( String password ) { } public void setEmail ( String email ) { } public void setScore ( int score ) { } public JsonObject getJson ( ) { } }

Fix:
this . name = name ;