nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ElementCache extends OverflowingLRUCache { IJavaElement spaceLimitParent = null ; public ElementCache ( int size ) { } public ElementCache ( int size , int overflow ) { } protected boolean close ( LRUCache . LRUCacheEntry entry ) { } protected void ensureSpaceLimit ( Object info , IJavaElement parent ) { <START_BUG> int childrenSize = ( ( JavaElementInfo ) ( info ) ) . children . length ; <END_BUG> int spaceNeeded = 1 + ( ( int ) ( ( 1 + ( this . loadFactor ) ) * ( childrenSize + ( this . overflow ) ) ) ) ; if ( ( this . spaceLimit ) < spaceNeeded ) { shrink ( ) ; setSpaceLimit ( spaceNeeded ) ; this . spaceLimitParent = parent ; } } protected LRUCache newInstance ( int size , int newOverflow ) { } protected void resetSpaceLimit ( int defaultLimit , IJavaElement parent ) { } }

Fix:
int childrenSize = ( ( JavaElementInfo ) ( info ) ) . getChildren ( ) . length ;
Buggy code:
public abstract class PropPanelClassifier extends PropPanelNamespace { protected JPanel _modifiersPanel ; protected JScrollPane extendsScroll ; protected JScrollPane implementsScroll ; protected JScrollPane derivedScroll ; protected JScrollPane opsScroll ; protected JScrollPane attrScroll ; protected JScrollPane connectScroll ; protected JScrollPane innerScroll ; public PropPanelClassifier ( String name , int columns ) { } public PropPanelClassifier ( String name , ImageIcon icon , int columns ) { } public void addOperation ( ) { } public void addAttribute ( ) { } public void addAssociation ( ) { } public void addGeneralization ( ) { } public void removeElement ( ) { Object target = getTarget ( ) ; if ( target instanceof MClassifier ) { MClassifier cls = ( ( MClassifier ) ( target ) ) ; Object newTarget = cls . getNamespace ( ) ; <START_BUG> SINGLETON . remove ( cls ) ; <END_BUG> if ( newTarget != null ) { navigateTo ( newTarget ) ; } TheInstance . getNavPane ( ) . forceUpdate ( ) ; } } protected boolean isAcceptibleBaseMetaClass ( String baseClass ) { } }

Fix:
UmlFactory . getFactory ( ) . getCore ( ) . removeClassifier ( cls ) ;
Buggy code:
class ColumnDecoder { public static final ByteBuffer DEFAULT_KEY_NAME = ByteBufferUtil . bytes ( "KEY" ) ; private class CFamMeta { String comparator ; String defaultValidator ; ByteBuffer keyAlias ; String keyValidator ; Map < ByteBuffer , String > columnMeta = new HashMap < ByteBuffer , String > ( ) ; private CFamMeta ( CfDef cf ) { } } private final Map < String , ColumnDecoder . CFamMeta > metadata = new HashMap < String , ColumnDecoder . CFamMeta > ( ) ; public ColumnDecoder ( List < KsDef > defs ) { } protected AbstractJdbcType < ? > getComparator ( String keyspace , String columnFamily ) { } private AbstractJdbcType < ? > getNameType ( String keyspace , String columnFamily , ByteBuffer name ) { ColumnDecoder . CFamMeta cf = metadata . get ( String . format ( "%s.%s" , keyspace , columnFamily ) ) ; try { if ( ByteBufferUtil . string ( name ) . equalsIgnoreCase ( ByteBufferUtil . string ( cf . keyAlias ) ) ) <START_BUG> return AsciiTerm . instance ; <END_BUG> } catch ( CharacterCodingException e ) { } return TypesMap . getTermForComparator ( cf . comparator ) ; } private AbstractJdbcType < ? > getValueType ( String keyspace , String columnFamily , ByteBuffer name ) { } public AbstractJdbcType < ? > getKeyValidator ( String keyspace , String columnFamily ) { } public String colNameAsString ( String keyspace , String columnFamily , ByteBuffer name ) { } public TypedColumn makeCol ( String keyspace , String columnFamily , Column column ) { } public TypedColumn makeKeyColumn ( String keyspace , String columnFamily , byte [ ] key ) throws SQLNonTransientException { } }

Fix:
return JdbcAscii . instance ;
Buggy code:
public class DefaultProblemFactory implements IProblemFactory { public String [ ] messageTemplates ; private Locale locale ; private static String [ ] DEFAULT_LOCALE_TEMPLATES ; public DefaultProblemFactory ( Locale loc ) { } public IProblem createProblem ( char [ ] originatingFileName , int problemId , String [ ] arguments , int severity , int startPosition , int endPosition , int lineNumber ) { } public Locale getLocale ( ) { } public final String getLocalizedMessage ( int id , String [ ] problemArguments ) { } public final String localizedMessage ( IProblem problem ) { } public static String [ ] loadMessageTemplates ( Locale loc ) { <START_BUG> ResourceBundle bundle = ResourceBundle . getBundle ( "org.eclipse.jdt.internal.compiler.problem.Messages" , loc ) ; <END_BUG> String [ ] templates = new String [ 500 ] ; for ( int i = 0 , max = templates . length ; i < max ; i ++ ) { try { templates [ i ] = bundle . getString ( String . valueOf ( i ) ) ; } catch ( MissingResourceException e ) { } } return templates ; } public DefaultProblemFactory ( ) { } }

Fix:
ResourceBundle bundle = ResourceBundle . getBundle ( "org.eclipse.jdt.internal.compiler.problem.messages" , loc ) ;
Buggy code:
public abstract class AbstractCheckBoxModel implements IModel < Boolean > { private static final long serialVersionUID = 1L ; public void detach ( ) { } public abstract boolean isSelected ( ) { } public abstract void select ( ) { } public abstract void unselect ( ) { } public final Boolean getObject ( ) { <START_BUG> return Boolean . valueOf ( isSelected ( ) ) ; <END_BUG> } public final void setObject ( Boolean object ) { } @ Deprecated public final Object getObject ( Component component ) { } @ Deprecated public final boolean isSelected ( Component component ) { } @ Deprecated public final void setObject ( Component component , Object object ) { } @ Deprecated public final void setSelected ( Component component , boolean sel ) { } }

