nus-yam/ex-repair huggingface dataset:
Buggy code:
public class FileManageFragment extends DialogFragment { private String filename = null ; private static String gStoragePath = null ; private String storagePath = null ; private String fileDeleted = null ; private EditText editText = null ; private Button deleteButton = null ; private Button renameButton = null ; private Button closeButton = null ; private Button shareButton = null ; private boolean filenameChanged = false ; private static final String TAG = "FileManageFragment" ; private static final String FILE_PROVIDER = "com.xiong.richard.greyparrot.fileprovider" ; private static boolean noExternalStorage = false ; public static FileManageFragment newInstance ( String filename , String storagePath ) { } public void onCreate ( Bundle savedInstanceState ) { } public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } private void closeSelf ( ) { } public void shareFile ( Activity activity , String filename ) { File file = new File ( filename ) ; if ( FileManageFragment . usePrivateStorage ( activity ) ) { Uri fileUri ; fileUri = FileProvider . getUriForFile ( activity , FileManageFragment . FILE_PROVIDER , file ) ; final Intent shareIntent = IntentBuilder . from ( activity ) . setType ( "*//*" ) . setStream ( fileUri ) . createChooserIntent ( ) . addFlags ( FLAG_GRANT_READ_URI_PERMISSION ) ; startActivity ( shareIntent ) ; } else { Intent shareIntent = new Intent ( ) ; shareIntent . setAction ( ACTION_SEND ) ; <START_BUG> shareIntent . putExtra ( EXTRA_STREAM , Uri . fromFile ( new File ( ( ( ( storagePath ) + '//' ) + filename ) ) ) ) ; <END_BUG> shareIntent . setType ( "*//*" ) ; startActivity ( Intent . createChooser ( shareIntent , "send<seq2seq4repair_space>to" ) ) ; } } public static void playFile ( Context ctx , String filename ) { } public static String getStorageDir ( Context ctxt ) { } private static boolean usePrivateStorage ( Context ctxt ) { } public static void reset ( ) { } }

Fix:
shareIntent . putExtra ( EXTRA_STREAM , Uri . fromFile ( file ) ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { private Calendar currentCalender = Calendar . getInstance ( Locale . getDefault ( ) ) ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; CompactCalendarView compactCalendarView = ( ( CompactCalendarView ) ( findViewById ( compactcalendar_view ) ) ) ; compactCalendarView . drawSmallIndicatorForEvents ( true ) ; addEvents ( compactCalendarView ) ; <START_BUG> String [ ] dayNames = new String [ ] { "Mon" , "Tue" , "Wed" , "Thur" , "Fri" , "Sat" , "Sun" } ; <END_BUG> compactCalendarView . setDayColumnNames ( dayNames ) ; } private void addEvents ( CompactCalendarView compactCalendarView ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
String [ ] dayNames = new String [ ] { "M" , "T" , "W" , "T" , "F" , "S" , "S" } ;
Buggy code:
class FileTypeMobipocket extends FileTypePalm { FileTypeMobipocket ( ) { } @ Override public boolean acceptsFile ( ZLFile file ) { <START_BUG> return ( "mobi" . equals ( file . getExtension ( ) ) ) || ( super . acceptsFile ( file ) ) ; <END_BUG> } @ Override public String extension ( ) { } @ Override public MimeType mimeType ( ) { } }

Fix:
return ( "mobi" . equalsIgnoreCase ( file . getExtension ( ) ) ) || ( super . acceptsFile ( file ) ) ;
Buggy code:
public abstract class AbstractJMSRuntimeHandler < T > extends AbstractRuntimeOnlyHandler { private final Map < AbstractJMSRuntimeHandler . ResourceConfig , T > resources = Collections . synchronizedMap ( new HashMap < AbstractJMSRuntimeHandler . ResourceConfig , T > ( ) ) ; @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } public void registerResource ( final String server , final String name , final T resource ) { } public void unregisterResource ( final String server , final String name ) { } protected abstract void executeReadAttribute ( final String attributeName , final OperationContext context , final T destination , final PathAddress address , final boolean includeDefault ) { } private static IllegalStateException unknownOperation ( String opName ) { } private T getResourceConfig ( final PathAddress operationAddress ) throws OperationFailedException { final String name = operationAddress . getLastElement ( ) . getValue ( ) ; final String server = operationAddress . getElement ( ( ( operationAddress . size ( ) ) - 2 ) ) . getValue ( ) ; T config = resources . get ( new AbstractJMSRuntimeHandler . ResourceConfig ( server , name ) ) ; if ( config == null ) { String exceptionMessage = ROOT_LOGGER . noDestinationRegisteredForAddress ( operationAddress ) ; <START_BUG> throw new OperationFailedException ( new ModelNode ( ) . set ( exceptionMessage ) ) ; <END_BUG> } return config ; } private static final class ResourceConfig { private final String server ; private final String name ; private ResourceConfig ( final String server , final String name ) { } @ Override public boolean equals ( final Object o ) { } @ Override public int hashCode ( ) { } } }

Fix:
throw new OperationFailedException ( exceptionMessage ) ;
Buggy code:
class ArtNode48 extends ArtNode { public static int count ; public ArtNode48 ( ) { } public ArtNode48 ( final ArtNode48 other ) { } public ArtNode48 ( final ArtNode16 other ) { } public ArtNode48 ( final ArtNode256 other ) { } @ Override public Node n_clone ( ) { } @ Override public ChildPtr find_child ( byte c ) { } @ Override public Leaf minimum ( ) { } @ Override public void add_child ( ChildPtr ref , byte c , Node child ) { } @ Override public void remove_child ( ChildPtr ref , byte c ) { } @ Override public void iter ( IterCallback cb ) { } @ Override public boolean exhausted ( int c ) { } @ Override public int nextChildAtOrAfter ( int c ) { } @ Override public Node childAt ( int c ) { <START_BUG> return children [ ( ( keys [ c ] ) - 1 ) ] ; <END_BUG> } @ Override public int decrement_refcount ( ) { } byte [ ] keys = new byte [ 256 ] ; Node [ ] children = new Node [ 48 ] ; }

Fix:
return children [ ( ( to_uint ( keys [ c ] ) ) - 1 ) ] ;
Buggy code:
public class AjaxTabbedPanel extends TabbedPanel { private static final long serialVersionUID = 1L ; public AjaxTabbedPanel ( String id , List < ITab > tabs ) { } @ Override protected WebMarkupContainer newLink ( String linkId , final int index ) { <START_BUG> return new AjaxFallbackLink ( linkId ) { <END_BUG> private static final long serialVersionUID = 1L ; @ Override public void onClick ( AjaxRequestTarget target ) { setSelectedTab ( index ) ; if ( target != null ) { target . addComponent ( AjaxTabbedPanel . this ) ; } onAjaxUpdate ( target ) ; } } ; } protected void onAjaxUpdate ( AjaxRequestTarget target ) { } }

Fix:
return new org . apache . wicket . ajax . markup . html . AjaxFallbackLink < Void > ( linkId ) {
Buggy code:
class DragomeGameView extends GenericAbstractGameView < DragomeGameResource > { private final HTMLCanvasElement canvas ; public DragomeGameView ( GameRuntime aGameRuntime , CameraBehavior aCameraBehavior , GestureDetector aGestureDetector , HTMLCanvasElement aCanvas ) { } private CanvasRenderingContext2D renderingContext2D ; @ Override protected EffectCanvas createEffectCanvas ( ) { } @ Override protected boolean beginFrame ( GameScene aScene ) { renderingContext2D = canvas . getContext ( "2d" ) ; Size theCurrentScreenSize = getCurrentScreenSize ( ) ; renderingContext2D . setFillStyle ( CSSUtils . toColor ( aScene . backgroundColorProperty ( ) . get ( ) ) ) ; <START_BUG> renderingContext2D . clearRect ( 0 , 0 , theCurrentScreenSize . width , theCurrentScreenSize . height ) ; <END_BUG> return true ; } @ Override protected void beforeInstance ( GameObjectInstance aInstance , float aOffsetX , float aOffsetY , Angle aRotation ) { } @ Override protected void drawImage ( GameObjectInstance aInstance , Position aPositionOnScreen , DragomeGameResource aResource , float aPositionX , float aPositionY ) { } @ Override protected void drawText ( GameObjectInstance aInstance , Position aPosition , Font aFont , Color aColor , String aText , Size aSize ) { } @ Override protected void drawRect ( GameObjectInstance aInstance , Position aPositionOnScreen , Color aColor , float aX , float aY , float aWidth , float aHeight ) { } @ Override protected void afterInstance ( GameObjectInstance aInstance , Position aPositionOnScreen ) { } @ Override protected void logError ( String aMessage ) { } @ Override public void setCurrentScreenSize ( Size aCurrentScreenSize ) { } No newline ; at end ; of file ; }

Fix:
renderingContext2D . fillRect ( 0 , 0 , theCurrentScreenSize . width , theCurrentScreenSize . height ) ;
Buggy code:
public class OSGiRuntimeResource implements Resource { private final InjectedValue < BundleManager > injectedBundleManager ; private final Resource delegate ; public OSGiRuntimeResource ( ) { } private OSGiRuntimeResource ( Resource resource , InjectedValue < BundleManager > injectedBundleManager ) { } public InjectedValue < BundleManager > getInjectedBundleManager ( ) { } @ Override public ModelNode getModel ( ) { } @ Override public void writeModel ( ModelNode newModel ) { } @ 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 ( ) { } private boolean hasBundle ( PathElement element ) { } private Set < String > getBundleIDs ( ) { } private BundleContext getBundleContext ( ) { BundleManager bundleManager = injectedBundleManager . getOptionalValue ( ) ; BundleContext context = ( bundleManager != null ) ? bundleManager . getSystemBundle ( ) . getBundleContext ( ) : null ; if ( context == null ) { <START_BUG> OSGiLogger . LOGGER . warnBundleContextNotAvailable ( ) ; <END_BUG> } return context ; } }

Fix:
OSGiLogger . LOGGER . debugf ( "BundleContext<seq2seq4repair_space>not<seq2seq4repair_space>available<seq2seq4repair_space>for<seq2seq4repair_space>management<seq2seq4repair_space>operation" ) ;
Buggy code:
public class FieldDeclarationPattern extends SearchPattern { protected char [ ] name ; protected char [ ] declaringQualification ; protected char [ ] declaringSimpleName ; protected char [ ] typeQualification ; protected char [ ] typeSimpleName ; protected char [ ] decodedName ; public FieldDeclarationPattern ( char [ ] name , int matchMode , boolean isCaseSensitive , char [ ] declaringQualification , char [ ] declaringSimpleName , char [ ] typeQualification , char [ ] typeSimpleName ) { } public void decodeIndexEntry ( IEntryResult entryResult ) { } public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { } public char [ ] indexEntryPrefix ( ) { } protected int matchContainer ( ) { } public boolean matchesBinary ( Object binaryInfo , Object enclosingBinaryInfo ) { } protected boolean matchIndexEntry ( ) { } private boolean needsResolve ( ) { } public String toString ( ) { } public int matchLevel ( AstNode node , boolean resolve ) { if ( ! ( node instanceof FieldDeclaration ) ) return IMPOSSIBLE_MATCH ; FieldDeclaration field = ( ( FieldDeclaration ) ( node ) ) ; if ( resolve ) { return this . matchLevel ( field . binding ) ; } else { if ( ! ( field . isField ( ) ) ) return IMPOSSIBLE_MATCH ; if ( ! ( this . matchesName ( this . name , field . name ) ) ) return IMPOSSIBLE_MATCH ; TypeReference fieldType = field . type ; char [ ] [ ] fieldTypeName = fieldType . getTypeName ( ) ; char [ ] sourceName = this . toArrayName ( fieldTypeName [ ( ( fieldTypeName . length ) - 1 ) ] , fieldType . dimensions ( ) ) ; if ( ! ( this . matchesName ( this . typeSimpleName , sourceName ) ) ) return IMPOSSIBLE_MATCH ; <START_BUG> return POSSIBLE_MATCH ; <END_BUG> } } public int matchLevel ( Binding binding ) { } }

Fix:
return this . needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ;
Buggy code:
public class TableView extends TreeTable { protected HeaderTableModel headerTableModel ; private int selectedRow = 0 ; private int update = 0 ; private String column ; private List tableModelPlugins ; protected HeaderList headerList ; public TableView ( HeaderTableModel headerTableModel ) { } public void enableThreadedView ( boolean b ) { } protected void adjustColumn ( ) { } protected void initRenderer ( ) throws Exception { TableItem tableItem = ( ( TableItem ) ( MailConfig . getMainFrameOptionsConfig ( ) . getTableItem ( ) ) ) ; TableRendererPluginHandler handler = null ; try { handler = ( ( TableRendererPluginHandler ) ( pluginManager . getHandler ( "org.columba.mail.tablerenderer" ) ) ) ; } catch ( PluginHandlerNotFoundException ex ) { ex . printStackTrace ( ) ; } for ( int i = 0 ; i < ( tableItem . count ( ) ) ; i ++ ) { HeaderItem v = tableItem . getHeaderItem ( i ) ; boolean enabled = v . getBoolean ( "enabled" ) ; if ( enabled == false ) continue ; String name = v . get ( "name" ) ; int size = v . getInteger ( "size" ) ; int position = v . getInteger ( "position" ) ; DefaultLabelRenderer r = null ; if ( handler . exists ( name ) ) r = ( ( DefaultLabelRenderer ) ( handler . getPlugin ( name , null ) ) ) ; if ( r == null ) { r = new BasicRenderer ( name ) ; registerRenderer ( name , r , new BasicHeaderRenderer ( ) , size , false , position ) ; } else { String image = handler . getAttribute ( name , "icon" ) ; String fixed = handler . getAttribute ( name , "size" ) ; boolean lockSize = false ; if ( fixed != null ) { if ( fixed . equals ( "fixed" ) ) { size = 23 ; lockSize = true ; } } <START_BUG> if ( lockSize == true ) { <END_BUG> registerRenderer ( name , r , new org . columba . mail . gui . table . plugins . BooleanHeaderRenderer ( ImageLoader . getSmallImageIcon ( image ) ) , size , lockSize , position ) ; } else { registerRenderer ( name , r , new BasicHeaderRenderer ( ) , size , lockSize , position ) ; } } } } public void registerRenderer ( String name , DefaultLabelRenderer cell , TableCellRenderer header , int size , boolean lockSize , int position ) { } public MessageNode getSelectedNode ( ) { } public MessageNode [ ] getSelectedNodes ( ) { } public MessageNode getMessagNode ( Object uid ) { } public Object selectFirstRow ( ) { } public Object selectLastRow ( ) { } public void selectRow ( int row ) { } }

Fix:
if ( lockSize ) {
Buggy code:
final class PropertyRemove extends AbstractRemoveStepHandler { static final PropertyRemove INSTANCE = new PropertyRemove ( ) ; private PropertyRemove ( ) { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { final ServerConfig config = PackageUtils . getServerConfig ( context ) ; if ( config != null ) { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String propertyName = address . getElement ( ( ( address . size ( ) ) - 1 ) ) . getValue ( ) ; PathElement confElem = address . getElement ( ( ( address . size ( ) ) - 2 ) ) ; final String configType = confElem . getKey ( ) ; final String configName = confElem . getValue ( ) ; for ( final CommonConfig commonConfig : PackageUtils . getConfigs ( config , configType ) ) { if ( configName . equals ( commonConfig . getConfigName ( ) ) ) { if ( commonConfig . getProperties ( ) . containsKey ( propertyName ) ) { commonConfig . getProperties ( ) . remove ( propertyName ) ; <START_BUG> context . restartRequired ( ) ; <END_BUG> } return ; } } throw WSMessages . MESSAGES . missingConfig ( configName ) ; } } @ Override protected void recoverServices ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { } }

Fix:
context . reloadRequired ( ) ;
Buggy code:
public final class RadioButtonsTagTests extends AbstractFormTagTests { private RadioButtonsTag tag ; private TestBean bean ; @ Override @ SuppressWarnings ( "serial" ) protected void onSetUp ( ) { } public void testWithMultiValueArray ( ) throws Exception { } public void testWithMultiValueArrayAndDynamicAttributes ( ) throws Exception { } public void testWithMultiValueArrayWithDelimiter ( ) throws Exception { } public void testWithMultiValueMap ( ) throws Exception { } public void testWithMultiValueMapWithDelimiter ( ) throws Exception { } public void testWithMultiValueWithEditor ( ) throws Exception { } public void testCollectionOfPets ( ) throws Exception { } public void testCollectionOfPetsWithEditor ( ) throws Exception { } public void testWithoutItemsEnumBindTarget ( ) throws Exception { } public void testWithoutItemsEnumBindTargetWithExplicitLabelsAndValues ( ) throws Exception { } public void testWithNullValue ( ) throws Exception { } public void testHiddenElementOmittedOnDisabled ( ) throws Exception { this . tag . setPath ( "stringArray" ) ; this . tag . setItems ( new Object [ ] { "foo" , "bar" , "baz" } ) ; <START_BUG> this . tag . setDisabled ( "true" ) ; <END_BUG> int result = this . tag . doStartTag ( ) ; assertEquals ( SKIP_BODY , result ) ; String output = getOutput ( ) ; output = ( "<doc>" + output ) + "<//doc>" ; SAXReader reader = new SAXReader ( ) ; Document document = reader . read ( new StringReader ( output ) ) ; Element rootElement = document . getRootElement ( ) ; assertEquals ( "Both<seq2seq4repair_space>tag<seq2seq4repair_space>and<seq2seq4repair_space>hidden<seq2seq4repair_space>element<seq2seq4repair_space>rendered<seq2seq4repair_space>incorrectly" , 3 , rootElement . elements ( ) . size ( ) ) ; Element spanElement = ( ( Element ) ( document . getRootElement ( ) . elements ( ) . get ( 0 ) ) ) ; Element radioButtonElement = ( ( Element ) ( spanElement . elements ( ) . get ( 0 ) ) ) ; assertEquals ( "input" , radioButtonElement . getName ( ) ) ; assertEquals ( "radio" , radioButtonElement . attribute ( "type" ) . getValue ( ) ) ; assertEquals ( "stringArray" , radioButtonElement . attribute ( "name" ) . getValue ( ) ) ; assertEquals ( "checked" , radioButtonElement . attribute ( "checked" ) . getValue ( ) ) ; assertEquals ( "disabled" , radioButtonElement . attribute ( "disabled" ) . getValue ( ) ) ; assertEquals ( "foo" , radioButtonElement . attribute ( "value" ) . getValue ( ) ) ; } public void testSpanElementCustomizable ( ) throws Exception { } public void testDynamicTypeAttribute ( ) throws JspException { } private Date getDate ( ) { } @ Override protected TestBean createTestBean ( ) { } private static class MyStringTrimmerEditor extends StringTrimmerEditor { public final Set allProcessedValues = new HashSet ( ) ; public MyStringTrimmerEditor ( ) { } @ Override public void setAsText ( String text ) { } } }

Fix:
this . tag . setDisabled ( true ) ;
Buggy code:
public class ServiceProviderRegistrationFactoryServiceInstaller implements CacheServiceInstaller { private final Logger logger = Logger . getLogger ( this . getClass ( ) ) ; private final CacheServiceBuilder < ServiceProviderRegistrationFactory > builder ; protected ServiceProviderRegistrationFactoryServiceInstaller ( CacheServiceBuilder < ServiceProviderRegistrationFactory > builder ) { } private static BindInfo createBinding ( String container , String cache ) { } @ Override public Collection < ServiceName > getServiceNames ( String container , String cache ) { } @ Override public void install ( ServiceTarget target , String container , String cache ) { ServiceName name = SERVICE_PROVIDER_REGISTRATION . getServiceName ( container , cache ) ; ContextNames . BindInfo bindInfo = ServiceProviderRegistrationFactoryServiceInstaller . createBinding ( container , cache ) ; this . logger . debugf ( "Installing<seq2seq4repair_space>%s<seq2seq4repair_space>service,<seq2seq4repair_space>bound<seq2seq4repair_space>to<seq2seq4repair_space>" , name . getCanonicalName ( ) , bindInfo . getAbsoluteJndiName ( ) ) ; this . builder . build ( target , name , container , cache ) . setInitialMode ( ServiceController . Mode . ON_DEMAND ) . install ( ) ; <START_BUG> new org . jboss . as . clustering . naming . BinderServiceBuilder ( target ) . build ( bindInfo , name , ServiceProviderRegistrationFactory . class ) . install ( ) ; <END_BUG> } }

Fix:
new org . jboss . as . clustering . naming . BinderServiceBuilder ( bindInfo , name , ServiceProviderRegistrationFactory . class ) . build ( target ) . install ( ) ;
Buggy code:
public class DefaultExecManager implements ExecManager { private final ProcessDestroyer m_processDestroyer = new ProcessDestroyer ( ) ; private final CommandLauncher m_launcher ; private final CommandLauncher m_shellLauncher ; private final Environment m_environment ; public DefaultExecManager ( final File homeDir ) throws ExecException { } public Properties getNativeEnvironment ( ) throws ExecException { } public int execute ( final ExecMetaData execMetaData , final ExecOutputHandler handler , long timeout ) throws IOException , ExecException { } public int execute ( final ExecMetaData command , final InputStream input , final OutputStream output , final OutputStream error , final long timeout ) throws IOException , ExecException { final CommandLauncher launcher = getLauncher ( command ) ; final Process process = launcher . exec ( command ) ; <START_BUG> final ProcessMonitor monitor = new ProcessMonitor ( process , input , output , error , timeout ) ; <END_BUG> final Thread thread = new Thread ( monitor , "ProcessMonitor" ) ; thread . start ( ) ; m_processDestroyer . add ( process ) ; waitFor ( process ) ; try { thread . join ( ) ; } catch ( InterruptedException e ) { } m_processDestroyer . remove ( process ) ; if ( monitor . didProcessTimeout ( ) ) { throw new ExecException ( "Process<seq2seq4repair_space>Timed<seq2seq4repair_space>out" ) ; } return process . exitValue ( ) ; } private void waitFor ( final Process process ) { } private CommandLauncher getLauncher ( final ExecMetaData metaData ) { } private CommandLauncher createShellLauncher ( final File homeDir ) throws ExecException { } private String resolveCommand ( final File antDir , final String command ) { } }

Fix:
final ProcessMonitor monitor = new ProcessMonitor ( process , input , output , error , timeout , false ) ;
Buggy code:
public class CQCUtilitiesTest { CQIE initialquery1 = null ; OBDADataFactory pfac = OBDADataFactoryImpl . getInstance ( ) ; OBDADataFactory tfac = OBDADataFactoryImpl . getInstance ( ) ; Predicate r = pfac . getPredicate ( "R" , new COL_TYPE [ ] { COL_TYPE . OBJECT , COL_TYPE . OBJECT } ) ; Predicate s = pfac . getPredicate ( "S" , new COL_TYPE [ ] { COL_TYPE . OBJECT , COL_TYPE . OBJECT , COL_TYPE . OBJECT } ) ; Predicate q = pfac . getPredicate ( "q" , new COL_TYPE [ ] { COL_TYPE . OBJECT , COL_TYPE . OBJECT , COL_TYPE . OBJECT , COL_TYPE . OBJECT , COL_TYPE . OBJECT } ) ; Term x = tfac . getVariable ( "x" ) ; Term y = tfac . getVariable ( "y" ) ; Term c1 = tfac . getConstantURI ( "URI1" ) ; Term c2 = tfac . getConstantLiteral ( "m" ) ; @ Before public void setUp ( ) throws Exception { } @ Test public void testContainment1 ( ) { } @ Test public void testSyntacticContainmentCheck ( ) { } @ Test public void testRemovalOfSyntacticContainmentCheck ( ) { } @ Test public void testSemanticContainment ( ) { } @ Test public void testFacts ( ) { OntologyFactory dfac = OntologyFactoryImpl . getInstance ( ) ; Ontology sigma = dfac . createOntology ( ) ; OClass left = sigma . getVocabulary ( ) . createClass ( "A" ) ; ObjectPropertyExpression pleft = sigma . getVocabulary ( ) . createObjectProperty ( "R" ) ; ObjectSomeValuesFrom right = pleft . getDomain ( ) ; sigma . addSubClassOfAxiom ( left , right ) ; List < Term > headTerms = new LinkedList < Term > ( ) ; headTerms . add ( x ) ; <START_BUG> Function head = tfac . getFunction ( pfac . getPredicate ( "q" , new COL_TYPE [ ] { COL_TYPE . OBJECT , COL_TYPE . OBJECT } ) , headTerms ) ; <END_BUG> List < Function > body = new LinkedList < Function > ( ) ; List < Term > terms = new LinkedList < Term > ( ) ; terms . add ( tfac . getVariable ( "x" ) ) ; terms . add ( tfac . getVariable ( "y" ) ) ; body . add ( tfac . getFunction ( pfac . getObjectPropertyPredicate ( "R" ) , terms ) ) ; terms = new LinkedList < Term > ( ) ; terms . add ( tfac . getVariable ( "x" ) ) ; body . add ( tfac . getFunction ( pfac . getClassPredicate ( "A" ) , terms ) ) ; CQIE query1 = tfac . getCQIE ( head , body ) ; headTerms = new LinkedList < Term > ( ) ; headTerms . add ( tfac . getVariable ( "x" ) ) ; head = tfac . getFunction ( pfac . getPredicate ( "q" , new COL_TYPE [ ] { COL_TYPE . OBJECT } ) , headTerms ) ; body = new LinkedList < Function > ( ) ; CQIE query2 = tfac . getCQIE ( head , body ) ; LinearInclusionDependencies dep = LinearInclusionDependencies . getABoxDependencies ( new org . semanticweb . ontop . owlrefplatform . core . dagjgrapht . TBoxReasonerImpl ( sigma ) , false ) ; CQContainmentCheckUnderLIDs cqc = new CQContainmentCheckUnderLIDs ( dep ) ; assertTrue ( cqc . isContainedIn ( query1 , query2 ) ) ; assertFalse ( cqc . isContainedIn ( query2 , query1 ) ) ; assertTrue ( SYNTACTIC_CHECK . isContainedIn ( query1 , query2 ) ) ; assertFalse ( SYNTACTIC_CHECK . isContainedIn ( query2 , query1 ) ) ; } }

Fix:
Function head = tfac . getFunction ( pfac . getPredicate ( "q" , new COL_TYPE [ ] { COL_TYPE . OBJECT } ) , headTerms ) ;
Buggy code:
final class ArrayToObjectGenericConverter implements GenericConverter { private final GenericConversionService conversionService ; public ArrayToObjectGenericConverter ( GenericConversionService conversionService ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { int length = Array . getLength ( source ) ; if ( length == 0 ) { return null ; } else { TypeDescriptor sourceElementType = sourceType . getElementTypeDescriptor ( ) ; if ( sourceElementType . isAssignableTo ( targetType ) ) { return Array . get ( source , 0 ) ; } else { GenericConverter converter = this . conversionService . getConverter ( sourceElementType , targetType ) ; if ( converter == null ) { <START_BUG> throw new org . springframework . core . convert . ConverterNotFoundException ( sourceType , targetType ) ; <END_BUG> } return converter . convert ( Array . get ( source , 0 ) , sourceElementType , targetType ) ; } } } }

Fix:
throw new org . springframework . core . convert . ConverterNotFoundException ( sourceElementType , targetType ) ;
Buggy code:
public class TestWindow { private static GLFWErrorCallback errorCallback = Callbacks . errorCallbackPrint ( System . err ) ; private static long window ; private static Matrix4f camera ; private Vector3f light ; private float angle = 35.2F ; private float speed = 0.01F ; private GLFWKeyCallback keyCallback = new GLFWKeyCallback ( ) { @ Override public void invoke ( long window , int key , int scancode , int action , int mods ) { } } ; public TestWindow ( ) { } private List < Asset > createScene ( ) { List < Asset > scene = new ArrayList < Asset > ( ) ; Model david = AssetLoader . instance ( ) . loadOBJ ( "res//sculpture_david.obj" ) ; if ( david != null ) { scene . add ( david ) ; } else { System . out . println ( "David<seq2seq4repair_space>not<seq2seq4repair_space>loaded" ) ; } Model floor = AssetLoader . instance ( ) . loadOBJ ( "res//floor.obj" ) ; if ( floor != null ) { scene . add ( floor ) ; } <START_BUG> Sprite player = AssetLoader . instance ( ) . loadSpritesheet ( "res//Red_Player.png" , 32 ) ; <END_BUG> if ( player != null ) { scene . add ( player ) ; } return scene ; } public static void main ( String [ ] args ) { } }

Fix:
Sprite player = AssetLoader . instance ( ) . loadSpritesheet ( "res//red_player.png" , 32 ) ;
Buggy code:
public class SQLExecTest extends TestCase { public static final int NULL = 0 ; public static final int ORACLE = 1 ; public static final int MYSQL = 2 ; public static final String DRIVER = "driver" ; public static final String USER = "user" ; public static final String PASSWORD = "password" ; public static final String URL = "url" ; public static final String PATH = "path" ; public static final String SQL = "sql" ; public SQLExecTest ( String s ) { } protected void setUp ( ) throws Exception { } public void testDriverCaching ( ) { } public void testNull ( ) throws Exception { } protected void doMultipleCalls ( int calls , int database , boolean caching , boolean catchexception ) { } protected SQLExec createTask ( Properties props ) { } protected String findResourcePath ( String resource ) { } protected Properties getProperties ( int database ) { Properties props = null ; switch ( database ) { case SQLExecTest . ORACLE : props = getProperties ( "oracle.jdbc.driver.OracleDriver" , "test" , "test" , "jdbc:oracle:thin:@127.0.0.1:1521:orcl" ) ; break ; case SQLExecTest . MYSQL : <START_BUG> props = getProperties ( "org.gjt.mm.mysql.Driver" , "sbailliez" , "apollo" , "jdbc:mysql:////127.0.0.1:3306//test" ) ; <END_BUG> break ; case SQLExecTest . NULL : default : props = getProperties ( SQLExecTest . NULL_DRIVER , "test" , "test" , "jdbc:database:////hostname:port//name" ) ; } String path = findResourcePath ( props . getProperty ( SQLExecTest . DRIVER ) ) ; props . put ( SQLExecTest . PATH , path ) ; props . put ( SQLExecTest . SQL , "create<seq2seq4repair_space>table<seq2seq4repair_space>OOME_TEST(X<seq2seq4repair_space>INTEGER<seq2seq4repair_space>NOT<seq2seq4repair_space>NULL);\ndrop<seq2seq4repair_space>table<seq2seq4repair_space>if<seq2seq4repair_space>exists<seq2seq4repair_space>OOME_TEST;" ) ; return props ; } protected Properties getProperties ( String driver , String user , String pwd , String url ) { } public static final String NULL_DRIVER = SQLExecTest . NullDriver . class . getName ( ) ; public static class NullDriver implements Driver { public Connection connect ( String url , Properties info ) throws SQLException { } public boolean acceptsURL ( String url ) throws SQLException { } public DriverPropertyInfo [ ] getPropertyInfo ( String url , Properties info ) throws SQLException { } public int getMajorVersion ( ) { } public int getMinorVersion ( ) { } public boolean jdbcCompliant ( ) { } } }

Fix:
props = getProperties ( "org.gjt.mm.mysql.Driver" , "test" , "test" , "jdbc:mysql:////127.0.0.1:3306//test" ) ;
Buggy code:
public class JsonTaskConverter { private DsHandler dsHandler = new DsHandler ( ) ; public long addTask ( JSONObject jTask , String googleUserId ) { } public void updateTask ( JSONObject jTask , String googleUserId ) { try { Date dueDate = new SimpleDateFormat ( "mm//dd//yyyy" ) . parse ( jTask . getString ( "dueDate" ) ) ; Date creationDate = new Date ( jTask . getLong ( "creationDate" ) ) ; <START_BUG> Task task = new Task ( jTask . getString ( "name" ) , jTask . getString ( "description" ) , jTask . getLong ( "category" ) , creationDate , dueDate , googleUserId ) ; <END_BUG> dsHandler . updateTask ( task ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } public Task getTaskById ( long taskId ) { } }

Fix:
Task task = new Task ( jTask . getLong ( "id" ) , jTask . getString ( "name" ) , jTask . getString ( "description" ) , jTask . getLong ( "category" ) , creationDate , dueDate , googleUserId ) ;
Buggy code:
public class BeanShellClient { private static final int MINARGS = 3 ; public static void main ( String [ ] args ) throws Exception { if ( ( args . length ) < ( BeanShellClient . MINARGS ) ) { System . out . println ( ( ( "Please<seq2seq4repair_space>provide<seq2seq4repair_space>" + ( BeanShellClient . MINARGS ) ) + "<seq2seq4repair_space>or<seq2seq4repair_space>more<seq2seq4repair_space>arguments:" ) ) ; System . out . println ( "serverhost<seq2seq4repair_space>serverport<seq2seq4repair_space>filename<seq2seq4repair_space>[arg1<seq2seq4repair_space>arg2<seq2seq4repair_space>...]" ) ; System . out . println ( "e.g.<seq2seq4repair_space>" ) ; System . out . println ( "localhost<seq2seq4repair_space>9000<seq2seq4repair_space>extras//remote.bsh<seq2seq4repair_space>apple<seq2seq4repair_space>blake<seq2seq4repair_space>7" ) ; <START_BUG> System . exit ( 1 ) ; <END_BUG> } String host = args [ 0 ] ; String portString = args [ 1 ] ; String file = args [ 2 ] ; int port = ( Integer . parseInt ( portString ) ) + 1 ; System . out . println ( ( ( ( "Connecting<seq2seq4repair_space>to<seq2seq4repair_space>BSH<seq2seq4repair_space>server<seq2seq4repair_space>on<seq2seq4repair_space>" + host ) + ":" ) + portString ) ) ; Socket sock = new Socket ( host , port ) ; InputStream is = sock . getInputStream ( ) ; OutputStream os = sock . getOutputStream ( ) ; InputStreamReader fis = new FileReader ( file ) ; new BeanShellClient . SockRead ( is ) . start ( ) ; BeanShellClient . sendLine ( "bsh.prompt=\"\";" , os ) ; BeanShellClient . sendLine ( "String<seq2seq4repair_space>[]<seq2seq4repair_space>args={" , os ) ; for ( int i = BeanShellClient . MINARGS ; i < ( args . length ) ; i ++ ) { BeanShellClient . sendLine ( ( ( "\"" + ( args [ i ] ) ) + "\",\n" ) , os ) ; } BeanShellClient . sendLine ( "};" , os ) ; int b ; while ( ( b = fis . read ( ) ) != ( - 1 ) ) { os . write ( b ) ; } BeanShellClient . sendLine ( "bsh.prompt=\"bsh<seq2seq4repair_space>%<seq2seq4repair_space>\";" , os ) ; os . flush ( ) ; sock . shutdownOutput ( ) ; } private static void sendLine ( String line , OutputStream outPipe ) throws IOException { } private static class SockRead extends Thread { private final InputStream is ; public SockRead ( InputStream _is ) { } @ Override public void run ( ) { } } }

Fix:
return ;
Buggy code:
public interface EvaluationContext { <START_BUG> Object getRootObject ( ) ; <END_BUG> void setVariable ( String name , Object value ) { } Object lookupVariable ( String name ) { } List < ConstructorResolver > getConstructorResolvers ( ) { } List < MethodResolver > getMethodResolvers ( ) { } List < PropertyAccessor > getPropertyAccessors ( ) { } TypeLocator getTypeLocator ( ) { } TypeComparator getTypeComparator ( ) { } TypeConverter getTypeConverter ( ) { } OperatorOverloader getOperatorOverloader ( ) { } }

Fix:
TypedValue getRootObject ( ) ;
Buggy code:
public class HelpUserTool implements UserTool , ComponentEventListener { private WindowControl wControl ; public HelpUserTool ( WindowControl wControl ) { } @ Override public Component getMenuComponent ( UserRequest ureq , VelocityContainer container ) { Link helpLink = LinkFactory . createLink ( "topnav.help" , container , this ) ; helpLink . setIconLeftCSS ( "o_icon<seq2seq4repair_space>o_icon_help<seq2seq4repair_space>o_icon-lg" ) ; helpLink . setTooltip ( "topnav.help.alt" ) ; <START_BUG> helpLink . setTarget ( "_oohelp" ) ; <END_BUG> return helpLink ; } @ Override public void dispatchEvent ( UserRequest ureq , Component source , Event event ) { } @ Override public void dispose ( ) { } No newline ; at end ; of file ; }

Fix:
helpLink . setTarget ( "oohelp" ) ;
Buggy code:
@ Configuration @ ConditionalOnClass ( BitronixContext . class ) @ ConditionalOnMissingBean ( PlatformTransactionManager . class ) class BitronixJtaConfiguration { @ Autowired private JtaProperties jtaProperties ; @ Bean @ ConditionalOnMissingBean @ ConfigurationProperties ( prefix = JtaProperties . PREFIX ) <START_BUG> public Configuration bitronixConfiguration ( JtaProperties xxx ) { <END_BUG> bitronix . tm . Configuration config = TransactionManagerServices . getConfiguration ( ) ; config . setServerId ( "spring-boot-jta-bitronix" ) ; File logBaseDir = getLogBaseDir ( ) ; config . setLogPart1Filename ( new File ( logBaseDir , "part1.btm" ) . getAbsolutePath ( ) ) ; config . setLogPart2Filename ( new File ( logBaseDir , "part2.btm" ) . getAbsolutePath ( ) ) ; config . setDisableJmx ( true ) ; return config ; } private File getLogBaseDir ( ) { } @ Bean @ ConditionalOnMissingBean public TransactionManager bitronixTransactionManager ( bitronix . tm . Configuration configuration ) { } @ Bean @ ConditionalOnMissingBean public XADataSourceWrapper xaDataSourceWrapper ( ) { } @ Bean @ ConditionalOnMissingBean public XAConnectionFactoryWrapper xaConnectionFactoryWrapper ( ) { } @ Bean @ ConditionalOnMissingBean public static BitronixDependentBeanFactoryPostProcessor atomikosDependsOnBeanFactoryPostProcessor ( ) { } @ Bean public JtaTransactionManager transactionManager ( TransactionManager transactionManager ) { } }

Fix:
public Configuration bitronixConfiguration ( ) {
Buggy code:
public abstract class Border extends WebMarkupContainerWithAssociatedMarkup implements IComponentResolver { private static final long serialVersionUID = 1L ; static final String BODY = "body" ; static final String BORDER = "border" ; private boolean transparentResolver = false ; private static final String BODY_ID = "_body" ; private Border . BorderBodyContainer body ; private transient MarkupStream originalMarkupStream ; private transient ComponentTag openTag ; private int beginOfBodyIndex ; public Border ( final String id ) { } public Border ( final String id , final IModel < ? > model ) { } public final Border . BorderBodyContainer getBodyContainer ( ) { } @ Deprecated public Border setBorderBodyVisible ( boolean bodyVisible ) { } public final Border setTransparentResolver ( final boolean enable ) { } @ Override public boolean isTransparentResolver ( ) { } public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { MarkupContainer border = container . getParent ( ) ; while ( ( border != null ) && ( ! ( border instanceof Border ) ) ) { border = border . getParent ( ) ; } if ( ( border == null ) || ( ( this ) == border ) ) { return false ; } if ( ! ( border instanceof Border ) ) { return false ; } if ( ! ( tag instanceof WicketTag ) ) { return false ; } final WicketTag wtag = ( ( WicketTag ) ( tag ) ) ; if ( ! ( wtag . isBodyTag ( ) ) ) { return false ; } body . render ( markupStream ) ; return true ; } @ Override protected void onComponentTag ( final ComponentTag tag ) { } @ Override protected final void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } @ Override public void renderHead ( HtmlHeaderContainer container ) { } public class BorderBodyContainer extends WebMarkupContainer implements IComponentResolver { private static final long serialVersionUID = 1L ; private transient boolean wasOpenCloseTag = false ; public BorderBodyContainer ( final String id ) { } @ Override protected void onComponentTag ( final ComponentTag tag ) { } @ Override protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { String id = tag . getId ( ) ; if ( ! ( id . equals ( Border . BODY_ID ) ) ) { <START_BUG> Component component = get ( id ) ; <END_BUG> if ( component != null ) { component . render ( markupStream ) ; return true ; } } return false ; } } }

Fix:
Component component = Border . this . get ( id ) ;
Buggy code:
public class NSPrintInfo extends NSObject { public NSPrintInfo ( ) { } public NSPrintInfo ( int id ) { } public int PMPageFormat ( ) { } public int PMPrintSession ( ) { } public int PMPrintSettings ( ) { } public float bottomMargin ( ) { } public static NSPrinter defaultPrinter ( ) { } public NSMutableDictionary dictionary ( ) { } public int horizontalPagination ( ) { } public NSRect imageablePageBounds ( ) { } public id initWithDictionary ( NSDictionary attributes ) { } public boolean isHorizontallyCentered ( ) { } public boolean isVerticallyCentered ( ) { } public NSString jobDisposition ( ) { } public float leftMargin ( ) { } public NSString localizedPaperName ( ) { } public int orientation ( ) { } public NSString paperName ( ) { } public NSSize paperSize ( ) { NSSize result = new NSSize ( ) ; <START_BUG> OS . objc_msgSend_struct ( result , this . id , sel_paperSize ) ; <END_BUG> return result ; } public NSMutableDictionary printSettings ( ) { } public NSPrinter printer ( ) { } public float rightMargin ( ) { } public void setBottomMargin ( float margin ) { } public static void setDefaultPrinter ( NSPrinter printer ) { } public void setHorizontalPagination ( int mode ) { } public void setHorizontallyCentered ( boolean flag ) { } public void setJobDisposition ( NSString disposition ) { } public void setLeftMargin ( float margin ) { } public void setOrientation ( int orientation ) { } public void setPaperName ( NSString name ) { } public void setPaperSize ( NSSize size ) { } public void setPrinter ( NSPrinter printer ) { } public void setRightMargin ( float margin ) { } public static void setSharedPrintInfo ( NSPrintInfo printInfo ) { } public void setTopMargin ( float margin ) { } public void setUpPrintOperationDefaultValues ( ) { } public void setVerticalPagination ( int mode ) { } public void setVerticallyCentered ( boolean flag ) { } public static NSPrintInfo sharedPrintInfo ( ) { } public static NSSize sizeForPaperName ( NSString name ) { } public float topMargin ( ) { } public void updateFromPMPageFormat ( ) { } public void updateFromPMPrintSettings ( ) { } public int verticalPagination ( ) { } }

Fix:
OS . objc_msgSend_stret ( result , this . id , sel_paperSize ) ;
Buggy code:
public abstract class SignInPanel extends Panel { private boolean includeRememberMe = true ; private PasswordTextField password ; private boolean rememberMe = true ; private TextField username ; public final class SignInForm extends Form { private final ValueMap properties = new ValueMap ( ) ; public SignInForm ( final String id ) { } public final void onSubmit ( ) { if ( signIn ( getUsername ( ) , getPassword ( ) ) ) { if ( ! ( getPage ( ) . continueToOriginalDestination ( ) ) ) { <START_BUG> setResponsePage ( getApplicationSettings ( ) . getDefaultPageFactory ( ) . newPage ( getApplicationPages ( ) . getHomePage ( ) , ( ( PageParameters ) ( null ) ) ) ) ; <END_BUG> } } else { final String errmsg = getLocalizer ( ) . getString ( "loginError" , this , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>sign<seq2seq4repair_space>you<seq2seq4repair_space>in" ) ; error ( errmsg ) ; } } } public SignInPanel ( final String id ) { } public SignInPanel ( final String id , final boolean includeRememberMe ) { } public final void forgetMe ( ) { } public String getPassword ( ) { } public boolean getRememberMe ( ) { } public String getUsername ( ) { } public void setPersistent ( boolean enable ) { } public void setRememberMe ( boolean rememberMe ) { } public abstract boolean signIn ( final String username , final String password ) { } }

Fix:
setResponsePage ( getApplicationSettings ( ) . getPageFactory ( ) . newPage ( getApplicationPages ( ) . getHomePage ( ) , ( ( PageParameters ) ( null ) ) ) ) ;
Buggy code:
public class Connect4Tournament { public static void main ( String [ ] args ) { <START_BUG> int games = 10000 ; <END_BUG> Color [ ] [ ] [ ] test = new Color [ games ] [ 6 ] [ 7 ] ; for ( int i = 0 ; i < games ; i ++ ) { for ( int j = 0 ; j < ( test [ 0 ] . length ) ; j ++ ) { for ( int k = 0 ; k < ( test [ 0 ] [ 0 ] . length ) ; k ++ ) { test [ i ] [ j ] [ k ] = Color . WHITE ; } } } Connect4Moderator [ ] mods = new Connect4Moderator [ games ] ; for ( int i = 0 ; i < games ; i ++ ) { mods [ i ] = new Connect4Moderator ( test [ i ] , 0 ) ; } Color [ ] winners = new Color [ games ] ; for ( int i = 0 ; i < games ; i ++ ) { winners [ i ] = mods [ i ] . playGame ( ) ; } double xWins = 0 ; double oWins = 0 ; double draws = 0 ; for ( int i = 0 ; i < games ; i ++ ) { if ( winners [ i ] . equals ( Color . RED ) ) xWins ++ ; if ( winners [ i ] . equals ( Color . YELLOW ) ) oWins ++ ; if ( winners [ i ] . equals ( Color . WHITE ) ) draws ++ ; } System . out . println ( ( ( ( ( "<seq2seq4repair_space>X:<seq2seq4repair_space>" + xWins ) + ",<seq2seq4repair_space>" ) + ( ( xWins // games ) * 100 ) ) + "%" ) ) ; System . out . println ( ( ( ( ( "<seq2seq4repair_space>O:<seq2seq4repair_space>" + oWins ) + ",<seq2seq4repair_space>" ) + ( ( oWins // games ) * 100 ) ) + "%" ) ) ; System . out . println ( ( ( ( ( "Draws:<seq2seq4repair_space>" + draws ) + ",<seq2seq4repair_space>" ) + ( ( draws // games ) * 100 ) ) + "%" ) ) ; } }

Fix:
int games = 10 ;
Buggy code:
@ TypeCapability ( outputs = { "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token" , "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence" } ) public class ClearNlpSegmenter extends SegmenterBase { public static final String PARAM_LANGUAGE = ComponentParameters . PARAM_LANGUAGE ; @ ConfigurationParameter ( name = ClearNlpSegmenter . PARAM_LANGUAGE , mandatory = false ) protected String language ; public static final String PARAM_VARIANT = ComponentParameters . PARAM_VARIANT ; @ ConfigurationParameter ( name = ClearNlpSegmenter . PARAM_VARIANT , mandatory = false ) protected String variant ; public static final String PARAM_MODEL_LOCATION = ComponentParameters . PARAM_MODEL_LOCATION ; @ ConfigurationParameter ( name = ClearNlpSegmenter . PARAM_MODEL_LOCATION , mandatory = false ) protected String modelLocation ; @ Override public void process ( JCas aJCas ) throws AnalysisEngineProcessException { } @ Override protected void process ( JCas aJCas , String aText , int aZoneBegin ) throws AnalysisEngineProcessException { AbstractTokenizer tokenizer = NLPGetter . getTokenizer ( aJCas . getDocumentLanguage ( ) ) ; AbstractSegmenter segmenter = NLPGetter . getSegmenter ( aJCas . getDocumentLanguage ( ) , tokenizer ) ; List < List < String > > sentences = segmenter . getSentences ( new BufferedReader ( new StringReader ( aText ) ) ) ; int sBegin = 0 ; int sEnd = 0 ; int tBegin = 0 ; int tEnd = 0 ; for ( List < String > sentence : sentences ) { sBegin = - 1 ; for ( String token : sentence ) { <START_BUG> tBegin = aText . indexOf ( token , tBegin ) ; <END_BUG> tEnd = tBegin + ( token . length ( ) ) ; if ( sBegin == ( - 1 ) ) { sBegin = tBegin ; } createToken ( aJCas , ( aZoneBegin + tBegin ) , ( aZoneBegin + tEnd ) ) ; } sEnd = tEnd ; createSentence ( aJCas , ( aZoneBegin + sBegin ) , ( aZoneBegin + sEnd ) ) ; } } }

Fix:
tBegin = aText . indexOf ( token , tEnd ) ;
Buggy code:
public class ImageTest extends WicketTestCase { public void test_1 ( ) throws Exception { } public void testParentRelativeImage ( ) { tester . getApplication ( ) . getResourceSettings ( ) . setParentFolderPlaceholder ( "$up$" ) ; tester . startPage ( Home . class ) ; <START_BUG> tester . assertContains ( "resource//org.apache.wicket.markup.html.image.Home//[$]up[$]//border//test.png\"" ) ; <END_BUG> } }

Fix:
tester . assertContains ( "resource//org.apache.wicket.markup.html.image.Home//[$]up[$]//[$]up[$]//border//logo.gif\"" ) ;