nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Model implements Attachable { private static final int CALIBRATE = 0 ; private static final int EXTRACT = 1 ; private LinkedList < Updateable > updateables ; private ColorChecker colorChecker ; private SizeCalibrator sizeCalibrator ; private CalibrationDataHandler calibrationDataHandler ; private FeaturesExtract featuresExtract ; private List < MatchingColor > matchingColors ; public Model ( ) { } @ Override public void attach ( Updateable updateable ) { } @ Override public void detach ( Updateable updateable ) { } private void updateAll ( ) { } private void clearMemory ( int process ) { } public void startColorChecker ( String colorCheckerPath ) { } public void startSizeCalibrator ( String sizeCalibratorPath ) { } public void calibrate ( File conversionCsv , double gridSize ) throws IOException { } public boolean saveCalibrationData ( File file , int [ ] [ ] [ ] rgbs , double pixelsxCm ) { } public boolean loadCalibrationData ( File file ) { } public void startFeaturesExtract ( String path ) { } public boolean extractFeatures ( ) { } public void identifyMatchingColors ( String text ) { matchingColors = new ArrayList ( ) ; String [ ] lines = text . split ( "\n" ) ; double [ ] [ ] inverseMatrixM = getCameraCalibration ( ) . getInverseWorkingSpaceMatrix ( ) ; for ( String line : lines ) { <START_BUG> String [ ] numbers = line . split ( "," ) ; <END_BUG> try { double [ ] xyY = new double [ ] { Double . valueOf ( numbers [ 0 ] ) , Double . valueOf ( numbers [ 1 ] ) , 0.75 } ; matchingColors . add ( new MatchingColor ( xyY , Double . valueOf ( numbers [ 2 ] ) , inverseMatrixM ) ) ; } catch ( NumberFormatException nfe ) { } catch ( ArrayIndexOutOfBoundsException aiobe ) { } } updateAll ( ) ; } public boolean analizeImage ( ) { } public ColorChecker getColorChecker ( ) { } public SizeCalibrator getSizeCalibrator ( ) { } public CameraCalibration getCameraCalibration ( ) { } public FeaturesExtract getFeaturesExtract ( ) { } public List < MatchingColor > getMatchingColors ( ) { } }

Fix:
String [ ] numbers = line . split ( ";" ) ;
Buggy code:
public class JPAStoreResourceDefinition extends AbstractIdentityStoreResourceDefinition { public static final SimpleAttributeDefinition DATA_SOURCE = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( JPA_STORE_DATASOURCE . getName ( ) , org . jboss . dmr . ModelType . STRING , true ) . setAllowExpression ( true ) . setAlternatives ( JPA_STORE_ENTITY_MANAGER_FACTORY . getName ( ) , JPA_STORE_ENTITY_MODULE_UNIT_NAME . getName ( ) ) . build ( ) ; public static final SimpleAttributeDefinition ENTITY_MODULE = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( ModelElement . JPA_STORE_ENTITY_MODULE . getName ( ) , org . jboss . dmr . ModelType . STRING , true ) . setAllowExpression ( true ) . build ( ) ; public static final SimpleAttributeDefinition ENTITY_MODULE_UNIT_NAME = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( JPA_STORE_ENTITY_MODULE_UNIT_NAME . getName ( ) , org . jboss . dmr . ModelType . STRING , true ) . setDefaultValue ( new org . jboss . dmr . ModelNode ( "identity" ) ) . setAllowExpression ( true ) . setAlternatives ( JPA_STORE_ENTITY_MANAGER_FACTORY . getName ( ) , JPA_STORE_DATASOURCE . getName ( ) ) . setRequires ( JPA_STORE_ENTITY_MODULE_UNIT_NAME . getName ( ) ) . build ( ) ; public static final SimpleAttributeDefinition ENTITY_MANAGER_FACTORY = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( JPA_STORE_ENTITY_MANAGER_FACTORY . getName ( ) , org . jboss . dmr . ModelType . STRING , true ) . setAllowExpression ( true ) . setAlternatives ( JPA_STORE_DATASOURCE . getName ( ) , JPA_STORE_ENTITY_MODULE_UNIT_NAME . getName ( ) ) . build ( ) ; public static final JPAStoreResourceDefinition INSTANCE = new JPAStoreResourceDefinition ( JPAStoreResourceDefinition . DATA_SOURCE , JPAStoreResourceDefinition . ENTITY_MODULE , JPAStoreResourceDefinition . ENTITY_MODULE_UNIT_NAME , JPAStoreResourceDefinition . ENTITY_MANAGER_FACTORY , SUPPORT_CREDENTIAL , SUPPORT_ATTRIBUTE ) ; private JPAStoreResourceDefinition ( SimpleAttributeDefinition ... attributes ) { } @ Override public void registerChildren ( ManagementResourceRegistration resourceRegistration ) { } private static ModelValidationStepHandler [ ] getModelValidators ( SimpleAttributeDefinition [ ] attributes ) { <START_BUG> return new ModelValidationStepHandler [ ] { new NotEmptyResourceValidationStepHandler ( ) , new org . wildfly . extension . picketlink . common . model . validator . RequiredChildValidationStepHandler ( ModelElement . SUPPORTED_TYPES ) } ; <END_BUG> } }

Fix:
return new ModelValidationStepHandler [ ] { NotEmptyResourceValidationStepHandler . INSTANCE , new org . wildfly . extension . picketlink . common . model . validator . RequiredChildValidationStepHandler ( ModelElement . SUPPORTED_TYPES ) } ;
Buggy code:
public class CameraPlugin extends CordovaPlugin { private static final String VERIFY_AUTO_FOCUS = "verify.auto.focus" ; private static final String LOG_TAG = "CameraPlugin" ; private CallbackContext callbackContext ; public CameraPlugin ( ) { } @ Override public boolean execute ( String action , JSONArray args , CallbackContext callbackContext ) { } private void isAvailable ( ) { cordova . getThreadPool ( ) . execute ( new Runnable ( ) { @ Override public void run ( ) { org . apache . cordova . PluginResult result = new org . apache . cordova . PluginResult ( PluginResult . Status . OK , cordova . getActivity ( ) . getPackageManager ( ) . hasSystemFeature ( PackageManager . FEATURE_CAMERA_AUTOFOCUS ) ) ; <START_BUG> this . callbackContext . sendPluginResult ( result ) ; <END_BUG> } } ) ; } No newline ; at end ; of file ; }

