nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class Expression extends Statement { public int implicitConversion ; public Constant constant ; public Expression ( ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { } public Constant conditionalConstant ( ) { } public static final boolean isConstantValueRepresentable ( Constant constant , int constantTypeID , int targetTypeID ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , Label trueLabel , Label falseLabel , boolean valueRequired ) { } public void generateOptimizedStringBuffer ( BlockScope blockScope , CodeStream codeStream , int typeID ) { } public void generateOptimizedStringBufferCreation ( BlockScope blockScope , CodeStream codeStream , int typeID ) { } public void implicitWidening ( TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { } public boolean isCompactableOperation ( ) { } public boolean isConstantValueOfTypeAssignableToType ( TypeBinding constantType , TypeBinding targetType ) { } public boolean isTypeReference ( ) { } public void resolve ( BlockScope scope ) { } public TypeBinding resolveType ( BlockScope scope ) { } public TypeBinding resolveTypeExpecting ( BlockScope scope , TypeBinding expectedTb ) { TypeBinding thisTb = this . resolveType ( scope ) ; if ( thisTb == null ) return null ; <START_BUG> if ( ! ( scope . areTypesCompatible ( thisTb , expectedTb ) ) ) { <END_BUG> scope . problemReporter ( ) . typeMismatchError ( thisTb , expectedTb , this ) ; return null ; } return thisTb ; } public String toString ( int tab ) { } public String toStringExpression ( ) { } public String toStringExpression ( int tab ) { } public Expression toTypeReference ( ) { } }

Fix:
if ( ! ( org . eclipse . jdt . internal . compiler . lookup . Scope . areTypesCompatible ( thisTb , expectedTb ) ) ) {
Buggy code:
public class DefaultsAnnotationAttributeInitializer extends AnnotationAttributeInitializer { public DefaultsAnnotationAttributeInitializer ( ) { } @ Override public List < MemberValuePair > getMemberValuePairs ( IJavaElement javaElement , AST ast , Class < ? extends Annotation > annotationClass ) { } @ Override public List < MemberValuePair > getMemberValuePairs ( ASTNode astNode , AST ast , Class < ? extends Annotation > annotationClass ) { } private List < MemberValuePair > getMemberValuePairs ( AST ast , Class < ? extends Annotation > annotationClass ) { List < MemberValuePair > memberValuePairs = new ArrayList < MemberValuePair > ( ) ; Method [ ] declaredMethods = annotationClass . getDeclaredMethods ( ) ; for ( Method method : declaredMethods ) { String name = method . getName ( ) ; Class < ? > returnType = method . getReturnType ( ) ; Object defaultValue = method . getDefaultValue ( ) ; if ( defaultValue != null ) { if ( returnType . equals ( String . class ) ) { memberValuePairs . add ( AnnotationsCore . createStringMemberValuePair ( ast , name , defaultValue . toString ( ) ) ) ; } if ( returnType . equals ( Boolean . TYPE ) ) { memberValuePairs . add ( AnnotationsCore . createBooleanMemberValuePair ( ast , name , Boolean . parseBoolean ( defaultValue . toString ( ) ) ) ) ; } if ( ( returnType . isPrimitive ( ) ) && ( ( ( ( ( ( returnType . equals ( Byte . TYPE ) ) || ( returnType . equals ( Short . TYPE ) ) ) || ( returnType . equals ( Integer . TYPE ) ) ) || ( returnType . equals ( Long . TYPE ) ) ) || ( returnType . equals ( Float . TYPE ) ) ) || ( returnType . equals ( Double . TYPE ) ) ) ) { memberValuePairs . add ( AnnotationsCore . createNumberMemberValuePair ( ast , name , defaultValue ) ) ; } if ( returnType . isArray ( ) ) { memberValuePairs . add ( AnnotationsCore . createArrayMemberValuePair ( ast , method , ( ( Object [ ] ) ( defaultValue ) ) ) ) ; } if ( returnType . isEnum ( ) ) { memberValuePairs . add ( AnnotationsCore . createEnumMemberValuePair ( ast , method . getDeclaringClass ( ) . getCanonicalName ( ) , name , defaultValue ) ) ; } if ( returnType . equals ( Class . class ) ) { <START_BUG> memberValuePairs . add ( AnnotationsCore . createTypeMemberVaulePair ( ast , name , defaultValue ) ) ; <END_BUG> } } } return memberValuePairs ; } }

Fix:
memberValuePairs . add ( AnnotationsCore . createTypeMemberValuePair ( ast , name , defaultValue ) ) ;
Buggy code:
@ RunWith ( SpringJUnit4ClassRunner . class ) @ WebAppConfiguration ( "src//test//resources//META-INF//web-resources" ) @ ContextConfiguration ( "servlet-context.xml" ) public class WebAppResourceTests { @ Autowired private WebApplicationContext wac ; private MockMvc mockMvc ; @ Before public void setup ( ) { } @ Test public void tilesDefinitions ( ) throws Exception { } @ Test public void resourceRequest ( ) throws Exception { <START_BUG> this . mockMvc . perform ( get ( "//resources//Spring.js" ) ) . andExpect ( content ( ) . mimeType ( "text//javascript" ) ) . andExpect ( content ( ) . string ( containsString ( "Spring={};" ) ) ) ; <END_BUG> } @ Test public void resourcesViaDefaultServlet ( ) throws Exception { } }

Fix:
this . mockMvc . perform ( get ( "//resources//Spring.js" ) ) . andExpect ( content ( ) . contentType ( "text//javascript" ) ) . andExpect ( content ( ) . string ( containsString ( "Spring={};" ) ) ) ;
Buggy code:
public class GaussNewtonEstimator extends AbstractEstimator implements Serializable { public GaussNewtonEstimator ( int maxCostEval , double convergence , double steadyStateThreshold ) { } public void estimate ( EstimationProblem problem ) throws EstimationException { initializeEstimate ( problem ) ; double [ ] grad = new double [ parameters . length ] ; RealMatrixImpl bDecrement = new RealMatrixImpl ( parameters . length , 1 ) ; double [ ] [ ] bDecrementData = bDecrement . getDataRef ( ) ; RealMatrixImpl wGradGradT = new RealMatrixImpl ( parameters . length , parameters . length ) ; double [ ] [ ] wggData = wGradGradT . getDataRef ( ) ; double previous = Double . POSITIVE_INFINITY ; do { <START_BUG> ++ ( jacobianEvaluations ) ; <END_BUG> RealMatrix b = new RealMatrixImpl ( parameters . length , 1 ) ; RealMatrix a = new RealMatrixImpl ( parameters . length , parameters . length ) ; for ( int i = 0 ; i < ( measurements . length ) ; ++ i ) { if ( ! ( measurements [ i ] . isIgnored ( ) ) ) { double weight = measurements [ i ] . getWeight ( ) ; double residual = measurements [ i ] . getResidual ( ) ; for ( int j = 0 ; j < ( parameters . length ) ; ++ j ) { grad [ j ] = measurements [ i ] . getPartial ( parameters [ j ] ) ; bDecrementData [ j ] [ 0 ] = ( weight * residual ) * ( grad [ j ] ) ; } for ( int k = 0 ; k < ( parameters . length ) ; ++ k ) { double [ ] wggRow = wggData [ k ] ; double gk = grad [ k ] ; for ( int l = 0 ; l < ( parameters . length ) ; ++ l ) { wggRow [ l ] = ( weight * gk ) * ( grad [ l ] ) ; } } a = a . add ( wGradGradT ) ; b = b . add ( bDecrement ) ; } } try { RealMatrix dX = a . solve ( b ) ; for ( int i = 0 ; i < ( parameters . length ) ; ++ i ) { parameters [ i ] . setEstimate ( ( ( parameters [ i ] . getEstimate ( ) ) + ( dX . getEntry ( i , 0 ) ) ) ) ; } } catch ( InvalidMatrixException e ) { throw new EstimationException ( "unable<seq2seq4repair_space>to<seq2seq4repair_space>solve:<seq2seq4repair_space>singular<seq2seq4repair_space>problem" , new Object [ 0 ] ) ; } previous = cost ; updateResidualsAndCost ( ) ; } while ( ( ( getCostEvaluations ( ) ) < 2 ) || ( ( ( Math . abs ( ( previous - ( cost ) ) ) ) > ( ( cost ) * ( steadyStateThreshold ) ) ) && ( ( Math . abs ( cost ) ) > ( convergence ) ) ) ) ; } private double steadyStateThreshold ; private double convergence ; private static final long serialVersionUID = 5485001826076289109L ; }

Fix:
incrementJacobianEvaluationsCounter ( ) ;
Buggy code:
public class TypeDescriptor < T > { @ SuppressWarnings ( "unchecked" ) public static final TypeDescriptor NULL = new TypeDescriptor ( ( ( Class < ? > ) ( null ) ) ) ; private MethodParameter methodParameter ; private Field field ; private Annotation [ ] cachedFieldAnnotations ; private Class < ? > type ; public TypeDescriptor ( Class < ? > type ) { } public TypeDescriptor ( MethodParameter methodParameter ) { } public TypeDescriptor ( Field field ) { } public Class < ? > getType ( ) { } public String getName ( ) { } public boolean isArray ( ) { } public boolean isCollection ( ) { } public Class < ? > getElementType ( ) { } public boolean isMap ( ) { } public boolean isMapEntryTypeKnown ( ) { } public Class < ? > getMapKeyType ( ) { } public Class < ? > getMapValueType ( ) { } public Annotation [ ] getAnnotations ( ) { if ( ( field ) != null ) { if ( ( cachedFieldAnnotations ) == null ) { cachedFieldAnnotations = field . getAnnotations ( ) ; } return cachedFieldAnnotations ; } else if ( ( methodParameter ) != null ) { <START_BUG> return methodParameter . getParameterAnnotations ( ) ; <END_BUG> } else { return null ; } } public MethodParameter getMethodParameter ( ) { } public Field getField ( ) { } public boolean isAbstractClass ( ) { } public boolean isInstance ( Object obj ) { } @ SuppressWarnings ( "unchecked" ) public boolean isAssignableTo ( TypeDescriptor targetType ) { } public static < T > TypeDescriptor < T > valueOf ( Class < T > type ) { } @ SuppressWarnings ( "unchecked" ) public static TypeDescriptor forObject ( Object object ) { } public String asString ( ) { } private Class < ? > wrapperType ( Class < ? > type ) { } private Class < ? > getArrayComponentType ( ) { } @ SuppressWarnings ( "unchecked" ) private Class < ? > getCollectionElementType ( ) { } private boolean isTypeAssignableTo ( Class < ? > clazz ) { } }

Fix:
return methodParameter . getMethod ( ) . getAnnotations ( ) ;
Buggy code:
public class RouletteV2ZorukTest { @ Rule public ExpectedException exception = ExpectedException . none ( ) ; @ Rule public EphemeralClientServerPair roulettePair = new EphemeralClientServerPair ( RouletteV2Protocol . VERSION ) ; @ Test @ TestAuthor ( githubId = "Zoruk" ) public void theClientShoudBeV2 ( ) throws IOException { } @ Test @ TestAuthor ( githubId = "Zoruk" ) public void theClearFunctionShoudBeCalledWithNoStudents ( ) throws IOException { } @ Test @ TestAuthor ( githubId = "Zoruk" ) public void theClearFunctionShoudRemoveAllStudents ( ) throws IOException { roulettePair . getClient ( ) . loadStudent ( "Super<seq2seq4repair_space>student" ) ; ( ( RouletteV2ClientImpl ) ( roulettePair . getClient ( ) ) ) . clearDataStore ( ) ; <START_BUG> assertEquals ( roulettePair . getClient ( ) . getNumberOfStudents ( ) , 1 ) ; <END_BUG> } @ Test @ TestAuthor ( githubId = "Zoruk" ) public void weShoudGetAllStudentsAtOntTime ( ) throws IOException { } @ TestAuthor ( githubId = "Zoruk" ) public void theNumberOfStudentShouldBeCorrect ( ) throws IOException { } @ Test @ TestAuthor ( githubId = "Zoruk" ) public void theServerShoudHandleMultipleClientAtSameTime ( ) throws IOException { } No newline ; at end ; of file ; }

Fix:
assertEquals ( roulettePair . getClient ( ) . getNumberOfStudents ( ) , 0 ) ;
Buggy code:
public class ScriptDef extends DefBase { private ScriptRunner runner = new ScriptRunner ( ) ; private String name ; private List attributes = new ArrayList ( ) ; private List nestedElements = new ArrayList ( ) ; private Set attributeSet ; private Map nestedElementMap ; public void setName ( String name ) { } public boolean isAttributeSupported ( String attributeName ) { } public static class Attribute { private String name ; public void setName ( String name ) { } } public void addAttribute ( ScriptDef . Attribute attribute ) { } public static class NestedElement { private String name ; private String type ; private String className ; public void setName ( String name ) { } public void setType ( String type ) { } public void setClassName ( String className ) { } } public void addElement ( ScriptDef . NestedElement nestedElement ) { } public void execute ( ) { } public Object createNestedElement ( String elementName ) { } public void executeScript ( Map attributes , Map elements ) { runner . addBean ( "attributes" , attributes ) ; runner . addBean ( "elements" , elements ) ; runner . addBean ( "project" , getProject ( ) ) ; <START_BUG> runner . executeScript ( ( ( "scriptdef<seq2seq4repair_space><" + ( name ) ) + ">" ) ) ; <END_BUG> } public void setLanguage ( String language ) { } public void setSrc ( File file ) { } public void addText ( String text ) { } }

Fix:
runner . executeScript ( ( "scriptdef_" + ( name ) ) ) ;
Buggy code:
public class Images { private static Map < String , Icon > images = new HashMap < String , Icon > ( ) ; public static Icon NEXT = Images . getIcon ( "images//nav_forward.gif" ) ; public static Icon BACK = Images . getIcon ( "images//nav_backward.gif" ) ; public static Icon DONE = Images . getIcon ( "images//done.png" ) ; public static Icon CANCEL = Images . getIcon ( "images//cancel.png" ) ; public static Icon ERROR = Images . getIcon ( "images//error.png" ) ; public static Icon BROWSE = Images . getIcon ( "images//browse.png" ) ; public static Icon START = Images . getIcon ( "images//start_task.gif" ) ; public static Icon MONITOR = Images . getIcon ( "images//console_view.gif" ) ; public static Icon JAVA = Images . getIcon ( "images//SourceCode.jpg" , true ) ; public static Icon getIcon ( String name ) { } public static Icon getIcon ( String name , boolean scale ) { } public static Icon getIcon ( String name , int width , int height ) { Icon icon = Images . getIcon ( name ) ; if ( icon == null ) { return null ; } <START_BUG> icon = new ImageIcon ( ( ( ImageIcon ) ( icon ) ) . getImage ( ) . getScaledInstance ( 32 , ( - 1 ) , Image . SCALE_SMOOTH ) ) ; <END_BUG> return icon ; } protected static ImageIcon createImageIcon ( String path ) { } }

Fix:
icon = new ImageIcon ( ( ( ImageIcon ) ( icon ) ) . getImage ( ) . getScaledInstance ( width , height , Image . SCALE_SMOOTH ) ) ;
Buggy code:
public class TypeDeclarationLocator extends PatternLocator { protected TypeDeclarationPattern pattern ; public TypeDeclarationLocator ( TypeDeclarationPattern pattern ) { } public int match ( TypeDeclaration node , MatchingNodeSet nodeSet ) { } public int resolveLevel ( ASTNode node ) { } public int resolveLevel ( Binding binding ) { if ( binding == null ) return PatternLocator . INACCURATE_MATCH ; if ( ! ( binding instanceof TypeBinding ) ) return PatternLocator . IMPOSSIBLE_MATCH ; TypeBinding type = ( ( TypeBinding ) ( binding ) ) ; <START_BUG> switch ( this . pattern . classOrInterface ) { <END_BUG> case IIndexConstants . CLASS_SUFFIX : if ( type . isInterface ( ) ) return PatternLocator . IMPOSSIBLE_MATCH ; break ; case IIndexConstants . INTERFACE_SUFFIX : if ( ! ( type . isInterface ( ) ) ) return PatternLocator . IMPOSSIBLE_MATCH ; break ; case IIndexConstants . TYPE_SUFFIX : } if ( ( this . pattern ) instanceof QualifiedTypeDeclarationPattern ) { QualifiedTypeDeclarationPattern qualifiedPattern = ( ( QualifiedTypeDeclarationPattern ) ( this . pattern ) ) ; return resolveLevelForType ( qualifiedPattern . simpleName , qualifiedPattern . qualification , type ) ; } else { char [ ] enclosingTypeName = ( ( this . pattern . enclosingTypeNames ) == null ) ? null : CharOperation . concatWith ( this . pattern . enclosingTypeNames , '.' ) ; return resolveLevelForType ( this . pattern . simpleName , this . pattern . pkg , enclosingTypeName , type ) ; } } protected int resolveLevelForType ( char [ ] simpleNamePattern , char [ ] qualificationPattern , char [ ] enclosingNamePattern , TypeBinding type ) { } public String toString ( ) { } }

Fix:
switch ( this . pattern . typeSuffix ) {
Buggy code:
public class Login extends Activity { private EditText emailET ; private EditText passwordET ; private BootstrapButton btnlogin ; private BootstrapButton btnregister ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_login ) ; RelativeLayout rLayout = ( ( RelativeLayout ) ( findViewById ( rLayout ) ) ) ; Resources res = getResources ( ) ; Drawable drawable = res . getDrawable ( bg1 ) ; rLayout . setBackgroundDrawable ( drawable ) ; emailET = ( ( EditText ) ( findViewById ( R . id . emailET ) ) ) ; passwordET = ( ( EditText ) ( findViewById ( R . id . passwordET ) ) ) ; emailET . setTextSize ( 20 ) ; emailET . setTextColor ( getResources ( ) . getColor ( abs__background_holo_dark ) ) ; passwordET . setTextSize ( 20 ) ; passwordET . setTextColor ( getResources ( ) . getColor ( abs__background_holo_dark ) ) ; emailET . setInputType ( ( ( InputType . TYPE_CLASS_TEXT ) | ( InputType . TYPE_TEXT_VARIATION_EMAIL_ADDRESS ) ) ) ; <START_BUG> emailET . setText ( "geoshopper@gmail.com" ) ; <END_BUG> passwordET . setText ( "123123" ) ; btnregister = ( ( BootstrapButton ) ( findViewById ( registerBtn ) ) ) ; btnlogin = ( ( BootstrapButton ) ( findViewById ( loginBtn ) ) ) ; btnregister . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View arg0 ) { Intent intent = new Intent ( Login . this , RegisterUser . class ) ; startActivity ( intent ) ; } } ) ; btnlogin . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { Form mForm = new Form ( ) ; Validate validEmail = new Validate ( emailET ) ; Validate validpwd = new Validate ( passwordET ) ; validEmail . addValidator ( new EmailValidator ( Login . this ) ) ; validpwd . addValidator ( new NotEmptyValidator ( Login . this ) ) ; mForm . addValidates ( validEmail ) ; mForm . addValidates ( validpwd ) ; ArrayList < Validate > validList = new ArrayList < Validate > ( ) ; validList . add ( validEmail ) ; validList . add ( validpwd ) ; Intent intent = new Intent ( ) ; Loginvalidatior loginController = new Loginvalidatior ( Login . this ) ; loginController . validateForm ( intent , mForm , validList ) ; } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } public EditText getEmailET ( ) { } public void setEmailET ( EditText emailET ) { } public EditText getPasswordET ( ) { } public void setPasswordET ( EditText passwordET ) { } }

