nus-yam/ex-repair huggingface dataset:
Buggy code:
@ SuppressWarnings ( "restriction" ) public class DoctrineModelAccess extends PhpModelAccess { private static DoctrineModelAccess modelInstance = null ; public static DoctrineModelAccess getDefault ( ) { } public String getRepositoryClass ( String className , String qualifier , IScriptProject project ) { IDLTKSearchScope scope = SearchEngine . createSearchScope ( project ) ; if ( scope == null ) { return null ; } ISearchEngine engine = ModelAccess . getSearchEngine ( PHPLanguageToolkit . getDefault ( ) ) ; final List < String > repos = new ArrayList < String > ( ) ; <START_BUG> engine . search ( REPOSITORY_CLASS , null , "Doctor" , 0 , 0 , 100 , REFERENCES , EXACT , scope , new ISearchRequestor ( ) { <END_BUG> @ Override public void match ( int elementType , int flags , int offset , int length , int nameOffset , int nameLength , String elementName , String metadata , String doc , String qualifier , String parent , ISourceModule sourceModule , boolean isReference ) { if ( metadata != null ) repos . add ( metadata ) ; } } , null ) ; if ( ( repos . size ( ) ) == 1 ) { return repos . get ( 0 ) ; } return null ; } public List < Entity > getEntities ( IScriptProject project ) { } No newline ; at end ; of file ; }

