nus-yam/ex-repair huggingface dataset:
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 . getType ( ) ) == ( Type . SERVER ) ) { <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 . getProcessType ( ) . isServer ( ) ) {
Buggy code:
public class StatefulComponentSessionIdGeneratingInterceptorFactory implements InterceptorFactory { public static final StatefulComponentSessionIdGeneratingInterceptorFactory INSTANCE = new StatefulComponentSessionIdGeneratingInterceptorFactory ( ) ; private StatefulComponentSessionIdGeneratingInterceptorFactory ( ) { } @ Override public Interceptor create ( InterceptorFactoryContext context ) { final AtomicReference < SessionID > sessionIdReference = new AtomicReference < SessionID > ( ) ; context . getContextData ( ) . put ( SESSION_ID_REFERENCE_KEY , sessionIdReference ) ; <START_BUG> final SessionID id = ( ( SessionID ) ( context . getContextData ( ) . get ( SESSION_ID_KEY ) ) ) ; <END_BUG> if ( id == null ) { return new StatefulComponentSessionIdGeneratingInterceptorFactory . StatefulComponentSessionIdGeneratingInterceptor ( sessionIdReference ) ; } else { sessionIdReference . set ( id ) ; return Interceptors . getTerminalInterceptor ( ) ; } } private class StatefulComponentSessionIdGeneratingInterceptor implements Interceptor { private final AtomicReference < SessionID > sessionIdReference ; StatefulComponentSessionIdGeneratingInterceptor ( AtomicReference < SessionID > sessionIdReference ) { } @ Override public Object processInvocation ( InterceptorContext context ) throws Exception { } } }

Fix:
final SessionID id = ( ( SessionID ) ( context . getContextData ( ) . get ( SessionID . class ) ) ) ;
Buggy code:
public class NOPTransformer < T > implements Serializable , Transformer < T , T > { private static final long serialVersionUID = 2133891748318574490L ; public static final Transformer < Object , Object > INSTANCE = new NOPTransformer < Object > ( ) ; @ SuppressWarnings ( "unchecked" ) public static < T > Transformer < T , T > nopTransformer ( ) { } private NOPTransformer ( ) { } <START_BUG> public T transform ( T input ) { <END_BUG> return input ; } private Object readResolve ( ) { } }

Fix:
public T transform ( final T input ) {
Buggy code:
public class Main { static String chaine = "" ; public static void main ( String [ ] args ) { <START_BUG> TreeBuilderIF tb = new TreeBuilder ( "((2.23*2)*1)" ) ; <END_BUG> ExprIF t = tb . build ( ) ; t . getReducedTree ( ) ; System . out . println ( Main . chaine ) ; } }

Fix:
TreeBuilderIF tb = new TreeBuilder ( "((2.23*2.2)*5.69)" ) ;
Buggy code:
public class ThreadsSubsystemTestCase extends AbstractSubsystemBaseTest { public ThreadsSubsystemTestCase ( ) { } @ Override protected String getSubsystemXml ( ) throws IOException { } @ Test public void testExpressions ( ) throws Exception { } @ Test public void testTransformerAS712 ( ) throws Exception { } @ Test public void testTransformerAS713 ( ) throws Exception { } private void testTransformer_1_0 ( ModelTestControllerVersion controllerVersion ) throws Exception { String subsystemXml = "threads-transform-1_0.xml" ; ModelVersion modelVersion = ModelVersion . create ( 1 , 0 , 0 ) ; KernelServicesBuilder builder = createKernelServicesBuilder ( MANAGEMENT ) . setSubsystemXmlResource ( subsystemXml ) ; <START_BUG> final PathAddress subsystemAddress = PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , mainSubsystemName ) ) ; <END_BUG> builder . createLegacyKernelServicesBuilder ( null , controllerVersion , modelVersion ) . addOperationValidationResolve ( "add" , subsystemAddress . append ( PathElement . pathElement ( "thread-factory" ) ) ) . addMavenResourceURL ( ( "org.jboss.as:jboss-as-threads:" + ( controllerVersion . getMavenGavVersion ( ) ) ) ) . excludeFromParent ( SingleClassFilter . createFilter ( ThreadsLogger . class ) ) ; KernelServices mainServices = builder . build ( ) ; KernelServices legacyServices = mainServices . getLegacyServices ( modelVersion ) ; Assert . assertNotNull ( legacyServices ) ; checkSubsystemModelTransformation ( mainServices , modelVersion ) ; } @ Test public void testRejectExpressionsAS712 ( ) throws Exception { } @ Test public void testRejectExpressionsAS713 ( ) throws Exception { } private void testRejectExpressions_1_0_0 ( ModelTestControllerVersion controllerVersion ) throws Exception { } private FailedOperationTransformationConfig getConfig ( ) { } }

Fix:
final PathAddress subsystemAddress = PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , getMainSubsystemName ( ) ) ) ;
Buggy code:
public class Group extends Composite { int parentingHandle ; String text ; public Group ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } int backgroundProperty ( ) { } int clientHandle ( ) { } void createHandle ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { int topHandle = topHandle ( ) ; int clientHandle = clientHandle ( ) ; if ( clientHandle != topHandle ) { double currentWidth = OS . FrameworkElement_Width ( topHandle ) ; double currentHeight = OS . FrameworkElement_Height ( topHandle ) ; OS . FrameworkElement_Width ( topHandle , 100 ) ; OS . FrameworkElement_Height ( topHandle , 100 ) ; <START_BUG> OS . UIElement_UpdateLayout ( topHandle ) ; <END_BUG> int w = ( ( int ) ( OS . FrameworkElement_ActualWidth ( topHandle ) ) ) ; int h = ( ( int ) ( OS . FrameworkElement_ActualHeight ( topHandle ) ) ) ; int clientWidth = ( ( int ) ( OS . FrameworkElement_ActualWidth ( clientHandle ) ) ) ; int clientHeight = ( ( int ) ( OS . FrameworkElement_ActualHeight ( clientHandle ) ) ) ; int point = OS . gcnew_Point ( 0 , 0 ) ; int result = OS . UIElement_TranslatePoint ( clientHandle , point , topHandle ) ; x -= ( ( int ) ( OS . Point_X ( result ) ) ) ; y -= ( ( int ) ( OS . Point_Y ( result ) ) ) ; width += w - clientWidth ; height += h - clientHeight ; OS . GCHandle_Free ( point ) ; OS . GCHandle_Free ( result ) ; OS . FrameworkElement_Width ( topHandle , currentWidth ) ; OS . FrameworkElement_Height ( topHandle , currentHeight ) ; } return new Rectangle ( x , y , width , height ) ; } int defaultBackground ( ) { } String getNameText ( ) { } public String getText ( ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void releaseHandle ( ) { } void setForegroundBrush ( int brush ) { } public void setText ( String string ) { } int parentingHandle ( ) { } }