Fix:
emailET . setText ( "geosaler@gmail.com" ) ;
Buggy code:
class CollectionGenericConverter implements GenericConverter { private GenericConversionService conversionService ; public CollectionGenericConverter ( GenericConversionService conversionService ) { } public boolean canConvert ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { } private TypeDescriptor getElementType ( Collection collection ) { for ( Object element : collection ) { if ( element != null ) { return TypeDescriptor . valueOf ( element . getClass ( ) ) ; } } <START_BUG> return null ; <END_BUG> } private Collection compatibleCollectionWithoutElementConversion ( Collection source , TypeDescriptor targetType ) { } }

Fix:
return TypeDescriptor . NULL ;
Buggy code:
public abstract class HeaderResponse implements IHeaderResponse { private final Set < Object > rendered = new HashSet < Object > ( ) ; private boolean closed ; public final void markRendered ( Object object ) { } public void renderCSSReference ( ResourceReference reference ) { } public void renderCSSReference ( ResourceReference reference , String media ) { } public void renderCSSReference ( ResourceReference reference , PageParameters pageParameters , String media ) { } public void renderCSSReference ( String url ) { } public void renderCSSReference ( String url , String media ) { } private void internalRenderCSSReference ( String url , String media ) { } public void renderJavaScriptReference ( ResourceReference reference ) { } public void renderJavaScriptReference ( ResourceReference reference , String id ) { } public void renderJavaScriptReference ( ResourceReference reference , PageParameters pageParameters , String id ) { } public void renderJavaScriptReference ( String url ) { } public void renderJavaScriptReference ( String url , String id ) { } private void internalRenderJavaScriptReference ( String url , String id ) { if ( Strings . isEmpty ( url ) ) { throw new IllegalArgumentException ( "url<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>empty<seq2seq4repair_space>or<seq2seq4repair_space>null" ) ; } if ( ! ( closed ) ) { List < String > token1 = Arrays . asList ( "javascript" , url ) ; List < String > token2 = ( id != null ) ? Arrays . asList ( "javascript" , id ) : null ; final boolean token1Unused = ( wasRendered ( token1 ) ) == false ; <START_BUG> final boolean token2Unused = ( token2 != null ) ? ( wasRendered ( token2 ) ) == false : true ; <END_BUG> if ( token1Unused && token2Unused ) { JavaScriptUtils . writeJavaScriptUrl ( getResponse ( ) , url , id ) ; markRendered ( token1 ) ; if ( token2 != null ) { markRendered ( token2 ) ; } } } } public void renderJavaScript ( CharSequence javascript , String id ) { } public void renderString ( CharSequence string ) { } public final boolean wasRendered ( Object object ) { } public void renderOnDomReadyJavaScript ( String javascript ) { } public void renderOnLoadJavaScript ( String javascript ) { } public void renderOnEventJavaScript ( String target , String event , String javascript ) { } public void close ( ) { } public final Response getResponse ( ) { } public boolean isClosed ( ) { } private String relative ( final String location ) { } protected abstract Response getRealResponse ( ) { } }