Fix:
return isSelected ( ) ;
Buggy code:
public class Preparador { public static void preparar ( Fatura fatura ) { } private static void prepararComprasParceladas ( Fatura fatura ) { } private static void prepararComprasDolar ( Fatura fatura ) { boolean emAberto = fatura . isEmAberto ( ) ; BigDecimal cotacao ; if ( emAberto ) { cotacao = Preparador . obterCotacao ( ) ; } else { cotacao = fatura . getCotacaoDolar ( ) ; } Transacao maiorTransacao = null ; BigDecimal somaConversao = new BigDecimal ( 0 ) ; for ( Transacao transacao : fatura . getTransacoes ( ) ) { if ( transacao . isDolar ( ) ) { BigDecimal valorConvertido = transacao . getValor ( ) . multiply ( cotacao ) ; valorConvertido = valorConvertido . setScale ( 2 , RoundingMode . HALF_UP ) ; transacao . setValorConvertido ( valorConvertido ) ; if ( emAberto ) { String descricao = ( ( ( transacao . getDescricao ( ) ) + "<seq2seq4repair_space>[previsao<seq2seq4repair_space>-<seq2seq4repair_space>tx<seq2seq4repair_space>" ) + cotacao ) + "]" ; transacao . setDescricao ( descricao ) ; } else { somaConversao = somaConversao . add ( valorConvertido ) ; if ( ( maiorTransacao == null ) || ( ( valorConvertido . compareTo ( maiorTransacao . getValorConvertido ( ) ) ) > 0 ) ) { maiorTransacao = transacao ; } } } } <START_BUG> if ( ! emAberto ) { <END_BUG> BigDecimal diferenca = fatura . getTotalDolarConvertido ( ) . subtract ( somaConversao ) ; BigDecimal novoValorDoMaior = maiorTransacao . getValorConvertido ( ) . add ( diferenca ) ; maiorTransacao . setValorConvertido ( novoValorDoMaior ) ; } } private static Transacao clonarTransacao ( Transacao transacao ) { } private static BigDecimal obterCotacao ( ) { } }

