nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ReferenceIdentityMap < K , V > extends AbstractReferenceMap < K , V > implements Serializable { private static final long serialVersionUID = - 1266190134568365852L ; public ReferenceIdentityMap ( ) { } public ReferenceIdentityMap ( final ReferenceStrength keyType , final ReferenceStrength valueType ) { } public ReferenceIdentityMap ( final ReferenceStrength keyType , final ReferenceStrength valueType , final boolean purgeValues ) { } public ReferenceIdentityMap ( final ReferenceStrength keyType , final ReferenceStrength valueType , final int capacity , final float loadFactor ) { } public ReferenceIdentityMap ( final ReferenceStrength keyType , final ReferenceStrength valueType , final int capacity , final float loadFactor , final boolean purgeValues ) { } @ Override protected int hash ( final Object key ) { } @ Override protected int hashEntry ( final Object key , final Object value ) { } @ Override protected boolean isEqualKey ( final Object key1 , Object key2 ) { <START_BUG> key2 = ( ( keyType ) == ( ReferenceStrength . HARD ) ) ? key2 : ( ( Reference < ? > ) ( key2 ) ) . get ( ) ; <END_BUG> return key1 == key2 ; } @ Override protected boolean isEqualValue ( final Object value1 , final Object value2 ) { } private void writeObject ( final ObjectOutputStream out ) throws IOException { } private void readObject ( final ObjectInputStream in ) throws IOException , ClassNotFoundException { } }

Fix:
key2 = ( isKeyType ( HARD ) ) ? key2 : ( ( Reference < ? > ) ( key2 ) ) . get ( ) ;
Buggy code:
public class TestTotalHitCountCollector extends LuceneTestCase { public void testBasics ( ) throws Exception { Directory indexStore = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , indexStore ) ; for ( int i = 0 ; i < 5 ; i ++ ) { Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . StringField ( "string" , ( "a" + i ) , Store . NO ) ) ; doc . add ( new org . apache . lucene . document . StringField ( "string" , ( "b" + i ) , Store . NO ) ) ; writer . addDocument ( doc ) ; } IndexReader reader = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> IndexSearcher searcher = newSearcher ( reader ) ; TotalHitCountCollector c = new TotalHitCountCollector ( ) ; searcher . search ( new MatchAllDocsQuery ( ) , null , c ) ; assertEquals ( 5 , c . getTotalHits ( ) ) ; reader . close ( ) ; indexStore . close ( ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class PerceptronLearning { private float [ ] [ ] examples ; private Network network ; private INode [ ] inputN ; public PerceptronLearning ( float [ ] [ ] ex , Network net , float err ) { } public Network Learn ( float learn_rate ) { } public float sigActivate ( float x ) { } public float sigDerive ( float x ) { } public void printExamples ( ) { for ( int i = 0 ; i < ( examples . length ) ; i ++ ) { for ( int j = 0 ; j < ( examples [ i ] . length ) ; j ++ ) { <START_BUG> System . out . print ( examples [ i ] [ j ] ) ; <END_BUG> } System . out . println ( ) ; } } }

Fix:
System . out . print ( ( ( examples [ i ] [ j ] ) + "," ) ) ;
Buggy code:
class FastViewPane { private int side = SWT . LEFT ; private Sash fastViewSash ; private ViewPane currentPane ; private Composite clientComposite ; private static final int SASH_SIZE = 3 ; private static final int MIN_FASTVIEW_SIZE = 10 ; private float ratio ; private DefaultStackPresentationSite site = new DefaultStackPresentationSite ( ) { public void setState ( int newState ) { } public void close ( IPresentablePart part ) { } } ; private Listener resizeListener = new Listener ( ) { public void handleEvent ( Event event ) { } } ; private SelectionAdapter selectionListener = new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { } } ; public float getCurrentRatio ( ) { } private Rectangle getBounds ( ) { } private void setFastViewSizeUsingRatio ( ) { } public void showView ( Composite newClientComposite , ViewPane pane , int newSide , float sizeRatio ) { side = newSide ; if ( ( currentPane ) != null ) { hideView ( ) ; } currentPane = pane ; ratio = sizeRatio ; clientComposite = newClientComposite ; clientComposite . addListener ( Resize , resizeListener ) ; if ( ( fastViewSash ) != null ) { fastViewSash . dispose ( ) ; fastViewSash = null ; } Control ctrl = pane . getControl ( ) ; if ( ctrl == null ) { pane . createControl ( clientComposite ) ; ctrl = pane . getControl ( ) ; } <START_BUG> StackPresentation presentation = new org . eclipse . ui . internal . presentations . PartTabFolderPresentation ( newClientComposite , site , ( ( SWT . MIN ) | ( SWT . MAX ) ) , pane . getPage ( ) . getTheme ( ) ) ; <END_BUG> site . setPresentation ( presentation ) ; site . setPresentationState ( STATE_MAXIMIZED ) ; presentation . addPart ( pane . getPresentablePart ( ) , null ) ; presentation . selectPart ( pane . getPresentablePart ( ) ) ; presentation . setActive ( true ) ; presentation . setVisible ( true ) ; setFastViewSizeUsingRatio ( ) ; ctrl . setEnabled ( true ) ; Composite parent = ctrl . getParent ( ) ; Rectangle bounds = getFastViewBounds ( ) ; pane . setVisible ( true ) ; presentation . setBounds ( bounds ) ; presentation . getControl ( ) . moveAbove ( null ) ; pane . moveAbove ( null ) ; pane . setFocus ( ) ; fastViewSash = new Sash ( parent , Geometry . getSwtHorizontalOrVerticalConstant ( Geometry . isHorizontal ( side ) ) ) ; fastViewSash . addSelectionListener ( selectionListener ) ; pane . setFastViewSash ( fastViewSash ) ; updateFastViewSashBounds ( bounds ) ; } private void updateFastViewSashBounds ( Rectangle bounds ) { } public void dispose ( ) { } private Rectangle getFastViewBounds ( ) { } private StackPresentation getPresentation ( ) { } public void hideFastViewSash ( ) { } public void hideView ( ) { } public ViewPane getCurrentPane ( ) { } }

