nus-yam/ex-repair huggingface dataset:
Buggy code:
public class BasicThreadFactoryTest { private static final String PATTERN = "testThread-%d" ; private BasicThreadFactory . Builder builder ; @ Before public void setUp ( ) throws Exception { } private void checkFactoryDefaults ( BasicThreadFactory factory ) { } @ Test public void testBuildDefaults ( ) { } @ Test ( expected = NullPointerException . class ) public void testBuildNamingPatternNull ( ) { } @ Test ( expected = NullPointerException . class ) public void testBuildWrappedFactoryNull ( ) { } @ Test ( expected = NullPointerException . class ) public void testBuildUncaughtExceptionHandlerNull ( ) { } @ Test public void testBuilderReset ( ) { } @ Test public void testBuilderResetAfterBuild ( ) { } @ Test public void testNewThreadNamingPattern ( ) { } @ Test public void testNewThreadNoNamingPattern ( ) { } private void checkDaemonFlag ( boolean flag ) { ThreadFactory wrapped = EasyMock . createMock ( ThreadFactory . class ) ; Runnable r = EasyMock . createMock ( Runnable . class ) ; Thread t = new Thread ( ) ; EasyMock . expect ( wrapped . newThread ( r ) ) . andReturn ( t ) ; EasyMock . replay ( wrapped , r ) ; BasicThreadFactory factory = builder . wrappedFactory ( wrapped ) . daemon ( flag ) . build ( ) ; assertSame ( "Wrong<seq2seq4repair_space>thread" , t , factory . newThread ( r ) ) ; <START_BUG> assertEquals ( "Wrong<seq2seq4repair_space>daemon<seq2seq4repair_space>flag" , flag , t . isDaemon ( ) ) ; <END_BUG> EasyMock . verify ( wrapped , r ) ; } @ Test public void testNewThreadDaemonTrue ( ) { } @ Test public void testNewThreadDaemonFalse ( ) { } @ Test public void testNewThreadNoDaemonFlag ( ) { } @ Test public void testNewThreadPriority ( ) { } @ Test public void testNewThreadNoPriority ( ) { } @ Test public void testNewThreadExHandler ( ) { } @ Test public void testNewThreadNoExHandler ( ) { } }

Fix:
assertTrue ( "Wrong<seq2seq4repair_space>daemon<seq2seq4repair_space>flag" , ( flag == ( t . isDaemon ( ) ) ) ) ;
Buggy code:
public class TestPredicatedSortedBag < T > extends AbstractTestSortedBag < T > { private SortedBag < T > nullBag = null ; public TestPredicatedSortedBag ( String testName ) { } protected Predicate < T > stringPredicate ( ) { } protected Predicate < T > truePredicate = org . apache . commons . collections . functors . TruePredicate . < T > truePredicate ( ) ; protected SortedBag < T > decorateBag ( SortedBag < T > bag , Predicate < T > predicate ) { <START_BUG> return PredicatedSortedBag . decorate ( bag , predicate ) ; <END_BUG> } @ Override public SortedBag < T > makeObject ( ) { } protected SortedBag < T > makeTestBag ( ) { } public void testDecorate ( ) { } @ SuppressWarnings ( "unchecked" ) public void testSortOrder ( ) { } @ Override public String getCompatibilityVersion ( ) { } }

Fix:
return PredicatedSortedBag . predicatedSortedBag ( bag , predicate ) ;
Buggy code:
public class BgNoShrinkingTestActivity extends MblBaseActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_bg_no_shrinking_test ) ; <START_BUG> MblViewUtil . setBackgroundNoShrinking ( getDecorView ( ) , background ) ; <END_BUG> } }

Fix:
MblViewUtil . setBackgroundNoShrinking ( getDecorView ( ) , portrait_bg , landscape_bg ) ;
Buggy code:
class PatchableTargetsArtifact extends AbstractArtifact < PatchingXmlArtifact . XmlArtifactState < Patch > , PatchableTargetsArtifact . PatchableTargetState > { PatchableTargetsArtifact ( PatchingArtifact < PatchableTargetsArtifact . PatchableTargetState , ? extends ArtifactState > ... artifacts ) { } @ Override public boolean process ( PatchingXmlArtifact . XmlArtifactState < Patch > parent , PatchingArtifactProcessor processor ) { <START_BUG> final InstalledIdentity identity = processor . getValidationContext ( ) . getCurrentPatchIdentity ( ) ; <END_BUG> final Patch patch = parent . getPatch ( ) ; if ( BASE . equals ( patch . getPatchId ( ) ) ) { return true ; } final List < PatchElement > elements = patch . getElements ( ) ; boolean valid = true ; if ( ( elements != null ) && ( ! ( elements . isEmpty ( ) ) ) ) { for ( final PatchElement element : elements ) { final String patchID = element . getId ( ) ; final PatchElementProvider provider = element . getProvider ( ) ; final String layerName = provider . getName ( ) ; final PatchableTarget target = ( provider . isAddOn ( ) ) ? identity . getAddOn ( layerName ) : identity . getLayer ( layerName ) ; boolean modules = false ; boolean bundles = false ; for ( final ContentModification modification : element . getModifications ( ) ) { if ( modules && bundles ) { break ; } if ( ( modification . getItem ( ) . getContentType ( ) ) == ( ContentType . BUNDLE ) ) { bundles = true ; } else if ( ( modification . getItem ( ) . getContentType ( ) ) == ( ContentType . MODULE ) ) { modules = true ; } } final PatchableTargetsArtifact . PatchableTargetState state = new PatchableTargetsArtifact . PatchableTargetState ( patchID , layerName , target , bundles , modules ) ; if ( ! ( processor . process ( LAYER , state ) ) ) { valid = false ; } } } for ( final ContentModification modification : patch . getModifications ( ) ) { if ( ( ( modification . getType ( ) ) != ( ModificationType . ADD ) ) && ( ( modification . getItem ( ) . getContentType ( ) ) == ( ContentType . MISC ) ) ) { final PatchingHistoryDirArtifact . DirectoryArtifactState history = processor . getParentArtifact ( HISTORY_DIR ) ; MISC_BACKUP . process ( history , processor ) ; break ; } } return valid ; } static class PatchableTargetState implements PatchingArtifact . ArtifactState { private final String patchID ; private final String layerName ; private final PatchableTarget target ; private final boolean checkBundles ; private final boolean checkModules ; PatchableTargetState ( String patchID , String layerName , PatchableTarget target , boolean checkBundles , boolean checkModules ) { } public String getPatchID ( ) { } public DirectoryStructure getStructure ( ) { } public boolean isCheckBundles ( ) { } public boolean isCheckModules ( ) { } @ Override public boolean isValid ( PatchingArtifactValidationContext context ) { } @ Override public String toString ( ) { } } }

