nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class XSNamedMap4Types extends XSNamedMapImpl { private final short fType ; public XSNamedMap4Types ( String namespace , SymbolHash map , short type ) { } public XSNamedMap4Types ( String [ ] namespaces , SymbolHash [ ] maps , int num , short type ) { } public synchronized int getLength ( ) { } public XSObject itemByName ( String namespace , String localName ) { for ( int i = 0 ; i < ( fNSNum ) ; i ++ ) { if ( isEqual ( namespace , fNamespaces [ i ] ) ) { XSTypeDefinition type = ( ( XSTypeDefinition ) ( fMaps [ i ] . get ( localName ) ) ) ; <START_BUG> if ( ( type . getTypeCategory ( ) ) == ( fType ) ) { <END_BUG> return type ; } return null ; } } return null ; } public synchronized XSObject item ( int index ) { } }

Fix:
if ( ( type != null ) && ( ( type . getTypeCategory ( ) ) == ( fType ) ) ) {
Buggy code:
final class SegmentMerger { private final Directory directory ; private final int termIndexInterval ; private final Codec codec ; private final IOContext context ; private final MergeState mergeState = new MergeState ( ) ; private final Builder fieldInfosBuilder ; SegmentMerger ( SegmentInfo segmentInfo , InfoStream infoStream , Directory dir , int termIndexInterval , MergeState . CheckAbort checkAbort , FieldInfos . FieldNumbers fieldNumbers , IOContext context ) { } void add ( IndexReader reader ) { } void add ( SegmentReader reader ) { } MergeState merge ( ) throws IOException { } private void mergeSimpleDocValues ( SegmentWriteState segmentWriteState ) throws IOException { } private void mergeSimpleNorms ( SegmentWriteState segmentWriteState ) throws IOException { if ( ( codec . simpleNormsFormat ( ) ) != null ) { SimpleDVConsumer consumer = codec . simpleNormsFormat ( ) . normsConsumer ( segmentWriteState ) ; boolean success = false ; try { for ( FieldInfo field : mergeState . fieldInfos ) { <START_BUG> if ( ( field . isIndexed ( ) ) && ( ! ( field . omitsNorms ( ) ) ) ) { <END_BUG> List < NumericDocValues > toMerge = new ArrayList < NumericDocValues > ( ) ; for ( AtomicReader reader : mergeState . readers ) { NumericDocValues norms = reader . simpleNormValues ( field . name ) ; if ( norms == null ) { norms = new NumericDocValues . EMPTY ( reader . maxDoc ( ) ) ; } toMerge . add ( norms ) ; } consumer . mergeNumericField ( field , mergeState , toMerge ) ; } } } finally { if ( success ) { IOUtils . close ( consumer ) ; } else { IOUtils . closeWhileHandlingException ( consumer ) ; } } } } private void setMatchingSegmentReaders ( ) { } private TypePromoter mergeDocValuesType ( TypePromoter previous , DocValues docValues ) { } public void mergeDocValuesAndNormsFieldInfos ( ) throws IOException { } protected void updatePromoted ( Map < FieldInfo , TypePromoter > infoAndPromoter , boolean norms ) { } private int mergeFields ( ) throws IOException { } private int mergeVectors ( ) throws IOException { } private int setDocMaps ( ) throws IOException { } private void mergeTerms ( SegmentWriteState segmentWriteState ) throws IOException { } private void mergePerDoc ( SegmentWriteState segmentWriteState ) throws IOException { } private void mergeNorms ( SegmentWriteState segmentWriteState ) throws IOException { } }

Fix:
if ( ( ( field . isIndexed ( ) ) && ( ! ( field . omitsNorms ( ) ) ) ) && ( ( field . getNormType ( ) ) != null ) ) {
Buggy code:
public class DomainAccessControlTestCase extends AbstractCoreModelTest { @ Test public void testConfiguration ( ) throws Exception { new org . jboss . as . controller . access . management . SensitiveTargetAccessConstraintDefinition ( new SensitivityClassification ( "play" , "security-realm" , true , true , true ) ) ; new org . jboss . as . controller . access . management . ApplicationTypeAccessConstraintDefinition ( new ApplicationTypeConfig ( "play" , "deployment" , false ) ) ; KernelServices kernelServices = createKernelServicesBuilder ( DOMAIN ) . setModelInitializer ( new ModelInitializer ( ) { @ Override public void populateModel ( Resource rootResource ) { Resource management = Factory . create ( ) ; rootResource . registerChild ( PathElement . pathElement ( CORE_SERVICE , MANAGEMENT ) , management ) ; <START_BUG> management . registerChild ( PathElement . pathElement ( ACCESS , AUTHORIZATION ) , RESOURCE ) ; <END_BUG> } } , null ) . setXmlResource ( "domain-all.xml" ) . validateDescription ( ) . build ( ) ; Assert . assertTrue ( kernelServices . isSuccessfulBoot ( ) ) ; String marshalled = kernelServices . getPersistedSubsystemXml ( ) ; ModelTestUtils . compareXml ( ModelTestUtils . readResource ( this . getClass ( ) , "domain-all.xml" ) , marshalled ) ; } }

Fix:
management . registerChild ( PathElement . pathElement ( ACCESS , AUTHORIZATION ) , AccessAuthorizationResourceDefinition . createResource ( null ) ) ;
Buggy code:
public class CacheDataWriter extends DataCache { private static boolean WRITING_DIRTY = false ; private static List < String > dirtyDataSets = new ArrayList < String > ( ) ; private static Timer timer = null ; protected DataWriter writer = new DataWriter ( ) ; public CacheDataWriter ( ) { } public void writeRecord ( String dataSetName , DataRecord record ) { rwl . writeLock ( ) . lock ( ) ; if ( ! ( CacheDataWriter . dirtyDataSets . contains ( dataSetName ) ) ) { CacheDataWriter . dirtyDataSets . add ( dataSetName ) ; } super . getCachedData ( dataSetName ) ; <START_BUG> if ( record . getIsPersistent ( ) ) { <END_BUG> Iterator < DataRecord > it = super . getCachedData ( dataSetName ) . iterator ( ) ; while ( it . hasNext ( ) ) { if ( record . getPK ( ) . equals ( it . next ( ) . getPK ( ) ) ) { it . remove ( ) ; break ; } } } record . setIsPersistent ( true ) ; super . getCachedData ( dataSetName ) . add ( record ) ; if ( ( dirtyData ) == null ) { dirtyData = new ArrayList < DataRecord > ( ) ; } DataRecord dirtyRecord = new sg . edu . nus . iss . shop . dao . adapter . DataTrackAdapter ( dataSetName , record ) . getDataRecord ( ) ; Iterator < DataRecord > dirtyDataIt = dirtyData . iterator ( ) ; while ( dirtyDataIt . hasNext ( ) ) { if ( dirtyRecord . getPK ( ) . equals ( dirtyDataIt . next ( ) . getPK ( ) ) ) { dirtyDataIt . remove ( ) ; break ; } } dirtyData . add ( dirtyRecord ) ; writeDirtyData ( ) ; rwl . writeLock ( ) . unlock ( ) ; } private void writeDirtyData ( ) { } private void write ( ) throws IOException { } @ Override public void finalize ( ) throws Throwable { } }

Fix:
{
Buggy code:
public class ShowBillActivity extends Activity implements AdapterView . OnItemClickListener { private ArrayList < Bill > collectedItems ; private MyBillListAdapter myListViewAdapter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void loadCollectedItems ( ) { } public void addBillActivity ( View v ) { } @ Override public void onResume ( ) { } @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { Intent intent = new Intent ( this , ShowOrderActivity . class ) ; intent . putExtra ( "table_number" , collectedItems . get ( position ) . getTable_number ( ) ) ; <START_BUG> onResume ( ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
startActivity ( intent ) ;
Buggy code:
public class ArithmeticTemplate extends Template { private AddService addService ; private DivideService divideService ; @ Override protected String getTemplateName ( ) { <START_BUG> return getClass ( ) . getName ( ) ; <END_BUG> } @ Override protected void resolveService ( ServiceResolver serviceResolver ) { } @ Override public void execute ( ) { } }

Fix:
return getClass ( ) . getSimpleName ( ) ;
Buggy code:
public class ActionGenerateOne extends UMLAction { public static ActionGenerateOne SINGLETON = new ActionGenerateOne ( ) ; protected ActionGenerateOne ( ) { } public void actionPerformed ( ActionEvent ae ) { <START_BUG> ProjectBrowser pb = ProjectBrowser . TheInstance ; <END_BUG> Editor ce = Globals . curEditor ( ) ; Vector sels = ce . getSelectionManager ( ) . getFigs ( ) ; util . Enumeration = sels . elements ( ) ; Vector classes = new Vector ( ) ; } public boolean shouldBeEnabled ( ) { } }

Fix:
ProjectBrowser pb = ProjectBrowser . getInstance ( ) ;
Buggy code:
public class SaveFeedCallback implements AsyncCallbackListener < RSSChannel > { private final ProgressListener progressListener ; private final DataModel dataModel ; public SaveFeedCallback ( ProgressListener progressListener , DataModel dataModel ) { } @ Override public void onPreExecute ( ) { } @ Override public void onPostExecute ( RSSChannel result ) { progressListener . stopRefreshProgress ( ) ; if ( result != null ) { try { result . saveToDb ( progressListener , dataModel ) ; <START_BUG> } catch ( ParseException e ) { <END_BUG> handleException ( e ) ; dataModel . onFeedFailureBeforeLoad ( ) ; } } else { dataModel . onFeedFailureBeforeLoad ( ) ; } } private void handleException ( Exception e ) { } }

Fix:
} catch ( Exception e ) {
Buggy code:
public class MutableLong extends Number implements Comparable < MutableLong > , Mutable < Number > { private static final long serialVersionUID = 62986528375L ; private long value ; public MutableLong ( ) { } public MutableLong ( long value ) { } public MutableLong ( Number value ) { } public MutableLong ( String value ) throws NumberFormatException { } public Long getValue ( ) { <START_BUG> return new Long ( this . value ) ; <END_BUG> } public void setValue ( long value ) { } public void setValue ( Number value ) { } public void increment ( ) { } public void decrement ( ) { } public void add ( long operand ) { } public void add ( Number operand ) { } public void subtract ( long operand ) { } public void subtract ( Number operand ) { } @ Override public int intValue ( ) { } @ Override public long longValue ( ) { } @ Override public float floatValue ( ) { } @ Override public double doubleValue ( ) { } public Long toLong ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } public int compareTo ( MutableLong other ) { } @ Override public String toString ( ) { } }

Fix:
return Long . valueOf ( this . value ) ;
Buggy code:
public class ScoreBoard extends GameLayer { private static final long serialVersionUID = 1L ; private static Font font = Roboto . deriveFont ( 20.0F ) ; public static final int WIDTH = 266 ; private static ArrayList < ScoreBoard . Row > rows = new ArrayList < ScoreBoard . Row > ( ) ; boolean visible = false ; GameState prevState = GameState . MainMenu ; double tTimer = 0 ; private static class Row implements Comparable < ScoreBoard . Row > { RankIcon icon ; public ClientPlayer cp ; public boolean white = true ; public Row ( ClientPlayer cp ) { } public void Draw ( Graphics2D g2 , Rectangle bounds ) { } @ Override public int compareTo ( ScoreBoard . Row o ) { } } public ScoreBoard ( ) { } public static void AddPlayer ( ClientPlayer p ) { } public static void RemovePlayer ( ClientPlayer p ) { } public static void ClearScores ( ) { } public static void ClearAllPlayers ( ) { } public static void SetCzar ( ClientPlayer p ) { for ( ScoreBoard . Row row : ScoreBoard . rows ) { <START_BUG> if ( ( row . cp ) == p ) { <END_BUG> row . white = false ; } else { row . white = true ; } } } @ Override protected void Update ( ) { } @ Override public void paintComponent ( Graphics g ) { } @ Override public void ChangeScene ( GameState newState ) { } }

Fix:
if ( ( row . cp . id ) == ( p . id ) ) {
Buggy code:
public class Arguments extends ConfigTestElement implements Serializable { public static final String ARGUMENTS = "Arguments.arguments" ; public Arguments ( ) { } public CollectionProperty getArguments ( ) { } public void clear ( ) { } public void setArguments ( List arguments ) { } public Map getArgumentsAsMap ( ) { } public void addArgument ( String name , String value ) { } public void addArgument ( Argument arg ) { TestElementProperty newArg = new TestElementProperty ( arg . getName ( ) , arg ) ; if ( isRunningVersion ( ) ) { <START_BUG> newArg . setTemporary ( true , this ) ; <END_BUG> } getArguments ( ) . addItem ( newArg ) ; } public void addArgument ( String name , String value , String metadata ) { } public PropertyIterator iterator ( ) { } public String toString ( ) { } public void removeArgument ( int row ) { } public void removeArgument ( Argument arg ) { } public void removeArgument ( String argName ) { } public void removeAllArguments ( ) { } public void addEmptyArgument ( ) { } public int getArgumentCount ( ) { } public Argument getArgument ( int row ) { } }

Fix:
this . setTemporary ( newArg ) ;
Buggy code:
public class StaleAsyncRequestCheckingCallableTests { private StaleAsyncRequestCheckingCallable callable ; private AsyncWebRequest asyncWebRequest ; @ Before public void setUp ( ) { this . asyncWebRequest = EasyMock . createMock ( AsyncWebRequest . class ) ; this . callable = new StaleAsyncRequestCheckingCallable ( asyncWebRequest ) ; <START_BUG> this . callable . setNextCallable ( new Callable < Object > ( ) { <END_BUG> public Object call ( ) throws Exception { return 1 ; } } ) ; } @ Test public void call_notStale ( ) throws Exception { } @ Test ( expected = StaleAsyncWebRequestException . class ) public void call_stale ( ) throws Exception { } }

Fix:
this . callable . setNext ( new Callable < Object > ( ) {
Buggy code:
public class CompileAndRunTestCase extends CommandTestCase { public CompileAndRunTestCase ( String name ) { } public void testAround ( ) throws IOException { } public void testInterType ( ) throws IOException { } public void testInterTypeMethods ( ) throws IOException { } public void testIf ( ) throws IOException { } public void testDeclareParentsFail ( ) throws IOException { <START_BUG> CommandTestCase . checkCompile ( "src1//ParentsFail.java" , new int [ ] { 3 , 11 , 19 , 21 } ) ; <END_BUG> } public void testDeclareParents ( ) throws IOException { } public void testPerCflow ( ) throws IOException { } public void testPerObject ( ) throws IOException { } public void testDeclareSoft ( ) throws IOException { } public void testPrivileged ( ) throws IOException { } public void testHandler ( ) throws IOException { } public void testInterConstructors ( ) throws IOException { } public void testAroundA1 ( ) throws IOException { } }

Fix:
CommandTestCase . checkCompile ( "src1//ParentsFail.java" , new int [ ] { 3 , 11 , 19 } ) ;
Buggy code:
public class AI implements IPlayer { private static final int DEFAULT_DIFFICULTY = Game . ULTIMATE_DIFFICULTY ; private static AI instance = null ; private static int difficulty = AI . DEFAULT_DIFFICULTY ; private static Board board ; private BoardLocation lastMove ; private static Algorithm solver ; private AI ( ) { } public static AI getInstance ( ) { } public static void initAI ( int difficulty , Board board ) { } @ Override public boolean withdraw ( ) throws WithdrawException { } @ Override public void forceWithdraw ( ) { } @ Override public BoardLocation makeMove ( ) throws InvalidIndexException { BoardLocation nextMove = null ; if ( ( AI . board . getTotalStones ( ) ) < 10 ) nextMove = AI . solver . makeMoveBeginning ( ) ; else <START_BUG> nextMove = AI . board . findEmptyLocSpiral ( ) ; <END_BUG> return nextMove ; } No newline ; at end ; of file ; }

Fix:
nextMove = AI . solver . makeMoveEnd ( ) ;
Buggy code:
public class HeaderPanel extends AbstractConfigGui implements ActionListener , FocusListener { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.protocol.http" ) ; HeaderPanel . InnerTableModel tableModel ; JTable headerTable ; JButton addButton ; JButton deleteButton ; JButton loadButton ; JButton saveButton ; JPanel headerManagerPanel ; public HeaderPanel ( ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement el ) { } public void configure ( TestElement el ) { } public String getStaticLabel ( ) { } public void init ( ) { } public void actionPerformed ( ActionEvent e ) { } public JPanel createHeaderTablePanel ( ) { } class HeaderUpdater implements ActionListener { JTextField nameField = new JTextField ( 20 ) ; JTextField valueField = new JTextField ( 20 ) ; JButton ok = new JButton ( "Ok" ) ; JButton cancel = new JButton ( "Cancel" ) ; int index ; JDialog updateDialog ; public HeaderUpdater ( ) { } public JPanel getPanel ( ) { JPanel main = new JPanel ( ) ; GridBagLayout g = new GridBagLayout ( ) ; main . setLayout ( g ) ; GridBagConstraints c = new GridBagConstraints ( ) ; <START_BUG> c . fill = c . BOTH ; <END_BUG> c . gridwidth = 1 ; c . gridheight = 1 ; JLabel nameLabel = new JLabel ( ( ( JMeterUtils . getResString ( "name" ) ) + ":" ) ) ; c . gridx = 1 ; c . gridy = 1 ; g . setConstraints ( nameLabel , c ) ; main . add ( nameLabel ) ; JLabel valueLabel = new JLabel ( ( ( JMeterUtils . getResString ( "value" ) ) + ":" ) ) ; c . gridx = 1 ; c . gridy = 2 ; g . setConstraints ( valueLabel , c ) ; main . add ( valueLabel ) ; c . gridx = 2 ; c . gridy = 1 ; g . setConstraints ( nameField , c ) ; main . add ( nameField ) ; c . gridx = 2 ; c . gridy = 2 ; g . setConstraints ( valueField , c ) ; main . add ( valueField ) ; JPanel buttons = new JPanel ( ) ; ok . setPreferredSize ( cancel . getPreferredSize ( ) ) ; buttons . add ( ok ) ; buttons . add ( cancel ) ; c . gridwidth = 2 ; c . gridx = 1 ; c . gridy = 7 ; g . setConstraints ( buttons , c ) ; main . add ( buttons ) ; return main ; } public void actionPerformed ( ActionEvent e ) { } } public void focusGained ( FocusEvent e ) { } public void focusLost ( FocusEvent e ) { } private class InnerTableModel extends AbstractTableModel { HeaderManager manager ; public InnerTableModel ( HeaderManager man ) { } public InnerTableModel ( ) { } public void removeRow ( int row ) { } public void addNewRow ( ) { } public boolean isCellEditable ( int row , int column ) { } public Class getColumnClass ( int column ) { } public int getRowCount ( ) { } public int getColumnCount ( ) { } public String getColumnName ( int column ) { } public Object getValueAt ( int row , int column ) { } public void setValueAt ( Object value , int row , int column ) { } } }

Fix:
c . fill = GridBagConstraints . BOTH ;
Buggy code:
public class MotionPlanner { public MotionPlanner ( ) { } public List < Point2D . Double > getPath ( ) { } public Point2D . Double getClosestPt ( List < Point2D . Double > path , Point2D . Double pt ) { } public double getDist ( double pt1X , double pt1Y , double pt2X , double pt2Y ) { } public boolean lineIntersects ( PolygonObstacle p , Point2D . Double x1 , Point2D . Double x2 ) { Line2D path = new Line2D . Double ( 100 , 100 , 200 , 200 ) ; List < Point2D . Double > verts = p . getVertices ( ) ; for ( int i = 0 ; i < ( verts . size ( ) ) ; i ++ ) { Point2D . Double point1 = verts . get ( i ) ; <START_BUG> Point2D . Double point2 = verts . get ( ( ( i + 1 ) % ( verts . length ) ) ) ; <END_BUG> Line2D side = new Line2D . Double ( point1 . x , point1 . y , point2 . x , point2 . y ) ; if ( side . intersectsLine ( path ) ) return true ; } return false ; } }

Fix:
Point2D . Double point2 = verts . get ( ( ( i + 1 ) % ( verts . size ( ) ) ) ) ;
Buggy code:
public class StatusRenderer extends DefaultLabelRenderer { boolean bool ; ImageIcon image1 ; ImageIcon image2 ; ImageIcon image4 ; ImageIcon image3 ; ImageIcon image5 ; ImageIcon image6 ; ImageIcon image7 ; public StatusRenderer ( ) { } public Component getTableCellRendererComponent ( JTable table , Object value , boolean isSelected , boolean hasFocus , int row , int column ) { super . getTableCellRendererComponent ( table , value , isSelected , hasFocus , row , column ) ; if ( value == null ) { setIcon ( null ) ; return this ; } if ( value instanceof String ) { System . out . println ( "statusrenderer-><seq2seq4repair_space>instanceof<seq2seq4repair_space>String<seq2seq4repair_space>not<seq2seq4repair_space>expected" ) ; return this ; } Flags flags = ( ( org . columba . mail . message . ColumbaHeader ) ( ( ( org . columba . mail . gui . table . model . MessageNode ) ( value ) ) . getHeader ( ) ) ) . getFlags ( ) ; <START_BUG> if ( flags . getExpunged ( ) ) { <END_BUG> setIcon ( image3 ) ; setToolTipText ( MailResourceLoader . getString ( "header" , "column" , "expunged" ) ) ; } else if ( flags . getAnswered ( ) ) { setIcon ( image1 ) ; setToolTipText ( MailResourceLoader . getString ( "header" , "column" , "answered" ) ) ; } else if ( flags . getDraft ( ) ) { setIcon ( image7 ) ; setToolTipText ( MailResourceLoader . getString ( "header" , "column" , "draft" ) ) ; } else if ( ! ( flags . getSeen ( ) ) ) { setIcon ( image6 ) ; setToolTipText ( MailResourceLoader . getString ( "header" , "column" , "unread" ) ) ; } else if ( flags . getSeen ( ) ) { setIcon ( image5 ) ; setToolTipText ( MailResourceLoader . getString ( "header" , "column" , "read" ) ) ; } else { setIcon ( null ) ; } return this ; } }

Fix:
if ( flags . getDeleted ( ) ) {
Buggy code:
public class PreProcessingHandler { public PreProcessingHandler ( ) { } public ProcessedExercise preprocessRawExerciseForANN ( ExerciseRaw exerciseRaw ) { } public ProcessedExercise preprocessRawExerciseForANN3Axis ( ExerciseRaw exerciseRaw ) { } public Routine createNewRoutine ( ProcessedExercise processedExercise , String collection ) { } public Routine updateRoutine ( Routine currentRoutine , ProcessedExercise processedExercise ) { } private List < Integer > getRepTimes ( ProcessedExercise exerciseProcessed ) { } private int findFirstSlowerRep ( List < Integer > repTimes , int oneRMtime ) { } private int getTimeLengthOfLastRep ( ProcessedExercise processedExercise ) { } public int get1RM ( int numOfReps , double weightLifted ) { <START_BUG> double oneRM = weightLifted * ( 1.0278 - ( 0.0278 * numOfReps ) ) ; <END_BUG> return ( ( int ) ( Math . round ( oneRM ) ) ) ; } private List < Double > setAverages ( List < SensorSample > rawSensorSamples ) { } }

Fix:
double oneRM = weightLifted // ( 1.0278 - ( 0.0278 * numOfReps ) ) ;
Buggy code:
public class EjbConcurrencyMergingProcessor extends AbstractMergingProcessor < SessionBeanComponentDescription > { public EjbConcurrencyMergingProcessor ( ) { } protected void handleAnnotations ( final DeploymentUnit deploymentUnit , final EEApplicationClasses applicationClasses , final DeploymentReflectionIndex deploymentReflectionIndex , final Class < ? > componentClass , final SessionBeanComponentDescription componentConfiguration ) { } protected void handleDeploymentDescriptor ( final DeploymentUnit deploymentUnit , final DeploymentReflectionIndex deploymentReflectionIndex , final Class < ? > componentClass , final SessionBeanComponentDescription componentConfiguration ) throws DeploymentUnitProcessingException { if ( ( componentConfiguration . getDescriptorData ( ) ) == null ) { return ; } SessionBeanMetaData sessionBeanMetaData = componentConfiguration . getDescriptorData ( ) ; if ( sessionBeanMetaData instanceof SessionBean31MetaData ) { SessionBean31MetaData descriptor = ( ( SessionBean31MetaData ) ( sessionBeanMetaData ) ) ; if ( ( descriptor . getLockType ( ) ) != null ) { componentConfiguration . setBeanLevelLockType ( componentConfiguration . getEJBClassName ( ) , descriptor . getLockType ( ) ) ; } if ( ( descriptor . getAccessTimeout ( ) ) != null ) { componentConfiguration . setBeanLevelAccessTimeout ( componentConfiguration . getEJBClassName ( ) , new org . jboss . as . ejb3 . concurrency . AccessTimeoutDetails ( descriptor . getAccessTimeout ( ) . getTimeout ( ) , descriptor . getAccessTimeout ( ) . getUnit ( ) ) ) ; } final ConcurrentMethodsMetaData methods = descriptor . getConcurrentMethods ( ) ; if ( methods != null ) { for ( final ConcurrentMethodMetaData method : methods ) { final Method realMethod = resolveMethod ( deploymentReflectionIndex , componentClass , method . getMethod ( ) ) ; final MethodIdentifier methodIdentifier = MethodIdentifier . getIdentifierForMethod ( realMethod ) ; if ( ( method . getLockType ( ) ) != null ) { componentConfiguration . setLockType ( method . getLockType ( ) , methodIdentifier ) ; } if ( ( method . getAccessTimeout ( ) ) != null ) { <START_BUG> componentConfiguration . setAccessTimeout ( new org . jboss . as . ejb3 . concurrency . AccessTimeoutDetails ( descriptor . getAccessTimeout ( ) . getTimeout ( ) , descriptor . getAccessTimeout ( ) . getUnit ( ) ) , methodIdentifier ) ; <END_BUG> } } } } } private Method resolveMethod ( final DeploymentReflectionIndex index , final Class < ? > componentClass , final NamedMethodMetaData methodData ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
componentConfiguration . setAccessTimeout ( new org . jboss . as . ejb3 . concurrency . AccessTimeoutDetails ( method . getAccessTimeout ( ) . getTimeout ( ) , method . getAccessTimeout ( ) . getUnit ( ) ) , methodIdentifier ) ;
Buggy code:
public class ProcessMessage { private static final String TAG = ProcessMessage . class . getSimpleName ( ) ; private Context context ; private ProcessSms processSms ; private String errorMessage ; private MessageResultsController mMessageResultsController ; private Prefs prefs ; public ProcessMessage ( Context context , ProcessSms processSms ) { } public boolean saveMessage ( Message message ) { } public boolean syncReceivedSms ( Message message , MessageSyncHttpClient client ) { } public String getPhoneNumber ( ) { } public boolean syncPendingMessages ( final String uuid ) { } public boolean routePendingMessage ( Message message ) { } private void deleteMessage ( Message message ) { } public void smsServerResponse ( SmssyncResponse response ) { } public void performTask ( SyncUrl syncUrl ) { } private void sendSMSWithMessageResultsAPIEnabled ( SyncUrl syncUrl , List < Message > msgs ) { } private void sendSMSWithMessageResultsAPIDisabled ( List < Message > msgs ) { } public boolean routeSms ( Message message ) { } private void savePendingMessage ( Message message ) { } private void deleteFromSmsInbox ( Message message ) { } private boolean processMessage ( Message message , SyncUrl syncUrl ) { boolean posted = false ; MessageSyncHttpClient client = new MessageSyncHttpClient ( context , syncUrl , message , getPhoneNumber ( ) , prefs . uniqueId ( ) . get ( ) ) ; if ( ! ( TextUtils . isEmpty ( syncUrl . getKeywords ( ) ) ) ) { String filterText = syncUrl . getKeywords ( ) ; if ( ( processSms . filterByKeywords ( message . getBody ( ) , filterText ) ) || ( processSms . filterByRegex ( message . getBody ( ) , filterText ) ) ) { Logger . log ( ProcessMessage . TAG , syncUrl . getUrl ( ) ) ; if ( ( message . getType ( ) ) == ( Type . PENDING ) ) { posted = syncReceivedSms ( message , client ) ; if ( posted ) { postToSentBox ( message ) ; } } else { posted = sendTaskSms ( message ) ; } } } else { if ( ( message . getType ( ) ) == ( Type . PENDING ) ) { posted = syncReceivedSms ( message , client ) ; setErrorMessage ( syncUrl . getUrl ( ) ) ; if ( posted ) { postToSentBox ( message ) ; } } else { posted = sendTaskSms ( message ) ; } } <START_BUG> if ( prefs . enableRetry ( ) . get ( ) ) { <END_BUG> if ( ! posted ) { Logger . log ( ProcessMessage . TAG , ( "Messages<seq2seq4repair_space>Not<seq2seq4repair_space>posted:<seq2seq4repair_space>" + message ) ) ; if ( ( message . getRetries ( ) ) >= ( prefs . retries ( ) . get ( ) ) ) { deleteMessage ( message ) ; } else { int retries = ( message . getRetries ( ) ) + 1 ; message . setRetries ( retries ) ; App . getDatabaseInstance ( ) . getMessageInstance ( ) . update ( message ) ; } } } return posted ; } private List < SyncUrl > fetchEnabledSyncUrl ( ) { } public boolean postToSentBox ( Message message ) { } public String getErrorMessage ( ) { } public void setErrorMessage ( String errorMessage ) { } public void logActivites ( String message ) { } private boolean sendTaskSms ( Message message ) { } }

Fix:
if ( ( prefs . enableRetry ( ) . get ( ) ) && ( ( message . getType ( ) ) == ( Type . PENDING ) ) ) {
Buggy code:
public class Oven extends BlockContainer { public Oven ( ) { } @ Override public TileEntity createNewTileEntity ( World world , int i ) { } @ Override public int getRenderType ( ) { } @ Override public boolean isOpaqueCube ( ) { } public boolean renderAsNormalBlock ( ) { } public void registerBlockIcons ( IIconRegister icon ) { <START_BUG> this . blockIcon = icon . registerIcon ( "extrafood:Zycrafted" ) ; <END_BUG> } private void setDefaultDirection ( World world , int x , int y , int z , EntityLivingBase entity ) { } @ Override public boolean onBlockActivated ( World world , int x , int y , int z , EntityPlayer player , int metadata , float what , float these , float are ) { } public void onBlockPlacedBy ( World world , int x , int y , int z , EntityLivingBase entity , ItemStack Itemstack ) { } }

Fix:
this . blockIcon = icon . registerIcon ( "extrafood:ItemOven" ) ;
Buggy code:
public class BindAndValidateLifecycleTests { private BindAndValidateLifecycle lifecycle ; private BindAndValidateLifecycleTests . TestBean model ; private DefaultAlertContext alertContext ; @ Before public void setUp ( ) { model = new BindAndValidateLifecycleTests . TestBean ( ) ; alertContext = new DefaultAlertContext ( ) ; Binder binder = new WebBinderFactory ( ) . getBinder ( model ) ; <START_BUG> lifecycle = new BindAndValidateLifecycle ( binder , alertContext ) ; <END_BUG> } @ Test public void testExecuteLifecycleNoErrors ( ) { } @ Test public void testExecuteLifecycleBindingErrors ( ) { } public static enum FooEnum { BAR , BAZ , BOOP ; } public static class TestBean { private String string ; private int integer ; private Date date ; private BindAndValidateLifecycleTests . FooEnum foo ; private BigDecimal currency ; private List < BindAndValidateLifecycleTests . FooEnum > foos ; private List < BindAndValidateLifecycleTests . Address > addresses ; public String getString ( ) { } public void setString ( String string ) { } public int getInteger ( ) { } public void setInteger ( int integer ) { } public Date getDate ( ) { } public void setDate ( Date date ) { } public BindAndValidateLifecycleTests . FooEnum getFoo ( ) { } public void setFoo ( BindAndValidateLifecycleTests . FooEnum foo ) { } @ CurrencyFormat public BigDecimal getCurrency ( ) { } public void setCurrency ( BigDecimal currency ) { } public List < BindAndValidateLifecycleTests . FooEnum > getFoos ( ) { } public void setFoos ( List < BindAndValidateLifecycleTests . FooEnum > foos ) { } public List < BindAndValidateLifecycleTests . Address > getAddresses ( ) { } public void setAddresses ( List < BindAndValidateLifecycleTests . Address > addresses ) { } } public static class Address { private String street ; private String city ; private String state ; private String zip ; private String country ; public String getStreet ( ) { } public void setStreet ( String street ) { } public String getCity ( ) { } public void setCity ( String city ) { } public String getState ( ) { } public void setState ( String state ) { } public String getZip ( ) { } public void setZip ( String zip ) { } public String getCountry ( ) { } public void setCountry ( String country ) { } } @ Model ( value = "testBean" , strictBinding = true ) public class TestAnnotatedBean { private String editable ; private String notEditable ; @ Bound public String getEditable ( ) { } public void setEditable ( String editable ) { } public String getNotEditable ( ) { } public void setNotEditable ( String notEditable ) { } } }

Fix:
lifecycle = new BindAndValidateLifecycle ( binder , null , alertContext ) ;
Buggy code:
@ Service public class EtablissementServiceImpl implements IEtablissementService { @ Autowired private IUserService userService ; @ Override public FlashInfoList retrieveInfos ( String escouai ) { <START_BUG> if ( ( ( escouai . equals ( null ) ) || ( escouai . equals ( "" ) ) ) || ( escouai . equals ( "guest" ) ) ) { <END_BUG> return this . userService . retrieveGuestFlashInfo ( ) ; } else { return this . userService . retrieveEtabInfos ( escouai ) ; } } }

Fix:
if ( ( ( escouai == null ) || ( escouai . equals ( "" ) ) ) || ( escouai . equals ( "guest" ) ) ) {
Buggy code:
public class ClientInvocationFuture < V > implements ICompletableFuture < V > { static final ILogger LOGGER = Logger . getLogger ( ClientInvocationFuture . class ) ; private final ClientRequest request ; private final ClientExecutionServiceImpl executionService ; private final ClientListenerServiceImpl clientListenerService ; private final SerializationService serializationService ; private final EventHandler handler ; private final List < ClientInvocationFuture < V > . ExecutionCallbackNode > callbackNodeList = new LinkedList < ClientInvocationFuture < V > . ExecutionCallbackNode > ( ) ; private final ClientInvocation invocation ; private volatile Object response ; public ClientInvocationFuture ( ClientInvocation invocation , HazelcastClientInstanceImpl client , ClientRequest request , EventHandler handler ) { } @ Override public boolean cancel ( boolean mayInterruptIfRunning ) { } @ Override public boolean isCancelled ( ) { } @ Override public boolean isDone ( ) { } @ Override public V get ( ) throws InterruptedException , ExecutionException { } @ Override public V get ( long timeout , TimeUnit unit ) throws InterruptedException , ExecutionException , TimeoutException { final int heartBeatInterval = invocation . getHeartBeatInterval ( ) ; if ( ( response ) == null ) { long waitMillis = unit . toMillis ( timeout ) ; if ( waitMillis > 0 ) { synchronized ( this ) { while ( ( waitMillis > 0 ) && ( ( response ) == null ) ) { long start = Clock . currentTimeMillis ( ) ; this . wait ( Math . min ( heartBeatInterval , waitMillis ) ) ; long elapsed = ( Clock . currentTimeMillis ( ) ) - start ; waitMillis -= elapsed ; <START_BUG> if ( ! ( invocation . isConnectionHealthy ( elapsed ) ) ) { <END_BUG> invocation . notify ( new TargetDisconnectedException ( ) ) ; } } } } } return resolveResponse ( ) ; } void setResponse ( Object response ) { } private V resolveResponse ( ) throws InterruptedException , ExecutionException , TimeoutException { } @ Override public void andThen ( ExecutionCallback < V > callback ) { } @ Override public void andThen ( ExecutionCallback < V > callback , Executor executor ) { } public void andThenInternal ( ExecutionCallback < Data > callback ) { } public ClientRequest getRequest ( ) { } public EventHandler getHandler ( ) { } private void runAsynchronous ( final ExecutionCallback callback , Executor executor , final boolean deserialized ) { } class ExecutionCallbackNode { final ExecutionCallback callback ; final Executor executor ; final boolean deserialized ; ExecutionCallbackNode ( ExecutionCallback callback , Executor executor , boolean deserialized ) { } } }

Fix:
if ( ! ( invocation . shouldContinueWaiting ( elapsed ) ) ) {
Buggy code:
public class PacienteController extends Controller { @ Transactional @ BodyParser . Of ( Json . class ) public static Result create ( ) { } @ Transactional public static Result delete ( Long id ) { Paciente p = JPA . em ( ) . find ( Paciente . class , id ) ; JPA . em ( ) . remove ( p ) ; <START_BUG> return redirect ( routes . PacienteController . getAll ( ) ) ; <END_BUG> } @ Transactional @ BodyParser . Of ( Json . class ) public static Result update ( ) { } @ Transactional public static Result getOne ( Long id ) { } @ Transactional public static Result getAll ( ) { } }

Fix:
return Results . ok ( ) ;
Buggy code:
public abstract class PerspectiveMenu extends ContributionItem { private static IPerspectiveRegistry reg ; private IWorkbenchWindow window ; private boolean showActive = false ; private boolean dirty = true ; private IMenuListener menuListener = new IMenuListener ( ) { public void menuAboutToShow ( IMenuManager manager ) { } } ; private Comparator comparator = new Comparator ( ) { private Collator collator = Collator . getInstance ( ) ; public int compare ( Object ob1 , Object ob2 ) { } } ; private static Hashtable imageCache = new Hashtable ( 11 ) ; public PerspectiveMenu ( IWorkbenchWindow window , String id ) { } void createMenuItem ( Menu menu , int index , final IPerspectiveDescriptor desc , boolean bCheck ) { } void createOtherItem ( Menu menu , int index ) { } public void fill ( Menu menu , int index ) { } private Image getImage ( IPerspectiveDescriptor perspDesc ) { } private ArrayList getPerspectiveShortcuts ( ) { ArrayList list = new ArrayList ( ) ; IWorkbenchPage page = window . getActivePage ( ) ; if ( page == null ) return list ; ArrayList ids = ( ( org . eclipse . ui . internal . WorkbenchPage ) ( page ) ) . getPerspectiveActionIds ( ) ; if ( ids == null ) return list ; RoleManager manager = RoleManager . getInstance ( ) ; for ( int i = 0 ; i < ( ids . size ( ) ) ; i ++ ) { String perspID = ( ( String ) ( ids . get ( i ) ) ) ; <START_BUG> if ( ( manager . filterRoles ) && ( ! ( manager . isEnabledId ( perspID ) ) ) ) <END_BUG> continue ; IPerspectiveDescriptor desc = PerspectiveMenu . reg . findPerspectiveWithId ( perspID ) ; if ( ( desc != null ) && ( ! ( list . contains ( desc ) ) ) ) list . add ( desc ) ; } return list ; } protected ArrayList getPerspectiveItems ( ) { } protected boolean getShowActive ( ) { } protected IWorkbenchWindow getWindow ( ) { } public boolean isDirty ( ) { } public boolean isDynamic ( ) { } protected abstract void run ( IPerspectiveDescriptor desc ) { } protected void run ( IPerspectiveDescriptor desc , SelectionEvent event ) { } void runOther ( SelectionEvent event ) { } protected void showActive ( boolean b ) { } }

Fix:
if ( ( manager . isFiltering ( ) ) && ( ! ( manager . isEnabledId ( perspID ) ) ) )
Buggy code:
public class JSLPDiscoveryContainer extends AbstractDiscoveryContainerAdapter implements IDiscoveryService { public static final String NAME = "ecf.discovery.jslp" ; public static long REDISCOVER = Long . parseLong ( System . getProperty ( "net.slp.rediscover" , new Long ( ( 60L * 1000L ) ) . toString ( ) ) ) ; private JSLPDiscoveryJob discoveryJob ; private ID targetID ; public JSLPDiscoveryContainer ( ) throws IDCreateException { } public void connect ( ID aTargetID , IConnectContext connectContext ) throws ContainerConnectException { } public void disconnect ( ) { } public void fireServiceDiscovered ( IServiceInfo iinfo ) { } public void fireServiceTypeDiscovered ( IServiceTypeID serviceTypeID ) { } public void fireServiceUndiscovered ( IServiceInfo iinfo ) { } public ID getConnectedID ( ) { } public IServiceInfo getServiceInfo ( IServiceID service ) { } public IServiceTypeID [ ] getServiceTypes ( ) { List result = new ArrayList ( ) ; try { ServiceLocationEnumeration slenum = Activator . getDefault ( ) . getLocator ( ) . findServiceTypes ( null , null ) ; for ( ; slenum . hasMoreElements ( ) ; ) { ServiceType st = new ServiceType ( ( ( String ) ( slenum . nextElement ( ) ) ) ) ; <START_BUG> IServiceID sid = ( ( IServiceID ) ( getConnectNamespace ( ) . createInstance ( new Object [ ] { st . toString ( ) } ) ) ) ; <END_BUG> result . add ( sid . getServiceTypeID ( ) ) ; } } catch ( ServiceLocationException e ) { Trace . catching ( PLUGIN_ID , EXCEPTIONS_CATCHING , this . getClass ( ) , "getServiceTypes(int)" , e ) ; } catch ( IDCreateException e ) { Trace . catching ( PLUGIN_ID , EXCEPTIONS_CATCHING , this . getClass ( ) , "getServiceTypes(int)" , e ) ; } return ( ( IServiceTypeID [ ] ) ( result . toArray ( new IServiceTypeID [ result . size ( ) ] ) ) ) ; } public IServiceInfo [ ] getServices ( ) { } public IServiceInfo [ ] getServices ( IServiceTypeID type ) { } public void registerService ( IServiceInfo aServiceInfo ) throws ECFException { } public void unregisterService ( IServiceInfo aServiceInfo ) throws ECFException { } private IServiceInfo [ ] convertToIServiceInfo ( Map serviceURLs ) { } private IServiceInfo [ ] convertToIServiceInfo ( Map serviceURLs , String [ ] scopes ) { } }

Fix:
IServiceID sid = ( ( IServiceID ) ( getConnectNamespace ( ) . createInstance ( new Object [ ] { st , "" } ) ) ) ;
Buggy code:
public class FlatFileCache { private static final Logger logger = LoggerFactory . getLogger ( FlatFileCache . class ) ; private static FlatFileCache me ; private static SoftHashMap < String , byte [ ] > cache = new SoftHashMap < String , byte [ ] > ( 0 ) ; public static FlatFileCache getInstance ( ) { } private FlatFileCache ( ) { } public static void addToCache ( String key , File fileToCache ) { try { InputStream is = new FileInputStream ( fileToCache ) ; long length = fileToCache . length ( ) ; if ( length > ( Integer . MAX_VALUE ) ) { } byte [ ] bytes = new byte [ ( ( int ) ( length ) ) ] ; int offset = 0 ; int numRead = 0 ; while ( ( offset < ( bytes . length ) ) && ( ( numRead = is . read ( bytes , offset , ( ( bytes . length ) - offset ) ) ) >= 0 ) ) { offset += numRead ; } if ( offset < ( bytes . length ) ) { is . close ( ) ; throw new IOException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>completely<seq2seq4repair_space>read<seq2seq4repair_space>file<seq2seq4repair_space>" + ( fileToCache . getName ( ) ) ) ) ; } is . close ( ) ; FlatFileCache . cache . put ( key , bytes ) ; } catch ( Exception e ) { <START_BUG> FlatFileCache . logger . error ( ( "Error<seq2seq4repair_space>adding<seq2seq4repair_space>to<seq2seq4repair_space>cache!<seq2seq4repair_space>{}" + ( e . getMessage ( ) ) ) , e ) ; <END_BUG> } } public static InputStream getInputStream ( String key ) { } public int size ( ) { } public void clear ( ) { } public static void destroy ( ) { } }

Fix:
FlatFileCache . logger . error ( ( "Error<seq2seq4repair_space>adding<seq2seq4repair_space>to<seq2seq4repair_space>cache!<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) , e ) ;
Buggy code:
public class SimulatedMFXLocomotiveStrategy extends LocomotiveStrategy { @ Override public void setSpeed ( final SRCPLocomotive locomotive , final int speed , boolean [ ] functions ) throws SRCPException { } @ Override public void initLocomotive ( final SRCPLocomotive locomotive , final SRCPSession session , final SRCPLockControl lockControl ) throws SRCPLocomotiveException { } private void initLocomotive ( final DoubleMMDigitalLocomotive locomotive ) throws SRCPLocomotiveException { } @ Override public boolean [ ] getEmergencyStopFunctions ( final SRCPLocomotive locomotive , final int emergencyStopFunction ) { } @ Override public void mergeFunctions ( SRCPLocomotive locomotive , int address , boolean [ ] newFunctions ) { DoubleMMDigitalLocomotive simulatedMfxLocomotive = ( ( DoubleMMDigitalLocomotive ) ( locomotive ) ) ; int startOffset = 0 ; if ( ( simulatedMfxLocomotive . getAddress2 ( ) ) == address ) { startOffset = 5 ; } boolean [ ] mergedFunctions = Arrays . copyOf ( locomotive . getFunctions ( ) , locomotive . getFunctions ( ) . length ) ; for ( int i = startOffset ; i < ( startOffset + ( newFunctions . length ) ) ; i ++ ) { <START_BUG> mergedFunctions [ i ] = newFunctions [ i ] ; <END_BUG> } simulatedMfxLocomotive . setFunctions ( mergedFunctions ) ; } }

Fix:
mergedFunctions [ i ] = newFunctions [ ( i - startOffset ) ] ;
Buggy code:
public class SendMail extends Thread { private TestFile test ; private String u1 ; private String u2 ; private String u3 ; public SendMail ( TestFile test ) { } public void run ( ) { JTextField uField = new JTextField ( 10 ) ; JPasswordField pField = new JPasswordField ( 10 ) ; JTextField tField = new JTextField ( 10 ) ; WebButton disclaimerButton = new WebButton ( "Disclaimer" ) ; JPanel myPanel = new JPanel ( ) ; myPanel . add ( new JLabel ( "Email:" ) ) ; myPanel . add ( uField ) ; myPanel . add ( Box . createHorizontalStrut ( 15 ) ) ; myPanel . add ( new JLabel ( "Password:" ) ) ; myPanel . add ( pField ) ; myPanel . add ( Box . createHorizontalStrut ( 15 ) ) ; myPanel . add ( new JLabel ( "Send<seq2seq4repair_space>To:" ) ) ; myPanel . add ( tField ) ; myPanel . add ( disclaimerButton ) ; disclaimerButton . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent arg0 ) { JOptionPane . showMessageDialog ( myPanel , ( "This<seq2seq4repair_space>program<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>store<seq2seq4repair_space>your<seq2seq4repair_space>password<seq2seq4repair_space>to<seq2seq4repair_space>keep<seq2seq4repair_space>it<seq2seq4repair_space>safe.\n" + "Make<seq2seq4repair_space>sure<seq2seq4repair_space>that<seq2seq4repair_space>you<seq2seq4repair_space>only<seq2seq4repair_space>type<seq2seq4repair_space>your<seq2seq4repair_space>details<seq2seq4repair_space>into<seq2seq4repair_space>programs<seq2seq4repair_space>and<seq2seq4repair_space>websites<seq2seq4repair_space>that<seq2seq4repair_space>you<seq2seq4repair_space>trust" ) , "Warning" , JOptionPane . WARNING_MESSAGE ) ; } } ) ; int result = JOptionPane . showConfirmDialog ( null , myPanel , "Send<seq2seq4repair_space>screenshot" , JOptionPane . OK_CANCEL_OPTION ) ; if ( result == ( JOptionPane . OK_OPTION ) ) { u1 = uField . getText ( ) ; <START_BUG> u2 = pField . getText ( ) ; <END_BUG> u3 = tField . getText ( ) ; System . out . println ( ( "u<seq2seq4repair_space>value:<seq2seq4repair_space>" + ( uField . getText ( ) ) ) ) ; if ( u1 . contains ( "@reading-school.co.uk" ) ) { try { mail ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } else { System . out . println ( "not<seq2seq4repair_space>reading<seq2seq4repair_space>school" ) ; } } } public void mail ( ) throws IOException { } No newline ; at end ; of file ; }

Fix:
u2 = new String ( pField . getPassword ( ) ) ;
Buggy code:
public abstract class ContentStreamBase implements ContentStream { public static final String DEFAULT_CHARSET = "utf-8" ; protected String name ; protected String sourceInfo ; protected String contentType ; protected Long size ; public static String getCharsetFromContentType ( String contentType ) { } public static class URLStream extends ContentStreamBase { private final URL url ; final URLConnection conn ; public URLStream ( URL url ) throws IOException { } public InputStream getStream ( ) throws IOException { return conn . getInputStream ( ) ; } } public static class FileStream extends ContentStreamBase { private final File file ; public FileStream ( File f ) throws IOException { } public InputStream getStream ( ) throws IOException { return new FileInputStream ( file ) ; } @ Override public Reader getReader ( ) throws IOException { } } public static class StringStream extends ContentStreamBase { private final String str ; public StringStream ( String str ) { } public InputStream getStream ( ) throws IOException { <START_BUG> return new ByteArrayInputStream ( str . getBytes ( ) ) ; <END_BUG> } @ Override public Reader getReader ( ) throws IOException { } } public Reader getReader ( ) throws IOException { } public String getContentType ( ) { } public void setContentType ( String contentType ) { } public String getName ( ) { } public void setName ( String name ) { } public Long getSize ( ) { } public void setSize ( Long size ) { } public String getSourceInfo ( ) { } public void setSourceInfo ( String sourceInfo ) { } }

Fix:
return new ByteArrayInputStream ( str . getBytes ( ContentStreamBase . DEFAULT_CHARSET ) ) ;
Buggy code:
public class EJBViewDescription extends ViewDescription { private final MethodIntf methodIntf ; private final boolean hasJNDIBindings ; private boolean ejb2xView = false ; public EJBViewDescription ( final ComponentDescription componentDescription , final String viewClassName , final MethodIntf methodIntf ) { } public MethodIntf getMethodIntf ( ) { } @ Override public ViewConfiguration createViewConfiguration ( final Class < ? > viewClass , final ComponentConfiguration componentConfiguration , final ProxyFactory < ? > proxyFactory ) { } @ Override public boolean equals ( Object o ) { } @ Override protected InjectionSource createInjectionSource ( final ServiceName serviceName ) { <START_BUG> if ( ( methodIntf ) != ( MethodIntf . REMOTE ) ) { <END_BUG> return super . createInjectionSource ( serviceName ) ; } else { final EJBComponentDescription componentDescription = getComponentDescription ( ) ; final EEModuleDescription desc = componentDescription . getModuleDescription ( ) ; return new org . jboss . as . ejb3 . remote . RemoteViewInjectionSource ( serviceName , desc . getApplicationName ( ) , desc . getModuleName ( ) , desc . getDistinctName ( ) , componentDescription . getComponentName ( ) , getViewClassName ( ) , componentDescription . isStateful ( ) ) ; } } @ Override public EJBComponentDescription getComponentDescription ( ) { } @ Override public ServiceName getServiceName ( ) { } @ Override public int hashCode ( ) { } public boolean hasJNDIBindings ( ) { } private boolean initHasJNDIBindings ( final MethodIntf methodIntf ) { } public boolean isEjb2xView ( ) { } public void setEjb2xView ( final boolean ejb2xView ) { } }

Fix:
if ( ( ( methodIntf ) != ( MethodIntf . REMOTE ) ) && ( ( methodIntf ) != ( MethodIntf . HOME ) ) ) {