Fix:
updateLayout ( topHandle ) ;
Buggy code:
public class ProgressRegion { ProgressCanvasViewer viewer ; AnimationItem item ; Composite region ; WorkbenchWindow workbenchWindow ; public ProgressRegion ( ) { } public Control createContents ( Composite parent , WorkbenchWindow window ) { workbenchWindow = window ; region = new Composite ( parent , SWT . NONE ) ; GridLayout gl = new GridLayout ( ) ; gl . marginHeight = 0 ; gl . marginWidth = 0 ; gl . numColumns = 3 ; region . setLayout ( gl ) ; new org . eclipse . swt . widgets . Label ( region , SWT . SEPARATOR ) ; viewer = new ProgressCanvasViewer ( region , SWT . NO_FOCUS , 1 , 36 ) ; viewer . setUseHashlookup ( true ) ; Control viewerControl = viewer . getControl ( ) ; GridData gd = new GridData ( GridData . FILL_BOTH ) ; gd . widthHint = viewer . getSizeHints ( ) . x ; viewerControl . setLayoutData ( gd ) ; int widthPreference = ( AnimationManager . getInstance ( ) . getPreferredWidth ( ) ) + 25 ; item = new ProgressAnimationItem ( this ) ; item . createControl ( region ) ; item . setAnimationContainer ( new AnimationItem . IAnimationContainer ( ) { public void animationDone ( ) { if ( viewer . getControl ( ) . isDisposed ( ) ) return ; viewer . refresh ( ) ; } public void animationStart ( ) { } } ) ; Control itemControl = item . getControl ( ) ; gd = new GridData ( GridData . FILL_VERTICAL ) ; gd . widthHint = widthPreference ; itemControl . setLayoutData ( gd ) ; viewerControl . addMouseListener ( new MouseAdapter ( ) { public void mouseDoubleClick ( MouseEvent e ) { processDoubleClick ( ) ; } } ) ; <START_BUG> IContentProvider provider = new ProgressViewerContentProvider ( viewer , false ) ; <END_BUG> viewer . setContentProvider ( provider ) ; viewer . setInput ( provider ) ; viewer . setLabelProvider ( new ProgressViewerLabelProvider ( viewerControl ) ) ; viewer . setSorter ( ProgressManagerUtil . getProgressViewerSorter ( ) ) ; return region ; } public AnimationItem getAnimationItem ( ) { } public Control getControl ( ) { } public void processDoubleClick ( ) { } }

Fix:
IContentProvider provider = new ProgressViewerContentProvider ( viewer , false , true ) ;
Buggy code:
public final class LazyClassGen { public static void disassemble ( String path , String name , PrintStream out ) throws IOException { } private BcelObjectType myType ; private ClassGen myGen ; private ConstantPoolGen constantPoolGen ; private List methodGens = new ArrayList ( ) ; private List classGens = new ArrayList ( ) ; private int childCounter = 0 ; public int getNewGeneratedNameTag ( ) { } private InstructionFactory fact ; public LazyClassGen ( String class_name , String super_class_name , String file_name , int access_flags , String [ ] interfaces ) { } public LazyClassGen ( BcelObjectType myType ) { } public String getInternalClassName ( ) { } public File getPackagePath ( File root ) { } public String getClassId ( ) { } public void addMethodGen ( LazyMethodGen gen ) { } public List getMethodGens ( ) { <START_BUG> return Collections . unmodifiableList ( methodGens ) ; <END_BUG> } private void writeBack ( ) { } public JavaClass getJavaClass ( ) { } public void addGeneratedInner ( LazyClassGen newClass ) { } public void addInterface ( TypeX typeX ) { } private List getClassGens ( ) { } public List getChildClasses ( ) { } public String toString ( ) { } public String toShortString ( ) { } public String toLongString ( ) { } public void print ( ) { } public void print ( PrintStream out ) { } private void printOne ( PrintStream out ) { } private boolean isEmptyClinit ( LazyMethodGen gen ) { } public ConstantPoolGen getConstantPoolGen ( ) { } public String getName ( ) { } public WeaverStateKind getWeaverState ( ) { } public void setWeaverState ( WeaverStateKind s ) { } public InstructionFactory getFactory ( ) { } public LazyMethodGen getStaticInitializer ( ) { } public LazyMethodGen getAjcPreClinit ( ) { } Map tjpFields = new HashMap ( ) ; public static final ObjectType tjpType = new ObjectType ( "org.aspectj.lang.JoinPoint" ) ; public static final ObjectType staticTjpType = new ObjectType ( "org.aspectj.lang.JoinPoint$StaticPart" ) ; private static final ObjectType sigType = new ObjectType ( "org.aspectj.lang.Signature" ) ; private static final ObjectType slType = new ObjectType ( "org.aspectj.lang.reflect.SourceLocation" ) ; private static final ObjectType factoryType = new ObjectType ( "org.aspectj.runtime.reflect.Factory" ) ; private static final ObjectType classType = new ObjectType ( "java.lang.Class" ) ; public Field getTjpField ( BcelShadow shadow ) { } private void addAjcInitializers ( ) { } private InstructionList initializeAllTjps ( ) { } private void initializeTjp ( InstructionFactory fact , InstructionList list , Field field , BcelShadow shadow ) { } public ResolvedTypeX getType ( ) { } public BcelObjectType getBcelObjectType ( ) { } public String getFileName ( ) { } public void addField ( Field field ) { } public String getClassName ( ) { } public boolean isInterface ( ) { } public LazyMethodGen getLazyMethodGen ( Member m ) { } public LazyMethodGen getLazyMethodGen ( String name , String signature ) { } public void forcePublic ( ) { } }

