nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SimpleResolver implements Resolver { public static final int PORT = 53 ; private InetAddress addr ; private int port = SimpleResolver . PORT ; private boolean useTCP ; private boolean ignoreTruncation ; private int EDNSlevel = - 1 ; private TSIG tsig ; private int timeoutValue = 60 * 1000 ; static String defaultResolver = "localhost" ; public SimpleResolver ( String hostname ) throws UnknownHostException { } public SimpleResolver ( ) throws UnknownHostException { } public static void setDefaultResolver ( String hostname ) { } public void setPort ( int port ) { } public void setTCP ( boolean flag ) { } public void setIgnoreTruncation ( boolean flag ) { } public void setEDNS ( int level ) { } public void setTSIGKey ( String name , String key ) { } public void setTSIGKey ( String key ) { } public void setTimeout ( int secs ) { } Message sendTCP ( Message query , byte [ ] out ) throws IOException { } public Message send ( Message query ) { byte [ ] out ; byte [ ] in ; Message response ; DatagramSocket s ; DatagramPacket dp ; int udpLength = 512 ; try { try { s = new DatagramSocket ( ) ; } catch ( SocketException e ) { System . out . println ( e ) ; return null ; } query = ( ( Message ) ( query . clone ( ) ) ) ; if ( ( EDNSlevel ) >= 0 ) { udpLength = 1280 ; query . addRecord ( ADDITIONAL , EDNS . newOPT ( udpLength ) ) ; } if ( ( tsig ) != null ) tsig . apply ( query , null ) ; out = query . toWire ( ) ; <START_BUG> if ( useTCP ) <END_BUG> return sendTCP ( query , out ) ; s . send ( new DatagramPacket ( out , out . length , addr , port ) ) ; dp = new DatagramPacket ( new byte [ udpLength ] , udpLength ) ; s . setSoTimeout ( timeoutValue ) ; try { s . receive ( dp ) ; } catch ( InterruptedIOException e ) { s . close ( ) ; System . out . println ( ";;<seq2seq4repair_space>No<seq2seq4repair_space>response" ) ; return null ; } in = new byte [ dp . getLength ( ) ] ; System . arraycopy ( dp . getData ( ) , 0 , in , 0 , in . length ) ; response = new Message ( in ) ; if ( ( tsig ) != null ) { boolean ok = tsig . verify ( response , in , query . getTSIG ( ) ) ; System . out . println ( ( ";;<seq2seq4repair_space>TSIG<seq2seq4repair_space>verify:<seq2seq4repair_space>" + ok ) ) ; } s . close ( ) ; if ( ( response . getHeader ( ) . getFlag ( TC ) ) && ( ! ( ignoreTruncation ) ) ) return sendTCP ( query , out ) ; else return response ; } catch ( IOException e ) { return null ; } } private int uniqueID ( Message m ) { } public int sendAsync ( final Message query , final ResolverListener listener ) { } public Message sendAXFR ( Message query ) { } }

Fix:
if ( ( useTCP ) || ( ( out . length ) > udpLength ) )
Buggy code:
public class CreateBook extends WebPage { private static final long serialVersionUID = 1L ; private Book book = new Book ( null , null ) ; public CreateBook ( ) { } public class CreateForm extends Form { private static final long serialVersionUID = 1L ; public CreateForm ( String id ) { } public void onSubmit ( ) { try { Page page = new SuccessPage ( ) ; page . info ( getString ( "book.save.success" , new wicket . model . Model ( book ) ) ) ; setResponsePage ( page ) ; } finally { <START_BUG> getPage ( ) . getPageMap ( ) . removePage ( getPage ( ) ) ; <END_BUG> } } } }

Fix:
getPage ( ) . getPageMap ( ) . remove ( getPage ( ) ) ;
Buggy code:
public class SubscribeSpotify implements MqttCallback { MqttClient client ; MqttMessage message ; int playCounter = 0 ; PlayMusic musicPlayer = new PlayMusic ( ) ; public static void main ( String [ ] args ) { <START_BUG> new SubscribeLocal ( ) . activateSubscriptionForLocal ( ) ; <END_BUG> } public void activateSubscriptionForSpotify ( ) { } @ Override public void connectionLost ( Throwable arg0 ) { } @ Override public void deliveryComplete ( IMqttDeliveryToken arg0 ) { } @ Override public void messageArrived ( String arg0 , MqttMessage arg1 ) throws Exception { } }

Fix:
new SubscribeSpotify ( ) . activateSubscriptionForSpotify ( ) ;
Buggy code:
public class SOContext implements ISharedObjectContext { static Trace debug = Trace . create ( "sharedobjectcontext" ) ; protected SOContainer container = null ; protected ID sharedObjectID ; protected ID homeContainerID ; protected boolean isActive ; protected Map properties ; protected IQueueEnqueue queue ; public SOContext ( ID objID , ID homeID , SOContainer cont , Map props , IQueueEnqueue queue ) { } public boolean isActive ( ) { } protected void trace ( String msg ) { } protected void traceDump ( String msg , Throwable e ) { } protected void makeInactive ( ) { } protected boolean isInactive ( ) { } public ID getLocalContainerID ( ) { } public ISharedObjectManager getSharedObjectManager ( ) { } public IQueueEnqueue getQueue ( ) { } public void connect ( ID groupID , IConnectContext joinContext ) throws ContainerConnectException { } public void disconnect ( ) { } public ID getConnectedID ( ) { } public boolean isGroupManager ( ) { } public boolean isGroupServer ( ) { } public ID [ ] getGroupMemberIDs ( ) { } public void sendCreate ( ID toContainerID , ReplicaSharedObjectDescription sd ) throws IOException { } public void sendCreateResponse ( ID toContainerID , Throwable throwable , long identifier ) throws IOException { } public void sendDispose ( ID toContainerID ) throws IOException { } public void sendMessage ( ID toContainerID , Object data ) throws IOException { } public Object getAdapter ( Class clazz ) { <START_BUG> return null ; <END_BUG> } public IOSGIService getServiceAccess ( ) { } public Namespace getConnectNamespace ( ) { } public Map getLocalContainerProperties ( ) { } }