Fix:
final InstalledIdentity identity = processor . getValidationContext ( ) . getInstalledIdentity ( ) ;
Buggy code:
class RemoveFolderFromIndex implements IJob { String folderPath ; IPath indexedContainer ; IndexManager manager ; public RemoveFolderFromIndex ( String folderPath , IPath indexedContainer , IndexManager manager ) { } public boolean belongsTo ( String jobFamily ) { } public boolean execute ( IProgressMonitor progressMonitor ) { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) return IJob . COMPLETE ; try { <START_BUG> IIndex index = manager . getIndex ( this . indexedContainer ) ; <END_BUG> if ( index == null ) return IJob . COMPLETE ; ReadWriteMonitor monitor = manager . getMonitorFor ( index ) ; if ( monitor == null ) return IJob . COMPLETE ; try { monitor . enterRead ( ) ; IQueryResult [ ] results = index . queryInDocumentNames ( this . folderPath ) ; for ( int i = 0 , max = ( results == null ) ? 0 : results . length ; i < max ; i ++ ) { String fileName = results [ i ] . getPath ( ) ; manager . remove ( fileName , this . indexedContainer ) ; } } finally { monitor . exitRead ( ) ; } } catch ( IOException e ) { if ( JobManager . VERBOSE ) { JobManager . verbose ( ( ( "-><seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>remove<seq2seq4repair_space>" + ( this . folderPath ) ) + "<seq2seq4repair_space>from<seq2seq4repair_space>index<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>exception:" ) ) ; e . printStackTrace ( ) ; } return IJob . FAILED ; } return IJob . COMPLETE ; } public String toString ( ) { } public void cancel ( ) { } }

Fix:
IIndex index = manager . getIndex ( this . indexedContainer , true , true ) ;
Buggy code:
public final class LinkReading implements Serializable { private static final long serialVersionUID = - 4818293656594892843L ; private static final String DELIMITER = "@" ; private String testbedId ; private String linkSource ; private String linkTarget ; private String capabilityName ; private String timestamp ; private String reading ; public LinkReading ( ) { } public String getTestbedId ( ) { } public void setTestbedId ( final String testbedId ) { } public String getLinkSource ( ) { } public void setLinkSource ( final String linkSource ) { } public String getLinkTarget ( ) { } public void setLinkTarget ( final String linkTarget ) { } public String getCapabilityName ( ) { } public void setCapabilityName ( final String capabilityName ) { } public String getReading ( ) { } public void setReading ( final String reading ) { } public String getTimestamp ( ) { } public void setTimestamp ( final String timestamp ) { } public String toRestString ( ) { <START_BUG> return ( ( ( ( ( ( ( ( ( ( "//testbed//" + ( testbedId ) ) + "//link//" ) + ( linkSource ) ) + "//" ) + ( linkTarget ) ) + "//capability//" ) + ( capabilityName ) ) + "//insert//timestamp//" ) + ( timestamp ) ) + "//reading//" ) + ( reading ) ; <END_BUG> } public String toDelimitedString ( ) { } @ Override public String toString ( ) { } }

Fix:
return ( ( ( ( ( ( ( ( ( ( ( "//testbed//" + ( testbedId ) ) + "//link//" ) + ( linkSource ) ) + "//" ) + ( linkTarget ) ) + "//capability//" ) + ( capabilityName ) ) + "//insert//timestamp//" ) + ( timestamp ) ) + "//reading//" ) + ( reading ) ) + "//" ;
Buggy code:
public class RemoveSubColumnTest extends CleanupHelper { @ Test public void testRemoveSubColumn ( ) throws IOException , InterruptedException , ExecutionException { Table table = Table . open ( "Keyspace1" ) ; ColumnFamilyStore store = table . getColumnFamilyStore ( "Super1" ) ; RowMutation rm ; DecoratedKey dk = Util . dk ( "key1" ) ; rm = new RowMutation ( "Keyspace1" , dk . key ) ; Util . addMutation ( rm , "Super1" , "SC1" , 1 , "asdf" , new TimestampClock ( 0 ) ) ; rm . apply ( ) ; store . forceBlockingFlush ( ) ; rm = new RowMutation ( "Keyspace1" , dk . key ) ; rm . delete ( new QueryPath ( "Super1" , "SC1" . getBytes ( ) , Util . getBytes ( 1 ) ) , new TimestampClock ( 1 ) ) ; rm . apply ( ) ; ColumnFamily retrieved = store . getColumnFamily ( QueryFilter . getIdentityFilter ( dk , new QueryPath ( "Super1" , "SC1" . getBytes ( ) ) ) ) ; assert retrieved . getColumn ( "SC1" . getBytes ( ) ) . getSubColumn ( Util . getBytes ( 1 ) ) . isMarkedForDelete ( ) ; <START_BUG> Assert . assertNull ( ColumnFamilyStore . removeDeleted ( retrieved , Integer . MAX_VALUE ) ) ; <END_BUG> } }