Fix:
engine . search ( REPOSITORY_CLASS , null , className , 0 , 0 , 100 , REFERENCES , EXACT , scope , new ISearchRequestor ( ) {
Buggy code:
public class ClojureCompilerMojo extends CompilerMojo { private String compilerId ; private MavenProject project ; protected void forwardCompilerId ( ) { } protected Object getField ( Class klass , String fieldName ) { } protected void addClojureCompileSourceRoots ( ) { List < String > sourceRoots = getCompileSourceRoots ( ) ; List < String > newRoots = new LinkedList ( ) ; for ( String srcDir : sourceRoots ) { <START_BUG> if ( srcDir . endsWith ( "//java" ) ) { <END_BUG> newRoots . add ( ( ( srcDir . substring ( 0 , ( ( srcDir . length ( ) ) - 4 ) ) ) + "clojure" ) ) ; } } for ( String srcDir : newRoots ) { project . addCompileSourceRoot ( srcDir ) ; sourceRoots . add ( srcDir ) ; } } protected SourceInclusionScanner getSourceInclusionScanner ( int staleMillis ) { } protected SourceInclusionScanner getSourceInclusionScanner ( String inputFileEnding ) { } public void execute ( ) throws CompilationFailureException , MojoExecutionException { } }

Fix:
if ( srcDir . endsWith ( ( ( File . separator ) + "java" ) ) ) {
Buggy code:
final class TargetModuleIDImpl implements JBossTargetModuleID { private final JBossTarget target ; private final String moduleID ; private final TargetModuleID parentModuleID ; private final ModuleType moduleType ; private List < TargetModuleID > childModuleIDs = new ArrayList < TargetModuleID > ( ) ; private boolean isRunning ; TargetModuleIDImpl ( JBossTarget target , String moduleID , TargetModuleID parentModuleID , ModuleType moduleType ) { } @ Override public boolean isRunning ( ) { } void setRunning ( boolean isRunning ) { } @ Override public ModuleType getModuleType ( ) { } void addChildTargetModuleID ( TargetModuleID childModuleID ) { } @ Override public Target getTarget ( ) { } @ Override public String getModuleID ( ) { } @ Override public String getWebURL ( ) { } @ Override public TargetModuleID getParentTargetModuleID ( ) { } @ Override public TargetModuleID [ ] getChildTargetModuleID ( ) { } public int hashCode ( ) { } public boolean equals ( Object obj ) { } public String toString ( ) { String parentID = ( ( parentModuleID ) != null ) ? parentModuleID . getModuleID ( ) : null ; <START_BUG> return ( ( ( ( ( "[target=" + ( target . getName ( ) ) ) + ",parent=" ) + parentID ) + ",id=" ) + ( moduleID ) ) + "]" ; <END_BUG> } }

Fix:
return ( ( ( ( ( ( ( "[target=" + ( target . getName ( ) ) ) + ",parent=" ) + parentID ) + ",type=" ) + ( moduleType ) ) + ",id=" ) + ( moduleID ) ) + "]" ;
Buggy code:
public class TestElement implements TestCollector { private String name ; public Enumeration collectTests ( ) { <START_BUG> return Enumerations . fromArray ( new String [ ] { name } ) ; <END_BUG> } public void setName ( String value ) { } }

Fix:
return new ArrayEnumeration ( new String [ ] { name } ) ;
Buggy code:
public interface ServerInterface { public String getAccessToken ( String userEmail ) { } public String getPassword ( String userEmail ) { } public double [ ] getEnqueteWeights ( String userEmail ) { } <START_BUG> public LinkedList < PersuasivePart > [ ] getAllMessages ( ) ; <END_BUG> public String getLastMessageTo ( String userEmail ) { } public int stepsTakenBetween ( String userEmail , Timestamp startTime , Timestamp endTime ) { } public boolean sendStepLog ( String userEmail , int nrOfSteps , Timestamp startTime , Timestamp endTime ) { } public boolean messageSent ( String userEmail , String message , int response , Timestamp time ) { } public boolean setMessageResponse ( String userEmail , Timestamp responseTime , int response ) { } public boolean newUser ( String userEmail , String accesstoken , String password ) { } public boolean setEnqueteWeights ( String userEmail , double [ ] weights ) { } }

Fix:
public LinkedList < PersuasivePart > getAllMessages ( ) ;
Buggy code:
public class GitTest { public static void main ( String [ ] args ) { System . out . println ( "Git<seq2seq4repair_space>is<seq2seq4repair_space>fun" ) ; System . out . println ( "Git<seq2seq4repair_space>is<seq2seq4repair_space>fun<seq2seq4repair_space>too....." ) ; <START_BUG> System . out . println ( "Fixes<seq2seq4repair_space>done<seq2seq4repair_space>in<seq2seq4repair_space>TestErrorFix<seq2seq4repair_space>branch" ) ; <END_BUG> } }

Fix:
System . out . println ( "More<seq2seq4repair_space>Fixes<seq2seq4repair_space>done<seq2seq4repair_space>in<seq2seq4repair_space>TestErrorFix<seq2seq4repair_space>branch" ) ;
Buggy code:
public class FAQActivity extends ActionBarActivity { ExpandableListAdapter listAdapter ; ExpandableListView expListView ; List < String > listDataHeader ; HashMap < String , List < String > > listDataChild ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public Intent getSupportParentActivityIntent ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { <START_BUG> getMenuInflater ( ) . inflate ( menu_faq , menu ) ; <END_BUG> return true ; } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void prepareListData ( ) { } No newline ; at end ; of file ; }

Fix:
getMenuInflater ( ) . inflate ( menu_faq_page , menu ) ;
Buggy code:
public final class DecimalValidator extends AbstractValidator { public static final DecimalValidator INT = new DecimalValidator ( Integer . MIN_VALUE , Integer . MAX_VALUE ) ; public static final DecimalValidator POSITIVE_INT = new DecimalValidator ( 0 , Integer . MAX_VALUE ) ; public static final DecimalValidator LONG = new DecimalValidator ( Long . MIN_VALUE , Long . MAX_VALUE ) ; public static final DecimalValidator POSITIVE_LONG = new DecimalValidator ( 0 , Long . MAX_VALUE ) ; private final long min ; private final long max ; private DecimalValidator ( final long min , final long max ) { } public static DecimalValidator range ( final long min , final long max ) { } public ValidationErrorMessage validate ( final FormComponent component ) { <START_BUG> final String value = component . getStringValue ( ) ; <END_BUG> try { final long longValue = Long . parseLong ( value ) ; if ( ( longValue < ( min ) ) || ( longValue > ( max ) ) ) { return errorMessage ( value , component ) ; } } catch ( NumberFormatException e ) { return errorMessage ( value , component ) ; } return NO_ERROR ; } }

Fix:
final String value = component . getRequestString ( ) ;
Buggy code:
public class GenerateFeatureMatrices { private ArrayList < ArrayList < Double > > examplesFeatures ; private ArrayList < Double > examplesClasses ; private static final int numberOfMoments = 10 ; private Collection < MLArray > collectionMl ; public GenerateFeatureMatrices ( ) { } private void exportTheMatrices ( ArrayList < Double > examplesClasses , ArrayList < ArrayList < Double > > examplesFeatures , String trainSetFileName ) { } private void addArrayListToMlarray ( ArrayList < Double > arrayList , String name ) { } private void addArrayListToMlarray2 ( ArrayList < ArrayList < Double > > arrayList , String name ) { } private double [ ] [ ] convertArrayListToNormalArray ( ArrayList < Double > arrayList ) { } private double [ ] [ ] convertArrayListToNormalArray2 ( ArrayList < ArrayList < Double > > arrayList ) { } private void creatingXandYs ( String classToTrain ) { } private void generateCsvOfExamples ( ) { } private int getclassNumber ( String classToTrain ) { } public static double [ ] [ ] readMatFile ( String fileName , String arrayName ) { MatFileReader matfilereader ; double [ ] [ ] array = null ; try { matfilereader = new MatFileReader ( fileName ) ; <START_BUG> MLDouble heta = ( ( MLDouble ) ( matfilereader . getMLArray ( "X" ) ) ) ; <END_BUG> array = heta . getArray ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return array ; } public void exportTrainingSetMatrices ( String name ) { } public static void main ( String [ ] args ) { } }

Fix:
MLDouble heta = ( ( MLDouble ) ( matfilereader . getMLArray ( arrayName ) ) ) ;
Buggy code:
public class VampireMob implements IExtendedEntityProperties { public static final VampireMob get ( EntityLiving mob ) { } public static int getMaxBloodAmount ( EntityCreature e ) { } public static final void register ( EntityCreature mob ) { } private final EntityCreature entity ; public static final String EXT_PROP_NAME = "VampireMob" ; private final String KEY_VAMPIRE = "vampire" ; private static final int VAMPIRE_WATCHER = 25 ; private final int blood ; public VampireMob ( EntityCreature mob ) { } private void addAITasks ( ) { <START_BUG> EntityAITasks tasks = ( ( EntityAITasks ) ( Reflection . getPrivateFinalField ( EntityLiving . class , entity , "tasks" ) ) ) ; <END_BUG> tasks . addTask ( 1 , new net . minecraft . entity . ai . EntityAIAttackOnCollide ( entity , EntityPlayer . class , 1.0 , false ) ) ; tasks . addTask ( 1 , new net . minecraft . entity . ai . EntityAIAttackOnCollide ( entity , EntityVampireHunter . class , 1.0 , true ) ) ; EntityAITasks targetTasks = ( ( EntityAITasks ) ( Reflection . getPrivateFinalField ( EntityLiving . class , entity , "targetTasks" ) ) ) ; targetTasks . addTask ( 3 , new net . minecraft . entity . ai . EntityAINearestAttackableTarget ( entity , EntityPlayer . class , 0 , true , false , new IEntitySelector ( ) { @ Override public boolean isEntityApplicable ( Entity entity ) { if ( entity instanceof EntityPlayer ) { return ( VampirePlayer . get ( ( ( EntityPlayer ) ( entity ) ) ) . getLevel ( ) ) <= 0 ; } return false ; } } ) ) ; targetTasks . addTask ( 3 , new net . minecraft . entity . ai . EntityAINearestAttackableTarget ( entity , EntityVampireHunter . class , 0 , true ) ) ; } public int bite ( ) { } public boolean lowEnoughHealth ( ) { } public boolean canBeBitten ( ) { } @ Override public void init ( Entity entity , World world ) { } public boolean isVampire ( ) { } @ Override public void loadNBTData ( NBTTagCompound compound ) { } private boolean makeVampire ( ) { } @ Override public void saveNBTData ( NBTTagCompound compound ) { } }

Fix:
EntityAITasks tasks = ( ( EntityAITasks ) ( Reflection . getPrivateFinalField ( EntityLiving . class , ( ( EntityLiving ) ( entity ) ) , "tasks" ) ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class ClientInventory extends JPanel { public static final int INVENTORY_WIDTH = 300 ; public static final int WIDTH = 5 ; public static final int HEIGHT = 5 ; private ClientItem [ ] [ ] inventory = new ClientItem [ ClientInventory . HEIGHT ] [ ClientInventory . WIDTH ] ; private ClientItem [ ] equippedWeapons = new ClientItem [ ServerPlayer . MAX_WEAPONS ] ; private Client client ; public ClientInventory ( ) { } public void addItem ( String image , String type , int amount ) { if ( ( type . charAt ( 1 ) ) == ( STACK_TYPE . charAt ( 1 ) ) ) for ( int row = 0 ; row < ( inventory . length ) ; row ++ ) for ( int col = 0 ; col < ( inventory [ row ] . length ) ; col ++ ) if ( ( ( inventory [ row ] [ col ] ) != null ) && ( inventory [ row ] [ col ] . getType ( ) . equals ( type ) ) ) { <START_BUG> inventory [ row ] [ col ] . increaseAmount ( ) ; <END_BUG> return ; } for ( int row = 0 ; row < ( inventory . length ) ; row ++ ) for ( int col = 0 ; col < ( inventory [ row ] . length ) ; col ++ ) if ( ( inventory [ row ] [ col ] ) == null ) { inventory [ row ] [ col ] = new ClientItem ( image , type , amount , row , col , this ) ; add ( inventory [ row ] [ col ] ) ; repaint ( ) ; return ; } System . out . println ( "Full<seq2seq4repair_space>Inventory" ) ; } public void removeItem ( ClientItem item , int pos ) { } public void use ( ClientItem item ) { } public void clear ( ) { } public Client getClient ( ) { } public void setClient ( Client client ) { } public void paintComponent ( Graphics graphics ) { } public ClientItem [ ] getEquippedWeapons ( ) { } public void setEquippedWeapons ( ClientItem [ ] equippedWeapons ) { } public ClientItem [ ] [ ] getInventory ( ) { } public void setInventory ( ClientItem [ ] [ ] inventory ) { } }

Fix:
inventory [ row ] [ col ] . increaseAmount ( amount ) ;
Buggy code:
public class DebuggableThreadPoolExecutor extends ThreadPoolExecutor { protected static Logger logger = Logger . getLogger ( DebuggableThreadPoolExecutor . class ) ; public DebuggableThreadPoolExecutor ( String threadPoolName , int priority ) { } public DebuggableThreadPoolExecutor ( int corePoolSize , int maximumPoolSize , long keepAliveTime , TimeUnit unit , BlockingQueue < Runnable > workQueue , ThreadFactory threadFactory ) { } public void afterExecute ( Runnable r , Throwable t ) { super . afterExecute ( r , t ) ; if ( r instanceof FutureTask ) { try { ( ( FutureTask ) ( r ) ) . get ( ) ; } catch ( InterruptedException e ) { throw new AssertionError ( e ) ; } catch ( ExecutionException e ) { <START_BUG> Thread . getDefaultUncaughtExceptionHandler ( ) . uncaughtException ( Thread . currentThread ( ) , e ) ; <END_BUG> } } if ( t != null ) { DebuggableThreadPoolExecutor . logger . error ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>ThreadPoolExecutor" , t ) ; } } }

Fix:
Thread . getDefaultUncaughtExceptionHandler ( ) . uncaughtException ( Thread . currentThread ( ) , e . getCause ( ) ) ;
Buggy code:
public final class ServerCommunicationHandlerFactory { private static final ServerCommunicationHandlerFactory INSTANCE = new ServerCommunicationHandlerFactory ( ) ; public static ServerCommunicationHandlerFactory getInstance ( ) { } public ServerCommunicationHandler getServerCommunicationHandler ( ServerEnvironment environment , MessageHandler handler ) { <START_BUG> return new ServerCommunicationHandler ( environment . getStdin ( ) , environment . getStdout ( ) , handler ) ; <END_BUG> } private ServerCommunicationHandlerFactory ( ) { } }

Fix:
return new ServerCommunicationHandler ( environment . getProcessName ( ) , environment . getProcessManagerAddress ( ) , environment . getProcessManagerPort ( ) , handler ) ;
Buggy code:
class JPASubsystemAdd implements ModelAddOperationHandler , BootOperationHandler { static final JPASubsystemAdd INSTANCE = new JPASubsystemAdd ( ) ; private JPASubsystemAdd ( ) { } @ Override public OperationResult execute ( OperationContext context , ModelNode operation , ResultHandler resultHandler ) { if ( context instanceof BootOperationContext ) { <START_BUG> PersistenceProviderResolverHolder . setPersistenceProviderResolver ( new PersistenceProviderResolverImpl ( ) ) ; <END_BUG> PersistenceProviderAdapterRegistry . putPersistenceProviderAdaptor ( "org.hibernate.ejb.HibernatePersistence" , new HibernatePersistenceProviderAdaptor ( ) ) ; final BootOperationContext updateContext = ( ( BootOperationContext ) ( context ) ) ; updateContext . addDeploymentProcessor ( PARSE , PARSE_PERSISTENCE_UNIT , new PersistenceUnitParseProcessor ( ) ) ; updateContext . addDeploymentProcessor ( PARSE , PARSE_PERSISTENCE_ANNOTATION , new JPAAnnotationParseProcessor ( ) ) ; updateContext . addDeploymentProcessor ( INSTALL , INSTALL_PERSISTENCE_PROVIDER , new PersistenceProviderProcessor ( ) ) ; updateContext . addDeploymentProcessor ( DEPENDENCIES , DEPENDENCIES_JPA , new JPADependencyProcessor ( ) ) ; updateContext . addDeploymentProcessor ( INSTALL , INSTALL_PERSISTENCE_REF , new PersistenceRefProcessor ( ) ) ; updateContext . addDeploymentProcessor ( INSTALL , INSTALL_PERSISTENTUNIT , new PersistenceUnitDeploymentProcessor ( ) ) ; } final ModelNode compensatingOperation = new ModelNode ( ) ; compensatingOperation . get ( OP ) . set ( REMOVE ) ; compensatingOperation . get ( OP_ADDR ) . set ( operation . require ( OP_ADDR ) ) ; context . getSubModel ( ) . setEmptyObject ( ) ; resultHandler . handleResultComplete ( ) ; return new org . jboss . as . controller . BasicOperationResult ( compensatingOperation ) ; } }

Fix:
PersistenceProviderResolverHolder . setPersistenceProviderResolver ( PersistenceProviderResolverImpl . getInstance ( ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class SearchView extends SearchLayout implements View { public static final String NAME = "search" ; public SearchView ( ) { } public void updateSearchResultsView ( SolrDocumentList docs ) { } public void submitQuery ( ) { try { SolrDocumentList doclist = null ; <START_BUG> doclist = SolrConnection . getDefault ( ) . query ( tfSearch . getValue ( ) ) ; <END_BUG> System . out . println ( ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>Search<seq2seq4repair_space>results:<seq2seq4repair_space>" + ( doclist . size ( ) ) ) ) ; updateSearchResultsView ( doclist ) ; } catch ( SolrServerException | IOException e ) { Notification notification = new Notification ( "Solr<seq2seq4repair_space>Server<seq2seq4repair_space>Error!" ) ; notification . setDelayMsec ( 8000 ) ; notification . setDescription ( "It<seq2seq4repair_space>looks<seq2seq4repair_space>the<seq2seq4repair_space>Solr<seq2seq4repair_space>server<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>running.<seq2seq4repair_space>Please<seq2seq4repair_space>consult<seq2seq4repair_space>your<seq2seq4repair_space>IT<seq2seq4repair_space>Administrator" ) ; notification . setStyleName ( "tray<seq2seq4repair_space>dark<seq2seq4repair_space>small<seq2seq4repair_space>closable<seq2seq4repair_space>login-help" ) ; notification . setPosition ( TOP_CENTER ) ; notification . show ( Page . getCurrent ( ) ) ; e . printStackTrace ( ) ; } } @ Override public void enter ( ViewChangeEvent event ) { } }

Fix:
doclist = SolrConnection . getInstance ( ) . query ( tfSearch . getValue ( ) ) ;
Buggy code:
@ Singleton @ Plugin ( id = "Skree" , name = "Skree" , version = "1.0" ) public class SkreePlugin { @ Inject private Game game ; @ Inject private Logger logger ; public static CustomItemSystem customItemSystem ; public static CustomBlockSystem customBlockSystem ; @ Subscribe public void onPreInit ( PreInitializationEvent event ) { SkreePlugin . customItemSystem = new CustomItemSystem ( this , game ) ; SkreePlugin . customItemSystem . preInit ( ) ; SkreePlugin . customBlockSystem = new CustomBlockSystem ( this , game ) ; <START_BUG> SkreePlugin . customBlockSystem . init ( ) ; <END_BUG> } @ Subscribe public void onServerStart ( ServerStartedEvent event ) { } private void registerPrimaryHybridSystems ( ) { } private void registerPrimaryClientSystems ( ) { } private void registerPrimaryServerSystems ( ) { } }

Fix:
SkreePlugin . customBlockSystem . preInit ( ) ;
Buggy code:
public abstract class Migration { private static final Logger logger = LoggerFactory . getLogger ( Migration . class ) ; public static final String MIGRATIONS_CF = "Migrations" ; public static final String SCHEMA_CF = "Schema" ; public static final byte [ ] MIGRATIONS_KEY = "Migrations<seq2seq4repair_space>Key" . getBytes ( Charsets . UTF_8 ) ; public static final byte [ ] LAST_MIGRATION_KEY = "Last<seq2seq4repair_space>Migration" . getBytes ( Charsets . UTF_8 ) ; protected RowMutation rm ; protected UUID newVersion ; protected UUID lastVersion ; protected transient boolean clientMode ; protected Migration ( ) { } Migration ( UUID newVersion , UUID lastVersion ) { } public void beforeApplyModels ( ) { } public final void apply ( ) throws IOException , ConfigurationException { } public final void announce ( ) { } public static UUID getLastMigrationId ( ) { } abstract void applyModels ( ) throws IOException { } public abstract void subdeflate ( org . apache . cassandra . db . migration . avro . Migration mi ) { } public abstract void subinflate ( org . apache . cassandra . db . migration . avro . Migration mi ) { } public UUID getVersion ( ) { } static RowMutation makeDefinitionMutation ( KSMetaData add , KSMetaData remove , UUID versionId ) throws IOException { } static void cleanupDeadFiles ( boolean wait ) { } public byte [ ] serialize ( ) throws IOException { } public static Migration deserialize ( byte [ ] bytes ) throws IOException { <START_BUG> org . apache . cassandra . db . migration . avro . Migration mi = SerDeUtils . deserializeWithSchema ( bytes ) ; <END_BUG> Migration migration ; try { Class migrationClass = Class . forName ( mi . classname . toString ( ) ) ; Constructor migrationConstructor = migrationClass . getDeclaredConstructor ( ) ; migrationConstructor . setAccessible ( true ) ; migration = ( ( Migration ) ( migrationConstructor . newInstance ( ) ) ) ; } catch ( Exception e ) { throw new RuntimeException ( ( "Invalid<seq2seq4repair_space>migration<seq2seq4repair_space>class:<seq2seq4repair_space>" + ( mi . classname . toString ( ) ) ) , e ) ; } migration . lastVersion = UUIDGen . makeType1UUID ( mi . old_version . bytes ( ) ) ; migration . newVersion = UUIDGen . makeType1UUID ( mi . new_version . bytes ( ) ) ; try { migration . rm = RowMutation . serializer ( ) . deserialize ( SerDeUtils . createDataInputStream ( mi . row_mutation ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } migration . subinflate ( mi ) ; return migration ; } public static Collection < IColumn > getLocalMigrations ( UUID start , UUID end ) { } public static byte [ ] toUTF8Bytes ( UUID version ) { } }

Fix:
org . apache . cassandra . db . migration . avro . Migration mi = SerDeUtils . deserializeWithSchema ( bytes , new org . apache . cassandra . db . migration . avro . Migration ( ) ) ;
Buggy code:
public class ThemeSwitcher { public static void setTheme ( ) { XmlElement themeConfig = Config . get ( "options" ) . getElement ( "//options//gui//theme" ) ; try { ThemePluginHandler handler = ( ( ThemePluginHandler ) ( pluginManager . getHandler ( "org.columba.core.theme" ) ) ) ; <START_BUG> String pluginName = themeConfig . getAttribute ( "name" , "ThinColumba" ) ; <END_BUG> if ( pluginName == null ) { themeConfig . addAttribute ( "name" , "ThinColumba" ) ; pluginName = "ThinColumba" ; } AbstractThemePlugin theme = null ; theme = ( ( AbstractThemePlugin ) ( handler . getPlugin ( pluginName , null ) ) ) ; theme . setLookAndFeel ( ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; try { UIManager . setLookAndFeel ( UIManager . getCrossPlatformLookAndFeelClassName ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } public static void updateFrame ( JFrame frame ) { } }

Fix:
String pluginName = themeConfig . getAttribute ( "name" , "Plastic" ) ;
Buggy code:
class AnnotationDrivenJmsBeanDefinitionParser implements BeanDefinitionParser { @ Override public BeanDefinition parse ( Element element , ParserContext parserContext ) { Object source = parserContext . extractSource ( element ) ; CompositeComponentDefinition compDefinition = new CompositeComponentDefinition ( element . getTagName ( ) , source ) ; parserContext . pushContainingComponent ( compDefinition ) ; BeanDefinitionRegistry registry = parserContext . getRegistry ( ) ; if ( registry . containsBeanDefinition ( JMS_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME ) ) { parserContext . getReaderContext ( ) . error ( "Only<seq2seq4repair_space>one<seq2seq4repair_space>JmsListenerAnnotationBeanPostProcessor<seq2seq4repair_space>may<seq2seq4repair_space>exist<seq2seq4repair_space>within<seq2seq4repair_space>the<seq2seq4repair_space>context." , source ) ; } else { BeanDefinitionBuilder builder = BeanDefinitionBuilder . genericBeanDefinition ( "org.springframework.jms.annotation.JmsListenerAnnotationBeanPostProcessor" ) ; builder . getRawBeanDefinition ( ) . setSource ( source ) ; String endpointRegistry = element . getAttribute ( "registry" ) ; if ( StringUtils . hasText ( endpointRegistry ) ) { builder . addPropertyReference ( "endpointRegistry" , endpointRegistry ) ; } else { AnnotationDrivenJmsBeanDefinitionParser . registerDefaultEndpointRegistry ( source , parserContext ) ; } String containerFactory = element . getAttribute ( "container-factory" ) ; if ( StringUtils . hasText ( containerFactory ) ) { builder . addPropertyValue ( "containerFactoryBeanName" , containerFactory ) ; } String handlerMethodFactory = element . getAttribute ( "handler-method-factory" ) ; if ( StringUtils . hasText ( handlerMethodFactory ) ) { <START_BUG> builder . addPropertyReference ( "jmsHandlerMethodFactory" , handlerMethodFactory ) ; <END_BUG> } AnnotationDrivenJmsBeanDefinitionParser . registerInfrastructureBean ( parserContext , builder , JMS_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME ) ; } parserContext . popAndRegisterContainingComponent ( ) ; return null ; } private static void registerDefaultEndpointRegistry ( Object source , ParserContext parserContext ) { } private static void registerInfrastructureBean ( ParserContext parserContext , BeanDefinitionBuilder builder , String beanName ) { } }

Fix:
builder . addPropertyReference ( "messageHandlerMethodFactory" , handlerMethodFactory ) ;
Buggy code:
@ Service ( "userDetailsService" ) public class UserDetailsServiceImpl implements UserDetailsService { private final UserService userService ; private final Logger log = LoggerFactory . getLogger ( getClass ( ) ) ; @ Autowired public UserDetailsServiceImpl ( UserService userService ) { } public UserDetails loadUserByUsername ( String username ) throws UsernameNotFoundException { log . debug ( ( "Авторизация<seq2seq4repair_space>пользователя<seq2seq4repair_space>с<seq2seq4repair_space>именем:<seq2seq4repair_space>" + username ) ) ; User user = userService . findByEmail ( username ) ; if ( null == user ) { log . warn ( ( ( "Пользователь<seq2seq4repair_space>\"" + username ) + "\"<seq2seq4repair_space>не<seq2seq4repair_space>найден<seq2seq4repair_space>в<seq2seq4repair_space>БД" ) ) ; throw new UsernameNotFoundException ( ( username + "<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ) ; } Set < GrantedAuthority > authorities = buildUserAuthority ( user . getRoles ( ) ) ; CurrentUser currentUser = new CurrentUser ( user . getId ( ) , user . getEmail ( ) , user . getPassword ( ) , user . getDescr ( ) , user . isEnabled ( ) , true , true , true , authorities ) ; <START_BUG> log . debug ( "Успешная<seq2seq4repair_space>авторизация.<seq2seq4repair_space>Детальная<seq2seq4repair_space>информация:<seq2seq4repair_space>\n" ) ; <END_BUG> return currentUser ; } private Set < GrantedAuthority > buildUserAuthority ( Set < UserRole > userRoles ) { } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
log . debug ( ( "Пользователь<seq2seq4repair_space>найден:<seq2seq4repair_space>\n" + currentUser ) ) ;
Buggy code:
public class PersistenceProviderImpl implements PersistenceProvider { static final String CLASS_TRANSFORMER_OPTIONS = "openjpa.ClassTransformerOptions" ; public EntityManagerFactory createEntityManagerFactory ( String name , String resource , Map m ) { ConfigurationProviderImpl cp = new ConfigurationProviderImpl ( ) ; try { <START_BUG> if ( cp . load ( name , resource , m ) ) <END_BUG> return OpenJPAPersistence . toEntityManagerFactory ( Bootstrap . newBrokerFactory ( cp , cp . getClassLoader ( ) ) ) ; else return null ; } catch ( Exception e ) { throw PersistenceExceptions . toPersistenceException ( e ) ; } } public EntityManagerFactory createEntityManagerFactory ( String name , Map m ) { } public EntityManagerFactory createContainerEntityManagerFactory ( PersistenceUnitInfo pui , Map map ) { } private static class ClassTransformerImpl implements ClassTransformer { private final ClassFileTransformer _trans ; private ClassTransformerImpl ( OpenJPAConfiguration conf , String options , ClassLoader tempClassLoader ) { } public byte [ ] transform ( ClassLoader cl , String name , Class < ? > previousVersion , ProtectionDomain pd , byte [ ] bytes ) throws IllegalClassFormatException { } } }

Fix:
if ( cp . load ( resource , name , m ) )
Buggy code:
public class WriteScriptsForCreatingBinaryFilesAll80CHS { public static void main ( String [ ] args ) throws Exception { BufferedWriter writer = new BufferedWriter ( new FileWriter ( new File ( "//projects//afodor_chs//kwinglee//cophylog_all80chs//run//runAll.sh" ) ) ) ; File folder = new File ( "//projects//afodor_research//mjzapata//CRE//CHS_raw//" ) ; File [ ] files = folder . listFiles ( ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { String inFile = files [ i ] . getName ( ) ; if ( inFile . endsWith ( ".fastq.gz" ) ) { inFile = inFile . replace ( ".fastq.gz" , "" ) ; File outFile = new File ( ( "//projects//afodor_chs//kwinglee//cophylog_all80chs//run//run_" + inFile ) ) ; BufferedWriter aWriter = new BufferedWriter ( new FileWriter ( outFile ) ) ; aWriter . write ( "#PBS<seq2seq4repair_space>-l<seq2seq4repair_space>nodes=1:ppn=12\n" ) ; writer . write ( ( ( "qsub<seq2seq4repair_space>-q<seq2seq4repair_space>\"Cobra_batch\"<seq2seq4repair_space>run_" + inFile ) + "\n" ) ) ; <START_BUG> aWriter . write ( ( ( ( ( ( "java<seq2seq4repair_space>-cp<seq2seq4repair_space>//users//afodor//gitInstall//clusterstuff//bin<seq2seq4repair_space>-mx20000m<seq2seq4repair_space>chs_snps.WriteBinaryContextsFromFastQ<seq2seq4repair_space>" + "//projects//afodor_research//mjzapata//CRE//CHS_raw//" ) + inFile ) + ".fastq.gz<seq2seq4repair_space>//projects//afodor_chs//kwinglee//cophylog_all80chs//context" ) + inFile ) + "_context.gz" ) ) ; <END_BUG> aWriter . flush ( ) ; aWriter . close ( ) ; } } writer . flush ( ) ; writer . close ( ) ; } }

Fix:
aWriter . write ( ( ( ( ( ( "java<seq2seq4repair_space>-cp<seq2seq4repair_space>//users//kwinglee//git//clusterstuff//bin<seq2seq4repair_space>-mx20000m<seq2seq4repair_space>chs_snps.WriteBinaryContextsFromFastQ<seq2seq4repair_space>" + "//projects//afodor_research//mjzapata//CRE//CHS_raw//" ) + inFile ) + ".fastq.gz<seq2seq4repair_space>//projects//afodor_chs//kwinglee//cophylog_all80chs//context" ) + inFile ) + "_context.gz" ) ) ;
Buggy code:
public class VariablesEvaluator extends Evaluator implements EvaluationConstants { int startPosOffset = 0 ; VariablesEvaluator ( EvaluationContext context , INameEnvironment environment , Map options , IRequestor requestor , IProblemFactory problemFactory ) { } protected void addEvaluationResultForCompilationProblem ( Map resultsByIDs , IProblem problem , char [ ] cuSource ) { } protected char [ ] getClassName ( ) { <START_BUG> return CharOperation . concat ( this . context . GLOBAL_VARS_CLASS_NAME_PREFIX , Integer . toString ( ( ( this . context . VAR_CLASS_COUNTER ) + 1 ) ) . toCharArray ( ) ) ; <END_BUG> } Compiler getCompiler ( ICompilerRequestor requestor ) { } protected char [ ] getPackageName ( ) { } protected char [ ] getSource ( ) { } private int numberOfCRs ( char [ ] source ) { } }

Fix:
return CharOperation . concat ( EvaluationContext . GLOBAL_VARS_CLASS_NAME_PREFIX , Integer . toString ( ( ( EvaluationContext . VAR_CLASS_COUNTER ) + 1 ) ) . toCharArray ( ) ) ;
Buggy code:
public final class DOMUtil { private DOMUtil ( ) { } public interface NodeFilter { boolean accept ( Node node ) { } } public static NodeList listChildNodes ( Node parent , DOMUtil . NodeFilter filter , boolean recurse ) { DOMUtil . NodeListImpl matches = new DOMUtil . NodeListImpl ( ) ; NodeList children = parent . getChildNodes ( ) ; if ( children != null ) { final int len = children . getLength ( ) ; for ( int i = 0 ; i < len ; i ++ ) { Node child = children . item ( i ) ; if ( filter . accept ( child ) ) { matches . addElement ( child ) ; } if ( recurse ) { NodeList recmatches = DOMUtil . listChildNodes ( child , filter , recurse ) ; <START_BUG> final int reclength = matches . getLength ( ) ; <END_BUG> for ( int j = 0 ; j < reclength ; j ++ ) { matches . addElement ( recmatches . item ( i ) ) ; } } } } return matches ; } public static class NodeListImpl extends Vector implements NodeList { public int getLength ( ) { } public Node item ( int i ) { } } public static String getNodeAttribute ( Node node , String name ) { } public static Element getChildByTagName ( Node parent , String tagname ) { } public static Node importNode ( Node parent , Node child ) { } }

Fix:
final int reclength = recmatches . getLength ( ) ;
Buggy code:
public class Logger { private static int log_line = 0 ; public static boolean write ( String message ) { } public static boolean write ( Object sender , String message ) { <START_BUG> return Logger . write ( sender . getClass ( ) . getSimpleName ( ) , message ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return Logger . write ( String . format ( "(%<seq2seq4repair_space>10s)<seq2seq4repair_space>%s" , sender . getClass ( ) . getSimpleName ( ) , message ) ) ;
Buggy code:
public class MarkupContainerTest extends WicketTestCase { public MarkupContainerTest ( String name ) { } public void testIteratorOrder ( ) { <START_BUG> MarkupContainer container = new wicket . markup . html . WebMarkupContainer ( new EmptyPage ( ) , "test" ) ; <END_BUG> for ( int i = 0 ; i < 10 ; i ++ ) { new wicket . markup . html . WebComponent ( container , Integer . toString ( i ) ) ; } int i = 0 ; Iterator iter = container . iterator ( ) ; while ( iter . hasNext ( ) ) { Component component = ( ( Component ) ( iter . next ( ) ) ) ; assertEquals ( Integer . toString ( ( i ++ ) ) , component . getId ( ) ) ; } } }

Fix:
MarkupContainer container = new wicket . markup . html . WebMarkupContainer ( new MockPageWithOneComponent ( ) , "component" ) ;
Buggy code:
@ Configuration public class DataConfig { @ Bean public DataSource dataSource ( ) { <START_BUG> return new EmbeddedDatabaseBuilder ( ) . generateUniqueName ( true ) . setType ( H2 ) . setScriptEncoding ( "UTF-8" ) . ignoreFailedDrops ( true ) . addScript ( "schema.sql" ) . addScript ( "data.sql" ) . build ( ) ; <END_BUG> } }

Fix:
return new EmbeddedDatabaseBuilder ( ) . generateUniqueName ( true ) . setType ( H2 ) . setScriptEncoding ( "UTF-8" ) . ignoreFailedDrops ( true ) . addScript ( "schema.sql" ) . build ( ) ;
Buggy code:
public class MultiSourceTypeFactory implements TypeFactory { private static final Resources REZ = ResourceManager . getPackageResources ( MultiSourceTypeFactory . class ) ; private final MultiSourceTypeFactory m_parent ; private final HashMap m_factories = new HashMap ( ) ; private final Class m_type ; public MultiSourceTypeFactory ( final Class type ) { } public MultiSourceTypeFactory ( final MultiSourceTypeFactory parent ) { } public void register ( final String name , final TypeFactory factory ) { } public boolean canCreate ( final String name ) { } public Object create ( final String name ) throws TypeException { TypeFactory factory = findFactory ( name ) ; if ( null == factory ) { final String message = MultiSourceTypeFactory . REZ . getString ( "no-factory.error" , name ) ; throw new TypeException ( message ) ; } final Object object = factory . create ( name ) ; <START_BUG> if ( ! ( m_type . isInstance ( object ) ) ) { <END_BUG> final String message = MultiSourceTypeFactory . REZ . getString ( "mismatched-type.error" , name , object . getClass ( ) . getName ( ) ) ; throw new TypeException ( message ) ; } return object ; } private TypeFactory findFactory ( final String name ) { } protected final Class getType ( ) { } protected final TypeFactory getTypeFactory ( final String name ) { } }

Fix:
if ( ( ( m_type ) != null ) && ( ! ( m_type . isInstance ( object ) ) ) ) {
Buggy code:
public class TestCase extends Action { public TestCase ( String name ) { } static DaoInterface dao ; static KObjSchema schema ; private static KObject [ ] [ ] cases = new KObject [ 50 ] [ 50 ] ; private static String [ ] casesJson = new String [ 50 ] ; private static int [ ] caseKeys = new int [ 50 ] ; @ Override public void init ( ) { TestCase . dao = DaoManager . findDao ( "TCTestCaseDao" ) ; TestCase . schema = KObjManager . findSchema ( "TCTestCase" ) ; ArrayList < KObject > cl = TestCase . dao . queryKObj ( prop_state_0 , null , prop_id , 0 , 0 , null ) ; Iterator < KObject > it = cl . iterator ( ) ; int ks = 0 ; while ( it . hasNext ( ) ) { KObject kobj = it . next ( ) ; int type = kobj . getType ( ) ; if ( ( TestCase . cases [ type ] ) == null ) { TestCase . caseKeys [ type ] = ks ; <START_BUG> TestCase . cases [ type ] = new KObject [ 100 ] ; <END_BUG> ks = 0 ; } if ( ( kobj . getLevel ( ) ) >= 10 ) { ks ++ ; } int index = Integer . parseInt ( kobj . getProp ( "caseId" ) . toString ( ) ) ; TestCase . cases [ type ] [ index ] = kobj ; } for ( int i = 0 ; i < ( TestCase . cases . length ) ; i ++ ) { if ( ( TestCase . cases [ i ] ) != null ) { ArrayList < HashMap < String , Object > > tmp = new ArrayList < HashMap < String , Object > > ( ) ; for ( int j = 0 ; j < ( TestCase . cases [ i ] . length ) ; j ++ ) { if ( ( TestCase . cases [ i ] [ j ] ) != null ) { tmp . add ( TestCase . cases [ i ] [ j ] . getPropMap ( ) ) ; } } TestCase . casesJson [ i ] = JSON . write ( tmp ) ; } } super . init ( ) ; } @ Override public ActionMsg act ( ActionMsg msg ) { } @ Override public void exit ( ) { } private void list ( String subact , HttpServletRequest req , KObject u , HttpActionMsg msg ) { } static ArrayList < HashMap < String , Object > > checkJson ( int sys , ArrayList < HashMap < String , Object > > json ) { } public static KObject [ ] findCaseList ( int sys ) { } public static HashMap < String , Object > findCase ( int sys , int caseId ) { } }

Fix:
TestCase . cases [ type ] = new KObject [ 50 ] ;
Buggy code:
public class HomeFragment extends Fragment { private static final String TAG = "HomeFragment" ; public HomeFragment ( ) { } private Context context ; private TextView mTvFavorites ; private TextView mTvExcursions ; private TextView mTvGallery ; private ImageView mProfilePhoto ; private TextView mProfileName ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } public void updateDisplayedInformation ( ) { } private String prettyPrint ( int num ) { } private void updateProfilePhoto ( ) { } private void loadProfilePhoto ( ) { } private void updateProfileName ( ) { String mKey = getString ( preference_name ) ; SharedPreferences mPrefs = super . getActivity ( ) . getSharedPreferences ( mKey , super . getActivity ( ) . MODE_PRIVATE ) ; mKey = getString ( prefs_Name ) ; String mValue = mPrefs . getString ( mKey , "" ) ; <START_BUG> if ( ( mValue == null ) || ( mValue == "" ) ) { <END_BUG> mValue = "Profile" ; } this . mProfileName . setText ( mValue ) ; Log . d ( HomeFragment . TAG , ( "Name<seq2seq4repair_space>is:<seq2seq4repair_space>" + mValue ) ) ; } public void onProfilePhotoClicked ( View v ) { } public void onQuickStartClicked ( View v ) { } }

Fix:
if ( ( mValue == null ) || ( mValue . equals ( "" ) ) ) {
Buggy code:
public class CLI { private CommandContext ctx ; private CLI ( ) { } public static CLI newInstance ( ) { } private void checkAlreadyConnected ( ) { } private void checkNotConnected ( ) { } public CommandContext getCommandContext ( ) { } public void connect ( ) { } public void connect ( String username , char [ ] password ) { } public void connect ( String controller , String username , char [ ] password ) { } public void connect ( String controllerHost , int controllerPort , String username , char [ ] password ) { } public void connect ( String protocol , String controllerHost , int controllerPort , String username , char [ ] password ) { } public void disconnect ( ) { try { checkNotConnected ( ) ; <START_BUG> ctx . disconnectController ( ) ; <END_BUG> } finally { ctx = null ; } } public CLI . Result cmd ( String cliCommand ) { } private String constructUri ( final String protocol , final String host , final int port ) { } public class Result { private String cliCommand ; private ModelNode request ; private ModelNode response ; private boolean isSuccess = false ; private boolean isLocalCommand = false ; Result ( String cliCommand , ModelNode request , ModelNode response ) { } Result ( String cliCommand , int exitCode ) { } public String getCliCommand ( ) { } public ModelNode getRequest ( ) { } public ModelNode getResponse ( ) { } public boolean isSuccess ( ) { } public boolean isLocalCommand ( ) { } } }

Fix:
ctx . terminateSession ( ) ;
Buggy code:
@ Controller @ RequestMapping ( "//configuration//settings" ) @ SessionAttributes ( "defaultConfiguration" ) @ PreAuthorize ( "hasRole('ROLE_CAN_MANAGE_SYSTEM_SETTINGS')" ) public class SystemSettingsController { protected final SanitizedLogger log = new SanitizedLogger ( SystemSettingsController . class ) ; @ Autowired private RoleService roleService = null ; @ Autowired private DefaultConfigService defaultConfigService = null ; @ Autowired private ReportService reportService = null ; @ Autowired private ApplicationService applicationService ; @ Autowired ( required = false ) LicenseService licenseService ; @ InitBinder public void setAllowedFields ( WebDataBinder dataBinder ) { } @ ModelAttribute public List < Role > populateRoles ( ) { } @ ModelAttribute ( "dashboardReports" ) public List < Report > populateDashboardReportTypes ( ) { } @ ModelAttribute ( "applicationReports" ) public List < Report > populateApplicationReportTypes ( ) { } @ ModelAttribute ( "teamReports" ) public List < Report > populateTeamReportTypes ( ) { } @ RequestMapping ( method = RequestMethod . GET ) public String setupForm ( Model model , HttpServletRequest request ) { } @ RequestMapping ( method = RequestMethod . POST ) public String processForm ( @ ModelAttribute DefaultConfiguration configModel , BindingResult bindingResult , Model model , HttpServletRequest request ) { } private void addModelAttributes ( Model model , HttpServletRequest request ) { model . addAttribute ( "isEnterprise" , EnterpriseTest . isEnterprise ( ) ) ; DefaultConfiguration configuration = defaultConfigService . loadCurrentConfiguration ( ) ; if ( ( ( configuration . getProxyPassword ( ) ) != null ) && ( ! ( configuration . getProxyPassword ( ) . isEmpty ( ) ) ) ) { configuration . setProxyPassword ( MASKED_PASSWORD ) ; } if ( ( ( configuration . getActiveDirectoryCredentials ( ) ) != null ) && ( ! ( configuration . getActiveDirectoryCredentials ( ) . isEmpty ( ) ) ) ) { configuration . setActiveDirectoryCredentials ( MASKED_PASSWORD ) ; } model . addAttribute ( "applicationCount" , applicationService . getApplicationCount ( ) ) ; model . addAttribute ( "licenseCount" , ( ( licenseService ) == null ? 0 : licenseService . getAppLimit ( ) ) ) ; <START_BUG> model . addAttribute ( "licenseExpirationDate" , ( ( licenseService ) == null ? 0 : licenseService ( ) ) ) ; <END_BUG> model . addAttribute ( "defaultConfiguration" , configuration ) ; model . addAttribute ( "successMessage" , ControllerUtils . getSuccessMessage ( request ) ) ; } }

Fix:
model . addAttribute ( "licenseExpirationDate" , ( ( licenseService ) == null ? 0 : licenseService . getAppLimit ( ) ) ) ;
Buggy code:
public class XLoadImageViewAsyncTask extends AsyncTask < Void , Void , Void > { private String path ; private ImageView imageView ; public XLoadImageViewAsyncTask ( String path , ImageView imageView ) { } @ Override protected Void doInBackground ( Void ... params ) { } private Bitmap getImage ( String imagePath ) { } private Options getOptionsInCalculate ( String resourcePath ) { BitmapFactory . Options opt = new BitmapFactory . Options ( ) ; opt . inJustDecodeBounds = true ; BitmapFactory . decodeFile ( resourcePath , opt ) ; <START_BUG> float width_divide_height = ( opt . outHeight ) // ( opt . outWidth ) ; <END_BUG> double cal_width = 0 ; double cal_height = 0 ; if ( width_divide_height > ( XCameraConst . WIDTH_DIVIDE_HEIGHT ) ) { if ( ( opt . outWidth ) > ( XCameraConst . SCREEN_WIDTH ) ) { cal_width = XCameraConst . SCREEN_WIDTH ; cal_height = cal_width * ( ( opt . outHeight ) // ( opt . outWidth ) ) ; } else { cal_height = opt . outHeight ; cal_width = opt . outWidth ; } opt . inSampleSize = ( ( int ) ( ( opt . outHeight ) // cal_height ) ) ; } else { if ( ( opt . outHeight ) > ( XCameraConst . SCREEN_HEIGHT ) ) { cal_height = XCameraConst . SCREEN_HEIGHT ; cal_width = cal_height * ( ( opt . outWidth ) // ( opt . outHeight ) ) ; } else { cal_height = opt . outHeight ; cal_width = opt . outWidth ; } opt . inSampleSize = ( ( int ) ( ( opt . outWidth ) // cal_width ) ) ; } opt . outHeight = ( ( int ) ( cal_height ) ) ; opt . outWidth = ( ( int ) ( cal_width ) ) ; opt . inSampleSize = opt . inSampleSize ; opt . inJustDecodeBounds = false ; return opt ; } }

Fix:
float width_divide_height = ( opt . outWidth ) // ( opt . outHeight ) ;
Buggy code:
public final class JDBCCustomFinderQuery implements JDBCQueryCommand { private final Logger log ; private final Method finderMethod ; private final JDBCReadAheadMetaData readAheadMetaData ; private final ReadAheadCache readAheadCache ; private final JDBCStoreManager manager ; public JDBCCustomFinderQuery ( JDBCStoreManager manager , Method finderMethod ) { } public JDBCStoreManager getSelectManager ( ) { } public Collection execute ( Method unused , Object [ ] args , CmpEntityBeanContext ctx , EntityProxyFactory factory ) throws FinderException { try { Object value = finderMethod . invoke ( ctx . getComponent ( ) . getCache ( ) . get ( ctx . getPrimaryKey ( ) ) , args ) ; if ( value instanceof Enumeration ) { Enumeration enumeration = ( ( Enumeration ) ( value ) ) ; List result = new ArrayList ( ) ; while ( enumeration . hasMoreElements ( ) ) { result . add ( enumeration . nextElement ( ) ) ; } cacheResults ( result ) ; return Util . getEntityCollection ( factory , result ) ; } else if ( value instanceof Collection ) { List result ; if ( value instanceof List ) result = ( ( List ) ( value ) ) ; else result = new ArrayList ( ( ( Collection ) ( value ) ) ) ; cacheResults ( result ) ; return Util . getEntityCollection ( factory , result ) ; } else { <START_BUG> return Collections . singleton ( factory . getEntityObject ( value ) ) ; <END_BUG> } } catch ( IllegalAccessException e ) { log . error ( ( "Error<seq2seq4repair_space>invoking<seq2seq4repair_space>custom<seq2seq4repair_space>finder<seq2seq4repair_space>" + ( finderMethod . getName ( ) ) ) , e ) ; throw new FinderException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>access<seq2seq4repair_space>finder<seq2seq4repair_space>implementation:<seq2seq4repair_space>" + ( finderMethod . getName ( ) ) ) ) ; } catch ( IllegalArgumentException e ) { log . error ( ( "Error<seq2seq4repair_space>invoking<seq2seq4repair_space>custom<seq2seq4repair_space>finder<seq2seq4repair_space>" + ( finderMethod . getName ( ) ) ) , e ) ; throw new FinderException ( ( ( "Illegal<seq2seq4repair_space>arguments<seq2seq4repair_space>for<seq2seq4repair_space>finder<seq2seq4repair_space>" + "implementation:<seq2seq4repair_space>" ) + ( finderMethod . getName ( ) ) ) ) ; } catch ( InvocationTargetException e ) { Throwable ex = e . getTargetException ( ) ; if ( ex instanceof FinderException ) { throw ( ( FinderException ) ( ex ) ) ; } else { throw new FinderException ( ( ( ( "Errror<seq2seq4repair_space>invoking<seq2seq4repair_space>cutom<seq2seq4repair_space>finder<seq2seq4repair_space>" + ( finderMethod . getName ( ) ) ) + ":<seq2seq4repair_space>" ) + ex ) ) ; } } } private void cacheResults ( List listOfPKs ) { } }

Fix:
return Collections . singleton ( ( value != null ? factory . getEntityObject ( value ) : null ) ) ;