Fix:
StackPresentation presentation = new org . eclipse . ui . internal . presentations . PartTabFolderPresentation ( newClientComposite , site , ( ( SWT . MIN ) | ( SWT . MAX ) ) ) ;
Buggy code:
public class BcelGenericSignatureToTypeXTestCase extends TestCase { public void testEnumFromHell ( ) { BcelWorld world = new BcelWorld ( ) ; JavaClass javaLangEnum = Repository . lookupClass ( "java//lang//Enum" ) ; Signature . ClassSignature cSig = javaLangEnum . getGenericClassTypeSignature ( ) ; UnresolvedType superclass = BcelGenericSignatureToTypeXConverter . classTypeSignature2TypeX ( cSig . superclassSignature , cSig . formalTypeParameters , world ) ; assertEquals ( "Ljava//lang//Object;" , superclass . getSignature ( ) ) ; assertEquals ( "2<seq2seq4repair_space>superinterfaces" , 2 , cSig . superInterfaceSignatures . length ) ; UnresolvedType comparable = BcelGenericSignatureToTypeXConverter . classTypeSignature2TypeX ( cSig . superInterfaceSignatures [ 0 ] , cSig . formalTypeParameters , world ) ; <START_BUG> assertEquals ( "Pjava//lang//Comparable<Pjava//lang//Enum<Ljava//lang//Object;>;>;" , comparable . getSignature ( ) ) ; <END_BUG> UnresolvedType serializable = BcelGenericSignatureToTypeXConverter . classTypeSignature2TypeX ( cSig . superInterfaceSignatures [ 1 ] , cSig . formalTypeParameters , world ) ; assertEquals ( "Ljava//io//Serializable;" , serializable . getSignature ( ) ) ; } public void testColonColon ( ) { } }

Fix:
assertEquals ( "Pjava//lang//Comparable<TE;>;" , comparable . getSignature ( ) ) ;
Buggy code:
public class SoftRestorer extends ArenaRestorer { private Cuboid cuboid ; private LinkedList < SoftRestorer . BlockChange > changedBlocks ; Iterator < SoftRestorer . BlockChange > it ; public SoftRestorer ( int waitBeforeRestoring ) { } @ Override public void setArena ( Cuboid cuboid ) { } @ Override public void saveArena ( ) { } @ Override public void restoreArena ( ) { if ( ( it ) == null ) it = changedBlocks . iterator ( ) ; for ( int i = 0 ; i < 40 ; i ++ ) { <START_BUG> if ( ! ( it . hasNext ( ) ) ) { <END_BUG> it = null ; break ; } else { SoftRestorer . BlockChange changedBlock = it . next ( ) ; Block block = changedBlock . location . getBlock ( ) ; block . setTypeId ( changedBlock . blockData . getTypeId ( ) , false ) ; block . setData ( changedBlock . blockData . getData ( ) , false ) ; } } } @ Override public boolean tick ( ) { } @ Override public boolean updateBlock ( Block block , int oldType , byte oldData ) { } private class BlockChange { private Location location ; private SerializableBlockData blockData ; } }

Fix:
if ( ( ( it ) == null ) || ( ! ( it . hasNext ( ) ) ) ) {
Buggy code:
public class Connections { private Connections ( ) { } public static Time getLastModified ( final URL url ) throws IOException { final File file = Files . getLocalFileFromUrl ( url ) ; if ( file != null ) { <START_BUG> return IOUtils . getLastModified ( file ) ; <END_BUG> } URLConnection connection = url . openConnection ( ) ; final long milliseconds ; try { if ( connection instanceof JarURLConnection ) { JarURLConnection jarUrlConnection = ( ( JarURLConnection ) ( connection ) ) ; URL jarFileUrl = jarUrlConnection . getJarFileURL ( ) ; URLConnection jarFileConnection = jarFileUrl . openConnection ( ) ; try { milliseconds = jarFileConnection . getLastModified ( ) ; } finally { Connections . close ( jarFileConnection ) ; } } else { milliseconds = connection . getLastModified ( ) ; } if ( milliseconds == 0 ) { return null ; } return Time . millis ( milliseconds ) ; } finally { Connections . close ( connection ) ; } } public static void closeQuietly ( final URLConnection connection ) { } public static void close ( final URLConnection connection ) throws IOException { } }

Fix:
return Files . getLastModified ( file ) ;
Buggy code:
public class NewsActivityFragmentInfo extends Fragment { ListView lv = null ; private ProgressBar spinner ; ArrayList < RSSObject > rssObject ; public NewsActivityFragmentInfo ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { final View rootView = inflater . inflate ( fragment_info , container , false ) ; lv = ( ( ListView ) ( rootView . findViewById ( newsListView ) ) ) ; spinner = ( ( ProgressBar ) ( rootView . findViewById ( progressBar1 ) ) ) ; DataManager . getInstance ( ) . getRSSFeedInfo ( new com . skandiacup . splinedevelopment . skandiacup . repository . SoapCallback < ArrayList < RSSObject > > ( ) { @ Override public void successCallback ( ArrayList < RSSObject > data ) { System . out . println ( ( "Datamanager<seq2seq4repair_space>RSS<seq2seq4repair_space>OK:<seq2seq4repair_space>" + ( data . size ( ) ) ) ) ; rssObject = data ; if ( ( getContext ( ) ) != null ) { spinner . setVisibility ( GONE ) ; <START_BUG> NewsAdapter newsAdapter = new NewsAdapter ( getContext ( ) . getApplicationContext ( ) , data ) ; <END_BUG> lv . setAdapter ( newsAdapter ) ; } } @ Override public void errorCallback ( ) { System . out . println ( "Datamanager<seq2seq4repair_space>RSS<seq2seq4repair_space>IKKE-OK" ) ; TextView tv = ( ( TextView ) ( rootView . findViewById ( onErrorMessage ) ) ) ; spinner . setVisibility ( GONE ) ; String errorMessage = getErrorMessage ( getContext ( ) ) ; tv . setText ( errorMessage ) ; } } ) ; lv . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { Intent detailIntent = new Intent ( getContext ( ) , NewsItemActivity . class ) ; detailIntent . putExtra ( "NewItem" , rssObject . get ( position ) ) ; startActivity ( detailIntent ) ; } } ) ; return rootView ; } No newline ; at end ; of file ; }