Fix:
Assert . assertNull ( Util . cloneAndRemoveDeleted ( retrieved , Integer . MAX_VALUE ) ) ;
Buggy code:
public class PlothooksSiteBuilder implements ISiteBuilder { private static final String OLD_URL = "https:////www.reddit.com//r//DnDBehindTheScreen//comments//3fe4x1//lets_make_10000_plot_hooks//" ; private static final String NEW_URL = "https:////www.reddit.com//r//DnDBehindTheScreen//comments//4hhfzr//10k_plot_hooks_resurrections_and_chosen_ones//" ; @ Override public void buildSite ( ) { StrongParagraphScrubber oldDataScrubber = new StrongParagraphScrubber ( PlothooksSiteBuilder . OLD_URL ) ; List < ScrubbedDataObject > data = oldDataScrubber . scrubData ( ) ; System . out . println ( ( "Old<seq2seq4repair_space>scrubbed<seq2seq4repair_space>plothooks:<seq2seq4repair_space>" + ( data . size ( ) ) ) ) ; StrongParagraphScrubber newScrubber = new StrongParagraphScrubber ( PlothooksSiteBuilder . NEW_URL ) ; List < ScrubbedDataObject > newData = newScrubber . scrubData ( ) ; System . out . println ( ( "New<seq2seq4repair_space>plot<seq2seq4repair_space>hooks:<seq2seq4repair_space>" + ( newData . size ( ) ) ) ) ; String fileNameAndLocation = "src//main//resources//plothooks" ; List < ScrubbedDataObject > allData = new java . util . ArrayList ( data ) ; allData . addAll ( newData ) ; oldDataScrubber . writeDataToFiles ( fileNameAndLocation , allData ) ; String tableHeaderHTML = "<tr><th<seq2seq4repair_space>align=\"center\">Plot<seq2seq4repair_space>Hook<seq2seq4repair_space>Name<//th><th<seq2seq4repair_space>align=\"center\">Description<//th><//tr>" ; <START_BUG> BaseSiteBuilderHelper baseSiteBuilderHelper = new BaseSiteBuilderHelper ( ( fileNameAndLocation + "//" ) , "Plot<seq2seq4repair_space>Hooks" , PlothooksSiteBuilder . NEW_URL , tableHeaderHTML , data ) ; <END_BUG> baseSiteBuilderHelper . buildHTML ( ) ; } public static void main ( String [ ] args ) { } }

Fix:
BaseSiteBuilderHelper baseSiteBuilderHelper = new BaseSiteBuilderHelper ( ( fileNameAndLocation + "//" ) , "Plot<seq2seq4repair_space>Hooks" , PlothooksSiteBuilder . NEW_URL , tableHeaderHTML , allData ) ;
Buggy code:
public final class WSIntegrationProcessorJAXRPC_POJO implements DeploymentUnitProcessor { @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( final DeploymentUnit context ) { } private static boolean isJaxwsPojoDeployment ( final DeploymentUnit unit ) { } private static void createJaxrpcDeployment ( final DeploymentUnit unit , final WebservicesMetaData webservicesMD , final JBossWebMetaData jbossWebMD ) { } private static POJOEndpoint newPojoEndpoint ( final PortComponentMetaData portComponentMD , final JBossWebMetaData jbossWebMD ) { final String endpointName = portComponentMD . getServletLink ( ) ; final ServletMetaData servletMD = getServletForName ( jbossWebMD , endpointName ) ; final String endpointClassName = getEndpointClassName ( servletMD ) ; final String urlPattern = WSIntegrationProcessorJAXRPC_POJO . getUrlPattern ( endpointName , jbossWebMD ) ; <START_BUG> return new POJOEndpoint ( endpointName , endpointClassName , urlPattern ) ; <END_BUG> } private static String getUrlPattern ( final String servletName , final JBossWebMetaData jbossWebMD ) { } private boolean hasJaxRpcMapping ( WebservicesMetaData webservicesMD ) { } }

Fix:
return new POJOEndpoint ( endpointName , endpointClassName , null , urlPattern ) ;
Buggy code:
public class FileSystemMonitorTestCase extends TestCase { protected FilesystemObserver observer ; protected CollectionFilesystemListener listener = new CollectionFilesystemListener ( false ) ; protected File testDir ; public FileSystemMonitorTestCase ( String name ) { } @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } public void testMonitor ( ) { } private void checkFile ( String label , File file , long interval , Collection < File > files ) throws Exception { } private void checkCollectionsEmpty ( String label ) { } private void checkDirectoryCounts ( String label , int dirCreate , int dirChange , int dirDelete ) { } private void checkFileCounts ( String label , int fileCreate , int fileChange , int fileDelete ) { } private File touch ( File file ) { long lastModified = ( file . exists ( ) ) ? file . lastModified ( ) : 0 ; try { FileUtils . touch ( file ) ; file = new File ( file . getParent ( ) , file . getName ( ) ) ; while ( lastModified == ( file . lastModified ( ) ) ) { try { <START_BUG> Thread . sleep ( 50 ) ; <END_BUG> } catch ( InterruptedException ie ) { } FileUtils . touch ( file ) ; file = new File ( file . getParent ( ) , file . getName ( ) ) ; } } catch ( Exception e ) { fail ( ( ( ( "Touching<seq2seq4repair_space>" + file ) + ":<seq2seq4repair_space>" ) + e ) ) ; } return file ; } }

Fix:
Thread . sleep ( 200 ) ;
Buggy code:
public class UrlSelectionAction extends JosmAction { public UrlSelectionAction ( ) { } public void actionPerformed ( ActionEvent e ) { <START_BUG> UrlSelectionDialog dialog = new UrlSelectionDialog ( this ) ; <END_BUG> dialog . setVisible ( true ) ; } }

Fix:
UrlSelectionDialog dialog = UrlSelectionDialog . getInstance ( ) ;
Buggy code:
public class CacheAbleRequestDemoFragment extends TitleBaseFragment { private TextView mTextView ; private ScrollView mScrollView ; @ Override protected View createView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { setHeaderTitle ( cube_demo_request_cache_able_request ) ; View view = inflater . inflate ( fragment_request_cache , null ) ; mTextView = ( ( TextView ) ( view . findViewById ( request_cache_demo_text_view ) ) ) ; mScrollView = ( ( ScrollView ) ( view . findViewById ( request_cache_demo_scroll_view ) ) ) ; EventBus . bindContainerAndHandler ( this , new SimpleEventHandler ( ) { @ Subscribe public void onCacheAbleRequestMsgDataEvent ( final CacheAbleRequestData . MsgDataEvent dataEvent ) { mTextView . post ( new Runnable ( ) { @ Override public void run ( ) { appendMsg ( dataEvent . msg ) ; } } ) ; } } ) . tryToRegisterIfNot ( ) ; <START_BUG> TextView textView = ( ( TextView ) ( view . findViewById ( form_base_button ) ) ) ; <END_BUG> textView . setText ( cube_demo_cache_manager_clear_cache ) ; textView . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { CacheAbleRequestData . getImage ( true , false ) ; } } ) ; view . findViewById ( request_cache_demo_btn_with_cache ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { CacheAbleRequestData . getImage ( false , false ) ; } } ) ; view . findViewById ( request_cache_demo_btn_no_cache ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { CacheAbleRequestData . getImage ( false , true ) ; } } ) ; view . findViewById ( request_cache_demo_btn_clear_log ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { clearMsg ( ) ; } } ) ; return view ; } private void clearMsg ( ) { } private void appendMsg ( String msg ) { } No newline ; at end ; of file ; }