Fix:
final boolean token2Unused = ( token2 == null ) || ( ( wasRendered ( token2 ) ) == false ) ;
Buggy code:
public class JasperC extends DefaultCompilerAdapter { public boolean execute ( ) throws TaskException { getLogger ( ) . debug ( "Using<seq2seq4repair_space>jasper<seq2seq4repair_space>compiler" ) ; Commandline cmd = setupJasperCommand ( ) ; try { Java java = null ; if ( ( getJspc ( ) . getClasspath ( ) ) != null ) <START_BUG> java . setClasspath ( getJspc ( ) . getClasspath ( ) ) ; <END_BUG> java . setClassname ( "org.apache.jasper.JspC" ) ; String [ ] args = cmd . getArguments ( ) ; for ( int i = 0 ; i < ( args . length ) ; i ++ ) java . createArg ( ) . setValue ( args [ i ] ) ; java . execute ( ) ; return true ; } catch ( Exception ex ) { if ( ex instanceof TaskException ) { throw ( ( TaskException ) ( ex ) ) ; } else { throw new TaskException ( "Error<seq2seq4repair_space>running<seq2seq4repair_space>jsp<seq2seq4repair_space>compiler:<seq2seq4repair_space>" , ex ) ; } } } private Commandline setupJasperCommand ( ) { } }