Fix:
InfoAdapter newsAdapter = new InfoAdapter ( getContext ( ) . getApplicationContext ( ) , data ) ;
Buggy code:
public class AddWorkerActivityBuilder extends ActivityBuilder { public Activity build ( int numOfWorkerToAdd ) { } @ Singleton public static class AddDataflowWorkerActivityStepBuilder implements ActivityStepBuilder { @ Inject private Registry registry ; @ Override public List < ActivityStep > build ( Activity activity , Injector container ) throws Exception { } public static ActivityStep createAddDataflowWorkerStep ( Registry registry ) throws Exception { } } @ Singleton public static class AddDataflowWorkerStepExecutor implements ActivityStepExecutor { @ Inject private DataflowService service ; @ Override public void execute ( ActivityExecutionContext context , Activity activity , ActivityStep step ) throws Exception { DataflowDescriptor dflDescriptor = service . getDataflowRegistry ( ) . getDataflowDescriptor ( ) ; DataflowRegistry dataflowRegistry = service . getDataflowRegistry ( ) ; Registry registry = dataflowRegistry . getRegistry ( ) ; RegistryConfig registryConfig = registry . getRegistryConfig ( ) ; VMConfig vmConfig = new VMConfig ( ) ; vmConfig . setEnvironment ( service . getVMConfig ( ) . getEnvironment ( ) ) . setName ( ( ( ( dflDescriptor . getId ( ) ) + "-worker-" ) + ( step . attribute ( "worker.id" ) ) ) ) . addRoles ( "dataflow-worker" ) . setRegistryConfig ( registryConfig ) . setVmApplication ( VMDataflowWorkerApp . class . getName ( ) ) . addProperty ( "dataflow.registry.path" , dataflowRegistry . getDataflowPath ( ) ) . setHadoopProperties ( service . getVMConfig ( ) . getHadoopProperties ( ) ) ; String dataflowAppHome = dflDescriptor . getDataflowAppHome ( ) ; if ( dataflowAppHome != null ) { vmConfig . setAppHome ( dataflowAppHome ) ; vmConfig . addVMResource ( "dataflow.libs" , ( dataflowAppHome + "//libs" ) ) ; } VMClient vmClient = new VMClient ( registry ) ; VMDescriptor vmDescriptor = vmClient . allocate ( vmConfig ) ; service . addWorker ( vmDescriptor ) ; } } @ Singleton public static class WaitForWorkerRunningStatus implements ActivityStepExecutor { @ Inject private DataflowService service ; @ Override public void execute ( ActivityExecutionContext ctx , Activity activity , ActivityStep step ) throws Exception { DataflowRegistry dflRegistry = service . getDataflowRegistry ( ) ; <START_BUG> Node activeWorkerNodes = dflRegistry . getAllWorkersNode ( ) ; <END_BUG> List < String > workers = activeWorkerNodes . getChildren ( ) ; WaitingNodeEventListener waitingListener = new com . neverwinterdp . registry . event . WaitingRandomNodeEventListener ( dflRegistry . getRegistry ( ) ) ; for ( int i = 0 ; i < ( workers . size ( ) ) ; i ++ ) { String path = ( ( ( activeWorkerNodes . getPath ( ) ) + "//" ) + ( workers . get ( i ) ) ) + "//status" ; step . addLog ( "" ) ; String logDesc = "Wait<seq2seq4repair_space>for<seq2seq4repair_space>RUNNING<seq2seq4repair_space>status<seq2seq4repair_space>for<seq2seq4repair_space>worker<seq2seq4repair_space>" + ( workers . get ( i ) ) ; step . addLog ( logDesc ) ; waitingListener . add ( path , RUNNING , logDesc , true ) ; } waitingListener . waitForEvents ( ( 30 * 1000 ) ) ; } } }

Fix:
Node activeWorkerNodes = dflRegistry . getActiveWorkersNode ( ) ;
Buggy code:
public class CustomActivity extends Activity { private static String TAG = "CustomActivity" ; public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; <START_BUG> setTheme ( theme ) ; <END_BUG> } public SharedPreferences getPreferences ( ) { } }

Fix:
setTheme ( MainTheme ) ;
Buggy code:
public class TestCompoundFile extends LuceneTestCase { public static void main ( String [ ] args ) { } private Directory dir ; public void setUp ( ) throws Exception { super . setUp ( ) ; File file = new File ( System . getProperty ( "tempDir" ) , "testIndex" ) ; _TestUtil . rmDir ( file ) ; <START_BUG> dir = FSDirectory . getDirectory ( file , null , false ) ; <END_BUG> } private void createRandomFile ( Directory dir , String name , int size ) throws IOException { } private void createSequenceFile ( Directory dir , String name , byte start , int size ) throws IOException { } private void assertSameStreams ( String msg , IndexInput expected , IndexInput test ) throws IOException { } private void assertSameStreams ( String msg , IndexInput expected , IndexInput actual , long seekTo ) throws IOException { } private void assertSameSeekBehavior ( String msg , IndexInput expected , IndexInput actual ) throws IOException { } private void assertEqualArrays ( String msg , byte [ ] expected , byte [ ] test , int start , int len ) { } public void testSingleFile ( ) throws IOException { } public void testTwoFiles ( ) throws IOException { } public void testRandomFiles ( ) throws IOException { } private void setUp_2 ( ) throws IOException { } public void testReadAfterClose ( ) throws IOException { } private void demo_FSIndexInputBug ( FSDirectory fsdir , String file ) throws IOException { } static boolean isCSIndexInput ( IndexInput is ) { } static boolean isCSIndexInputOpen ( IndexInput is ) throws IOException { } public void testClonedStreamsClosing ( ) throws IOException { } public void testRandomAccess ( ) throws IOException { } public void testRandomAccessClones ( ) throws IOException { } public void testFileNotFound ( ) throws IOException { } public void testReadPastEOF ( ) throws IOException { } public void testLargeWrites ( ) throws IOException { } }

Fix:
dir = FSDirectory . getDirectory ( file ) ;
Buggy code:
public final class Game extends com . badlogic . gdx . Game { @ Override public void create ( ) { if ( Globals . SHOW_PARTICLE_EFFECT_VIEWER ) { setScreen ( new ParticleEffectViewer ( ) ) ; } else { <START_BUG> setScreen ( new Driver ( ) ) ; <END_BUG> } } }

Fix:
setScreen ( Driver . getInstance ( ) ) ;
Buggy code:
public class AnnotationBits { private String tokenIdentifier ; private String token ; private String mweIdentifier1 ; private String mweIdentifier2 ; private String mweType1X ; private String mweType2 ; final int NO_SENTEMCE_MARKER = - 2 ; private int sentenceNumber = NO_SENTEMCE_MARKER ; private int lineNumeber = - 2 ; public String getAnnotationBit1Key ( ) { } public void setLineNumeber ( int lineNumeber ) { } public int getLineNumeber ( ) { <START_BUG> return lineNumeber ; <END_BUG> } public String getAnnotationBit2Key ( ) { } private String toStringBitKey ( String bit ) { } public static AnnotationBits fromString ( String line , int sentenceNumber , int lineNumber ) throws Exception { } public String toDebugString ( ) { } public static final String replaceStringForNullValueInAnnotation = "" ; private String toStringBit ( String bit , String delimiter ) { } public String getMweIdentifier1 ( ) { } public String getMweIdentifier2 ( ) { } public String getMweType1 ( ) { } public String getMweType2 ( ) { } public String getToken ( ) { } public String getTokenIdentifier ( ) { } public int getSentenceNumber ( ) { } public boolean hasMweIdentifier1 ( ) { } public boolean hasMweIdentifier2 ( ) { } public boolean hasMweType1 ( ) { } public boolean hasMweType2 ( ) { } public boolean hasToken ( ) { } public boolean hasTokenIdentifier ( ) { } public boolean hasSentenceNumber ( ) { } public void setMweIdentifier1 ( String mweIdentifier1 ) { } public void setMweIdentifier2 ( String mweIdentifier2 ) { } public void setMweType1 ( String mweType1 ) { } public void setMweType2 ( String mweType2 ) { } public void setSentenceNumber ( int sentenceNumber ) { } public void setToken ( String token ) { } }

