nus-yam/ex-repair huggingface dataset:
Buggy code:
public class War extends Jar { private File deploymentDescriptor ; private boolean needxmlfile = true ; private File addedWebXmlFile ; private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private static final String XML_DESCRIPTOR_PATH = "WEB-INF//web.xml" ; private static final String XML_DESCRIPTOR_PATH_LC = War . XML_DESCRIPTOR_PATH . toLowerCase ( Locale . ENGLISH ) ; public War ( ) { } public void setWarfile ( File warFile ) { } public void setWebxml ( File descr ) { } public void setNeedxmlfile ( boolean needxmlfile ) { } public void addLib ( ZipFileSet fs ) { } public void addClasses ( ZipFileSet fs ) { } public void addWebinf ( ZipFileSet fs ) { } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected void zipFile ( File file , ZipOutputStream zOut , String vPath , int mode ) throws IOException { } protected void cleanUp ( ) { <START_BUG> if ( ( ( ( addedWebXmlFile ) == null ) && ( needxmlfile ) ) && ( ! ( isInUpdateMode ( ) ) ) ) { <END_BUG> throw new BuildException ( ( "No<seq2seq4repair_space>WEB-INF//web.xml<seq2seq4repair_space>file<seq2seq4repair_space>was<seq2seq4repair_space>added.\n" + "If<seq2seq4repair_space>this<seq2seq4repair_space>is<seq2seq4repair_space>your<seq2seq4repair_space>intent,<seq2seq4repair_space>set<seq2seq4repair_space>needxml='false'<seq2seq4repair_space>" ) ) ; } addedWebXmlFile = null ; super . cleanUp ( ) ; } }