Fix:
java . addClasspath ( getJspc ( ) . getClasspath ( ) ) ;
Buggy code:
public class SchemaCheckVerbHandler implements IVerbHandler { private final Logger logger = LoggerFactory . getLogger ( SchemaCheckVerbHandler . class ) ; public void doVerb ( Message message ) { logger . debug ( "Received<seq2seq4repair_space>schema<seq2seq4repair_space>check<seq2seq4repair_space>request." ) ; <START_BUG> Message response = message . getInternalReply ( DatabaseDescriptor . getDefsVersion ( ) . toString ( ) . getBytes ( ) ) ; <END_BUG> MessagingService . instance ( ) . sendOneWay ( response , message . getFrom ( ) ) ; } }

Fix:
Message response = message . getInternalReply ( DatabaseDescriptor . getDefsVersion ( ) . toString ( ) . getBytes ( ) , message . getVersion ( ) ) ;
Buggy code:
public class RolesTest { @ BeforeClass public static void setup ( ) { Class < ? > [ ] exclude = new Class < ? > [ ] { TestRigidObjectExceptions . class , TestOriginalRigidTurnOffRoleMethod . class , TestMissProcessingWrongObjectType . class , TestWriteClasses . class , TestRigidAnnotationSingleStrategy . class , TestRigidAnnotationMultipleStrategy . class , TestPkgMatchTypes . class , TestPlay . class , TestInheritAnnotation . class } ; <START_BUG> new RoleRegisterComposition ( "pt.mashashi.javaroles" ) . excludeGiven ( exclude ) . registerRoles ( ) ; <END_BUG> } @ Test public void testMethodRoleObjectMethodCall ( ) { } @ Test public void testWithNullRoleObjects ( ) { } @ Test public void testWithNotAccessibleClasses ( ) { } @ Test public void testRigidCall ( ) { } @ Test public void testNotInRole ( ) { } @ Test public void testToSecondRoleFirstNull ( ) { } @ Test public void testRoleSurpressed ( ) { } @ Test public void testRigidCallMadeWrong ( ) { } @ Test public void testCallMultiInput ( ) { } @ Test public void testRigidObjectExceptions ( ) { } @ Test public void testOriginalRigidTurnOffRoleMethod ( ) { } @ Test public void testOriginalRigidVoidMethod ( ) { } @ Test public void testOriginalRigidVoidMethodException ( ) { } @ Test public void testMissProcessing ( ) { } @ Test public void testMissProcessingWrongObjectType ( ) { } @ Test public void testRigidAnnotationSingleStrategy ( ) { } @ Test public void TestRigidAnnotationMultipleStrategy ( ) { } @ Test public void testWriteClasses ( ) { } @ Test public void testPkgMatchTypes ( ) { } @ Test public void testPlay ( ) { } @ Test public void testPlayCheck ( ) { } @ Test public void testInjectionMethod ( ) { } @ Test public void testInheritAnnotation ( ) { } No newline ; at end ; of file ; }