Fix:
return ( lineNumeber ) + 2 ;
Buggy code:
public class VCenterEventHandler { Event event ; VCenterDB vcenterDB ; VncDB vncDB ; private final Logger s_logger = Logger . getLogger ( VCenterEventHandler . class ) ; VCenterEventHandler ( Event event , VCenterDB vcenterDB , VncDB vncDB ) { } private void printEvent ( ) { } public void handle ( ) throws Exception { } private void handleVmUpdateEvent ( ) throws Exception { } private void handleVmDeleteEvent ( ) throws Exception { } private void handleNetworkUpdateEvent ( ) throws Exception { } private void handleNetworkDeleteEvent ( ) throws Exception { } private void handleEvent ( Event event ) { <START_BUG> s_logger . error ( "Buddy<seq2seq4repair_space>you<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>a<seq2seq4repair_space>hold<seq2seq4repair_space>off<seq2seq4repair_space>this<seq2seq4repair_space>event" ) ; <END_BUG> } }

Fix:
s_logger . error ( ( "Need<seq2seq4repair_space>to<seq2seq4repair_space>process<seq2seq4repair_space>" + ( event . getClass ( ) . getName ( ) ) ) ) ;
Buggy code:
public class SendAllMessagesAction extends FrameAction { public SendAllMessagesAction ( AbstractFrameController controller ) { } public void actionPerformed ( ActionEvent evt ) { FolderCommandReference [ ] r = new FolderCommandReference [ 1 ] ; OutboxFolder folder = ( ( OutboxFolder ) ( treeModel . getFolder ( 103 ) ) ) ; r [ 0 ] = new FolderCommandReference ( folder ) ; <START_BUG> SendAllMessagesCommand c = new SendAllMessagesCommand ( frameController , r ) ; <END_BUG> processor . addOp ( c ) ; } }

Fix:
SendAllMessagesCommand c = new SendAllMessagesCommand ( frameMediator , r ) ;
Buggy code:
public class DataTableCellRenderer extends DefaultTableCellRenderer { private static final long serialVersionUID = 1L ; @ Override protected void setValue ( Object o ) { if ( o instanceof Boolean ) { if ( ( ( boolean ) ( o ) ) ) { super . setValue ( "Yes" ) ; } else { super . setValue ( "No" ) ; } } else if ( o instanceof UPI ) { <START_BUG> super . setValue ( ( ( UPI ) ( o ) ) . fullTaxonomy ) ; <END_BUG> } else super . setValue ( o ) ; } }