Fix:
callbackContext . sendPluginResult ( result ) ;
Buggy code:
@ Entity @ Table ( name = "search" ) @ NamedQuery ( name = Search . Q_FIND_BY_TYPE , query = "SELECT<seq2seq4repair_space>s<seq2seq4repair_space>FROM<seq2seq4repair_space>Search<seq2seq4repair_space>s<seq2seq4repair_space>WHERE<seq2seq4repair_space>s.type<seq2seq4repair_space>=<seq2seq4repair_space>:type" ) public class Search { public static final String Q_FIND_BY_TYPE = "Search.findByType" ; public enum SearchType { ADVERSE_EVENTS , ROUTES , DRUGS ; } @ Id @ Column ( name = "ID" , length = 36 ) private String id ; @ Column ( name = "name" ) private String name ; @ Column ( name = "datetime" ) private Date datetime ; @ Column ( name = "type" , length = 10 , nullable = false ) @ Convert ( converter = SearchTypeConverter . class ) private Search . SearchType type ; @ Column ( name = "indication" ) private String indication ; @ Column ( name = "brandName" ) private String brandName ; @ Column ( name = "genericName" ) private String genericName ; @ Column ( name = "manufacturerName" ) private String manufacturerName ; @ Column ( name = "substanceName" ) private String substanceName ; @ Column ( name = "minAge" ) private int minAge ; @ Column ( name = "maxAge" ) private int maxAge ; @ Column ( name = "minWeight" ) private double minWeight ; @ Column ( name = "maxWeight" ) private double maxWeight ; @ Column ( name = "gender" ) private String gender ; @ Column ( name = "route" ) private String route ; public Search ( ) { } public String getId ( ) { } public String getName ( ) { } public void setName ( String name ) { } public Date getDatetime ( ) { <START_BUG> return datetime ; <END_BUG> } public Search . SearchType getType ( ) { } public void setType ( Search . SearchType type ) { } public String getIndication ( ) { } public void setIndication ( String indication ) { } public String getBrandName ( ) { } public void setBrandName ( String brandName ) { } public String getGenericName ( ) { } public void setGenericName ( String genericName ) { } public String getManufacturerName ( ) { } public void setManufacturerName ( String manufacturerName ) { } public String getSubstanceName ( ) { } public void setSubstanceName ( String substanceName ) { } public int getMinAge ( ) { } public void setMinAge ( int minAge ) { } public int getMaxAge ( ) { } public void setMaxAge ( int maxAge ) { } public double getMinWeight ( ) { } public void setMinWeight ( double minWeight ) { } public double getMaxWeight ( ) { } public void setMaxWeight ( double maxWeight ) { } public String getGender ( ) { } public void setGender ( String gender ) { } public String getRoute ( ) { } public void setRoute ( String route ) { } }

Fix:
return ( ( Date ) ( datetime . clone ( ) ) ) ;
Buggy code:
public class EchoPropertiesTest extends BuildFileTest { private static final String TASKDEFS_DIR = "src//etc//testcases//taskdefs//optional//" ; private static final String GOOD_OUTFILE = "test.properties" ; private static final String GOOD_OUTFILE_XML = "test.xml" ; private static final String PREFIX_OUTFILE = "test-prefix.properties" ; private static final String TEST_VALUE = "isSet" ; private static final String BAD_OUTFILE = "." ; public EchoPropertiesTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void testEchoToLog ( ) { } public void testReadBadFile ( ) { } public void testReadBadFileFail ( ) { } public void testReadBadFileNoFail ( ) { } public void testEchoToBadFile ( ) { } public void testEchoToBadFileFail ( ) { } public void testEchoToBadFileNoFail ( ) { } public void testEchoToGoodFile ( ) throws Exception { } public void testEchoToGoodFileXml ( ) throws Exception { executeTarget ( "testEchoToGoodFileXml" ) ; File f = createRelativeFile ( EchoPropertiesTest . GOOD_OUTFILE_XML ) ; FileReader fr = new FileReader ( f ) ; try { BufferedReader br = new BufferedReader ( fr ) ; String read = null ; while ( ( read = br . readLine ( ) ) != null ) { <START_BUG> if ( ( read . indexOf ( ( ( "<property<seq2seq4repair_space>name=\"test.property\"<seq2seq4repair_space>value=\"" + ( EchoPropertiesTest . TEST_VALUE ) ) + "\"><//property>" ) ) ) >= 0 ) { <END_BUG> return ; } } fail ( "did<seq2seq4repair_space>not<seq2seq4repair_space>encounter<seq2seq4repair_space>set<seq2seq4repair_space>property<seq2seq4repair_space>in<seq2seq4repair_space>generated<seq2seq4repair_space>file." ) ; } finally { try { fr . close ( ) ; } catch ( IOException e ) { } } } public void testEchoToGoodFileFail ( ) throws Exception { } public void testEchoToGoodFileNoFail ( ) throws Exception { } public void testEchoPrefix ( ) throws Exception { } public void testEchoPrefixAsPropertyset ( ) throws Exception { } public void testEchoPrefixAsNegatedPropertyset ( ) throws Exception { } public void testEchoPrefixAsDoublyNegatedPropertyset ( ) throws Exception { } private void testEchoPrefixVarious ( String target ) throws Exception { } protected Properties loadPropFile ( String relativeFilename ) throws IOException { } protected void assertGoodFile ( ) throws Exception { } protected String toAbsolute ( String filename ) { } protected File createRelativeFile ( String filename ) { } }