Fix:
new RoleRegisterComposition ( "pt.mashashi.javaroles.composition" ) . excludeGiven ( exclude ) . registerRoles ( ) ;
Buggy code:
public class UIUtilities { private static final String LOG_TAG = "UIUtilities" ; private UIUtilities ( ) { } public static void showImageToast ( Context context , int id , Drawable drawable ) { } public static void showImageToast ( Context context , String text , Drawable drawable ) { } public static void showToast ( Context context , int id ) { } public static void showToast ( Context context , int id , boolean longToast ) { } public static void showToast ( Context context , String text ) { } public static void showToast ( Context context , String text , boolean longToast ) { } public static void showFormattedImageToast ( Context context , int id , Drawable drawable , Object ... args ) { } public static void showFormattedToast ( Context context , int id , Object ... args ) { } public static void showIdentificationDots ( TextView identification_dots , int pos ) { <START_BUG> String [ ] dotsArray = new String [ ] { "<seq2seq4repair_space>ﾥ<seq2seq4repair_space>" , "<seq2seq4repair_space>ﾥ<seq2seq4repair_space>" , "<seq2seq4repair_space>ﾥ<seq2seq4repair_space>" } ; <END_BUG> dotsArray [ pos ] = ( "<font<seq2seq4repair_space>color='red'<seq2seq4repair_space>size='20px'>" + ( dotsArray [ pos ] ) ) + "<//font>" ; StringBuilder dots = new StringBuilder ( ) ; for ( String i : dotsArray ) { dots . append ( i ) ; } identification_dots . setText ( Html . fromHtml ( dots . toString ( ) ) , SPANNABLE ) ; } public static boolean isHoneycomb ( ) { } public static boolean isHoneycombTablet ( Context context ) { } public static boolean isICS ( ) { } public static boolean isGingerbread ( ) { } public static Dialog createUnsupportedDialog ( Activity a ) { } public static boolean isPaid ( ContentResolver cr , Context context ) { } }

Fix:
String [ ] dotsArray = new String [ ] { "<seq2seq4repair_space>*<seq2seq4repair_space>" , "<seq2seq4repair_space>*<seq2seq4repair_space>" , "<seq2seq4repair_space>*<seq2seq4repair_space>" } ;
Buggy code:
public class Maintenance { public static HashMap < String , Boolean > runStatus ; public static boolean flagSet ; private static void resetBigAccountHarvestIndexes ( ) throws UnknownHostException { } private static void cleanBigAccs ( ) throws FuckinUpKPException { } private static void cleanToFollows ( ) throws UnknownHostException , FuckinUpKPException { } public static void safeShutDownAccounts ( ) { } public static void safeShutdownSystem ( ) { } public static void performMaintenance ( ) throws Exception { } public static void writeLog ( String message , String subDir ) { } public static void writeLog ( String message , int index ) { } public static void writeLog ( String message ) { } public static void writeLog ( ) { } public static String writeStackTrace ( Exception e ) { <START_BUG> String error = "" ; <END_BUG> for ( StackTraceElement elem : e . getStackTrace ( ) ) { error += elem . toString ( ) ; error += "\n" ; } return error ; } No newline ; at end ; of file ; }

Fix:
String error = ( e . toString ( ) ) + "\n" ;
Buggy code:
public class KeyboardPanel extends AbstractKeyboardPanel < DisplayButton > { public KeyboardPanel ( ) { } public void loadKeyboardLayout ( @ NotNull KeyboardLayout layout ) { } public void setKeyboardLayout ( @ NotNull KeyboardLayout layout ) { } private void fillKeyboard ( @ NotNull KeyboardLayout curKeyboard ) { int [ ] lastLeftPositionInRows = curKeyboard . getLastLeftPositionInRows ( ) ; int minLastLeftPosition = Integer . MAX_VALUE ; for ( int lastLeftPosition : lastLeftPositionInRows ) minLastLeftPosition = Math . min ( minLastLeftPosition , lastLeftPosition ) ; <START_BUG> for ( int row = DIGIT_KEYS . ordinal ( ) ; row <= ( LOWER_KEYS . ordinal ( ) ) ; row ++ ) <END_BUG> keyboardRows [ row ] . removeAll ( ) ; boolean rowSwitch ; int oldRow = - 1 ; final int lastIndex = ( keyboardButtons . size ( ) ) - 1 ; int counter = 0 ; for ( DisplayButton aButton : keyboardButtons ) { if ( counter == lastIndex ) break ; int buttonRow = aButton . getPositionLesson ( ) . ordinal ( ) ; rowSwitch = oldRow != buttonRow ; int lastLeftPositionInRow = lastLeftPositionInRows [ buttonRow ] ; while ( rowSwitch && ( minLastLeftPosition < lastLeftPositionInRow ) ) { keyboardRows [ buttonRow ] . add ( getSubstituitionPanel ( KeyButton . getStdDimension ( ) ) ) ; lastLeftPositionInRow -- ; } keyboardRows [ buttonRow ] . add ( aButton ) ; assert buttonRow != 4 ; oldRow = buttonRow ; counter ++ ; } int maxNumKeys = getMaxNumberOfKeyboardButtonsInRow ( ) ; int maxWidth = ( DisplayButton . DEFAULT_WIDTH ) * maxNumKeys ; Box ctrlBox = keyboardRows [ ( ( NUM_OF_KYB_ROWS ) - 1 ) ] ; for ( int index = 0 ; index < 3 ; index ++ ) ctrlBox . add ( modifierButtons . get ( index ) ) ; DisplayButton spaceButton = keyboardButtons . get ( lastIndex ) ; Constants . setConstantSize ( spaceButton , new Dimension ( ( maxWidth - ( getModifierButtonsWidth ( ) ) ) , spaceButton . getHeight ( ) ) ) ; spaceButton . setCurrentModifier ( ModifierKeys . MODIFIER_VALUES [ 0 ] ) ; ctrlBox . add ( spaceButton ) ; for ( int index = 3 ; index < ( LAST_ROW_MODIFIERS . length ) ; index ++ ) ctrlBox . add ( modifierButtons . get ( index ) ) ; } No newline ; at end ; of file ; }