Fix:
return methodGens ;
Buggy code:
public class SurveyResponseValidatorsTest extends TestCase { @ Test public void testValidateSurveyIds ( ) { } @ Test public void testValidatePromptIds ( ) { } @ Test public void testValidateSurveyResponseId ( ) { } @ Test public void testValidatePrivacyState ( ) { } @ Test public void testValidateUsernames ( ) { } @ Test public void testValidateColumnList ( ) { } @ Test public void testValidateOutputFormat ( ) { } @ Test public void testValidateSortOrder ( ) { try { for ( String emptyValue : ParameterSets . getEmptyValues ( ) ) { <START_BUG> Assert . assertEquals ( SurveyResponseValidators . validateSortOrder ( emptyValue ) , DEFAULT_SORT_ORDER ) ; <END_BUG> } try { SurveyResponseValidators . validateSortOrder ( "Invalid<seq2seq4repair_space>value." ) ; fail ( "The<seq2seq4repair_space>survey<seq2seq4repair_space>response<seq2seq4repair_space>sort<seq2seq4repair_space>order<seq2seq4repair_space>was<seq2seq4repair_space>invalid." ) ; } catch ( ValidationException e ) { } Set < List < SortParameter > > permutations = getUniqueSets ( Arrays . asList ( SortParameter . values ( ) ) ) ; for ( List < SortParameter > permutation : permutations ) { int length = permutation . size ( ) ; StringBuilder permutationStringBuilder = new StringBuilder ( ) ; int count = 1 ; for ( SortParameter sortParameter : permutation ) { permutationStringBuilder . append ( sortParameter . toString ( ) ) ; if ( count != length ) { permutationStringBuilder . append ( LIST_ITEM_SEPARATOR ) ; } } String permutationString = permutationStringBuilder . toString ( ) ; Assert . assertEquals ( permutation , SurveyResponseValidators . validateSortOrder ( permutationString ) ) ; } } catch ( ValidationException e ) { fail ( ( "A<seq2seq4repair_space>validation<seq2seq4repair_space>exception<seq2seq4repair_space>was<seq2seq4repair_space>thrown:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } @ Test public void testValidateFunction ( ) { } @ Test public void testValidateStartDate ( ) { } @ Test public void testValidateEndDate ( ) { } @ Test public void testValidateSuppressMetadata ( ) { } @ Test public void testValidateReturnId ( ) { } @ Test public void testValidatePrettyPrint ( ) { } @ Test public void testValidateCollapse ( ) { } private Set < List < SortParameter > > getUniqueSets ( final List < SortParameter > parameters ) { } }

Fix:
Assert . assertNull ( SurveyResponseValidators . validateSortOrder ( emptyValue ) ) ;
Buggy code:
public class QiniuUtil { private static final String APP_KEY = "KMA1TsVFfbaFVlS04nCwrdWB0hiGNLi_isuRsoHN" ; private static final String APP_SECRET = "eGyJuSrAUta7np-II2qjzhfe8FR7kIHCaRpi7guF" ; public static String getUploadToken ( ) { Auth auth = Auth . create ( QiniuUtil . APP_KEY , QiniuUtil . APP_SECRET ) ; <START_BUG> return auth . uploadToken ( "bucket" ) ; <END_BUG> } }

Fix:
return auth . uploadToken ( "maopao" ) ;
Buggy code:
public abstract class StopwordAnalyzerBase extends Analyzer { protected final CharArraySet stopwords ; protected final Version matchVersion ; public CharArraySet getStopwordSet ( ) { } protected StopwordAnalyzerBase ( final Version version , final CharArraySet stopwords ) { } protected StopwordAnalyzerBase ( final Version version ) { } protected static CharArraySet loadStopwordSet ( final boolean ignoreCase , final Class < ? extends Analyzer > aClass , final String resource , final String comment ) throws IOException { Reader reader = null ; try { reader = IOUtils . getDecodingReader ( aClass . getResourceAsStream ( resource ) , CHARSET_UTF_8 ) ; <START_BUG> return WordlistLoader . getWordSet ( reader , comment , new CharArraySet ( Version . LUCENE_31 , 16 , ignoreCase ) ) ; <END_BUG> } finally { IOUtils . close ( reader ) ; } } protected static CharArraySet loadStopwordSet ( File stopwords , Version matchVersion ) throws IOException { } protected static CharArraySet loadStopwordSet ( Reader stopwords , Version matchVersion ) throws IOException { } }

Fix:
return WordlistLoader . getWordSet ( reader , comment , new CharArraySet ( Version . LUCENE_CURRENT , 16 , ignoreCase ) ) ;
Buggy code:
@ RunWith ( BMUnitRunner . class ) public class OperationSequencesTestCase extends OperationTestCaseBase { static final ModelNode addStackOp = getProtocolStackAddOperation ( "maximal2" ) ; static final ModelNode addStackOpWithParams = getProtocolStackAddOperationWithParameters ( "maximal2" ) ; static final ModelNode removeStackOp = getProtocolStackRemoveOperation ( "maximal2" ) ; static final ModelNode addTransportOp = getTransportAddOperation ( "maximal2" , "UDP" ) ; static final ModelNode addTransportOpWithProps = getTransportAddOperationWithProperties ( "maximal2" , "UDP" ) ; static final ModelNode removeTransportOp = getTransportRemoveOperation ( "maximal2" , "UDP" ) ; static final ModelNode addProtocolOp = getProtocolAddOperation ( "maximal2" , "MPING" ) ; static final ModelNode addProtocolOpWithProps = getProtocolAddOperationWithProperties ( "maximal2" , "MPING" ) ; static final ModelNode removeProtocolOp = getProtocolRemoveOperation ( "maximal2" , "MPING" ) ; @ Test public void testProtocolStackAddRemoveAddSequence ( ) throws Exception { } @ Test public void testProtocolStackRemoveRemoveSequence ( ) throws Exception { } @ Test public void testProtocolStackAddRemoveSequenceWithParameters ( ) throws Exception { } @ Test <START_BUG> @ BMRule ( name = "Test<seq2seq4repair_space>remove<seq2seq4repair_space>rollback<seq2seq4repair_space>operation" , targetClass = "org.jboss.as.clustering.jgroups.subsystem.ProtocolStackRemove" , targetMethod = "performRuntime" , targetLocation = "AT<seq2seq4repair_space>EXIT" , action = "$1.setRollbackOnly()" ) <END_BUG> public void testProtocolStackRemoveRollback ( ) throws Exception { String subsystemXml = getSubsystemXml ( ) ; KernelServices servicesA = createKernelServicesBuilder ( null ) . setSubsystemXml ( subsystemXml ) . build ( ) ; ModelNode [ ] batchToAddStack = new ModelNode [ ] { OperationSequencesTestCase . addStackOp , OperationSequencesTestCase . addTransportOp , OperationSequencesTestCase . addProtocolOp } ; ModelNode compositeOp = getCompositeOperation ( batchToAddStack ) ; ModelNode result = servicesA . executeOperation ( compositeOp ) ; Assert . assertEquals ( SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; result = servicesA . executeOperation ( OperationSequencesTestCase . removeStackOp ) ; Assert . assertEquals ( FAILED , result . get ( OUTCOME ) . asString ( ) ) ; ServiceName channelFactoryServiceName = ChannelFactoryService . getServiceName ( "maximal2" ) ; Assert . assertNotNull ( "channel<seq2seq4repair_space>factory<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>installed" , servicesA . getContainer ( ) . getService ( channelFactoryServiceName ) ) ; } }

Fix:
@ BMRule ( name = "Test<seq2seq4repair_space>remove<seq2seq4repair_space>rollback<seq2seq4repair_space>operation" , targetClass = "org.jboss.as.clustering.jgroups.subsystem.ProtocolStackRemove" , targetMethod = "performRuntime" , targetLocation = "AT<seq2seq4repair_space>EXIT" , action = "traceln(\"Injecting<seq2seq4repair_space>rollback<seq2seq4repair_space>fault<seq2seq4repair_space>via<seq2seq4repair_space>Byteman\");$1.setRollbackOnly()" )
Buggy code:
public class PrefixExpression extends Expression { public static class Operator { private String token ; private Operator ( String token ) { } public String toString ( ) { } public static final PrefixExpression . Operator INCREMENT = new PrefixExpression . Operator ( "++" ) ; public static final PrefixExpression . Operator DECREMENT = new PrefixExpression . Operator ( "--" ) ; public static final PrefixExpression . Operator PLUS = new PrefixExpression . Operator ( "+" ) ; public static final PrefixExpression . Operator MINUS = new PrefixExpression . Operator ( "-" ) ; public static final PrefixExpression . Operator COMPLEMENT = new PrefixExpression . Operator ( "~" ) ; public static final PrefixExpression . Operator NOT = new PrefixExpression . Operator ( "!" ) ; private static final Map CODES ; public static PrefixExpression . Operator toOperator ( String token ) { } } public static final SimplePropertyDescriptor OPERATOR_PROPERTY = new SimplePropertyDescriptor ( PrefixExpression . class , "operator" , PrefixExpression . Operator . class , ASTNode . MANDATORY ) ; public static final ChildPropertyDescriptor OPERAND_PROPERTY = new ChildPropertyDescriptor ( PrefixExpression . class , "operand" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private PrefixExpression . Operator operator = PrefixExpression . Operator . PLUS ; private Expression operand = null ; PrefixExpression ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final Object internalGetSetObjectProperty ( SimplePropertyDescriptor property , boolean get , Object value ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public PrefixExpression . Operator getOperator ( ) { } public void setOperator ( PrefixExpression . Operator operator ) { } public Expression getOperand ( ) { if ( ( this . operand ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . operand ) == null ) { preLazyInit ( ) ; this . operand = new SimpleName ( this . ast ) ; postLazyInit ( this . operand , PrefixExpression . OPERAND_PROPERTY ) ; } } } return this . operand ; } public void setOperand ( Expression expression ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public final class Main { public static String getVersionString ( ) { } private static void usage ( ) { System . out . println ( "Usage:<seq2seq4repair_space>.//run.sh<seq2seq4repair_space>[args...]\n" ) ; System . out . println ( "where<seq2seq4repair_space>args<seq2seq4repair_space>include:" ) ; System . out . println ( "<seq2seq4repair_space>-D<name>[=<value>]<seq2seq4repair_space>Set<seq2seq4repair_space>a<seq2seq4repair_space>system<seq2seq4repair_space>property" ) ; System . out . println ( "<seq2seq4repair_space>-help<seq2seq4repair_space>Display<seq2seq4repair_space>this<seq2seq4repair_space>message<seq2seq4repair_space>and<seq2seq4repair_space>exit" ) ; System . out . println ( "<seq2seq4repair_space>-interprocess-address<seq2seq4repair_space><address><seq2seq4repair_space>address<seq2seq4repair_space>of<seq2seq4repair_space>socket<seq2seq4repair_space>on<seq2seq4repair_space>which<seq2seq4repair_space>this<seq2seq4repair_space>process<seq2seq4repair_space>should<seq2seq4repair_space>listen<seq2seq4repair_space>for<seq2seq4repair_space>communication<seq2seq4repair_space>from<seq2seq4repair_space>child<seq2seq4repair_space>processes" ) ; System . out . println ( "<seq2seq4repair_space>-interprocess-port<seq2seq4repair_space><port><seq2seq4repair_space>port<seq2seq4repair_space>of<seq2seq4repair_space>socket<seq2seq4repair_space>on<seq2seq4repair_space>which<seq2seq4repair_space>this<seq2seq4repair_space>process<seq2seq4repair_space>should<seq2seq4repair_space>listen<seq2seq4repair_space>for<seq2seq4repair_space>communication<seq2seq4repair_space>from<seq2seq4repair_space>child<seq2seq4repair_space>processes" ) ; <START_BUG> System . out . println ( "<seq2seq4repair_space>-P,<seq2seq4repair_space><url><seq2seq4repair_space>Load<seq2seq4repair_space>system<seq2seq4repair_space>properties<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>given<seq2seq4repair_space>url" ) ; <END_BUG> System . out . println ( "<seq2seq4repair_space>-properties<seq2seq4repair_space><url><seq2seq4repair_space>Load<seq2seq4repair_space>system<seq2seq4repair_space>properties<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>given<seq2seq4repair_space>url" ) ; System . out . println ( "<seq2seq4repair_space>-version<seq2seq4repair_space>Print<seq2seq4repair_space>version<seq2seq4repair_space>and<seq2seq4repair_space>exit\n" ) ; } public static void main ( String [ ] args ) { } Properties props = new Properties ( System . getProperties ( ) ) ; private Main ( ) { } private void boot ( String [ ] args , InputStream stdin , PrintStream stdout , PrintStream stderr ) { } private void abort ( Throwable t ) { } private ServerManagerEnvironment determineEnvironment ( String [ ] args , InputStream stdin , PrintStream stdout , PrintStream stderr ) { } private URL makeURL ( String urlspec ) throws MalformedURLException { } }

Fix:
System . out . println ( "<seq2seq4repair_space>-P<seq2seq4repair_space><url><seq2seq4repair_space>Load<seq2seq4repair_space>system<seq2seq4repair_space>properties<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>given<seq2seq4repair_space>url" ) ;
Buggy code:
public class UnaryExpression extends OperatorExpression { public Expression expression ; public Constant optimizedBooleanConstant ; public UnaryExpression ( Expression expression , int operator ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { <START_BUG> this . expression . checkNPE ( currentScope , flowContext , flowInfo , true ) ; <END_BUG> if ( ( ( ( bits ) & ( ASTNode . OperatorMASK ) ) > > ( ASTNode . OperatorSHIFT ) ) == ( OperatorIds . NOT ) ) { return this . expression . analyseCode ( currentScope , flowContext , flowInfo ) . asNegatedCondition ( ) ; } else { return this . expression . analyseCode ( currentScope , flowContext , flowInfo ) ; } } public Constant optimizedBooleanConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
this . expression . checkNPE ( currentScope , flowContext , flowInfo ) ;
Buggy code:
public class ServerControllerUnitTestCase { private final ServiceContainer container = Factory . create ( ) ; private ModelController controller ; @ Before public void beforeClass ( ) throws Exception { } @ After public void afterClass ( ) { } @ Test public void testInterfacesAlternatives ( ) throws IOException { } @ Test public void testUpdateInterface ( ) throws IOException { } @ Test public void testComplexInterface ( ) throws IOException { } protected void populateCritieria ( final ModelNode model , final boolean nested ) { } private static class ModelControllerService extends AbstractControllerService { final CountDownLatch latch = new CountDownLatch ( 1 ) ; final ServerControllerUnitTestCase . StringConfigurationPersister persister ; final ControlledProcessState processState ; volatile ManagementResourceRegistration rootRegistration ; volatile Exception error ; ModelControllerService ( final OperationContext . Type type , final ControlledProcessState processState , final ServerControllerUnitTestCase . StringConfigurationPersister persister ) { } @ Override protected void initModel ( Resource rootResource , ManagementResourceRegistration rootRegistration ) { this . rootRegistration = rootRegistration ; Properties properties = new Properties ( ) ; properties . put ( "jboss.home.dir" , "." ) ; final ServerEnvironment environment = new ServerEnvironment ( properties , new HashMap < String , String > ( ) , null , LaunchType . DOMAIN ) ; <START_BUG> ServerControllerModelUtil . initOperations ( rootRegistration , null , persister , environment , processState , null ) ; <END_BUG> } @ Override protected void boot ( List < ModelNode > bootOperations ) throws ConfigurationPersistenceException { } @ Override public void start ( StartContext context ) throws StartException { } } static class StringConfigurationPersister extends AbstractConfigurationPersister { private final List < ModelNode > bootOperations ; volatile String marshalled ; public StringConfigurationPersister ( List < ModelNode > bootOperations , XMLElementWriter < ModelMarshallingContext > rootDeparser ) { } @ Override public PersistenceResource store ( ModelNode model , Set < PathAddress > affectedAddresses ) throws ConfigurationPersistenceException { } @ Override public List < ModelNode > load ( ) throws ConfigurationPersistenceException { } private class StringPersistenceResource implements PersistenceResource { private byte [ ] bytes ; private final AbstractConfigurationPersister persister ; StringPersistenceResource ( final ModelNode model , final AbstractConfigurationPersister persister ) throws ConfigurationPersistenceException { } @ Override public void commit ( ) { } @ Override public void rollback ( ) { } } } static ModelNode readResource ( final ModelControllerClient client , final ModelNode address ) { } static void executeForFailure ( final ModelControllerClient client , final ModelNode operation ) { } static ModelNode executeForResult ( final ModelControllerClient client , final ModelNode operation ) { } }

Fix:
ServerControllerModelUtil . initOperations ( rootRegistration , null , persister , environment , processState , null , false ) ;
Buggy code:
public class RobotView extends JFrame implements Runnable { private static final long serialVersionUID = 6549981924840180076L ; private static final int ROBOTPANEL_W = 150 ; private static final int ROBOTPANEL_H = 105 ; private static final Map < Integer , ImageIcon > logos = new HashMap < Integer , ImageIcon > ( ) ; private final FieldView fieldView = new FieldView ( ) ; private final JPanel [ ] teamPanels = new JPanel [ ] { new JPanel ( ) , new JPanel ( ) , new JPanel ( ) } ; private final JLabel [ ] teamLogos = new JLabel [ ] { new JLabel ( ) , new JLabel ( ) } ; private final Map < String , JPanel > robotPanels = new HashMap < String , JPanel > ( ) ; private final Map < String , JFrame > robotDetailPanels = new HashMap < String , JFrame > ( ) ; private final JMenuItem [ ] logMenuItems ; public RobotView ( ) { } @ Override public void run ( ) { } private void updateView ( ) { final int [ ] teamNumbers = RobotData . getInstance ( ) . getTeamNumbers ( ) ; final Set < String > robotAddresses = new LinkedHashSet < String > ( robotPanels . keySet ( ) ) ; for ( int team = 0 ; team < 3 ; team ++ ) { final Iterator < RobotState > robots ; if ( team < 2 ) { if ( teamNumbers == null ) { teamLogos [ team ] . setIcon ( null ) ; } else { teamLogos [ team ] . setIcon ( getTeamIcon ( teamNumbers [ team ] ) ) ; } robots = RobotData . getInstance ( ) . getRobotsForTeam ( team ) ; } else { robots = RobotData . getInstance ( ) . getOtherRobots ( ) ; } int i = 0 ; while ( robots . hasNext ( ) ) { final RobotState robot = robots . next ( ) ; robotAddresses . remove ( robot . getAddress ( ) ) ; JPanel panel = robotPanels . get ( robot . getAddress ( ) ) ; if ( panel == null ) { panel = createRobotPanel ( robot ) ; robotPanels . put ( robot . getAddress ( ) , panel ) ; } else { updateRobotPanel ( panel , robot ) ; } JFrame detailPanel = robotDetailPanels . get ( robot . getAddress ( ) ) ; if ( detailPanel == null ) { detailPanel = createRobotDetailPanel ( robot , panel ) ; robotDetailPanels . put ( robot . getAddress ( ) , detailPanel ) ; } else { updateRobotDetailPanel ( detailPanel , robot ) ; } if ( ( teamPanels [ team ] . getComponentCount ( ) ) <= ( i + ( team < 2 ? 1 : 0 ) ) ) { teamPanels [ team ] . add ( panel ) ; panel . revalidate ( ) ; } else if ( panel != ( teamPanels [ team ] . getComponent ( ( i + ( team < 2 ? 1 : 0 ) ) ) ) ) { teamPanels [ team ] . remove ( panel ) ; teamPanels [ team ] . add ( panel , ( i + ( team < 2 ? 1 : 0 ) ) ) ; panel . revalidate ( ) ; } i ++ ; } } for ( final String addr : robotAddresses ) { <START_BUG> robotDetailPanels . remove ( addr ) . dispose ( ) ; <END_BUG> final JPanel p = robotPanels . remove ( addr ) ; for ( int i = 0 ; i < 3 ; i ++ ) { teamPanels [ i ] . remove ( p ) ; } } } private ImageIcon getTeamIcon ( final int team ) { } private JPanel createRobotPanel ( final RobotState robot ) { } private void updateRobotPanel ( final JPanel panel , final RobotState robot ) { } private JFrame createRobotDetailPanel ( final RobotState robot , final JPanel anchor ) { } private void updateRobotDetailPanel ( final JFrame frame , final RobotState robot ) { } }

Fix:
robotDetailPanels . remove ( addr ) ;
Buggy code:
class XidTransactionForgetTask extends XidTransactionManagementTask { XidTransactionForgetTask ( final TransactionRequestHandler txRequestHandler , final EJBRemoteTransactionsRepository transactionsRepository , final MarshallerFactory marshallerFactory , final XidTransactionID xidTransactionID , final ChannelAssociation channelAssociation , final short invocationId ) { } @ Override protected void manageTransaction ( ) throws Throwable { <START_BUG> final Transaction transaction = this . transactionsRepository . removeTransaction ( this . xidTransactionID ) ; <END_BUG> if ( transaction == null ) { if ( EJB3_INVOCATION_LOGGER . isDebugEnabled ( ) ) { EJB3_INVOCATION_LOGGER . debug ( ( ( "Not<seq2seq4repair_space>forgetting<seq2seq4repair_space>transaction<seq2seq4repair_space>" + ( this . xidTransactionID ) ) + "<seq2seq4repair_space>as<seq2seq4repair_space>is<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>server" ) ) ; } return ; } this . resumeTransaction ( transaction ) ; final Xid xid = this . xidTransactionID . getXid ( ) ; try { final SubordinateTransaction subordinateTransaction = SubordinationManager . getTransactionImporter ( ) . getImportedTransaction ( xid ) ; if ( subordinateTransaction == null ) { throw new XAException ( XAException . XAER_INVAL ) ; } subordinateTransaction . doForget ( ) ; } catch ( Exception ex ) { final XAException xaException = new XAException ( XAException . XAER_RMERR ) ; xaException . initCause ( ex ) ; throw xaException ; } finally { SubordinationManager . getTransactionImporter ( ) . removeImportedTransaction ( xid ) ; this . transactionsRepository . getTransactionManager ( ) . suspend ( ) ; } } }

Fix:
final Transaction transaction = this . transactionsRepository . getImportedTransaction ( this . xidTransactionID ) ;
Buggy code:
public class CompleteRun_HTML { public static boolean includeRes = true ; public static void main ( String [ ] args ) { <START_BUG> String baseDir = ( new File ( args [ 0 ] ) . getAbsoluteFile ( ) . getParentFile ( ) . getPath ( ) ) + ( File . separator ) ; <END_BUG> if ( OS . contains ( "win" ) ) { LaTeX_Compiler . suffix = "win" ; } else if ( OS . contains ( "mac" ) ) { LaTeX_Compiler . suffix = "mac" ; } else if ( ( ( OS . contains ( "nix" ) ) || ( OS . contains ( "nux" ) ) ) || ( OS . contains ( "aix" ) ) ) { LaTeX_Compiler . suffix = "unix" ; } else { System . err . println ( "Sorry,<seq2seq4repair_space>your<seq2seq4repair_space>operating<seq2seq4repair_space>system<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported!" ) ; System . exit ( ( - 1 ) ) ; } if ( ( ( ( args . length ) > 3 ) || ( ( args . length ) < 1 ) ) || ( args [ 0 ] . equalsIgnoreCase ( "--help" ) ) ) { System . out . println ( "Usage:\tjava<seq2seq4repair_space>-jar<seq2seq4repair_space>PDBF.jar<seq2seq4repair_space>LaTeX_file\nOR\n\tjava<seq2seq4repair_space>-jar<seq2seq4repair_space>PDBF.jar<seq2seq4repair_space>--vm<seq2seq4repair_space>PDBF_File.html<seq2seq4repair_space>VM_File.ova\nFor<seq2seq4repair_space>further<seq2seq4repair_space>help<seq2seq4repair_space>visit:<seq2seq4repair_space>https:////github.com//uds-datalab//PDBF" ) ; System . exit ( 0 ) ; } if ( args [ 0 ] . equalsIgnoreCase ( "--version" ) ) { try { System . out . println ( ( ( "PDBF<seq2seq4repair_space>" + ( FileUtils . readFileToString ( new File ( "VERSION.md" ) ) ) ) + "\nhttps:////github.com//uds-datalab//PDBF" ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } System . exit ( 0 ) ; } if ( args [ 0 ] . equalsIgnoreCase ( "--vm" ) ) { VM_Compiler . main ( args ) ; System . exit ( 0 ) ; } long begin = System . currentTimeMillis ( ) ; if ( CompleteRun_HTML . includeRes ) { MinifyResources . main ( args ) ; } LaTeX_Compiler . main ( args ) ; HTML_Compiler . main ( args ) ; new File ( ( baseDir + "pdbf-dim.json" ) ) . delete ( ) ; new File ( ( baseDir + "pdbf-config.json" ) ) . delete ( ) ; new File ( ( baseDir + "pdbf-db.sql" ) ) . delete ( ) ; new File ( ( baseDir + "pdbf-db.json" ) ) . delete ( ) ; new File ( ( baseDir + "null.png" ) ) . delete ( ) ; new File ( ( baseDir + "pdbf-preload" ) ) . delete ( ) ; System . out . println ( "Finished!" ) ; System . out . println ( ( ( "Took<seq2seq4repair_space>" + ( ( System . currentTimeMillis ( ) ) - begin ) ) + "ms" ) ) ; } }

Fix:
String baseDir = new File ( CompleteRun_HTML . class . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) . getPath ( ) ) . getParent ( ) ;
Buggy code:
@ Wire public class MapRenderSystem extends VoidEntitySystem { public final String layer = "infront" ; private TiledMapSystem mapSystem ; private CameraSystem cameraSystem ; public MapRenderSystem . IndividualLayerRenderer renderer ; @ Override protected void initialize ( ) { } @ Override protected void processSystem ( ) { } public static class IndividualLayerRenderer extends OrthogonalTiledMapRenderer { public IndividualLayerRenderer ( TiledMap map ) { } public void renderLayer ( TiledMapTileLayer layer ) { <START_BUG> getSpriteBatch ( ) . setColor ( 1.0F , 1.0F , 1.0F , 1.0F ) ; <END_BUG> beginRender ( ) ; super . renderTileLayer ( layer ) ; endRender ( ) ; } } }

Fix:
batch . setColor ( 1.0F , 1.0F , 1.0F , 1.0F ) ;
Buggy code:
public class Controller { SearchResponse currentList ; Food currentFood ; @ FXML private TextField searchField ; @ FXML private Button myButton ; @ FXML private TableView < SearchResponseItem > listView ; @ FXML private TextArea textArea ; @ FXML private TextField details ; @ FXML private Button getDetails ; @ FXML private Button refreshButton ; @ FXML private Button saveButton ; @ FXML private ListView < String > databaseList ; @ FXML private Button deleteButton ; @ FXML private TextField deleteField ; @ FXML private void initialize ( ) { myButton . setOnAction ( ( event ) -> { currentList = new WebManager ( ) . webSearchFoods ( searchField . getText ( ) ) ; System . out . println ( currentList . toString ( ) ) ; ObservableList < SearchResponseItem > data = FXCollections . observableArrayList ( currentList . getItem ( ) ) ; System . out . println ( data . toString ( ) ) ; TableColumn ndbno = new TableColumn ( "NDBNO" ) ; ndbno . setCellValueFactory ( new PropertyValueFactory < SearchResponseItem , String > ( "ndbno" ) ) ; TableColumn name = new TableColumn ( "Name" ) ; name . setCellValueFactory ( new PropertyValueFactory < SearchResponseItem , String > ( "name" ) ) ; TableColumn fg = new TableColumn ( "Good<seq2seq4repair_space>Group" ) ; fg . setCellValueFactory ( new PropertyValueFactory < SearchResponseItem , String > ( "group" ) ) ; listView . setItems ( data ) ; listView . getColumns ( ) . addAll ( ndbno , name , fg ) ; } ) ; getDetails . setOnAction ( ( event ) -> { currentFood = new WebManager ( ) . webFoodDetails ( details . getText ( ) ) ; textArea . setText ( currentFood . toString ( ) ) ; } ) ; saveButton . setOnAction ( ( event1 ) -> { new DataManager ( ) . saveFood ( currentFood ) ; } ) ; refreshButton . setOnAction ( ( event ) -> { List ls = new DataManager ( ) . getFoodList ( ) ; System . out . println ( ls . toString ( ) ) ; ObservableList < String > data = FXCollections . observableArrayList ( ls ) ; databaseList . setItems ( data ) ; } ) ; deleteButton . setOnAction ( ( event ) -> { <START_BUG> new DataManager ( ) . deleteFood ( Integer . parseInt ( deleteField . getText ( ) ) ) ; <END_BUG> } ) ; } }

Fix:
new DataManager ( ) . deleteFood ( deleteField . getText ( ) ) ;
Buggy code:
public abstract class AbstractReference extends AbstractQuery implements Reference { public AbstractReference ( String ... name ) { } public void process ( final PFlow pf , boolean returnFirstOnly , boolean forceUSE ) { Relationship the = null ; FastSet < Relationship > thes = FastSet . newInstance ( ) ; FastSet < Relationship > others = FastSet . newInstance ( ) ; try { Utils . getTHELikeBag ( pf , pf . getVector ( ) , thes ) ; if ( thes . isEmpty ( ) ) return ; FastSet . Record rec = thes . head ( ) ; rec = rec . getNext ( ) ; the = thes . valueOf ( rec ) ; Node node = the . getEndNode ( ) ; FastSet < Node > uses = FastSet . newInstance ( ) ; FastSet < Node > weaks = FastSet . newInstance ( ) ; FastSet < Path > directed = FastSet . newInstance ( ) ; try { getUSEs ( pf , node , uses , weaks , directed ) ; <START_BUG> if ( forceUSE && ( ( uses . isEmpty ( ) ) || ( weaks . isEmpty ( ) ) ) ) { <END_BUG> return ; } for ( FastSet . Record end = thes . tail ( ) ; ( rec = rec . getNext ( ) ) != end ; ) { uses . add ( thes . valueOf ( rec ) . getEndNode ( ) ) ; } Set < Relationship > list = getExpected ( pf ) ; if ( ( list != null ) && ( ! ( list . isEmpty ( ) ) ) ) { System . out . println ( ( "after<seq2seq4repair_space>predicate<seq2seq4repair_space>" + ( Arrays . toString ( list . toArray ( ) ) ) ) ) ; for ( Relationship r : list ) { if ( setFiltering ( r . getEndNode ( ) , uses , weaks ) ) if ( isLeaf ( r . getEndNode ( ) ) ) { pf . sendAnswer ( r ) ; if ( returnFirstOnly ) return ; } } return ; } boolean underUSE = false ; Node n = getClosestIntersection ( directed ) ; if ( n != null ) { node = n ; underUSE = true ; } Relationship res ; if ( ( ( underUSE && ( isLeaf ( node ) ) ) && ( ( res = getThe ( node ) ) != null ) ) && ( filtering ( pf , res , uses , weaks ) ) ) try { pf . sendAnswer ( res ) ; if ( returnFirstOnly ) return ; } catch ( Exception e ) { } for ( Path path : td_IS_leaf . traverse ( node ) ) { Relationship r = path . lastRelationship ( ) ; if ( ! ( Utils . haveContext ( r . getEndNode ( ) ) ) ) { if ( ! ( isLeaf ( r . getStartNode ( ) ) ) ) continue ; try { res = getThe ( r . getStartNode ( ) ) ; if ( filtering ( pf , res , uses , weaks ) ) { pf . sendAnswer ( res ) ; if ( returnFirstOnly ) return ; } } catch ( Exception e ) { for ( Path p : td_THE . traverse ( r . getStartNode ( ) ) ) { res = p . lastRelationship ( ) ; if ( filtering ( pf , res , uses , weaks ) ) { pf . sendAnswer ( res ) ; if ( returnFirstOnly ) return ; } } } } else { IndexHits < Relationship > hits = Order . context ( r . getEndNode ( ) ) ; try { for ( Relationship rr : hits ) { if ( ( rr . isType ( _ ) ) || ( rr . isType ( VALUE . _ ) ) ) { if ( filtering ( pf , rr , r . getEndNode ( ) , uses , weaks ) ) { pf . sendAnswer ( rr ) ; if ( returnFirstOnly ) return ; } } } } finally { hits . close ( ) ; } } } } finally { FastSet . recycle ( uses ) ; FastSet . recycle ( weaks ) ; FastSet . recycle ( directed ) ; } } finally { FastSet . recycle ( thes ) ; FastSet . recycle ( others ) ; } } }

Fix:
if ( forceUSE && ( ! ( ( ! ( uses . isEmpty ( ) ) ) || ( ! ( weaks . isEmpty ( ) ) ) ) ) ) {
Buggy code:
public abstract class SimilarityBase extends Similarity { private static final double LOG_2 = Math . log ( 2 ) ; protected boolean discountOverlaps = true ; public SimilarityBase ( ) { } public void setDiscountOverlaps ( boolean v ) { } public boolean getDiscountOverlaps ( ) { } @ Override public final SimWeight computeWeight ( float queryBoost , CollectionStatistics collectionStats , TermStatistics ... termStats ) { } protected BasicStats newStats ( String field , float queryBoost ) { } protected void fillBasicStats ( BasicStats stats , CollectionStatistics collectionStats , TermStatistics termStats ) { } protected abstract float score ( BasicStats stats , float freq , float docLen ) { } protected void explain ( Explanation expl , BasicStats stats , int doc , float freq , float docLen ) { } protected Explanation explain ( BasicStats stats , int doc , Explanation freq , float docLen ) { } @ Override public SimScorer simScorer ( SimWeight stats , AtomicReaderContext context ) throws IOException { } @ Override public abstract String toString ( ) { } private static final float [ ] NORM_TABLE = new float [ 256 ] ; @ Override public long computeNorm ( FieldInvertState state ) { final float numTerms ; if ( discountOverlaps ) numTerms = ( state . getLength ( ) ) - ( state . getNumOverlap ( ) ) ; else <START_BUG> numTerms = ( state . getLength ( ) ) // ( state . getBoost ( ) ) ; <END_BUG> return encodeNormValue ( state . getBoost ( ) , numTerms ) ; } protected float decodeNormValue ( byte norm ) { } protected byte encodeNormValue ( float boost , float length ) { } public static double log2 ( double x ) { } private class BasicSimScorer extends SimScorer { private final BasicStats stats ; private final NumericDocValues norms ; BasicSimScorer ( BasicStats stats , NumericDocValues norms ) throws IOException { } @ Override public float score ( int doc , float freq ) { } @ Override public Explanation explain ( int doc , Explanation freq ) { } @ Override public float computeSlopFactor ( int distance ) { } @ Override public float computePayloadFactor ( int doc , int start , int end , BytesRef payload ) { } } }

Fix:
numTerms = state . getLength ( ) ;