nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MqttDrpcClient { private static final Logger LOG = LoggerFactory . getLogger ( MqttDrpcClient . class ) ; private final ServiceHost serviceHost ; private final TopicBuilder topicBuilder ; private final int qos ; private final MqttClient sampleClient ; private final MqttDrpcPackets mqttDrpcPackets ; protected class MqttDrpcCallbackHandler implements MqttCallback { @ Override public void connectionLost ( Throwable throwable ) { } @ Override public void messageArrived ( String topic , MqttMessage mqttMessage ) throws Exception { } @ Override public void deliveryComplete ( IMqttDeliveryToken iMqttDeliveryToken ) { } } public MqttDrpcClient ( String broker ) throws MqttException { } private void send ( String messageId , Topic topic , Object [ ] content ) throws MqttException , IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; MqttDrpcPackets . Packet packet = new MqttDrpcPackets . Packet ( ) ; packet . setMessageId ( messageId ) ; <START_BUG> packet . setBody ( content ) ; <END_BUG> mqttDrpcPackets . write ( outputStream , packet ) ; MqttMessage message = new MqttMessage ( outputStream . toByteArray ( ) ) ; message . setQos ( qos ) ; sampleClient . publish ( topic . getTopic ( ) , message ) ; } public < T > SilentCloseable publish ( Class < T > type , String identifier , T implementation ) { } @ SuppressWarnings ( "unchecked" ) public < T > ServiceConnector < T > connector ( Class < T > type ) { } }

Fix:
packet . setBody ( ( content == null ? new Object [ ] { } : content ) ) ;
Buggy code:
public class ResQRobot extends Robot { private Motor leftLeg ; private Motor rightLeg ; private Motor scoringArm ; private Motor sweeper ; private Servo bucketTilt ; private Servo blueBucketDoor ; private Servo redBucketDoor ; private Servo climberArm ; private static final double LEG_MOTOR_SPEED = 1.0 ; private static final double BUCKET_TILT_INCREMENT = 0.02 ; private static final double BUCKET_DOOR_OPEN_POSITION = 1 ; private static final double BUCKET_DOOR_CLOSED_POSITION = 0 ; @ Override public String [ ] getDriveMotorNames ( ) { } @ Override public void initializeRobot ( ) { } public void walkForward ( ) { } public void walkBackward ( ) { } public void stopWalking ( ) { } private void setLegPower ( double pow ) { } public void tiltBucketCW ( ) { } public void tiltBucketCCW ( ) { } private void tiltBucket ( int direction ) { } public void openBlueBucketDoor ( ) { } public void closeBlueBucketDoor ( ) { } public void openRedBucketDoor ( ) { } public void closeRedBucketDoor ( ) { } public void moveScoringArm ( double pow ) { } public void moveBucket ( int pos ) { <START_BUG> if ( pos == ( - 1 ) ) <END_BUG> this . bucketTilt . moveToPosition ( 0 ) ; else if ( pos == 0 ) this . bucketTilt . moveToPosition ( 0.5 ) ; else this . bucketTilt . moveToPosition ( 1 ) ; } public void moveClimberArm ( int pos ) { } public void moveSweeper ( int pow ) { } }

Fix:
if ( pos == 1 )
Buggy code:
public final class ErrorCodeTest extends BaseJDBCTestCase { public ErrorCodeTest ( String name ) { } public static Test suite ( ) { TestSuite suite = new TestSuite ( "errorcode<seq2seq4repair_space>Test" ) ; <START_BUG> suite . addTest ( TestConfiguration . embeddedSuite ( ErrorCodeTest . class ) ) ; <END_BUG> return new org . apache . derbyTesting . junit . LocaleTestSetup ( suite , Locale . ENGLISH ) ; } public void test_errorcode ( ) throws Exception { } }