Fix:
return container . getAdapter ( clazz ) ;
Buggy code:
public class Trick { private final Map < Role , ObjectProperty < Card > > cardProperties = new HashMap < > ( ) ; private final Role initiator ; private ObjectBinding < Role > winner ; private IntegerBinding value ; public Trick ( Role initiator , GameType gameType ) { } void playCard ( Role role , Card card ) { } public Card getCard ( Role role ) { } public ObjectBinding < Card > getCardProperty ( Role role ) { } public Role getWinner ( ) { } public ObjectBinding < Role > winnerProperty ( ) { } public Role getInitiator ( ) { } public Role getNext ( ) { <START_BUG> if ( ( winner ) != null ) { <END_BUG> return null ; } Role next = initiator ; while ( ( getCard ( next ) ) != null ) { next = next . next ( ) ; } return next ; } public int getValue ( ) { } }

Fix:
if ( ( winner . get ( ) ) != null ) {
Buggy code:
public class DateTextField extends TextField < Date > implements ITextFormatProvider { private static final long serialVersionUID = 1L ; public static DateTextField forDatePattern ( String id , IModel < Date > model , String datePattern ) { } public static DateTextField forDatePattern ( String id , String datePattern ) { } public static DateTextField forDateStyle ( String id , IModel < Date > model , String dateStyle ) { } public static DateTextField forDateStyle ( String id , String dateStyle ) { } public static DateTextField forShortStyle ( String id ) { } public static DateTextField forShortStyle ( String id , IModel < Date > model , boolean applyTimeZoneDifference ) { } public static DateTextField withConverter ( String id , DateConverter converter ) { } public static DateTextField withConverter ( String id , IModel < Date > model , DateConverter converter ) { } private final DateConverter converter ; public DateTextField ( String id , IModel < Date > model , DateConverter converter ) { } @ SuppressWarnings ( "unchecked" ) @ Override public final < C > IConverter < C > getConverter ( Class < C > clazz ) { } public final String getTextFormat ( ) { <START_BUG> return converter . getDatePattern ( ) ; <END_BUG> } }

Fix:
return converter . getDatePattern ( getLocale ( ) ) ;
Buggy code:
public class Upload extends AppCompatActivity { static final long mb5 = ( ( long ) ( 5 * 1.0E10 ) ) ; static final long mb1 = ( ( long ) ( 1 * 1.0E10 ) ) ; static final int CAPTURE_IMAGE_ACTIVITY = 2187 ; boolean first = true ; final String directoryName = "ClothApp" ; String photoFileName = new SimpleDateFormat ( "'IMG_'yyyyMMdd_hhmmss'.jpg'" ) . format ( new Date ( ) ) ; Uri takenPhotoUri ; ImageView imageView = null ; Bitmap imageBitmap = null ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override public void onSaveInstanceState ( Bundle savedInstanceState ) { } public Uri getPhotoFileUri ( String fileName ) { } private boolean isExternalStorageAvailable ( ) { } private void rotate ( ) { } private int checkToCompress ( Bitmap photo ) { System . out . println ( ( "photo<seq2seq4repair_space>to<seq2seq4repair_space>compress<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( getAllocationByteCount ( photo ) ) ) ) ; if ( ( getAllocationByteCount ( photo ) ) > ( Upload . mb5 ) ) return 40 ; else if ( ( getAllocationByteCount ( photo ) ) > ( Upload . mb1 ) ) return 60 ; else <START_BUG> return 0 ; <END_BUG> } }

Fix:
return 100 ;
Buggy code:
public class StompProtocolHandler implements SubProtocolHandler { public static final String CONNECTED_USER_HEADER = "user-name" ; public static final String QUEUE_SUFFIX_HEADER = "queue-suffix" ; private final Log logger = LogFactory . getLog ( StompProtocolHandler . class ) ; private final StompMessageConverter stompMessageConverter = new StompMessageConverter ( ) ; private MutableUserQueueSuffixResolver queueSuffixResolver = new SimpleUserQueueSuffixResolver ( ) ; public void setUserQueueSuffixResolver ( MutableUserQueueSuffixResolver resolver ) { } public MutableUserQueueSuffixResolver getUserQueueSuffixResolver ( ) { } @ Override public List < String > getSupportedProtocols ( ) { } public void handleMessageFromClient ( WebSocketSession session , WebSocketMessage webSocketMessage , MessageChannel outputChannel ) { try { Assert . isInstanceOf ( TextMessage . class , webSocketMessage ) ; String payload = ( ( TextMessage ) ( webSocketMessage ) ) . getPayload ( ) ; Message < ? > message = this . stompMessageConverter . toMessage ( payload ) ; if ( logger . isTraceEnabled ( ) ) { <START_BUG> logger . trace ( ( "Processing<seq2seq4repair_space>STOMP<seq2seq4repair_space>message:<seq2seq4repair_space>" + message ) ) ; <END_BUG> } try { StompHeaderAccessor headers = StompHeaderAccessor . wrap ( message ) ; headers . setSessionId ( session . getId ( ) ) ; headers . setUser ( session . getPrincipal ( ) ) ; message = MessageBuilder . withPayloadAndHeaders ( message . getPayload ( ) , headers ) . build ( ) ; if ( CONNECT . equals ( headers . getMessageType ( ) ) ) { handleConnect ( session , message ) ; } outputChannel . send ( message ) ; } catch ( Throwable t ) { logger . error ( "Terminating<seq2seq4repair_space>STOMP<seq2seq4repair_space>session<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>failure<seq2seq4repair_space>to<seq2seq4repair_space>send<seq2seq4repair_space>message:<seq2seq4repair_space>" , t ) ; sendErrorMessage ( session , t ) ; } } catch ( Throwable error ) { sendErrorMessage ( session , error ) ; } } @ Override public void handleMessageToClient ( WebSocketSession session , Message < ? > message ) { } protected void handleConnect ( WebSocketSession session , Message < ? > message ) throws IOException { } protected void sendErrorMessage ( WebSocketSession session , Throwable error ) { } @ Override public String resolveSessionId ( Message < ? > message ) { } @ Override public void afterSessionStarted ( WebSocketSession session , MessageChannel outputChannel ) { } @ Override public void afterSessionEnded ( WebSocketSession session , CloseStatus closeStatus , MessageChannel outputChannel ) { } }

Fix:
logger . trace ( ( "Message<seq2seq4repair_space>" + message ) ) ;
Buggy code:
@ Controller public class GreetingController { @ Autowired protected CountService countService ; @ RequestMapping ( "//greeting" ) public String greeting ( Model model ) { CountPojo countPojo = countService . getCountViaApiCall ( ) ; model . addAttribute ( "apiCallCount" , countPojo . getCount ( ) ) ; <START_BUG> return "countPojo" ; <END_BUG> } }

Fix:
return "greeting" ;
Buggy code:
public class FriendProfileActivity extends ActionBarActivity { private User user ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_friend_profile ) ; Bundle bundle = getIntent ( ) . getExtras ( ) ; <START_BUG> user = ( ( User ) ( getIntent ( ) . getSerializableExtra ( "user" ) ) ) ; <END_BUG> TextView usernameText = ( ( TextView ) ( findViewById ( username ) ) ) ; TextView emailText = ( ( TextView ) ( findViewById ( email ) ) ) ; TextView ratingText = ( ( TextView ) ( findViewById ( rating ) ) ) ; TextView salesReportsNumText = ( ( TextView ) ( findViewById ( sales_reports_num ) ) ) ; setTitle ( user . getUsername ( ) ) ; usernameText . append ( ( ":<seq2seq4repair_space>" + ( user . getUsername ( ) ) ) ) ; emailText . append ( ( ":<seq2seq4repair_space>" + ( user . getEmail ( ) ) ) ) ; ratingText . append ( ":<seq2seq4repair_space>0" ) ; salesReportsNumText . append ( ":<seq2seq4repair_space>0" ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
user = ( ( User ) ( getIntent ( ) . getParcelableExtra ( "user" ) ) ) ;
Buggy code:
public class CmdChat extends FCommand { public CmdChat ( ) { } @ Override public void perform ( ) { if ( ! ( Conf . factionOnlyChat ) ) { msg ( COMMAND_CHAT_DISABLED . toString ( ) ) ; return ; } String modeString = this . argAsString ( 0 ) ; ChatMode modeTarget = fme . getChatMode ( ) . getNext ( ) ; if ( modeString != null ) { <START_BUG> modeString . toLowerCase ( ) ; <END_BUG> if ( modeString . startsWith ( "p" ) ) { modeTarget = ChatMode . PUBLIC ; } else if ( modeString . startsWith ( "a" ) ) { modeTarget = ChatMode . ALLIANCE ; } else if ( modeString . startsWith ( "f" ) ) { modeTarget = ChatMode . FACTION ; } else { msg ( COMMAND_CHAT_INVALIDMODE ) ; return ; } } fme . setChatMode ( modeTarget ) ; if ( ( fme . getChatMode ( ) ) == ( ChatMode . PUBLIC ) ) { msg ( COMMAND_CHAT_MODE_PUBLIC ) ; } else if ( ( fme . getChatMode ( ) ) == ( ChatMode . ALLIANCE ) ) { msg ( COMMAND_CHAT_MODE_ALLIANCE ) ; } else { msg ( COMMAND_CHAT_MODE_FACTION ) ; } } }

Fix:
modeString = modeString . toLowerCase ( ) ;
Buggy code:
public class Location { public int inputOffset ; public int inputColumn ; public int outputLine ; public int outputColumn ; public int outputIndentationLevel ; public boolean needSpace ; public boolean pendingSpace ; public int nlsTagCounter ; public int lastLocalDeclarationSourceStart ; public int numberOfIndentations ; public int lastNumberOfNewLines ; int editsIndex ; OptimizedReplaceEdit textEdit ; public Location ( Scribe scribe , int sourceRestart ) { } public void update ( Scribe scribe , int sourceRestart ) { this . outputColumn = scribe . column ; this . outputLine = scribe . line ; this . inputOffset = sourceRestart ; <START_BUG> this . inputColumn = scribe . getCurrentIndentation ( sourceRestart ) ; <END_BUG> this . outputIndentationLevel = scribe . indentationLevel ; this . lastNumberOfNewLines = scribe . lastNumberOfNewLines ; this . needSpace = scribe . needSpace ; this . pendingSpace = scribe . pendingSpace ; this . editsIndex = scribe . editsIndex ; this . nlsTagCounter = scribe . nlsTagCounter ; this . numberOfIndentations = scribe . numberOfIndentations ; this . textEdit = scribe . getLastEdit ( ) ; } public String toString ( ) { } }

Fix:
this . inputColumn = scribe . getCurrentColumn ( sourceRestart ) ;
Buggy code:
public class DeploymentRootMountProcessor implements DeploymentUnitProcessor { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ( deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ) != null ) { return ; } final ServerDeploymentRepository serverDeploymentRepository = deploymentUnit . getAttachment ( SERVER_DEPLOYMENT_REPOSITORY ) ; if ( serverDeploymentRepository == null ) { throw new DeploymentUnitProcessingException ( "No<seq2seq4repair_space>deployment<seq2seq4repair_space>repository<seq2seq4repair_space>available." ) ; } final String deploymentName = deploymentUnit . getName ( ) ; final String deploymentRuntimeName = deploymentUnit . getAttachment ( RUNTIME_NAME ) ; final byte [ ] deploymentHash = deploymentUnit . getAttachment ( DEPLOYMENT_HASH ) ; final VirtualFile deploymentRoot = VFS . getChild ( ( "content//" + deploymentRuntimeName ) ) ; boolean failed = false ; Closeable handle = null ; final MountHandle mountHandle ; try { handle = serverDeploymentRepository . mountDeploymentContent ( deploymentName , deploymentRuntimeName , deploymentHash , deploymentRoot ) ; mountHandle = new MountHandle ( handle ) ; } catch ( IOException e ) { failed = true ; throw new DeploymentUnitProcessingException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>mount<seq2seq4repair_space>deployment<seq2seq4repair_space>content" , e ) ; } finally { if ( failed ) { VFSUtils . safeClose ( handle ) ; } } <START_BUG> final ResourceRoot resourceRoot = new ResourceRoot ( deploymentRoot , mountHandle , false ) ; <END_BUG> ModuleRootMarker . markRoot ( resourceRoot ) ; deploymentUnit . putAttachment ( DEPLOYMENT_ROOT , resourceRoot ) ; } public void undeploy ( DeploymentUnit context ) { } }

Fix:
final ResourceRoot resourceRoot = new ResourceRoot ( deploymentRoot , mountHandle ) ;
Buggy code:
public class CustomProperties extends Properties { private static final long serialVersionUID = 1L ; public void store ( OutputStream out ) throws IOException { <START_BUG> store0 ( new BufferedWriter ( new OutputStreamWriter ( out , "8859_1" ) ) ) ; <END_BUG> } private void store0 ( BufferedWriter bw ) throws IOException { } }

Fix:
store0 ( new BufferedWriter ( new OutputStreamWriter ( out , "UTF8" ) ) ) ;
Buggy code:
public abstract class ClusteringModelBuilder < M extends ClusteringModel < M , P , O > , P extends ClusteringParameters , O extends ClusteringOutput > extends ModelBuilder < M , P , O > { public boolean isSupervised ( ) { } public ClusteringModelBuilder ( String desc , P parms ) { } public ClusteringModelBuilder ( Key dest , String desc , P parms ) { } @ Override public void init ( boolean expensive ) { super . init ( expensive ) ; <START_BUG> if ( ( ( _parms . _k ) < 1 ) || ( ( _parms . _k ) > 10000000 ) ) <END_BUG> ClusteringModelBuilder . error ( "_k" , "k<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>between<seq2seq4repair_space>1<seq2seq4repair_space>and<seq2seq4repair_space>1e7" ) ; if ( ( ( _train ) != null ) && ( ( _train . numRows ( ) ) < ( _parms . _k ) ) ) error ( "_k" , ( ( ( ( "Cannot<seq2seq4repair_space>make<seq2seq4repair_space>" + ( _parms . _k ) ) + "<seq2seq4repair_space>clusters<seq2seq4repair_space>out<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( _train . numRows ( ) ) ) + "<seq2seq4repair_space>rows" ) ) ; } }

Fix:
if ( ( ( _parms . _k ) < 1 ) || ( ( _parms . _k ) > 1.0E7 ) )
Buggy code:
public class JmsListenerEndpointRegistrar implements BeanFactoryAware , InitializingBean { private JmsListenerEndpointRegistry endpointRegistry ; private MessageHandlerMethodFactory messageHandlerMethodFactory ; private JmsListenerContainerFactory < ? > containerFactory ; private String containerFactoryBeanName ; private BeanFactory beanFactory ; private final List < JmsListenerEndpointRegistrar . JmsListenerEndpointDescriptor > endpointDescriptors = new ArrayList < JmsListenerEndpointRegistrar . JmsListenerEndpointDescriptor > ( ) ; public void setEndpointRegistry ( JmsListenerEndpointRegistry endpointRegistry ) { } public JmsListenerEndpointRegistry getEndpointRegistry ( ) { } public void setMessageHandlerMethodFactory ( MessageHandlerMethodFactory messageHandlerMethodFactory ) { } public MessageHandlerMethodFactory getMessageHandlerMethodFactory ( ) { } public void setContainerFactory ( JmsListenerContainerFactory < ? > containerFactory ) { } public void setContainerFactoryBeanName ( String containerFactoryBeanName ) { } @ Override public void setBeanFactory ( BeanFactory beanFactory ) { } @ Override public void afterPropertiesSet ( ) { } protected void registerAllEndpoints ( ) { } private JmsListenerContainerFactory < ? > resolveContainerFactory ( JmsListenerEndpointRegistrar . JmsListenerEndpointDescriptor descriptor ) { } public void registerEndpoint ( JmsListenerEndpoint endpoint , JmsListenerContainerFactory < ? > factory ) { Assert . notNull ( endpoint , "Endpoint<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set" ) ; <START_BUG> Assert . notNull ( endpoint . getId ( ) , "Endpoint<seq2seq4repair_space>id<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set" ) ; <END_BUG> this . endpointDescriptors . add ( new JmsListenerEndpointRegistrar . JmsListenerEndpointDescriptor ( endpoint , factory ) ) ; } public void registerEndpoint ( JmsListenerEndpoint endpoint ) { } private static class JmsListenerEndpointDescriptor { public final JmsListenerEndpoint endpoint ; public final JmsListenerContainerFactory < ? > containerFactory ; public JmsListenerEndpointDescriptor ( JmsListenerEndpoint endpoint , JmsListenerContainerFactory < ? > containerFactory ) { } } }

Fix:
Assert . hasText ( endpoint . getId ( ) , "Endpoint<seq2seq4repair_space>id<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set" ) ;
Buggy code:
public class DefaultFailureHandler implements IMassageFailureHandler { public static final Logger LOG = LoggerFactory . getLogger ( DefaultFailureHandler . class ) ; SortedSet < Long > failed ; long numberFailed ; long maxOffsetBehind ; PartitionManager _pm ; public DefaultFailureHandler ( PartitionManager pm ) { } @ Override public long getOffset ( Long expectedOffset ) { <START_BUG> return ! ( failed . isEmpty ( ) ) ? failed . first ( ) : - 1 ; <END_BUG> } @ Override public boolean isOffsetFailed ( long offset ) { } @ Override public void startMessageProcessing ( MessageAndOffset enrichedMessage ) { } @ Override public void fail ( Long offset ) throws RuntimeException { } public void ack ( Long offset ) { } }

Fix:
return ! ( failed . isEmpty ( ) ) ? failed . first ( ) : expectedOffset ;
Buggy code:
public class ServiceInfoComparator implements Comparator { private boolean compareServiceProperties ( IServiceProperties p1 , IServiceProperties p2 ) { <START_BUG> if ( ( p1 . asProperties ( ) . size ( ) ) != ( p2 . asProperties ( ) . size ( ) ) ) <END_BUG> return false ; for ( final Enumeration e = p1 . getPropertyNames ( ) ; e . hasMoreElements ( ) ; ) { final String key = ( ( String ) ( e . nextElement ( ) ) ) ; final Object o1 = p1 . getProperty ( key ) ; final Object o2 = p2 . getProperty ( key ) ; if ( ( o1 instanceof byte [ ] ) && ( o2 instanceof byte [ ] ) ) { final byte [ ] b1 = ( ( byte [ ] ) ( o1 ) ) ; final byte [ ] b2 = ( ( byte [ ] ) ( o2 ) ) ; for ( int i = 0 ; i < ( b1 . length ) ; i ++ ) if ( ( b1 [ i ] ) != ( b2 [ i ] ) ) return false ; } else if ( ! ( o1 . equals ( o2 ) ) ) return false ; } return true ; } public int compare ( Object arg0 , Object arg1 ) { } }

Fix:
if ( ( p1 . size ( ) ) != ( p2 . size ( ) ) )
Buggy code:
public interface IConnectionEventHandler { public boolean handleSuspectEvent ( ConnectionEvent event ) { } <START_BUG> public void handleDisconnectEvent ( ConnectionEvent event ) ; <END_BUG> public Object getAdapter ( Class clazz ) { } }

Fix:
public void handleDisconnectEvent ( DisconnectConnectionEvent event ) ;
Buggy code:
public class EditPropertiesAction extends FrameAction { public EditPropertiesAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> AddressbookFrameController addressbookFrameController = ( ( AddressbookFrameController ) ( frameController ) ) ; <END_BUG> Object uid = addressbookFrameController . getTable ( ) . getView ( ) . getSelectedUid ( ) ; if ( uid == null ) return ; HeaderItem item = addressbookFrameController . getTable ( ) . getView ( ) . getSelectedItem ( ) ; AddressbookFolder folder = ( ( AddressbookFolder ) ( addressbookFrameController . getTree ( ) . getView ( ) . getSelectedFolder ( ) ) ) ; if ( item . isContact ( ) ) { ContactCard card = ( ( ContactCard ) ( folder . get ( uid ) ) ) ; System . out . println ( ( "card:" + card ) ) ; ContactDialog dialog = new ContactDialog ( addressbookFrameController . getView ( ) ) ; dialog . updateComponents ( card , true ) ; dialog . setVisible ( true ) ; if ( dialog . getResult ( ) ) { System . out . println ( "saving<seq2seq4repair_space>contact" ) ; dialog . updateComponents ( card , false ) ; folder . modify ( card , uid ) ; addressbookFrameController . getTable ( ) . getView ( ) . setFolder ( folder ) ; } } else { GroupListCard card = ( ( GroupListCard ) ( folder . get ( uid ) ) ) ; EditGroupDialog dialog = new EditGroupDialog ( addressbookFrameController . getView ( ) , addressbookFrameController , null ) ; dialog . setHeaderList ( folder . getHeaderItemList ( ) ) ; Object [ ] uids = card . getUids ( ) ; HeaderItemList members = folder . getHeaderItemList ( uids ) ; dialog . updateComponents ( card , members , true ) ; dialog . setVisible ( true ) ; if ( dialog . getResult ( ) ) { dialog . updateComponents ( card , null , false ) ; folder . modify ( card , uid ) ; addressbookFrameController . getTable ( ) . getView ( ) . setFolder ( folder ) ; } } } }

Fix:
AddressbookFrameController addressbookFrameController = ( ( AddressbookFrameController ) ( frameMediator ) ) ;
Buggy code:
public class MarkupCacheTest extends TestCase { private MarkupCache cache ; private MarkupCacheTest . MarkupCachingAssumingComponent component ; @ Override public void setUp ( ) { WebApplication application = new WicketTester . DummyWebApplication ( ) { @ Override public String getConfigurationType ( ) { return Application . DEPLOYMENT ; } } ; WicketTester tester = new WicketTester ( application ) ; <START_BUG> cache = new MarkupCache ( application ) ; <END_BUG> component = new MarkupCacheTest . MarkupCachingAssumingComponent ( "panel" ) ; tester . startComponent ( component ) ; } public void testMarkupNotFoundInformationIsCachedInDeploymentMode ( ) { } private class MarkupCachingAssumingComponent extends Panel implements IMarkupResourceStreamProvider { private static final long serialVersionUID = - 6743937191677599322L ; private boolean firstCall = true ; public MarkupCachingAssumingComponent ( final String id ) { } public IResourceStream getMarkupResourceStream ( MarkupContainer container , Class < ? > containerClass ) { } @ Override public MarkupType getMarkupType ( ) { } } }

Fix:
cache = new MarkupCache ( ) ;
Buggy code:
public class RootLayoutContainer extends PartSashContainer { public RootLayoutContainer ( WorkbenchPage page ) { } protected void childAdded ( LayoutPart child ) { } public RootLayoutContainer getRootContainer ( ) { } protected void childRemoved ( LayoutPart child ) { } protected Composite createParent ( Composite parentWidget ) { } protected void disposeParent ( ) { } public Control getControl ( ) { } public IStatus restoreState ( IMemento memento ) { MultiStatus result = new MultiStatus ( PlatformUI . PLUGIN_ID , IStatus . OK , WorkbenchMessages . getString ( "RootLayoutContainer.problemsRestoringPerspective" ) , null ) ; IMemento [ ] children = memento . getChildren ( TAG_INFO ) ; Map mapIDtoPart = new HashMap ( children . length ) ; for ( int i = 0 ; i < ( children . length ) ; i ++ ) { IMemento childMem = children [ i ] ; String partID = childMem . getString ( TAG_PART ) ; String relativeID = childMem . getString ( TAG_RELATIVE ) ; int relationship = 0 ; float ratio = 0.0F ; if ( relativeID != null ) { relationship = childMem . getInteger ( TAG_RELATIONSHIP ) . intValue ( ) ; ratio = childMem . getFloat ( TAG_RATIO ) . floatValue ( ) ; } String strFolder = childMem . getString ( TAG_FOLDER ) ; LayoutPart part = null ; if ( strFolder == null ) part = new PartPlaceholder ( partID ) ; else { <START_BUG> PartTabFolder folder = new PartTabFolder ( ) ; <END_BUG> folder . setID ( partID ) ; result . add ( folder . restoreState ( childMem . getChild ( TAG_FOLDER ) ) ) ; ContainerPlaceholder placeholder = new ContainerPlaceholder ( partID ) ; placeholder . setRealContainer ( folder ) ; part = placeholder ; } part . setContainer ( this ) ; if ( relativeID == null ) { add ( part ) ; } else { LayoutPart refPart = ( ( LayoutPart ) ( mapIDtoPart . get ( relativeID ) ) ) ; if ( refPart != null ) { add ( part , relationship , ratio , refPart ) ; } else { WorkbenchPlugin . log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>part<seq2seq4repair_space>for<seq2seq4repair_space>ID:<seq2seq4repair_space>" + relativeID ) ) ; } } mapIDtoPart . put ( partID , part ) ; } return result ; } public IStatus saveState ( IMemento memento ) { } }

Fix:
PartTabFolder folder = new PartTabFolder ( page ) ;
Buggy code:
public class Menu extends Widget { public int handle ; int x ; int y ; int hwndCB ; int id0 ; int id1 ; boolean hasLocation ; MenuItem cascade ; Decorations parent ; ImageList imageList ; static final int ID_PPC = 100 ; static final int ID_SPMM = 102 ; static final int ID_SPBM = 103 ; static final int ID_SPMB = 104 ; static final int ID_SPBB = 105 ; static final int ID_SPSOFTKEY0 = 106 ; static final int ID_SPSOFTKEY1 = 107 ; public Menu ( Control parent ) { } public Menu ( Decorations parent , int style ) { } public Menu ( Menu parentMenu ) { } public Menu ( MenuItem parentItem ) { } Menu ( Decorations parent , int style , int handle ) { } void _setVisible ( boolean visible ) { } public void addHelpListener ( HelpListener listener ) { } public void addMenuListener ( MenuListener listener ) { } static Control checkNull ( Control control ) { } static Menu checkNull ( Menu menu ) { } static MenuItem checkNull ( MenuItem item ) { } static int checkStyle ( int style ) { } void createHandle ( ) { } void createItem ( MenuItem item , int index ) { } void createWidget ( ) { } int defaultBackground ( ) { } int defaultForeground ( ) { } void destroyAccelerators ( ) { } void destroyItem ( MenuItem item ) { } void destroyWidget ( ) { } void fixMenus ( Decorations newParent ) { } Rectangle getBounds ( ) { } public MenuItem getDefaultItem ( ) { } public boolean getEnabled ( ) { } public MenuItem getItem ( int index ) { } public int getItemCount ( ) { } public MenuItem [ ] getItems ( ) { } int GetMenuItemCount ( int handle ) { } String getNameText ( ) { } public Decorations getParent ( ) { } public MenuItem getParentItem ( ) { } public Menu getParentMenu ( ) { } public Shell getShell ( ) { } public boolean getVisible ( ) { } int imageIndex ( Image image ) { } public int indexOf ( MenuItem item ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } void redraw ( ) { } void releaseChild ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { MenuItem [ ] items = getItems ( ) ; for ( int i = 0 ; i < ( items . length ) ; i ++ ) { MenuItem item = items [ i ] ; <START_BUG> if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { <END_BUG> if ( ( OS . IsPPC ) && ( ( hwndCB ) != 0 ) ) { item . dispose ( ) ; } else { item . releaseResources ( ) ; } } } if ( ( OS . IsPPC ) && ( ( hwndCB ) != 0 ) ) { if ( ( imageList ) != null ) { OS . SendMessage ( hwndCB , TB_SETIMAGELIST , 0 , 0 ) ; display . releaseToolImageList ( imageList ) ; imageList = null ; } } super . releaseWidget ( ) ; if ( ( parent ) != null ) parent . removeMenu ( this ) ; parent = null ; cascade = null ; } public void removeHelpListener ( HelpListener listener ) { } public void removeMenuListener ( MenuListener listener ) { } public void setDefaultItem ( MenuItem item ) { } public void setEnabled ( boolean enabled ) { } public void setLocation ( int x , int y ) { } public void setLocation ( Point location ) { } public void setVisible ( boolean visible ) { } void update ( ) { } }

Fix:
if ( ! ( item . isDisposed ( ) ) ) {
Buggy code:
public final class JVMEnvironmentVariableAddHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "add-item-to-environment-variables-list" ; static final JVMEnvironmentVariableAddHandler INSTANCE = new JVMEnvironmentVariableAddHandler ( ) ; private final ParameterValidator validator = new StringLengthValidator ( 1 ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validateParameter ( NAME , operation . get ( NAME ) ) ; validator . validateParameter ( VALUE , operation . get ( VALUE ) ) ; final Resource resource = context . readResourceForUpdate ( EMPTY_ADDRESS ) ; final ModelNode model = resource . getModel ( ) ; final String name = operation . require ( NAME ) . asString ( ) ; final String value = operation . require ( VALUE ) . asString ( ) ; ModelNode variables = model . get ( JVM_ENV_VARIABLES ) ; if ( variables . isDefined ( ) ) { for ( ModelNode varNode : variables . asList ( ) ) { if ( varNode . asProperty ( ) . getName ( ) . equals ( name ) ) { throw HostControllerMessages . MESSAGES . envVariableAlreadyExists ( varNode . asProperty ( ) . getName ( ) ) ; } } } model . get ( JVM_ENV_VARIABLES ) . add ( name , value ) ; <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class ManagementPingHeader extends ManagementProtocolHeader { protected ManagementPingHeader ( int version ) { } @ Override public byte getType ( ) { <START_BUG> return ManagementProtocol . TYPE_PONG ; <END_BUG> } }

Fix:
return ManagementProtocol . TYPE_PING ;
Buggy code:
public class TestSerialization extends SingleEMFTestCase { public void setUp ( ) { <START_BUG> setUp ( Person . class , Employee . class , "openjpa.DetachState" , "fgs(DetachedStateField=true)" ) ; <END_BUG> } public void testDetachedUpdate ( ) { } private Object serializeObject ( Object orig ) { } }

Fix:
setUp ( Person . class , Employee . class , DROP_TABLES , "openjpa.DetachState" , "fgs(DetachedStateField=true)" ) ;
Buggy code:
public class AccountWizardLauncher { public AccountWizardLauncher ( ) { } public void launchWizard ( boolean firstStart ) { DataModel data = new DataModel ( ) ; Step [ ] steps ; if ( firstStart ) { steps = new Step [ ] { new WelcomeStep ( ) , new IdentityStep ( data ) , new IncomingServerStep ( data ) , new OutgoingServerStep ( data , false ) , new FinishStep ( ) } ; } else { steps = new Step [ ] { new IdentityStep ( data ) , new IncomingServerStep ( data ) , new OutgoingServerStep ( data , true ) } ; } WizardModel model = new net . javaprog . ui . wizard . DefaultWizardModel ( steps ) ; model . addWizardModelListener ( new AccountCreator ( data ) ) ; Wizard wizard = new Wizard ( model , MailResourceLoader . getString ( "dialog" , "accountwizard" , "title" ) , ImageLoader . getSmallImageIcon ( "stock_preferences.png" ) ) ; CSH . setHelpIDString ( wizard , "getting_started_1" ) ; <START_BUG> JavaHelpSupport . enableHelp ( wizard , HelpManager . getHelpBroker ( ) ) ; <END_BUG> wizard . pack ( ) ; wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } }

Fix:
JavaHelpSupport . enableHelp ( wizard , HelpManager . getHelpManager ( ) . getHelpBroker ( ) ) ;
Buggy code:
public class MySpecialDouble extends MyDouble { protected String strToString ; private boolean keepOriginalString ; private boolean isLetterConstant ; private boolean scientificNotation = false ; private static MySpecialDouble eulerConstant ; public MySpecialDouble ( Kernel kernel , double val , String strToString ) { } public MySpecialDouble ( MySpecialDouble sd ) { } @ Override public ExpressionValue deepCopy ( Kernel kernel ) { } public void setKeepOriginalString ( ) { } public static MySpecialDouble getEulerConstant ( Kernel kernel ) { } public boolean isEulerConstant ( ) { } @ Override public String toString ( StringTemplate tpl ) { if ( ! ( isLetterConstant ) ) { if ( keepOriginalString ) { if ( scientificNotation ) { return kernel . convertScientificNotation ( strToString ) ; } return strToString ; } <START_BUG> return super . toString ( ) ; <END_BUG> } StringType printForm = tpl . getStringType ( ) ; switch ( printForm ) { case MATH_PIPER : char ch = strToString . charAt ( 0 ) ; switch ( ch ) { case Unicode . piChar : return "Pi" ; case Unicode . degreeChar : return "Pi//180" ; } break ; case MAXIMA : ch = strToString . charAt ( 0 ) ; switch ( ch ) { case Unicode . piChar : return "%pi" ; case Unicode . degreeChar : return "%pi//180" ; case Unicode . eulerChar : return "%e" ; } break ; case MPREDUCE : ch = strToString . charAt ( 0 ) ; switch ( ch ) { case Unicode . piChar : return "pi" ; case Unicode . degreeChar : return "pi//180" ; case Unicode . eulerChar : return "e" ; } break ; case LATEX : ch = strToString . charAt ( 0 ) ; switch ( ch ) { case Unicode . piChar : return "\\pi" ; case Unicode . degreeChar : return "^{\\circ}" ; case Unicode . eulerChar : return Unicode . EULER_STRING ; } break ; } return strToString ; } }

Fix:
return super . toString ( tpl ) ;
Buggy code:
public class ApplicationContextProcessor implements DeploymentUnitProcessor { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ( deploymentUnit . getParent ( ) ) != null ) { return ; } EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; final ServiceName applicationContextServiceName = ContextNames . contextServiceNameOfApplication ( moduleDescription . getApplicationName ( ) ) ; <START_BUG> final NamingStoreService contextService = new NamingStoreService ( ) ; <END_BUG> serviceTarget . addService ( applicationContextServiceName , contextService ) . install ( ) ; final BinderService applicationNameBinder = new BinderService ( "AppName" ) ; final ServiceName appNameServiceName = applicationContextServiceName . append ( "AppName" ) ; serviceTarget . addService ( appNameServiceName , applicationNameBinder ) . addDependency ( applicationContextServiceName , ServiceBasedNamingStore . class , applicationNameBinder . getNamingStoreInjector ( ) ) . addInjection ( applicationNameBinder . getManagedObjectInjector ( ) , new org . jboss . as . naming . ValueManagedReferenceFactory ( Values . immediateValue ( moduleDescription . getApplicationName ( ) ) ) ) . install ( ) ; deploymentUnit . addToAttachmentList ( JNDI_DEPENDENCIES , appNameServiceName ) ; deploymentUnit . putAttachment ( APPLICATION_CONTEXT_CONFIG , applicationContextServiceName ) ; } public void undeploy ( DeploymentUnit context ) { } }

Fix:
final NamingStoreService contextService = new NamingStoreService ( new ServiceBasedNamingStore ( phaseContext . getServiceRegistry ( ) , applicationContextServiceName ) ) ;
Buggy code:
@ Component ( "chartAction" ) @ Scope ( "prototype" ) public class ChartAction extends ActionSupport { private static final long serialVersionUID = - 2860355939047563512L ; @ Autowired private IterationBurndownBusiness iterationBurndownBusiness ; @ Autowired private ProjectBurnupBusiness projectBurnupBusiness ; @ Autowired private IterationBusiness iterationBusiness ; @ Autowired private ProjectBusiness projectBusiness ; private int backlogId ; private byte [ ] result ; private Integer customBdWidth = 1024 ; private Integer customBdHeight = 768 ; private Integer timeZoneOffset = 0 ; public void setIterationBurndownBusiness ( IterationBurndownBusiness iterationBurndownBusiness ) { } public void setIterationBusiness ( IterationBusiness iterationBusiness ) { } public void setProjectBurnupBusiness ( ProjectBurnupBusiness projectBurnupBusiness ) { } public void setCustomBdWidth ( Integer largeBdWidth ) { } public void setCustomBdHeight ( Integer largeBdHeight ) { } public String getIterationBurndown ( ) { } public String getProjectBurnup ( ) { } public String getSmallProjectBurnup ( ) { } public String getSmallIterationBurndown ( ) { Iteration iteration = iterationBusiness . retrieve ( backlogId ) ; <START_BUG> result = iterationBurndownBusiness . getSmallIterationBurndown ( iteration ) ; <END_BUG> return Action . SUCCESS ; } public String getCustomIterationBurndown ( ) { } public InputStream getInputStream ( ) { } public void setBacklogId ( int backlogId ) { } public void setTimeZoneOffset ( Integer timeZoneOffset ) { } public byte [ ] getResult ( ) { } }

Fix:
result = iterationBurndownBusiness . getSmallIterationBurndown ( iteration , timeZoneOffset ) ;
Buggy code:
public class CopyResourcesStep implements Step { private static final Pattern GENERATED_FILE_PATTERN = Pattern . compile ( ( ( "^(?:" + ( Joiner . on ( '|' ) . join ( ANNOTATION_DIR , SCRATCH_DIR , GEN_DIR ) ) ) + ")//(.*)" ) ) ; private final SourcePathResolver resolver ; private final BuildTarget target ; private final Collection < ? extends SourcePath > resources ; private final Path outputDirectory ; private final JavaPackageFinder javaPackageFinder ; public CopyResourcesStep ( SourcePathResolver resolver , BuildTarget target , Collection < ? extends SourcePath > resources , Path outputDirectory , JavaPackageFinder javaPackageFinder ) { } @ Override public int execute ( ExecutionContext context ) throws IOException , InterruptedException { } @ VisibleForTesting ImmutableList < Step > buildSteps ( ) { ImmutableList . Builder < Step > allSteps = ImmutableList . builder ( ) ; if ( resources . isEmpty ( ) ) { return allSteps . build ( ) ; } String targetPackageDir = javaPackageFinder . findJavaPackage ( target ) ; for ( SourcePath rawResource : resources ) { final Path pathToResource = resolver . getPath ( rawResource ) ; String resource = MorePaths . pathWithUnixSeparators ( pathToResource ) ; Matcher matcher ; if ( ( matcher = CopyResourcesStep . GENERATED_FILE_PATTERN . matcher ( resource ) ) . matches ( ) ) { resource = matcher . group ( 1 ) ; } Path javaPackageAsPath = javaPackageFinder . findJavaPackageFolder ( Paths . get ( resource ) ) ; Path relativeSymlinkPath ; if ( "" . equals ( javaPackageAsPath . toString ( ) ) ) { relativeSymlinkPath = pathToResource . getFileName ( ) ; } else { <START_BUG> int lastIndex = resource . lastIndexOf ( javaPackageAsPath . toString ( ) ) ; <END_BUG> if ( lastIndex < 0 ) { Preconditions . checkState ( ( rawResource instanceof BuildTargetSourcePath ) , "If<seq2seq4repair_space>resource<seq2seq4repair_space>path<seq2seq4repair_space>%s<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>contain<seq2seq4repair_space>%s,<seq2seq4repair_space>then<seq2seq4repair_space>it<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>BuildTargetSourcePath." , pathToResource , javaPackageAsPath ) ; relativeSymlinkPath = Paths . get ( String . format ( "%s%s%s" , targetPackageDir , ( targetPackageDir . isEmpty ( ) ? "" : "//" ) , resolver . getPath ( rawResource ) . getFileName ( ) ) ) ; } else { relativeSymlinkPath = Paths . get ( resource . substring ( lastIndex ) ) ; } } Path target = outputDirectory . resolve ( relativeSymlinkPath ) ; MkdirAndSymlinkFileStep link = new MkdirAndSymlinkFileStep ( pathToResource , target ) ; allSteps . add ( link ) ; } return allSteps . build ( ) ; } @ Override public String getShortName ( ) { } @ Override public String getDescription ( ExecutionContext context ) { } }

Fix:
int lastIndex = resource . lastIndexOf ( MorePaths . pathWithUnixSeparators ( javaPackageAsPath ) ) ;
Buggy code:
public class RemoveCardAction extends DefaultTableAction implements TreeSelectionListener { public RemoveCardAction ( IFrameMediator frameController ) { } public void actionPerformed ( ActionEvent evt ) { AddressbookFrameMediator mediator = ( ( AddressbookFrameMediator ) ( frameMediator ) ) ; FocusOwner focusOwner = FocusManager . getInstance ( ) . getCurrentOwner ( ) ; TableController table = ( ( AddressbookFrameMediator ) ( frameMediator ) ) . getTable ( ) ; boolean tableHasFocus = false ; if ( table . equals ( focusOwner ) ) tableHasFocus = true ; if ( tableHasFocus ) { <START_BUG> Object [ ] uids = mediator . getTable ( ) . getUids ( ) ; <END_BUG> AbstractFolder folder = ( ( AbstractFolder ) ( mediator . getTree ( ) . getSelectedFolder ( ) ) ) ; for ( int i = 0 ; i < ( uids . length ) ; i ++ ) { try { folder . remove ( uids [ i ] ) ; } catch ( Exception e ) { if ( Logging . DEBUG ) e . printStackTrace ( ) ; ErrorDialog . createDialog ( e . getMessage ( ) , e ) ; } } if ( folder instanceof IGroupFolder ) mediator . getTree ( ) . setSelectedFolder ( folder ) ; } else { AbstractFolder folder = ( ( AbstractFolder ) ( mediator . getTree ( ) . getSelectedFolder ( ) ) ) ; AddressbookTreeNode parent = ( ( AddressbookTreeNode ) ( folder . getParent ( ) ) ) ; mediator . getTree ( ) . setSelectedFolder ( ( ( AbstractFolder ) ( parent ) ) ) ; folder . removeFromParent ( ) ; AddressbookTreeModel . getInstance ( ) . nodeStructureChanged ( parent ) ; } } public void valueChanged ( ListSelectionEvent event ) { } public void valueChanged ( TreeSelectionEvent e ) { } }

Fix:
String [ ] uids = mediator . getTable ( ) . getUids ( ) ;
Buggy code:
public class TypeDeclarationLocator extends PatternLocator { protected TypeDeclarationPattern pattern ; public TypeDeclarationLocator ( TypeDeclarationPattern pattern ) { } public void match ( TypeDeclaration node , MatchingNodeSet nodeSet ) { if ( ( ( this . pattern . simpleName ) == null ) || ( matchesName ( this . pattern . simpleName , node . name ) ) ) <START_BUG> nodeSet . addMatch ( node , ( this . pattern . mustResolve ? POTENTIAL_MATCH : PatternLocator . ACCURATE_MATCH ) ) ; <END_BUG> } public int resolveLevel ( AstNode node ) { } public int resolveLevel ( Binding binding ) { } protected int resolveLevelForType ( char [ ] simpleNamePattern , char [ ] qualificationPattern , char [ ] enclosingNamePattern , TypeBinding type ) { } public String toString ( ) { } }

Fix:
nodeSet . addMatch ( node , ( this . pattern . mustResolve ? PatternLocator . POSSIBLE_MATCH : PatternLocator . ACCURATE_MATCH ) ) ;
Buggy code:
public class PromptRolesState implements State { private final StateValues stateValues ; private final ConsoleWrapper theConsole ; public PromptRolesState ( ConsoleWrapper theConsole , final StateValues stateValues ) { } @ Override public State execute ( ) { if ( ( stateValues . isSilentOrNonInteractive ( ) ) == false ) { <START_BUG> if ( ! ( stateValues . isManagement ( ) ) ) { <END_BUG> theConsole . printf ( DomainManagementMessages . MESSAGES . rolesPrompt ( ) ) ; String userRoles = stateValues . getKnownRoles ( ) . get ( stateValues . getUserName ( ) ) ; stateValues . setRoles ( theConsole . readLine ( "[%1$2s]:<seq2seq4repair_space>" , ( userRoles == null ? "" : userRoles ) ) ) ; } } return new PreModificationState ( theConsole , stateValues ) ; } }

Fix:
if ( ! ( stateValues . getRoleFiles ( ) . isEmpty ( ) ) ) {
Buggy code:
public class TestDistance extends LuceneTestCase { private Directory directory ; private double lat = 38.969398 ; private double lng = - 77.386398 ; private String latField = "lat" ; private String lngField = "lng" ; private IndexWriter writer ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } private void addPoint ( IndexWriter writer , String name , double lat , double lng ) throws IOException { } private void addData ( IndexWriter writer ) throws IOException { } public void testLatLongFilterOnDeletedDocs ( ) throws Exception { writer . deleteDocuments ( new Term ( "name" , "Potomac" ) ) ; IndexReader r = IndexReader . open ( writer , true ) ; LatLongDistanceFilter f = new LatLongDistanceFilter ( new org . apache . lucene . search . QueryWrapperFilter ( new MatchAllDocsQuery ( ) ) , lat , lng , 1.0 , latField , lngField ) ; AtomicReaderContext [ ] leaves = ReaderUtil . leaves ( r . getTopReaderContext ( ) ) ; for ( int i = 0 ; i < ( leaves . length ) ; i ++ ) { <START_BUG> f . getDocIdSet ( leaves [ i ] ) ; <END_BUG> } r . close ( ) ; } }

Fix:
f . getDocIdSet ( leaves [ i ] , leaves [ i ] . reader . getLiveDocs ( ) ) ;