Fix:
TextView textView = ( ( TextView ) ( view . findViewById ( request_cache_demo_btn_use_cache_anyway ) ) ) ;
Buggy code:
public class N2ConfigApi { public static HashMap < String , File > DirectoryList = new HashMap < String , File > ( ) ; public static HashMap < File , File > TempDirectoryList = new HashMap < File , File > ( ) ; public static Logger log = LogManager . getLogger ( "N2ConfigAPI" ) ; public static File registerCustomConfigDirectory ( String directoryPath , String directoryID ) { } public static File registerCustomDirectory ( File ParentDirectory , String directoryPath , String directoryID ) { } public static File getMCMainDir ( ) { } public static File getConfigDir ( ) { } public static String [ ] getDirContentConfigNames ( File directory ) { String [ ] totalList = N2ConfigApi . getDirContentNames ( directory ) ; List < String > finalList = new ArrayList < String > ( ) ; for ( int i = 0 ; i < ( totalList . length ) ; i ++ ) { String currentName = totalList [ i ] ; if ( currentName . endsWith ( ".cfg" ) ) <START_BUG> finalList . add ( currentName ) ; <END_BUG> } return ( ( String [ ] ) ( finalList . toArray ( new String [ finalList . size ( ) ] ) ) ) ; } public static String [ ] getDirContentNames ( File directory ) { } public static File getFileDirFromID ( String directoryID ) { } public static String getFileIDFromFileDir ( File FileDirectory ) { } public static File getTempDir ( File directory ) { } }

