nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class WicketRemoveTagHandler extends BaseMarkupFilter { public static final String REMOVE = "remove" ; public WicketRemoveTagHandler ( ) { } @ Override protected final MarkupElement nextTag ( ComponentTag tag ) throws ParseException { if ( ( ! ( tag instanceof WicketTag ) ) || ( ! ( ( ( WicketTag ) ( tag ) ) . isRemoveTag ( ) ) ) ) { return tag ; } if ( tag . isOpenClose ( ) ) { throw new org . apache . wicket . markup . WicketParseException ( "Wicket<seq2seq4repair_space>remove<seq2seq4repair_space>tag<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>an<seq2seq4repair_space>open-close<seq2seq4repair_space>tag:" , tag ) ; } ComponentTag closeTag ; <START_BUG> while ( null != ( closeTag = ( ( ComponentTag ) ( getParent ( ) . nextTag ( ) ) ) ) ) { <END_BUG> if ( ( closeTag . getId ( ) ) == null ) { continue ; } if ( closeTag . closes ( tag ) ) { tag . setIgnore ( true ) ; return tag ; } throw new org . apache . wicket . markup . WicketParseException ( "Markup<seq2seq4repair_space>remove<seq2seq4repair_space>regions<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>contain<seq2seq4repair_space>Wicket<seq2seq4repair_space>component<seq2seq4repair_space>tags:" , closeTag ) ; } throw new org . apache . wicket . markup . WicketParseException ( "Did<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>close<seq2seq4repair_space>tag<seq2seq4repair_space>for<seq2seq4repair_space>markup<seq2seq4repair_space>remove<seq2seq4repair_space>region.<seq2seq4repair_space>Open<seq2seq4repair_space>tag:" , tag ) ; } }

