nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PopupSettings implements Serializable { public static final int LOCATION_BAR = 1 ; public static final int MENU_BAR = 2 ; public static final int RESIZABLE = 4 ; public static final int SCROLLBARS = 8 ; public static final int STATUS_BAR = 16 ; public static final int TOOL_BAR = 32 ; private int displayFlags ; private int height = - 1 ; private int left = - 1 ; private String target = "href" ; private int top = - 1 ; private int width = - 1 ; private String windowName = null ; public PopupSettings ( ) { } public PopupSettings ( final int displayFlags ) { } public String getPopupJavaScript ( ) { String windowTitle = windowName ; if ( windowTitle == null ) { windowTitle = "" ; } else { <START_BUG> windowTitle = windowTitle . replace ( '.' , '_' ) ; <END_BUG> } StringBuffer script = new StringBuffer ( ( ( "if<seq2seq4repair_space>(!window.focus)<seq2seq4repair_space>return<seq2seq4repair_space>true;<seq2seq4repair_space>window.open(" + ( target ) ) + ",<seq2seq4repair_space>'" ) ) . append ( windowTitle ) . append ( "',<seq2seq4repair_space>'" ) ; script . append ( "scrollbars=" ) . append ( flagToString ( PopupSettings . SCROLLBARS ) ) ; script . append ( ",<seq2seq4repair_space>location=" ) . append ( flagToString ( PopupSettings . LOCATION_BAR ) ) ; script . append ( ",<seq2seq4repair_space>menuBar=" ) . append ( flagToString ( PopupSettings . MENU_BAR ) ) ; script . append ( ",<seq2seq4repair_space>resizable=" ) . append ( flagToString ( PopupSettings . RESIZABLE ) ) ; script . append ( ",<seq2seq4repair_space>scrollbars=" ) . append ( flagToString ( PopupSettings . SCROLLBARS ) ) ; script . append ( ",<seq2seq4repair_space>status=" ) . append ( flagToString ( PopupSettings . STATUS_BAR ) ) ; script . append ( ",<seq2seq4repair_space>toolbar=" ) . append ( flagToString ( PopupSettings . TOOL_BAR ) ) ; if ( ( width ) != ( - 1 ) ) { script . append ( ",<seq2seq4repair_space>width=" ) . append ( width ) ; } if ( ( height ) != ( - 1 ) ) { script . append ( ",<seq2seq4repair_space>height=" ) . append ( height ) ; } if ( ( left ) != ( - 1 ) ) { script . append ( ",<seq2seq4repair_space>left=" ) . append ( left ) ; } if ( ( top ) != ( - 1 ) ) { script . append ( ",<seq2seq4repair_space>top=" ) . append ( top ) ; } script . append ( "');<seq2seq4repair_space>" ) . append ( "<seq2seq4repair_space>return<seq2seq4repair_space>false;" ) ; return script . toString ( ) ; } public PopupSettings setHeight ( int popupHeight ) { } public PopupSettings setLeft ( int popupPositionLeft ) { } public void setTarget ( String target ) { } public PopupSettings setTop ( int popupPositionTop ) { } public PopupSettings setWidth ( int popupWidth ) { } public PopupSettings setWindowName ( String popupWindowName ) { } private String flagToString ( final int flag ) { } }

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

Fix:
throw MESSAGES . nullParent ( ) ;
Buggy code:
public class XWalkViewWithOnHideOnShowAsync extends Activity implements XWalkInitializer . XWalkInitListener { private XWalkView mXWalkView ; private XWalkInitializer mXWalkInitializer ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public final void onXWalkInitStarted ( ) { } @ Override public final void onXWalkInitCancelled ( ) { } @ Override public final void onXWalkInitFailed ( ) { } @ Override public final void onXWalkInitCompleted ( ) { StringBuffer mess = new StringBuffer ( ) ; mess . append ( "Test<seq2seq4repair_space>Purpose:<seq2seq4repair_space>\n\n" ) . append ( "Verifies<seq2seq4repair_space>XWalkView<seq2seq4repair_space>can<seq2seq4repair_space>hide<seq2seq4repair_space>and<seq2seq4repair_space>show.\n\n" ) . append ( "Test<seq2seq4repair_space>Step:\n\n" ) . append ( "1.<seq2seq4repair_space>Play<seq2seq4repair_space>the<seq2seq4repair_space>video<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>page,<seq2seq4repair_space>then<seq2seq4repair_space>click<seq2seq4repair_space>home<seq2seq4repair_space>key.\n" ) . append ( "2.<seq2seq4repair_space>Click<seq2seq4repair_space>the<seq2seq4repair_space>\'EmbeddedAPISamples\'<seq2seq4repair_space>app<seq2seq4repair_space>again.\n\n" ) . append ( "Expected<seq2seq4repair_space>Result:\n\n" ) . append ( "1.Test<seq2seq4repair_space>passes<seq2seq4repair_space>if<seq2seq4repair_space>app<seq2seq4repair_space>video<seq2seq4repair_space>can<seq2seq4repair_space>be<seq2seq4repair_space>paused<seq2seq4repair_space>when<seq2seq4repair_space>clicking<seq2seq4repair_space>home<seq2seq4repair_space>key." ) . append ( "2.Test<seq2seq4repair_space>passes<seq2seq4repair_space>if<seq2seq4repair_space>there<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>short<seq2seq4repair_space>white<seq2seq4repair_space>screen<seq2seq4repair_space>displayed<seq2seq4repair_space>when<seq2seq4repair_space>clicking<seq2seq4repair_space>home<seq2seq4repair_space>key." ) ; new AlertDialog . Builder ( this ) . setTitle ( "Info" ) . setMessage ( mess . toString ( ) ) . setPositiveButton ( "confirm" , null ) . show ( ) ; setContentView ( xwview_layout ) ; mXWalkView = ( ( XWalkView ) ( findViewById ( xwalkview ) ) ) ; <START_BUG> mXWalkView . load ( "http:////www.iandevlin.com//html5//webvtt-example.html" , null ) ; <END_BUG> } }