Fix:
finalList . add ( currentName . substring ( 0 , ( ( currentName . length ( ) ) - 4 ) ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class DataSourceOperationsUnitTestCase extends AbstractMgmtTestBase { @ Deployment public static Archive < ? > getDeployment ( ) { } @ AfterClass public static void tearDown ( ) throws IOException { } @ Test public void testAddDsAndTestConnection ( ) throws Exception { } @ Test public void testAddDisabledDsEnableItAndTestConnection ( ) throws Exception { } @ Test public void testAddDsWithConnectionProperties ( ) throws Exception { } @ Test public void testAddAndRemoveSameName ( ) throws Exception { } @ Test public void testAddAndRemoveNameAndJndiNameDifferent ( ) throws Exception { } @ Test public void testAddAndRemoveXaDs ( ) throws Exception { } @ Test public void testMarshallUnmarshallXaDs ( ) throws Exception { } @ Test @ Ignore ( "AS7-3173" ) public void DisableAndReEnableXaDs ( ) throws Exception { } @ Test public void testReadInstalledDrivers ( ) throws Exception { } @ Test public void testAddXaDsWithProperties ( ) throws Exception { } @ Test public void testAddComplexDs ( ) throws Exception { } @ Test public void testAddComplexXaDs ( ) throws Exception { } private static < T > T lookup ( ModelControllerClient client , String name , Class < T > expected ) throws Exception { <START_BUG> MBeanServerConnection mbeanServer = JMXConnectorFactory . connect ( new JMXServiceURL ( "service:jmx:remote:////127.0.0.1:9999" ) ) . getMBeanServerConnection ( ) ; <END_BUG> ObjectName objectName = new ObjectName ( "jboss:name=test,type=fakejndi" ) ; PollingUtils . retryWithTimeout ( 10000 , new PollingUtils . WaitForMBeanTask ( mbeanServer , objectName ) ) ; Object o = mbeanServer . invoke ( objectName , "lookup" , new Object [ ] { name } , new String [ ] { "java.lang.String" } ) ; return expected . cast ( o ) ; } }

Fix:
MBeanServerConnection mbeanServer = JMXConnectorFactory . connect ( new JMXServiceURL ( "service:jmx:remoting-jmx:////127.0.0.1:9999" ) ) . getMBeanServerConnection ( ) ;
Buggy code:
public class FileServer { static Logger log = LoggingManager . getLoggerForClass ( ) ; File base ; Map files = new HashMap ( ) ; private static FileServer server = new FileServer ( ) ; private Random random = new Random ( ) ; private FileServer ( ) { } public static FileServer getFileServer ( ) { } public void setBasedir ( String basedir ) throws IOException { } public String getBaseDir ( ) { } public synchronized void reserveFile ( String filename ) { } public synchronized String readLine ( String filename ) throws IOException { } public void closeFiles ( ) throws IOException { } protected boolean filesOpen ( ) { } public File getRandomFile ( String basedir ) { File input = null ; if ( basedir != null ) { File src = new File ( basedir ) ; if ( ( src . isDirectory ( ) ) && ( ( src . list ( ) ) != null ) ) { <START_BUG> File [ ] files = src . listFiles ( new JMeterFileFilter ( new String [ ] { ".txt,.obj" } ) ) ; <END_BUG> int count = files . length ; input = files [ random . nextInt ( count ) ] ; } } return input ; } }

Fix:
File [ ] files = src . listFiles ( new JMeterFileFilter ( new String [ ] { ".txt" , ".obj" } ) ) ;
Buggy code:
public final class Mesh { private final String name ; private final String vertLoc ; private int listID = 0 ; private final Tex tex ; private final boolean ladder ; private final float scale ; public Mesh ( String vertLoc , String name , Tex tex , boolean ladder , float scale ) { } public void render ( GL2 g ) { } private MeshData loadMesh ( GL2 g , File location ) throws IOException , ParserConfigurationException , SAXException , DeedPlannerException { } private void processSource ( MeshData data , Element source ) { Element floatContainer = ( ( Element ) ( source . getElementsByTagName ( "float_array" ) . item ( 0 ) ) ) ; int count = Integer . parseInt ( floatContainer . getAttribute ( "count" ) ) ; String floatsString = floatContainer . getTextContent ( ) ; float [ ] floats = new float [ count ] ; Scanner scan = new Scanner ( floatsString ) ; scan . useLocale ( Locale . US ) ; int current = 0 ; while ( scan . hasNextFloat ( ) ) { floats [ current ] = scan . nextFloat ( ) ; current ++ ; } String attribute = source . getAttribute ( "id" ) . toUpperCase ( ) ; <START_BUG> if ( attribute . contains ( "POS" ) ) { <END_BUG> data . setVertices ( floats ) ; } else if ( attribute . contains ( "NORMAL" ) ) { data . setNormals ( floats ) ; } else if ( ( ( attribute . contains ( "UV" ) ) || ( attribute . contains ( "MAP" ) ) ) || ( attribute . contains ( "TEX" ) ) ) { data . setTexcoords ( floats ) ; } } private void processTriangles ( MeshData data , Element triangles ) { } public String toString ( ) { } }

Fix:
if ( attribute . contains ( "POSITION" ) ) {
Buggy code:
public class MethodInvocation extends Expression { public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( MethodInvocation . class , "expression" , Expression . class , ASTNode . OPTIONAL , ASTNode . CYCLE_RISK ) ; public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor ( MethodInvocation . class , "typeArguments" , Type . class , ASTNode . NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( MethodInvocation . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor ( MethodInvocation . class , "arguments" , Expression . class , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; public static List propertyDescriptors ( int apiLevel ) { } private Expression optionalExpression = null ; private ASTNode . NodeList typeArguments = null ; private SimpleName methodName = null ; private ASTNode . NodeList arguments = new ASTNode . NodeList ( MethodInvocation . ARGUMENTS_PROPERTY ) ; MethodInvocation ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { MethodInvocation result = new MethodInvocation ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setName ( ( ( SimpleName ) ( getName ( ) . clone ( target ) ) ) ) ; result . setExpression ( ( ( Expression ) ( ASTNode . copySubtree ( target , getExpression ( ) ) ) ) ) ; if ( ( this . ast . apiLevel ) >= ( AST . JLS3 ) ) { result . typeArguments ( ) . addAll ( ASTNode . copySubtrees ( target , typeArguments ( ) ) ) ; } result . arguments ( ) . addAll ( ASTNode . copySubtrees ( target , arguments ( ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { } public boolean isResolvedTypeInferredFromExpectedType ( ) { } public void setExpression ( Expression expression ) { } public List typeArguments ( ) { } public SimpleName getName ( ) { } public void setName ( SimpleName name ) { } public List arguments ( ) { } public IMethodBinding resolveMethodBinding ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class PathExpr extends Expr { Expr fe ; LocationPathExpr lpe ; int evalState ; intHash ih ; public PathExpr ( Expr f , LocationPathExpr l ) { } public final boolean evalBoolean ( VTDNav vn ) { } public final double evalNumber ( VTDNav vn ) { } public final int evalNodeSet ( VTDNav vn ) throws NavException , XPathEvalException { } public final String evalString ( VTDNav vn ) { String s = "" ; int a = 2147483647 ; int k = - 1 ; vn . push2 ( ) ; int size = vn . contextStack2 . size ; try { while ( ( k = evalNodeSet ( vn ) ) != ( - 1 ) ) { if ( k < a ) a = k ; } if ( a == 2147483647 ) a = - 1 ; if ( a != ( - 1 ) ) { int t = vn . getTokenType ( a ) ; switch ( t ) { case VTDNav . TOKEN_STARTING_TAG : case VTDNav . TOKEN_DOCUMENT : <START_BUG> s = vn . getXPathStringVal ( ) ; <END_BUG> break ; case VTDNav . TOKEN_ATTR_NAME : s = vn . toString ( ( a + 1 ) ) ; break ; case VTDNav . TOKEN_PI_NAME : s = vn . toString ( ( a + 1 ) ) ; break ; default : s = vn . toString ( a ) ; break ; } } } catch ( Exception e ) { } vn . contextStack2 . size = size ; reset ( vn ) ; vn . pop2 ( ) ; return s ; } public final boolean isUnique ( int i ) { } public final void reset ( VTDNav vn ) { } public final String toString ( ) { } public final boolean isNumerical ( ) { } public final boolean isNodeSet ( ) { } public final boolean isString ( ) { } public final boolean isBoolean ( ) { } public final boolean requireContextSize ( ) { } public final void setContextSize ( int size ) { } public final void setPosition ( int pos ) { } public final int adjust ( int n ) { } public final boolean isFinal ( ) { } public final void markCacheable ( ) { } public final void markCacheable2 ( ) { } public final void clearCache ( ) { } }

Fix:
s = vn . getXPathStringVal2 ( a , ( ( short ) ( 0 ) ) ) ;
Buggy code:
public class Label extends Control { int frameHandle ; int labelHandle ; int imageHandle ; ImageList imageList ; Image image ; String text ; public Label ( Composite parent , int style ) { } static int checkStyle ( int style ) { } void addRelation ( Control control ) { if ( ! ( control . isDescribedByLabel ( ) ) ) return ; if ( ( labelHandle ) == 0 ) return ; <START_BUG> control . getAccessible ( ) . addRelation ( ACC . RELATION_LABELLED_BY , getAccessible ( ) ) ; <END_BUG> control . labelRelation = this ; } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( int index ) { } void createWidget ( int index ) { } void deregister ( ) { } int eventHandle ( ) { } public int getAlignment ( ) { } public int getBorderWidth ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public String getText ( ) { } void hookEvents ( ) { } boolean isDescribedByLabel ( ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void register ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } void resizeHandle ( int width , int height ) { } public void setAlignment ( int alignment ) { } void setAlignment ( ) { } void setBackgroundColor ( GdkColor color ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setFontDescription ( int font ) { } void setForegroundColor ( GdkColor color ) { } void setOrientation ( ) { } public void setImage ( Image image ) { } public void setText ( String string ) { } void showWidget ( ) { } }

Fix:
control . _getAccessible ( ) . addRelation ( ACC . RELATION_LABELLED_BY , _getAccessible ( ) ) ;
Buggy code:
public class LocationUpdate extends Thread { private static final String TAG = "LocationUpdate" ; private InstaMeetService service ; private LocationManager locationManager ; private LocationUpdate . MyLocationListener listener ; private Location previousBestLocation = null ; private static final int TIME_LIMIT = 30000 ; private boolean isGPSEnabled = false ; private boolean isNetworkEnabled = false ; public LocationUpdate ( InstaMeetService service ) { } public Location getLatestLocation ( ) { } boolean isBetterLocation ( Location location , Location currentBestLocation ) { } private boolean isSameProvider ( String provider1 , String provider2 ) { } private class MyLocationListener implements LocationListener { @ Override public void onLocationChanged ( Location location ) { Log . i ( LocationUpdate . TAG , "Location<seq2seq4repair_space>changed" ) ; <START_BUG> if ( ( isBetterLocation ( location , previousBestLocation ) ) && ( ( isGPSEnabled ) || ( isNetworkEnabled ) ) ) { <END_BUG> previousBestLocation = location ; service . updateLocation ( location ) ; } } @ Override public void onStatusChanged ( String provider , int status , Bundle extras ) { } @ Override public void onProviderEnabled ( String provider ) { } @ Override public void onProviderDisabled ( String provider ) { } } }

Fix:
if ( ( ( isBetterLocation ( location , previousBestLocation ) ) && ( ( isGPSEnabled ) || ( isNetworkEnabled ) ) ) && ( ( service . getOwnData ( ) . getId ( ) ) != 0 ) ) {
Buggy code:
public class Utilities { public static ArrayList < String > tokenizeFile ( String input ) { ArrayList < String > tokens = new ArrayList < String > ( ) ; for ( String str : input . split ( "\\W" ) ) { <START_BUG> if ( ( str . length ( ) ) > 1 ) { <END_BUG> tokens . add ( str . toLowerCase ( ) ) ; } } return tokens ; } No newline ; at end ; of file ; }

Fix:
if ( ( ( str . length ( ) ) > 1 ) && ( ! ( WordFrequencyCounter . getStopwords ( ) . contains ( str . toLowerCase ( ) ) ) ) ) {
Buggy code:
public class Login extends Application { @ FXML Button btLogin ; @ FXML RadioButton rbEasyLeft ; @ FXML RadioButton rbNormalLeft ; @ FXML RadioButton rbHardLeft ; @ FXML RadioButton rbVeryHardLeft ; @ FXML RadioButton rbEasyRight ; @ FXML RadioButton rbNormalRight ; @ FXML RadioButton rbHardRight ; @ FXML RadioButton rbVeryHardRight ; @ FXML TextField tfUsername ; @ FXML PasswordField tfPassword ; @ FXML Button btStartSingleGame ; Database database ; Stage primaryStage ; final ToggleGroup group = new ToggleGroup ( ) ; @ Override public void start ( Stage primaryStage ) { } public void Login ( ) { } public void startSingleGame ( ) { } public void actionlogin ( ) { try { database = new Database ( ) ; if ( database . loginCheck ( tfUsername . getText ( ) , tfPassword . getText ( ) ) ) { primaryStage = ( ( Stage ) ( btLogin . getScene ( ) . getWindow ( ) ) ) ; primaryStage . close ( ) ; <START_BUG> Lobby lobby = new Lobby ( primaryStage , new User ( "Martijn" ) ) ; <END_BUG> System . out . println ( ( ( "User:<seq2seq4repair_space>" + ( tfUsername . getText ( ) ) ) + "<seq2seq4repair_space>logged<seq2seq4repair_space>in!" ) ) ; } else { showPopupWindow ( "Invalid<seq2seq4repair_space>login<seq2seq4repair_space>combination!" , "Ok" ) ; System . out . println ( "Logged<seq2seq4repair_space>in<seq2seq4repair_space>(no<seq2seq4repair_space>user)!" ) ; } } catch ( SQLException | IOException ex ) { Logger . getLogger ( Login . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } catch ( IllegalArgumentException ex ) { showPopupWindow ( "Field<seq2seq4repair_space>is<seq2seq4repair_space>empty!" , "Ok" ) ; } } public void actionCreateAccount ( ) { } private void setDifficulty ( ) { } protected void showPopupWindow ( String message , String buttonText ) { } }

Fix:
Lobby lobby = new Lobby ( primaryStage , database . getUser ( tfUsername . getText ( ) ) ) ;
Buggy code:
class Trim extends AbstractVal implements Val { private final Val _val ; private final Val _trimChar ; private final Boolean _where ; private ClassMetaData _meta = null ; private String _func = null ; public Trim ( Val val , Val trimChar , Boolean where ) { } public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public boolean isVariable ( ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } public void initialize ( Select sel , JDBCStore store , boolean nullTest ) { } public Joins getJoins ( ) { } public Object toDataStoreValue ( Object val , JDBCStore store ) { } public void select ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void selectColumns ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void groupBy ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { <START_BUG> sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) , false ) ; <END_BUG> } public void orderBy ( Select sel , JDBCStore store , Object [ ] params , boolean asc , JDBCFetchConfiguration fetch ) { } private SQLBuffer newSQLBuffer ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public Object load ( Result res , JDBCStore store , JDBCFetchConfiguration fetch ) throws SQLException { } public boolean hasVariable ( Variable var ) { } public void calculateValue ( Select sel , JDBCStore store , Object [ ] params , Val other , JDBCFetchConfiguration fetch ) { } public void clearParameters ( ) { } public int length ( ) { } public void appendTo ( SQLBuffer sql , int index , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } }

Fix:
sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) ) ;
Buggy code:
public class Cell { public class State { public static final boolean DEAD = false ; public static final boolean ALIVE = true ; } private int age ; private boolean isAlive = false ; private boolean bufferIsAlive = false ; public Cell ( ) { } public int getAge ( ) { } public void age ( ) { } public void setBufferState ( boolean newState ) { } public boolean isAlive ( ) { } public void persistBufferState ( ) { } public void toggle ( ) { <START_BUG> this . bufferIsAlive = ! ( isAlive ) ; <END_BUG> } }

Fix:
this . isAlive = ! ( isAlive ) ;
Buggy code:
public class PatchConflictsUnitTestCase extends AbstractPatchingTest { @ Test public void testOverrideModules ( ) throws Exception { } @ Test public void testOverrideAllImpliesOverrideModules ( ) throws Exception { } @ Test public void testModuleOverrideAndRollback ( ) throws Exception { final PatchingTestStepBuilder step = testModuleConflicts ( policyBuilder ( ) . overrideAll ( ) . createPolicy ( ) ) ; <START_BUG> rollback ( step , STRICT ) ; <END_BUG> } protected PatchingTestStepBuilder testModuleConflicts ( final ContentVerificationPolicy resolvePolicy ) throws Exception { } }

Fix:
rollback ( step ) ;
Buggy code:
public class CompilationUnitDeclaration extends ASTNode implements ReferenceContext , ProblemSeverities { private static final Comparator STRING_LITERAL_COMPARATOR = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { } } ; private static final int STRING_LITERALS_INCREMENT = 10 ; public ImportReference currentPackage ; public ImportReference [ ] imports ; public TypeDeclaration [ ] types ; public int [ ] [ ] comments ; public boolean ignoreFurtherInvestigation = false ; public boolean ignoreMethodBodies = false ; public CompilationUnitScope scope ; public ProblemReporter problemReporter ; public CompilationResult compilationResult ; public LocalTypeBinding [ ] localTypes ; public int localTypeCount = 0 ; public boolean isPropagatingInnerClassEmulation ; public Javadoc javadoc ; public NLSTag [ ] nlsTags ; private StringLiteral [ ] stringLiterals ; private int stringLiteralsPtr ; public CompilationUnitDeclaration ( ProblemReporter problemReporter , CompilationResult compilationResult , int sourceLength ) { } public void abort ( int abortLevel , IProblem problem ) { } public void analyseCode ( ) { } public void cleanUp ( ) { } private void cleanUp ( TypeDeclaration type ) { if ( ( type . memberTypes ) != null ) { for ( int i = 0 , max = type . memberTypes . length ; i < max ; i ++ ) { cleanUp ( type . memberTypes [ i ] ) ; } } if ( ( ( type . binding ) != null ) && ( type . binding . isAnnotationType ( ) ) ) <START_BUG> compilationResult . declaresAnnotations = true ; <END_BUG> if ( ( type . binding ) != null ) { type . binding . scope = null ; } } public void checkUnusedImports ( ) { } public CompilationResult compilationResult ( ) { } public TypeDeclaration declarationOfType ( char [ ] [ ] typeName ) { } public void generateCode ( ) { } public char [ ] getFileName ( ) { } public char [ ] getMainTypeName ( ) { } public boolean isEmpty ( ) { } public boolean isPackageInfo ( ) { } public boolean hasErrors ( ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public void propagateInnerEmulationForAllLocalTypes ( ) { } public void recordStringLiteral ( StringLiteral literal ) { } public void record ( LocalTypeBinding localType ) { } public void resolve ( ) { } public void tagAsHavingErrors ( ) { } public void traverse ( ASTVisitor visitor , CompilationUnitScope unitScope ) { } }

Fix:
compilationResult . hasAnnotations = true ;
Buggy code:
@ PrepareForTest ( { Arguments . class , SystemClock . class , ReactChoreographer . class } ) @ PowerMockIgnore ( { "org.mockito.*" , "org.robolectric.*" , "android.*" } ) @ RunWith ( RobolectricTestRunner . class ) public class TimingModuleTest { private static final long FRAME_TIME_NS = ( 17 * 1000 ) * 1000 ; private Timing mTiming ; private ReactChoreographer mChoreographerMock ; private TimingModuleTest . PostFrameCallbackHandler mPostFrameCallbackHandler ; private long mCurrentTimeNs ; private JSTimersExecution mJSTimersMock ; @ Rule public PowerMockRule rule = new PowerMockRule ( ) ; @ Before public void prepareModules ( ) { PowerMockito . mockStatic ( Arguments . class ) ; when ( Arguments . createArray ( ) ) . thenAnswer ( new org . mockito . stubbing . Answer < Object > ( ) { @ Override public Object answer ( InvocationOnMock invocation ) throws Throwable { return new JavaOnlyArray ( ) ; } } ) ; PowerMockito . mockStatic ( SystemClock . class ) ; when ( SystemClock . currentTimeMillis ( ) ) . thenReturn ( ( ( mCurrentTimeNs ) // 1000000 ) ) ; when ( SystemClock . nanoTime ( ) ) . thenReturn ( mCurrentTimeNs ) ; mChoreographerMock = mock ( ReactChoreographer . class ) ; PowerMockito . mockStatic ( ReactChoreographer . class ) ; when ( ReactChoreographer . getInstance ( ) ) . thenReturn ( mChoreographerMock ) ; CatalystInstance reactInstance = mock ( CatalystInstance . class ) ; ReactApplicationContext reactContext = mock ( ReactApplicationContext . class ) ; when ( reactContext . getCatalystInstance ( ) ) . thenReturn ( reactInstance ) ; mCurrentTimeNs = 0 ; mPostFrameCallbackHandler = new TimingModuleTest . PostFrameCallbackHandler ( ) ; <START_BUG> doAnswer ( mPostFrameCallbackHandler ) . when ( mChoreographerMock ) . postFrameCallback ( eq ( TIMERS_EVENTS ) , any ( FrameCallback . class ) ) ; <END_BUG> mTiming = new Timing ( reactContext ) ; mJSTimersMock = mock ( JSTimersExecution . class ) ; when ( reactInstance . getJSModule ( JSTimersExecution . class ) ) . thenReturn ( mJSTimersMock ) ; mTiming . initialize ( ) ; } private void stepChoreographerFrame ( ) { } @ Test public void testSimpleTimer ( ) { } @ Test public void testSimpleRecurringTimer ( ) { } @ Test public void testCancelRecurringTimer ( ) { } @ Test public void testPausingAndResuming ( ) { } private static class PostFrameCallbackHandler implements org . mockito . stubbing . Answer < Void > { private FrameCallback mFrameCallback ; @ Override public Void answer ( InvocationOnMock invocation ) throws Throwable { } public FrameCallback getAndResetFrameCallback ( ) { } } }

Fix:
doAnswer ( mPostFrameCallbackHandler ) . when ( mChoreographerMock ) . postFrameCallback ( eq ( CALLBACK_TYPE_TIMERS_EVENTS ) , any ( FrameCallback . class ) ) ;
Buggy code:
public class PlanningThread extends Observable implements Runnable { private AllMovingObjects allMovingObjects ; private AllStaticObjects allStaticObjects ; private int planType ; private boolean worldStateIsPopulated = false ; private WorldState worldState = WorldState . getInstance ( ) ; public static final Logger logger = Logger . getLogger ( PlanningThread . class ) ; public PlanningThread ( Observer myWatcher , AllStaticObjects aSO ) { } @ Override public void run ( ) { boolean keepPlanning = true ; while ( keepPlanning || ( this . allStaticObjects . getRunFlag ( ) ) ) { if ( worldStateIsPopulated ) { synchronized ( this ) { <START_BUG> if ( ( this . planType ) == ( HALT . ordinal ( ) ) ) { <END_BUG> keepPlanning = false ; PlanningThread . logger . debug ( "Robot<seq2seq4repair_space>been<seq2seq4repair_space>asked<seq2seq4repair_space>to<seq2seq4repair_space>stop" ) ; } else { keepPlanning = true ; } Strategy . logger . info ( "Planning<seq2seq4repair_space>Thread<seq2seq4repair_space>is<seq2seq4repair_space>running" ) ; Plan temp_plan = new Plan ( this . allStaticObjects , this . allMovingObjects ) ; setChanged ( ) ; notifyObservers ( temp_plan ) ; PlanningThread . logger . debug ( ( "Plan<seq2seq4repair_space>type:<seq2seq4repair_space>" + ( this . planType ) ) ) ; try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e ) { Strategy . logger . error ( "Thread<seq2seq4repair_space>sleeping<seq2seq4repair_space>in<seq2seq4repair_space>PlanningThread<seq2seq4repair_space>was<seq2seq4repair_space>interrupted." ) ; } } } else { while ( ! ( worldStateIsPopulated ) ) { Strategy . logger . info ( worldState . getLastUpdateTime ( ) ) ; setWorldStateIsPopulated ( ) ; } } } } public void setWorldStateIsPopulated ( ) { } }

Fix:
if ( ( this . allStaticObjects . getPlanType ( ) ) == ( HALT . ordinal ( ) ) ) {
Buggy code:
public class ObjectStorageObjectServiceImpl extends BaseObjectStorageService implements ObjectStorageObjectService { @ Override public List < ? extends SwiftObject > list ( String containerName ) { } @ Override public List < ? extends SwiftObject > list ( String containerName , ObjectListOptions options ) { } @ Override public SwiftObject get ( ObjectLocation location ) { } @ Override public SwiftObject get ( String containerName , String name ) { } @ Override public String put ( String containerName , String name , Payload < ? > payload ) { } @ Override public String put ( String containerName , String name , Payload < ? > payload , ObjectPutOptions options ) { } @ Override public ActionResponse delete ( String containerName , String name ) { } @ Override public ActionResponse delete ( ObjectLocation location ) { } @ Override public String copy ( ObjectLocation source , ObjectLocation dest ) { Preconditions . checkNotNull ( source ) ; Preconditions . checkNotNull ( dest ) ; <START_BUG> HttpResponse resp = put ( Void . class , dest . getURI ( ) ) . header ( X_COPY_FROM , source . getURI ( ) ) . header ( CONTENT_LENGTH , 0 ) . executeWithResponse ( ) ; <END_BUG> return resp . header ( ETAG ) ; } @ Override public Map < String , String > getMetadata ( ObjectLocation location ) { } @ Override public Map < String , String > getMetadata ( String containerName , String name ) { } @ Override public boolean updateMetadata ( ObjectLocation location , Map < String , String > metadata ) { } @ Override public DLPayload download ( String containerName , String name ) { } @ Override public DLPayload download ( String containerName , String name , DownloadOptions options ) { } @ Override public DLPayload download ( ObjectLocation location , DownloadOptions options ) { } }

Fix:
HttpResponse resp = put ( Void . class , dest . getURI ( ) ) . header ( X_COPY_FROM , source . getURI ( ) ) . executeWithResponse ( ) ;
Buggy code:
public class DistanceUtils { public static final double DEGREES_TO_RADIANS = ( Math . PI ) // 180.0 ; public static final double RADIANS_TO_DEGREES = 180.0 // ( Math . PI ) ; public static final double KM_TO_MILES = 0.621371192 ; public static final double MILES_TO_KM = 1.609344 ; public static double vectorDistance ( double [ ] vec1 , double [ ] vec2 , double power ) { } public static double vectorDistance ( double [ ] vec1 , double [ ] vec2 , double power , double oneOverPower ) { } public static double squaredEuclideanDistance ( double [ ] vec1 , double [ ] vec2 ) { } public static double haversine ( double x1 , double y1 , double x2 , double y2 , double radius ) { } public static String [ ] parsePoint ( String [ ] out , String externalVal , int dimension ) { } public static double [ ] parsePointDouble ( double [ ] out , String externalVal , int dimension ) { if ( ( out == null ) || ( ( out . length ) != dimension ) ) out = new double [ dimension ] ; int idx = externalVal . indexOf ( ',' ) ; int end = idx ; int start = 0 ; int i = 0 ; if ( ( ( idx == ( - 1 ) ) && ( dimension == 1 ) ) && ( ( externalVal . length ( ) ) > 0 ) ) { out [ 0 ] = Double . parseDouble ( externalVal . trim ( ) ) ; i = 1 ; } else if ( idx > 0 ) { for ( ; i < dimension ; i ++ ) { while ( ( start < end ) && ( ( externalVal . charAt ( start ) ) == '<seq2seq4repair_space>' ) ) start ++ ; while ( ( end > start ) && ( ( externalVal . charAt ( ( end - 1 ) ) ) == '<seq2seq4repair_space>' ) ) end -- ; if ( start == end ) { break ; } out [ i ] = Double . parseDouble ( externalVal . substring ( start , end ) ) ; start = idx + 1 ; end = externalVal . indexOf ( ',' , start ) ; <START_BUG> idex = end ; <END_BUG> if ( end == ( - 1 ) ) { end = externalVal . length ( ) ; } } } if ( i != dimension ) { throw new org . apache . solr . common . SolrException ( ErrorCode . BAD_REQUEST , ( ( ( ( ( ( "incompatible<seq2seq4repair_space>dimension<seq2seq4repair_space>(" + dimension ) + ")<seq2seq4repair_space>and<seq2seq4repair_space>values<seq2seq4repair_space>(" ) + externalVal ) + ").<seq2seq4repair_space>Only<seq2seq4repair_space>" ) + i ) + "<seq2seq4repair_space>values<seq2seq4repair_space>specified" ) ) ; } return out ; } public static final double [ ] parseLatitudeLongitude ( double [ ] latLon , String latLonStr ) { } }

Fix:
idx = end ;