Fix:
if ( ( ! emAberto ) && ( maiorTransacao != null ) ) {
Buggy code:
public class LRUMemoryMapState < T > implements ITupleCollection , Snapshottable < T > , MapState < T > { LRUMemoryMapState . LRUMemoryMapStateBacking < OpaqueValue > _backing ; SnapshottableMap < T > _delegate ; public LRUMemoryMapState ( int cacheSize , String id ) { } public T update ( ValueUpdater updater ) { } public void set ( T o ) { } public T get ( ) { } public void beginCommit ( Long txid ) { } public void commit ( Long txid ) { } public Iterator < List < Object > > getTuples ( ) { } public List < T > multiUpdate ( List < List < Object > > keys , List < ValueUpdater > updaters ) { } public void multiPut ( List < List < Object > > keys , List < T > vals ) { } public List < T > multiGet ( List < List < Object > > keys ) { } public static class Factory implements StateFactory { String _id ; int _maxSize ; public Factory ( int maxSize ) { } @ Override public State makeState ( Map conf , IMetricsContext metrics , int partitionIndex , int numPartitions ) { <START_BUG> return new LRUMemoryMapState ( _maxSize , _id ) ; <END_BUG> } } static ConcurrentHashMap < String , Map < List < Object > , Object > > _dbs = new ConcurrentHashMap < String , Map < List < Object > , Object > > ( ) ; static class LRUMemoryMapStateBacking < T > implements ITupleCollection , IBackingMap < T > { public static void clearAll ( ) { } Map < List < Object > , T > db ; Long currTx ; public LRUMemoryMapStateBacking ( int cacheSize , String id ) { } @ Override public List < T > multiGet ( List < List < Object > > keys ) { } @ Override public void multiPut ( List < List < Object > > keys , List < T > vals ) { } @ Override public Iterator < List < Object > > getTuples ( ) { } } }

Fix:
return new LRUMemoryMapState ( _maxSize , ( ( _id ) + partitionIndex ) ) ;
Buggy code:
class ProgressBarTab extends RangeTab { ProgressBar progressBar1 ; Group progressBarGroup ; Button smoothButton ; Button indeterminateButton ; ProgressBarTab ( ControlExample instance ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { <START_BUG> return new String [ ] { "ToolTipText" } ; <END_BUG> } public String getShortTabText ( ) { } String getTabText ( ) { } void setExampleWidgetState ( ) { } void setWidgetMaximum ( ) { } void setWidgetMinimum ( ) { } void setWidgetSelection ( ) { } void updateSpinners ( ) { } }

Fix:
return new String [ ] { "Selection" , "ToolTipText" } ;
Buggy code:
public class PureForkJoin extends RecursiveTask < Boolean > { private static final long serialVersionUID = - 1883115459616562727L ; private BigInteger primeNumber ; private BigInteger from ; private BigInteger to ; static BigInteger lengthForThread = sqrt . divide ( numberOfThread ) ; public PureForkJoin ( BigInteger src , BigInteger start , BigInteger length ) { } private boolean computeDirectly ( ) { } @ Override protected Boolean compute ( ) { BigInteger tmp = to . subtract ( from ) ; if ( ( tmp . compareTo ( PureForkJoin . lengthForThread ) ) <= 0 ) { return computeDirectly ( ) ; } <START_BUG> BigInteger middle = to . divide ( two ) ; <END_BUG> PureForkJoin leftJoin = new PureForkJoin ( primeNumber , from , middle ) ; PureForkJoin rightJoin = new PureForkJoin ( primeNumber , middle . add ( BigInteger . ONE ) , to ) ; return ( leftJoin . compute ( ) ) && ( rightJoin . compute ( ) ) ; } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
BigInteger middle = to . add ( from ) . divide ( two ) ;
Buggy code:
public class TransactionManagementMergingProcessor extends AbstractMergingProcessor < EJBComponentDescription > { public TransactionManagementMergingProcessor ( ) { } @ Override protected void handleAnnotations ( final DeploymentUnit deploymentUnit , final EEApplicationClasses applicationClasses , final DeploymentReflectionIndex deploymentReflectionIndex , final Class < ? > componentClass , final EJBComponentDescription componentConfiguration ) throws DeploymentUnitProcessingException { } @ Override protected void handleDeploymentDescriptor ( final DeploymentUnit deploymentUnit , final DeploymentReflectionIndex deploymentReflectionIndex , final Class < ? > componentClass , final EJBComponentDescription componentConfiguration ) throws DeploymentUnitProcessingException { final EnterpriseBeanMetaData beanMetaData = componentConfiguration . getDescriptorData ( ) ; <START_BUG> if ( ( beanMetaData == null ) || ( beanMetaData . isEntity ( ) ) ) { <END_BUG> return ; } final TransactionManagementType type = componentConfiguration . getDescriptorData ( ) . getTransactionType ( ) ; if ( type != null ) { componentConfiguration . setTransactionManagementType ( type ) ; } } }

Fix:
if ( ( componentConfiguration . isEntity ( ) ) || ( beanMetaData == null ) ) {
Buggy code:
public class TestPlanGui extends AbstractJMeterGuiComponent { private static final long serialVersionUID = 240L ; private final JCheckBox functionalMode ; private final JCheckBox serializedMode ; private final JCheckBox tearDownOnShutdown ; private final ArgumentsPanel argsPanel ; private final FileListPanel browseJar ; public TestPlanGui ( ) { } @ Override public JPopupMenu createPopupMenu ( ) { JPopupMenu pop = new JPopupMenu ( ) ; JMenu addMenu = new JMenu ( JMeterUtils . getResString ( "add" ) ) ; addMenu . add ( MenuFactory . makeMenu ( THREADS , ADD ) ) ; addMenu . add ( MenuFactory . makeMenu ( FRAGMENTS , ADD ) ) ; addMenu . add ( MenuFactory . makeMenu ( CONFIG_ELEMENTS , ADD ) ) ; addMenu . add ( MenuFactory . makeMenu ( TIMERS , ADD ) ) ; addMenu . add ( MenuFactory . makeMenu ( PRE_PROCESSORS , ADD ) ) ; addMenu . add ( MenuFactory . makeMenu ( POST_PROCESSORS , ADD ) ) ; addMenu . add ( MenuFactory . makeMenu ( ASSERTIONS , ADD ) ) ; addMenu . add ( MenuFactory . makeMenu ( LISTENERS , ADD ) ) ; pop . add ( addMenu ) ; MenuFactory . addPasteResetMenu ( pop ) ; <START_BUG> MenuFactory . addFileMenu ( pop ) ; <END_BUG> return pop ; } @ Override public TestElement createTestElement ( ) { } @ Override public void modifyTestElement ( TestElement plan ) { } @ Override public String getLabelResource ( ) { } @ Override public Collection < String > getMenuCategories ( ) { } @ Override public void configure ( TestElement el ) { } private void init ( ) { } @ Override public void clearGui ( ) { } }

Fix:
MenuFactory . addFileMenu ( pop , false ) ;
Buggy code:
public class RaavareDAO implements IRaavareDAO { private TextReader txt ; public RaavareDAO ( TextReader txt ) throws FileNotFoundException { } @ Override public RaavareDTO getRaavare ( int raavareId ) throws DALException { } @ Override public List < RaavareDTO > getRaavareList ( ) throws DALException { List < RaavareDTO > list = new ArrayList < RaavareDTO > ( ) ; <START_BUG> ResultSet rs = Connector . doQuery ( txt . getCommand ( 28 ) ) ; <END_BUG> try { while ( rs . next ( ) ) { list . add ( new RaavareDTO ( rs . getInt ( "raavare_id" ) , rs . getString ( "raavare_navn" ) , rs . getString ( "leverandoer" ) ) ) ; } } catch ( SQLException e ) { throw new DALException ( e ) ; } return list ; } @ Override public void createRaavare ( RaavareDTO raavare ) throws DALException { } @ Override public void updateRaavare ( RaavareDTO raavare ) throws DALException { } }

Fix:
ResultSet rs = Connector . doQuery ( txt . getCommand ( 29 ) ) ;
Buggy code:
@ Mod ( name = "Ice<seq2seq4repair_space>and<seq2seq4repair_space>Shadow<seq2seq4repair_space>2" , modid = IceAndShadow2 . MODID , dependencies = "required-after:FML;" , version = IceAndShadow2 . VERSION ) public class IceAndShadow2 { public static final String MODID = "IceAndShadow2" ; public static final String VERSION = "Pre-Alpha<seq2seq4repair_space>5" ; public static final int CONFIG_MAJ = 2 ; public static final int CONFIG_MIN = 1 ; private static IaSConfigManager cfg ; private static Logger logger ; private static boolean acceptRegistration = false ; @ Instance ( IceAndShadow2 . MODID ) public static IceAndShadow2 instance ; public static Logger getLogger ( ) { } private static List toPreRegister ; private static List toPostRegister ; public static Collection getPreRegistrationHandlers ( ) { } public static Collection getPostRegistrationHandlers ( ) { <START_BUG> return Collections . unmodifiableList ( IceAndShadow2 . toPreRegister ) ; <END_BUG> } @ EventHandler public void preInit ( FMLPreInitializationEvent event ) { } @ EventHandler public void init ( FMLInitializationEvent event ) { } @ EventHandler public void postInit ( FMLPostInitializationEvent event ) { } private void addToolMaterials ( ) { } private void addPostInitHandlers ( ) { } @ EventHandler public void serverLoad ( FMLServerStartingEvent event ) { } public static boolean isRegistrationPublic ( ) { } }

Fix:
return Collections . unmodifiableList ( IceAndShadow2 . toPostRegister ) ;
Buggy code:
public class JoranConfigurator extends ConfiguratorBase { Interpreter joranInterpreter ; LoggerRepository repository ; boolean listAppnderAttached = false ; public JoranConfigurator ( ) { } protected interface ParseAction { void parse ( final SAXParser parser , final DefaultHandler handler ) throws IOException , SAXException { } } public final void doConfigure ( final URL url , final LoggerRepository repository ) { } public final void doConfigure ( final String filename , final LoggerRepository repository ) { } public final void doConfigure ( final File file , final LoggerRepository repository ) { } public final void doConfigure ( final InputSource source , final LoggerRepository repository ) { } public final void doConfigure ( final InputStream stream , final LoggerRepository repository ) { } protected void doConfigure ( final JoranConfigurator . ParseAction action , final LoggerRepository repository ) { } public List getErrorList ( ) { } protected void selfInitialize ( ) { RuleStore rs = new SimpleRuleStore ( ) ; rs . addRule ( new Pattern ( "configuration" ) , new ConfigurationAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//substitutionProperty" ) , new SubstitutionPropertyAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//repositoryProperty" ) , new RepositoryPropertyAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//plugin" ) , new PluginAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//logger" ) , new LoggerAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//logger//level" ) , new LevelAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//logger//priority" ) , new PriorityAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//root" ) , new RootLoggerAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//root//level" ) , new LevelAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//root//priority" ) , new PriorityAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//logger//appender-ref" ) , new AppenderRefAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//root//appender-ref" ) , new AppenderRefAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//appender" ) , new AppenderAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//appender//layout" ) , new LayoutAction ( ) ) ; rs . addRule ( new Pattern ( "configuration//appender//layout//conversionRule" ) , new ConversionRuleAction ( ) ) ; <START_BUG> rs . addRule ( new Pattern ( "log4j:configuration//jndiSubstitutionProperty" ) , new JndiSubstitutionPropertyAction ( ) ) ; <END_BUG> rs . addRule ( new Pattern ( "configuration//newRule" ) , new NewRuleAction ( ) ) ; rs . addRule ( new Pattern ( "*//param" ) , new ParamAction ( ) ) ; joranInterpreter = new Interpreter ( rs ) ; joranInterpreter . addImplicitAction ( new NestComponentIA ( ) ) ; ExecutionContext ec = joranInterpreter . getExecutionContext ( ) ; HashMap omap = ec . getObjectMap ( ) ; omap . put ( APPENDER_BAG , new HashMap ( ) ) ; } public ExecutionContext getExecutionContext ( ) { } }

Fix:
rs . addRule ( new Pattern ( "configuration//jndiSubstitutionProperty" ) , new JndiSubstitutionPropertyAction ( ) ) ;
Buggy code:
public class JPADependencyProcessor implements DeploymentUnitProcessor { private static final ModuleIdentifier JAVAX_PERSISTENCE_API_ID = ModuleIdentifier . create ( "javax.persistence.api" ) ; private static final ModuleIdentifier JBOSS_AS_JPA_ID = ModuleIdentifier . create ( "org.jboss.as.jpa" ) ; private static final ModuleIdentifier JBOSS_AS_JPA_SPI_ID = ModuleIdentifier . create ( "org.jboss.as.jpa.spi" ) ; private static final ModuleIdentifier JAVASSIST_ID = ModuleIdentifier . create ( "org.javassist" ) ; private static final ModuleIdentifier HIBERNATE_3_PROVIDER = ModuleIdentifier . create ( "org.jboss.as.jpa.hibernate" , "3" ) ; private static final String HIBERNATE3_PROVIDER_ADAPTOR = "org.jboss.as.jpa.hibernate3.HibernatePersistenceProviderAdaptor" ; private static final ModuleIdentifier JBOSS_AS_NAMING_ID = ModuleIdentifier . create ( "org.jboss.as.naming" ) ; private static final ModuleIdentifier JBOSS_JANDEX_ID = ModuleIdentifier . create ( "org.jboss.jandex" ) ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void addDependency ( ModuleSpecification moduleSpecification , ModuleLoader moduleLoader , DeploymentUnit deploymentUnit , ModuleIdentifier ... moduleIdentifiers ) { for ( ModuleIdentifier moduleIdentifier : moduleIdentifiers ) { <START_BUG> moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , moduleIdentifier , false , false , false , false ) ) ; <END_BUG> ROOT_LOGGER . debugf ( "added<seq2seq4repair_space>%s<seq2seq4repair_space>dependency<seq2seq4repair_space>to<seq2seq4repair_space>%s" , moduleIdentifier , deploymentUnit . getName ( ) ) ; } } private void addOptionalDependency ( ModuleSpecification moduleSpecification , ModuleLoader moduleLoader , DeploymentUnit deploymentUnit , ModuleIdentifier ... moduleIdentifiers ) { } @ Override public void undeploy ( DeploymentUnit context ) { } private void addPersistenceProviderModuleDependencies ( DeploymentPhaseContext phaseContext , ModuleSpecification moduleSpecification , ModuleLoader moduleLoader ) throws DeploymentUnitProcessingException { } private static void addPUServiceDependencyToComponents ( final Collection < ComponentDescription > components , final PersistenceUnitMetadataHolder holder ) { } private int loadPersistenceUnits ( final ModuleSpecification moduleSpecification , final ModuleLoader moduleLoader , final DeploymentUnit deploymentUnit , final Set < String > moduleDependencies , final PersistenceUnitMetadataHolder holder ) throws DeploymentUnitProcessingException { } private void addHibernate3AdaptorToDeployment ( final ModuleLoader moduleLoader , final DeploymentUnit deploymentUnit ) { } }

Fix:
moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , moduleIdentifier , false , false , true , false ) ) ;
Buggy code:
final class RegistryReader extends org . eclipse . ui . internal . registry . RegistryReader { private static final String TAG_ROOT = Persistence . PACKAGE_BASE ; private List commandElements ; private IPluginRegistry pluginRegistry ; private List unmodifiableCommandElements ; RegistryReader ( IPluginRegistry pluginRegistry ) { } List getCommandElements ( ) { } void load ( ) { } protected boolean readElement ( IConfigurationElement element ) { String name = element . getName ( ) ; if ( TAG_COMMAND . equals ( name ) ) return readCommand ( element ) ; <START_BUG> return false ; <END_BUG> } private String getPluginId ( IConfigurationElement element ) { } private boolean readCommand ( IConfigurationElement element ) { } }

Fix:
return true ;
Buggy code:
public final class XmlPullParser implements IXmlPullParser { public static final String STYLE = "style" ; public static final String SCRIPT = "script" ; private XmlReader xmlReader ; private FullyBufferedReader input ; private String skipUntilText ; private CharSequence lastText ; private CharSequence doctype ; private HttpTagType lastType = HttpTagType . NOT_INITIALIZED ; private XmlTag lastTag ; public XmlPullParser ( ) { } public final String getEncoding ( ) { } public final CharSequence getXmlDeclaration ( ) { } public final CharSequence getDoctype ( ) { } public final CharSequence getInputFromPositionMarker ( final int toPos ) { } public final CharSequence getInput ( final int fromPos , final int toPos ) { } private final void skipUntil ( ) throws ParseException { } private String getLineAndColumnText ( ) { } public final HttpTagType next ( ) throws ParseException { } protected void specialTagHandling ( String tagText , final int openBracketIndex , int closeBracketIndex ) throws ParseException { } public final XmlTag getElement ( ) { } public final CharSequence getString ( ) { } public final XmlTag nextTag ( ) throws ParseException { } private int findChar ( final char ch , int startIndex ) { } public void parse ( final CharSequence string ) throws IOException , ResourceStreamNotFoundException { } public void parse ( final InputStream in ) throws IOException , ResourceStreamNotFoundException { } public void parse ( final InputStream inputStream , final String encoding ) throws IOException , ResourceStreamNotFoundException { } public final void setPositionMarker ( ) { } public final void setPositionMarker ( final int pos ) { } @ Override public String toString ( ) { } private boolean parseTagText ( final XmlTag tag , final String tagText ) throws ParseException { final int tagTextLength = tagText . length ( ) ; final TagNameParser tagnameParser = new TagNameParser ( tagText ) ; if ( tagnameParser . matcher ( ) . lookingAt ( ) ) { tag . name = tagnameParser . getName ( ) ; tag . namespace = tagnameParser . getNamespace ( ) ; int pos = tagnameParser . matcher ( ) . end ( 0 ) ; if ( pos == tagTextLength ) { return true ; } final VariableAssignmentParser attributeParser = new VariableAssignmentParser ( tagText ) ; while ( attributeParser . matcher ( ) . find ( pos ) ) { String value = attributeParser . getValue ( ) ; if ( value == null ) { value = "" ; } pos = attributeParser . matcher ( ) . end ( 0 ) ; if ( ( value . startsWith ( "\"" ) ) || ( value . startsWith ( "\'" ) ) ) { value = value . substring ( 1 , ( ( value . length ( ) ) - 1 ) ) ; } value = value . trim ( ) ; final String key = attributeParser . getKey ( ) ; <START_BUG> if ( null != ( ( ( TagAttributes ) ( tag . getAttributes ( ) ) ) . putInternal ( key , value ) ) ) { <END_BUG> throw new ParseException ( ( ( "Same<seq2seq4repair_space>attribute<seq2seq4repair_space>found<seq2seq4repair_space>twice:<seq2seq4repair_space>" + key ) + ( getLineAndColumnText ( ) ) ) , input . getPosition ( ) ) ; } if ( pos == tagTextLength ) { return true ; } } return true ; } return false ; } }

Fix:
if ( null != ( tag . getAttributes ( ) . put ( key , value ) ) ) {
Buggy code:
public class EditCommand extends TaskRestorableCommand { protected String details ; protected int index ; public EditCommand ( TasmaUserInterface userInterface , TaskCollection collection , List < Task > state , int index , String details ) { } @ Override public void execute ( ) throws Exception { if ( details . equals ( "" ) ) { userInterface . editCmdDisplay ( String . format ( "edit<seq2seq4repair_space>%d<seq2seq4repair_space>%s" , index , task . toString ( ) ) ) ; } else { Parser parser = new Parser ( ) ; Task updatedTask = parser . parse ( details ) ; if ( updatedTask == null ) { } else { if ( ( updatedTask . getDetails ( ) ) != null ) { task . setDetails ( updatedTask . getDetails ( ) ) ; } if ( ( updatedTask . getLocation ( ) ) != null ) { task . setLocation ( updatedTask . getLocation ( ) ) ; } if ( ( updatedTask . getStartDateTime ( ) ) != null ) { task . setStartDateTime ( updatedTask . getStartDateTime ( ) ) ; } if ( ( updatedTask . getEndDateTime ( ) ) != null ) { task . setEndDateTime ( updatedTask . getEndDateTime ( ) ) ; } <START_BUG> userInterface . displayMessage ( String . format ( COMMAND_EDIT_SUCCESS ) ) ; <END_BUG> } } ListCommand listCommand = new ListCommand ( userInterface , collection , state ) ; listCommand . execute ( ) ; } }

Fix:
userInterface . displayMessage ( String . format ( COMMAND_EDIT_SUCCESS , task . getDetails ( ) ) ) ;
Buggy code:
public class EulerIntegratorTest extends TestCase { public EulerIntegratorTest ( String name ) { } public void testDimensionCheck ( ) { } public void testDecreasingSteps ( ) throws DerivativeException , IntegratorException { TestProblemAbstract [ ] problems = TestProblemFactory . getProblems ( ) ; for ( int k = 0 ; k < ( problems . length ) ; ++ k ) { double previousError = Double . NaN ; for ( int i = 4 ; i < 10 ; ++ i ) { <START_BUG> TestProblemAbstract pb = ( ( TestProblemAbstract ) ( problems [ k ] . clone ( ) ) ) ; <END_BUG> double step = ( ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ) * ( Math . pow ( 2.0 , ( - i ) ) ) ; FirstOrderIntegrator integ = new EulerIntegrator ( step ) ; TestProblemHandler handler = new TestProblemHandler ( pb , integ ) ; integ . addStepHandler ( handler ) ; EventHandler [ ] functions = pb . getEventsHandlers ( ) ; for ( int l = 0 ; l < ( functions . length ) ; ++ l ) { integ . addEventHandler ( functions [ l ] , Double . POSITIVE_INFINITY , ( 1.0E-6 * step ) , 1000 ) ; } double stopTime = integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; if ( ( functions . length ) == 0 ) { assertEquals ( pb . getFinalTime ( ) , stopTime , 1.0E-10 ) ; } double error = handler . getMaximalValueError ( ) ; if ( i > 4 ) { assertTrue ( ( error < ( Math . abs ( previousError ) ) ) ) ; } previousError = error ; assertEquals ( 0 , handler . getMaximalTimeError ( ) , 1.0E-12 ) ; } } } public void testSmallStep ( ) throws DerivativeException , IntegratorException { } public void testBigStep ( ) throws DerivativeException , IntegratorException { } public void testBackward ( ) throws DerivativeException , IntegratorException { } public void testStepSize ( ) throws DerivativeException , IntegratorException { } public static Test suite ( ) { } }

Fix:
TestProblemAbstract pb = problems [ k ] . copy ( ) ;
Buggy code:
public class URLController implements ActionListener { private String address ; private URL link ; public JPopupMenu createContactMenu ( String contact ) { } public JPopupMenu createLinkMenu ( ) { } public void setAddress ( String s ) { } public String getAddress ( ) { } public URL getLink ( ) { } public void setLink ( URL u ) { } public void compose ( String address ) { } public void contact ( String address ) { } public JPopupMenu createMenu ( URL url ) { } public void open ( URL url ) { try { Desktop . browse ( url ) ; } catch ( DesktopException e ) { <START_BUG> JOptionPane . showMessageDialog ( null , GlobalResourceLoader . getString ( "dialog" , "error" , "no_browser" ) , "Error" , JOptionPane . ERROR_MESSAGE ) ; <END_BUG> } } public void actionPerformed ( ActionEvent e ) { } }

Fix:
JOptionPane . showMessageDialog ( null , GlobalResourceLoader . getString ( "org.columba.core.i18n.dialog" , "error" , "no_browser" ) , "Error" , JOptionPane . ERROR_MESSAGE ) ;
Buggy code:
public class AuthenticatedHtmlPage extends HtmlPage { protected boolean checkAccess ( RequestCycle cycle ) { <START_BUG> boolean signedIn = ( cycle . getSession ( ) . getProperty ( "user" ) ) != null ; <END_BUG> if ( ! signedIn ) { cycle . redirectToInterceptPage ( SignIn2 . class ) ; } return signedIn ; } }

Fix:
boolean signedIn = ( cycle . getSession ( ) . getProperty ( "signin2.user" ) ) != null ;
Buggy code:
public class BlogManager extends Manager { public BlogManager ( RequestSolver requestSolver ) { } public void addDocument ( String username , String password , String title , String body , String type ) { } public void addReply ( String username , String password , String documentID , String reply ) { } public void getDocument ( String id ) { } public void addReader ( String id ) { } public void getAuthorTypeDocumentList ( String author , String type ) { } public void getTypeDocumentList ( String type ) { } public void getAuthorDocumentList ( String author ) { } protected void sendDocumentList ( Event event , Document message ) { BlogCollection blogCollection = new BlogCollection ( ) ; List < DBClient . DBData > list = blogCollection . findDocumentListData ( message ) ; JSONArray array = new JSONArray ( ) ; for ( DBClient . DBData now : list ) { JSONObject object = new JSONObject ( ) ; <START_BUG> object . put ( "id" , now . object . get ( "_id" ) ) ; <END_BUG> object . put ( "title" , now . object . get ( "title" ) ) ; object . put ( "author" , now . object . get ( "author" ) ) ; object . put ( "time" , now . object . get ( "time" ) ) ; String body = now . object . getString ( "body" ) ; if ( ( body . length ( ) ) > 100 ) { body = body . substring ( 0 , 100 ) ; } object . put ( "preview" , body ) ; array . add ( object ) ; } event . sendWhileSuccess ( new net . tool . WriteMessageServerSolver ( requestSolver , array ) ) ; } }

Fix:
object . put ( "id" , now . object . get ( "_id" ) . toString ( ) ) ;
Buggy code:
public abstract class AbstractMethodDeclaration extends AstNode implements ReferenceContext , ProblemSeverities { public MethodScope scope ; public char [ ] selector ; public int declarationSourceStart ; public int declarationSourceEnd ; public int modifiers ; public int modifiersSourceStart ; public Argument [ ] arguments ; public TypeReference [ ] thrownExceptions ; public Statement [ ] statements ; public int explicitDeclarations ; public MethodBinding binding ; public boolean ignoreFurtherInvestigation = false ; public boolean needFreeReturn = false ; public int bodyStart ; public int bodyEnd = - 1 ; public CompilationResult compilationResult ; public boolean errorInSignature = false ; AbstractMethodDeclaration ( CompilationResult compilationResult ) { } public void abort ( int abortLevel ) { } public abstract void analyseCode ( ClassScope classScope , InitializationFlowContext initializationContext , FlowInfo info ) { } public void bindArguments ( ) { } public void bindThrownExceptions ( ) { } public CompilationResult compilationResult ( ) { } public void generateCode ( ClassScope classScope , ClassFile classFile ) { } private void generateCode ( ClassFile classFile ) { } private void checkArgumentsSize ( ) { } public boolean hasErrors ( ) { } public boolean isAbstract ( ) { } public boolean isClinit ( ) { } public boolean isConstructor ( ) { } public boolean isDefaultConstructor ( ) { } public boolean isInitializationMethod ( ) { } public boolean isNative ( ) { } public boolean isStatic ( ) { } public abstract void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer print ( int tab , StringBuffer output ) { } public StringBuffer printBody ( int indent , StringBuffer output ) { } public StringBuffer printReturnType ( int indent , StringBuffer output ) { } public void resolve ( ClassScope upperScope ) { } public void resolveStatements ( ) { if ( ( statements ) != null ) { for ( int i = 0 , length = statements . length ; i < length ; i ++ ) { statements [ i ] . resolve ( scope ) ; } } else if ( ( ( this . bits ) & ( UndocumentedEmptyBlockMASK ) ) != 0 ) { <START_BUG> scope . problemReporter ( ) . undocumentedEmptyBlock ( this . sourceEnd , this . declarationSourceEnd ) ; <END_BUG> } } public void tagAsHavingErrors ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , ClassScope classScope ) { } }

Fix:
scope . problemReporter ( ) . undocumentedEmptyBlock ( ( ( this . bodyStart ) - 1 ) , ( ( this . bodyEnd ) + 1 ) ) ;
Buggy code:
class HelperAppLauncherDialog { XPCOMObject supports ; XPCOMObject helperAppLauncherDialog ; int refCount = 0 ; public HelperAppLauncherDialog ( ) { } int AddRef ( ) { } void createCOMInterfaces ( ) { } void disposeCOMInterfaces ( ) { } int getAddress ( ) { } int queryInterface ( int riid , int ppvObject ) { } int Release ( ) { } <START_BUG> public int Show ( int aLauncher , int aContext , int aForced ) { <END_BUG> nsISupports supports = new nsISupports ( aLauncher ) ; int [ ] result = new int [ 1 ] ; int rc = supports . QueryInterface ( NS_IHELPERAPPLAUNCHER_IID , result ) ; if ( rc == 0 ) { nsIHelperAppLauncher_1_8 helperAppLauncher = new nsIHelperAppLauncher_1_8 ( aLauncher ) ; rc = helperAppLauncher . SaveToDisk ( 0 , false ) ; helperAppLauncher . Release ( ) ; return rc ; } nsIHelperAppLauncher helperAppLauncher = new nsIHelperAppLauncher ( aLauncher ) ; return helperAppLauncher . SaveToDisk ( 0 , false ) ; } public int PromptForSaveToFile ( int arg0 , int arg1 , int arg2 , int arg3 , int arg4 ) { } }

Fix:
public int Show ( int aLauncher , int aContext , int aReason ) {
Buggy code:
public class ManagedDMRContentResource implements Resource . ResourceEntry { private final PathElement pathElement ; private ManagedDMRContentTypeResource parent ; private ModelNode model ; public ManagedDMRContentResource ( PathElement pathElement ) { } public ManagedDMRContentResource ( final PathElement pathElement , final ManagedDMRContentTypeResource parent ) { } void setParent ( final ManagedDMRContentTypeResource parent ) { } @ Override public synchronized ModelNode getModel ( ) { } @ Override public synchronized void writeModel ( ModelNode newModel ) { if ( ( parent ) == null ) { <START_BUG> throw MESSAGES . nullParent ( ) ; <END_BUG> } ModelNode content = newModel . get ( CONTENT ) ; try { byte [ ] hash = parent . storeManagedContent ( pathElement . getValue ( ) , content ) ; newModel . get ( HASH ) . set ( hash ) ; this . model = null ; } catch ( IOException e ) { throw new ContentStorageException ( e ) ; } } @ Override public boolean isModelDefined ( ) { } @ Override public boolean hasChild ( PathElement element ) { } @ Override public Resource getChild ( PathElement element ) { } @ Override public Resource requireChild ( PathElement element ) { } @ Override public boolean hasChildren ( String childType ) { } @ Override public Resource navigate ( PathAddress address ) { } @ Override public Set < String > getChildTypes ( ) { } @ Override public Set < String > getChildrenNames ( String childType ) { } @ Override public Set < ResourceEntry > getChildren ( String childType ) { } @ Override public void registerChild ( PathElement address , Resource resource ) { } @ Override public Resource removeChild ( PathElement address ) { } @ Override public boolean isRuntime ( ) { } @ Override public boolean isProxy ( ) { } @ Override public Resource clone ( ) { } @ Override public String getName ( ) { } @ Override public PathElement getPathElement ( ) { } }

Fix:
throw ROOT_LOGGER . nullParent ( ) ;
Buggy code:
public class PortletSessionStore implements ISessionStore { private static final int SCOPE = PortletSession . APPLICATION_SCOPE ; protected static Log log = LogFactory . getLog ( PortletSessionStore . class ) ; protected final PortletApplication application ; public PortletSessionStore ( ) { } public final void invalidate ( Request request ) { } public final String getSessionId ( Request request ) { } public final void bind ( Request request , Session newSession ) { } public final void unbind ( String sessionId ) { } public Session lookup ( Request request ) { } protected final WicketPortletRequest toPortletRequest ( Request request ) { } protected final PortletSession getPortletSession ( WicketPortletRequest request ) { } protected void onBind ( Request request , Session newSession ) { } protected void onUnbind ( String sessionId ) { } public void setAttribute ( Request request , String name , Object value ) { } public Object getAttribute ( Request request , String name ) { } public void removeAttribute ( Request request , String name ) { } public List getAttributeNames ( Request request ) { } private String getSessionAttributePrefix ( final WicketPortletRequest request ) { } public IPageMap createPageMap ( String name , Session session ) { } public IPageVersionManager newVersionManager ( Page page ) { final IPageSettings settings = page . getSession ( ) . getApplication ( ) . getPageSettings ( ) ; <START_BUG> return new wicket . version . undo . UndoPageVersionManager ( page , settings . getMaxPageVersions ( ) ) ; <END_BUG> } public final String getSessionId ( Request request , boolean create ) { } public void onBeginRequest ( Request request ) { } public void onEndRequest ( Request request ) { } public void destroy ( ) { } }

Fix:
return new wicket . version . undo . UndoPageVersionManager ( page , 20 ) ;
Buggy code:
public class WordDAO extends AbstractDAO < Word > { private final SessionFactory sessionFactory ; public WordDAO ( SessionFactory sessionFactory ) { } public Word create ( Word word ) { } public List findBy ( int wordId , Boolean showOnMainLandingPage ) { } private Criteria allWordsCriteria ( Session session ) { } public Word update ( Word updatableWord ) { currentSession ( ) . update ( updatableWord ) ; for ( WordIntroduction wordIntroduction : updatableWord . getWordIntroductions ( ) ) { wordIntroduction . setWord ( updatableWord ) ; <START_BUG> currentSession ( ) . update ( wordIntroduction ) ; <END_BUG> } return updatableWord ; } public List < Word > findReflections ( int wordId ) { } public List findAll ( ) { } }

Fix:
currentSession ( ) . saveOrUpdate ( wordIntroduction ) ;
Buggy code:
public class AdminloginController { public Hyperlink goBack ; public void goBack ( ) { Stage stage = ( ( Stage ) ( goBack . getScene ( ) . getWindow ( ) ) ) ; <START_BUG> stage . hide ( ) ; <END_BUG> } }

Fix:
stage . close ( ) ;
Buggy code:
public class IfElseStmt extends Stmt { private Expr condition ; private List < Stmt > ifbody ; private List < Stmt > elsebody ; public IfElseStmt ( Expr cond , List < Stmt > ib , List < Stmt > eb , int lineNum , int colNum ) { } public Expr getCond ( ) { } public List < Stmt > getIfBody ( ) { } public List < Stmt > getElseBody ( ) { } public Type typecheck ( SymTab s ) { SymTab ifScope = new SymTab ( s ) ; <START_BUG> if ( ( condition . typecheck ( ifScope ) . getType ( ) ) != "bool" ) <END_BUG> throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "not<seq2seq4repair_space>boolean<seq2seq4repair_space>in<seq2seq4repair_space>if<seq2seq4repair_space>condition" ) ) ; for ( int a = 0 ; a < ( ifbody . size ( ) ) ; a ++ ) { if ( a == ( ( ifbody . size ( ) ) - 1 ) ) { Type t = ifbody . get ( a ) . typecheck ( ifScope ) ; if ( ( ( t . getType ( ) ) != "unit" ) && ( ( t . getType ( ) ) != "void" ) ) { throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "last<seq2seq4repair_space>stmt<seq2seq4repair_space>in<seq2seq4repair_space>if<seq2seq4repair_space>block<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>typecheck" ) ) ; } else return new Type ( "unit" ) ; } else if ( ( ifbody . get ( a ) . typecheck ( ifScope ) . getType ( ) ) != "unit" ) throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "stmt<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>unit<seq2seq4repair_space>type" ) ) ; } SymTab elseScope = new SymTab ( s ) ; if ( ( elsebody . size ( ) ) == 0 ) return new Type ( "unit" ) ; for ( int a = 0 ; a < ( elsebody . size ( ) ) ; a ++ ) { if ( a == ( ( elsebody . size ( ) ) - 1 ) ) { Type t = elsebody . get ( a ) . typecheck ( elseScope ) ; if ( ( ( t . getType ( ) ) != "unit" ) && ( ( t . getType ( ) ) != "void" ) ) { throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "last<seq2seq4repair_space>stmt<seq2seq4repair_space>in<seq2seq4repair_space>else<seq2seq4repair_space>block<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>typecheck" ) ) ; } else return t ; } else if ( ( elsebody . get ( a ) . typecheck ( elseScope ) . getType ( ) ) != "unit" ) throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "stmt<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>unit<seq2seq4repair_space>type" ) ) ; } throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "shouldn't<seq2seq4repair_space>get<seq2seq4repair_space>here<seq2seq4repair_space>in<seq2seq4repair_space>ifelseblock<seq2seq4repair_space>typecheck" ) ) ; } public String toString ( ) { } public boolean returncheck ( ) { } @ Override public IRStmt buildIRStmt ( ) { } }