Fix:
suite . addTest ( TestConfiguration . defaultSuite ( ErrorCodeTest . class ) ) ;
Buggy code:
public final class ComponentResourceRequestTarget implements IRequestTarget { private static final Logger log = LoggerFactory . getLogger ( ComponentResourceRequestTarget . class ) ; private final Page page ; private final Component component ; private final RequestListenerInterface listener ; public ComponentResourceRequestTarget ( Page page , Component component , RequestListenerInterface listener ) { } public void respond ( RequestCycle requestCycle ) { } public void detach ( RequestCycle requestCycle ) { <START_BUG> page . internalDetach ( ) ; <END_BUG> } public Object getLock ( RequestCycle requestCycle ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
page . detach ( ) ;
Buggy code:
public class InfinispanExtension implements Extension { static final String SUBSYSTEM_NAME = "infinispan" ; private static final PathElement containerPath = PathElement . pathElement ( CACHE_CONTAINER ) ; private static final PathElement localCachePath = PathElement . pathElement ( LOCAL_CACHE ) ; private static final PathElement invalidationCachePath = PathElement . pathElement ( INVALIDATION_CACHE ) ; private static final PathElement replicatedCachePath = PathElement . pathElement ( REPLICATED_CACHE ) ; private static final PathElement distributedCachePath = PathElement . pathElement ( DISTRIBUTED_CACHE ) ; private static final PathElement transportPath = PathElement . pathElement ( SINGLETON , TRANSPORT ) ; private static final PathElement lockingPath = PathElement . pathElement ( SINGLETON , LOCKING ) ; private static final PathElement transactionPath = PathElement . pathElement ( SINGLETON , TRANSACTION ) ; private static final PathElement evictionPath = PathElement . pathElement ( SINGLETON , EVICTION ) ; private static final PathElement expirationPath = PathElement . pathElement ( SINGLETON , EXPIRATION ) ; private static final PathElement stateTransferPath = PathElement . pathElement ( SINGLETON , STATE_TRANSFER ) ; private static final PathElement rehashingPath = PathElement . pathElement ( SINGLETON , REHASHING ) ; private static final PathElement storePropertyPath = PathElement . pathElement ( PROPERTY ) ; @ Override public void initialize ( ExtensionContext context ) { } @ Override public void initializeParsers ( ExtensionParsingContext context ) { for ( Namespace namespace : Namespace . values ( ) ) { if ( namespace != ( Namespace . UNKNOWN ) ) { <START_BUG> context . setSubsystemXmlMapping ( namespace . getUri ( ) , namespace . getReader ( ) ) ; <END_BUG> } } } private void registerCommonCacheAttributeHandlers ( ManagementResourceRegistration resource ) { } static void createPropertyRegistration ( final ManagementResourceRegistration parent ) { } }

Fix:
context . setSubsystemXmlMapping ( InfinispanExtension . SUBSYSTEM_NAME , namespace . getUri ( ) , namespace . getReader ( ) ) ;
Buggy code:
public class ActionNewTimeEvent extends ActionNewEvent { public static ActionNewTimeEvent SINGLETON = new ActionNewTimeEvent ( ) ; protected ActionNewTimeEvent ( ) { } protected Object createEvent ( ) { <START_BUG> return StateMachinesFactory . getFactory ( ) . createTimeEvent ( ) ; <END_BUG> } }

Fix:
return StateMachinesFactory . getFactory ( ) . buildTimeEvent ( ) ;
Buggy code:
class DecoratorOverlayIcon extends CompositeImageDescriptor { private Image base ; private ImageDescriptor [ ] overlays ; private Point size ; public static final int TOP_LEFT = 0 ; public static final int TOP_RIGHT = 1 ; public static final int BOTTOM_LEFT = 2 ; public static final int BOTTOM_RIGHT = 3 ; public DecoratorOverlayIcon ( Image base , ImageDescriptor [ ] overlays , Point size ) { } protected void drawOverlays ( ImageDescriptor [ ] overlays ) { Point size = getSize ( ) ; for ( int i = 0 ; i < ( overlays . length ) ; i ++ ) { ImageDescriptor overlay = overlays [ i ] ; if ( overlay == null ) <START_BUG> break ; <END_BUG> ImageData overlayData = overlay . getImageData ( ) ; switch ( i ) { case DecoratorOverlayIcon . TOP_LEFT : drawImage ( overlayData , 0 , 0 ) ; break ; case DecoratorOverlayIcon . TOP_RIGHT : drawImage ( overlayData , ( ( size . x ) - ( overlayData . width ) ) , 0 ) ; break ; case DecoratorOverlayIcon . BOTTOM_LEFT : drawImage ( overlayData , 0 , ( ( size . y ) - ( overlayData . height ) ) ) ; break ; case DecoratorOverlayIcon . BOTTOM_RIGHT : drawImage ( overlayData , ( ( size . x ) - ( overlayData . width ) ) , ( ( size . y ) - ( overlayData . height ) ) ) ; break ; } } } public boolean equals ( Object o ) { } public int hashCode ( ) { } protected void drawCompositeImage ( int width , int height ) { } protected Point getSize ( ) { } }

Fix:
continue ;
Buggy code:
public class DeclareAnnotation extends Declare { public static final DeclareAnnotation . Kind AT_TYPE = new DeclareAnnotation . Kind ( 1 , "type" ) ; public static final DeclareAnnotation . Kind AT_FIELD = new DeclareAnnotation . Kind ( 2 , "field" ) ; public static final DeclareAnnotation . Kind AT_METHOD = new DeclareAnnotation . Kind ( 3 , "method" ) ; public static final DeclareAnnotation . Kind AT_CONSTRUCTOR = new DeclareAnnotation . Kind ( 4 , "constructor" ) ; private DeclareAnnotation . Kind kind ; private TypePattern typePattern ; private SignaturePattern sigPattern ; private String annotationMethod = "unknown" ; private String annotationString = "@<annotation>" ; private ResolvedType containingAspect ; private AnnotationX annotation ; public static class Kind { private final int id ; private String s ; private Kind ( int n , String name ) { } public int hashCode ( ) { } public boolean equals ( Object obj ) { } public String toString ( ) { } } public DeclareAnnotation ( DeclareAnnotation . Kind kind , TypePattern typePattern ) { } public String getAnnotationString ( ) { } public DeclareAnnotation ( DeclareAnnotation . Kind kind , SignaturePattern sigPattern ) { } public boolean isExactPattern ( ) { } public String getAnnotationMethod ( ) { } public String toString ( ) { } public Object accept ( PatternNodeVisitor visitor , Object data ) { } public void resolve ( IScope scope ) { } public boolean isAdviceLike ( ) { } public void setAnnotationString ( String as ) { } public void setAnnotationMethod ( String methName ) { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } public void write ( DataOutputStream s ) throws IOException { } public static Declare read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public boolean matches ( ResolvedMember rm , World world ) { <START_BUG> return sigPattern . matches ( rm , world ) ; <END_BUG> } public boolean matches ( ResolvedType typeX ) { } public void setAspect ( ResolvedType typeX ) { } public UnresolvedType getAspect ( ) { } public void copyAnnotationTo ( ResolvedType onType ) { } public AnnotationX getAnnotationX ( ) { } private void ensureAnnotationDiscovered ( ) { } public TypePattern getTypePattern ( ) { } public boolean isStarredAnnotationPattern ( ) { } public DeclareAnnotation . Kind getKind ( ) { } public boolean isDeclareAtConstuctor ( ) { } public boolean isDeclareAtMethod ( ) { } public boolean isDeclareAtType ( ) { } public boolean isDeclareAtField ( ) { } public UnresolvedType getAnnotationTypeX ( ) { } public boolean isAnnotationAllowedOnField ( ) { } public String getPatternAsString ( ) { } public boolean couldEverMatch ( ResolvedType type ) { } public String getNameSuffix ( ) { } }

Fix:
return sigPattern . matches ( rm , world , false ) ;
Buggy code:
public class SubversionPlugin implements VersionControlPlugin { private static final Logger LOG = Logger . getLogger ( SubversionPlugin . class ) ; private SVNRepository svnRepo ; private ISVNAuthenticationManager authManager ; private RepositoryDto repository ; public SubversionPlugin ( ) { } @ Override public String getPurposes ( ) { } @ Override public String getVersion ( ) { } @ Override public void setRepository ( RepositoryDto repository ) throws VersionControlPluginException { } @ Override public FileDto getFileDtoForFileIdentifierAtRevision ( FileIdentifier identifier , String revision ) throws VersionControlPluginException { try { String filePath = identifier . getFilePath ( ) ; SubversionPlugin . LOG . debug ( ( "Retrieving<seq2seq4repair_space>and<seq2seq4repair_space>checking<seq2seq4repair_space>file:<seq2seq4repair_space>" + filePath ) ) ; FileDto fileDto = new FileDto ( ) ; SVNNodeKind nodeKind = svnRepo . checkPath ( filePath , ( - 1 ) ) ; if ( nodeKind != ( SVNNodeKind . FILE ) ) { <START_BUG> return null ; <END_BUG> } ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; SVNProperties properties = new SVNProperties ( ) ; svnRepo . getFile ( filePath , Long . parseLong ( revision ) , properties , baos ) ; boolean binary = ! ( SVNProperty . isTextMimeType ( properties . getStringValue ( MIME_TYPE ) ) ) ; String lastAuthor = properties . getStringValue ( LAST_AUTHOR ) ; String lastAlterationDate = properties . getStringValue ( COMMITTED_DATE ) ; fileDto . setLastAuthor ( lastAuthor ) ; fileDto . setLastAlteration ( lastAlterationDate ) ; fileDto . setContent ( baos . toByteArray ( ) ) ; fileDto . setBinary ( binary ) ; fileDto . setFilePath ( filePath ) ; fileDto . setRepository ( repository ) ; return fileDto ; } catch ( SVNException ex ) { throw new VersionControlPluginException ( ex . toString ( ) ) ; } } @ Override public Set < FileIdentifier > getChangedFilesSinceRevision ( String revision ) throws VersionControlPluginException { } @ Override public String getRepositoryRevision ( ) throws VersionControlPluginException { } @ Override public List < String > getFilesInDirectory ( String directoryPath ) throws VersionControlPluginException { } @ Override public void setCacheDirectory ( String directoryPath ) { } private void establishConnectionToRepo ( ) throws VersionControlPluginException { } private void listEntries ( String path , Set < FileIdentifier > identifiers ) throws SVNException { } @ Override public void validate ( ) { } private class ListDirectoryDirEntryHandler implements ISVNDirEntryHandler { List < String > fileNames ; public ListDirectoryDirEntryHandler ( List < String > fileNames ) { } @ Override public void handleDirEntry ( SVNDirEntry dirEntry ) throws SVNException { } } }

Fix:
throw new VersionControlPluginException ( "The<seq2seq4repair_space>file<seq2seq4repair_space>is<seq2seq4repair_space>either<seq2seq4repair_space>a<seq2seq4repair_space>folder<seq2seq4repair_space>or<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>deleted" ) ;
Buggy code:
public class RequestCycle extends RequestHandlerStack { private static final Logger log = LoggerFactory . getLogger ( RequestCycle . class ) ; public interface DetachCallback { public void onDetach ( RequestCycle requestCycle ) { } } public static RequestCycle get ( ) { } private static void set ( RequestCycle requestCycle ) { } private Request request ; private final Response originalResponse ; private final IRequestMapper requestMapper ; private final IExceptionMapper exceptionMapper ; private final List < RequestCycle . DetachCallback > detachCallbacks = new ArrayList < RequestCycle . DetachCallback > ( ) ; private UrlRenderer urlRenderer ; private MetaDataEntry < ? > [ ] metaData ; public RequestCycle ( RequestCycleContext context ) { } protected UrlRenderer newUrlRenderer ( ) { } public Response getOriginalResponse ( ) { } public final UrlRenderer getUrlRenderer ( ) { } protected IRequestHandler resolveRequestHandler ( ) { } protected int getExceptionRetryCount ( ) { } public boolean processRequest ( ) { } public boolean processRequestAndDetach ( ) { } private void executeExceptionRequestHandler ( final IRequestHandler handler , final int retryCount ) { } protected IRequestHandler handleException ( final Exception e ) { } public Request getRequest ( ) { } public void setRequest ( Request request ) { } @ Override protected RequestCycle getRequestCycle ( ) { } public final < T > void setMetaData ( final MetaDataKey < T > key , final T object ) { } public final < T > T getMetaData ( final MetaDataKey < T > key ) { } public Url urlFor ( IRequestHandler handler ) { } public Url urlFor ( ResourceReference reference , PageParameters params ) { } public Url urlFor ( ResourceReference reference ) { } public String renderUrlFor ( IRequestHandler handler ) { Url url = urlFor ( handler ) ; if ( url != null ) { <START_BUG> return getUrlRenderer ( ) . renderUrl ( url ) ; <END_BUG> } else { return null ; } } @ Override public void detach ( ) { } public void register ( RequestCycle . DetachCallback detachCallback ) { } public void setResponsePage ( IRequestablePage page ) { } public void setResponsePage ( Class < ? extends IRequestablePage > pageClass ) { } public void setResponsePage ( Class < ? extends IRequestablePage > pageClass , PageParameters parameters ) { } public ClientInfo newClientInfo ( ) { } public ClientInfo getClientInfo ( ) { } }

Fix:
return getResponse ( ) . encodeURL ( getUrlRenderer ( ) . renderUrl ( url ) ) ;
Buggy code:
public class Body { private String name ; private Vector [ ] vertices ; private Vector position ; private Vector rotation ; private int verticesCount ; public Body ( String name , int verticesCount ) { } public void AddVertex ( Vector vertex , int index ) { } public void MoveBody ( VectorMultipliable matrix ) { for ( int i = 0 ; i < ( vertices . length ) ; i ++ ) { <START_BUG> double [ ] currentvertex = vertices [ i ] . GetVector ( ) ; <END_BUG> } } }

Fix:
double [ ] updatedvertex = matrix . Multiply ( this . vertices [ i ] ) ;
Buggy code:
public class DeleteResourceElementsOperation extends MultiOperation { protected DeleteResourceElementsOperation ( IJavaElement [ ] elementsToProcess , boolean force ) { } private void deletePackageFragment ( IPackageFragment frag ) throws JavaModelException { IResource res = frag . getResource ( ) ; if ( res != null ) { IJavaElement [ ] childrenOfInterest = frag . getChildren ( ) ; if ( ( childrenOfInterest . length ) > 0 ) { IResource [ ] resources = new IResource [ childrenOfInterest . length ] ; for ( int i = 0 ; i < ( childrenOfInterest . length ) ; i ++ ) { resources [ i ] = childrenOfInterest [ i ] . getCorrespondingResource ( ) ; } deleteResources ( resources , fForce ) ; } Object [ ] nonJavaResources = frag . getNonJavaResources ( ) ; int actualResourceCount = 0 ; for ( int i = 0 , max = nonJavaResources . length ; i < max ; i ++ ) { if ( ( nonJavaResources [ i ] ) instanceof IResource ) actualResourceCount ++ ; } IResource [ ] actualNonJavaResources = new IResource [ actualResourceCount ] ; for ( int i = 0 , max = nonJavaResources . length , index = 0 ; i < max ; i ++ ) { if ( ( nonJavaResources [ i ] ) instanceof IResource ) actualNonJavaResources [ ( index ++ ) ] = ( ( IResource ) ( nonJavaResources [ i ] ) ) ; } deleteResources ( actualNonJavaResources , fForce ) ; IResource [ ] remainingFiles ; try { remainingFiles = ( ( IContainer ) ( res ) ) . members ( ) ; } catch ( CoreException ce ) { throw new JavaModelException ( ce ) ; } boolean isEmpty = true ; for ( int i = 0 , length = remainingFiles . length ; i < length ; i ++ ) { IResource file = remainingFiles [ i ] ; <START_BUG> if ( ( file instanceof IFile ) && ( Util . isClassFileName ( file . getFileExtension ( ) ) ) ) { <END_BUG> this . deleteResource ( file , ( ( IResource . FORCE ) | ( IResource . KEEP_HISTORY ) ) ) ; } else { isEmpty = false ; } } if ( isEmpty && ( ! ( frag . isDefaultPackage ( ) ) ) ) { IResource fragResource = frag . getResource ( ) ; if ( fragResource != null ) { deleteEmptyPackageFragment ( frag , false , fragResource . getParent ( ) ) ; } } } } protected String getMainTaskName ( ) { } protected void processElement ( IJavaElement element ) throws JavaModelException { } protected void verify ( IJavaElement element ) throws JavaModelException { } }

Fix:
if ( ( file instanceof IFile ) && ( Util . isClassFileName ( file . getName ( ) ) ) ) {
Buggy code:
public class CookieMonster implements Callable < Object > { private final VendingMachine vendingMachine ; private final Timer timer ; private final CountDownLatch start ; public CookieMonster ( final VendingMachine vendingMachine , Timer timer , CountDownLatch start ) { } public Object call ( ) throws Exception { int day = timer . getDay ( ) ; start . countDown ( ) ; start . await ( ) ; while ( day < ( Main . DAYS_TO_RUN ) ) { new akka . stm . Atomic < Boolean > ( ) { public Boolean atomically ( ) { if ( vendingMachine . dispenseCookie ( 1 , this . getClass ( ) ) ) System . out . println ( "<seq2seq4repair_space>Me<seq2seq4repair_space>love<seq2seq4repair_space>cookies" ) ; else System . out . println ( "<seq2seq4repair_space>Me<seq2seq4repair_space>hungry" ) ; return true ; } } . execute ( ) ; <START_BUG> Thread . sleep ( 500 ) ; <END_BUG> day = timer . getDay ( ) ; } return null ; } No newline ; at end ; of file ; }

Fix:
Thread . sleep ( ( ( long ) ( ( Main . SECONDS_IN_A_DAY ) * 0.5 ) ) ) ;
Buggy code:
public class PrecisionTest { @ Test public void testEqualsWithRelativeTolerance ( ) { } @ Test public void testEqualsIncludingNaN ( ) { } @ Test public void testEqualsWithAllowedDelta ( ) { } @ Test public void testMath475 ( ) { } @ Test public void testEqualsIncludingNaNWithAllowedDelta ( ) { } @ Test public void testFloatEqualsWithAllowedUlps ( ) { } @ Test public void testEqualsWithAllowedUlps ( ) { } @ Test public void testEqualsIncludingNaNWithAllowedUlps ( ) { } @ Test public void testCompareToEpsilon ( ) { } @ Test public void testCompareToMaxUlps ( ) { } @ Test public void testRoundDouble ( ) { } @ Test public void testRoundFloat ( ) { } @ Test public void testIssue721 ( ) { } @ Test public void testRepresentableDelta ( ) { int nonRepresentableCount = 0 ; final double x = 100 ; final int numTrials = 10000 ; for ( int i = 0 ; i < numTrials ; i ++ ) { <START_BUG> final double originalDelta = Math . random ( ) ; <END_BUG> final double delta = Precision . representableDelta ( x , originalDelta ) ; if ( delta != originalDelta ) { ++ nonRepresentableCount ; } } Assert . assertTrue ( ( ( nonRepresentableCount // ( ( double ) ( numTrials ) ) ) > 0.9 ) ) ; } @ Test public void testMath843 ( ) { } }

Fix:
final double originalDelta = FastMath . random ( ) ;
Buggy code:
public class UI { protected static final String TAG = "UI" ; public static GameMode mode ; public static GameMode oldmode ; public static Context context ; public static Game gamestate ; public static AlertDialog windialog ; public static LinearLayout wintextll ; public static World world ; private static long oldseconds ; public static void setup ( Context context , World theworld , FrameBuffer fb , int w , int h ) { } public static void update ( ) { } public static void setMode ( GameMode mode ) { } public static void handleRelease ( int x , int y ) { } public static void handleFirstTouch ( float xpos , float ypos ) { } public static void handleTouching ( float xpos , float ypos ) { } public static void updateMoveCount ( ) { } public static void winGame ( ) { activity . runOnUiThread ( new Runnable ( ) { @ TargetApi ( VERSION_CODES . HONEYCOMB ) @ Override public void run ( ) { AlertDialog . Builder builder = new AlertDialog . Builder ( UI . context ) ; LayoutInflater inflater = ( ( LayoutInflater ) ( UI . context . getSystemService ( LAYOUT_INFLATER_SERVICE ) ) ) ; UI . wintextll = ( ( LinearLayout ) ( inflater . inflate ( R . layout . windialog , null ) ) ) ; builder . setView ( UI . wintextll ) . setPositiveButton ( "New<seq2seq4repair_space>Game" , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int id ) { activity . reset ( null ) ; } } ) ; UI . windialog = builder . create ( ) ; boolean beatmoves = Game . checkBestMoves ( ) ; String movestring = ( ( "#<seq2seq4repair_space>of<seq2seq4repair_space>moves:<seq2seq4repair_space>" + ( Game . movecount ) ) + "<seq2seq4repair_space>Best<seq2seq4repair_space>#<seq2seq4repair_space>of<seq2seq4repair_space>moves:<seq2seq4repair_space>" ) + ( Game . bestmovecount ) ; if ( beatmoves ) movestring += "<seq2seq4repair_space>New<seq2seq4repair_space>Record!" ; TextView movestext = ( ( TextView ) ( UI . wintextll . findViewById ( wintext2 ) ) ) ; movestext . setText ( movestring ) ; TextView timertext = ( ( TextView ) ( UI . wintextll . findViewById ( wintext3 ) ) ) ; boolean beattime = Game . checkBestTime ( ) ; int seconds = ( ( int ) ( ( Game . currenttime ) // 1000 ) ) ; int minutes = seconds // 60 ; seconds = seconds % 60 ; int bestsecs = ( ( int ) ( ( Game . besttime ) // 1000 ) ) ; int bestmins = bestsecs // 60 ; <START_BUG> bestsecs = seconds % 60 ; <END_BUG> String timestring = ( String . format ( "Time<seq2seq4repair_space>finished<seq2seq4repair_space>in:<seq2seq4repair_space>%d:%02d" , minutes , seconds ) ) + ( String . format ( "<seq2seq4repair_space>Best<seq2seq4repair_space>time:<seq2seq4repair_space>%d:%02d" , bestmins , bestsecs ) ) ; if ( beattime ) timestring += "<seq2seq4repair_space>New<seq2seq4repair_space>Record!" ; timertext . setText ( timestring ) ; UI . wintextll . setAlpha ( 0 ) ; UI . windialog . show ( ) ; } } ) ; } @ TargetApi ( VERSION_CODES . HONEYCOMB ) public static void winGameUpdate ( ) { } }

Fix:
bestsecs = bestsecs % 60 ;
Buggy code:
public class MoveItem extends JsonMessageHandler < ConnectionToGridiaClientHandler > { @ Override protected void handle ( ConnectionToGridiaClientHandler connection , JsonObject data ) { ServingGridia server = connection . getServer ( ) ; Player player = connection . getPlayer ( ) ; String source = data . get ( "source" ) . getAsString ( ) ; String dest = data . get ( "dest" ) . getAsString ( ) ; int sourceIndex = data . get ( "si" ) . getAsInt ( ) ; int quantityToMove = data . get ( "quantity" ) . getAsInt ( ) ; int destIndex = data . get ( "di" ) . getAsInt ( ) ; if ( ( source . equals ( dest ) ) && ( sourceIndex == destIndex ) ) { return ; } ItemWrapper sourceItemWrapped = server . getItemFrom ( player , source , sourceIndex ) ; ItemInstance sourceItem = sourceItemWrapped . getItemInstance ( ) ; if ( ( sourceItem == ( ItemInstance . NONE ) ) || ( ( ! ( player . accountDetails . isAdmin ) ) && ( ! ( sourceItem . getData ( ) . moveable ) ) ) ) { return ; } if ( quantityToMove == ( - 1 ) ) { quantityToMove = sourceItem . getQuantity ( ) ; } ItemInstance itemToMove = new ItemInstance ( sourceItem . getData ( ) , quantityToMove ) ; itemToMove . age = sourceItem . age ; ItemWrapper destItemWrapped = server . getItemFrom ( player , dest , destIndex ) ; <START_BUG> boolean moveSuccessful = destItemWrapped . addItemHere ( sourceItem ) ; <END_BUG> if ( ! moveSuccessful ) { return ; } sourceItemWrapped . changeWrappedItem ( sourceItem . remove ( quantityToMove ) ) ; } }

Fix:
boolean moveSuccessful = destItemWrapped . addItemHere ( itemToMove ) ;
Buggy code:
public class PathRelationship implements Serializable , Cloneable , AsString { public final Path leftNode ; public final Direction direction ; public final Identifier as ; public final Iterable < Identifier > relationships ; public final PropertyValues relationshipPropertyValues ; public final Integer minHops ; public final Integer maxHops ; PathRelationship ( Path leftNode , Direction direction , Identifier as , Iterable < Identifier > relationships , PropertyValues relationshipPropertyValues , Integer minHops , Integer maxHops ) { } public PathRelationship values ( PropertyValue ... propertyValues ) { } public PathRelationship values ( Iterable < PropertyValue > propertyValues ) { } public PathRelationship as ( String name ) { } public PathRelationship as ( Identifier name ) { } public PathRelationship hops ( Integer minHops , Integer maxHops ) { } public Path node ( ) { } public Path node ( String id ) { } public Path node ( Expression id ) { } @ Override public void asString ( StringBuilder builder ) { leftNode . asString ( builder ) ; builder . append ( ( direction . equals ( IN ) ? "<-" : "-" ) ) ; boolean hasRelationships = relationships . iterator ( ) . hasNext ( ) ; <START_BUG> if ( ( ( ( ( as ) != null ) || hasRelationships ) || ( ( minHops ) != null ) ) || ( ( maxHops ) != null ) ) { <END_BUG> builder . append ( '[' ) ; if ( ( as ) != null ) { as . asString ( builder ) ; } if ( hasRelationships ) { builder . append ( ':' ) ; String or = "" ; for ( Identifier relationship : relationships ) { builder . append ( or ) ; relationship . asString ( builder ) ; or = "|" ; } } if ( ( ( minHops ) != null ) || ( ( maxHops ) != null ) ) { builder . append ( '*' ) ; if ( ( minHops ) != null ) { builder . append ( minHops ) ; } builder . append ( ".." ) ; if ( ( maxHops ) != null ) { builder . append ( maxHops ) ; } } if ( ( relationshipPropertyValues ) != null ) { builder . append ( '<seq2seq4repair_space>' ) ; relationshipPropertyValues . asString ( builder ) ; } builder . append ( ']' ) ; } builder . append ( ( direction . equals ( OUT ) ? "->" : "-" ) ) ; } }

Fix:
if ( ( ( ( ( ( as ) != null ) || hasRelationships ) || ( ( minHops ) != null ) ) || ( ( maxHops ) != null ) ) || ( ( relationshipPropertyValues ) != null ) ) {
Buggy code:
public class RemoteSource implements AudioSource { public static final List < String > YOUTUBE_DL_LAUNCH_ARGS = Collections . unmodifiableList ( Arrays . asList ( "python" , ".//youtube-dl" , "-q" , "-f" , "bestaudio//best" , "--no-playlist" , "-o" , "-" ) ) ; public static final List < String > FFMPEG_LAUNCH_ARGS = Collections . unmodifiableList ( Arrays . asList ( "ffmpeg" , "-i" , "-" , "-f" , "s16be" , "-ac" , "2" , "-ar" , "48000" , "-map" , "a" , "-" ) ) ; private final String url ; private final List < String > ytdlLaunchArgsF ; private final List < String > ffmpegLaunchArgsF ; private AudioInfo audioInfo ; public RemoteSource ( String url ) { } public RemoteSource ( String url , List < String > ytdlLaunchArgs , List < String > ffmpegLaunchArgs ) { } public String getSource ( ) { } @ Override public AudioInfo getInfo ( ) { } @ Override public AudioStream asStream ( ) { List < String > ytdlLaunchArgs = new ArrayList < > ( ) ; List < String > ffmpegLaunchArgs = new ArrayList < > ( ) ; if ( ( ytdlLaunchArgsF ) == null ) ytdlLaunchArgs . addAll ( RemoteSource . YOUTUBE_DL_LAUNCH_ARGS ) ; else { ytdlLaunchArgs . addAll ( ytdlLaunchArgsF ) ; if ( ! ( ytdlLaunchArgs . contains ( "-q" ) ) ) ytdlLaunchArgs . add ( "-q" ) ; } if ( ( ffmpegLaunchArgsF ) == null ) ffmpegLaunchArgs . addAll ( RemoteSource . FFMPEG_LAUNCH_ARGS ) ; else <START_BUG> ffmpegLaunchArgs . addAll ( ytdlLaunchArgsF ) ; <END_BUG> ytdlLaunchArgs . add ( url ) ; return new RemoteStream ( ytdlLaunchArgs , ffmpegLaunchArgs ) ; } @ Override public File asFile ( String path , boolean deleteIfExists ) throws FileNotFoundException , FileAlreadyExistsException { } }

Fix:
ffmpegLaunchArgs . addAll ( ffmpegLaunchArgsF ) ;
Buggy code:
public class TestDocumentsWriterDeleteQueue extends LuceneTestCase { public void testUpdateDelteSlices ( ) { DocumentsWriterDeleteQueue queue = new DocumentsWriterDeleteQueue ( ) ; final int size = 200 + ( ( random ( ) . nextInt ( 500 ) ) * ( RANDOM_MULTIPLIER ) ) ; Integer [ ] ids = new Integer [ size ] ; for ( int i = 0 ; i < ( ids . length ) ; i ++ ) { ids [ i ] = random ( ) . nextInt ( ) ; } DeleteSlice slice1 = queue . newSlice ( ) ; DeleteSlice slice2 = queue . newSlice ( ) ; BufferedDeletes bd1 = new BufferedDeletes ( ) ; BufferedDeletes bd2 = new BufferedDeletes ( ) ; int last1 = 0 ; int last2 = 0 ; Set < Term > uniqueValues = new HashSet < Term > ( ) ; for ( int j = 0 ; j < ( ids . length ) ; j ++ ) { Integer i = ids [ j ] ; Term [ ] term = new Term [ ] { new Term ( "id" , i . toString ( ) ) } ; uniqueValues . add ( term [ 0 ] ) ; queue . addDelete ( term ) ; if ( ( ( random ( ) . nextInt ( 20 ) ) == 0 ) || ( j == ( ( ids . length ) - 1 ) ) ) { queue . updateSlice ( slice1 ) ; assertTrue ( slice1 . isTailItem ( term ) ) ; slice1 . apply ( bd1 , j ) ; assertAllBetween ( last1 , j , bd1 , ids ) ; last1 = j + 1 ; } if ( ( ( random ( ) . nextInt ( 10 ) ) == 5 ) || ( j == ( ( ids . length ) - 1 ) ) ) { queue . updateSlice ( slice2 ) ; assertTrue ( slice2 . isTailItem ( term ) ) ; slice2 . apply ( bd2 , j ) ; assertAllBetween ( last2 , j , bd2 , ids ) ; last2 = j + 1 ; } <START_BUG> assertEquals ( uniqueValues . size ( ) , queue . numGlobalTermDeletes ( ) ) ; <END_BUG> } assertEquals ( uniqueValues , bd1 . terms . keySet ( ) ) ; assertEquals ( uniqueValues , bd2 . terms . keySet ( ) ) ; HashSet < Term > frozenSet = new HashSet < Term > ( ) ; for ( Term t : queue . freezeGlobalBuffer ( null ) . termsIterable ( ) ) { BytesRef bytesRef = new BytesRef ( ) ; bytesRef . copyBytes ( t . bytes ) ; frozenSet . add ( new Term ( t . field , bytesRef ) ) ; } assertEquals ( uniqueValues , frozenSet ) ; assertEquals ( "num<seq2seq4repair_space>deletes<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>0<seq2seq4repair_space>after<seq2seq4repair_space>freeze" , 0 , queue . numGlobalTermDeletes ( ) ) ; } private void assertAllBetween ( int start , int end , BufferedDeletes deletes , Integer [ ] ids ) { } public void testClear ( ) { } public void testAnyChanges ( ) { } public void testPartiallyAppliedGlobalSlice ( ) throws IllegalAccessException , IllegalArgumentException , InterruptedException , NoSuchFieldException , SecurityException { } public void testStressDeleteQueue ( ) throws InterruptedException { } private static class UpdateThread extends Thread { final DocumentsWriterDeleteQueue queue ; final AtomicInteger index ; final Integer [ ] ids ; final DeleteSlice slice ; final BufferedDeletes deletes ; final CountDownLatch latch ; protected UpdateThread ( DocumentsWriterDeleteQueue queue , AtomicInteger index , Integer [ ] ids , CountDownLatch latch ) { } @ Override public void run ( ) { } } }

Fix:
assertEquals ( ( j + 1 ) , queue . numGlobalTermDeletes ( ) ) ;
Buggy code:
public class AssemblerOperationsBlock { private final Block block ; private final ArrayList < AssemblerOperation > operations ; private final Set < AssemblerOperationsBlock > predecessors = new HashSet < > ( ) ; private final Set < AssemblerOperationsBlock > successors = new HashSet < > ( ) ; private final Set < VirtualRegister > uses = new HashSet < > ( ) ; private final Set < VirtualRegister > kills = new HashSet < > ( ) ; private final Set < VirtualRegister > liveIn = new HashSet < > ( ) ; private final Set < VirtualRegister > liveOut = new HashSet < > ( ) ; private final HashMap < VirtualRegister , AssemblerOperation > lastUsed = new HashMap < > ( ) ; public AssemblerOperationsBlock ( Block block , ArrayList < AssemblerOperation > operations ) { } public void calculateTree ( HashMap < Block , AssemblerOperationsBlock > operationsBlocks ) { } public void calculateUsesAndKills ( ) { } public Set < VirtualRegister > calculatePreallocatedRegisters ( ) { } public boolean calculateLiveInAndOut ( ) { } private void calculateLiveOut ( ) { } public Set < VirtualRegister > getLiveIn ( ) { } public Set < VirtualRegister > getLiveOut ( ) { } @ Override public String toString ( ) { } public Set < AssemblerOperationsBlock > getPredecessors ( ) { } public ArrayList < AssemblerOperation > getOperations ( ) { } public boolean isLastUsage ( VirtualRegister register , AssemblerOperation operation ) { } public boolean dominates ( AssemblerOperationsBlock otherBlock ) { <START_BUG> return FirmUtils . blockPostdominates ( block , otherBlock . block ) ; <END_BUG> } public boolean strictlyDominates ( AssemblerOperation operation1 , AssemblerOperation operation2 ) { } }

Fix:
return FirmUtils . blockDominates ( block , otherBlock . block ) ;
Buggy code:
public abstract class UIJob extends Job { private Display cachedDisplay ; public UIJob ( String name ) { } public UIJob ( Display jobDisplay , String name ) { } public static IStatus errorStatus ( Throwable exception ) { } public final IStatus run ( final IProgressMonitor monitor ) { if ( monitor . isCanceled ( ) ) return Status . CANCEL_STATUS ; Display asyncDisplay = getDisplay ( ) ; if ( ( asyncDisplay == null ) || ( asyncDisplay . isDisposed ( ) ) ) { return Status . CANCEL_STATUS ; } asyncDisplay . asyncExec ( new Runnable ( ) { public void run ( ) { IStatus result = null ; try { setThread ( Thread . currentThread ( ) ) ; if ( monitor . isCanceled ( ) ) result = Status . CANCEL_STATUS ; else { UIStats . start ( UI_JOB , getName ( ) ) ; result = runInUIThread ( monitor ) ; } } finally { UIStats . end ( UI_JOB , UIJob . this , getName ( ) ) ; if ( result == null ) <START_BUG> result = new Status ( IStatus . ERROR , PlatformUI . PLUGIN_ID , IStatus . ERROR , ProgressMessages . getString ( "Error" ) , null ) ; <END_BUG> done ( result ) ; } } } ) ; return Job . ASYNC_FINISH ; } public abstract IStatus runInUIThread ( IProgressMonitor monitor ) { } public void setDisplay ( Display runDisplay ) { } public Display getDisplay ( ) { } }

Fix:
result = new Status ( IStatus . ERROR , PlatformUI . PLUGIN_ID , IStatus . ERROR , ProgressMessages . Error , null ) ;
Buggy code:
public class ConditionalExpression extends Expression { public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( ConditionalExpression . class , "expression" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor THEN_EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( ConditionalExpression . class , "thenExpression" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor ELSE_EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( ConditionalExpression . class , "elseExpression" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Expression conditionExpression = null ; private Expression thenExpression = null ; private Expression elseExpression = null ; ConditionalExpression ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { ConditionalExpression result = new ConditionalExpression ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setExpression ( ( ( Expression ) ( getExpression ( ) . clone ( target ) ) ) ) ; result . setThenExpression ( ( ( Expression ) ( getThenExpression ( ) . clone ( target ) ) ) ) ; result . setElseExpression ( ( ( Expression ) ( getElseExpression ( ) . clone ( target ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { } public void setExpression ( Expression expression ) { } public Expression getThenExpression ( ) { } public void setThenExpression ( Expression expression ) { } public Expression getElseExpression ( ) { } public void setElseExpression ( Expression expression ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class ArgumentParser { public static final String COMMON_PREFIX = "-" ; public static final String FLOATING_PREFIX = ArgumentParser . COMMON_PREFIX ; public static final String FLAG_PREFIX = ( ArgumentParser . COMMON_PREFIX ) + '-' ; public ArgumentParseResults parse ( AbstractCommand command , String [ ] args ) throws CommandException { } private void parseStaticArgs ( AbstractCommand command , ArgumentParseResults results , Deque < CommandParameter > staticParameters , Deque < String > arguments ) throws CommandException { } private void parseNonStaticArgs ( AbstractCommand command , ArgumentParseResults results , RetrievableSet < CommandParameter > parameters , RetrievableSet < FlagParameter > flags , Deque < String > arguments ) throws CommandException { while ( ! ( arguments . isEmpty ( ) ) ) { String paramName = arguments . removeFirst ( ) ; if ( ! ( paramName . startsWith ( ArgumentParser . COMMON_PREFIX ) ) ) CommandException . invalidArgument ( command , paramName ) ; if ( paramName . startsWith ( ArgumentParser . FLAG_PREFIX ) ) { paramName = paramName . substring ( ArgumentParser . FLAG_PREFIX . length ( ) ) ; FlagParameter parameter = flags . removeRetrieve ( new FlagParameter ( paramName , ( - 1 ) ) ) ; if ( parameter == null ) { CommandException . invalidFlag ( command , paramName ) ; } results . setFlag ( paramName , true ) ; } else if ( paramName . startsWith ( ArgumentParser . FLOATING_PREFIX ) ) { paramName = paramName . substring ( ArgumentParser . FLOATING_PREFIX . length ( ) ) ; CommandParameter parameter = parameters . removeRetrieve ( new CommandParameter ( paramName , null ) ) ; if ( parameter == null ) { CommandException . invalidParam ( command , paramName ) ; } if ( arguments . isEmpty ( ) ) { CommandException . missingRequiredArg ( command , parameter ) ; } String arg = parseArgValue ( arguments . removeFirst ( ) , arguments ) ; CommandArgument commandArgument = new CommandArgument ( parameter , arg ) ; if ( results . getArgMap ( ) . containsKey ( paramName ) ) { CommandException . duplicateArg ( command , parameter ) ; } results . getFloatingArgs ( ) . add ( commandArgument ) ; results . getArgMap ( ) . put ( paramName , commandArgument ) ; } } if ( ! ( parameters . isEmpty ( ) ) ) { for ( CommandParameter param : parameters ) { if ( param . hasDefaultValue ( ) ) { <START_BUG> CommandArgument commandArgument = new CommandArgument ( param , param . getDefaultValue ( ) ) ; <END_BUG> results . getFloatingArgs ( ) . add ( commandArgument ) ; results . getArgMap ( ) . put ( param . getName ( ) , commandArgument ) ; } else { CommandException . missingRequiredArg ( command , param ) ; } } } } private String parseArgValue ( String currentArg , Deque < String > argsQueue ) { } }

Fix:
CommandArgument commandArgument = new CommandArgument ( param , null ) ;
Buggy code:
public class PackageFragmentRoot extends Openable implements IPackageFragmentRoot { protected IResource fResource ; protected PackageFragmentRoot ( IResource resource , IJavaProject project ) { } protected PackageFragmentRoot ( IResource resource , IJavaProject project , String path ) { } public void attachSource ( IPath zipPath , IPath rootPath , IProgressMonitor monitor ) throws JavaModelException { } protected boolean computeChildren ( OpenableElementInfo info ) throws JavaModelException { } protected void computeFolderChildren ( IContainer folder , String prefix , Vector vChildren ) throws JavaModelException { } protected OpenableElementInfo createElementInfo ( ) { } public IPackageFragment createPackageFragment ( String name , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected int determineKind ( IResource underlyingResource ) throws JavaModelException { <START_BUG> IClasspathEntry [ ] entries = getJavaProject ( ) . getResolvedClasspath ( true ) ; <END_BUG> for ( int i = 0 ; i < ( entries . length ) ; i ++ ) { IClasspathEntry entry = entries [ i ] ; if ( entry . getPath ( ) . equals ( underlyingResource . getFullPath ( ) ) ) { return entry . getContentKind ( ) ; } } return IPackageFragmentRoot . K_SOURCE ; } public boolean equals ( Object o ) { } public boolean exists ( ) { } public boolean exists0 ( ) { } protected boolean generateInfos ( OpenableElementInfo info , IProgressMonitor pm , Hashtable newElements , IResource underlyingResource ) throws JavaModelException { } protected char getHandleMementoDelimiter ( ) { } public int getKind ( ) throws JavaModelException { } public Object [ ] getNonJavaResources ( ) throws JavaModelException { } public IPackageFragment getPackageFragment ( String packageName ) { } protected String getPackageName ( IFolder folder ) throws JavaModelException { } public IPath getPath ( ) { } public IPath getSourceAttachmentPath ( ) throws JavaModelException { } public IPath getSourceAttachmentRootPath ( ) throws JavaModelException { } public IResource getUnderlyingResource ( ) throws JavaModelException { } public int hashCode ( ) { } public boolean isArchive ( ) { } public boolean isExternal ( ) { } public void refreshChildren ( ) { } public void resetNonJavaResources ( ) throws JavaModelException { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
IClasspathEntry [ ] entries = getJavaProject ( ) . getExpandedClasspath ( true ) ;
Buggy code:
public class OpenHABWidgetListFragment extends ListFragment { private static final String TAG = "OpenHABWidgetListFragment" ; private OnWidgetSelectedListener widgetSelectedListener ; private OpenHABWidgetDataSource openHABWidgetDataSource ; private OpenHABWidgetAdapter openHABWidgetAdapter ; private String displayPageUrl ; private String sitemapRootUrl = "" ; private String openHABBaseUrl = "https:////demo.openhab.org:8443//" ; private ArrayList < OpenHABWidget > widgetList = new ArrayList < OpenHABWidget > ( ) ; private String openHABUsername = "" ; private String openHABPassword = "" ; private OpenHABWidget selectedOpenHABWidget ; private String nfcWidgetId ; private String nfcCommand ; private boolean nfcAutoClose = false ; private OpenHABMainActivity mActivity ; private MyAsyncHttpClient mAsyncHttpClient ; private boolean mIsVisible = false ; private OpenHABWidgetListFragment mTag ; private int mCurrentSelectedItem = - 1 ; private int mPosition ; private int mOldSelectedItem = - 1 ; private String mAtmosphereTrackingId ; private Handler networkHandler = new Handler ( ) ; private Runnable networkRunnable ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } @ Override public void onPause ( ) { } @ Override public void onResume ( ) { } @ Override public void onSaveInstanceState ( Bundle savedInstanceState ) { } @ Override public void setUserVisibleHint ( boolean isVisibleToUser ) { } public static OpenHABWidgetListFragment withPage ( String pageUrl , String baseUrl , String rootUrl , String username , String password , int position ) { } public void showPage ( String pageUrl , final boolean longPolling ) { } public void processContent ( Document document , boolean longPolling ) { } private void stopProgressIndicator ( ) { } private void startProgressIndicator ( ) { } private void showAlertDialog ( String alertMessage ) { } public void setOpenHABUsername ( String openHABUsername ) { } public void setOpenHABPassword ( String openHABPassword ) { } public void setDisplayPageUrl ( String displayPageUrl ) { } public String getDisplayPageUrl ( ) { } public String getTitle ( ) { } public void clearSelection ( ) { <START_BUG> if ( ( ( getListView ( ) ) != null ) && ( this . isVisible ( ) ) ) { <END_BUG> getListView ( ) . clearChoices ( ) ; getListView ( ) . requestLayout ( ) ; } } public int getPosition ( ) { } }

Fix:
if ( ( ( ( getListView ( ) ) != null ) && ( this . isVisible ( ) ) ) && ( isAdded ( ) ) ) {
Buggy code:
public class TypeDeclarationStatement extends Statement { public static final ChildPropertyDescriptor TYPE_DECLARATION_PROPERTY = new ChildPropertyDescriptor ( TypeDeclarationStatement . class , "typeDeclaration" , TypeDeclaration . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor DECLARATION_PROPERTY = new ChildPropertyDescriptor ( TypeDeclarationStatement . class , "declaration" , AbstractTypeDeclaration . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; public static List propertyDescriptors ( int apiLevel ) { } private AbstractTypeDeclaration typeDecl = null ; TypeDeclarationStatement ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } 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 AbstractTypeDeclaration getDeclaration ( ) { if ( ( this . typeDecl ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . typeDecl ) == null ) { preLazyInit ( ) ; this . typeDecl = new TypeDeclaration ( this . ast ) ; postLazyInit ( this . typeDecl , TypeDeclarationStatement . TYPE_DECLARATION_PROPERTY ) ; } } } return this . typeDecl ; } public void setDeclaration ( AbstractTypeDeclaration decl ) { } public TypeDeclaration getTypeDeclaration ( ) { } public void setTypeDeclaration ( TypeDeclaration decl ) { } public ITypeBinding resolveBinding ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {