nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Menu extends Widget { boolean hasLocation ; MenuItem cascade ; MenuItem defaultItem ; Decorations parent ; public Menu ( Control parent ) { } public Menu ( Decorations parent , int style ) { } public Menu ( Menu parentMenu ) { } public Menu ( MenuItem parentItem ) { } void _setVisible ( boolean visible ) { } void addAccelerators ( ) { } public void addHelpListener ( HelpListener listener ) { } public void addMenuListener ( MenuListener listener ) { } static int checkStyle ( int style ) { } static Control checkNull ( Control control ) { } static Menu checkNull ( Menu menu ) { } static MenuItem checkNull ( MenuItem item ) { } void createHandle ( int index ) { } void createWidget ( int index ) { } Rectangle getBounds ( ) { } public MenuItem getDefaultItem ( ) { } public boolean getEnabled ( ) { } public MenuItem getItem ( int index ) { } public int getItemCount ( ) { } public MenuItem [ ] getItems ( ) { } String getNameText ( ) { } public Decorations getParent ( ) { } public MenuItem getParentItem ( ) { } public Menu getParentMenu ( ) { } public Shell getShell ( ) { } public boolean getVisible ( ) { } void hookEvents ( ) { } public int indexOf ( MenuItem item ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } void releaseChildren ( boolean destroy ) { MenuItem [ ] items = getItems ( ) ; for ( int i = 0 ; i < ( items . length ) ; i ++ ) { MenuItem item = items [ i ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { <START_BUG> item . releaseChildren ( false ) ; <END_BUG> } } super . releaseChildren ( destroy ) ; } void releaseParent ( ) { } void releaseWidget ( ) { } void removeAccelerators ( ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeMenuListener ( MenuListener listener ) { } void sendHelpEvent ( int callData ) { } public void setDefaultItem ( MenuItem item ) { } public void setEnabled ( boolean enabled ) { } public void setLocation ( int x , int y ) { } public void setLocation ( Point location ) { } public void setVisible ( boolean visible ) { } boolean translateAccelerator ( int accel , boolean doit ) { } int XmNhelpCallback ( int w , int client_data , int call_data ) { } int XmNmapCallback ( int w , int client_data , int call_data ) { } int XmNunmapCallback ( int w , int client_data , int call_data ) { } }

Fix:
item . release ( false ) ;
Buggy code:
public class ArrayAccess extends Expression { public static final ChildPropertyDescriptor ARRAY_PROPERTY = new ChildPropertyDescriptor ( ArrayAccess . class , "array" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor INDEX_PROPERTY = new ChildPropertyDescriptor ( ArrayAccess . class , "index" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Expression arrayExpression = null ; private Expression indexExpression = null ; ArrayAccess ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { ArrayAccess result = new ArrayAccess ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setArray ( ( ( Expression ) ( getArray ( ) . clone ( target ) ) ) ) ; result . setIndex ( ( ( Expression ) ( getIndex ( ) . clone ( target ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getArray ( ) { } public void setArray ( Expression expression ) { } public Expression getIndex ( ) { } public void setIndex ( Expression expression ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class IndexFiles { private IndexFiles ( ) { } public static void main ( String [ ] args ) { } static void indexDocs ( IndexWriter writer , File file ) throws IOException { if ( file . canRead ( ) ) { if ( file . isDirectory ( ) ) { String [ ] files = file . list ( ) ; if ( files != null ) { for ( int i = 0 ; i < ( files . length ) ; i ++ ) { IndexFiles . indexDocs ( writer , new File ( file , files [ i ] ) ) ; } } } else { FileInputStream fis ; try { fis = new FileInputStream ( file ) ; } catch ( FileNotFoundException fnfe ) { return ; } try { Document doc = new Document ( ) ; Field pathField = new org . apache . lucene . document . StringField ( "path" , file . getPath ( ) , Store . YES ) ; doc . add ( pathField ) ; doc . add ( new org . apache . lucene . document . LongField ( "modified" , file . lastModified ( ) , Store . NO ) ) ; <START_BUG> doc . add ( new org . apache . lucene . document . TextField ( "contents" , new BufferedReader ( new InputStreamReader ( fis , "UTF-8" ) ) , Store . NO ) ) ; <END_BUG> if ( ( writer . getConfig ( ) . getOpenMode ( ) ) == ( OpenMode . CREATE ) ) { System . out . println ( ( "adding<seq2seq4repair_space>" + file ) ) ; writer . addDocument ( doc ) ; } else { System . out . println ( ( "updating<seq2seq4repair_space>" + file ) ) ; writer . updateDocument ( new Term ( "path" , file . getPath ( ) ) , doc ) ; } } finally { fis . close ( ) ; } } } } }

Fix:
doc . add ( new TextField ( "contents" , new BufferedReader ( new InputStreamReader ( fis , "UTF-8" ) ) ) ) ;
Buggy code:
public class VariableDeclarationExpression extends Expression { public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = new SimplePropertyDescriptor ( VariableDeclarationExpression . class , "modifiers" , int . class , ASTNode . MANDATORY ) ; public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = new ChildListPropertyDescriptor ( VariableDeclarationExpression . class , "modifiers" , IExtendedModifier . class , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( VariableDeclarationExpression . class , "type" , Type . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = new ChildListPropertyDescriptor ( VariableDeclarationExpression . class , "fragments" , VariableDeclarationFragment . class , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; public static List propertyDescriptors ( int apiLevel ) { } private ASTNode . NodeList modifiers = null ; private int modifierFlags = Modifier . NONE ; private Type baseType = null ; private ASTNode . NodeList variableDeclarationFragments = new ASTNode . NodeList ( VariableDeclarationExpression . FRAGMENTS_PROPERTY ) ; VariableDeclarationExpression ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final int internalGetSetIntProperty ( SimplePropertyDescriptor property , boolean get , int value ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public List modifiers ( ) { } public int getModifiers ( ) { } public void setModifiers ( int modifiers ) { } public Type getType ( ) { if ( ( this . baseType ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . baseType ) == null ) { preLazyInit ( ) ; this . baseType = this . ast . newPrimitiveType ( PrimitiveType . INT ) ; postLazyInit ( this . baseType , VariableDeclarationExpression . TYPE_PROPERTY ) ; } } } return this . baseType ; } public void setType ( Type type ) { } public List fragments ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class HttpDefaultsGui extends AbstractConfigGui { private static final long serialVersionUID = 240L ; private JCheckBox imageParser ; private JCheckBox concurrentDwn ; private JTextField concurrentPool ; private UrlConfigGui urlConfig ; public HttpDefaultsGui ( ) { } public String getLabelResource ( ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement config ) { } @ Override public void clearGui ( ) { } @ Override public void configure ( TestElement el ) { } private void init ( ) { setLayout ( new BorderLayout ( 0 , 5 ) ) ; setBorder ( makeBorder ( ) ) ; add ( makeTitlePanel ( ) , BorderLayout . NORTH ) ; <START_BUG> urlConfig = new UrlConfigGui ( false ) ; <END_BUG> add ( urlConfig , BorderLayout . CENTER ) ; final JPanel optionalTasksPanel = new HorizontalPanel ( ) ; optionalTasksPanel . setBorder ( BorderFactory . createTitledBorder ( BorderFactory . createEtchedBorder ( ) , JMeterUtils . getResString ( "optional_tasks" ) ) ) ; final JPanel checkBoxPanel = new HorizontalPanel ( ) ; imageParser = new JCheckBox ( JMeterUtils . getResString ( "web_testing_retrieve_images" ) ) ; checkBoxPanel . add ( imageParser ) ; imageParser . addItemListener ( new ItemListener ( ) { public void itemStateChanged ( final ItemEvent e ) { if ( ( e . getStateChange ( ) ) == ( ItemEvent . SELECTED ) ) { enableConcurrentDwn ( true ) ; } else { enableConcurrentDwn ( false ) ; } } } ) ; concurrentDwn = new JCheckBox ( JMeterUtils . getResString ( "web_testing_concurrent_download" ) ) ; concurrentDwn . addItemListener ( new ItemListener ( ) { public void itemStateChanged ( final ItemEvent e ) { if ( ( e . getStateChange ( ) ) == ( ItemEvent . SELECTED ) ) { concurrentPool . setEnabled ( true ) ; } else { concurrentPool . setEnabled ( false ) ; } } } ) ; concurrentPool = new JTextField ( 2 ) ; concurrentPool . setMaximumSize ( new Dimension ( 30 , 20 ) ) ; checkBoxPanel . add ( concurrentDwn ) ; checkBoxPanel . add ( concurrentPool ) ; optionalTasksPanel . add ( checkBoxPanel ) ; add ( optionalTasksPanel , BorderLayout . SOUTH ) ; } @ Override public Dimension getPreferredSize ( ) { } private void enableConcurrentDwn ( final boolean enable ) { } public void itemStateChanged ( final ItemEvent event ) { } }

Fix:
urlConfig = new UrlConfigGui ( false , true , false ) ;
Buggy code:
public class ResponseAssertion extends AbstractTestElement implements Serializable , Assertion { public static final String TEST_FIELD = "Assertion.test_field" ; public static final String SAMPLE_LABEL = "Assertion.sample_label" ; public static final String RESPONSE_DATA = "Assertion.response_data" ; public static final String RESPONSE_CODE = "Assertion.response_code" ; public static final String RESPONSE_MESSAGE = "Assertion.response_message" ; public static final String ASSUME_SUCCESS = "Assertion.assume_success" ; public static final String TEST_STRINGS = "Asserion.test_strings" ; public static final String TEST_TYPE = "Assertion.test_type" ; private static final int MATCH = 1 << 0 ; private static final int CONTAINS = 1 << 1 ; private static final int NOT = 1 << 2 ; private static ThreadLocal matcher = new ThreadLocal ( ) { protected Object initialValue ( ) { } } ; private static PatternCacheLRU patternCache = new PatternCacheLRU ( 1000 , new Perl5Compiler ( ) ) ; public ResponseAssertion ( ) { } public ResponseAssertion ( String field , int type , String string ) { } public void clear ( ) { } public void setTestField ( String testField ) { } public void setTestType ( int testType ) { } public void addTestString ( String testString ) { <START_BUG> getTestStrings ( ) . addProperty ( new StringProperty ( testString , testString ) ) ; <END_BUG> } public void setTestString ( String testString , int index ) { } public void removeTestString ( String testString ) { } public void removeTestString ( int index ) { } public void clearTestStrings ( ) { } public AssertionResult getResult ( SampleResult response ) { } public String getTestField ( ) { } public int getTestType ( ) { } public CollectionProperty getTestStrings ( ) { } public boolean isContainsType ( ) { } public boolean isMatchType ( ) { } public boolean isNotType ( ) { } public void setToContainsType ( ) { } public void setToMatchType ( ) { } public void setToNotType ( ) { } public void unsetNotType ( ) { } public boolean getAssumeSuccess ( ) { } public void setAssumeSuccess ( boolean b ) { } private AssertionResult evaluateResponse ( SampleResult response ) { } private String getFailText ( String stringPattern ) { } protected AssertionResult setResultForNull ( AssertionResult result ) { } public static class Test extends TestCase { int threadsRunning ; int failed ; public Test ( String name ) { } public void testThreadSafety ( ) throws Exception { } class TestThread extends Thread { static final String TEST_STRING = "DAbale<seq2seq4repair_space>arroz<seq2seq4repair_space>a<seq2seq4repair_space>la<seq2seq4repair_space>zorra<seq2seq4repair_space>el<seq2seq4repair_space>abad." ; static final String TEST_PATTERN = ".*A.*\\." ; public void run ( ) { } } } }

Fix:
getTestStrings ( ) . addProperty ( new StringProperty ( String . valueOf ( testString . hashCode ( ) ) , testString ) ) ;
Buggy code:
public class StopAction extends AbstractAction { private static final Logger logger = LoggerFactory . getLogger ( StopAction . class ) ; public StopAction ( BasicSubsystem requestor , BasicSubsystem target , boolean disableRootCheck ) { } @ Override public Object run ( ) { checkRoot ( ) ; State state = target . getState ( ) ; if ( EnumSet . of ( INSTALLED , RESOLVED ) . contains ( state ) ) return null ; else if ( EnumSet . of ( INSTALL_FAILED , UNINSTALLING , UNINSTALLED ) . contains ( state ) ) throw new IllegalStateException ( ( "Cannot<seq2seq4repair_space>stop<seq2seq4repair_space>from<seq2seq4repair_space>state<seq2seq4repair_space>" + state ) ) ; else if ( EnumSet . of ( INSTALLING , RESOLVING , STARTING , STOPPING ) . contains ( state ) ) { <START_BUG> waitForStateChange ( ) ; <END_BUG> return new StopAction ( requestor , target , disableRootCheck ) . run ( ) ; } target . setState ( STOPPING ) ; List < Resource > resources = new ArrayList < Resource > ( Activator . getInstance ( ) . getSubsystems ( ) . getResourcesReferencedBy ( target ) ) ; SubsystemContentHeader header = target . getSubsystemManifest ( ) . getSubsystemContentHeader ( ) ; if ( header != null ) { Collections . sort ( resources , new StartResourceComparator ( target . getSubsystemManifest ( ) . getSubsystemContentHeader ( ) ) ) ; Collections . reverse ( resources ) ; } for ( Resource resource : resources ) { if ( Utils . isRegionContextBundle ( resource ) ) continue ; try { stopResource ( resource ) ; } catch ( Exception e ) { StopAction . logger . error ( ( ( ( "An<seq2seq4repair_space>error<seq2seq4repair_space>occurred<seq2seq4repair_space>while<seq2seq4repair_space>stopping<seq2seq4repair_space>resource<seq2seq4repair_space>" + resource ) + "<seq2seq4repair_space>of<seq2seq4repair_space>subsystem<seq2seq4repair_space>" ) + ( target ) ) , e ) ; } } target . setState ( RESOLVED ) ; try { target . setDeploymentManifest ( new org . apache . aries . subsystem . core . archive . DeploymentManifest ( target . getDeploymentManifest ( ) , null , target . isAutostart ( ) , target . getSubsystemId ( ) , SubsystemIdentifier . getLastId ( ) , target . getLocation ( ) , false , false ) ) ; } catch ( Exception e ) { throw new SubsystemException ( e ) ; } return null ; } private void stopBundleResource ( Resource resource ) throws BundleException { } private void stopResource ( Resource resource ) throws IOException , BundleException { } private void stopSubsystemResource ( Resource resource ) throws IOException { } }

Fix:
waitForStateChange ( state ) ;
Buggy code:
public final class FloatConverter extends AbstractDecimalConverter { public static final ITypeConverter INSTANCE = new FloatConverter ( ) ; public Object convert ( final Object value , Locale locale ) { <START_BUG> final Number number = ( value instanceof Number ) ? ( ( Number ) ( value ) ) : parse ( value , Float . MIN_VALUE , Float . MAX_VALUE , locale ) ; <END_BUG> if ( number == null ) { return null ; } return new Float ( number . floatValue ( ) ) ; } protected Class getTargetType ( ) { } }

Fix:
final Number number = ( value instanceof Number ) ? ( ( Number ) ( value ) ) : parse ( value , ( - ( Float . MAX_VALUE ) ) , Float . MAX_VALUE , locale ) ;
Buggy code:
public class BorlandGenerateClient extends Task { static final String JAVA_MODE = "java" ; static final String FORK_MODE = "fork" ; boolean debug = false ; File ejbjarfile = null ; File clientjarfile = null ; String mode = BorlandGenerateClient . JAVA_MODE ; Path classpath ; public void setClasspath ( Path classpath ) throws TaskException { } public void setClientjar ( File clientjar ) { } public void setDebug ( boolean debug ) { } public void setEjbjar ( File ejbfile ) { } public void setMode ( String s ) { } public Path createClasspath ( ) throws TaskException { } public void execute ( ) throws TaskException { } protected void executeFork ( ) throws TaskException { } protected void executeJava ( ) throws TaskException { try { getLogger ( ) . info ( "mode<seq2seq4repair_space>:<seq2seq4repair_space>java" ) ; org . apache . tools . ant . taskdefs . Java execTask = null ; <START_BUG> execTask = ( ( Java ) ( getProject ( ) . createTask ( "java" ) ) ) ; <END_BUG> execTask . setDir ( new File ( "." ) ) ; execTask . setClassname ( "com.inprise.server.commandline.EJBUtilities" ) ; execTask . setClasspath ( classpath . concatSystemClasspath ( ) ) ; execTask . setFork ( true ) ; execTask . createArg ( ) . setValue ( "generateclient" ) ; if ( debug ) { execTask . createArg ( ) . setValue ( "-trace" ) ; } execTask . createArg ( ) . setValue ( "-short" ) ; execTask . createArg ( ) . setValue ( "-jarfile" ) ; execTask . createArg ( ) . setValue ( ejbjarfile . getAbsolutePath ( ) ) ; execTask . createArg ( ) . setValue ( "-single" ) ; execTask . createArg ( ) . setValue ( "-clientjarfile" ) ; execTask . createArg ( ) . setValue ( clientjarfile . getAbsolutePath ( ) ) ; getLogger ( ) . debug ( "Calling<seq2seq4repair_space>EJBUtilities" ) ; execTask . execute ( ) ; } catch ( Exception e ) { String msg = "Exception<seq2seq4repair_space>while<seq2seq4repair_space>calling<seq2seq4repair_space>generateclient<seq2seq4repair_space>Details:<seq2seq4repair_space>" + ( e . toString ( ) ) ; throw new TaskException ( msg , e ) ; } } }

Fix:
execTask = null ;
Buggy code:
public class RequestTickle { private Request < ? > mRequest ; private final Cache mCache ; private final Network mNetwork ; private final ResponseDelivery mDelivery ; private Response < ? > response ; private VolleyError error ; public RequestTickle ( Cache cache , Network network , ResponseDelivery delivery ) { } public RequestTickle ( Cache cache , Network network ) { } public < T > Request < T > add ( Request < T > request ) { } public void cancel ( ) { } public Cache getCache ( ) { } @ TargetApi ( VERSION_CODES . ICE_CREAM_SANDWICH ) public NetworkResponse start ( ) { if ( null == ( mRequest ) ) { return null ; } NetworkResponse networkResponse = null ; long startTimeMs = SystemClock . elapsedRealtime ( ) ; try { mRequest . addMarker ( "network-queue-take" ) ; if ( mRequest . isCanceled ( ) ) { mRequest . finish ( "network-discard-cancelled" ) ; return null ; } if ( ( VERSION . SDK_INT ) >= ( VERSION_CODES . ICE_CREAM_SANDWICH ) ) { TrafficStats . setThreadStatsTag ( mRequest . getTrafficStatsTag ( ) ) ; } networkResponse = mNetwork . performRequest ( mRequest ) ; if ( ( networkResponse . notModified ) && ( mRequest . hasHadResponseDelivered ( ) ) ) { mRequest . finish ( "not-modified" ) ; return networkResponse ; } response = mRequest . parseNetworkResponse ( networkResponse ) ; mRequest . addMarker ( "network-parse-complete" ) ; <START_BUG> if ( ( mRequest . shouldCache ( ) ) && ( ( response . cacheEntry ) != null ) ) { <END_BUG> mCache . put ( mRequest . getCacheKey ( ) , response . cacheEntry ) ; mRequest . addMarker ( "network-cache-written" ) ; } mRequest . markDelivered ( ) ; mDelivery . postResponse ( mRequest , response ) ; } catch ( VolleyError volleyError ) { networkResponse = volleyError . networkResponse ; volleyError . setNetworkTimeMs ( ( ( SystemClock . elapsedRealtime ( ) ) - startTimeMs ) ) ; parseAndDeliverNetworkError ( mRequest , volleyError ) ; } catch ( Exception e ) { VolleyLog . e ( e , "Unhandled<seq2seq4repair_space>exception<seq2seq4repair_space>%s" , e . toString ( ) ) ; VolleyError volleyError = new VolleyError ( e ) ; volleyError . setNetworkTimeMs ( ( ( SystemClock . elapsedRealtime ( ) ) - startTimeMs ) ) ; mDelivery . postError ( mRequest , volleyError ) ; } if ( null == networkResponse ) { networkResponse = new NetworkResponse ( 0 , null , null , false ) ; } return networkResponse ; } public Response < ? > getResponse ( ) { } public VolleyError getError ( ) { } private void parseAndDeliverNetworkError ( Request < ? > request , VolleyError volleyError ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ( mCache ) != null ) && ( mRequest . shouldCache ( ) ) ) && ( ( response . cacheEntry ) != null ) ) {
Buggy code:
public class ModClusterRemoveCustomMetric implements OperationStepHandler , DescriptionProvider { static final ModClusterRemoveCustomMetric INSTANCE = new ModClusterRemoveCustomMetric ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . getProcessType ( ) . isServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode dynamicLoadProvider = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) . get ( DYNAMIC_LOAD_PROVIDER ) ; String classname = null ; if ( dynamicLoadProvider . isDefined ( ) ) { List < Property > list = operation . asPropertyList ( ) ; Iterator < Property > it = list . iterator ( ) ; while ( it . hasNext ( ) ) { Property prop = it . next ( ) ; if ( prop . getName ( ) . equals ( "class" ) ) { classname = prop . getValue ( ) . asString ( ) ; break ; } } if ( classname != null ) { removeMetric ( dynamicLoadProvider , classname ) ; } } if ( ( ! ( dynamicLoadProvider . get ( LOAD_METRIC ) . isDefined ( ) ) ) && ( ! ( dynamicLoadProvider . get ( CUSTOM_LOAD_METRIC ) . isDefined ( ) ) ) ) { context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) . remove ( DYNAMIC_LOAD_PROVIDER ) ; } context . completeStep ( ) ; } private void removeMetric ( ModelNode dynamicLoadProvider , String classname ) { List < ModelNode > list = dynamicLoadProvider . get ( CUSTOM_LOAD_METRIC ) . asList ( ) ; List < ModelNode > newlist = Collections . < ModelNode > emptyList ( ) ; dynamicLoadProvider . get ( CUSTOM_LOAD_METRIC ) . set ( newlist ) ; Iterator < ModelNode > it = list . iterator ( ) ; while ( it . hasNext ( ) ) { ModelNode node = it . next ( ) ; if ( ! ( node . get ( "class" ) . asString ( ) . equals ( classname ) ) ) { dynamicLoadProvider . get ( CUSTOM_LOAD_METRIC ) . add ( node ) ; } } list = dynamicLoadProvider . get ( CUSTOM_LOAD_METRIC ) . asList ( ) ; if ( list . isEmpty ( ) ) { dynamicLoadProvider . remove ( CUSTOM_LOAD_METRIC ) ; } } } , MODEL ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class SuperReference extends ThisReference { public SuperReference ( int sourceStart , int sourceEnd ) { } public static ExplicitConstructorCall implicitSuperConstructorCall ( ) { } public boolean isImplicitThis ( ) { } public boolean isSuper ( ) { } public boolean isThis ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; if ( ! ( checkAccess ( scope . methodScope ( ) ) ) ) return null ; SourceTypeBinding enclosingTb = scope . enclosingSourceType ( ) ; <START_BUG> if ( ( enclosingTb . id ) == ( T_Object ) ) { <END_BUG> scope . problemReporter ( ) . cannotUseSuperInJavaLangObject ( this ) ; return null ; } return this . resolvedType = enclosingTb . superclass ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
if ( ( enclosingTb . id ) == ( TypeIds . T_JavaLangObject ) ) {
Buggy code:
public class MockWebResponse extends WebResponse { public MockWebResponse ( ) { } private final List < Cookie > cookies = new ArrayList < Cookie > ( ) ; @ Override public void addCookie ( Cookie cookie ) { } @ Override public void clearCookie ( Cookie cookie ) { } public List < Cookie > getCookies ( ) { } private String redirectUrl ; @ Override public void sendRedirect ( String url ) { } public String getRedirectUrl ( ) { } @ Override public boolean isRedirect ( ) { } private Long contentLength ; @ Override public void setContentLength ( long length ) { } public Long getContentLength ( ) { } private String contentType ; @ Override public void setContentType ( String mimeType ) { } public String getContentType ( ) { } private final Map < String , Object > headers = new HashMap < String , Object > ( ) ; @ Override public void setDateHeader ( String name , long date ) { } public long getDateHeader ( String name ) { } @ Override public void setHeader ( String name , String value ) { } public String getHeader ( String name ) { } public boolean hasHeader ( String name ) { } public Set < String > getHeaderNames ( ) { } Integer status ; @ Override public void setStatus ( int sc ) { } public Integer getStatus ( ) { } @ Override public String encodeURL ( CharSequence url ) { } private StringBuilder textResponse ; private ByteArrayOutputStream binaryResponse ; @ Override public void write ( CharSequence sequence ) { } public CharSequence getTextResponse ( ) { } @ Override public void write ( byte [ ] array ) { if ( ( textResponse ) != null ) { throw new IllegalStateException ( "Text<seq2seq4repair_space>response<seq2seq4repair_space>has<seq2seq4repair_space>already<seq2seq4repair_space>been<seq2seq4repair_space>initiated." ) ; } if ( ( binaryResponse ) == null ) { binaryResponse = new ByteArrayOutputStream ( ) ; } try { binaryResponse . write ( array ) ; <START_BUG> } catch ( IOException yeahRight ) { <END_BUG> } } public byte [ ] getBinaryResponse ( ) { } String errorMessage ; @ Override public void sendError ( int sc , String msg ) { } public String getErrorMessage ( ) { } @ Override public void flush ( ) { } @ Override public void reset ( ) { } }

Fix:
} catch ( IOException ignored ) {
Buggy code:
public abstract class NitroContentExtractor < SOURCE , CONTENT extends Content > implements ContentExtractor < SOURCE , CONTENT > { private static final Logger log = LoggerFactory . getLogger ( NitroContentExtractor . class ) ; protected static final String PID_NAMESPACE = "gb:bbc:pid" ; private static final String URI_NAMESPACE = "uri" ; private final Clock clock ; private final NitroImageExtractor imageExtractor = new NitroImageExtractor ( 1024 , 576 ) ; public NitroContentExtractor ( Clock clock ) { } @ Override public final CONTENT extract ( SOURCE source ) { } @ Nullable protected abstract MasterBrand extractMasterBrand ( SOURCE source ) { } @ Nonnull protected abstract CONTENT createContent ( SOURCE source ) { } @ Nonnull protected abstract String extractPid ( SOURCE source ) { } @ Nullable protected abstract String extractTitle ( SOURCE source ) { } @ Nullable protected abstract Synopses extractSynopses ( SOURCE source ) { } @ Nullable protected abstract Image extractImage ( SOURCE source ) { } protected void extractAdditionalFields ( SOURCE source , CONTENT content , DateTime now ) { } private String longestSynopsis ( Synopses synopses ) { } private MediaType computeMediaType ( MasterBrand masterBrand ) { if ( masterBrand == null ) { return MediaType . VIDEO ; } <START_BUG> return ionIdToService . containsKey ( masterBrand . getMid ( ) ) ? MediaType . AUDIO : MediaType . VIDEO ; <END_BUG> } }

Fix:
return masterBrandIdToService . containsKey ( masterBrand . getMid ( ) ) ? MediaType . AUDIO : MediaType . VIDEO ;
Buggy code:
public class RaiseToteToLastLvl extends Command { public RaiseToteToLastLvl ( ) { } @ Override protected void initialize ( ) { } @ Override protected void execute ( ) { <START_BUG> toteLift . liftTote ( ) ; <END_BUG> } @ Override protected boolean isFinished ( ) { } @ Override protected void end ( ) { } @ Override protected void interrupted ( ) { } }

Fix:
toteLift . raiseTote ( ) ;
Buggy code:
@ Named @ Stateful @ RequestScoped @ Join ( path = "//workspace//{workspaceUrlName}//materials-reading" , to = "//workspaces//materials-reading.jsf" ) @ LoggedIn public class WorkspaceMaterialsReadingBackingBean { @ Parameter private String workspaceUrlName ; @ Inject private WorkspaceController workspaceController ; @ Inject private WorkspaceMaterialController workspaceMaterialController ; @ Inject @ Named private WorkspaceNavigationBackingBean workspaceNavigationBackingBean ; @ RequestAction public String init ( ) { String urlName = getWorkspaceUrlName ( ) ; if ( StringUtils . isBlank ( urlName ) ) { return NavigationRules . NOT_FOUND ; } WorkspaceEntity workspaceEntity = workspaceController . findWorkspaceEntityByUrlName ( urlName ) ; if ( workspaceEntity == null ) { return NavigationRules . NOT_FOUND ; } rootFolder = workspaceMaterialController . findWorkspaceRootFolderByWorkspaceEntity ( workspaceEntity ) ; workspaceNavigationBackingBean . setWorkspaceUrlName ( urlName ) ; Workspace workspace = workspaceController . findWorkspace ( workspaceEntity ) ; workspaceName = workspace . getName ( ) ; workspaceEntityId = workspaceEntity . getId ( ) ; contentNodes = new ArrayList ( ) ; <START_BUG> List < WorkspaceNode > rootMaterialNodes = workspaceMaterialController . listWorkspaceNodesByParentSortByOrderNumber ( rootFolder ) ; <END_BUG> for ( WorkspaceNode rootMaterialNode : rootMaterialNodes ) { ContentNode node = workspaceMaterialController . createContentNode ( rootMaterialNode ) ; contentNodes . add ( node ) ; } return null ; } public WorkspaceRootFolder getRootFolder ( ) { } public void setRootFolder ( WorkspaceRootFolder rootFolder ) { } public String getWorkspaceUrlName ( ) { } public void setWorkspaceUrlName ( String workspaceUrlName ) { } public String getWorkspaceName ( ) { } public Long getWorkspaceEntityId ( ) { } public List < ContentNode > getContentNodes ( ) { } private WorkspaceRootFolder rootFolder ; private String workspaceName ; private Long workspaceEntityId ; private List < ContentNode > contentNodes ; No newline ; at end ; of file ; }

Fix:
List < WorkspaceNode > rootMaterialNodes = workspaceMaterialController . listVisibleWorkspaceNodesByParentSortByOrderNumber ( rootFolder ) ;
Buggy code:
public class AssertStatement extends Statement { public Expression assertExpression ; public Expression exceptionArgument ; int preAssertInitStateIndex = - 1 ; private FieldBinding assertionSyntheticFieldBinding ; public AssertStatement ( Expression exceptionArgument , Expression assertExpression , int startPosition ) { } public AssertStatement ( Expression assertExpression , int startPosition ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { preAssertInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; Constant cst = this . assertExpression . optimizedBooleanConstant ( ) ; boolean isOptimizedTrueAssertion = ( cst != ( Constant . NotAConstant ) ) && ( ( cst . booleanValue ( ) ) == true ) ; boolean isOptimizedFalseAssertion = ( cst != ( Constant . NotAConstant ) ) && ( ( cst . booleanValue ( ) ) == false ) ; FlowInfo assertRawInfo = assertExpression . analyseCode ( currentScope , flowContext , flowInfo . copy ( ) ) ; UnconditionalFlowInfo assertWhenTrueInfo = assertRawInfo . initsWhenTrue ( ) . unconditionalInits ( ) ; UnconditionalFlowInfo assertInfo = assertRawInfo . unconditionalCopy ( ) ; if ( isOptimizedTrueAssertion ) { assertInfo . setReachMode ( FlowInfo . UNREACHABLE ) ; } if ( ( exceptionArgument ) != null ) { FlowInfo exceptionInfo = exceptionArgument . analyseCode ( currentScope , flowContext , assertInfo . copy ( ) ) ; if ( ! isOptimizedTrueAssertion ) { flowContext . checkExceptionHandlers ( currentScope . getJavaLangAssertionError ( ) , this , exceptionInfo , currentScope ) ; } } if ( ! isOptimizedTrueAssertion ) { manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; } if ( isOptimizedFalseAssertion ) { return flowInfo ; } else { <START_BUG> return flowInfo . mergedWith ( assertInfo . nullInfoLessUnconditionalCopy ( ) ) . addInitializationsFrom ( assertWhenTrueInfo . nullInfo ( ) ) ; <END_BUG> } } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } }

Fix:
return flowInfo . mergedWith ( assertInfo . nullInfoLessUnconditionalCopy ( ) ) . addInitializationsFrom ( assertWhenTrueInfo . discardInitializationInfo ( ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class PureTestCase extends ContainerResourceMgmtTestBase { @ Deployment public static ResourceAdapterArchive createDeployment ( ) throws Exception { } @ ArquillianResource ServiceContainer serviceContainer ; @ Test public void testRegistryConfiguration ( ) throws Throwable { ServiceController < ? > controller = serviceContainer . getService ( RA_REPOSITORY_SERVICE ) ; assertNotNull ( controller ) ; ResourceAdapterRepository repository = ( ( ResourceAdapterRepository ) ( controller . getValue ( ) ) ) ; assertNotNull ( repository ) ; Set < String > ids = repository . getResourceAdapters ( ) ; assertNotNull ( ids ) ; <START_BUG> assertEquals ( 2 , ids . size ( ) ) ; <END_BUG> for ( String piId : ids ) { assertNotNull ( piId ) ; System . out . println ( ( "PID:" + piId ) ) ; assertNotNull ( repository . getResourceAdapter ( piId ) ) ; } } @ Test public void testMetadataConfiguration ( ) throws Throwable { } }

Fix:
assertEquals ( 1 , ids . size ( ) ) ;
Buggy code:
public class EnterpriseBeanPolicyContextHandler implements PolicyContextHandler { public static final String EJB_CONTEXT_KEY = "javax.ejb.EnterpriseBean" ; private static ThreadLocal ejbContext = new ThreadLocal ( ) ; static void setEnterpriseBean ( Object bean ) { } public Object getContext ( String key , Object data ) throws PolicyContextException { Object context = null ; <START_BUG> if ( ( key . equalsIgnoreCase ( EnterpriseBeanPolicyContextHandler . EJB_CONTEXT_KEY ) ) == false ) <END_BUG> context = EnterpriseBeanPolicyContextHandler . ejbContext . get ( ) ; return context ; } public String [ ] getKeys ( ) throws PolicyContextException { } public boolean supports ( String key ) throws PolicyContextException { } }

Fix:
if ( ( key . equalsIgnoreCase ( EnterpriseBeanPolicyContextHandler . EJB_CONTEXT_KEY ) ) == true )
Buggy code:
public abstract class AbstractDataSourceAdd implements ModelAddOperationHandler { public static final Logger log = Logger . getLogger ( "org.jboss.as.connector.subsystems.datasources" ) ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) throws OperationFailedException { } protected abstract void populateModel ( final ModelNode operation , final ModelNode model ) { } protected abstract AbstractDataSourceService createDataSourceService ( final String jndiName , final ModelNode operation ) throws OperationFailedException { } private ServiceName getDriverDependency ( final String driver ) { } static void populateAddModel ( final ModelNode existingModel , final ModelNode newModel , final String connectionPropertiesProp , final AttributeDefinition [ ] attributes ) { if ( existingModel . has ( connectionPropertiesProp ) ) { for ( Property property : existingModel . get ( connectionPropertiesProp ) . asPropertyList ( ) ) { newModel . get ( connectionPropertiesProp , property . getName ( ) ) . set ( property . getValue ( ) . asString ( ) ) ; } } for ( final AttributeDefinition attribute : attributes ) { <START_BUG> if ( existingModel . get ( attribute . getName ( ) ) . isDefined ( ) ) { <END_BUG> newModel . get ( attribute . getName ( ) ) . set ( existingModel . get ( attribute . getName ( ) ) ) ; } } } }

Fix:
if ( existingModel . hasDefined ( attribute . getName ( ) ) ) {
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.5-SNAPSHOT-20070904-1400" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.5-SNAPSHOT-20071012-1919" ;
Buggy code:
public final class TestHttpServer extends NetManager { public TestHttpServer ( String key_file , String key_pw ) throws Exception { } @ Override protected void onAddSession ( IoSession session ) { } @ Override protected void onDelSession ( IoSession session ) { } @ SuppressWarnings ( "resource" ) @ Override public void messageReceived ( IoSession session , Object message ) { } @ Override public void messageSent ( IoSession session , Object message ) { } @ Override public void exceptionCaught ( IoSession session , Throwable cause ) { if ( cause instanceof IOException ) log . error ( ( ( ( ( ( ( getName ( ) ) + '(' ) + ( session . getId ( ) ) ) + ',' ) + ( session . getRemoteAddress ( ) ) ) + "):<seq2seq4repair_space>exception:<seq2seq4repair_space>{}" ) , cause . getMessage ( ) ) ; else log . error ( ( ( ( ( ( ( getName ( ) ) + '(' ) + ( session . getId ( ) ) ) + ',' ) + ( session . getRemoteAddress ( ) ) ) + "):<seq2seq4repair_space>exception:" ) , cause ) ; <START_BUG> session . close ( true ) ; <END_BUG> } public static void main ( String [ ] args ) throws Exception { } }

Fix:
session . close ( false ) ;
Buggy code:
public class JMSService implements Service < JMSServerManager > { private final InjectedValue < HornetQServer > hornetQServer = new InjectedValue < HornetQServer > ( ) ; private final InjectedValue < Context > contextInjector = new InjectedValue < Context > ( ) ; private JMSServerManager jmsServer ; public static void addService ( final BatchBuilder builder ) { final JMSService service = new JMSService ( ) ; <START_BUG> builder . addService ( JMS_MANAGER , service ) . addDependency ( JBOSS_MESSAGING , HornetQServer . class , service . getHornetQServer ( ) ) . setInitialMode ( IMMEDIATE ) ; <END_BUG> } protected JMSService ( ) { } public synchronized void start ( StartContext context ) throws StartException { } public synchronized void stop ( StopContext context ) { } public synchronized JMSServerManager getValue ( ) throws IllegalStateException { } InjectedValue < HornetQServer > getHornetQServer ( ) { } InjectedValue < Context > getContextInjector ( ) { } }

Fix:
builder . addService ( JMS_MANAGER , service ) . addDependency ( JBOSS_MESSAGING , HornetQServer . class , service . getHornetQServer ( ) ) . setInitialMode ( ACTIVE ) ;
Buggy code:
public class PageRequestTarget implements IPageRequestTarget { private final Page page ; public PageRequestTarget ( Page page ) { } public void respond ( RequestCycle requestCycle ) { } public final Page getPage ( ) { } public void cleanUp ( RequestCycle requestCycle ) { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } public String toString ( ) { <START_BUG> return page . toString ( ) ; <END_BUG> } }

Fix:
return ( ( ( "PageRequestTarget@" + ( hashCode ( ) ) ) + "{page=" ) + ( page ) ) + "}" ;
Buggy code:
public class Register extends ActionBarActivity implements LoaderCallbacks < Cursor > { private AutoCompleteTextView mEmailView ; private EditText mPasswordView ; private EditText mPasswordView2 ; private View mProgressView ; private View mLoginFormView ; private Toast mLoginStatus ; private static Toast regMsgToast = null ; private void populateAutoComplete ( ) { } private Register . UserRegisterTask mAuthTask = null ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void proceedToShoppingPage ( ) { } public void attemptRegister ( ) { } @ Override public void onLoadFinished ( Loader < Cursor > cursorLoader , Cursor cursor ) { } private void addEmailsToAutoComplete ( List < String > emailAddressCollection ) { } private interface ProfileQuery { String [ ] PROJECTION = new String [ ] { Email . ADDRESS , Email . IS_PRIMARY } ; int ADDRESS = 0 ; int IS_PRIMARY = 1 ; } @ Override public Loader < Cursor > onCreateLoader ( int i , Bundle bundle ) { } public void onLoaderReset ( Loader < Cursor > cursorLoader ) { } public class UserRegisterTask extends AsyncTask < Void , Void , Boolean > { private final String mEmail ; private final String mPassword ; public UserRegisterTask ( String email , String password ) { } @ Override protected Boolean doInBackground ( Void ... params ) { } protected boolean isInSystem ( String user ) { String TAG = Register . class . getSimpleName ( ) ; <START_BUG> String link = "http:////sandbox.artineer.com//getuser.php?username=" + user ; <END_BUG> try { URL url = new URL ( link ) ; HttpClient client = new DefaultHttpClient ( ) ; HttpGet request = new HttpGet ( ) ; request . setURI ( new URI ( link ) ) ; HttpResponse response = client . execute ( request ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( response . getEntity ( ) . getContent ( ) ) ) ; StringBuffer sb = new StringBuffer ( "" ) ; String line = "" ; while ( ( line = in . readLine ( ) ) != null ) { sb . append ( line ) ; break ; } in . close ( ) ; Log . e ( TAG , sb . toString ( ) ) ; return ! ( sb . toString ( ) . equals ( "*NOSUCHUSER" ) ) ; } catch ( Exception e ) { Log . e ( TAG , "EXCEPTION>>>>" , e ) ; return false ; } } protected boolean registerUser ( String user , String pass ) { } @ Override protected void onPostExecute ( final Boolean success ) { } @ Override protected void onCancelled ( ) { } } }

Fix:
String link = "http:////sandbox.artineer.com//getuserregister.php?username=" + user ;
Buggy code:
public interface IData { public IDataScheme getScheme ( ) { } public List < String > getTexts ( ) { } <START_BUG> public List < String > getText ( ) ; <END_BUG> }

Fix:
public String getText ( ) ;
Buggy code:
public class StandardEvaluationContext implements EvaluationContext { private TypedValue rootObject ; private List < ConstructorResolver > constructorResolvers ; private List < MethodResolver > methodResolvers ; private List < PropertyAccessor > propertyAccessors ; private TypeLocator typeLocator ; private TypeConverter typeConverter ; private TypeComparator typeComparator = new StandardTypeComparator ( ) ; private OperatorOverloader operatorOverloader = new StandardOperatorOverloader ( ) ; private final Map < String , Object > variables = new HashMap < String , Object > ( ) ; public StandardEvaluationContext ( ) { } public StandardEvaluationContext ( Object rootObject ) { } public void setRootObject ( Object rootObject ) { } public void setRootObject ( Object rootObject , TypeDescriptor typeDescriptor ) { } public TypedValue getRootObject ( ) { } public void addConstructorResolver ( ConstructorResolver resolver ) { } public List < ConstructorResolver > getConstructorResolvers ( ) { } private void ensureConstructorResolversInitialized ( ) { } public void addMethodResolver ( MethodResolver resolver ) { } public List < MethodResolver > getMethodResolvers ( ) { } private void ensureMethodResolversInitialized ( ) { } public void addPropertyAccessor ( PropertyAccessor accessor ) { } public List < PropertyAccessor > getPropertyAccessors ( ) { } private void ensurePropertyAccessorsInitialized ( ) { if ( ( this . propertyAccessors ) == null ) { this . propertyAccessors = new ArrayList < PropertyAccessor > ( ) ; <START_BUG> this . propertyAccessors . add ( new ReflectivePropertyResolver ( ) ) ; <END_BUG> } } public void setTypeLocator ( TypeLocator typeLocator ) { } public TypeLocator getTypeLocator ( ) { } public void setTypeConverter ( TypeConverter typeConverter ) { } public TypeConverter getTypeConverter ( ) { } public void setTypeComparator ( TypeComparator typeComparator ) { } public TypeComparator getTypeComparator ( ) { } public void setOperatorOverloader ( OperatorOverloader operatorOverloader ) { } public OperatorOverloader getOperatorOverloader ( ) { } public void setVariable ( String name , Object value ) { } public void setVariables ( Map < String , Object > variables ) { } public void registerFunction ( String name , Method method ) { } public Object lookupVariable ( String name ) { } }

Fix:
this . propertyAccessors . add ( new ReflectivePropertyAccessor ( ) ) ;
Buggy code:
public class TestUmlModel extends GenericObjectTestFixture { public TestUmlModel ( String arg0 ) { } public void testNamespace ( ) { <START_BUG> Object o = getFactory ( ) . create ( MODEL ) ; <END_BUG> assertNotNull ( "Didn't<seq2seq4repair_space>create<seq2seq4repair_space>object" , o ) ; assertTrue ( "Should<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>base" , ModelFacade . isABase ( o ) ) ; assertTrue ( "Should<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>model" , ModelFacade . isAModel ( o ) ) ; runTruthTests ( o ) ; } protected void initializeTruth ( ) { } }

Fix:
Object o = ModelFacade . getFacade ( ) . create ( MODEL ) ;
Buggy code:
class WebContextLifecycleInterceptor extends AbstractLifecycleInterceptor implements Service < LifecycleInterceptor > { static final ServiceName SERVICE_NAME = JBOSS . append ( "as" , "osgi" , "web" ) . append ( WebContextLifecycleInterceptor . class . getSimpleName ( ) ) ; private final InjectedValue < BundleContext > injectedSystemContext = new InjectedValue < BundleContext > ( ) ; private ServiceRegistration < LifecycleInterceptor > registration ; static ServiceController < LifecycleInterceptor > addService ( ServiceTarget serviceTarget , ServiceVerificationHandler verificationHandler ) { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public void invoke ( int state , InvocationContext context ) { } private void injectBundleContext ( ServletContext webContext , BundleContext bundleContext ) { } private void uninjectBundleContext ( ServletContext webContext ) { } private void registerServletContextService ( ServletContext servletContext , BundleContext bundleContext ) { Bundle bundle = bundleContext . getBundle ( ) ; Dictionary < String , Object > props = new Hashtable < String , Object > ( ) ; props . put ( "osgi.web.symbolicname" , bundle . getSymbolicName ( ) ) ; Dictionary < ? , ? > headers = bundle . getHeaders ( ) ; Object version = headers . get ( Constants . BUNDLE_VERSION ) ; if ( version instanceof String ) props . put ( "osgi.web.version" , version ) ; <START_BUG> Object contextPath = headers . get ( WEB_CONTEXT_PATH ) ; <END_BUG> if ( contextPath instanceof String ) props . put ( "osgi.web.contextpath" , contextPath ) ; bundleContext . registerService ( ServletContext . class . getName ( ) , servletContext , props ) ; } @ Override public LifecycleInterceptor getValue ( ) throws IllegalArgumentException , IllegalStateException { } }

Fix:
Object contextPath = headers . get ( WEB_CONTEXTPATH ) ;
Buggy code:
public class StationAdapter extends CursorAdapter { private final DataBaseHelper dataBaseHelper ; public StationAdapter ( Activity activity , Cursor c ) { } @ Override public View newView ( Context context , Cursor cursor , ViewGroup parent ) { } @ Override public void bindView ( View view , Context context , Cursor cursor ) { Station station = this . createItem ( cursor ) ; ImageView iv = ( ( ImageView ) ( view . findViewById ( station_item_icon ) ) ) ; TextView tv = ( ( TextView ) ( view . findViewById ( station_item_headline ) ) ) ; TextView sv = ( ( TextView ) ( view . findViewById ( station_item_subline ) ) ) ; if ( station . active ) iv . setImageResource ( ic_launcher ) ; else iv . setImageResource ( deactive_alarm ) ; tv . setText ( station . name ) ; <START_BUG> sv . setText ( "500m" ) ; <END_BUG> } @ Override public Cursor runQueryOnBackgroundThread ( CharSequence constraint ) { } @ Override public CharSequence convertToString ( Cursor cursor ) { } public Station getItemByPosition ( int pos ) { } private Station createItem ( Cursor cursor ) { } }

Fix:
sv . setText ( "1km" ) ;