Fix:
if ( ! ( condition . typecheck ( ifScope ) . equals ( new Type ( "bool" ) ) ) )
Buggy code:
public class FrozenBehaviour implements IMoveBehaviour , Serializable { private static final long serialVersionUID = - 5760123782325835897L ; @ Override public Vec2d getSpeedVector ( ) { } @ Override public void preMove ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { if ( obj == null ) { return false ; } <START_BUG> return ( obj . getClass ( ) ) == ( FrozenBehaviour . class ) ; <END_BUG> } @ Override public void updateTo ( IMoveBehaviour behaviour ) { } }

Fix:
return ( this . getClass ( ) ) == ( obj . getClass ( ) ) ;
Buggy code:
public class PersistenceDescriptorParserImpl implements PersistenceDescriptorParser { private static class RememberingInputStream extends InputStream { private static final int bufferGrowthSize = 16384 ; private byte [ ] bytes = new byte [ PersistenceDescriptorParserImpl . RememberingInputStream . bufferGrowthSize ] ; private int pos = 0 ; private final InputStream stream ; private int maxRead = - 1 ; private int markPoint = - 1 ; public RememberingInputStream ( InputStream in ) throws IOException { } @ Override public int read ( ) throws IOException { } private void ensureCapacity ( int i ) { if ( ( ( pos ) + i ) >= ( bytes . length ) ) { byte [ ] tmp = bytes ; int newLength = ( bytes . length ) + ( PersistenceDescriptorParserImpl . RememberingInputStream . bufferGrowthSize ) ; while ( newLength < ( ( pos ) + i ) ) { newLength += PersistenceDescriptorParserImpl . RememberingInputStream . bufferGrowthSize ; } bytes = new byte [ newLength ] ; <START_BUG> System . arraycopy ( tmp , 0 , bytes , 0 , pos ) ; <END_BUG> } } @ Override public int read ( byte [ ] b ) throws IOException { } @ Override public int read ( byte [ ] b , int off , int len ) throws IOException { } @ Override public long skip ( long n ) throws IOException { } @ Override public int available ( ) throws IOException { } @ Override public synchronized void mark ( int readlimit ) { } @ Override public synchronized void reset ( ) throws IOException { } @ Override public boolean markSupported ( ) { } @ Override public void close ( ) throws IOException { } } public Collection < ParsedPersistenceUnit > parse ( Bundle b , PersistenceDescriptor descriptor ) throws PersistenceDescriptorParserException { } }

Fix:
System . arraycopy ( tmp , 0 , bytes , 0 , ( ( maxRead ) >= ( pos ) ? ( maxRead ) + 1 : pos ) ) ;