Fix:
if ( ( ( ( ( addedWebXmlFile ) == null ) && ( ( deploymentDescriptor ) == null ) ) && ( needxmlfile ) ) && ( ! ( isInUpdateMode ( ) ) ) ) {
Buggy code:
public class TaskActivity extends Activity { private Task touchedTask ; private ListView lv ; private ArrayAdapter < Task > taskAdapter ; private Dialog dialog ; private AlertDialog alertMarkComplete ; private AlertDialog alertDelete ; private ArrayList < Task > tasksWithNewTask ; private static final String TAG = "TaskActivity" ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private void setUpListView ( ) { } private void showTaskDialog ( final int position , final boolean updatingTask ) { } private void hideTaskDialog ( final int position , final boolean updatingTask ) { EditText taskNameEntry = ( ( EditText ) ( dialog . findViewById ( taskNameEntry ) ) ) ; RatingBar ratingEntry = ( ( RatingBar ) ( dialog . findViewById ( ratingEntry ) ) ) ; EditText notesEntry = ( ( EditText ) ( dialog . findViewById ( notesEntry ) ) ) ; TimePicker timeEntry = ( ( TimePicker ) ( dialog . findViewById ( timeEntry ) ) ) ; Task task = new Task ( taskNameEntry . getText ( ) . toString ( ) , notesEntry . getText ( ) . toString ( ) , "" , ( ( int ) ( ratingEntry . getRating ( ) ) ) ) ; Calendar c = Calendar . getInstance ( ) ; Time currentTime = new Time ( ) ; currentTime . set ( System . currentTimeMillis ( ) ) ; if ( ( ( currentTime . hour ) != ( timeEntry . getCurrentHour ( ) ) ) || ( ( currentTime . minute ) != ( timeEntry . getCurrentMinute ( ) ) ) ) { Time time = new Time ( ) ; time . set ( 0 , timeEntry . getCurrentMinute ( ) , timeEntry . getCurrentHour ( ) , c . get ( Calendar . DAY_OF_MONTH ) , c . get ( Calendar . MONTH ) , c . get ( Calendar . YEAR ) ) ; task . setAlarmTime ( time ) ; } if ( ( keywords . size ( ) ) == 0 ) { Log . e ( TaskActivity . TAG , ( ( "Trying<seq2seq4repair_space>to<seq2seq4repair_space>asign<seq2seq4repair_space>keywords<seq2seq4repair_space>to<seq2seq4repair_space>" + ( task . getName ( ) ) ) + "<seq2seq4repair_space>but<seq2seq4repair_space>keywords<seq2seq4repair_space>database<seq2seq4repair_space>is<seq2seq4repair_space>empty" ) ) ; } HashSet < String > type = ToDoMeActivity . keywords . getTypes ( task . getName ( ) ) ; task . setTypes ( type ) ; if ( updatingTask ) { tasks . remove ( ( position - 1 ) ) ; } if ( position == 0 ) { tasks . add ( 0 , task ) ; } else { tasks . add ( task ) ; } setUpTasksWithNewTasks ( ) ; taskAdapter . notifyDataSetChanged ( ) ; Log . i ( TaskActivity . TAG , ( ( ( ( ( ( "Task<seq2seq4repair_space>just<seq2seq4repair_space>added<seq2seq4repair_space>(" + ( task . getName ( ) ) ) + "<seq2seq4repair_space>" ) + type ) + ")<seq2seq4repair_space>now<seq2seq4repair_space>have<seq2seq4repair_space>" ) + ( tasks . size ( ) ) ) + "<seq2seq4repair_space>tasks" ) ) ; Log . i ( TaskActivity . TAG , ( "Tasks:<seq2seq4repair_space>" + ( tasks . toString ( ) ) ) ) ; taskNameEntry . setText ( "" ) ; ToDoMeActivity . writeTasks ( tasks ) ; <START_BUG> dialog . hide ( ) ; <END_BUG> } private void setUpTasksWithNewTasks ( ) { } private void addStarRating ( int position ) { } }

Fix:
dialog . dismiss ( ) ;
Buggy code:
public class TestQueryHints extends SingleEMFTestCase { EntityManager em ; OpenJPAQuery query ; public void setUp ( ) { } public void testSupportedHintsContainProductDerivationHints ( ) { } public void testSupportedHintsContainFetchPlanHints ( ) { } public void testSupportedHintsIgnoresSomeFetchPlanBeanStyleProperty ( ) { } public void testSupportedHintsContainQueryProperty ( ) { } public void testSupportedHintsContainKernelQueryHints ( ) { } public void testSupportedHintsContainJPAQueryHints ( ) { } public void testUnrecognizedKeyIsIgnored ( ) { } public void testRecognizedKeyIsNotRecordedButAvailable ( ) { } public void testSupportedKeyIsRecordedAndAvailable ( ) { } public void testSupportedKeyWrongValue ( ) { } public void testSupportedKeyIntegerValueConversion ( ) { } public void testSupportedKeyBooleanValueConversion ( ) { } public void testJPAHintSetsFetchPlan ( ) { String jpaKey = "javax.persistence.query.timeout" ; query . setHint ( jpaKey , 5671 ) ; <START_BUG> assertEquals ( 5671 , query . getFetchPlan ( ) . getLockTimeout ( ) ) ; <END_BUG> } public void testParts ( ) { } void assertSupportedHint ( String hint , boolean contains ) { } }

Fix:
assertEquals ( 5671 , query . getFetchPlan ( ) . getQueryTimeout ( ) ) ;
Buggy code:
public class URLRewritingModifier extends AbstractTestElement implements Serializable , PreProcessor { private Pattern pathExtensionEqualsQuestionmarkRegexp ; private Pattern pathExtensionEqualsNoQuestionmarkRegexp ; private Pattern parameterRegexp ; private Pattern pathExtensionNoEqualsQuestionmarkRegexp ; private Pattern pathExtensionNoEqualsNoQuestionmarkRegexp ; private static final String ARGUMENT_NAME = "argument_name" ; private static final String PATH_EXTENSION = "path_extension" ; private static final String PATH_EXTENSION_NO_EQUALS = "path_extension_no_equals" ; private static final String PATH_EXTENSION_NO_QUESTIONMARK = "path_extension_no_questionmark" ; public void process ( ) { } private void modify ( HTTPSamplerBase sampler , String value ) { if ( isPathExtension ( ) ) { if ( isPathExtensionNoEquals ( ) ) { sampler . setPath ( ( ( ( ( sampler . getPath ( ) ) + ";" ) + ( getArgumentName ( ) ) ) + value ) ) ; } else { sampler . setPath ( ( ( ( ( ( sampler . getPath ( ) ) + ";" ) + ( getArgumentName ( ) ) ) + "=" ) + value ) ) ; } } else { sampler . getArguments ( ) . removeArgument ( getArgumentName ( ) ) ; <START_BUG> sampler . getArguments ( ) . addArgument ( new HTTPArgument ( getArgumentName ( ) , value , false ) ) ; <END_BUG> } } public void setArgumentName ( String argName ) { } private void initRegex ( String argName ) { } public String getArgumentName ( ) { } public void setPathExtension ( boolean pathExt ) { } public void setPathExtensionNoEquals ( boolean pathExtNoEquals ) { } public void setPathExtensionNoQuestionmark ( boolean pathExtNoQuestionmark ) { } public boolean isPathExtension ( ) { } public boolean isPathExtensionNoEquals ( ) { } public boolean isPathExtensionNoQuestionmark ( ) { } }

Fix:
sampler . getArguments ( ) . addArgument ( new HTTPArgument ( getArgumentName ( ) , value , true ) ) ;
Buggy code:
public class ConfigRuntimeException extends RuntimeException { protected ConfigRuntimeException ( ) { } public void setEnv ( Env env ) { } public Env getEnv ( ) { } public void setFile ( File f ) { } public void setLineNum ( int line_num ) { } public static enum Reaction { IGNORE , REPORT , FATAL ; } public static ConfigRuntimeException . Reaction HandleUncaughtException ( ConfigRuntimeException e ) { } public static void DoReport ( ConfigRuntimeException e ) { } public static void DoReport ( String message , String exceptionType , String file , String simpleFile , String line_num , String optionalMessage , MCPlayer player ) { } public static void DoReport ( ConfigRuntimeException e , String optionalMessage ) { MCPlayer p = null ; if ( ( ( e . getEnv ( ) ) != null ) && ( ( e . getEnv ( ) . GetPlayer ( ) ) != null ) ) { p = e . getEnv ( ) . GetPlayer ( ) ; } <START_BUG> ConfigRuntimeException . DoReport ( e . getMessage ( ) , e . getExceptionType ( ) . toString ( ) , ( ( e . getFile ( ) ) == null ? null : e . getFile ( ) . getPath ( ) ) , e . getSimpleFile ( ) , Integer . toString ( e . getLineNum ( ) ) , optionalMessage , p ) ; <END_BUG> } public static void DoReport ( ConfigCompileException e , String optionalMessage , MCPlayer player ) { } public static void DoWarning ( Exception e ) { } public static void DoWarning ( String optionalMessage ) { } public static void DoWarning ( Exception e , String optionalMessage , boolean checkPrefs ) { } private ExceptionType ex ; private int line_num ; private File file ; private Env env ; public ConfigRuntimeException ( String msg , ExceptionType ex , int line_num , File file ) { } public ConfigRuntimeException ( String msg , ExceptionType ex , int line_num , File file , Throwable cause ) { } public ConfigRuntimeException ( String msg , int line_num , File file ) { } private ConfigRuntimeException ( String msg ) { } public ExceptionType getExceptionType ( ) { } public int getLineNum ( ) { } public File getFile ( ) { } public String getSimpleFile ( ) { } }

Fix:
ConfigRuntimeException . DoReport ( e . getMessage ( ) , ( ( e . getExceptionType ( ) ) != null ? e . getExceptionType ( ) . toString ( ) : "FatalRuntimeException" ) , ( ( e . getFile ( ) ) == null ? null : e . getFile ( ) . getPath ( ) ) , e . getSimpleFile ( ) , Integer . toString ( e . getLineNum ( ) ) , optionalMessage , p ) ;
Buggy code:
public class EnglishCoreferenceResolution extends AbstractCoreferenceResolution { private AbstractMentionDetector m_detector ; public EnglishCoreferenceResolution ( ) { } @ Override public Pair < List < Mention > , DisjointSet > getEntities ( List < DEPTree > trees ) { List < Mention > mentions = m_detector . getMentionList ( trees ) ; DisjointSet set = new DisjointSet ( mentions . size ( ) ) ; int i ; int j ; int size = mentions . size ( ) ; Mention curr ; Mention prev ; for ( i = 1 ; i < size ; i ++ ) { curr = mentions . get ( i ) ; for ( j = i - 1 ; j >= 0 ; j -- ) { <START_BUG> prev = mentions . get ( i ) ; <END_BUG> if ( ( ( matchesPerson ( curr , prev ) ) || ( matchesPronoun ( curr , prev ) ) ) || ( matchesCommonNoun ( curr , prev ) ) ) { set . union ( i , j ) ; break ; } } } return new Pair < List < Mention > , DisjointSet > ( mentions , set ) ; } private boolean matchesPerson ( Mention curr , Mention prev ) { } private boolean matchesPronoun ( Mention curr , Mention prev ) { } private boolean matchesCommonNoun ( Mention curr , Mention prev ) { } }

Fix:
prev = mentions . get ( j ) ;
Buggy code:
public class Transaction extends BaseTransaction implements Persistent { private static final String GET_ACTIVITY_LIST = "getActivityList" ; private Attachment aAttachment = null ; public void create ( TransactionType tt , ScarabUser user ) throws Exception { } public void create ( TransactionType tt , ScarabUser user , Attachment attachment ) throws Exception { } public void create ( NumberKey typeId , ScarabUser user ) throws Exception { } public void create ( NumberKey typeId , ScarabUser user , Attachment attachment ) throws Exception { } public List getActivityList ( ) throws Exception { } public boolean sendEmail ( TemplateContext context , Issue issue , String subject , String template ) throws Exception { if ( context == null ) { context = new DefaultTemplateContext ( ) ; } context . put ( "issue" , issue ) ; <START_BUG> context . put ( "attachment" , aAttachment ) ; <END_BUG> context . put ( "activityList" , getActivityList ( ) ) ; String fromUser = "scarab.email.modifyissue" ; if ( subject == null ) { subject = ( ( ( "[" + ( issue . getModule ( ) . getRealName ( ) . toUpperCase ( ) ) ) + "]<seq2seq4repair_space>Issue<seq2seq4repair_space>#" ) + ( issue . getUniqueId ( ) ) ) + "<seq2seq4repair_space>modified" ; } if ( template == null ) { template = Turbine . getConfiguration ( ) . getString ( "scarab.email.modifyissue.template" ) ; } List toUsers = new LinkedList ( ) ; List users = issue . getUsersToEmail ( EMAIL_TO ) ; Iterator iter = users . iterator ( ) ; while ( iter . hasNext ( ) ) { toUsers . add ( iter . next ( ) ) ; } List ccUsers = null ; users = issue . getUsersToEmail ( CC_TO ) ; if ( users != null ) { ccUsers = new LinkedList ( ) ; iter = users . iterator ( ) ; while ( iter . hasNext ( ) ) { ccUsers . add ( iter . next ( ) ) ; } } return Email . sendEmail ( context , issue . getModule ( ) , fromUser , toUsers , ccUsers , subject , template ) ; } public boolean sendEmail ( TemplateContext context , Issue issue ) throws Exception { } public boolean sendEmail ( Issue issue ) throws Exception { } public boolean sendEmail ( Issue issue , String subject , String template ) throws Exception { } }

Fix:
context . put ( "attachment" , getAttachment ( ) ) ;
Buggy code:
public class TabPanel extends JPanel { private JTable gameListTable ; private DefaultTableModel gameListModel ; private Object [ ] [ ] tableData ; private GameLobbyGUI gameLobbyWindow ; private JPanel buttonPanel ; private JButton createButton ; private JButton joinButton ; private JButton returnButton ; private AbstractUser u ; private LogInGUI loginWindow ; private int chatPort ; private GameRoomClient grc ; public TabPanel ( AbstractUser user , GameLobbyGUI gameLobbyWindow , LogInGUI loginWindow ) { } public void initializeComponents ( ) { } public void createGUI ( ) { } public void addActionListeners ( ) { } public void updateGames ( String [ ] gameString ) { int numGames = gameString . length ; int selectedRow = - 1 ; if ( ( gameListTable ) != null ) { selectedRow = gameListTable . getSelectedRow ( ) ; } gameListModel . setRowCount ( 0 ) ; if ( ( numGames != 1 ) || ( ! ( gameString [ 0 ] . equals ( "" ) ) ) ) { for ( int i = 0 ; i < numGames ; i ++ ) { String [ ] gameInfo = gameString [ i ] . split ( ":::" ) ; gameListModel . addRow ( new Object [ ] { gameInfo [ 0 ] , gameInfo [ 1 ] } ) ; } } gameListModel . fireTableDataChanged ( ) ; <START_BUG> if ( selectedRow != ( - 1 ) ) { <END_BUG> gameListTable . setRowSelectionInterval ( selectedRow , selectedRow ) ; } } public void setChatPort ( int nextPort ) { } No newline ; at end ; of file ; }

Fix:
if ( ( selectedRow != ( - 1 ) ) && ( selectedRow < ( gameListModel . getRowCount ( ) ) ) ) {
Buggy code:
public class TracksActivity extends AppCompatActivity { private TracksFragment mTracksFragment ; private String mArtistId ; private String mArtistName ; private boolean isTwoPane ; @ InjectView ( id . toolbar ) Toolbar tracksToolbar ; private ArrayList < MyTrack > mTracks = new ArrayList < > ( ) ; private int position = 0 ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onDestroy ( ) { } public void onEvent ( PlayerIntent playerIntent ) { <START_BUG> LogHelper . d ( TAG , "play<seq2seq4repair_space>intent<seq2seq4repair_space>received" ) ; <END_BUG> mTracks = playerIntent . tracks ; position = playerIntent . position ; if ( isTwoPane ) { PlayerFragment playerFragment = PlayerFragment . newInstance ( mTracks , position ) ; playerFragment . show ( getSupportFragmentManager ( ) . beginTransaction ( ) , "Player" ) ; } else { Intent intent = new Intent ( this , PlayerActivity . class ) ; intent . putParcelableArrayListExtra ( "tracks" , mTracks ) ; intent . putExtra ( "position" , position ) ; startActivity ( intent ) ; } } @ Override protected void onSaveInstanceState ( Bundle outState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
LogHelper . i ( TAG , "play<seq2seq4repair_space>intent<seq2seq4repair_space>received<seq2seq4repair_space>in<seq2seq4repair_space>tracksActivity" ) ;
Buggy code:
public class SurfaceViewFactory { private static Hashtable < String , SurfaceView > mRemoteViews = new Hashtable < String , SurfaceView > ( ) ; private static WeakReference < SurfaceView > mLocalView = new WeakReference < SurfaceView > ( null ) ; public static SurfaceView getLocalView ( Context context ) { SurfaceView view = SurfaceViewFactory . mLocalView . get ( ) ; if ( view == null ) { <START_BUG> view = ViERenderer . CreateLocalRenderer ( context ) ; <END_BUG> SurfaceViewFactory . mLocalView = new WeakReference < SurfaceView > ( view ) ; } return view ; } public static SurfaceView getRemoteSurfaceView ( Context context , String peerId ) { } }

Fix:
view = ViERenderer . CreateRenderer ( context ) ;
Buggy code:
public class ActionSaveGIF extends UMLAction { protected static Category cat = Category . getInstance ( ActionSaveGIF . class ) ; public static ActionSaveGIF SINGLETON = new ActionSaveGIF ( ) ; public static final String separator = "//" ; protected ActionSaveGIF ( ) { } public void actionPerformed ( ActionEvent ae ) { } public boolean trySave ( boolean overwrite ) { CmdSaveGIF cmd = new CmdSaveGIF ( ) ; Object target = TheInstance . getActiveDiagram ( ) ; if ( target instanceof Diagram ) { String defaultName = ( ( Diagram ) ( target ) ) . getName ( ) ; defaultName = Util . stripJunk ( defaultName ) ; ProjectBrowser pb = ProjectBrowser . TheInstance ; <START_BUG> Project p = pb . getProject ( ) ; <END_BUG> try { JFileChooser chooser = null ; try { if ( ( ( p != null ) && ( ( p . getURL ( ) ) != null ) ) && ( ( p . getURL ( ) . getFile ( ) . length ( ) ) > 0 ) ) { String filename = p . getURL ( ) . getFile ( ) ; if ( ! ( filename . startsWith ( "//FILE1//+//" ) ) ) chooser = OsUtil . getFileChooser ( p . getURL ( ) . getFile ( ) ) ; } } catch ( Exception ex ) { ActionSaveGIF . cat . error ( "exception<seq2seq4repair_space>in<seq2seq4repair_space>opening<seq2seq4repair_space>JFileChooser" , ex ) ; } if ( chooser == null ) chooser = OsUtil . getFileChooser ( ) ; chooser . setDialogTitle ( ( "Save<seq2seq4repair_space>Diagram<seq2seq4repair_space>as<seq2seq4repair_space>GIF:<seq2seq4repair_space>" + defaultName ) ) ; FileFilter filter = FileFilters . GIFFilter ; chooser . addChoosableFileFilter ( filter ) ; chooser . setFileFilter ( filter ) ; File def = new File ( ( defaultName + ".gif" ) ) ; chooser . setSelectedFile ( def ) ; int retval = chooser . showSaveDialog ( pb ) ; if ( retval == 0 ) { File theFile = chooser . getSelectedFile ( ) ; if ( theFile != null ) { String path = theFile . getParent ( ) ; String name = theFile . getName ( ) ; if ( ! ( path . endsWith ( ActionSaveGIF . separator ) ) ) path += ActionSaveGIF . separator ; pb . showStatus ( ( ( ( "Writing<seq2seq4repair_space>" + path ) + name ) + "..." ) ) ; if ( ( theFile . exists ( ) ) && ( ! overwrite ) ) { String t = ( "Overwrite<seq2seq4repair_space>" + path ) + name ; int response = JOptionPane . showConfirmDialog ( pb , t , t , JOptionPane . YES_NO_OPTION ) ; if ( response == ( JOptionPane . NO_OPTION ) ) return false ; } FileOutputStream fo = new FileOutputStream ( theFile ) ; cmd . setStream ( fo ) ; cmd . doIt ( ) ; fo . close ( ) ; pb . showStatus ( ( ( "Wrote<seq2seq4repair_space>" + path ) + name ) ) ; return true ; } } } catch ( FileNotFoundException ignore ) { ActionSaveGIF . cat . error ( "got<seq2seq4repair_space>a<seq2seq4repair_space>FileNotFoundException" , ignore ) ; } catch ( IOException ignore ) { ActionSaveGIF . cat . error ( "got<seq2seq4repair_space>an<seq2seq4repair_space>IOException" , ignore ) ; } } return false ; } }

Fix:
Project p = ProjectManager . getManager ( ) . getCurrentProject ( ) ;
Buggy code:
public class CxxPluginTest { @ Test public void testGetExtensions ( ) throws Exception { CxxPlugin plugin = new CxxPlugin ( ) ; <START_BUG> assertEquals ( 66 , plugin . getExtensions ( ) . size ( ) ) ; <END_BUG> } }

Fix:
assertEquals ( 67 , plugin . getExtensions ( ) . size ( ) ) ;
Buggy code:
public class PagedTableTest extends TestCase { public PagedTableTest ( ) { } public PagedTableTest ( String name ) { } public void testPagedTable ( ) throws Exception { MockWebApplication application = new MockWebApplication ( null ) ; application . getPages ( ) . setHomePage ( PagedTablePage . class ) ; application . setupRequestAndResponse ( ) ; application . processRequestCycle ( ) ; PagedTablePage page = ( ( PagedTablePage ) ( application . getLastRenderedPage ( ) ) ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( validatePage1 ( document ) ) ; <START_BUG> Link link = ( ( Link ) ( page . get ( "navigation.1.pageLink" ) ) ) ; <END_BUG> application . setupRequestAndResponse ( ) ; application . getServletRequest ( ) . setRequestToComponent ( link ) ; application . processRequestCycle ( ) ; document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( validatePage2 ( document ) ) ; } private boolean validatePage1 ( String document ) { } private boolean validatePage2 ( String document ) { } }

Fix:
Link link = ( ( Link ) ( page . get ( "navigation:1:pageLink" ) ) ) ;
Buggy code:
@ RestController @ RequestMapping ( "//user" ) public class AppUserController { @ Autowired private AppUserDao appUserDao ; @ Autowired private EmailValidator emailValidator ; @ Autowired private PasswordEncrypt passwordEncrypt ; private static final Logger log = Logger . getLogger ( AppUserController . class . getName ( ) ) ; @ RequestMapping ( value = "//add" , method = RequestMethod . POST ) public ResponseEntity < ? > createAppUser ( @ RequestBody @ Valid AppUser appUser ) { } @ RequestMapping ( value = "//find_all" , method = RequestMethod . GET ) public ResponseEntity < List < AppUser > > listAllUsers ( ) { } @ RequestMapping ( value = "//find//{id}" , method = RequestMethod . GET ) public ResponseEntity < ? > findAppUser ( @ PathVariable ( "id" ) Long id ) { } <START_BUG> @ RequestMapping ( value = "//login//{login}" , method = RequestMethod . GET ) <END_BUG> public ResponseEntity < ? > login ( @ PathVariable ( "login" ) String loginString ) { AppUser appUser = null ; if ( emailValidator . validate ( loginString ) ) { appUser = appUserDao . findByEmail ( loginString ) ; } else { appUser = appUserDao . findByUsername ( loginString ) ; } if ( appUser == null ) { return new ResponseEntity < String > ( "User<seq2seq4repair_space>not<seq2seq4repair_space>found" , HttpStatus . NOT_FOUND ) ; } return new ResponseEntity < AppUser > ( appUser , HttpStatus . OK ) ; } @ RequestMapping ( value = "//update//{id}" , method = RequestMethod . POST ) public ResponseEntity < String > updateAppUser ( @ PathVariable ( "id" ) Long id , @ RequestBody @ Valid AppUser appUser ) { } @ RequestMapping ( value = "//delete//{id}" , method = RequestMethod . DELETE ) public ResponseEntity < String > deleteAppUser ( @ PathVariable ( "id" ) Long id ) { } @ RequestMapping ( value = "//deleteAll" , method = RequestMethod . DELETE ) public ResponseEntity < String > deleteAll ( ) { } }

Fix:
@ RequestMapping ( value = "//login//{login:.+}" , method = RequestMethod . GET )
Buggy code:
public class ConverterLocator implements IConverterLocator { private class DefaultConverter implements IConverter { private static final long serialVersionUID = 1L ; private final WeakReference < Class < ? > > type ; private DefaultConverter ( Class < ? > type ) { } public Object convertToObject ( String value , Locale locale ) { if ( value == null ) { return null ; } Class < ? > theType = type . get ( ) ; if ( "" . equals ( value ) ) { if ( theType . equals ( String . class ) ) { return theType . cast ( "" ) ; } return null ; } try { Object converted = Objects . convertValue ( value , theType ) ; if ( theType . isAssignableFrom ( converted . getClass ( ) ) ) { return theType . cast ( converted ) ; } else { <START_BUG> throw new ConversionException ( ( ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>convert<seq2seq4repair_space>value:<seq2seq4repair_space>" + value ) + "<seq2seq4repair_space>to<seq2seq4repair_space>type:<seq2seq4repair_space>" ) + ( theType . getName ( ) ) ) + "(Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>compatible<seq2seq4repair_space>converter)." ) ) . setSourceValue ( value ) ; <END_BUG> } } catch ( Exception e ) { throw new ConversionException ( e . getMessage ( ) , e ) . setSourceValue ( value ) ; } } public String convertToString ( Object value , Locale locale ) { } } private static final long serialVersionUID = 1L ; private final Map < String , IConverter > classToConverter = new HashMap < String , IConverter > ( ) ; public ConverterLocator ( ) { } public final IConverter get ( Class < ? > c ) { } public final IConverter getConverter ( Class < ? > type ) { } public final IConverter remove ( Class < ? > c ) { } @ SuppressWarnings ( "unchecked" ) public final IConverter set ( final Class c , final IConverter converter ) { } }

Fix:
throw new ConversionException ( ( ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>convert<seq2seq4repair_space>value:<seq2seq4repair_space>" + value ) + "<seq2seq4repair_space>to<seq2seq4repair_space>type:<seq2seq4repair_space>" ) + ( theType . getName ( ) ) ) + ".<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>compatible<seq2seq4repair_space>converter." ) ) . setSourceValue ( value ) ;
Buggy code:
public class HResp { private static Logger L = LoggerFactory . getLogger ( HResp . class ) ; long tid ; String path ; long time ; String u ; String m ; String arg ; int code ; long len ; String type ; String enc = "UTF-8" ; long lmt ; String etag ; InputStream in = null ; String filename ; Map < String , String > headers = new HashMap < String , String > ( ) ; public HResp init ( CBase c ) { } public HResp init ( CBase c , PathPis pis ) { } public HResp init ( HttpResponse res , String encoding ) { } public HResp initHttpStream ( HttpResponse res ) throws IOException , IllegalStateException { } public HResp initFileStream ( HDb db ) throws FileNotFoundException { } public HResp initPathStream ( HDb db ) throws FileNotFoundException { } public String readCache ( HDb db ) throws Exception { } public void close ( ) { try { this . in . close ( ) ; } catch ( Exception e ) { <START_BUG> HResp . L . warn ( "closing<seq2seq4repair_space>stream<seq2seq4repair_space>error:" , e . getMessage ( ) ) ; <END_BUG> } } @ Override public String toString ( ) { } public Object [ ] toObjects ( boolean id_ ) { } protected String encoding ( String data ) { } public InputStream getIn ( ) { } public long getTid ( ) { } public String getPath ( ) { } public long getTime ( ) { } public String getU ( ) { } public String getM ( ) { } public String getArg ( ) { } public int getCode ( ) { } public long getLen ( ) { } public String getType ( ) { } public String getEnc ( ) { } public long getLmt ( ) { } public String getEtag ( ) { } public String getFilename ( ) { } public void setTid ( long tid ) { } public void setPath ( String path ) { } public void setTime ( long time ) { } public void setU ( String u ) { } public void setM ( String m ) { } public void setArg ( String arg ) { } public void setLen ( long len ) { } public void setType ( String type ) { } public void setEnc ( String enc ) { } public void setLmt ( long lmt ) { } public void setEtag ( String etag ) { } public Map < String , String > getHeaders ( ) { } public static long parseLmt ( String gmt ) throws ParseException { } public static String formatLmt ( Date gmt ) throws ParseException { } }

Fix:
HResp . L . warn ( "closing<seq2seq4repair_space>stream<seq2seq4repair_space>error:" , e ) ;
Buggy code:
public class UMLEnumerationBooleanProperty extends UMLBooleanProperty { private Method _getMethod ; private Method _setMethod ; private static final Object [ ] _noArg = new Object [ ] { } ; private Object [ ] _trueArg = new Object [ 1 ] ; private Object [ ] _falseArg = new Object [ 1 ] ; private Class _enumClass ; public UMLEnumerationBooleanProperty ( String propertyName , Class elementClass , String getMethod , String setMethod , Class enumClass , Object trueValue , Object falseValue ) { } public void setProperty ( Object element , boolean newState ) { } public boolean getProperty ( Object element ) { boolean state = false ; if ( ( ( _getMethod ) != null ) && ( element != null ) ) { try { Object retval = _getMethod . invoke ( element , UMLEnumerationBooleanProperty . _noArg ) ; <START_BUG> if ( ( _enumClass . isInstance ( retval ) ) && ( ( retval == ( _trueArg [ 0 ] ) ) || ( retval . equals ( _trueArg [ 0 ] ) ) ) ) { <END_BUG> state = true ; } } catch ( Exception e ) { System . out . println ( ( ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>UMLEnumerationBooleanProperty.getProperty<seq2seq4repair_space>for<seq2seq4repair_space>" + ( getPropertyName ( ) ) ) + ":<seq2seq4repair_space>" ) + ( e . toString ( ) ) ) ) ; } } return state ; } }

Fix:
if ( ( retval != null ) && ( ( retval == ( _trueArg [ 0 ] ) ) || ( retval . equals ( _trueArg [ 0 ] ) ) ) ) {
Buggy code:
public class ObjectMover implements Runnable { private IDType TYPE ; private IDType OTHERIDTYPE ; private DoubleArrayList < MovingObject > objects = null ; private Thread thread ; private Vector3d enTowerPosition = new Vector3d ( 0 , ( - 1 ) , 0 ) ; private Path path ; private Vector3d begin = new Vector3d ( 0 , 0 , 0 ) ; private Vector3d end = new Vector3d ( ( ( float ) ( 100.0 ) ) , ( ( float ) ( 100.0 ) ) , ( ( float ) ( 0.0 ) ) ) ; private final Boolean _STOP = true ; public ObjectMover ( IDType type , DoubleArrayList < MovingObject > objects ) { } public ObjectMover ( IDType tYPE , DoubleArrayList < MovingObject > objects , Vector3d begin , Vector3d end ) { } @ Override public void run ( ) { } public IDType getTYPE ( ) { } public void setTYPE ( IDType tYPE ) { } public void setObjects ( DoubleArrayList < MovingObject > objects ) { } public void setEnTowerPos ( Vector3d enPos ) { } public void addPosition ( Vector3d pos ) { } public void reovePosition ( PathPoint pos ) { } @ Deprecated private ArrayList getCube ( BoundingBox box ) { } @ Deprecated private Boolean collisionDetection ( DefaultObject A , DefaultObject B ) { } @ Deprecated private float culAngle ( Vector3d a , Vector3d b ) { } @ Deprecated private Boolean isOver ( MovingObject moveObject ) { } private boolean move ( int index ) { MovingObject movingObject = objects . seek ( index , TYPE ) ; if ( movingObject . isDead ( ) ) return false ; switch ( movingObject . moveByPathPoint ( ) ) { case MovingObject . STOPING : movingObject . startMove ( ) ; Log . d ( "point" , "Restart<seq2seq4repair_space>move" ) ; break ; case MovingObject . AT_END : movingObject . dead ( ) ; objects . remove ( objects . getIndexOf ( movingObject , TYPE ) , TYPE . O ) ; return true ; case MovingObject . NO_PATH_SET : movingObject . setPathPoint ( path . getNextPathPoint ( null ) ) ; movingObject . moveByPathPoint ( ) ; Log . d ( "point" , ( ( ( ( "Set<seq2seq4repair_space>Point:{X:" + ( path . getNextPathPoint ( null ) . getPosition ( ) . getX ( ) ) ) + "<seq2seq4repair_space>Y:" ) + ( path . getNextPathPoint ( null ) . getPosition ( ) . getY ( ) ) ) + "}" ) ) ; break ; default : break ; } <START_BUG> for ( int i = 0 ; i < ( objects . size ( TYPE ) ) ; i ++ ) { <END_BUG> if ( ( objects . getIndexOf ( movingObject , TYPE ) ) == i ) continue ; if ( objects . seek ( i , TYPE ) . checkCollision ( movingObject ) ) { movingObject . stopMove ( ) ; movingObject . back ( ) ; return false ; } } for ( int i = 0 ; i < ( objects . size ( OTHERIDTYPE ) ) ; i ++ ) { if ( objects . seek ( i , OTHERIDTYPE ) . checkCollision ( movingObject ) ) { movingObject . stopMove ( ) ; movingObject . back ( ) ; movingObject . setHealth ( ( ( float ) ( ( movingObject . getHealth ( ) ) - 1.0 ) ) ) ; if ( ( movingObject . getHealth ( ) ) <= 0 ) { movingObject . dead ( ) ; return false ; } } } return true ; } }

Fix:
for ( int i = objects . getIndexOf ( movingObject , TYPE ) ; i < ( objects . size ( TYPE ) ) ; i ++ ) {
Buggy code:
public class DuplicateUserCheckStateTestCase extends PropertyTestHelper { @ Test public void newUser ( ) throws IOException { values . setExistingUser ( false ) ; values . setRoles ( ROLES ) ; DuplicateUserCheckState userCheckState = new DuplicateUserCheckState ( consoleMock , values ) ; <START_BUG> AssertConsoleBuilder consoleBuilder = new AssertConsoleBuilder ( ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . aboutToAddUser ( values . getUserName ( ) , values . getRealm ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . isCorrectPrompt ( ) ) . expectedDisplayText ( "<seq2seq4repair_space>" ) . expectedInput ( "yes" ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedUser ( values . getUserName ( ) , values . getPropertiesFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedRoles ( values . getUserName ( ) , values . getRoles ( ) , values . getRoleFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) ; <END_BUG> consoleMock . setResponses ( consoleBuilder ) ; State nextState = userCheckState . execute ( ) ; assertTrue ( ( nextState instanceof ConfirmationChoice ) ) ; nextState = nextState . execute ( ) ; assertTrue ( ( nextState instanceof AddUser ) ) ; nextState . execute ( ) ; consoleBuilder . validate ( ) ; } @ Test public void existingUSer ( ) throws IOException { } }

Fix:
AssertConsoleBuilder consoleBuilder = new AssertConsoleBuilder ( ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . aboutToAddUser ( values . getUserName ( ) , values . getRealm ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( ( ( ( ( ( ( DomainManagementMessages . MESSAGES . isCorrectPrompt ( ) ) + "<seq2seq4repair_space>" ) + ( DomainManagementMessages . MESSAGES . yes ( ) ) ) + "//" ) + ( DomainManagementMessages . MESSAGES . no ( ) ) ) + "?" ) ) . expectedDisplayText ( "<seq2seq4repair_space>" ) . expectedInput ( "yes" ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedUser ( values . getUserName ( ) , values . getPropertiesFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedRoles ( values . getUserName ( ) , values . getRoles ( ) , values . getRoleFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) ;
Buggy code:
public class Tar extends MatchingTask { File tarFile ; File baseDir ; public void setTarfile ( String tarFilename ) { } public void setBasedir ( String baseDirname ) { } public void execute ( ) throws BuildException { } protected void tarFile ( File file , TarOutputStream tOut , String vPath ) throws IOException { FileInputStream fIn = new FileInputStream ( file ) ; TarEntry te = new TarEntry ( vPath ) ; te . setSize ( file . length ( ) ) ; <START_BUG> te . setModTime ( ( ( file . lastModified ( ) ) // 1000 ) ) ; <END_BUG> tOut . putNextEntry ( te ) ; byte [ ] buffer = new byte [ 8 * 1024 ] ; int count = 0 ; do { tOut . write ( buffer , 0 , count ) ; count = fIn . read ( buffer , 0 , buffer . length ) ; } while ( count != ( - 1 ) ) ; tOut . closeEntry ( ) ; fIn . close ( ) ; } }

Fix:
te . setModTime ( file . lastModified ( ) ) ;
Buggy code:
@ Superclass ( "" ) public class TObject { @ Rename ( "fakeInit" ) public TObject ( ) { } @ GeneratedBy ( ObjectNativeGenerator . class ) @ Rename ( "<init>" ) private native void init ( ) { } @ InjectedBy ( ObjectNativeGenerator . class ) @ Rename ( "getClass" ) @ PluggableDependency ( ObjectNativeGenerator . class ) public final native TClass < ? > getClass0 ( ) { } @ Override @ GeneratedBy ( ObjectNativeGenerator . class ) public native int hashCode ( ) { } @ Rename ( "equals" ) public boolean equals0 ( TObject other ) { } @ Rename ( "toString" ) public TString toString0 ( ) { <START_BUG> return TString . wrap ( ( ( ( getClass ( ) . getName ( ) ) + "@" ) + ( identity ( ) ) ) ) ; <END_BUG> } @ GeneratedBy ( ObjectNativeGenerator . class ) native int identity ( ) { } @ GeneratedBy ( ObjectNativeGenerator . class ) @ PluggableDependency ( ObjectNativeGenerator . class ) @ Override protected native Object clone ( ) throws TCloneNotSupportedException { } @ Rename ( "notify" ) public final void notify0 ( ) { } @ Rename ( "notifyAll" ) public final void notifyAll0 ( ) { } @ SuppressWarnings ( "unused" ) @ Rename ( "wait" ) public final void wait0 ( long timeout ) throws TInterruptedException { } @ SuppressWarnings ( "unused" ) @ Rename ( "wait" ) public final void wait0 ( long timeout , int nanos ) throws TInterruptedException { } @ Rename ( "wait" ) public final void wait0 ( ) throws TInterruptedException { } @ Override protected void finalize ( ) throws TThrowable { } @ InjectedBy ( ObjectNativeGenerator . class ) @ PluggableDependency ( ObjectNativeGenerator . class ) public static native TObject wrap ( Object obj ) { } }

Fix:
return TString . wrap ( ( ( ( getClass ( ) . getName ( ) ) + "@" ) + ( TInteger . toHexString ( identity ( ) ) ) ) ) ;
Buggy code:
public abstract class EmbedValueHandler extends AbstractValueHandler { private static final Localizer _loc = Localizer . forPackage ( EmbedValueHandler . class ) ; protected void map ( ValueMapping vm , String name , ColumnIO io , boolean adapt , List cols , List args ) { } protected Object toDataStoreValue ( OpenJPAStateManager em , ValueMapping vm , JDBCStore store , Column [ ] cols , Object rval , int idx ) { } protected int toDataStoreValue1 ( OpenJPAStateManager em , ValueMapping vm , JDBCStore store , Column [ ] cols , List rvals , int idx ) { } protected void toObjectValue ( OpenJPAStateManager em , ValueMapping vm , Object val , JDBCStore store , JDBCFetchConfiguration fetch , Column [ ] cols , int idx ) throws SQLException { } protected int toObjectValue1 ( OpenJPAStateManager em , ValueMapping vm , Object val , JDBCStore store , JDBCFetchConfiguration fetch , Column [ ] cols , int idx ) throws SQLException { } private Column [ ] getColumns ( FieldMapping fm ) { } public static void getEmbeddedIdCols ( FieldMapping fmd , List cols ) { } public static void getIdColumns ( FieldMapping fmd , List cols ) { Column [ ] pkCols = ( ( ValueMappingImpl ) ( fmd . getValue ( ) ) ) . getColumns ( ) ; for ( int j = 0 ; j < ( pkCols . length ) ; j ++ ) { Column newCol = new Column ( ) ; <START_BUG> newCol . setName ( pkCols [ j ] . getName ( ) ) ; <END_BUG> cols . add ( newCol ) ; } } }

Fix:
newCol . copy ( pkCols [ j ] ) ;
Buggy code:
@ ClientMarshaller public class ByteMarshaller extends AbstractNumberMarshaller < JSONValue , Byte > { @ Override public Class < Byte > getTypeHandled ( ) { } @ Override public String getEncodingType ( ) { } @ Override public Byte demarshall ( JSONValue o , MarshallingSession ctx ) { if ( o == null ) { return null ; } else if ( ( o . isObject ( ) ) != null ) { <START_BUG> return Byte . parseByte ( o . isObject ( ) . get ( NUMERIC_VALUE ) . isString ( ) . stringValue ( ) ) ; <END_BUG> } else if ( ( o . isNumber ( ) ) != null ) { return new Double ( o . isNumber ( ) . doubleValue ( ) ) . byteValue ( ) ; } else { return Byte . parseByte ( o . isString ( ) . stringValue ( ) ) ; } } @ Override public boolean handles ( JSONValue o ) { } }

Fix:
return new Double ( o . isObject ( ) . get ( NUMERIC_VALUE ) . isNumber ( ) . doubleValue ( ) ) . byteValue ( ) ;
Buggy code:
public class RecursiveDiscardAndRemoveTestCase { private static PathElement PATH = PathElement . pathElement ( "toto" , "testSubsystem" ) ; private static PathElement DISCARDED_WILDCARD = PathElement . pathElement ( "removeall" ) ; private static PathElement DISCARDED_WILDCARD_ENTRY = PathElement . pathElement ( "removeall" , "entry" ) ; private static PathElement DISCARDED_SPECIFIC = PathElement . pathElement ( "remove" , "one" ) ; private static PathElement DISCARDED_CHILD = PathElement . pathElement ( "child" , "one" ) ; private Resource resourceRoot = Factory . create ( ) ; private TransformerRegistry registry = TransformerRegistry . Factory . create ( null ) ; private ManagementResourceRegistration resourceRegistration = ManagementResourceRegistration . Factory . create ( RecursiveDiscardAndRemoveTestCase . ROOT ) ; private TransformersSubRegistration transformersSubRegistration ; private ModelNode resourceModel ; @ Before public void setUp ( ) { } @ Test public void testDiscardResource ( ) throws Exception { } @ Test public void testRejectResource ( ) throws Exception { } private void sanityTestNonDiscardedResource ( ) throws Exception { } private void discardResourceOperationsTest ( PathAddress pathAddress ) throws Exception { } private void rejectResourceOperationsTest ( PathAddress pathAddress ) throws Exception { } private Resource transformResource ( ) throws OperationFailedException { } private TransformedOperation transformOperation ( final ModelNode operation ) throws OperationFailedException { } private ResourceTransformationContext createContext ( final TransformationTarget target ) { } private Transformers getTransfomers ( final TransformationTarget target ) { } protected TransformationTarget create ( final TransformerRegistry registry , ModelVersion version ) { } protected TransformationTarget create ( final TransformerRegistry registry , ModelVersion version , TransformationTarget . TransformationTargetType type ) { <START_BUG> return TransformationTargetImpl . create ( registry , version , Collections . < PathAddress , ModelVersion > emptyMap ( ) , null , type ) ; <END_BUG> } private static final DescriptionProvider NOOP_PROVIDER = new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { } } ; private static final ResourceDefinition ROOT = new org . jboss . as . controller . SimpleResourceDefinition ( PathElement . pathElement ( "test" ) , RecursiveDiscardAndRemoveTestCase . NOOP_PROVIDER ) ; protected void assertRejected ( final ModelNode original , final TransformedOperation transformed ) { } private void assertDiscarded ( final TransformedOperation transformed ) { } private static final ModelNode success ( ) { } }

Fix:
return TransformationTargetImpl . create ( registry , version , Collections . < PathAddress , ModelVersion > emptyMap ( ) , null , type , null ) ;
Buggy code:
public class ChooseAreaActivity extends Activity { public static final int LEVEL_PROVINCE = 0 ; public static final int LEVEL_CITY = 1 ; private ProgressDialog progressDialog ; private TextView titleText ; private ListView listView ; private ArrayAdapter < String > adapter ; private JustWeatherDB justWeatherDB ; private List < String > dataList = new ArrayList < > ( ) ; private List < Province > provinceList ; private List < City > cityList ; private Province selectedProvince ; private int currentLevel ; private boolean isFromWeatherActivtiy ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void queryProvinces ( ) { } private void queryCities ( ) { } private void queryFromServer ( final String type ) { } private void showProgressDialog ( ) { if ( ( progressDialog ) == null ) { progressDialog = new ProgressDialog ( this ) ; <START_BUG> progressDialog . setMessage ( "Loading...." ) ; <END_BUG> progressDialog . setCanceledOnTouchOutside ( false ) ; } progressDialog . show ( ) ; } private void closeProgressDialog ( ) { } @ Override public void onBackPressed ( ) { } }

Fix:
progressDialog . setMessage ( "首次加载时间较长，抱歉......" ) ;
Buggy code:
public class ObjectFactoryBuilder implements ObjectFactory , javax . naming . spi . ObjectFactoryBuilder { public ObjectFactory createObjectFactory ( final Object obj , Hashtable < ? , ? > environment ) throws NamingException { } public Object getObjectInstance ( final Object obj , final Name name , final Context nameCtx , final Hashtable < ? , ? > environment ) throws Exception { } private ObjectFactory factoryFromReference ( final Reference reference , final Hashtable < ? , ? > environment ) throws NamingException { } private ObjectFactory factoryFromModularReference ( ModularReference modularReference ) throws NamingException { try { <START_BUG> final Module module = Module . getModule ( modularReference . getModuleIdentifier ( ) ) ; <END_BUG> final Class < ? > factoryClass = module . getClassLoader ( ) . loadClass ( modularReference . getFactoryClassName ( ) ) ; return ObjectFactory . class . cast ( factoryClass . newInstance ( ) ) ; } catch ( Throwable t ) { throw namingException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>object<seq2seq4repair_space>factory<seq2seq4repair_space>from<seq2seq4repair_space>modular<seq2seq4repair_space>reference." , t ) ; } } private ClassLoader getContextClassLoader ( ) { } }

Fix:
final Module module = Module . getCurrentModuleLoader ( ) . loadModule ( modularReference . getModuleIdentifier ( ) ) ;
Buggy code:
public class OSGiBundleInfoParseProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; BundleInfo info = BundleInfoAttachment . getBundleInfo ( deploymentUnit ) ; if ( info != null ) return ; VirtualFile virtualFile = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ; Manifest manifest = deploymentUnit . getAttachment ( OSGI_MANIFEST ) ; if ( manifest == null ) return ; try { ServiceRegistry serviceRegistry = phaseContext . getServiceRegistry ( ) ; <START_BUG> String location = InstallBundleInitiatorService . getLocation ( serviceRegistry , deploymentUnit . getName ( ) ) ; <END_BUG> info = BundleInfo . createBundleInfo ( AbstractVFS . adapt ( virtualFile ) , location ) ; BundleInfoAttachment . attachBundleInfo ( deploymentUnit , info ) ; } catch ( BundleException ex ) { throw new DeploymentUnitProcessingException ( ( "Cannot<seq2seq4repair_space>create<seq2seq4repair_space>bundle<seq2seq4repair_space>deployment<seq2seq4repair_space>from:<seq2seq4repair_space>" + virtualFile ) ) ; } } @ Override public void undeploy ( final DeploymentUnit deploymentUnit ) { } }

Fix:
String location = DeploymentHolderService . getLocation ( serviceRegistry , deploymentUnit . getName ( ) ) ;
Buggy code:
public class TestSettingsResourceBundle extends TestCase { public TestSettingsResourceBundle ( String name ) { } public void testMain ( ) { <START_BUG> CheckResourceBundle . checkResourceBundle ( this , new SettingsResourceBundle ( ) ) ; <END_BUG> } }

Fix:
CheckResourceBundle . checkResourceBundle ( this , "org.argouml.i18n.SettingsResourceBundle" ) ;