Fix:
for ( int row = DIGIT_KEYS . ordinal ( ) ; row <= ( SPACE_BAR . ordinal ( ) ) ; row ++ )
Buggy code:
public class LegacyAnimationFeedback extends RectangleAnimationFeedbackBase { private static final int LINE_WIDTH = 1 ; private Display display ; private Region shellRegion ; private Shell theShell ; public LegacyAnimationFeedback ( Shell parentShell , Rectangle start , Rectangle end ) { } public void renderStep ( AnimationEngine engine ) { } public void initialize ( AnimationEngine engine ) { theShell = new Shell ( getAnimationShell ( ) , ( ( SWT . NO_TRIM ) | ( SWT . ON_TOP ) ) ) ; display = theShell . getDisplay ( ) ; <START_BUG> Color color = display . getSystemColor ( COLOR_WIDGET_FOREGROUND ) ; <END_BUG> theShell . setBackground ( color ) ; shellRegion = new Region ( display ) ; theShell . setRegion ( shellRegion ) ; } public void dispose ( ) { } public boolean jobInit ( AnimationEngine engine ) { } }

Fix:
Color color = display . getSystemColor ( COLOR_WIDGET_DARK_SHADOW ) ;
Buggy code:
public class BuildPipelineTriggerTest extends HudsonTestCase { @ Override @ Before protected void setUp ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testInvalidConstructor ( ) { } @ Test public void testBuildPipelineTrigger ( ) throws IOException { } @ Test public void testOnDownstreamProjectRenamed ( ) throws IOException { } @ Test public void testOnDownstreamProjectDeleted ( ) { } @ Test public void testOnRenamed ( ) throws IOException { } @ Test public void testOnDeleted ( ) throws IOException , InterruptedException { } @ Test public void testDoCheckDownstreamProjectNames ( ) throws IOException , InterruptedException { final AbstractProject upstreamProject = createFreeStyleProject ( "Upstream" ) ; final String proj1 = "Proj1" ; final String proj2 = "Proj2" ; createFreeStyleProject ( proj1 ) ; final BuildPipelineTrigger . DescriptorImpl di = new BuildPipelineTrigger . DescriptorImpl ( ) ; assertEquals ( FormValidation . ok ( ) , di . doCheckDownstreamProjectNames ( upstreamProject , proj1 ) ) ; <START_BUG> assertThat ( FormValidation . error ( ( ( ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>project<seq2seq4repair_space>'" + proj2 ) + "'.<seq2seq4repair_space>Did<seq2seq4repair_space>you<seq2seq4repair_space>mean<seq2seq4repair_space>'" ) + proj1 ) + "'?" ) ) . toString ( ) , is ( di . doCheckDownstreamProjectNames ( upstreamProject , proj2 ) . toString ( ) ) ) ; <END_BUG> } @ Test public void testRemoveDownstreamTrigger ( ) throws IOException , InterruptedException { } @ Test public void testCyclicDownstreamTrigger ( ) throws IOException , InterruptedException { } @ Test public void testGetBuilderConfigDescriptors ( ) throws Exception { } }

Fix:
assertThat ( FormValidation . error ( ( ( ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>project<seq2seq4repair_space>‘" + proj2 ) + "’.<seq2seq4repair_space>Did<seq2seq4repair_space>you<seq2seq4repair_space>mean<seq2seq4repair_space>‘" ) + proj1 ) + "’?" ) ) . toString ( ) , is ( di . doCheckDownstreamProjectNames ( upstreamProject , proj2 ) . toString ( ) ) ) ;
Buggy code:
public class SystemTable { private static Logger logger = LoggerFactory . getLogger ( SystemTable . class ) ; public static final String STATUS_CF = "LocationInfo" ; private static final byte [ ] LOCATION_KEY = "L" . getBytes ( Charsets . UTF_8 ) ; private static final byte [ ] BOOTSTRAP_KEY = "Bootstrap" . getBytes ( Charsets . UTF_8 ) ; private static final byte [ ] GRAVEYARD_KEY = "Graveyard" . getBytes ( Charsets . UTF_8 ) ; private static final byte [ ] COOKIE_KEY = "Cookies" . getBytes ( Charsets . UTF_8 ) ; private static final byte [ ] BOOTSTRAP = "B" . getBytes ( Charsets . UTF_8 ) ; private static final byte [ ] TOKEN = "Token" . getBytes ( Charsets . UTF_8 ) ; private static final byte [ ] GENERATION = "Generation" . getBytes ( Charsets . UTF_8 ) ; private static final byte [ ] CLUSTERNAME = "ClusterName" . getBytes ( Charsets . UTF_8 ) ; private static final byte [ ] PARTITIONER = "Partioner" . getBytes ( Charsets . UTF_8 ) ; private static SystemTable . StorageMetadata metadata ; private static DecoratedKey decorate ( byte [ ] key ) { } public static void purgeIncompatibleHints ( ) throws IOException { } public static synchronized void updateToken ( InetAddress ep , Token token ) { } public static synchronized void updateToken ( Token token ) { } public static void checkHealth ( ) throws ConfigurationException { } public static synchronized SystemTable . StorageMetadata initMetadata ( ) throws IOException { } public static boolean isBootstrapped ( ) { } public static void setBootstrapped ( boolean isBootstrapped ) { } public static ColumnFamily getDroppedCFs ( ) throws IOException { ColumnFamilyStore cfs = Table . open ( SYSTEM_TABLE ) . getColumnFamilyStore ( SystemTable . STATUS_CF ) ; <START_BUG> return cfs . getColumnFamily ( QueryFilter . getSliceFilter ( SystemTable . decorate ( SystemTable . GRAVEYARD_KEY ) , new QueryPath ( SystemTable . STATUS_CF ) , "" . getBytes ( ) , "" . getBytes ( ) , null , false , 100 ) ) ; <END_BUG> } public static void deleteDroppedCfMarkers ( Collection < IColumn > cols ) throws IOException { } public static void markForRemoval ( CFMetaData cfm ) { } public static class StorageMetadata { private Token token ; private int generation ; private byte [ ] cluster ; StorageMetadata ( Token storageId , int generation , byte [ ] clustername ) { } public Token getToken ( ) { } public void setToken ( Token storageId ) { } public int getGeneration ( ) { } public byte [ ] getClusterName ( ) { } } }

Fix:
return cfs . getColumnFamily ( QueryFilter . getSliceFilter ( SystemTable . decorate ( SystemTable . GRAVEYARD_KEY ) , new QueryPath ( SystemTable . STATUS_CF ) , "" . getBytes ( ) , "" . getBytes ( ) , false , 100 ) ) ;
Buggy code:
public class StratController { static Direction [ ] directions = new Direction [ ] { Direction . NORTH , Direction . NORTH_EAST , Direction . EAST , Direction . SOUTH_EAST , Direction . SOUTH , Direction . SOUTH_WEST , Direction . WEST , Direction . NORTH_WEST } ; public static boolean shouldBuildHere ( RobotController rc , MapLocation m ) { } public static boolean isSafe ( RobotController rc , MapLocation m ) { } public static MapLocation findBuildLocation ( RobotController rc ) { } public static RobotType toMake ( RobotController rc ) throws GameActionException { } static int mindex ( int [ ] options ) { } public static void calculateRatios ( RobotController rc ) { try { int maxBarracks = 1 ; int maxHelipad = 1 ; int maxMinerfactory = 2 ; int maxTankfactory = 3 ; int maxSupply = 5 ; int maxAerospace = 0 ; int maxTechnologyInstitute = 1 ; int maxTrainingField = 1 ; int roundNum = Clock . getRoundNum ( ) ; int mapSize = 3600 ; int maxSoldiers = 0 ; int maxDrones = 60 ; int maxMiner = 50 ; int maxTank = 50 ; int maxLauncher = 20 ; <START_BUG> int maxBasher = 100 ; <END_BUG> rc . broadcast ( BUILD_NUM_BARRACKS . getValue ( ) , maxBarracks ) ; rc . broadcast ( BUILD_NUM_HELIPAD . getValue ( ) , maxHelipad ) ; rc . broadcast ( BUILD_NUM_MINEFACTORY . getValue ( ) , maxMinerfactory ) ; rc . broadcast ( BUILD_NUM_TANKFACTORY . getValue ( ) , maxTankfactory ) ; rc . broadcast ( BUILD_NUM_SUPPLY . getValue ( ) , maxSupply ) ; rc . broadcast ( BUILD_NUM_AEROSPACELAB . getValue ( ) , maxAerospace ) ; rc . broadcast ( BUILD_NUM_SOLDIER . getValue ( ) , maxSoldiers ) ; rc . broadcast ( BUILD_NUM_DRONE . getValue ( ) , maxDrones ) ; rc . broadcast ( BUILD_NUM_MINER . getValue ( ) , maxMiner ) ; rc . broadcast ( BUILD_NUM_TANK . getValue ( ) , maxTank ) ; rc . broadcast ( BUILD_NUM_LAUNCHER . getValue ( ) , maxLauncher ) ; rc . broadcast ( BUILD_NUM_BASHER . getValue ( ) , maxBasher ) ; } catch ( Exception e ) { System . out . println ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>claculating<seq2seq4repair_space>ratios<seq2seq4repair_space>" + e ) ) ; } } }

Fix:
int maxBasher = 20 ;
Buggy code:
final class Command implements ICommand { private static final boolean DEBUG_HANDLERS = ( Policy . DEBUG_HANDLERS ) && ( Policy . DEBUG_HANDLERS_VERBOSE ) ; private static final String DEBUG_HANDLERS_COMMAND_ID = Policy . DEBUG_HANDLERS_VERBOSE_COMMAND_ID ; private static final int HASH_FACTOR = 89 ; private static final int HASH_INITIAL = Command . class . getName ( ) . hashCode ( ) ; private String categoryId ; private List commandListeners ; private Set commandsWithListeners ; private List contextBindings ; private transient IContextBinding [ ] contextBindingsAsArray ; private boolean defined ; private String description ; private IHandler handler ; private transient int hashCode ; private transient boolean hashCodeComputed ; private String id ; private List imageBindings ; private transient IImageBinding [ ] imageBindingsAsArray ; private List keySequenceBindings ; private transient IKeySequenceBinding [ ] keySequenceBindingsAsArray ; private String name ; private transient String string ; Command ( Set commandsWithListeners , String id ) { } public void addCommandListener ( ICommandListener commandListener ) { } public int compareTo ( Object object ) { } public boolean equals ( Object object ) { } public void execute ( Object parameter ) throws ExecutionException , NotHandledException { } void fireCommandChanged ( CommandEvent commandEvent ) { } public Map getAttributeValuesByName ( ) throws NotHandledException { } public String getCategoryId ( ) throws NotDefinedException { } public List getContextBindings ( ) { } public String getDescription ( ) throws NotDefinedException { } public String getId ( ) { } public List getImageBindings ( ) { } public List getKeySequenceBindings ( ) { } public String getName ( ) throws NotDefinedException { } public int hashCode ( ) { } public boolean isDefined ( ) { } public boolean isHandled ( ) { <START_BUG> if ( ( handler ) != null ) <END_BUG> return false ; Map attributeValuesByName = handler . getAttributeValuesByName ( ) ; if ( ( attributeValuesByName . containsKey ( "handled" ) ) && ( ! ( Boolean . TRUE . equals ( attributeValuesByName . get ( "handled" ) ) ) ) ) return false ; else return true ; } public void removeCommandListener ( ICommandListener commandListener ) { } boolean setCategoryId ( String categoryId ) { } boolean setContextBindings ( List contextBindings ) { } boolean setDefined ( boolean defined ) { } boolean setDescription ( String description ) { } boolean setHandler ( IHandler handler ) { } boolean setImageBindings ( List imageBindings ) { } boolean setKeySequenceBindings ( List keySequenceBindings ) { } boolean setName ( String name ) { } public String toString ( ) { } }

Fix:
if ( ( handler ) == null )
Buggy code:
public class ClientCallFuture < V > implements ICompletableFuture < V > , Callback { static final ILogger LOGGER = Logger . getLogger ( ClientCallFuture . class ) ; private final int heartBeatInterval ; private final int retryCount ; private final int retryWaitTime ; private volatile Object response ; private final ClientRequest request ; private final ClientExecutionServiceImpl executionService ; private final ClientInvocationServiceImpl invocationService ; private final ClientListenerServiceImpl clientListenerService ; private final SerializationService serializationService ; private final EventHandler handler ; private AtomicInteger reSendCount = new AtomicInteger ( ) ; private volatile ClientConnection connection ; private List < ClientCallFuture < V > . ExecutionCallbackNode > callbackNodeList = new LinkedList < ClientCallFuture < V > . ExecutionCallbackNode > ( ) ; public ClientCallFuture ( HazelcastClientInstanceImpl client , ClientRequest request , EventHandler handler ) { } @ Override public boolean cancel ( boolean mayInterruptIfRunning ) { } @ Override public boolean isCancelled ( ) { } @ Override public boolean isDone ( ) { } @ Override public V get ( ) throws InterruptedException , ExecutionException { } @ Override public V get ( long timeout , TimeUnit unit ) throws InterruptedException , ExecutionException , TimeoutException { } private boolean isConnectionHealthy ( long elapsed ) { if ( elapsed >= ( heartBeatInterval ) ) { <START_BUG> return ( connection . isAlive ( ) ) && ( connection . isHeartBeating ( ) ) ; <END_BUG> } return true ; } @ Override public void notify ( Object response ) { } private void setResponse ( Object response ) { } private V resolveResponse ( ) throws InterruptedException , ExecutionException , TimeoutException { } @ Override public void andThen ( ExecutionCallback < V > callback ) { } @ Override public void andThen ( ExecutionCallback < V > callback , Executor executor ) { } public void andThenInternal ( ExecutionCallback < Data > callback ) { } public ClientRequest getRequest ( ) { } public EventHandler getHandler ( ) { } public ClientConnection getConnection ( ) { } public boolean resend ( ) { } private void sleep ( ) { } private void runAsynchronous ( final ExecutionCallback callback , Executor executor , final boolean deserialized ) { } public void setConnection ( ClientConnection connection ) { } class ReSendTask implements Runnable { @ Override public void run ( ) { } } class ExecutionCallbackNode { final ExecutionCallback callback ; final Executor executor ; final boolean deserialized ; ExecutionCallbackNode ( ExecutionCallback callback , Executor executor , boolean deserialized ) { } } }

Fix:
return connection . isHeartBeating ( ) ;
Buggy code:
public class VerticalPartioningTripleStoreRWSmartLock implements TripleStore { private static Logger logger = Logger . getLogger ( VerticalPartioningTripleStoreRWSmartLock . class ) ; private final Map < Long , Multimap < Long , Long > > internalstore ; private final Map < Long , ReentrantReadWriteLock > predicatesLocks ; private final ReentrantReadWriteLock globalLock ; private final AtomicInteger triples ; public VerticalPartioningTripleStoreRWSmartLock ( ) { } private ReentrantReadWriteLock getLock ( final long p ) { } @ Override public boolean add ( final Triple t ) { } @ Override public Collection < Triple > addAll ( final Collection < Triple > triples ) { } @ Override public void remove ( final Triple t ) { } @ Override public Collection < Triple > getAll ( ) { } @ Override public Collection < Triple > getbySubject ( final long s ) { } @ Override public Collection < Triple > getbyPredicate ( final long p ) { Collection < Triple > result = null ; this . globalLock . readLock ( ) . lock ( ) ; Multimap < Long , Long > map = null ; try { map = this . internalstore . get ( p ) ; } catch ( final Exception e ) { VerticalPartioningTripleStoreRWSmartLock . logger . error ( "" , e ) ; } finally { this . globalLock . readLock ( ) . unlock ( ) ; if ( map == null ) { return new ArrayList < Triple > ( ) ; } } final ReentrantReadWriteLock lock = this . getLock ( p ) ; lock . writeLock ( ) . lock ( ) ; try { result = new ArrayList < Triple > ( ) ; for ( final Map . Entry < Long , Long > entry : map . entries ( ) ) { result . add ( new ImmutableTriple ( entry . getKey ( ) , p , entry . getValue ( ) ) ) ; } } catch ( final Exception e ) { VerticalPartioningTripleStoreRWSmartLock . logger . error ( "" , e ) ; } finally { <START_BUG> lock . readLock ( ) . unlock ( ) ; <END_BUG> } return result ; } @ Override public Collection < Triple > getbyObject ( final long o ) { } @ Override public long size ( ) { } @ Override public boolean isEmpty ( ) { } @ Override public void writeToFile ( final String file , final Dictionary dictionary ) { } @ Override public boolean contains ( final Triple triple ) { } @ Override public boolean contains ( final long s , final long p , final long o ) { } private boolean containsNoLock ( final long s , final long p , final long o ) { } @ Override public Multimap < Long , Long > getMultiMapForPredicate ( final long p ) { } @ Override public Collection < Long > getPredicates ( ) { } @ Override public void clear ( ) { } @ Override public void add ( final long s , final long p , final long o ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( final Object obj ) { } }

Fix:
lock . writeLock ( ) . unlock ( ) ;
Buggy code:
public class TypeDescriptor < T > { @ SuppressWarnings ( "unchecked" ) public static final TypeDescriptor NULL = new TypeDescriptor ( ( ( Class < ? > ) ( null ) ) ) ; private MethodParameter methodParameter ; private Field field ; private Annotation [ ] cachedFieldAnnotations ; private Class < ? > type ; public TypeDescriptor ( Class < ? > type ) { } public TypeDescriptor ( MethodParameter methodParameter ) { } public TypeDescriptor ( Field field ) { } public Class < ? > getType ( ) { } public String getName ( ) { } public boolean isArray ( ) { } public boolean isCollection ( ) { } public Class < ? > getElementType ( ) { } public boolean isMap ( ) { } public boolean isMapEntryTypeKnown ( ) { } public Class < ? > getMapKeyType ( ) { } public Class < ? > getMapValueType ( ) { } public Annotation [ ] getAnnotations ( ) { if ( ( field ) != null ) { if ( ( cachedFieldAnnotations ) == null ) { cachedFieldAnnotations = field . getAnnotations ( ) ; } return cachedFieldAnnotations ; } else if ( ( methodParameter ) != null ) { return methodParameter . getMethod ( ) . getAnnotations ( ) ; } else { <START_BUG> return null ; <END_BUG> } } public MethodParameter getMethodParameter ( ) { } public Field getField ( ) { } public boolean isAbstractClass ( ) { } public boolean isInstance ( Object obj ) { } @ SuppressWarnings ( "unchecked" ) public boolean isAssignableTo ( TypeDescriptor targetType ) { } public static < T > TypeDescriptor < T > valueOf ( Class < T > type ) { } @ SuppressWarnings ( "unchecked" ) public static TypeDescriptor forObject ( Object object ) { } public String asString ( ) { } private Class < ? > wrapperType ( Class < ? > type ) { } private Class < ? > getArrayComponentType ( ) { } @ SuppressWarnings ( "unchecked" ) private Class < ? > getCollectionElementType ( ) { } private boolean isTypeAssignableTo ( Class < ? > clazz ) { } }

Fix:
return new Annotation [ 0 ] ;