Fix:
mXWalkView . load ( "https:////www.w3.org//2010//05//video//mediaevents.html" , null ) ;
Buggy code:
public class Scanner { private static final Logger LOGGER = LoggerFactory . getLogger ( Scanner . class ) ; private final PrintStream output ; public Scanner ( ) { } public Scanner ( final PrintStream out ) { } public static void main ( String [ ] args ) throws Exception { } public Format run ( ReadableChannelWrapper in ) throws IOException { Format format = new Format ( ) ; ChannelWrapper . Key < Integer > headerStartKey = in . start ( ) ; ChannelWrapper . Key < Integer > lead = in . start ( ) ; format . getLead ( ) . read ( in ) ; log ( ( ( "Lead<seq2seq4repair_space>ended<seq2seq4repair_space>at<seq2seq4repair_space>'" + ( in . finish ( lead ) ) ) + "'." ) ) ; ChannelWrapper . Key < Integer > signature = in . start ( ) ; int count = format . getSignature ( ) . read ( in ) ; <START_BUG> Entry < ? > sigEntry = format . getSignatur ( ) . getEntry ( SIGNATURES ) ; <END_BUG> int expected = ( sigEntry == null ) ? 0 : ( ByteBuffer . wrap ( ( ( byte [ ] ) ( sigEntry . getValues ( ) ) ) , 8 , 4 ) . getInt ( ) ) // ( - 16 ) ; log ( ( ( ( ( ( ( "Signature<seq2seq4repair_space>ended<seq2seq4repair_space>at<seq2seq4repair_space>'" + ( in . finish ( signature ) ) ) + "'<seq2seq4repair_space>and<seq2seq4repair_space>contained<seq2seq4repair_space>'" ) + count ) + "'<seq2seq4repair_space>headers<seq2seq4repair_space>(expected<seq2seq4repair_space>'" ) + expected ) + "')." ) ) ; Integer headerStartPos = in . finish ( headerStartKey ) ; format . getHeader ( ) . setStartPos ( headerStartPos ) ; ChannelWrapper . Key < Integer > headerKey = in . start ( ) ; count = format . getHeader ( ) . read ( in ) ; Entry < ? > immutableEntry = format . getHeader ( ) . getEntry ( HeaderTag . HEADERIMMUTABLE ) ; expected = ( immutableEntry == null ) ? 0 : ( ByteBuffer . wrap ( ( ( byte [ ] ) ( immutableEntry . getValues ( ) ) ) , 8 , 4 ) . getInt ( ) ) // ( - 16 ) ; Integer headerLength = in . finish ( headerKey ) ; format . getHeader ( ) . setEndPos ( ( headerStartPos + headerLength ) ) ; log ( ( ( ( ( ( ( "Header<seq2seq4repair_space>ended<seq2seq4repair_space>at<seq2seq4repair_space>'" + headerLength ) + "<seq2seq4repair_space>and<seq2seq4repair_space>contained<seq2seq4repair_space>'" ) + count ) + "'<seq2seq4repair_space>headers<seq2seq4repair_space>(expected<seq2seq4repair_space>'" ) + expected ) + "')." ) ) ; return format ; } private void log ( final String text ) { } }

Fix:
Entry < ? > sigEntry = format . getSignature ( ) . getEntry ( SIGNATURES ) ;
Buggy code:
public final class EditBook extends AuthenticatedWebPage { static final Book otherBook = new Book ( "Frisbee<seq2seq4repair_space>Techniques" , "Marty<seq2seq4repair_space>van<seq2seq4repair_space>Hoff" , Book . FICTION ) ; public EditBook ( final Book book ) { } public static PageLink link ( final String name , final long id ) { } public static final class EditBookForm extends Form { public EditBookForm ( final String componentName , final Book book , final FeedbackPanel feedback ) { } public final void onSubmit ( ) { final RequestCycle cycle = getRequestCycle ( ) ; PageParameters parameters = new PageParameters ( ) ; <START_BUG> final Book book = ( ( Book ) ( getRootModelObject ( ) ) ) ; <END_BUG> parameters . put ( "id" , new Long ( book . getId ( ) ) ) ; cycle . setResponsePage ( getPageFactory ( ) . newPage ( BookDetails . class , parameters ) ) ; cycle . setRedirect ( true ) ; } } }

Fix:
final Book book = ( ( Book ) ( getModelObject ( ) ) ) ;
Buggy code:
public class DatasourcesSubsystemTestCase extends AbstractSubsystemBaseTest { public DatasourcesSubsystemTestCase ( ) { } @ Override protected String getSubsystemXml ( ) throws IOException { } public void testFullConfig ( ) throws Exception { } public void testExpressionConfig ( ) throws Exception { } protected AdditionalInitialization createAdditionalInitialization ( ) { } @ Test public void testTransformerAS712 ( ) throws Exception { } @ Test public void testTransformerAS713 ( ) throws Exception { } @ Test public void tesExpressionsAS712 ( ) throws Exception { } @ Test public void testExpressionsAS713 ( ) throws Exception { } private void testTransformer1_1_0 ( String subsystemXml , ModelTestControllerVersion controllerVersion ) throws Exception { ModelVersion modelVersion = ModelVersion . create ( 1 , 1 , 0 ) ; KernelServicesBuilder builder = createKernelServicesBuilder ( MANAGEMENT ) . setSubsystemXmlResource ( subsystemXml ) ; <START_BUG> builder . createLegacyKernelServicesBuilder ( null , controllerVersion , modelVersion ) . addMavenResourceURL ( ( "org.jboss.as:jboss-as-connector:" + ( controllerVersion . getMavenGavVersion ( ) ) ) ) . setExtensionClassName ( "org.jboss.as.connector.subsystems.datasources.DataSourcesExtension" ) . configureReverseControllerCheck ( MANAGEMENT , null ) . skipReverseControllerCheck ( ) ; <END_BUG> KernelServices mainServices = builder . build ( ) ; Assert . assertTrue ( mainServices . isSuccessfulBoot ( ) ) ; KernelServices legacyServices = mainServices . getLegacyServices ( modelVersion ) ; Assert . assertTrue ( legacyServices . isSuccessfulBoot ( ) ) ; Assert . assertNotNull ( legacyServices ) ; checkSubsystemModelTransformation ( mainServices , modelVersion , new ModelFixer ( ) { @ Override public ModelNode fixModel ( ModelNode modelNode ) { Assert . assertTrue ( modelNode . get ( XA_DATASOURCE ) . get ( "complexXaDs_Pool" ) . get ( JTA . getName ( ) ) . asBoolean ( ) ) ; modelNode . get ( XA_DATASOURCE ) . get ( "complexXaDs_Pool" ) . remove ( JTA . getName ( ) ) ; return modelNode ; } } ) ; } public void testRejectTransformers1_1_0 ( String subsystemXml , ModelTestControllerVersion controllerVersion ) throws Exception { } }

Fix:
builder . createLegacyKernelServicesBuilder ( null , controllerVersion , modelVersion ) . addMavenResourceURL ( ( "org.jboss.as:jboss-as-connector:" + ( controllerVersion . getMavenGavVersion ( ) ) ) ) . setExtensionClassName ( "org.jboss.as.connector.subsystems.datasources.DataSourcesExtension" ) . configureReverseControllerCheck ( MANAGEMENT , null ) ;
Buggy code:
public final class DiffUtil { private static final Log log = LogFactory . getLog ( DiffUtil . class ) ; public static final boolean validatePage ( String document , final Class clazz , final String file , boolean failWithAssert ) throws IOException { String filename = clazz . getPackage ( ) . getName ( ) ; filename = filename . replace ( '.' , '//' ) ; filename += "//" + file ; InputStream in = clazz . getClassLoader ( ) . getResourceAsStream ( filename ) ; if ( in == null ) { throw new IOException ( ( "File<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>" + filename ) ) ; } String reference = Streams . readString ( in ) ; reference = reference . replaceAll ( "\n\r" , "\n" ) ; reference = reference . replaceAll ( "\r\n" , "\n" ) ; document = document . replaceAll ( "\n\r" , "\n" ) ; document = document . replaceAll ( "\r\n" , "\n" ) ; boolean equals = document . equals ( reference ) ; if ( equals == false ) { <START_BUG> if ( Boolean . getBoolean ( "org.apache.wicket.replace.expected.results" ) ) { <END_BUG> in . close ( ) ; in = null ; DiffUtil . replaceExpectedResultFile ( document , clazz , file ) ; return true ; } if ( failWithAssert ) { Assert . assertEquals ( filename , reference , document ) ; } else { DiffUtil . log . error ( ( "File<seq2seq4repair_space>name:<seq2seq4repair_space>" + file ) ) ; DiffUtil . log . error ( "===================" ) ; DiffUtil . log . error ( reference ) ; DiffUtil . log . error ( "===================" ) ; DiffUtil . log . error ( document ) ; DiffUtil . log . error ( "===================" ) ; String [ ] test1 = StringList . tokenize ( reference , "\n" ) . toArray ( ) ; String [ ] test2 = StringList . tokenize ( document , "\n" ) . toArray ( ) ; Diff df = new Diff ( test1 ) ; Revision r ; try { r = df . diff ( test2 ) ; } catch ( DifferentiationFailedException e ) { throw new RuntimeException ( e ) ; } System . out . println ( r . toString ( ) ) ; } } return equals ; } public static final void replaceExpectedResultFile ( final String document , final Class clazz , final String file ) throws IOException { } }

Fix:
if ( Boolean . getBoolean ( "wicket.replace.expected.results" ) ) {
Buggy code:
public class AI { private ArrayList < Card > hand ; private ArrayList < Card > faceup ; private ArrayList < Player > players ; public AI ( ArrayList < Card > hand , ArrayList < Card > faceup , ArrayList < Player > players ) { } private boolean canCompleteFour ( ArrayList < Card > handy , Pile pile ) { } private boolean isWinning ( Player opp ) { } private boolean isValid ( Pile p , Card c ) { <START_BUG> if ( p . isEmpty ( ) ) { <END_BUG> return true ; } return ( p . checkTop ( ) . value ) > ( c . value ) ? false : true ; } private int getPlayValue ( Pile pile , int fdCount ) { } public Card logical ( Pile pilein , int fdCountin ) { } }

Fix:
if ( ( p . isEmpty ( ) ) || ( ( c . value ) == 2 ) ) {
Buggy code:
public class RenderSystem extends EntitySystem { private ImmutableArray < Entity > entities ; private SpriteBatch batch ; private OrthographicCamera camera ; private ComponentMapper < PositionComponent > pm = ComponentMapper . getFor ( PositionComponent . class ) ; private ComponentMapper < VisualComponent > vm = ComponentMapper . getFor ( VisualComponent . class ) ; public RenderSystem ( OrthographicCamera camera ) { } @ Override public void addedToEngine ( Engine engine ) { <START_BUG> entities = engine . getEntitiesFor ( Family . getFor ( PositionComponent . class , VisualComponent . class ) ) ; <END_BUG> } @ Override public void removedFromEngine ( Engine engine ) { } @ Override public void update ( float deltaTime ) { } }

Fix:
entities = engine . getEntitiesFor ( Family . all ( PositionComponent . class , VisualComponent . class ) . get ( ) ) ;
Buggy code:
public class dnsResolver { InetAddress addr ; int port = dns . PORT ; dnsTSIG TSIG ; int timeoutValue = 60 * 1000 ; public dnsResolver ( String hostname ) { } public void setPort ( int port ) { } public void setTSIGKey ( String name , String key ) { } public void setTSIGKey ( String key ) { } dnsMessage sendTCP ( dnsMessage query , byte [ ] out ) throws IOException { } public dnsMessage send ( dnsMessage query ) throws IOException { } public dnsMessage sendAXFR ( dnsMessage query ) throws IOException { byte [ ] out ; byte [ ] in ; Socket s ; int inLength ; DataInputStream dataIn ; int soacount = 0 ; dnsMessage response ; boolean first = true ; try { <START_BUG> s = new Socket ( addr , dns . PORT ) ; <END_BUG> } catch ( SocketException e ) { System . out . println ( e ) ; return null ; } if ( ( TSIG ) != null ) TSIG . apply ( query ) ; out = query . toBytes ( ) ; new DataOutputStream ( s . getOutputStream ( ) ) . writeShort ( out . length ) ; s . getOutputStream ( ) . write ( out ) ; s . setSoTimeout ( timeoutValue ) ; response = new dnsMessage ( ) ; response . getHeader ( ) . setID ( query . getHeader ( ) . getID ( ) ) ; if ( ( TSIG ) != null ) TSIG . verifyAXFRStart ( ) ; while ( soacount < 2 ) { try { dataIn = new DataInputStream ( s . getInputStream ( ) ) ; inLength = dataIn . readUnsignedShort ( ) ; in = new byte [ inLength ] ; dataIn . readFully ( in ) ; } catch ( InterruptedIOException e ) { s . close ( ) ; System . out . println ( ";;<seq2seq4repair_space>No<seq2seq4repair_space>response" ) ; return null ; } dnsMessage m = new dnsMessage ( in ) ; if ( ( ( ( m . getHeader ( ) . getCount ( QUESTION ) ) != 0 ) || ( ( m . getHeader ( ) . getCount ( ANSWER ) ) <= 0 ) ) || ( ( m . getHeader ( ) . getCount ( AUTHORITY ) ) != 0 ) ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( "Invalid<seq2seq4repair_space>AXFR:<seq2seq4repair_space>" ) ; for ( int i = 0 ; i < 4 ; i ++ ) { Enumeration e = m . getSection ( i ) . elements ( ) ; System . out . println ( "--" ) ; while ( e . hasMoreElements ( ) ) { dnsRecord r ; r = ( ( dnsRecord ) ( e . nextElement ( ) ) ) ; System . out . println ( r ) ; } System . out . println ( ) ; } System . out . println ( sb . toString ( ) ) ; s . close ( ) ; return null ; } for ( int i = 1 ; i < 4 ; i ++ ) { Enumeration e = m . getSection ( i ) . elements ( ) ; while ( e . hasMoreElements ( ) ) { dnsRecord r = ( ( dnsRecord ) ( e . nextElement ( ) ) ) ; response . addRecord ( i , r ) ; if ( r instanceof dnsSOARecord ) soacount ++ ; } } if ( ( TSIG ) != null ) { boolean required = ( soacount > 1 ) || first ; boolean ok = TSIG . verifyAXFR ( m , in , query . getTSIG ( ) , required , first ) ; System . out . println ( ( "TSIG<seq2seq4repair_space>verify:<seq2seq4repair_space>" + ok ) ) ; } first = false ; } s . close ( ) ; return response ; } }

Fix:
s = new Socket ( addr , port ) ;
Buggy code:
@ MSExtension ( "SKCompat" ) public class SKCompat extends AbstractExtension { @ Override public void onStartup ( ) { } @ Override public void onShutdown ( ) { } @ Override public Version getVersion ( ) { <START_BUG> return new SimpleVersion ( 1 , 0 , 4 ) ; <END_BUG> } public static MCCommandSender myGetPlayer ( Construct arg , Target t ) { } public static abstract class SKFunction extends AbstractFunction { @ Override public boolean isRestricted ( ) { } @ Override public Version since ( ) { } @ Override public Boolean runAsync ( ) { } } }

Fix:
return new SimpleVersion ( 1 , 1 , 0 ) ;
Buggy code:
public class DefinitionExtractor { @ SuppressWarnings ( "unchecked" ) public static void main ( String [ ] args ) { if ( ( args . length ) != 1 ) { System . out . println ( "Wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>arguments" ) ; System . exit ( 1 ) ; } try { String treeString = args [ 0 ] ; Tree definitionTree = DefinitionTree . getDefinitionTree ( treeString ) ; List < String > definitions = Lists . newArrayList ( DefinitionTree . getDefinitions ( definitionTree ) ) ; JSONObject result = new JSONObject ( ) ; <START_BUG> result . put ( "tree" , definitionTree ) ; <END_BUG> result . put ( "definitions" , definitions ) ; System . out . println ( result . toJSONString ( ) ) ; } catch ( Exception e ) { System . exit ( 1 ) ; } } }

Fix:
result . put ( "tree" , definitionTree . toString ( ) ) ;
Buggy code:
public class MountedMapperTest extends AbstractMapperTest { public MountedMapperTest ( ) { } private final MountedMapper encoder = new MountedMapper ( "//some//mount//path" , MockPage . class ) { @ Override protected IMapperContext getContext ( ) { } } ; private final MountedMapper placeholderEncoder = new MountedMapper ( "//some//${param1}//path//${param2}" , MockPage . class ) { @ Override protected IMapperContext getContext ( ) { } } ; public void testDecode1 ( ) { } public void testDecode2 ( ) { } public void testDecode3 ( ) { } public void testDecode4 ( ) { } public void testDecode5 ( ) { } public void testDecode6 ( ) { } public void testDecode7 ( ) { <START_BUG> Url url = Url . parse ( "some//mount//path?15-ILinkListener.4-foo-bar" ) ; <END_BUG> IRequestHandler handler = encoder . mapRequest ( getRequest ( url ) ) ; assertTrue ( ( handler instanceof ListenerInterfaceRequestHandler ) ) ; ListenerInterfaceRequestHandler h = ( ( ListenerInterfaceRequestHandler ) ( handler ) ) ; IRequestablePage page = h . getPage ( ) ; checkPage ( page , 15 ) ; assertEquals ( INTERFACE , h . getListenerInterface ( ) ) ; assertEquals ( "foo:bar" , h . getComponent ( ) . getPageRelativePath ( ) ) ; assertEquals ( ( ( Object ) ( 4 ) ) , h . getBehaviorIndex ( ) ) ; } public void testDecode8 ( ) { } public void testDecode9 ( ) { } public void testDecode10 ( ) { } public void testDecode11 ( ) { } public void testEncode1 ( ) { } public void testEncode2 ( ) { } public void testEncode3 ( ) { } public void testEncode4 ( ) { } public void testEncode5 ( ) { } public void testEncode6 ( ) { } public void testEncode7 ( ) { } public void testEncode8 ( ) { } public void testConstruct1 ( ) { } public void testConstruct2 ( ) { } public void testPlaceholderDecode1 ( ) { } public void testPlaceholderDecode2 ( ) { } public void testPlaceholderEncode2 ( ) { } public void testPlaceholderEncode3 ( ) { } }

Fix:
Url url = Url . parse ( "some//mount//path?param1=value1&15-ILinkListener.4-foo-bar" ) ;
Buggy code:
class ListTab extends ScrollableTab { List list1 ; Group listGroup ; static String [ ] ListData1 = new String [ ] { ControlExample . getResourceString ( "ListData1_0" ) , ControlExample . getResourceString ( "ListData1_1" ) , ControlExample . getResourceString ( "ListData1_2" ) , ControlExample . getResourceString ( "ListData1_3" ) , ControlExample . getResourceString ( "ListData1_4" ) , ControlExample . getResourceString ( "ListData1_5" ) , ControlExample . getResourceString ( "ListData1_6" ) , ControlExample . getResourceString ( "ListData1_7" ) , ControlExample . getResourceString ( "ListData1_8" ) } ; ListTab ( ControlExample instance ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { <START_BUG> return new String [ ] { "Items" , "Selection" , "TopIndex" } ; <END_BUG> } String getTabText ( ) { } }

Fix:
return new String [ ] { "Items" , "Selection" , "ToolTipText" , "TopIndex" } ;
Buggy code:
public class ProgressIndividualActivity extends ActionBarActivity { private String m_date ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_progress_individual ) ; Bundle args = getIntent ( ) . getExtras ( ) ; m_date = args . getString ( "date" ) ; ActionBar actionBar = getActionBar ( ) ; actionBar . setDisplayHomeAsUpEnabled ( true ) ; actionBar . setDisplayShowHomeEnabled ( false ) ; actionBar . setDisplayShowTitleEnabled ( true ) ; actionBar . setTitle ( m_date ) ; actionBar . setDisplayUseLogoEnabled ( false ) ; ListView individual_progress_listView = ( ( ListView ) ( findViewById ( individual_progress_listview ) ) ) ; LongTermDataSQLHelper helper = new LongTermDataSQLHelper ( this ) ; <START_BUG> ArrayAdapter < LongTermEvent > mArrayAdapter = new ArrayAdapter < LongTermEvent > ( this , layout . row_no_config , id . liftText , helper . getProgressList ( ) ) ; <END_BUG> individual_progress_listView . setAdapter ( mArrayAdapter ) ; ColorManager manager = ColorManager . getInstance ( getApplicationContext ( ) ) ; getActionBar ( ) . setBackgroundDrawable ( new android . graphics . drawable . ColorDrawable ( manager . getPrimaryColor ( ) ) ) ; individual_progress_listView . setBackgroundColor ( BLACK ) ; } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
ArrayAdapter < LongTermEvent > mArrayAdapter = new ArrayAdapter < LongTermEvent > ( this , layout . row_no_config , id . liftText , helper . getProgressList ( DEFAULT ) ) ;
Buggy code:
public class DeleteJmsResourceHandler extends BatchModeCommandHandler { public DeleteJmsResourceHandler ( ) { } @ Override public ModelNode buildRequest ( CommandContext ctx ) throws OperationFormatException { try { <START_BUG> if ( ! ( ctx . getParsedArguments ( ) . hasProperties ( ) ) ) { <END_BUG> throw new OperationFormatException ( "Arguments<seq2seq4repair_space>are<seq2seq4repair_space>missing" ) ; } } catch ( CommandFormatException e ) { throw new OperationFormatException ( e . getLocalizedMessage ( ) ) ; } String jndiName = null ; String [ ] args = ctx . getArgumentsString ( ) . split ( "\\s+" ) ; int i = 0 ; while ( i < ( args . length ) ) { String arg = args [ ( i ++ ) ] ; if ( arg . equals ( "--target" ) ) { } else { jndiName = arg ; } } if ( jndiName == null ) { throw new OperationFormatException ( "name<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ; } ModelControllerClient client = ctx . getModelControllerClient ( ) ; final String resource ; if ( Util . isTopic ( client , jndiName ) ) { resource = "jms-topic" ; } else if ( Util . isQueue ( client , jndiName ) ) { resource = "jms-queue" ; } else if ( Util . isConnectionFactory ( client , jndiName ) ) { resource = "connection-factory" ; } else { throw new OperationFormatException ( ( ( "'" + jndiName ) + "'<seq2seq4repair_space>wasn't<seq2seq4repair_space>found<seq2seq4repair_space>among<seq2seq4repair_space>existing<seq2seq4repair_space>JMS<seq2seq4repair_space>resources." ) ) ; } DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder ( ) ; builder . addNode ( "subsystem" , "messaging" ) ; builder . addNode ( resource , jndiName ) ; builder . setOperationName ( "remove" ) ; return builder . buildRequest ( ) ; } }

Fix:
if ( ! ( ctx . getParsedCommandLine ( ) . hasProperties ( ) ) ) {
Buggy code:
public class TestPrefixFilter extends LuceneTestCase { public void testPrefixFilter ( ) throws Exception { Directory directory = newDirectory ( ) ; String [ ] categories = new String [ ] { "//Computers//Linux" , "//Computers//Mac//One" , "//Computers//Mac//Two" , "//Computers//Windows" } ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory ) ; for ( int i = 0 ; i < ( categories . length ) ; i ++ ) { Document doc = new Document ( ) ; doc . add ( newStringField ( "category" , categories [ i ] , YES ) ) ; writer . addDocument ( doc ) ; } IndexReader reader = writer . getReader ( ) ; PrefixFilter filter = new PrefixFilter ( new Term ( "category" , "//Computers" ) ) ; Query query = new ConstantScoreQuery ( filter ) ; IndexSearcher searcher = newSearcher ( reader ) ; ScoreDoc [ ] hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 4 , hits . length ) ; filter = new PrefixFilter ( new Term ( "category" , "//Computers//Mac" ) ) ; query = new ConstantScoreQuery ( filter ) ; hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 2 , hits . length ) ; filter = new PrefixFilter ( new Term ( "category" , "//Computers//Linux" ) ) ; query = new ConstantScoreQuery ( filter ) ; hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 1 , hits . length ) ; filter = new PrefixFilter ( new Term ( "category" , "//Computers//Windows" ) ) ; query = new ConstantScoreQuery ( filter ) ; hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 1 , hits . length ) ; filter = new PrefixFilter ( new Term ( "category" , "//Computers//ObsoleteOS" ) ) ; query = new ConstantScoreQuery ( filter ) ; hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 0 , hits . length ) ; filter = new PrefixFilter ( new Term ( "category" , "//Computers//AAA" ) ) ; query = new ConstantScoreQuery ( filter ) ; hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 0 , hits . length ) ; filter = new PrefixFilter ( new Term ( "category" , "//Computers//ZZZ" ) ) ; query = new ConstantScoreQuery ( filter ) ; hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 0 , hits . length ) ; filter = new PrefixFilter ( new Term ( "category" , "" ) ) ; query = new ConstantScoreQuery ( filter ) ; hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 4 , hits . length ) ; filter = new PrefixFilter ( new Term ( "nonexistantfield" , "//Computers" ) ) ; query = new ConstantScoreQuery ( filter ) ; hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 0 , hits . length ) ; <START_BUG> writer . close ( ) ; <END_BUG> reader . close ( ) ; directory . close ( ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class DistributedTestActivator extends TestActivator implements ServiceListener { private BundleContext context ; public void start ( BundleContext aContext ) throws Exception { } public void stop ( BundleContext context ) throws Exception { } public void serviceChanged ( ServiceEvent event ) { } private void handleServiceAdded ( final ServiceReference aServiceReference ) { final Object objectClass = aServiceReference . getProperty ( Constants . OBJECTCLASS ) ; final boolean adv = Arrays . equals ( ( ( String [ ] ) ( objectClass ) ) , new String [ ] { Advertiser . class . getName ( ) } ) ; <START_BUG> final String symbolicName = aServiceReference . getBundle ( ) . getSymbolicName ( ) ; <END_BUG> final boolean remote = symbolicName . equals ( "org.eclipse.ecf.osgi.services.distribution" ) ; if ( remote && adv ) { advertiser = ( ( Advertiser ) ( context . getService ( aServiceReference ) ) ) ; } if ( ( ! adv ) && ( ! remote ) ) { locator = ( ( Locator ) ( context . getService ( aServiceReference ) ) ) ; } } }

Fix:
final String symbolicName = ( ( String ) ( aServiceReference . getBundle ( ) . getHeaders ( ) . get ( "Bundle-SymbolicName" ) ) ) ;
Buggy code:
public class RemoteJMeterEngineImpl extends UnicastRemoteObject implements RemoteJMeterEngine { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; JMeterEngine backingEngine ; public RemoteJMeterEngineImpl ( ) throws RemoteException { } public void setHost ( String host ) { } public void configure ( HashTree testTree ) throws RemoteException { } public void runTest ( ) throws RemoteException , JMeterEngineException { } public void reset ( ) throws RemoteException { } public void stopTest ( ) throws RemoteException { } public static void main ( String [ ] args ) { try { <START_BUG> RemoteJMeterEngine engine = new RemoteJMeterEngineImpl ( ) ; <END_BUG> while ( true ) { Thread . sleep ( Long . MAX_VALUE ) ; } } catch ( Exception ex ) { RemoteJMeterEngineImpl . log . error ( "" , ex ) ; } } }

Fix:
new RemoteJMeterEngineImpl ( ) ;
Buggy code:
public class DataBaseHelper extends SQLiteOpenHelper { private static final String LOG_TAG = DataBaseHelper . class . getSimpleName ( ) ; private static String DB_PATH = "//data//data//vegnab//databases//" ; private static String DB_NAME = "VegNab.db" ; private SQLiteDatabase myDataBase ; private final Context myContext ; public DataBaseHelper ( Context context ) { } public void createDataBase ( ) throws IOException { } private boolean checkDataBase ( ) { } private void copyDataBase ( ) throws IOException { } public void openDataBase ( ) throws SQLException { } @ Override public synchronized void close ( ) { } @ Override public void onCreate ( SQLiteDatabase db ) { } @ Override public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } @ TargetApi ( VERSION_CODES . HONEYCOMB ) public String fillSpeciesTable ( ParcelFileDescriptor fileDescr ) { StringBuilder lines = new StringBuilder ( ) ; String listName = "" ; String line ; String code ; String descr ; String [ ] lineParts ; long ct = 0 ; SQLiteDatabase db = this . getWritableDatabase ( ) ; db . execSQL ( "DELETE<seq2seq4repair_space>FROM<seq2seq4repair_space>RegionalSpeciesList;" ) ; <START_BUG> String sSql = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>RegionalSpeciesList<seq2seq4repair_space>(<seq2seq4repair_space>Code,<seq2seq4repair_space>SppDescr<seq2seq4repair_space>)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(<seq2seq4repair_space>?,<seq2seq4repair_space>?<seq2seq4repair_space>)" ; <END_BUG> db . beginTransactionNonExclusive ( ) ; SQLiteStatement stmt = db . compileStatement ( sSql ) ; try { InputStream is = new FileInputStream ( fileDescr . getFileDescriptor ( ) ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( is , "UTF-8" ) ) ; while ( ( line = br . readLine ( ) ) != null ) { if ( ct == 0 ) { listName = line . toString ( ) ; } else { lineParts = line . split ( "\t" ) ; code = lineParts [ 0 ] . replace ( '\'' , '`' ) ; descr = lineParts [ 1 ] . replace ( '\'' , '`' ) ; Log . v ( DataBaseHelper . LOG_TAG , ( ( ( ( "Code:<seq2seq4repair_space>'" + code ) + "',<seq2seq4repair_space>Description:<seq2seq4repair_space>'" ) + descr ) + "'" ) ) ; lines . append ( "('" ) . append ( code ) . append ( "',<seq2seq4repair_space>'" ) . append ( descr ) . append ( "\'),<seq2seq4repair_space>\n\r" ) ; stmt . bindString ( 1 , lineParts [ 0 ] ) ; stmt . bindString ( 2 , lineParts [ 1 ] ) ; stmt . execute ( ) ; stmt . clearBindings ( ) ; } ct ++ ; } br . close ( ) ; db . setTransactionSuccessful ( ) ; } catch ( IOException e ) { Log . v ( DataBaseHelper . LOG_TAG , ( "IOException<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } db . endTransaction ( ) ; db . close ( ) ; return listName ; } No newline ; at end ; of file ; }

Fix:
String sSql = "INSERT<seq2seq4repair_space>OR<seq2seq4repair_space>REPLACE<seq2seq4repair_space>INTO<seq2seq4repair_space>RegionalSpeciesList<seq2seq4repair_space>(<seq2seq4repair_space>Code,<seq2seq4repair_space>SppDescr<seq2seq4repair_space>)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(<seq2seq4repair_space>?,<seq2seq4repair_space>?<seq2seq4repair_space>)" ;
Buggy code:
public class ClobStoredProcedureTest extends BaseJDBCTestCase { final String testStr = "I<seq2seq4repair_space>am<seq2seq4repair_space>a<seq2seq4repair_space>simple<seq2seq4repair_space>derby<seq2seq4repair_space>test<seq2seq4repair_space>case" ; final long testStrLength = testStr . length ( ) ; public ClobStoredProcedureTest ( String name ) { } public static Test suite ( ) { } public void setUp ( ) throws Exception { } public void tearDown ( ) throws Exception { } public void testGetSubStringSP ( ) throws SQLException { } public void testClobCreateLocatorSP ( ) throws SQLException { int locator = - 1 ; CallableStatement cs = prepareCall ( "?<seq2seq4repair_space>=<seq2seq4repair_space>CALL<seq2seq4repair_space>SYSIBM.CLOBCREATELOCATOR()" ) ; cs . registerOutParameter ( 1 , Types . INTEGER ) ; cs . executeUpdate ( ) ; locator = cs . getInt ( 1 ) ; <START_BUG> assertEquals ( ( "The<seq2seq4repair_space>locator<seq2seq4repair_space>values<seq2seq4repair_space>returned<seq2seq4repair_space>by<seq2seq4repair_space>" + "SYSIBM.CLOBCREATELOCATOR()<seq2seq4repair_space>are<seq2seq4repair_space>incorrect" ) , 4 , locator ) ; <END_BUG> cs . close ( ) ; } public void testClobReleaseLocatorSP ( ) throws SQLException { } public void testClobGetLengthSP ( ) throws SQLException { } public void testClobGetPositionFromStringSP ( ) throws SQLException { } public void testClobSetStringSP ( ) throws SQLException { } public void testClobTruncateSP ( ) throws SQLException { } public void testClobGetPositionFromLocatorSP ( ) throws SQLException { } }

Fix:
assertEquals ( ( "The<seq2seq4repair_space>locator<seq2seq4repair_space>values<seq2seq4repair_space>returned<seq2seq4repair_space>by<seq2seq4repair_space>" + "SYSIBM.CLOBCREATELOCATOR()<seq2seq4repair_space>are<seq2seq4repair_space>incorrect" ) , 2 , locator ) ;
Buggy code:
public class ViewPane extends PartPane { private IToolBarManager2 isvToolBarMgr = null ; private MenuManager isvMenuMgr ; boolean hasFocus ; private boolean hadViewMenu = false ; private class ISVPropListener implements IPropertyChangeListener { private Control toolBar ; public ISVPropListener ( Control toolBar ) { } public void propertyChange ( PropertyChangeEvent event ) { } } class PaneMenuManager extends MenuManager { public PaneMenuManager ( ) { } protected void update ( boolean force , boolean recursive ) { } } public ViewPane ( IViewReference ref , WorkbenchPage page ) { } public void createControl ( Composite parent ) { } protected void createTitleBar ( ) { } private void toolBarResized ( Control toolBar , int newSize ) { } private void createToolBars ( ) { } public void dispose ( ) { } public void doHide ( ) { } Rectangle getParentBounds ( ) { } public void doMakeFast ( ) { } public void doRemoveFast ( ) { } protected void doDock ( ) { } public void doDetach ( ) { } public void doAttach ( ) { } public String getCompoundId ( ) { } public Control getDragHandle ( ) { } public MenuManager getMenuManager ( ) { } public Control [ ] getTabList ( ) { } public IToolBarManager2 getToolBarManager ( ) { } public IViewReference getViewReference ( ) { } public void setFast ( boolean b ) { } void shellActivated ( ) { } void shellDeactivated ( ) { } void setActive ( boolean active ) { } public void showFocus ( boolean inFocus ) { } private boolean isFastView ( ) { } boolean isMoveable ( ) { } public boolean hasViewMenu ( ) { } public void showViewMenu ( Point location ) { } public String toString ( ) { } public void updateActionBars ( ) { if ( ( isvMenuMgr ) != null ) { <START_BUG> isvMenuMgr . updateAll ( false ) ; <END_BUG> } if ( ( isvToolBarMgr ) != null ) { isvToolBarMgr . update ( false ) ; } } public void updateTitles ( ) { } public void addSizeMenuItem ( Menu menu , int index ) { } protected void doZoom ( ) { } public void setContainer ( ILayoutContainer container ) { } public void reparent ( Composite newParent ) { } public void moveAbove ( Control refControl ) { } public void setVisible ( boolean makeVisible ) { } public boolean toolbarIsVisible ( ) { } public void showHighlight ( ) { } public String getPlaceHolderId ( ) { } public Control getToolBar ( ) { } private Control internalGetToolbar ( ) { } public boolean isCloseable ( ) { } public void showSystemMenu ( ) { } public void showPaneMenu ( ) { } public void removeContributions ( ) { } }

Fix:
isvMenuMgr . update ( false ) ;
Buggy code:
public class IndentXMLStreamWriterTest extends TestSupport { private final XMLInputFactory xmlInputFactory = XMLInputFactory . newFactory ( ) ; private final XMLOutputFactory xmlOutputFactory = XMLOutputFactory . newFactory ( ) ; @ Test ( dataProvider = "files" ) public void testIndent ( String inputResource , String expectedResource , boolean emptyTag , boolean addMissingXmlDeclaration , boolean indentAfterXmlDecl ) throws Exception { final File actualFile = File . createTempFile ( "test1." , "xml" ) ; final String input = this . readResource ( inputResource ) ; this . indent ( input , actualFile , emptyTag , addMissingXmlDeclaration , indentAfterXmlDecl ) ; final String actual = this . readResource ( actualFile ) ; final String expected = this . readResource ( expectedResource ) ; <START_BUG> Assert . assertEquals ( actual . trim ( ) . replaceAll ( "(?s)\\r\\n?" , "\\n" ) , expected . trim ( ) ) ; <END_BUG> actualFile . delete ( ) ; } private void indent ( String input , File outputFile , boolean emptyTag , boolean addMissingXmlDeclaration , boolean indentAfterXmlDecl ) throws Exception { } @ DataProvider ( name = "files" ) public Object [ ] [ ] generateFiles ( ) { } }

Fix:
Assert . assertEquals ( actual . trim ( ) . replaceAll ( "(?s)\\r\\n?" , "\n" ) , expected . trim ( ) ) ;
Buggy code:
public class RunNotifier { private List < RunListener > fListeners = new ArrayList < RunListener > ( ) ; private boolean fPleaseStop = false ; public void addListener ( RunListener listener ) { } public void removeListener ( RunListener listener ) { } private abstract class SafeNotifier { void run ( ) { } protected abstract void notifyListener ( RunListener each ) throws Exception { } } public void fireTestRunStarted ( final Description description ) { } public void fireTestRunFinished ( final Result result ) { } public void fireTestStarted ( final Description description ) throws StoppedByUserException { } public void fireTestFailure ( final Failure failure ) { } public void fireTestIgnored ( final Description description ) { } public void fireTestFinished ( final Description description ) { } public void pleaseStop ( ) { } public void addFirstListener ( RunListener listener ) { } public void testAborted ( Description description , Throwable cause ) { } public void fireTestAssumptionFailed ( final Description description , final AssumptionViolatedException e ) { new RunNotifier . SafeNotifier ( ) { @ Override protected void notifyListener ( RunListener each ) throws Exception { <START_BUG> each . testAssumptionFailed ( description , e ) ; <END_BUG> } } . run ( ) ; } }

Fix:
each . testAssumptionInvalid ( description , e ) ;
Buggy code:
public class WicketSessionFilter implements Filter { private static final Log log = LogFactory . getLog ( WicketSessionFilter . class ) ; private String servletPath ; private String sessionKey ; public WicketSessionFilter ( ) { } public void init ( FilterConfig filterConfig ) throws ServletException { servletPath = filterConfig . getInitParameter ( "servletPath" ) ; if ( ( servletPath ) == null ) { throw new ServletException ( ( "you<seq2seq4repair_space>must<seq2seq4repair_space>provide<seq2seq4repair_space>init<seq2seq4repair_space>parameter<seq2seq4repair_space>servlet-path<seq2seq4repair_space>if<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>" + ( getClass ( ) . getName ( ) ) ) ) ; } if ( ( servletPath . charAt ( 0 ) ) != '//' ) { servletPath = '//' + ( servletPath ) ; } if ( WicketSessionFilter . log . isDebugEnabled ( ) ) { WicketSessionFilter . log . debug ( ( "servlet<seq2seq4repair_space>path<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>" + ( servletPath ) ) ) ; } <START_BUG> sessionKey = ( ( "org.apache.wicket:" + ( servletPath ) ) + ":" ) + ( Session . SESSION_ATTRIBUTE_NAME ) ; <END_BUG> if ( WicketSessionFilter . log . isDebugEnabled ( ) ) { WicketSessionFilter . log . debug ( ( ( "will<seq2seq4repair_space>use<seq2seq4repair_space>" + ( sessionKey ) ) + "<seq2seq4repair_space>as<seq2seq4repair_space>the<seq2seq4repair_space>session<seq2seq4repair_space>key<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>the<seq2seq4repair_space>Wicket<seq2seq4repair_space>session" ) ) ; } } public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { } public void destroy ( ) { } }

Fix:
sessionKey = ( ( "wicket:" + ( servletPath ) ) + ":" ) + ( Session . SESSION_ATTRIBUTE_NAME ) ;
Buggy code:
public class DeploymentHolderService extends AbstractService < Deployment > { private static final ServiceName SERVICE_NAME_BASE = JBOSS . append ( "osgi" , "deployment" , "holder" ) ; private final Deployment deployment ; private InjectedValue < BundleManager > injectedBundleManager = new InjectedValue < BundleManager > ( ) ; private DeploymentHolderService ( Deployment deployment ) { } public static void addService ( BatchBuilder batchBuilder , String contextName , Deployment dep ) { } public static void removeService ( ServiceContainer container , String contextName ) { } public static Deployment getDeployment ( ServiceRegistry registry , String contextName ) { } public static String getContextName ( Deployment dep ) { } public static ServiceName getServiceName ( String contextName ) { <START_BUG> ServiceName deploymentServiceName = JBOSS_DEPLOYMENT . append ( contextName ) ; <END_BUG> return DeploymentHolderService . SERVICE_NAME_BASE . append ( deploymentServiceName . getSimpleName ( ) ) ; } @ Override public Deployment getValue ( ) throws IllegalStateException { } }

Fix:
ServiceName deploymentServiceName = Services . deploymentUnitName ( contextName ) ;
Buggy code:
public class ParserPartial extends AsyncTask < Void , Integer , Integer > { private CountDownLatch cdl ; private Context app_context ; private OnParseTaskComplete listener ; private ArrayList < String > course_urls ; private SQL_DataSource datasource ; private ProgressDialog pdialog ; private ArrayList < ScheduleParsePackage > spp ; private IOException ex ; private Boolean task_cancelled = false ; private final String WEB_URL = "https:////www.sis.hawaii.edu//uhdad//avail.classes?i=MAN&t=" ; private final String MJR_FIELD = "&s=" ; @ Override protected void onPreExecute ( ) { } public ParserPartial ( SQL_DataSource ds , Context c , OnParseTaskComplete listener , ArrayList < ScheduleParsePackage > spp_data ) { } public boolean getTaskCancelled ( ) { } @ Override protected Integer doInBackground ( Void ... params ) { } @ Override protected void onProgressUpdate ( Integer ... progress ) { } private ExecutorService parseCourseData ( ArrayList < Integer > sem , ArrayList < Integer > yr ) { } @ Override protected void onPostExecute ( Integer result ) { pdialog . dismiss ( ) ; <START_BUG> listener . onParseTaskComplete ( ex ) ; <END_BUG> } public int calculateURLyear ( int year , int sem ) { } public int getURLDigit ( int sem ) { } private String calculateURLField ( int year , int sem ) { } private String produceURL ( int sem , int year , String mjr ) { } }

Fix:
listener . onPartialParseTaskComplete ( ) ;
Buggy code:
public class StudyImporterForThessenIT extends GraphDBTestCase { @ Test public void importSome ( ) throws NodeFactoryException , StudyImporterException { StudyImporterForThessen importer = new StudyImporterForThessen ( new ParserFactoryImpl ( ) , nodeFactory ) ; importer . setFilter ( new ImportFilter ( ) { @ Override public boolean shouldImportRecord ( Long recordNumber ) { <START_BUG> return ( recordNumber % 100 ) == 0 ; <END_BUG> } } ) ; Study study = importer . importStudy ( ) ; Iterable < Relationship > specimens = study . getSpecimens ( ) ; int specimenCount = 0 ; Set < String > taxonIds = new HashSet < String > ( ) ; while ( specimens . iterator ( ) . hasNext ( ) ) { Node sourceSpecimen = specimens . iterator ( ) . next ( ) . getEndNode ( ) ; specimenCount ++ ; Node taxonNode = sourceSpecimen . getSingleRelationship ( CLASSIFIED_AS , OUTGOING ) . getEndNode ( ) ; taxonIds . add ( ( ( String ) ( taxonNode . getProperty ( EXTERNAL_ID ) ) ) ) ; } assertThat ( ( specimenCount > 10 ) , is ( true ) ) ; assertThat ( ( ( taxonIds . size ( ) ) > 1 ) , is ( true ) ) ; assertThat ( study . getCitation ( ) , is ( notNullValue ( ) ) ) ; assertThat ( study . getTitle ( ) , is ( notNullValue ( ) ) ) ; for ( String taxonId : taxonIds ) { TaxonNode taxon = nodeFactory . getTaxonIndex ( ) . findTaxonById ( taxonId ) ; assertThat ( taxon , is ( notNullValue ( ) ) ) ; assertThat ( taxon . getName ( ) , is ( notNullValue ( ) ) ) ; } } }

Fix:
return ( recordNumber % 1000 ) == 0 ;