Fix:
super . setValue ( ( ( UPI ) ( o ) ) . getFullTaxonomy ( ) ) ;
Buggy code:
public class TelicProtocolDecoder extends BaseProtocolDecoder { public TelicProtocolDecoder ( TelicProtocol protocol ) { } private static final Pattern PATTERN = new PatternBuilder ( ) . number ( "dddd" ) . number ( "(d{6})" ) . number ( "(d+)," ) . number ( "d{12}," ) . number ( "d+," ) . number ( "(dd)(dd)(dd)" ) . number ( "(dd)(dd)(dd)," ) . groupBegin ( ) . number ( "(ddd)(dd)(dddd)," ) . number ( "(dd)(dd)(dddd)," ) . or ( ) . number ( "(-?d+)," ) . number ( "(-?d+)," ) . groupEnd ( ) . number ( "(d)," ) . number ( "(d+)," ) . number ( "(d+)," ) . number ( "(d+)," ) . expression ( "(?:[^,]*,){7}" ) . number ( "(d+)," ) . any ( ) . compile ( ) ; @ Override protected Object decode ( Channel channel , SocketAddress remoteAddress , Object msg ) throws Exception { Parser parser = new Parser ( TelicProtocolDecoder . PATTERN , ( ( String ) ( msg ) ) ) ; if ( ! ( parser . matches ( ) ) ) { return null ; } Position position = new Position ( ) ; position . setProtocol ( getProtocolName ( ) ) ; if ( ! ( identify ( parser . next ( ) , channel , remoteAddress ) ) ) { return null ; } position . setDeviceId ( getDeviceId ( ) ) ; position . set ( KEY_TYPE , parser . next ( ) ) ; DateBuilder dateBuilder = new DateBuilder ( ) . setDateReverse ( parser . nextInt ( ) , parser . nextInt ( ) , parser . nextInt ( ) ) . setTime ( parser . nextInt ( ) , parser . nextInt ( ) , parser . nextInt ( ) ) ; position . setTime ( dateBuilder . getDate ( ) ) ; if ( parser . hasNext ( 6 ) ) { position . setLongitude ( parser . nextCoordinate ( DEG_MIN_MIN ) ) ; <START_BUG> position . setLongitude ( parser . nextCoordinate ( DEG_MIN_MIN ) ) ; <END_BUG> } if ( parser . hasNext ( 2 ) ) { position . setLongitude ( ( ( parser . nextDouble ( ) ) // 10000 ) ) ; position . setLatitude ( ( ( parser . nextDouble ( ) ) // 10000 ) ) ; } position . setValid ( ( ( parser . nextInt ( ) ) != 1 ) ) ; position . setSpeed ( parser . nextDouble ( ) ) ; position . setCourse ( parser . nextDouble ( ) ) ; position . set ( KEY_SATELLITES , parser . next ( ) ) ; position . set ( KEY_BATTERY , parser . nextInt ( ) ) ; return position ; } }

Fix:
position . setLatitude ( parser . nextCoordinate ( DEG_MIN_MIN ) ) ;
Buggy code:
public class ParachuteServerProxy extends ParachuteCommonProxy { @ Override public void preInit ( ) { } @ Override public void Init ( ) { } @ Override public void postInit ( ) { <START_BUG> info ( ( ( Parachute . modid ) + "<seq2seq4repair_space>DedicatedServer<seq2seq4repair_space>initialization<seq2seq4repair_space>is<seq2seq4repair_space>complete." ) ) ; <END_BUG> } }

Fix:
info ( ( ( Parachute . modid ) + "<seq2seq4repair_space>DedicatedServer<seq2seq4repair_space>postInit<seq2seq4repair_space>is<seq2seq4repair_space>complete." ) ) ;
Buggy code:
public final class LoadProperties extends Task { private File srcFile = null ; private final Vector filterChains = new Vector ( ) ; private String encoding = null ; public final void setSrcFile ( final File srcFile ) { } public final void setEncoding ( final String encoding ) { } public final void execute ( ) throws BuildException { if ( ( srcFile ) == null ) { throw new BuildException ( "Source<seq2seq4repair_space>file<seq2seq4repair_space>not<seq2seq4repair_space>defined." ) ; } if ( ! ( srcFile . exists ( ) ) ) { throw new BuildException ( "Source<seq2seq4repair_space>file<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) ; } if ( ! ( srcFile . isFile ( ) ) ) { throw new BuildException ( "Source<seq2seq4repair_space>file<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>file." ) ; } FileInputStream fis = null ; BufferedInputStream bis = null ; Reader instream = null ; try { final long len = srcFile . length ( ) ; final int size = ( ( int ) ( len ) ) ; fis = new FileInputStream ( srcFile ) ; bis = new BufferedInputStream ( fis ) ; if ( ( encoding ) == null ) { instream = new InputStreamReader ( bis ) ; } else { instream = new InputStreamReader ( bis , encoding ) ; } ChainReaderHelper crh = new ChainReaderHelper ( ) ; crh . setBufferSize ( size ) ; crh . setPrimaryReader ( instream ) ; crh . setFilterChains ( filterChains ) ; crh . setProject ( getProject ( ) ) ; instream = crh . getAssembledReader ( ) ; String text = crh . readFully ( instream ) ; if ( text != null ) { if ( ! ( text . endsWith ( "\n" ) ) ) { text = text + "\n" ; } ByteArrayInputStream tis = null ; if ( ( encoding ) == null ) { tis = new ByteArrayInputStream ( text . getBytes ( ) ) ; } else { tis = new ByteArrayInputStream ( text . getBytes ( encoding ) ) ; } final Properties props = new Properties ( ) ; props . load ( tis ) ; final Enumeration e = props . keys ( ) ; while ( e . hasMoreElements ( ) ) { final String key = ( ( String ) ( e . nextElement ( ) ) ) ; final String value = props . getProperty ( key ) ; if ( ( ( key != null ) && ( value != null ) ) && ( ( value . trim ( ) . length ( ) ) > 0 ) ) { getProject ( ) . setNewProperty ( key , value ) ; } } tis . close ( ) ; } } catch ( final IOException ioe ) { final String message = "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>file:<seq2seq4repair_space>" + ( ioe . toString ( ) ) ; <START_BUG> throw new BuildException ( message , ioe , location ) ; <END_BUG> } catch ( final BuildException be ) { throw be ; } finally { try { if ( fis != null ) { fis . close ( ) ; } } catch ( IOException ioex ) { } } } public final void addFilterChain ( FilterChain filter ) { } }

Fix:
throw new BuildException ( message , ioe , getLocation ( ) ) ;
Buggy code:
@ RestController @ RequestMapping ( "//rest//report//" ) public class ReportsResource { @ Autowired private ReportsGenerator reportsGenerator ; @ Autowired private BillService billService ; @ RequestMapping ( value = "//dailyOrderReport" , method = RequestMethod . GET , produces = MediaType . APPLICATION_JSON_VALUE ) @ ResponseBody public ResponseEntity < Map < String , Object > > generateReportByDate ( ) throws SQLException { } @ RequestMapping ( value = "//monthlyBills" , method = RequestMethod . GET , produces = MediaType . APPLICATION_JSON_VALUE ) @ ResponseBody public ResponseEntity < Map < String , Object > > generatePaidToUnpaidBills ( ) throws SQLException { LocalDate localDate = LocalDate . now ( ) ; List < Bill > billList = billService . findByMonth ( localDate . minusMonths ( 1 ) . getMonth ( ) , localDate . minusMonths ( 1 ) . getYear ( ) ) ; List < Bill > paidBills = Lambda . filter ( having ( on ( Bill . class ) . getPaidAmount ( ) , greaterThan ( 0.0 ) ) , billList ) ; <START_BUG> List < Bill > unpaidBills = Lambda . filter ( having ( on ( Bill . class ) . getPaidAmount ( ) , lessThan ( 1 ) ) , billList ) ; <END_BUG> Map < String , Object > userMap = new HashMap < > ( ) ; Double unpaidAmount = ( ( double ) ( 0 ) ) ; Double paidAmount = ( ( double ) ( 0 ) ) ; if ( ! ( unpaidBills . isEmpty ( ) ) ) { unpaidAmount = sumFrom ( unpaidBills ) . getPayableAmount ( ) ; } if ( ! ( paidBills . isEmpty ( ) ) ) { paidAmount = sumFrom ( paidBills ) . getPaidAmount ( ) ; } userMap . put ( "success" , Boolean . TRUE ) ; userMap . put ( "billList" , billList ) ; userMap . put ( "paidBills" , paidBills ) ; userMap . put ( "unpaidBills" , unpaidBills ) ; userMap . put ( "paidBillsCount" , paidBills . size ( ) ) ; userMap . put ( "unpaidBillsCount" , unpaidBills . size ( ) ) ; userMap . put ( "unpaidAmount" , unpaidAmount ) ; userMap . put ( "amountYetToBePaid" , ( unpaidAmount - paidAmount ) ) ; userMap . put ( "paidAmount" , paidAmount ) ; userMap . put ( "forMonth" , localDate . minusMonths ( 1 ) . getMonth ( ) . getDisplayName ( TextStyle . FULL , Locale . US ) ) ; return new ResponseEntity ( userMap , HttpStatus . OK ) ; } @ RequestMapping ( value = "//dailyOrderGroundReport" , method = RequestMethod . GET , produces = MediaType . APPLICATION_JSON_VALUE ) @ ResponseBody public ResponseEntity < Map < String , Object > > generateDailyOrderGroundReport ( ) throws SQLException { } @ RequestMapping ( value = "//listBills" , method = RequestMethod . GET , produces = MediaType . APPLICATION_JSON_VALUE ) @ ResponseBody public ResponseEntity < Map < String , Object > > listBills ( ) throws SQLException { } }

Fix:
List < Bill > unpaidBills = Lambda . filter ( having ( on ( Bill . class ) . getPaidAmount ( ) , lessThan ( 1.0 ) ) , billList ) ;
Buggy code:
public class QNameDV extends TypeValidator { private static final String EMPTY_STRING = "" ; public short getAllowedFacets ( ) { } public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { String prefix ; String localpart ; int colonptr = content . indexOf ( ":" ) ; if ( colonptr > 0 ) { prefix = context . getSymbol ( content . substring ( 0 , colonptr ) ) ; localpart = content . substring ( ( colonptr + 1 ) ) ; } else { prefix = context . getSymbol ( QNameDV . EMPTY_STRING ) ; localpart = content ; } if ( ( ( prefix . length ( ) ) > 0 ) && ( ! ( XMLChar . isValidNCName ( prefix ) ) ) ) throw new InvalidDatatypeValueException ( ( ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>QName:<seq2seq4repair_space>'" ) + prefix ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>an<seq2seq4repair_space>NCName" ) ) ; if ( ! ( XMLChar . isValidNCName ( localpart ) ) ) throw new InvalidDatatypeValueException ( ( ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>QName:<seq2seq4repair_space>'" ) + localpart ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>an<seq2seq4repair_space>NCName" ) ) ; String uri = context . getURI ( prefix ) ; if ( ( ( prefix . length ( ) ) > 0 ) && ( uri == null ) ) throw new InvalidDatatypeValueException ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>QName:<seq2seq4repair_space>cannot<seq2seq4repair_space>resolve<seq2seq4repair_space>the<seq2seq4repair_space>prefix<seq2seq4repair_space>to<seq2seq4repair_space>a<seq2seq4repair_space>namespace<seq2seq4repair_space>uri" ) ) ; <START_BUG> return new QName ( prefix , localpart , content , uri ) ; <END_BUG> } public int getDataLength ( Object value ) { } }

Fix:
return new org . apache . xerces . xni . QName ( prefix , context . getSymbol ( localpart ) , context . getSymbol ( content ) , uri ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( ObjectFactoryWithEnvironmentBindingTestCase . ObjectFactoryWithEnvironmentBindingTestCaseServerSetup . class ) public class ObjectFactoryWithEnvironmentBindingTestCase { private static Logger LOGGER = Logger . getLogger ( ObjectFactoryWithEnvironmentBindingTestCase . class ) ; private static final String MODULE_NAME = "objectFactoryWithEnvironmentBindingModule" ; private static final String MODULE_JAR_NAME = "objectFactoryWithEnvironmentBinding.jar" ; private static final Map < String , String > ENVIRONMENT_PROPERTIES = ObjectFactoryWithEnvironmentBindingTestCase . getEnvironmentProperties ( ) ; private static Map < String , String > getEnvironmentProperties ( ) { } public static void validateEnvironmentProperties ( Hashtable < ? , ? > environment ) throws IllegalArgumentException { } static class ObjectFactoryWithEnvironmentBindingTestCaseServerSetup implements ServerSetupTask { @ Override public void setup ( final ManagementClient managementClient , final String containerId ) throws Exception { } private ModelNode createAddress ( ) { } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } } @ Deployment public static JavaArchive deploy ( ) { } @ Test public void testBindingWithEnvironment ( ) throws Exception { } private static void deployModule ( ) throws IOException { } private static void undeployModule ( ) { } private static File getModulesHome ( ) { String modulePath = System . getProperty ( "module.path" , null ) ; if ( modulePath == null ) { String jbossHome = System . getProperty ( "jboss.home" , null ) ; if ( jbossHome == null ) { throw new IllegalStateException ( "Neither<seq2seq4repair_space>-Dmodule.path<seq2seq4repair_space>nor<seq2seq4repair_space>-Djboss.home<seq2seq4repair_space>were<seq2seq4repair_space>set" ) ; } modulePath = ( jbossHome + ( File . separatorChar ) ) + "modules" ; } else { <START_BUG> modulePath = modulePath . split ( File . pathSeparator ) [ 0 ] ; <END_BUG> } File moduleDir = new File ( modulePath ) ; if ( ! ( moduleDir . exists ( ) ) ) { throw new IllegalStateException ( "Determined<seq2seq4repair_space>module<seq2seq4repair_space>path<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ) ; } if ( ! ( moduleDir . isDirectory ( ) ) ) { throw new IllegalStateException ( "Determined<seq2seq4repair_space>module<seq2seq4repair_space>path<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>dir" ) ; } return moduleDir ; } private static void copyFile ( File target , InputStream src ) throws IOException { } private static void deleteRecursively ( File file ) { } }

Fix:
modulePath = modulePath . split ( File . pathSeparator ) [ 1 ] ;
Buggy code:
@ RunWith ( Arquillian . class ) public class TypeBeansTestCase { @ Deployment ( name = "type-beans" ) public static JavaArchive getCycleBeansJar ( ) { JavaArchive archive = ShrinkWrap . create ( JavaArchive . class , "type-beans.jar" ) ; archive . addPackage ( TFactory . class . getPackage ( ) ) ; <START_BUG> archive . addAsManifestResource ( "pojo//type-jboss-beans.xml" , "type-jboss-beans.xml" ) ; <END_BUG> return archive ; } @ Test @ OperateOnDeployment ( "type-beans" ) public void testTypeBeans ( ) throws Exception { } }

Fix:
archive . addAsManifestResource ( TypeBeansTestCase . class . getPackage ( ) , "type-jboss-beans.xml" , "type-jboss-beans.xml" ) ;
Buggy code:
public class NTEventLogAppender extends AppenderSkeleton { private int _handle = 0 ; private String source = null ; private String server = null ; private static final int FATAL = Level . FATAL . toInt ( ) ; private static final int ERROR = Level . ERROR . toInt ( ) ; private static final int WARN = Level . WARN . toInt ( ) ; private static final int INFO = Level . INFO . toInt ( ) ; private static final int DEBUG = Level . DEBUG . toInt ( ) ; public NTEventLogAppender ( ) { } public NTEventLogAppender ( String source ) { } public NTEventLogAppender ( String server , String source ) { } public NTEventLogAppender ( Layout layout ) { } public NTEventLogAppender ( String source , Layout layout ) { } public NTEventLogAppender ( String server , String source , Layout layout ) { } public void close ( ) { } public void activateOptions ( ) { } public void append ( LoggingEvent event ) { StringBuffer sbuf = new StringBuffer ( ) ; sbuf . append ( layout . format ( event ) ) ; if ( layout . ignoresThrowable ( ) ) { String [ ] s = event . getThrowableStrRep ( ) ; if ( s != null ) { int len = s . length ; for ( int i = 0 ; i < len ; i ++ ) { sbuf . append ( s [ i ] ) ; } } } <START_BUG> int nt_category = event . level . toInt ( ) ; <END_BUG> reportEvent ( _handle , sbuf . toString ( ) , nt_category ) ; } public void finalize ( ) { } public void setSource ( String source ) { } public String getSource ( ) { } public boolean requiresLayout ( ) { } private native int registerEventSource ( String server , String source ) { } private native void reportEvent ( int handle , String message , int level ) { } private native void deregisterEventSource ( int handle ) { } }

Fix:
int nt_category = event . getLevel ( ) . toInt ( ) ;
Buggy code:
public class Browser6 { public static boolean passed = false ; public static boolean test1 ( String url ) { } public static boolean test2 ( String url , final String expectedTitle ) { } static boolean runLoopTimer ( final Display display , final Shell shell , final int seconds ) { } public static boolean test ( ) { int fail = 0 ; <START_BUG> String [ ] urls = new String [ ] { "http:////www.eclipse.org" , "http:////www.google.com" , "http:////www.ibm.com" } ; <END_BUG> for ( int i = 0 ; i < ( urls . length ) ; i ++ ) { boolean result = Browser6 . test1 ( urls [ i ] ) ; System . out . print ( ( result ? "." : "E" ) ) ; if ( ! result ) fail ++ ; } String pluginPath = System . getProperty ( "PLUGIN_PATH" ) ; System . out . println ( ( ( "PLUGIN_PATH<seq2seq4repair_space><" + pluginPath ) + ">" ) ) ; String url ; if ( pluginPath == null ) url = Browser6 . class . getClassLoader ( ) . getResource ( "browser6.html" ) . toString ( ) ; else url = pluginPath + "//data//browser6.html" ; urls = new String [ ] { url } ; String [ ] titles = new String [ ] { "This<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>test<seq2seq4repair_space>title<seq2seq4repair_space>that<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>carefully<seq2seq4repair_space>checked<seq2seq4repair_space>when<seq2seq4repair_space>that<seq2seq4repair_space>page<seq2seq4repair_space>is<seq2seq4repair_space>loaded" } ; for ( int i = 0 ; i < ( urls . length ) ; i ++ ) { boolean result = Browser6 . test2 ( urls [ i ] , titles [ i ] ) ; System . out . print ( ( result ? "." : "E" ) ) ; if ( ! result ) fail ++ ; } return fail == 0 ; } public static void main ( String [ ] argv ) { } }

Fix:
String [ ] urls = new String [ ] { "http:////www.google.com" } ;
Buggy code:
public class Filter extends Task { private File filtersFile ; private String token ; private String value ; public void setFiltersfile ( File filtersFile ) { } public void setToken ( String token ) { } public void setValue ( String value ) { } public void execute ( ) throws BuildException { boolean isFiltersFromFile = ( ( ( filtersFile ) != null ) && ( ( token ) == null ) ) && ( ( value ) == null ) ; boolean isSingleFilter = ( ( ( filtersFile ) == null ) && ( ( token ) != null ) ) && ( ( value ) != null ) ; if ( ( ! isFiltersFromFile ) && ( ! isSingleFilter ) ) { <START_BUG> throw new BuildException ( "both<seq2seq4repair_space>token<seq2seq4repair_space>and<seq2seq4repair_space>value<seq2seq4repair_space>parameters,<seq2seq4repair_space>or<seq2seq4repair_space>only<seq2seq4repair_space>a<seq2seq4repair_space>filtersFile<seq2seq4repair_space>parameter<seq2seq4repair_space>is<seq2seq4repair_space>required" , location ) ; <END_BUG> } if ( isSingleFilter ) { project . getGlobalFilterSet ( ) . addFilter ( token , value ) ; } if ( isFiltersFromFile ) { readFilters ( ) ; } } protected void readFilters ( ) throws BuildException { } }

Fix:
throw new BuildException ( "both<seq2seq4repair_space>token<seq2seq4repair_space>and<seq2seq4repair_space>value<seq2seq4repair_space>parameters,<seq2seq4repair_space>or<seq2seq4repair_space>only<seq2seq4repair_space>a<seq2seq4repair_space>filtersFile<seq2seq4repair_space>parameter<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ;
Buggy code:
class AjASMAttribute extends Attribute { private boolean unpacked = false ; private byte [ ] data ; protected AjASMAttribute ( String type ) { } protected AjASMAttribute ( String type , byte [ ] data ) { } protected Attribute read ( ClassReader cr , int off , int len , char [ ] buf , int codeOff , Label [ ] labels ) { } protected ByteVector write ( ClassWriter cw , byte [ ] code , int len , int maxStack , int maxLocals ) { } public boolean isUnknown ( ) { } public AjAttribute unpack ( AsmDelegate relatedDelegate ) { if ( unpacked ) throw new BCException ( "Don't<seq2seq4repair_space>unpack<seq2seq4repair_space>an<seq2seq4repair_space>attribute<seq2seq4repair_space>twice!" ) ; <START_BUG> AjAttribute attr = AjAttribute . read ( relatedDelegate . weaverVersion , type , data , relatedDelegate . getSourceContext ( ) , relatedDelegate . getWorld ( ) . getMessageHandler ( ) ) ; <END_BUG> unpacked = true ; return attr ; } }

Fix:
AjAttribute attr = AjAttribute . read ( relatedDelegate . weaverVersion , type , data , relatedDelegate . getSourceContext ( ) , relatedDelegate . getWorld ( ) ) ;
Buggy code:
public class XSComplexTypeDecl implements XSComplexTypeDefinition , XSTypeDecl { public String fName = null ; public String fTargetNamespace = null ; public XSTypeDecl fBaseType = null ; public short fDerivedBy = XSConstants . DERIVATION_RESTRICTION ; public short fFinal = XSConstants . DERIVATION_NONE ; public short fBlock = XSConstants . DERIVATION_NONE ; public short fMiscFlags = 0 ; public XSAttributeGroupDecl fAttrGrp = new XSAttributeGroupDecl ( ) ; public short fContentType = CONTENTTYPE_EMPTY ; public XSSimpleType fXSSimpleType = null ; public XSParticleDecl fParticle = null ; public XSCMValidator fCMValidator = null ; public short getTypeCategory ( ) { } public String getTypeName ( ) { } public short getFinalSet ( ) { } public String getTargetNamespace ( ) { } private static final short CT_IS_ABSTRACT = 1 ; private static final short CT_HAS_TYPE_ID = 2 ; private static final short CT_IS_ANONYMOUS = 4 ; public boolean containsTypeID ( ) { } public void setIsAbstractType ( ) { } public void setContainsTypeID ( ) { } public void setIsAnonymous ( ) { } public synchronized XSCMValidator getContentModel ( CMBuilder cmBuilder ) { } public String toString ( ) { } void appendTypeInfo ( StringBuffer str ) { } public boolean derivedFrom ( XSTypeDefinition ancestor ) { } public boolean derivedFrom ( String ancestorNS , String ancestorName ) { } public void reset ( ) { } public short getType ( ) { } public String getName ( ) { <START_BUG> return fName ; <END_BUG> } public boolean getIsAnonymous ( ) { } public String getNamespace ( ) { } public XSTypeDefinition getBaseType ( ) { } public short getDerivationMethod ( ) { } public boolean getIsFinal ( short derivation ) { } public short getFinal ( ) { } public boolean getIsAbstract ( ) { } public XSObjectList getAttributeUses ( ) { } public XSWildcard getAttributeWildcard ( ) { } public short getContentType ( ) { } public XSSimpleTypeDefinition getSimpleType ( ) { } public XSParticle getParticle ( ) { } public boolean getIsProhibitedSubstitution ( short prohibited ) { } public short getProhibitedSubstitutions ( ) { } public XSObjectList getAnnotations ( ) { } }

Fix:
return getIsAnonymous ( ) ? null : fName ;
Buggy code:
public class SIRSampleForestConditionedTest extends XMLTestCase { @ Override public String getXMLFileName ( ) { } @ Override public long getSeed ( ) { } @ Override public Map < File , String > getOutputFileHashes ( ) { Map < File , String > map = new HashMap < > ( ) ; map . put ( new File ( "SIRSampleForestConditioned_output.json" ) , "28cbb6cf7c5e76e304f9d49ddeb2edf3" ) ; <START_BUG> map . put ( new File ( "SIRSampleForestConditioned_output.nexus" ) , "8ac5690dfbdf503cd16094739f728b9b" ) ; <END_BUG> return map ; } }

Fix:
map . put ( new File ( "SIRSampleForestConditioned_output.nexus" ) , "74a2591fe4fc418924dd8787152c35fd" ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class Controller extends HttpServlet { public void init ( ) throws ServletException { } public void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } public void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } private String performTheAction ( HttpServletRequest request ) { } private void sendToNextPage ( String nextPage , HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { if ( nextPage == null ) { response . sendError ( SC_NOT_FOUND , request . getServletPath ( ) ) ; return ; } if ( nextPage . endsWith ( ".do" ) ) { response . sendRedirect ( nextPage ) ; return ; } <START_BUG> if ( nextPage . endsWith ( ".jsp?" ) ) { <END_BUG> RequestDispatcher d = request . getRequestDispatcher ( ( "WEB-INF//" + nextPage ) ) ; d . forward ( request , response ) ; return ; } if ( nextPage . startsWith ( "http:////" ) ) { response . sendRedirect ( response . encodeRedirectURL ( nextPage ) ) ; return ; } response . sendRedirect ( response . encodeRedirectURL ( ( "http:////" + nextPage ) ) ) ; } private String getActionName ( String path ) { } }

Fix:
if ( nextPage . endsWith ( ".jsp" ) ) {
Buggy code:
@ SuppressWarnings ( "nls" ) @ TestingPolicy ( UrlWhitelistPolicy . class ) public class UrlWhitelistPolicyTest extends ApimanPolicyTest { private static final String API_BASE_URL = "//PolicyTester//TestApi//1" ; private static ObjectMapper jsonMapper ; @ BeforeClass public static void setUp ( ) { } private void requestExpectPolicyFailure ( PolicyTestRequestType method , String resource ) throws Throwable { final PolicyTestRequest request = PolicyTestRequest . build ( method , resource ) ; try { send ( request ) ; TestCase . fail ( ( ( PolicyFailureError . class ) + "<seq2seq4repair_space>expected" ) ) ; } catch ( PolicyFailureError policyFailureError ) { final PolicyFailure failure = policyFailureError . getFailure ( ) ; <START_BUG> assertEquals ( HttpURLConnection . HTTP_UNAUTHORIZED , failure . getFailureCode ( ) ) ; <END_BUG> assertEquals ( Authorization , failure . getType ( ) ) ; } } private void requestExpectPolicySuccess ( PolicyTestRequestType method , String resource ) throws Throwable { } @ Test @ Configuration ( classpathConfigFile = "basic-config.json" ) @ BackEndApi ( EchoBackEndApi . class ) public void testAllowedUrlAndMethod ( ) throws Throwable { } @ Test @ Configuration ( classpathConfigFile = "basic-config.json" ) @ BackEndApi ( EchoBackEndApi . class ) public void testUrlNormalisationAllowed ( ) throws Throwable { } @ Test @ Configuration ( classpathConfigFile = "basic-config.json" ) @ BackEndApi ( EchoBackEndApi . class ) public void testUrlNormalisationDenied ( ) throws Throwable { } @ Test @ Configuration ( classpathConfigFile = "basic-config.json" ) @ BackEndApi ( EchoBackEndApi . class ) public void testDeniedUrl ( ) throws Throwable { } @ Test @ Configuration ( classpathConfigFile = "basic-config.json" ) @ BackEndApi ( EchoBackEndApi . class ) public void testDeniedMethod ( ) throws Throwable { } @ Test @ Configuration ( classpathConfigFile = "basic-config.json" ) @ BackEndApi ( EchoBackEndApi . class ) public void testDefaultDenyMissingWhitelist ( ) throws Throwable { } @ Test @ Configuration ( classpathConfigFile = "basic-config.json" ) @ BackEndApi ( EchoBackEndApi . class ) public void testDefaultDenyPartiallyConfiguredWhitelist ( ) throws Throwable { } }

Fix:
assertEquals ( HttpURLConnection . HTTP_FORBIDDEN , failure . getFailureCode ( ) ) ;
Buggy code:
public class IssueTemplateInfo extends org . tigris . scarab . om . BaseIssueTemplateInfo implements Persistent { public static IssueTemplateInfo getInstance ( ) { } public void saveAndSendEmail ( ScarabUser user , Module module , TemplateContext context ) throws Exception { } public void approve ( ScarabUser user , boolean approved ) throws Exception { Module module = getIssue ( ) . getModule ( ) ; if ( user . hasPermission ( ITEM__APPROVE , module ) ) { setApproved ( true ) ; if ( approved ) { <START_BUG> setScopeId ( GLOBAL__PK ) ; <END_BUG> } save ( ) ; } else { throw new org . tigris . scarab . util . ScarabException ( ScarabConstants . NO_PERMISSION_MESSAGE ) ; } } }

Fix:
setScopeId ( MODULE__PK ) ;