Fix:
while ( null != ( closeTag = ( ( ComponentTag ) ( getNextFilter ( ) . nextTag ( ) ) ) ) ) {
Buggy code:
public class Area implements Serializable { public String Name ; private int BuildingCost ; private int Number ; private boolean IsBuilt ; private boolean IsTrouble ; public String CityAreaCardName ; private Pieces TroubleMakers ; public List < Pieces > ListDemons ; private List < Pieces > ListTrolls ; public List < Pieces > ListMinions ; private Pieces Building ; private String AdjArea ; public Pieces GetBuilding ( ) { } public String toString ( ) { } public Area ( String _Name , int _Number , int _Cost , String adjArea ) { } public boolean GetIsBuilt ( ) { } public void SetIsBuilt ( boolean isBuilt ) { } public boolean GetIsTrouble ( ) { } public void SetIsTrouble ( boolean isTrouble ) { } public String GetName ( ) { } public int GetAreaCost ( ) { } public int GetDemonCount ( ) { } public int GetTrollCount ( ) { } public int GetMinionCount ( Colors Color ) { } public void AddDemons ( Pieces p ) { } public void AddTrolls ( Pieces p ) { } public void AddTroubleMaker ( Pieces p ) { } public void AddMinions ( Pieces p ) { } public void AddBuilding ( Pieces b ) { } public boolean RemoveDemons ( ) { } public boolean RemoveTrolls ( ) { } public boolean HasTroubleMaker ( ) { } public boolean RemoveTroubleMaker ( ) { } public boolean RemoveMinions ( Colors Color ) { } public boolean RemoveBuilding ( ) { } public boolean HasBuilding ( ) { } public String ReportMinion ( ) { } public void PrintState ( ) { } public void Assassinate ( Pieces p ) { } public boolean AreaAdjacency ( int area2 ) { } public int [ ] GetAdjAreas ( ) { } public boolean AreaControllled ( Colors color ) { <START_BUG> if ( ( this . Building . GetPieceColor ( ) ) == color ) { <END_BUG> return true ; } else if ( ( this . ListDemons . size ( ) ) > 0 ) { return false ; } else { if ( ( this . GetMinionCount ( color ) ) == 1 ) { if ( ( ( this . GetMinionCount ( None ) ) == 1 ) && ( ( this . GetTrollCount ( ) ) == 0 ) ) { return true ; } else { return false ; } } else { int countThis = this . GetMinionCount ( color ) ; int countRed = this . GetMinionCount ( Red ) ; int countBlue = this . GetMinionCount ( Blue ) ; int countYellow = this . GetMinionCount ( Yellow ) ; int countGreen = this . GetMinionCount ( Green ) ; int [ ] ColorCount = new int [ ] { countRed , countRed , countYellow , countGreen } ; int maxVal = 0 ; for ( int i : ColorCount ) { if ( i >= maxVal ) { maxVal = i ; } } return countThis == maxVal ; } } } }

Fix:
if ( ( this . IsBuilt ) && ( ( this . Building . GetPieceColor ( ) ) == color ) ) {
Buggy code:
public class DoubleConverter extends AbstractDecimalConverter < Double > { private static final long serialVersionUID = 1L ; public static final IConverter < Double > INSTANCE = new DoubleConverter ( ) ; public Double convertToObject ( final String value , Locale locale ) { final Number number = parse ( value , ( - ( Double . MAX_VALUE ) ) , Double . MAX_VALUE , locale ) ; if ( number == null ) { return null ; } <START_BUG> return new Double ( number . doubleValue ( ) ) ; <END_BUG> } @ Override protected Class < Double > getTargetType ( ) { } }

Fix:
return number . doubleValue ( ) ;
Buggy code:
public class Loader { private final List < LoadStep > preLoadSteps = new ArrayList < > ( ) ; private final Set < Integer > preAsyncSteps = new HashSet < > ( ) ; private List < LoadStep > loadSteps ; private Set < Integer > asyncSteps ; private final JavaPlugin plugin ; private volatile boolean isLoading = false ; private int stepIndex = 0 ; public Loader ( JavaPlugin plugin ) { } public void addStep ( LoadStep step ) { } public void addAsyncStep ( LoadStep step ) { } public void load ( final LoadCallback callback ) { if ( isLoading ) throw new IllegalStateException ( "Loader<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>loading!" ) ; loadSteps = Collections . unmodifiableList ( preLoadSteps ) ; <START_BUG> asyncSteps = Collections . unmodifiableSet ( asyncSteps ) ; <END_BUG> isLoading = true ; load ( 0 , ( success ) -> { isLoading = false ; callback . reloadFinished ( success ) ; } , false ) ; } private void load ( final int stepIndex , final LoadCallback callback , final boolean onAsyncThread ) { } private void callCallback ( final boolean success , final LoadCallback callback , final boolean onAsyncThread ) { } private boolean isAsync ( int stepIndex ) { } }

Fix:
asyncSteps = Collections . unmodifiableSet ( preAsyncSteps ) ;
Buggy code:
class IntegerEndpoint extends AbstractEndpoint < Integer > { public IntegerEndpoint ( RegisterImpl reg , EndpointDef epDef ) { } @ Override public Type getType ( ) { } @ Override public Integer getValue ( ) throws GatewayException { } @ Override public void setValue ( Integer value ) throws GatewayException { byte [ ] bytes ; if ( reg . hasValue ( ) ) { bytes = reg . getValue ( ) ; } else { bytes = new byte [ epDef . getRegister ( ) . getByteSize ( ) ] ; } long val = value . longValue ( ) ; for ( int i = ( epDef . getSize ( ) . getBytes ( ) ) - 1 ; i >= 0 ; -- i ) { <START_BUG> bytes [ i ] = ( ( byte ) ( val & 255 ) ) ; <END_BUG> val = val > > > 8 ; } reg . setValue ( bytes ) ; } @ Override protected Integer transformIn ( Integer value , Unit unit ) { } @ Override protected Integer transformOut ( Integer value , Unit unit ) { } }

Fix:
bytes [ ( ( epDef . getPosition ( ) . getBytePos ( ) ) + i ) ] = ( ( byte ) ( val & 255 ) ) ;
Buggy code:
abstract class ReadOnlySystemAttributesMap implements Map < String , String > { @ Override public boolean containsKey ( Object key ) { } @ Override public String get ( Object key ) { <START_BUG> Assert . isInstanceOf ( String . class , key , String . format ( "expected<seq2seq4repair_space>key<seq2seq4repair_space>[%s]<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>String,<seq2seq4repair_space>got<seq2seq4repair_space>%s" , key , key . getClass ( ) . getName ( ) ) ) ; <END_BUG> return this . getSystemAttribute ( ( ( String ) ( key ) ) ) ; } @ Override public boolean isEmpty ( ) { } protected abstract String getSystemAttribute ( String attributeName ) { } @ Override public int size ( ) { } @ Override public String put ( String key , String value ) { } @ Override public boolean containsValue ( Object value ) { } @ Override public String remove ( Object key ) { } @ Override public void clear ( ) { } @ Override public Set < String > keySet ( ) { } @ Override public void putAll ( Map < ? extends String , ? extends String > map ) { } @ Override public Collection < String > values ( ) { } @ Override public Set < Map . Entry < String , String > > entrySet ( ) { } }

Fix:
Assert . isInstanceOf ( String . class , key , String . format ( "Expected<seq2seq4repair_space>key<seq2seq4repair_space>[%s]<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>String,<seq2seq4repair_space>got<seq2seq4repair_space>%s" , key , key . getClass ( ) . getName ( ) ) ) ;
Buggy code:
public class WithincodePointcut extends Pointcut { SignaturePattern signature ; public WithincodePointcut ( SignaturePattern signature ) { } <START_BUG> public FuzzyBoolean fastMatch ( ResolvedTypeX type ) { <END_BUG> return FuzzyBoolean . MAYBE ; } public FuzzyBoolean match ( Shadow shadow ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( DataInputStream s , ISourceContext context ) throws IOException { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public void postRead ( ResolvedTypeX enclosingType ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public Pointcut concretize1 ( ResolvedTypeX inAspect , IntMap bindings ) { } }

Fix:
public FuzzyBoolean fastMatch ( FastMatchInfo type ) {
Buggy code:
public class ContentAssistField extends DecoratedField { private ContentAssistCommandAdapter adapter ; private static final String CONTENT_ASSIST_DECORATION_ID = "org.eclipse.ui.fieldAssist.ContentAssistField" ; public ContentAssistField ( Composite parent , int style , IControlCreator controlCreator , IControlContentAdapter controlContentAdapter , IContentProposalProvider proposalProvider , String commandId , char [ ] autoActivationCharacters ) { } public void setEnabled ( boolean enabled ) { } private FieldDecoration getFieldDecoration ( ) { FieldDecorationRegistry registry = FieldDecorationRegistry . getDefault ( ) ; String decId = ( ContentAssistField . CONTENT_ASSIST_DECORATION_ID ) + ( adapter . getCommandId ( ) ) ; FieldDecoration dec = registry . getFieldDecoration ( decId ) ; if ( dec == null ) { FieldDecoration originalDec = registry . getFieldDecoration ( DEC_CONTENT_PROPOSAL ) ; registry . registerFieldDecoration ( decId , null , originalDec . getImage ( ) ) ; dec = registry . getFieldDecoration ( decId ) ; } <START_BUG> IBindingService bindingService = ( ( IBindingService ) ( PlatformUI . getWorkbench ( ) . getAdapter ( IBindingService . class ) ) ) ; <END_BUG> dec . setDescription ( NLS . bind ( ContentAssist_Cue_Description_Key , bindingService . getBestActiveBindingFormattedFor ( adapter . getCommandId ( ) ) ) ) ; return dec ; } public ContentAssistCommandAdapter getContentAssistCommandAdapter ( ) { } }

Fix:
IBindingService bindingService = ( ( IBindingService ) ( PlatformUI . getWorkbench ( ) . getService ( IBindingService . class ) ) ) ;
Buggy code:
@ ManagedBean @ ViewScoped public class EditAirportBean { public EditAirportBean ( ) { } private int id ; private String name ; private String code ; private String country ; private int city ; @ Autowired @ ManagedProperty ( "#{countryService}" ) private CountryService countryService ; @ Autowired @ ManagedProperty ( "#{cityService}" ) private CityService cityService ; @ Autowired @ ManagedProperty ( "#{airportService}" ) private AirportService airportService ; private List < CountryEntity > countries ; private List < CityEntity > cities ; public String getName ( ) { } public void setName ( String name ) { } public String getCode ( ) { } public void setCode ( String code ) { } public String getCountry ( ) { } public void setCountry ( String country ) { } public List < CountryEntity > getCountries ( ) { } public void setCountries ( List < CountryEntity > countries ) { } public List < CityEntity > getCities ( ) { } public void setCities ( List < CityEntity > cities ) { } public int getCity ( ) { } public void setCity ( int city ) { } public CountryService getCountryService ( ) { } public void setCountryService ( CountryService countryService ) { } public CityService getCityService ( ) { } public void setCityService ( CityService cityService ) { } public AirportService getAirportService ( ) { } public void setAirportService ( AirportService airportService ) { } @ PostConstruct public void init ( ) { } public String editAirportAction ( ) { AirportEntity airportEdit = new AirportEntity ( ) ; airportEdit . setName ( this . getName ( ) ) ; airportEdit . setCode ( this . code ) ; airportEdit . setCountry ( Utils . getCountryFromList ( this . country , this . countries ) ) ; airportEdit . setCity ( Utils . getCityFromList ( this . city , this . cities ) ) ; AirportEntity airportUpdated = this . airportService . updateAirport ( this . id , airportEdit , true ) ; if ( airportUpdated == null ) { } else { } <START_BUG> return "airport" ; <END_BUG> } }

Fix:
return "//airport//index?faces-redirect=true" ;
Buggy code:
public class GuestBookApplication extends WicketExampleApplication { public GuestBookApplication ( ) { } @ Override public Class < ? extends Page > getHomePage ( ) { } @ Override public ISessionFactory getSessionFactory ( ) { return new ISessionFactory ( ) { <START_BUG> public Session newSession ( Request request ) { <END_BUG> return new GuestBookSession ( GuestBookApplication . this ) ; } } ; } }

Fix:
public Session newSession ( final Request request ) {
Buggy code:
public class TestPerFieldDocValuesFormat extends BaseDocValuesFormatTestCase { private Codec codec ; @ Override public void setUp ( ) throws Exception { } @ Override protected Codec getCodec ( ) { } @ Override protected boolean codecAcceptsHugeBinaryValues ( String field ) { } public void testTwoFieldsTwoFormats ( ) throws IOException { Analyzer analyzer = new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ; Directory directory = newDirectory ( ) ; IndexWriterConfig iwc = newIndexWriterConfig ( TEST_VERSION_CURRENT , analyzer ) ; final DocValuesFormat fast = DocValuesFormat . forName ( "Lucene45" ) ; final DocValuesFormat slow = DocValuesFormat . forName ( "SimpleText" ) ; iwc . setCodec ( new Lucene46Codec ( ) { @ Override public DocValuesFormat getDocValuesFormatForField ( String field ) { if ( "dv1" . equals ( field ) ) { return fast ; } else { return slow ; } } } ) ; IndexWriter iwriter = new IndexWriter ( directory , iwc ) ; Document doc = new Document ( ) ; String longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm" ; String text = "This<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>text<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>indexed.<seq2seq4repair_space>" + longTerm ; doc . add ( newTextField ( "fieldname" , text , YES ) ) ; doc . add ( new NumericDocValuesField ( "dv1" , 5 ) ) ; doc . add ( new org . apache . lucene . document . BinaryDocValuesField ( "dv2" , new BytesRef ( "hello<seq2seq4repair_space>world" ) ) ) ; iwriter . addDocument ( doc ) ; <START_BUG> iwriter . close ( ) ; <END_BUG> IndexReader ireader = DirectoryReader . open ( directory ) ; IndexSearcher isearcher = newSearcher ( ireader ) ; assertEquals ( 1 , isearcher . search ( new org . apache . lucene . search . TermQuery ( new Term ( "fieldname" , longTerm ) ) , 1 ) . totalHits ) ; Query query = new org . apache . lucene . search . TermQuery ( new Term ( "fieldname" , "text" ) ) ; TopDocs hits = isearcher . search ( query , null , 1 ) ; assertEquals ( 1 , hits . totalHits ) ; BytesRef scratch = new BytesRef ( ) ; for ( int i = 0 ; i < ( hits . scoreDocs . length ) ; i ++ ) { StoredDocument hitDoc = isearcher . doc ( hits . scoreDocs [ i ] . doc ) ; assertEquals ( text , hitDoc . get ( "fieldname" ) ) ; assert ( ireader . leaves ( ) . size ( ) ) == 1 ; NumericDocValues dv = ireader . leaves ( ) . get ( 0 ) . reader ( ) . getNumericDocValues ( "dv1" ) ; assertEquals ( 5 , dv . get ( hits . scoreDocs [ i ] . doc ) ) ; BinaryDocValues dv2 = ireader . leaves ( ) . get ( 0 ) . reader ( ) . getBinaryDocValues ( "dv2" ) ; dv2 . get ( hits . scoreDocs [ i ] . doc , scratch ) ; assertEquals ( new BytesRef ( "hello<seq2seq4repair_space>world" ) , scratch ) ; } ireader . close ( ) ; directory . close ( ) ; } }

Fix:
iwriter . shutdown ( ) ;
Buggy code:
public class ToolBar extends Composite { ToolItem lastFocus ; public ToolBar ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void createHandle ( int index ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } int eventHandle ( ) { } boolean forceFocus ( int focusHandle ) { } public ToolItem getItem ( int index ) { } public ToolItem getItem ( Point point ) { } public int getItemCount ( ) { } public ToolItem [ ] getItems ( ) { } public int getRowCount ( ) { } int gtk_key_press_event ( int widget , int eventPtr ) { if ( ! ( hasFocus ( ) ) ) return 0 ; int result = super . gtk_key_press_event ( widget , eventPtr ) ; if ( result != 0 ) return result ; ToolItem [ ] items = getItems ( ) ; int length = items . length ; int index = 0 ; while ( index < length ) { if ( items [ index ] . hasFocus ( ) ) break ; index ++ ; } GdkEventKey gdkEvent = new GdkEventKey ( ) ; OS . memmove ( gdkEvent , eventPtr , sizeof ) ; boolean next = false ; switch ( gdkEvent . keyval ) { case OS . GDK_Up : case OS . GDK_Left : next = false ; break ; case OS . GDK_Down : { if ( ( 0 <= index ) && ( index < length ) ) { ToolItem item = items [ index ] ; if ( ( ( item . style ) & ( SWT . DROP_DOWN ) ) != 0 ) { Event event = new Event ( ) ; event . detail = SWT . ARROW ; int topHandle = item . topHandle ( ) ; event . x = OS . GTK_WIDGET_X ( topHandle ) ; event . y = ( OS . GTK_WIDGET_Y ( topHandle ) ) + ( OS . GTK_WIDGET_HEIGHT ( topHandle ) ) ; item . postEvent ( Selection , event ) ; return result ; } } } case OS . GDK_Right : next = true ; break ; default : return result ; } int start = index ; int offset = ( next ) ? 1 : - 1 ; while ( ( index = ( ( index + offset ) + length ) % length ) != start ) { ToolItem item = items [ index ] ; <START_BUG> if ( item . setFocus ( ) ) <END_BUG> return result ; } return result ; } boolean hasFocus ( ) { } public int indexOf ( ToolItem item ) { } void layoutItems ( ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setFontDescription ( int font ) { } void setForegroundColor ( GdkColor color ) { } public void setToolTipText ( String string ) { } }

Fix:
if ( ( OS . gtk_widget_get_child_visible ( item . handle ) ) && ( item . setFocus ( ) ) )
Buggy code:
public class FunctionRule implements IValidatorRule < CubeDesc > { @ Override public void validate ( CubeDesc cube , ValidateContext context ) { } private void validateReturnType ( ValidateContext context , CubeDesc cube , FunctionDesc funcDesc ) { String func = funcDesc . getExpression ( ) ; DataType rtype = funcDesc . getReturnDataType ( ) ; if ( funcDesc . isCount ( ) ) { if ( ( rtype . isIntegerFamily ( ) ) == false ) { context . addResult ( ERROR , ( ( ( "Return<seq2seq4repair_space>type<seq2seq4repair_space>for<seq2seq4repair_space>function<seq2seq4repair_space>" + func ) + "<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>one<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( DataType . INTEGER_FAMILY ) ) ) ; } } else if ( funcDesc . isCountDistinct ( ) ) { if ( ( ( rtype . isHLLC ( ) ) == false ) && ( ( funcDesc . isHolisticCountDistinct ( ) ) == false ) ) { context . addResult ( ERROR , ( ( "Return<seq2seq4repair_space>type<seq2seq4repair_space>for<seq2seq4repair_space>function<seq2seq4repair_space>" + func ) + "<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>hllc(10),<seq2seq4repair_space>hllc(12)<seq2seq4repair_space>etc." ) ) ; } } else if ( ( ( funcDesc . isMax ( ) ) || ( funcDesc . isMin ( ) ) ) || ( funcDesc . isSum ( ) ) ) { if ( ( rtype . isNumberFamily ( ) ) == false ) { context . addResult ( ERROR , ( ( ( "Return<seq2seq4repair_space>type<seq2seq4repair_space>for<seq2seq4repair_space>function<seq2seq4repair_space>" + func ) + "<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>one<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( DataType . NUMBER_FAMILY ) ) ) ; } } else { <START_BUG> if ( StringUtils . equalsIgnoreCase ( KylinConfig . getInstanceFromEnv ( ) . getProperty ( KEY_IGNORE_UNKNOWN_FUNC , "false" ) , "false" ) ) { <END_BUG> context . addResult ( ERROR , ( ( "Unrecognized<seq2seq4repair_space>function:<seq2seq4repair_space>[" + func ) + "]" ) ) ; } } } private void validateCostantParameter ( ValidateContext context , CubeDesc cube , String value ) { } private void validateColumnParameter ( ValidateContext context , CubeDesc cube , String value ) { } }

Fix:
if ( StringUtils . equalsIgnoreCase ( KylinConfig . getInstanceFromEnv ( ) . getOptional ( KEY_IGNORE_UNKNOWN_FUNC , "false" ) , "false" ) ) {
Buggy code:
public abstract class AbstractCompendiumHandler extends ServiceTracker implements MBeanHandler { protected final JMXAgentContext agentContext ; protected StandardMBean mbean ; protected Long trackedId ; protected AbstractCompendiumHandler ( JMXAgentContext agentContext , Filter filter ) { } protected AbstractCompendiumHandler ( JMXAgentContext agentContext , String clazz ) { } public Object addingService ( ServiceReference reference ) { } public void removedService ( ServiceReference reference , Object service ) { Logger logger = agentContext . getLogger ( ) ; Long serviceID = ( ( Long ) ( reference . getProperty ( Constants . SERVICE_ID ) ) ) ; if ( ( ( trackedId ) != null ) && ( ! ( trackedId . equals ( serviceID ) ) ) ) { String serviceDescription = ( ( String ) ( ( ( reference . getProperty ( Constants . SERVICE_DESCRIPTION ) ) != null ) ? reference . getProperty ( Constants . SERVICE_DESCRIPTION ) : reference . getProperty ( Constants . OBJECTCLASS ) ) ) ; logger . log ( LogService . LOG_WARNING , ( ( ( ( ( ( "ServiceReference<seq2seq4repair_space>for<seq2seq4repair_space>[" + serviceDescription ) + "]<seq2seq4repair_space>with<seq2seq4repair_space>" ) + ( Constants . SERVICE_ID ) ) + "<seq2seq4repair_space>[" ) + serviceID ) + "]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>currently<seq2seq4repair_space>JMX<seq2seq4repair_space>managed" ) ) ; } else { logger . log ( LogService . LOG_INFO , ( ( ( ( ( ( "Unregistering<seq2seq4repair_space>MBean<seq2seq4repair_space>with<seq2seq4repair_space>ObjectName<seq2seq4repair_space>[" + ( getName ( ) ) ) + "]<seq2seq4repair_space>for<seq2seq4repair_space>service<seq2seq4repair_space>with<seq2seq4repair_space>" ) + ( Constants . SERVICE_ID ) ) + "<seq2seq4repair_space>[" ) + serviceID ) + "]" ) ) ; ExecutorService executor = agentContext . getRegistrationExecutor ( ) ; executor . submit ( new Runnable ( ) { public void run ( ) { <START_BUG> agentContext . unregisterMBean ( getName ( ) ) ; <END_BUG> } } ) ; trackedId = null ; context . ungetService ( reference ) ; } } public StandardMBean getMbean ( ) { } protected abstract StandardMBean constructInjectMBean ( Object targetService ) { } }

Fix:
agentContext . unregisterMBean ( AbstractCompendiumHandler . this ) ;
Buggy code:
public class IndexManager extends JobManager implements IIndexConstants { public static int MAX_FILES_IN_MEMORY = 0 ; public IWorkspace workspace ; Map indexes = new HashMap ( 5 ) ; private Map monitors = new HashMap ( 5 ) ; private boolean needToSave = false ; private static final CRC32 checksumCalculator = new CRC32 ( ) ; private IPath javaPluginLocation = null ; public void activateProcessing ( ) { } public void addSource ( IFile resource , IPath indexedContainer ) { } public void addBinary ( IFile resource , IPath indexedContainer ) { } public void indexSourceFolder ( JavaProject javaProject , IPath sourceFolder ) { } public void checkIndexConsistency ( ) { } private String computeIndexName ( String pathString ) { } public void deleting ( IProject project ) { } public synchronized void discardJobsUntilNextProjectAddition ( String jobFamily ) { } public IIndex getIndex ( IPath path ) { } public synchronized IIndex getIndex ( IPath path , boolean mustCreate ) { } private IPath getJavaPluginWorkingLocation ( ) { } public ReadWriteMonitor getMonitorFor ( IIndex index ) { } public void indexAll ( IProject project ) { } protected synchronized void moveToNextJob ( ) { } protected void notifyIdle ( long idlingTime ) { } public String processName ( ) { } public synchronized IIndex recreateIndex ( IPath path ) { } public void remove ( String resourceName , IPath indexedContainer ) { } public synchronized void removeIndex ( IPath path ) { } public void removeSourceFolderFromIndex ( JavaProject javaProject , IPath sourceFolder ) { } public void reset ( ) { } public void saveIndexes ( ) { ArrayList indexList = new ArrayList ( ) ; synchronized ( this ) { for ( Iterator iter = indexes . values ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { indexList . add ( iter . next ( ) ) ; } } for ( Iterator iter = indexList . iterator ( ) ; iter . hasNext ( ) ; ) { IIndex index = ( ( IIndex ) ( iter . next ( ) ) ) ; if ( index == null ) continue ; ReadWriteMonitor monitor = getMonitorFor ( index ) ; if ( monitor == null ) continue ; try { monitor . enterWrite ( ) ; if ( IndexManager . VERBOSE ) { if ( index . hasChanged ( ) ) { <START_BUG> System . out . println ( ( "-><seq2seq4repair_space>merging<seq2seq4repair_space>index<seq2seq4repair_space>:<seq2seq4repair_space>" + ( index . getIndexFile ( ) ) ) ) ; <END_BUG> } } try { index . save ( ) ; } catch ( IOException e ) { if ( IndexManager . VERBOSE ) { e . printStackTrace ( ) ; } } } finally { monitor . exitWrite ( ) ; } } needToSave = false ; } public void shutdown ( ) { } public void indexLibrary ( IPath path , IProject referingProject ) { } }

Fix:
System . out . println ( ( ( ( "-><seq2seq4repair_space>merging<seq2seq4repair_space>index<seq2seq4repair_space>(" + ( Thread . currentThread ( ) ) ) + "):<seq2seq4repair_space>" ) + ( index . getIndexFile ( ) ) ) ) ;
Buggy code:
public class VariableDeclarationFragment extends VariableDeclaration { public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( VariableDeclarationFragment . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY = new SimplePropertyDescriptor ( VariableDeclarationFragment . class , "extraDimensions" , int . class , ASTNode . MANDATORY ) ; public static final ChildPropertyDescriptor INITIALIZER_PROPERTY = new ChildPropertyDescriptor ( VariableDeclarationFragment . class , "initializer" , Expression . class , ASTNode . OPTIONAL , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private SimpleName variableName = null ; private int extraArrayDimensions = 0 ; private Expression optionalInitializer = null ; VariableDeclarationFragment ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final int internalGetSetIntProperty ( SimplePropertyDescriptor property , boolean get , int value ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public SimpleName getName ( ) { if ( ( this . variableName ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . variableName ) == null ) { preLazyInit ( ) ; this . variableName = new SimpleName ( this . ast ) ; postLazyInit ( this . variableName , VariableDeclarationFragment . NAME_PROPERTY ) ; } } } return this . variableName ; } public void setName ( SimpleName variableName ) { } public int getExtraDimensions ( ) { } public void setExtraDimensions ( int dimensions ) { } public Expression getInitializer ( ) { } public void setInitializer ( Expression initializer ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
@ PersistenceCapable ( identityType = IdentityType . APPLICATION ) public class Workout implements Serializable , Cloneable , Comparable < Workout > { private static final long serialVersionUID = - 4265455516532989163L ; public static WorkoutModel getClientModel ( Workout model ) { } public static Workout getServerModel ( WorkoutModel model ) { } public Object clone ( ) throws CloneNotSupportedException { } @ Persistent public Integer dayInRoutine = 0 ; @ Persistent public Integer rating = 0 ; @ Persistent private Integer copyCount = 0 ; @ Persistent private Date date ; @ Persistent private Boolean done = false ; @ Persistent ( mappedBy = "workout" ) @ Element ( dependent = "true" ) private List < Exercise > exercises = new ArrayList < Exercise > ( ) ; @ PrimaryKey @ Persistent ( valueStrategy = IdGeneratorStrategy . IDENTITY ) private Key id ; @ Persistent private String info ; @ Persistent private String name ; @ OneToOne private Long routineId = 0L ; @ Persistent private Long timeEnd = 0L ; @ Persistent private Long timeStart = 0L ; @ Persistent private Long uid ; @ Persistent public String openId ; @ NotPersistent private UserOpenid user ; public Workout ( ) { } public Workout ( String name ) { } @ Override public int compareTo ( Workout compare ) { } public Date getDate ( ) { } public Integer getDayInRoutine ( ) { } public Boolean getDone ( ) { } public List < Exercise > getExercises ( ) { } public Long getId ( ) { } public Key getKey ( ) { } public String getInfo ( ) { } public String getName ( ) { } public Integer getRating ( ) { } public Long getRoutineId ( ) { } public Long getTimeEnd ( ) { } public Long getTimeStart ( ) { } public String getUid ( ) { } public void incrementCopyCount ( ) { } public void setDate ( Date date ) { } public void setDayInRoutine ( Integer dayInWorkout ) { } public void setDone ( Boolean done ) { } public void setExercises ( List < Exercise > exercises ) { } public void setId ( Long id ) { } public void setInfo ( String info ) { } public void setName ( String name ) { } public void setRating ( Integer rating ) { } public void setRoutineId ( Long routineId ) { } public void setTimeEnd ( Long timeEnd ) { } public void setTimeStart ( Long timeStart ) { } public void setUid ( String openId ) { } public Long getUidOld ( ) { } public UserOpenid getUser ( ) { } public void setUser ( UserOpenid user ) { } public Integer getCount ( ) { } public void setCount ( Integer copyCount ) { } public void update ( Workout model , boolean includeId ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( "Workout:<seq2seq4repair_space>['" + ( getName ( ) ) ) + "',<seq2seq4repair_space>exercises:<seq2seq4repair_space>" ) + ( getExercises ( ) . size ( ) ) ) + "]" ; <END_BUG> } }

Fix:
return ( ( ( ( ( "Workout:<seq2seq4repair_space>['" + ( getName ( ) ) ) + "',<seq2seq4repair_space>exercises:<seq2seq4repair_space>" ) + ( getExercises ( ) . size ( ) ) ) + ",<seq2seq4repair_space>date:<seq2seq4repair_space>'" ) + ( getDate ( ) ) ) + "']" ;
Buggy code:
public class Builder { private static final File ANT1_SRC_ROOT = new File ( "..//..//src//main" ) ; private static final File PACKAGE_ROOT = new File ( Builder . ANT1_SRC_ROOT , "org//apache//tools//ant" ) ; private static final File ZIP_ROOT = new File ( Builder . ANT1_SRC_ROOT , "org//apache//tools//zip" ) ; private static final File TASKDEFS_ROOT = new File ( Builder . PACKAGE_ROOT , "taskdefs" ) ; private static final File TYPES_ROOT = new File ( Builder . PACKAGE_ROOT , "types" ) ; private static final File FILTERS_ROOT = new File ( Builder . PACKAGE_ROOT , "filters" ) ; private static final File UTIL_ROOT = new File ( Builder . PACKAGE_ROOT , "util" ) ; private static final File DEPEND_ROOT = new File ( Builder . TASKDEFS_ROOT , "optional//depend" ) ; public static void main ( String [ ] args ) { } private File [ ] getAnt1Files ( ) { } private void runBuild ( String [ ] args ) { BuildHelper mainBuild = new BuildHelper ( ) ; mainBuild . setProperty ( "dist.dir" , "bootstrap" ) ; MutantBuilder mutantBuilder = new MutantBuilder ( ) ; mutantBuilder . _init ( mainBuild ) ; mutantBuilder . buildsetup ( mainBuild ) ; mutantBuilder . init ( mainBuild ) ; mutantBuilder . common ( mainBuild ) ; mutantBuilder . antcore ( mainBuild ) ; mutantBuilder . start ( mainBuild ) ; mutantBuilder . cli ( mainBuild ) ; BuildHelper systemBuild = new BuildHelper ( ) ; systemBuild . setProperty ( "libset" , "system" ) ; systemBuild . setProperty ( "dist.dir" , "bootstrap" ) ; mutantBuilder . _init ( systemBuild ) ; mutantBuilder . build_lib ( systemBuild ) ; Ant1CompatBuilder ant1Builder = new Ant1CompatBuilder ( ) ; BuildHelper ant1Build = new BuildHelper ( ) ; ant1Build . setProperty ( "dist.dir" , "bootstrap" ) ; <START_BUG> ant1Build . addFileSet ( "ant1src" , Builder . ANT1_SRC_ROOT , getAnt1Files ( ) ) ; <END_BUG> ant1Builder . _init ( ant1Build ) ; ant1Builder . ant1compat ( ant1Build ) ; } }

Fix:
ant1Build . addFileSet ( "ant1src_tocopy" , Builder . ANT1_SRC_ROOT , getAnt1Files ( ) ) ;
Buggy code:
public class TestFieldCacheTermsFilter extends LuceneTestCase { public void testMissingTerms ( ) throws Exception { String fieldName = "field1" ; Directory rd = newDirectory ( ) ; RandomIndexWriter w = new RandomIndexWriter ( random ( ) , rd ) ; for ( int i = 0 ; i < 100 ; i ++ ) { Document doc = new Document ( ) ; int term = i * 10 ; doc . add ( newStringField ( fieldName , ( "" + term ) , YES ) ) ; w . addDocument ( doc ) ; } IndexReader reader = w . getReader ( ) ; <START_BUG> w . close ( ) ; <END_BUG> IndexSearcher searcher = newSearcher ( reader ) ; int numDocs = reader . numDocs ( ) ; ScoreDoc [ ] results ; MatchAllDocsQuery q = new MatchAllDocsQuery ( ) ; List < String > terms = new ArrayList < > ( ) ; terms . add ( "5" ) ; results = searcher . search ( q , new FieldCacheTermsFilter ( fieldName , terms . toArray ( new String [ 0 ] ) ) , numDocs ) . scoreDocs ; assertEquals ( "Must<seq2seq4repair_space>match<seq2seq4repair_space>nothing" , 0 , results . length ) ; terms = new ArrayList < > ( ) ; terms . add ( "10" ) ; results = searcher . search ( q , new FieldCacheTermsFilter ( fieldName , terms . toArray ( new String [ 0 ] ) ) , numDocs ) . scoreDocs ; assertEquals ( "Must<seq2seq4repair_space>match<seq2seq4repair_space>1" , 1 , results . length ) ; terms = new ArrayList < > ( ) ; terms . add ( "10" ) ; terms . add ( "20" ) ; results = searcher . search ( q , new FieldCacheTermsFilter ( fieldName , terms . toArray ( new String [ 0 ] ) ) , numDocs ) . scoreDocs ; assertEquals ( "Must<seq2seq4repair_space>match<seq2seq4repair_space>2" , 2 , results . length ) ; reader . close ( ) ; rd . close ( ) ; } }

Fix:
w . shutdown ( ) ;
Buggy code:
@ Service public class NoSurfaceDataConverter extends AbstractTrackDataConverter { @ Override public boolean canHandle ( SearchConfig searchConfig ) { } @ Override protected boolean decideWay ( WayFeatures wayFeatures , SearchConfig searchConfig ) { <START_BUG> if ( ( wayFeatures . isHighway ( ) ) && ( ! ( wayFeatures . isSurface ( ) ) ) ) { <END_BUG> return true ; } return false ; } }

Fix:
if ( ( wayFeatures . isHighwayTrack ( ) ) && ( ! ( wayFeatures . isSurface ( ) ) ) ) {
Buggy code:
public class CreateJMSBridgeSetupTask extends CreateQueueSetupTask { public static final String CF_NAME = "myAwesomeCF" ; public static final String CF_JNDI_NAME = "//myAwesomeCF" ; public static final String JMS_BRIDGE_NAME = "myAwesomeJMSBridge" ; private static final Logger logger = Logger . getLogger ( CreateJMSBridgeSetupTask . class ) ; private ManagementClient managementClient ; @ Override public void setup ( ManagementClient managementClient , String containerId ) throws Exception { } @ Override public void tearDown ( ManagementClient managementClient , String containerId ) throws Exception { } private void createConnectionFactory ( String cfName , String cfJndiName ) { final ModelNode createConnectionFactoryOp = new ModelNode ( ) ; createConnectionFactoryOp . get ( OP ) . set ( ADD ) ; createConnectionFactoryOp . get ( OP_ADDR ) . add ( "subsystem" , "messaging" ) ; createConnectionFactoryOp . get ( OP_ADDR ) . add ( "hornetq-server" , "default" ) ; createConnectionFactoryOp . get ( OP_ADDR ) . add ( "connection-factory" , cfName ) ; ModelNode connector = createConnectionFactoryOp . get ( "connector" ) ; <START_BUG> connector . get ( "in-vm" ) . set ( UNDEFINED ) ; <END_BUG> createConnectionFactoryOp . get ( "factory-type" ) . set ( "XA_GENERIC" ) ; createConnectionFactoryOp . get ( "entries" ) . add ( cfJndiName ) ; System . err . println ( ( "Create<seq2seq4repair_space>operation<seq2seq4repair_space>=====><seq2seq4repair_space>" + createConnectionFactoryOp ) ) ; try { this . applyUpdate ( createConnectionFactoryOp ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } private void removeConnectionFactory ( String cfName ) { } private void createJmsBridge ( String bridgeName ) { } private void removeJmsBridge ( String bridgeName ) { } private void applyUpdate ( final ModelNode update ) throws IOException { } }

Fix:
connector . get ( "in-vm" ) . set ( new ModelNode ( ) ) ;
Buggy code:
public class MessageDigestResourceVersion implements IResourceVersion { private static final Logger log = LoggerFactory . getLogger ( MessageDigestResourceVersion . class ) ; private static final String DEFAULT_ALGORITHM = "MD5" ; private static final int DEFAULT_BUFFER_BYTES = 8192 ; private static final Bytes DEFAULT_BUFFER_SIZE = Bytes . bytes ( MessageDigestResourceVersion . DEFAULT_BUFFER_BYTES ) ; private final String algorithm ; private final Bytes bufferSize ; public MessageDigestResourceVersion ( ) { } public MessageDigestResourceVersion ( String algorithm ) { } public MessageDigestResourceVersion ( String algorithm , Bytes bufferSize ) { } public String getVersion ( PackageResourceReference resourceReference ) { final PackageResourceReference . StreamInfo streamInfo = resourceReference . getCurrentStreamInfo ( ) ; if ( streamInfo == null ) { return null ; } try { <START_BUG> final byte [ ] hash = computeDigest ( streamInfo . stream ) ; <END_BUG> return Strings . toHexString ( hash ) ; } catch ( ResourceStreamNotFoundException e ) { MessageDigestResourceVersion . log . warn ( "resource<seq2seq4repair_space>stream<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>'{}'" , resourceReference ) ; return null ; } catch ( IOException e ) { MessageDigestResourceVersion . log . warn ( ( "resource<seq2seq4repair_space>stream<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>read<seq2seq4repair_space>for<seq2seq4repair_space>" + resourceReference ) , e ) ; return null ; } } protected MessageDigest getMessageDigest ( ) { } protected byte [ ] computeDigest ( IResourceStream resourceStream ) throws IOException , ResourceStreamNotFoundException { } }

Fix:
final byte [ ] hash = computeDigest ( streamInfo . getStream ( ) ) ;
Buggy code:
public class Service extends EnabledLogicalElement implements Serializable { public System getHostSystem ( ) { <START_BUG> return ( ( System ) ( this . getFromAssociatedElementsByType ( HostedService . class ) ) ) ; <END_BUG> } public void setHostSystem ( System host ) { } protected Service ( ) { } private String systemCreationClassName ; public String getSystemCreationClassName ( ) { } public void setSystemCreationClassName ( String systemCreationClassName ) { } private String systemName ; public String getSystemName ( ) { } public void setSystemName ( String systemName ) { } private String creationClassName ; public String getCreationClassName ( ) { } public void setCreationClassName ( String creationClassName ) { } @ Override public String getName ( ) { } @ Override public void setName ( String name ) { } private String primaryOwnerName ; public String getPrimaryOwnerName ( ) { } public void setPrimaryOwnerName ( String primaryOwnerName ) { } private String primaryOwnerContact ; public String getPrimaryOwnerContact ( ) { } public void setPrimaryOwnerContact ( String primaryOwnerContact ) { } @ Deprecated public enum StartMode { AUTOMATIC , MANUAL ; } @ Deprecated private Service . StartMode startMode ; @ Deprecated public Service . StartMode getStartMode ( ) { } @ Deprecated public void setStartMode ( Service . StartMode startMode ) { } private boolean started ; public boolean isStarted ( ) { } public void setStarted ( boolean started ) { } }

Fix:
return ( ( System ) ( this . getFirstFromAssociatedElementByType ( HostedService . class ) ) ) ;
Buggy code:
public class ActionTestJunit extends UMLAction implements PluggableMenu { private static ActionTestJunit SINGLETON = new ActionTestJunit ( ) ; private static final String JUNIT_CLASS = "junit.swingui.TestRunner" ; private static JMenuItem _menuItem = null ; private boolean _failed = false ; public ActionTestJunit ( ) { } public static ActionTestJunit getInstance ( ) { } public void actionPerformed ( ActionEvent event ) { } public void setModuleEnabled ( boolean v ) { } public boolean initializeModule ( ) { } public Object [ ] buildContext ( JMenuItem a , String b ) { } public boolean inContext ( Object [ ] o ) { } public boolean isModuleEnabled ( ) { } public Vector getModulePopUpActions ( Vector v , Object o ) { } public boolean shutdownModule ( ) { } public String getModuleName ( ) { } public String getModuleDescription ( ) { } public String getModuleAuthor ( ) { <START_BUG> return "Andreas" ; <END_BUG> } public String getModuleVersion ( ) { } public String getModuleKey ( ) { } public JMenuItem getMenuItem ( JMenuItem mi , String s ) { } }

Fix:
return "Andreas<seq2seq4repair_space>Rueckert" ;
Buggy code:
abstract class HttpTask < RESP > implements Runnable { private static final String TAG = "HttpTask" ; private Request request ; private IHttpListener < RESP > listener ; private byte [ ] recvBuffer ; private int retryTimes = 0 ; private static final String CONTENT_TYPE = "application//json" ; private static final String USER_AGENT = "Android" ; private static final String PRAGMA = "no-cache" ; private static final String ACCEPT_LANGUAGE = "zh-CN" ; private static final String ACCEPT = "*//*" ; private static final int CONNECTION_TIMEOUT = 25 * 1000 ; private static final int READWIRTE_TIMEOUT = 30 * 1000 ; private static final int WHAT_SUCCESS = 1 ; private static final int WHAT_FAILED = 2 ; private Handler handler = null ; private Callback callback ; public HttpTask ( ) { } public HttpTask < RESP > setRequest ( final Request request ) { } public HttpTask < RESP > setHttpListener ( final IHttpListener < RESP > listener ) { } protected void setRequestProperty ( final HttpURLConnection conn ) { } @ Override public void run ( ) { LogUtils . d ( HttpTask . TAG , ( ( ( "request:<seq2seq4repair_space>" + ( request ) ) + "<seq2seq4repair_space>listener:<seq2seq4repair_space>" ) + ( listener ) ) ) ; try { <START_BUG> if ( ( null == ( request ) ) || ( null == ( request . getData ( ) ) ) ) { <END_BUG> throw new HttpError ( ) . setErrorMessage ( ( "请求为空：" + ( request ) ) ) ; } final URL url ; try { url = new URL ( request . getUrl ( ) ) ; LogUtils . d ( HttpTask . TAG , ( "url:<seq2seq4repair_space>" + url ) ) ; } catch ( MalformedURLException e ) { throw new HttpError ( e ) . setErrorMessage ( ( ( ( "URL非法：" + ( request . getUrl ( ) ) ) + "<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) ) ; } while ( true ) { try { tryRequest ( url ) ; return ; } catch ( HttpError err ) { if ( ! ( request . isRetry ( ) ) ) { LogUtils . e ( HttpTask . TAG , "请求失败，不进行重试" ) ; throw err ; } else if ( ( ( retryTimes ) ++ ) >= ( request . getMaxRetryTimes ( ) ) ) { LogUtils . e ( HttpTask . TAG , ( "超过最大重试次数：" + ( request . getMaxRetryTimes ( ) ) ) ) ; throw err ; } else { LogUtils . w ( HttpTask . TAG , ( ( ( "第[" + ( retryTimes ) ) + "]次重试：" ) + ( err . getErrorMessage ( ) ) ) ) ; } } } } catch ( HttpError err ) { LogUtils . w ( HttpTask . TAG , "请求失败：" , err ) ; handleFailed ( request . getThreadMode ( ) , err ) ; } catch ( Exception e ) { LogUtils . e ( HttpTask . TAG , "请求失败，未正确处理的异常：" , e ) ; final HttpError err = new HttpError ( e ) . setErrorMessage ( ( "未正确处理的异常：" + ( e . getMessage ( ) ) ) ) ; handleFailed ( request . getThreadMode ( ) , err ) ; } } private void tryRequest ( final URL url ) throws HttpError { } protected abstract Method getMethod ( ) { } protected abstract void request ( final HttpURLConnection conn , final Request request ) throws HttpError { } protected void handleSuccess ( final ThreadMode mode , final int code , final RESP o ) { } protected void handleFailed ( final ThreadMode mode , final HttpError err ) { } No newline ; at end ; of file ; }

Fix:
if ( null == ( request ) ) {
Buggy code:
public class MainFrame extends Application { @ Override public void start ( Stage stage ) throws Exception { } public static void main ( String [ ] args ) { } public static boolean isNumeric ( String s ) { for ( char c : s . toCharArray ( ) ) { <START_BUG> if ( ! ( Character . isDefined ( c ) ) ) <END_BUG> return false ; } return true ; } }

Fix:
if ( ! ( Character . isDigit ( c ) ) )
Buggy code:
public class DateTimeColumnTypeValueParser implements ColumnTypeValueParser { @ Override public Object parse ( byte [ ] buf , Position pos , ColumnDefinition columnDef , int meta ) { long tmp = MysqlNumberUtils . read8Int ( buf , pos ) ; long d = tmp // 1000000 ; long t = tmp % 1000000 ; int year = ( ( int ) ( d // 10000 ) ) ; int month = ( ( int ) ( ( d % 10000 ) // 100 ) ) ; int date = ( ( int ) ( d % 100 ) ) ; int hour = ( ( int ) ( t // 10000 ) ) ; int minute = ( ( int ) ( ( t % 10000 ) // 100 ) ) ; int second = ( ( int ) ( t % 100 ) ) ; Calendar cal = Calendar . getInstance ( ) ; <START_BUG> cal . set ( year , month , date , hour , minute , second ) ; <END_BUG> return cal . getTime ( ) ; } }

Fix:
cal . set ( year , ( month - 1 ) , date , hour , minute , second ) ;
Buggy code:
public class DisplayItem { public enum MediaType { TEXT , IMAGE , VIDEO , SOUND ; } private final String text ; private final String file ; private final DisplayItem . MediaType type ; private final String id ; private final String sha256 ; public DisplayItem ( String text , String id ) { } public DisplayItem ( DisplayItem . MediaType type , String id , String text , String file , String sha256 ) { } public String getText ( ) { } public String getId ( ) { } public String getFile ( ) { } public String getSha256 ( ) { <START_BUG> return this . getSha256 ( ) ; <END_BUG> } public boolean isVideo ( ) { } public boolean isImage ( ) { } }

Fix:
return this . sha256 ;