Fix:
if ( ( read . indexOf ( ( ( "<property<seq2seq4repair_space>name=\"test.property\"<seq2seq4repair_space>value=\"" + ( EchoPropertiesTest . TEST_VALUE ) ) + "\"<seq2seq4repair_space>//>" ) ) ) >= 0 ) {
Buggy code:
public class Angle { private double angle ; public Angle ( ) { } public Angle ( double angle ) { } public double getAngle ( ) { } public void setAngle ( double angle ) { } public void increment ( double step ) { angle += step ; if ( ( angle ) > 360 ) { angle = ( angle ) - 360 ; } if ( ( angle ) < 0 ) { <START_BUG> angle = 360 - ( angle ) ; <END_BUG> } } public double cos ( ) { } public double sin ( ) { } public double tan ( ) { } public double toRadians ( ) { } }

Fix:
angle = 360 + ( angle ) ;
Buggy code:
public class LinuxBrightnessManager extends BrightnessManager { @ Override public void setBrightness ( int brightness , int delay ) throws IOException , BrightnessSettingException { } private enum Card { intel , acpi ; } @ Override public String createExecCommand ( int brightness , int delay ) throws IOException { Process checkDir ; BufferedReader stdInput ; String cardString ; checkDir = Runtime . getRuntime ( ) . exec ( ( "if<seq2seq4repair_space>test<seq2seq4repair_space>-d<seq2seq4repair_space>//sys//class//backlight//intel_backlight;<seq2seq4repair_space>then<seq2seq4repair_space>echo<seq2seq4repair_space>\"intel\";" + "else<seq2seq4repair_space>if<seq2seq4repair_space>test<seq2seq4repair_space>-d<seq2seq4repair_space>//sys//class//backlight//acpi_video0;<seq2seq4repair_space>then<seq2seq4repair_space>echo<seq2seq4repair_space>\"acpi\"<seq2seq4repair_space>;fi<seq2seq4repair_space>" ) ) ; stdInput = new BufferedReader ( new InputStreamReader ( checkDir . getInputStream ( ) ) ) ; LinuxBrightnessManager . Card card = LinuxBrightnessManager . Card . valueOf ( stdInput . readLine ( ) ) ; switch ( card ) { case intel : cardString = "//sys//class//backlight//intel_backlight//" ; break ; case acpi : cardString = "//sys//class//backlight//acpi_video0//" ; break ; default : throw new IOException ( ) ; } Process process = Runtime . getRuntime ( ) . exec ( ( ( "cat<seq2seq4repair_space>" + cardString ) + "max_brightness" ) ) ; stdInput = new BufferedReader ( new InputStreamReader ( process . getInputStream ( ) ) ) ; String maxBrightness = stdInput . readLine ( ) ; <START_BUG> return new String ( ( ( "echo<seq2seq4repair_space>" + ( ( new Integer ( maxBrightness ) ) * ( brightness // 100 ) ) ) + "<seq2seq4repair_space>|<seq2seq4repair_space>sudo<seq2seq4repair_space>tee<seq2seq4repair_space>//sys//class//backlight//intel_backlight//brightness" ) ) ; <END_BUG> } }

Fix:
return new String ( ( ( ( ( "echo<seq2seq4repair_space>" + ( ( new Integer ( maxBrightness ) ) * ( brightness // 100 ) ) ) + "<seq2seq4repair_space>|<seq2seq4repair_space>sudo<seq2seq4repair_space>tee<seq2seq4repair_space>" ) + cardString ) + "brightness" ) ) ;
Buggy code:
public class FileUploadTest extends WicketTestCase { public FileUploadTest ( ) { } public void testGetInputStream ( ) throws Exception { FileItem fileItem = new DiskFileItemFactory ( ) . createItem ( "dummyFieldName" , "text//java" , false , "FileUploadTest.java" ) ; fileItem . getOutputStream ( ) ; <START_BUG> Field inputStreamsField = FileUpload . class . getDeclaredField ( "inputStreams" ) ; <END_BUG> inputStreamsField . setAccessible ( true ) ; FileUpload fileUpload = new FileUpload ( fileItem ) ; List inputStreams = ( ( List ) ( inputStreamsField . get ( fileUpload ) ) ) ; assertNull ( inputStreams ) ; InputStream is1 = fileUpload . getInputStream ( ) ; inputStreams = ( ( List ) ( inputStreamsField . get ( fileUpload ) ) ) ; assertEquals ( 1 , inputStreams . size ( ) ) ; InputStream is2 = fileUpload . getInputStream ( ) ; inputStreams = ( ( List ) ( inputStreamsField . get ( fileUpload ) ) ) ; assertEquals ( 2 , inputStreams . size ( ) ) ; assertNotSame ( is1 , is2 ) ; try { fileUpload . closeStreams ( ) ; } catch ( Exception e ) { fail ( ) ; } inputStreams = ( ( List ) ( inputStreamsField . get ( fileUpload ) ) ) ; assertNull ( inputStreams ) ; } }

Fix:
Field inputStreamsField = FileUpload . class . getDeclaredField ( "inputStreamsToClose" ) ;
Buggy code:
public class DeleteElementsOperation extends MultiOperation { protected Map childrenToRemove ; protected ASTParser parser ; public DeleteElementsOperation ( IJavaElement [ ] elementsToDelete , boolean force ) { } private void deleteElement ( IJavaElement elementToRemove , ICompilationUnit cu ) throws JavaModelException { } private void initASTParser ( ) { } protected String getMainTaskName ( ) { } protected ISchedulingRule getSchedulingRule ( ) { } protected void groupElements ( ) throws JavaModelException { } protected void processElement ( IJavaElement element ) throws JavaModelException { ICompilationUnit cu = ( ( ICompilationUnit ) ( element ) ) ; int numberOfImports = cu . getImports ( ) . length ; JavaElementDelta delta = new JavaElementDelta ( cu ) ; IJavaElement [ ] cuElements = ( ( IRegion ) ( childrenToRemove . get ( cu ) ) ) . getElements ( ) ; for ( int i = 0 , length = cuElements . length ; i < length ; i ++ ) { IJavaElement e = cuElements [ i ] ; if ( e . exists ( ) ) { deleteElement ( e , cu ) ; delta . removed ( e ) ; if ( ( e . getElementType ( ) ) == ( IJavaElement . IMPORT_DECLARATION ) ) { numberOfImports -- ; if ( numberOfImports == 0 ) { delta . removed ( cu . getImportContainer ( ) ) ; } } } } if ( ( delta . getAffectedChildren ( ) . length ) > 0 ) { cu . save ( getSubProgressMonitor ( 1 ) , force ) ; if ( ! ( cu . isWorkingCopy ( ) ) ) { addDelta ( delta ) ; <START_BUG> this . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ; <END_BUG> } } } protected void processElements ( ) throws JavaModelException { } protected void verify ( IJavaElement element ) throws JavaModelException { } }

Fix:
JavaModelOperation . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ;
Buggy code:
@ Retention ( RetentionPolicy . RUNTIME ) @ Target ( ElementType . METHOD ) public @ interface ajcDeclareSoft { <START_BUG> Class exceptionType ( ) ; <END_BUG> String pointcut ( ) ; }

Fix:
String exceptionType ( ) ;
Buggy code:
public class CommandlineJava implements Cloneable { private Commandline vmCommand = new Commandline ( ) ; private Commandline javaCommand = new Commandline ( ) ; private CommandlineJava . SysProperties sysProperties = new CommandlineJava . SysProperties ( ) ; private Path classpath = null ; private String vmVersion ; public static class SysProperties extends Environment implements Cloneable { Properties sys = null ; public String [ ] getVariables ( ) throws BuildException { } public int size ( ) { } public void setSystem ( ) throws BuildException { } public void restoreSystem ( ) throws BuildException { } public Object clone ( ) { } } public CommandlineJava ( ) { } public Argument createArgument ( ) { } public Argument createVmArgument ( ) { } public void addSysproperty ( Environment . Variable sysp ) { } public void setVm ( String vm ) { } public void setVmversion ( String value ) { } public void setClassname ( String classname ) { } public String getClassname ( ) { } public Path createClasspath ( Project p ) { } public String getVmversion ( ) { } public String [ ] getCommandline ( ) { int size = ( ( vmCommand . size ( ) ) + ( javaCommand . size ( ) ) ) + ( sysProperties . size ( ) ) ; if ( ( ( classpath ) != null ) && ( ( classpath . size ( ) ) > 0 ) ) { size += 2 ; } String [ ] result = new String [ size ] ; System . arraycopy ( vmCommand . getCommandline ( ) , 0 , result , 0 , vmCommand . size ( ) ) ; int pos = vmCommand . size ( ) ; if ( ( sysProperties . size ( ) ) > 0 ) { System . arraycopy ( sysProperties . getVariables ( ) , 0 , result , pos , sysProperties . size ( ) ) ; pos += sysProperties . size ( ) ; } if ( ( ( classpath ) != null ) && ( ( classpath . size ( ) ) > 0 ) ) { result [ ( pos ++ ) ] = "-classpath" ; <START_BUG> result [ ( pos ++ ) ] = classpath . concatSystemClasspath ( ) . toString ( ) ; <END_BUG> } System . arraycopy ( javaCommand . getCommandline ( ) , 0 , result , pos , javaCommand . size ( ) ) ; return result ; } public String toString ( ) { } public int size ( ) { } public Commandline getJavaCommand ( ) { } public Commandline getVmCommand ( ) { } public Path getClasspath ( ) { } public void setSystemProperties ( ) throws BuildException { } public void restoreSystemProperties ( ) throws BuildException { } public CommandlineJava . SysProperties getSystemProperties ( ) { } public Object clone ( ) { } public void clearJavaArgs ( ) { } }

Fix:
result [ ( pos ++ ) ] = classpath . concatSystemClasspath ( "ignore" ) . toString ( ) ;
Buggy code:
public class GraphModel implements Serializable , Clearable { private String name ; private List samples ; private List listeners ; private long previous = 0 ; private boolean bigChange = false ; private Sample current = new Sample ( 0 , 0 , 0 , 0 , 0 , false ) ; private long startTime = 0 ; private int throughputMax = 20 ; private long graphMax = 20 ; private StatCalculator statCalc = new StatCalculator ( ) ; public GraphModel ( ) { } public void setName ( String name ) { } public long getCurrentData ( ) { } public long getCurrentAverage ( ) { } public long getCurrentMedian ( ) { } public long getCurrentDeviation ( ) { } public float getCurrentThroughput ( ) { } public int getSampleCount ( ) { } public List getSamples ( ) { } public Class getGuiClass ( ) { } public String getName ( ) { } public long getMaxSample ( ) { } public long getGraphMax ( ) { } public int getThroughputMax ( ) { } public void addGraphListener ( GraphListener listener ) { } public Sample addSample ( SampleResult e ) { } public void clear ( ) { } protected void fireDataChanged ( ) { } protected void quickUpdate ( Sample s ) { } protected Sample addNewSample ( long sample , long timeStamp , boolean success ) { int counter = 0 ; float average ; long deviation ; long median ; synchronized ( statCalc ) { statCalc . addValue ( sample ) ; counter = statCalc . getCount ( ) ; average = ( ( float ) ( statCalc . getMean ( ) ) ) ; deviation = ( ( long ) ( statCalc . getStandardDeviation ( ) ) ) ; median = statCalc . getMedian ( ) . longValue ( ) ; } if ( ( samples . size ( ) ) == 0 ) { <START_BUG> startTime = timeStamp ; <END_BUG> } float throughput = 0 ; if ( ( timeStamp - ( startTime ) ) > 0 ) { throughput = ( ( float ) ( ( ( ( float ) ( ( samples . size ( ) ) + 1 ) ) // ( ( float ) ( timeStamp - ( startTime ) ) ) ) * 60000 ) ) ; } if ( throughput > ( throughputMax ) ) { bigChange = true ; throughputMax = ( ( int ) ( throughput * 1.5F ) ) ; } if ( average > ( graphMax ) ) { bigChange = true ; graphMax = ( ( long ) ( average ) ) * 3 ; } if ( deviation > ( graphMax ) ) { bigChange = true ; graphMax = deviation * 3 ; } Sample s = new Sample ( sample , ( ( long ) ( average ) ) , deviation , throughput , median , ( ! success ) ) ; previous = sample ; current = s ; samples . add ( s ) ; return s ; } }

Fix:
startTime = timeStamp - sample ;
Buggy code:
final class MuninnPagedFile implements PagedFile { private static int stripeFactor = Integer . getInteger ( "org.neo4j.io.pagecache.impl.muninn.MuninnPagedFile.stripeFactor" , 10 ) ; static final int translationTableStripeLevel = 1 << ( MuninnPagedFile . stripeFactor ) ; static final int translationTableStripeMask = ( MuninnPagedFile . translationTableStripeLevel ) - 1 ; private static final long referenceCounterOffset = UnsafeUtil . getFieldOffset ( MuninnPagedFile . class , "referenceCounter" ) ; private static final long lastPageIdOffset = UnsafeUtil . getFieldOffset ( MuninnPagedFile . class , "lastPageId" ) ; final MuninnPageCache pageCache ; final int pageSize ; final PageCacheMonitor monitor ; final PrimitiveLongObjectMap < MuninnPage > [ ] translationTables ; final StampedLock [ ] translationTableLocks ; final PageSwapper swapper ; private final MuninnCursorPool cursorPool ; private volatile int referenceCounter ; private volatile long lastPageId ; MuninnPagedFile ( File file , MuninnPageCache pageCache , int pageSize , PageSwapperFactory swapperFactory , MuninnCursorPool cursorPool , PageCacheMonitor monitor ) throws IOException { } @ Override public PageCursor io ( long pageId , int pf_flags ) { if ( ( getRefCount ( ) ) == 0 ) { <START_BUG> throw new IllegalStateException ( "Cannot<seq2seq4repair_space>do<seq2seq4repair_space>IO<seq2seq4repair_space>on<seq2seq4repair_space>an<seq2seq4repair_space>unmapped<seq2seq4repair_space>PagedFile." ) ; <END_BUG> } int lockMask = ( PF_EXCLUSIVE_LOCK ) | ( PF_SHARED_LOCK ) ; if ( ( pf_flags & lockMask ) == 0 ) { throw new IllegalArgumentException ( "Must<seq2seq4repair_space>specify<seq2seq4repair_space>either<seq2seq4repair_space>PF_EXCLUSIVE_LOCK<seq2seq4repair_space>or<seq2seq4repair_space>PF_SHARED_LOCK" ) ; } if ( ( pf_flags & lockMask ) == lockMask ) { throw new IllegalArgumentException ( "Cannot<seq2seq4repair_space>specify<seq2seq4repair_space>both<seq2seq4repair_space>PF_EXCLUSIVE_LOCK<seq2seq4repair_space>and<seq2seq4repair_space>PF_SHARED_LOCK" ) ; } MuninnPageCursor cursor ; if ( ( pf_flags & ( PF_SHARED_LOCK ) ) == 0 ) { cursor = cursorPool . takeWriteCursor ( ) ; } else { cursor = cursorPool . takeReadCursor ( ) ; } cursor . initialise ( this , pageId , pf_flags ) ; cursor . rewind ( ) ; return cursor ; } @ Override public int pageSize ( ) { } public void close ( ) throws IOException { } void closeSwapper ( ) throws IOException { } @ Override public void flush ( ) throws IOException { } @ Override public void force ( ) throws IOException { } @ Override public long getLastPageId ( ) { } private void initialiseLastPageId ( long lastPageIdFromFile ) { } long increaseLastPageIdTo ( long newLastPageId ) { } void incrementRefCount ( ) { } boolean decrementRefCount ( ) { } int getRefCount ( ) { } MuninnPage grabFreePage ( PageFaultEvent faultEvent ) throws IOException { } }

Fix:
throw new IllegalStateException ( "File<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>unmapped" ) ;
Buggy code:
public class JavaTest extends BuildFileTest { private static final int TIME_TO_WAIT = 1 ; private static final int SECURITY_MARGIN = 2000 ; private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private boolean runFatalTests = false ; public JavaTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void testNoJarNoClassname ( ) { } public void testJarNoFork ( ) { } public void testJarAndClassName ( ) { } public void testClassnameAndJar ( ) { } public void testRun ( ) { } public void testRunFail ( ) { } public void testRunFailFoe ( ) { } public void testRunFailFoeFork ( ) { } public void testExcepting ( ) { } public void testExceptingFork ( ) { } public void testExceptingFoe ( ) { } public void testExceptingFoeFork ( ) { } public void testResultPropertyZero ( ) { } public void testResultPropertyNonZero ( ) { } public void testResultPropertyZeroNoFork ( ) { } public void testResultPropertyNonZeroNoFork ( ) { } public void testRunFailWithFailOnError ( ) { } public void testRunSuccessWithFailOnError ( ) { } public void testSpawn ( ) { <START_BUG> File logFile = JavaTest . FILE_UTILS . createTempFile ( "spawn" , "log" , project . getBaseDir ( ) ) ; <END_BUG> assertTrue ( "log<seq2seq4repair_space>file<seq2seq4repair_space>not<seq2seq4repair_space>existing" , ( ! ( logFile . exists ( ) ) ) ) ; project . setProperty ( "logFile" , logFile . getAbsolutePath ( ) ) ; project . setProperty ( "timeToWait" , Long . toString ( JavaTest . TIME_TO_WAIT ) ) ; project . executeTarget ( "testSpawn" ) ; try { Thread . sleep ( ( ( ( JavaTest . TIME_TO_WAIT ) * 1000 ) + ( JavaTest . SECURITY_MARGIN ) ) ) ; } catch ( Exception ex ) { System . out . println ( "my<seq2seq4repair_space>sleep<seq2seq4repair_space>was<seq2seq4repair_space>interrupted" ) ; } if ( ! ( logFile . exists ( ) ) ) { System . out . println ( ( "suggestion:<seq2seq4repair_space>increase<seq2seq4repair_space>the<seq2seq4repair_space>constant" + "<seq2seq4repair_space>SECURITY_MARGIN<seq2seq4repair_space>to<seq2seq4repair_space>give<seq2seq4repair_space>more<seq2seq4repair_space>time<seq2seq4repair_space>for<seq2seq4repair_space>java<seq2seq4repair_space>to<seq2seq4repair_space>start." ) ) ; } assertTrue ( "log<seq2seq4repair_space>file<seq2seq4repair_space>exists" , logFile . exists ( ) ) ; } public void testRedirect1 ( ) { } public void testRedirect2 ( ) { } public void testRedirect3 ( ) { } public void testRedirector1 ( ) { } public void testRedirector2 ( ) { } public static class EntryPoint { public static void main ( String [ ] argv ) { } } public static class ExceptingEntryPoint { public static void main ( String [ ] argv ) { } } public static class SpawnEntryPoint { public static void main ( String [ ] argv ) { } } public static class PipeEntryPoint { public static void main ( String [ ] args ) { } } }

Fix:
File logFile = JavaTest . FILE_UTILS . createTempFileName ( "spawn" , "log" , project . getBaseDir ( ) , false ) ;
Buggy code:
public interface SSOManagerFactoryBuilder { <START_BUG> < I , D > ServiceBuilder < SSOManagerFactory < I , D > > build ( ServiceTarget target , ServiceName name , String host ) ; <END_BUG> }

Fix:
< A , D > ServiceBuilder < SSOManagerFactory < A , D > > build ( ServiceTarget target , ServiceName name , String host ) ;
Buggy code:
public class ArrayReference extends Reference { public Expression receiver ; public Expression position ; public TypeBinding arrayElementBinding ; public ArrayReference ( Expression rec , Expression pos ) { } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean compoundAssignment ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; receiver . generateCode ( currentScope , codeStream , true ) ; position . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAt ( arrayElementBinding . id ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( implicitConversion ) ; } else { if ( ( ( arrayElementBinding ) == ( LongBinding ) ) || ( ( arrayElementBinding ) == ( DoubleBinding ) ) ) { codeStream . pop2 ( ) ; } else { codeStream . pop ( ) ; } } <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public TypeBinding resolveType ( BlockScope scope ) { } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class ModifyColumnNode extends ColumnDefinitionNode { int columnPosition = - 1 ; UUID oldDefaultUUID ; UUID getOldDefaultUUID ( ) { } public int getColumnPosition ( ) { } public void checkUserType ( TableDescriptor td ) throws StandardException { } public void checkExistingConstraints ( TableDescriptor td ) throws StandardException { } public void useExistingCollation ( TableDescriptor td ) throws StandardException { } int getAction ( ) { } void bindAndValidateDefault ( DataDictionary dd , TableDescriptor td ) throws StandardException { ColumnDescriptor cd ; cd = td . getColumnDescriptor ( name ) ; if ( cd == null ) { throw StandardException . newException ( LANG_COLUMN_NOT_FOUND_IN_TABLE , name , td . getName ( ) ) ; } DefaultDescriptor defaultDescriptor = cd . getDefaultDescriptor ( dd ) ; oldDefaultUUID = ( defaultDescriptor == null ) ? null : defaultDescriptor . getUUID ( ) ; columnPosition = cd . getPosition ( ) ; if ( ( getNodeType ( ) ) != ( C_NodeTypes . MODIFY_COLUMN_DEFAULT_NODE ) ) { return ; } <START_BUG> if ( ( defaultNode ) == null ) { <END_BUG> defaultInfo = ( ( DefaultInfoImpl ) ( cd . getDefaultInfo ( ) ) ) ; } else { if ( cd . hasGenerationClause ( ) ) { throw StandardException . newException ( LANG_GEN_COL_DEFAULT , cd . getColumnName ( ) ) ; } } if ( ( autoinc_create_or_modify_Start_Increment ) == ( ColumnDefinitionNode . MODIFY_AUTOINCREMENT_RESTART_VALUE ) ) autoincrementIncrement = cd . getAutoincInc ( ) ; if ( ( autoinc_create_or_modify_Start_Increment ) == ( ColumnDefinitionNode . MODIFY_AUTOINCREMENT_INC_VALUE ) ) autoincrementStart = cd . getAutoincStart ( ) ; type = cd . getType ( ) ; validateDefault ( dd , td ) ; } private ColumnDescriptor getLocalColumnDescriptor ( String name , TableDescriptor td ) throws StandardException { } public void validateAutoincrement ( DataDictionary dd , TableDescriptor td , int tableType ) throws StandardException { } }

Fix:
if ( keepCurrentDefault ) {
Buggy code:
public class SpatialExample extends LuceneTestCase { public static void main ( String [ ] args ) throws Exception { } public void test ( ) throws Exception { } private SpatialContext ctx ; private SpatialStrategy strategy ; private Directory directory ; protected void init ( ) { } private void indexPoints ( ) throws Exception { IndexWriterConfig iwConfig = new IndexWriterConfig ( TEST_VERSION_CURRENT , null ) ; IndexWriter indexWriter = new IndexWriter ( directory , iwConfig ) ; indexWriter . addDocument ( newSampleDocument ( 2 , ctx . makePoint ( ( - 80.93 ) , 33.77 ) ) ) ; indexWriter . addDocument ( newSampleDocument ( 4 , ctx . readShapeFromWkt ( "POINT(60.9289094<seq2seq4repair_space>-50.7693246)" ) ) ) ; indexWriter . addDocument ( newSampleDocument ( 20 , ctx . makePoint ( 0.1 , 0.1 ) , ctx . makePoint ( 0 , 0 ) ) ) ; <START_BUG> indexWriter . close ( ) ; <END_BUG> } private Document newSampleDocument ( int id , Shape ... shapes ) { } private void search ( ) throws Exception { } private void assertDocMatchedIds ( IndexSearcher indexSearcher , TopDocs docs , int ... ids ) throws IOException { } }

Fix:
indexWriter . shutdown ( ) ;
Buggy code:
public class RowMutationVerbHandler implements IVerbHandler { private static Logger logger_ = LoggerFactory . getLogger ( RowMutationVerbHandler . class ) ; public void doVerb ( Message message ) { try { <START_BUG> RowMutation rm = RowMutation . fromBytes ( message . getMessageBody ( ) ) ; <END_BUG> if ( RowMutationVerbHandler . logger_ . isDebugEnabled ( ) ) RowMutationVerbHandler . logger_ . debug ( ( "Applying<seq2seq4repair_space>" + rm ) ) ; byte [ ] hintedBytes = message . getHeader ( HINT ) ; if ( hintedBytes != null ) { assert ( hintedBytes . length ) > 0 ; DataInputStream dis = new DataInputStream ( new ByteArrayInputStream ( hintedBytes ) ) ; while ( ( dis . available ( ) ) > 0 ) { ByteBuffer addressBytes = ByteBufferUtil . readWithShortLength ( dis ) ; if ( RowMutationVerbHandler . logger_ . isDebugEnabled ( ) ) RowMutationVerbHandler . logger_ . debug ( ( "Adding<seq2seq4repair_space>hint<seq2seq4repair_space>for<seq2seq4repair_space>" + ( InetAddress . getByName ( ByteBufferUtil . string ( addressBytes , Charsets . UTF_8 ) ) ) ) ) ; RowMutation hintedMutation = new RowMutation ( Table . SYSTEM_TABLE , addressBytes ) ; hintedMutation . addHints ( rm ) ; hintedMutation . apply ( ) ; } } byte [ ] forwardBytes = message . getHeader ( FORWARD_HEADER ) ; if ( forwardBytes != null ) forwardToLocalNodes ( message , forwardBytes ) ; Table . open ( rm . getTable ( ) ) . apply ( rm , true ) ; WriteResponse response = new WriteResponse ( rm . getTable ( ) , rm . key ( ) , true ) ; Message responseMessage = WriteResponse . makeWriteResponseMessage ( message , response ) ; if ( RowMutationVerbHandler . logger_ . isDebugEnabled ( ) ) RowMutationVerbHandler . logger_ . debug ( ( ( ( ( rm + "<seq2seq4repair_space>applied.<seq2seq4repair_space>Sending<seq2seq4repair_space>response<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( message . getMessageId ( ) ) ) + "@" ) + ( message . getFrom ( ) ) ) ) ; MessagingService . instance ( ) . sendOneWay ( responseMessage , message . getFrom ( ) ) ; } catch ( IOException e ) { RowMutationVerbHandler . logger_ . error ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>row<seq2seq4repair_space>mutation" , e ) ; } } private void forwardToLocalNodes ( Message message , byte [ ] forwardBytes ) throws UnknownHostException { } }

Fix:
RowMutation rm = RowMutation . fromBytes ( message . getMessageBody ( ) , message . getVersion ( ) ) ;
Buggy code:
public class AccessManagerHandler extends PipedHttpHandler { private final AccessManager accessManager ; public AccessManagerHandler ( AccessManager accessManager , PipedHttpHandler next ) { } @ Override public void handleRequest ( HttpServerExchange exchange , RequestContext context ) throws Exception { if ( accessManager . isAllowed ( exchange , context ) ) { if ( ( getNext ( ) ) != null ) { getNext ( ) . handleRequest ( exchange , context ) ; } } else { <START_BUG> ResponseHelper . endExchange ( exchange , SC_UNAUTHORIZED ) ; <END_BUG> } } }

Fix:
ResponseHelper . endExchange ( exchange , SC_FORBIDDEN ) ;
Buggy code:
public abstract class Record { protected Name name ; protected short type ; protected short dclass ; protected int ttl ; protected int wireLength = - 1 ; protected Record ( ) { } Record ( Name _name , short _type , short _dclass , int _ttl ) { } private static Class toClass ( short type ) throws ClassNotFoundException { } private static Record newRecord ( Name name , short type , short dclass , int ttl , int length , DataByteInputStream in , Compression c ) throws IOException { } public static Record newRecord ( Name name , short type , short dclass , int ttl , int length , byte [ ] data ) { } public static Record newRecord ( Name name , short type , short dclass , int ttl ) { } public static Record newRecord ( Name name , short type , short dclass ) { } static Record fromWire ( DataByteInputStream in , int section , Compression c ) throws IOException { } void toWire ( DataByteOutputStream out , int section , Compression c ) throws IOException { } public byte [ ] toWire ( int section ) throws IOException { } void toWireCanonical ( DataByteOutputStream out ) throws IOException { } <START_BUG> public byte [ ] toWireCanonical ( int section ) throws IOException { <END_BUG> DataByteOutputStream out = new DataByteOutputStream ( ) ; toWireCanonical ( out ) ; return out . toByteArray ( ) ; } StringBuffer toStringNoData ( ) { } public String toString ( ) { } public static Record fromString ( Name name , short type , short dclass , int ttl , MyStringTokenizer st , Name origin ) throws IOException { } public Name getName ( ) { } public short getType ( ) { } public short getRRsetType ( ) { } public short getDClass ( ) { } public int getTTL ( ) { } public short getWireLength ( ) { } abstract void rrToWire ( DataByteOutputStream out , Compression c ) throws IOException { } void rrToWireCanonical ( DataByteOutputStream out ) throws IOException { } public boolean equals ( Object arg ) { } public int hashCode ( ) { } }

Fix:
public byte [ ] toWireCanonical ( ) throws IOException {
Buggy code:
@ Path ( "config//v2" ) public class RestConfigurator { @ PUT @ Path ( "emailtask//{emailtaskID}//" ) @ Consumes ( MediaType . APPLICATION_JSON ) public Response updateEmailConfiguration ( @ PathParam ( "emailtaskID" ) <START_BUG> int emailTaskID , final EmailConfigJaxBean input ) { <END_BUG> DbEmailConfiguration dbEmailConfiguration = new DbEmailConfiguration ( ) ; int result = dbEmailConfiguration . setEmailConfiguration ( emailTaskID , input . receiver , input . subject , input . content ) ; return Response . status ( ( result > 0 ? Status . ACCEPTED : Status . NOT_ACCEPTABLE ) ) . build ( ) ; } }

Fix:
int emailTaskID , final RestInterface . EmailConfigJaxBean input ) {
Buggy code:
public class LineGraphTest extends JMeterTestCase { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public LineGraphTest ( String arg0 ) { } public void testGenerateBarChart ( ) { LineGraphTest . log . info ( ( "jtl<seq2seq4repair_space>version=" + ( JMeterUtils . getProperty ( "file_format.testlog" ) ) ) ) ; String sampleLog = "testfiles//sample_log1.jtl" ; String sampleLog2 = "testfiles//sample_log1b.jtl" ; String sampleLog3 = "testfiles//sample_log1c.jtl" ; JTLData input = new JTLData ( ) ; JTLData input2 = new JTLData ( ) ; JTLData input3 = new JTLData ( ) ; input . setDataSource ( sampleLog ) ; input . loadData ( ) ; input2 . setDataSource ( sampleLog2 ) ; input2 . loadData ( ) ; input3 . setDataSource ( sampleLog3 ) ; input3 . loadData ( ) ; assertTrue ( ( ( input . getStartTimestamp ( ) ) > 0 ) ) ; assertTrue ( ( ( input . getEndTimestamp ( ) ) > ( input . getStartTimestamp ( ) ) ) ) ; assertTrue ( ( ( input . getURLs ( ) . size ( ) ) > 0 ) ) ; LineGraphTest . log . info ( ( "URL<seq2seq4repair_space>count=" + ( input . getURLs ( ) . size ( ) ) ) ) ; ArrayList list = new ArrayList ( ) ; list . add ( input ) ; list . add ( input2 ) ; list . add ( input3 ) ; LineChart lgraph = new LineChart ( ) ; lgraph . setTitle ( "Sample<seq2seq4repair_space>Line<seq2seq4repair_space>Graph" ) ; lgraph . setCaption ( "Sample" ) ; lgraph . setName ( "Sample" ) ; lgraph . setYAxis ( "milliseconds" ) ; lgraph . setYLabel ( "Test<seq2seq4repair_space>Runs" ) ; lgraph . setXAxis ( REPORT_TABLE_MEAN ) ; lgraph . setXLabel ( "x<seq2seq4repair_space>label" ) ; lgraph . setURLs ( "jakarta_home,jmeter_home" ) ; JComponent gr = lgraph . renderChart ( list ) ; assertNotNull ( gr ) ; SaveGraphicsService serv = new SaveGraphicsService ( ) ; String filename = lgraph . getTitle ( ) ; filename = filename . replace ( '<seq2seq4repair_space>' , '_' ) ; <START_BUG> serv . saveJComponent ( filename , PNG , gr ) ; <END_BUG> } }

Fix:
serv . saveJComponent ( ( ".//testfiles//" + filename ) , PNG , gr ) ;
Buggy code:
public class EntityManagerFactoryImpl implements PersistenceUnitUtil , Closeable , OpenJPAEntityManagerFactory , OpenJPAEntityManagerFactorySPI { private static final Localizer _loc = Localizer . forPackage ( EntityManagerFactoryImpl . class ) ; private DelegatingBrokerFactory _factory = null ; private transient Constructor < FetchPlan > _plan = null ; private transient StoreCache _cache = null ; private transient QueryResultCache _queryCache = null ; private transient MetamodelImpl _metaModel ; public EntityManagerFactoryImpl ( ) { } public EntityManagerFactoryImpl ( BrokerFactory factory ) { } public BrokerFactory getBrokerFactory ( ) { } public void setBrokerFactory ( BrokerFactory factory ) { } public OpenJPAConfiguration getConfiguration ( ) { } public Map getProperties ( ) { } public Object putUserObject ( Object key , Object val ) { } public Object getUserObject ( Object key ) { } public StoreCache getStoreCache ( ) { } public StoreCache getStoreCache ( String cacheName ) { } public QueryResultCache getQueryResultCache ( ) { } public OpenJPAEntityManagerSPI createEntityManager ( ) { } public OpenJPAEntityManagerSPI createEntityManager ( Map props ) { } protected EntityManagerImpl newEntityManagerImpl ( Broker broker ) { } public void addLifecycleListener ( Object listener , Class ... classes ) { } public void removeLifecycleListener ( Object listener ) { } public void addTransactionListener ( Object listener ) { } public void removeTransactionListener ( Object listener ) { } public void close ( ) { } public boolean isOpen ( ) { } public int hashCode ( ) { } public boolean equals ( Object other ) { } FetchPlan toFetchPlan ( Broker broker , FetchConfiguration fetch ) { } public Cache getCache ( ) { } <START_BUG> public QueryBuilder getQueryBuilder ( ) { <END_BUG> return new CriteriaBuilder ( ) . setMetaModel ( getMetamodel ( ) ) ; } public OpenJPAQueryBuilder getDynamicQueryBuilder ( ) { } public Set < String > getSupportedProperties ( ) { } public MetamodelImpl getMetamodel ( ) { } public PersistenceUnitUtil getPersistenceUnitUtil ( ) { } public Object getIdentifier ( Object entity ) { } public boolean isLoaded ( Object entity ) { } public boolean isLoaded ( Object entity , String attribute ) { } }

Fix:
public CriteriaBuilder getQueryBuilder ( ) {
Buggy code:
@ Path ( "//person" ) public class PersonCollectionResource { @ Context UriInfo uriInfo ; @ Context Request request ; @ GET @ Produces ( MediaType . APPLICATION_JSON ) public List < Person > getPersonsBrowser ( @ QueryParam ( "measureType" ) String measure , @ QueryParam ( "min" ) int min , @ QueryParam ( "max" ) int max ) { } @ GET @ Path ( "count" ) @ Produces ( MediaType . TEXT_PLAIN ) public int getCount ( ) { } @ POST @ Produces ( MediaType . APPLICATION_JSON ) @ Consumes ( MediaType . APPLICATION_JSON ) public Person newPerson ( @ QueryParam ( "token" ) String token , Person person ) throws Exception { } @ Path ( "{personId}" ) public PersonResource getPerson ( @ PathParam ( "personId" ) int id ) { } @ GET @ Path ( "{personId}//{measure}" ) @ Produces ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) public List < Measure > getMeasureByPerson ( @ PathParam ( "personId" ) int id , @ PathParam ( "measure" ) String measure , @ QueryParam ( "before" ) String before , @ QueryParam ( "after" ) String after ) { } @ GET @ Path ( "{personId}//{measure}//{mid}" ) @ Produces ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) public Measure getMeasureByPersonAndID ( @ PathParam ( "personId" ) int id , @ PathParam ( "measure" ) String measure , @ PathParam ( "mid" ) int mid ) { } @ POST @ Path ( "{personId}//{measure}" ) @ Produces ( { "application//javascript" } ) @ Consumes ( MediaType . APPLICATION_JSON ) public String insertMeasureByPerson ( @ PathParam ( "personId" ) long id , @ PathParam ( "measure" ) String measure , @ QueryParam ( "token" ) String token , @ QueryParam ( "callback" ) String callback , Measure newMeasure ) throws Exception { } @ PUT @ Path ( "{personId}//{measure}//{mid}" ) @ Produces ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) @ Consumes ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) public Measure updateMeasureByID ( @ PathParam ( "personId" ) int id , @ PathParam ( "measure" ) String measure , @ PathParam ( "mid" ) int mid , Measure measureHistory ) { } @ POST @ Path ( "//facebook" ) @ Produces ( MediaType . APPLICATION_JSON ) @ Consumes ( MediaType . APPLICATION_JSON ) public Measure insertMeasureFB ( @ QueryParam ( "token" ) String token , Measure newMeasure ) throws Exception { System . out . println ( "This<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>post<seq2seq4repair_space>working" ) ; FacebookService fs = new FacebookService ( ) ; FacebookInfo fi = fs . getInfoByToken ( token ) ; Person p = Person . getPersonFromFB ( fi . getId ( ) ) ; <START_BUG> if ( p == null ) { <END_BUG> p = new Person ( ) ; p . setFirstname ( fi . getFirst_name ( ) ) ; p . setId ( ( ( long ) ( fi . getId ( ) ) ) ) ; p = Person . savePerson ( p ) ; } else throw new NotFoundException ( "This<seq2seq4repair_space>person<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ) ; newMeasure . setPerson ( p ) ; newMeasure . setTodayDate ( ) ; return Measure . saveMeasure ( newMeasure ) ; } }

Fix:
if ( p != null ) {
Buggy code:
public interface IAsynchConnectionEventHandler extends IConnectionEventHandler { <START_BUG> public void handleAsynchEvent ( ConnectionEvent event ) throws IOException ; <END_BUG> }

Fix:
public void handleAsynchEvent ( AsynchConnectionEvent event ) throws IOException ;
Buggy code:
public class Form { static final Logger log = LoggerFactory . getLogger ( Form . class ) ; public Form ( ) { } private void initFields ( ) { } public void assignFieldValues ( RequestContext context ) { } public String render ( String type ) { } public String renderErrors ( ) { } public String renderField ( String fieldName , Map < String , Object > attributes ) { } public String renderLabel ( String fieldName , Map < String , Object > attributes ) { } public String renderLabel ( FormField field , Map < String , Object > attributes ) { if ( field == null ) throw new SnapException ( "Rendering<seq2seq4repair_space>of<seq2seq4repair_space>label<seq2seq4repair_space>for<seq2seq4repair_space>non-existing<seq2seq4repair_space>field" ) ; String htmlId = field . getHtmlId ( ) ; String label = field . getLabel ( ) ; if ( label == null ) return "" ; Map < String , String > attribs = new HashMap < > ( ) ; attributes . entrySet ( ) . stream ( ) . forEach ( ( e ) -> attribs . put ( e . getKey ( ) , e . getValue ( ) . toString ( ) ) ) ; <START_BUG> return String . format ( "<label<seq2seq4repair_space>for=\'%1$s\'<seq2seq4repair_space>%3%s>%2$s<//label>\n" , htmlId , label , Helpers . attrToString ( attribs ) ) ; <END_BUG> } public String renderFieldError ( String fieldName , Map < String , Object > attributes ) { } public FormField getField ( String fieldName ) { } public boolean isValid ( ) { } public boolean hasErrors ( ) { } public boolean hasError ( String fieldName ) { } public String getFormError ( ) { } public void setFormError ( String formError ) { } public void setFieldError ( String fieldName , String errorText ) { } public void clearFieldError ( String fieldName ) { } public void clearAllErrors ( ) { } private List < FormField > mFieldList ; private Map < String , FormField > mFieldMap ; private String mFormError = null ; private String mFormName ; }

Fix:
return String . format ( "<label<seq2seq4repair_space>for=\'%1$s\'<seq2seq4repair_space>%3$s>%2$s<//label>\n" , htmlId , label , Helpers . attrToString ( attribs ) ) ;