nus-yam/ex-repair huggingface dataset:
Buggy code:
@ SqlGroup ( { @ Sql ( executionPhase = ExecutionPhase . BEFORE_TEST_METHOD , scripts = "classpath:insertModalities.sql" ) , @ Sql ( executionPhase = ExecutionPhase . BEFORE_TEST_METHOD , scripts = "classpath:insertOrderTypes.sql" ) , @ Sql ( executionPhase = ExecutionPhase . AFTER_TEST_METHOD , scripts = "classpath:truncateTables.sql" ) } ) @ PrepareForTest ( WebClientFactory . class ) public class EncounterFeedWorkerTest extends BaseIntegrationTest { @ Mock private HttpClient webClient ; @ Autowired private OrderRepository orderRepository ; @ Autowired private EncounterFeedWorker encounterFeedWorker ; @ Before public void setUp ( ) throws Exception { } @ Test public void shouldSendRadiologyOrderToAModality ( ) throws Exception { } @ Test public void shouldAddToFailedEventsWhenModalityIsNotAvailable ( ) throws Exception { <START_BUG> modalityStubServer . stop ( ) ; <END_BUG> try { encounterFeedWorker . process ( new Event ( "event<seq2seq4repair_space>id" , "//encounter//1" ) ) ; Assert . fail ( "Should<seq2seq4repair_space>be<seq2seq4repair_space>throwing<seq2seq4repair_space>a<seq2seq4repair_space>exception<seq2seq4repair_space>since<seq2seq4repair_space>modality<seq2seq4repair_space>is<seq2seq4repair_space>down" ) ; } catch ( RuntimeException e ) { Assert . assertEquals ( "Failed<seq2seq4repair_space>send<seq2seq4repair_space>order<seq2seq4repair_space>to<seq2seq4repair_space>modality" , e . getMessage ( ) ) ; List < Order > savedOrders = orderRepository . findAll ( ) ; assertEquals ( 0 , savedOrders . size ( ) ) ; } } No newline ; at end ; of file ; }

Fix:
modalityStubServer . stopAndWait ( ) ;
Buggy code:
public class TLStickerSet extends TLObject { public static final int CONSTRUCTOR_ID = - 1240849242 ; protected com . github . badoualy . telegram . tl . api . TLStickerSet set ; protected TLVector < ? extends TLStickerPack > packs ; protected TLVector < ? extends TLAbsDocument > documents ; public TLStickerSet ( ) { } public TLStickerSet ( com . github . badoualy . telegram . tl . api . TLStickerSet set , TLVector < ? extends TLStickerPack > packs , TLVector < ? extends TLAbsDocument > documents ) { } @ Override public void serializeBody ( OutputStream stream ) throws IOException { } @ Override @ SuppressWarnings ( "unchecked" ) public void deserializeBody ( InputStream stream , TLContext context ) throws IOException { <START_BUG> set = StreamUtils . readTLObject ( stream , context , com . github . badoualy . telegram . tl . api . TLStickerSet . class , TLStickerSet . CONSTRUCTOR_ID ) ; <END_BUG> packs = StreamUtils . readTLVector ( stream , context ) ; documents = StreamUtils . readTLVector ( stream , context ) ; } @ Override public int computeSerializedSize ( ) { } @ Override public String toString ( ) { } @ Override public int getConstructorId ( ) { } public com . github . badoualy . telegram . tl . api . TLStickerSet getSet ( ) { } public void setSet ( com . github . badoualy . telegram . tl . api . TLStickerSet set ) { } public TLVector < ? extends TLStickerPack > getPacks ( ) { } public void setPacks ( TLVector < ? extends TLStickerPack > packs ) { } public TLVector < ? extends TLAbsDocument > getDocuments ( ) { } public void setDocuments ( TLVector < ? extends TLAbsDocument > documents ) { } }

Fix:
set = StreamUtils . readTLObject ( stream , context , com . github . badoualy . telegram . tl . api . TLStickerSet . class , com . github . badoualy . telegram . tl . api . TLStickerSet . CONSTRUCTOR_ID ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { <START_BUG> getMenuInflater ( ) . inflate ( menu_recipe_list , menu ) ; <END_BUG> return true ; } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
getMenuInflater ( ) . inflate ( menu_main , menu ) ;
Buggy code:
public class LiftWithSticks extends Command { public LiftWithSticks ( ) { } protected void initialize ( ) { } protected void execute ( ) { elevator . liftWithSticks ( ) ; <START_BUG> SmartDashboard . putNumber ( "Stick<seq2seq4repair_space>Val" , oi . getManipulatorLeftStick ( ) ) ; <END_BUG> } protected boolean isFinished ( ) { } protected void end ( ) { } protected void interrupted ( ) { } }

Fix:
SmartDashboard . putNumber ( "Stick<seq2seq4repair_space>Val" , oi . getManipulatorLeftStickY ( ) ) ;
Buggy code:
public class ResourceStreamRequestHandler implements IRequestHandler { private static final Logger log = LoggerFactory . getLogger ( ResourceStreamRequestHandler . class ) ; private String fileName ; private ContentDisposition contentDisposition = ContentDisposition . INLINE ; private final IResourceStream resourceStream ; public ResourceStreamRequestHandler ( IResourceStream resourceStream ) { } public ResourceStreamRequestHandler ( IResourceStream resourceStream , String fileName ) { } public void detach ( IRequestCycle requestCycle ) { } @ Override public boolean equals ( Object obj ) { if ( obj instanceof ResourceStreamRequestHandler ) { ResourceStreamRequestHandler that = ( ( ResourceStreamRequestHandler ) ( obj ) ) ; <START_BUG> return ( resourceStream . equals ( that . resourceStream ) ) && ( ( fileName ) != null ? fileName . equals ( that . fileName ) : true ) ; <END_BUG> } return false ; } public final String getFileName ( ) { } public final IResourceStream getResourceStream ( ) { } @ Override public int hashCode ( ) { } public void respond ( IRequestCycle requestCycle ) { } public final ResourceStreamRequestHandler setFileName ( String fileName ) { } @ Override public String toString ( ) { } public final ContentDisposition getContentDisposition ( ) { } public final ResourceStreamRequestHandler setContentDisposition ( ContentDisposition contentDisposition ) { } }

Fix:
return ( resourceStream . equals ( that . resourceStream ) ) && ( ( ( fileName ) == null ) || ( fileName . equals ( that . fileName ) ) ) ;
Buggy code:
public class JexlProperties extends Task implements PropertyInterceptor { JexlContext jc ; public static String PREFIX = "jexl:" ; public JexlProperties ( ) { } public boolean setProperty ( Object ctx , String ns , String name , Object value ) { } public Object getProperty ( Object p , String ns , String name ) { } public void execute ( ) { <START_BUG> PropertyHelper phelper = PropertyHelper . getPropertyHelper ( project ) ; <END_BUG> phelper . addPropertyInterceptor ( this ) ; jc = JexlHelper . createContext ( ) ; jc . getVars ( ) . put ( "ant" , project ) ; } }

Fix:
PropertyHelper2 phelper = PropertyHelper2 . getPropertyHelper ( project ) ;
Buggy code:
public interface ManagerComponent extends Component { @ Override default Class < ManagerComponent > getComponentClass ( ) { } < PK , E , B extends Buildable < E > > void put ( Manager < PK , E , B > manager ) { } <START_BUG> < PK , E , B extends Buildable < E > , M extends Manager < PK , E , B > > Manager < PK , E , B > manager ( Class < M > managerClass ) ; <END_BUG> < PK , E , B extends Buildable < E > > Manager < PK , E , B > managerOf ( Class < E > entityClass ) { } Stream < Manager < ? , ? , ? > > stream ( ) { } }

Fix:
< PK , E , B extends Buildable < E > , M extends Manager < PK , E , B > > M manager ( Class < M > managerClass ) ;
Buggy code:
public class PatchConfigXmlUnitTestCase { @ Test public void testCumulativeGenerated ( ) throws Exception { final InputStream is = PatchConfigXmlUnitTestCase . getResource ( "test-config01.xml" ) ; final PatchConfig patchConfig = PatchConfigXml . parse ( is ) ; assertNotNull ( patchConfig ) ; assertEquals ( "patch-12345" , patchConfig . getPatchId ( ) ) ; assertEquals ( "patch<seq2seq4repair_space>description" , patchConfig . getDescription ( ) ) ; assertNotNull ( patchConfig . getPatchType ( ) ) ; assertEquals ( CUMULATIVE , patchConfig . getPatchType ( ) ) ; assertTrue ( patchConfig . isGenerateByDiff ( ) ) ; assertEquals ( "2.3.4" , patchConfig . getResultingVersion ( ) ) ; <START_BUG> PatchConfigXmlUnitTestCase . validateAppliesTo ( patchConfig , "1.2.3" , "1.2.4" ) ; <END_BUG> PatchConfigXmlUnitTestCase . validateInRuntimeUse ( patchConfig ) ; } @ Test public void testOneOffGenerated ( ) throws Exception { } @ Test public void testCumulativeSpecified ( ) throws Exception { } @ Test public void testOneOffSpecified ( ) throws Exception { } private void specifiedContentTest ( String configFile ) throws Exception { } private static InputStream getResource ( String name ) throws IOException { } private static void validateAppliesTo ( final PatchConfig patchConfig , String ... expected ) { } private static void validateInRuntimeUse ( final PatchConfig patchConfig ) { } private static void validateInRuntimeUse ( final PatchConfig patchConfig , Set < String > validInUse ) { } }

Fix:
PatchConfigXmlUnitTestCase . validateAppliesTo ( patchConfig , "1.2.3" ) ;
Buggy code:
public final class DynamicWander implements MovementBehavior { public DynamicFace face ; public float wanderOffset ; public float wanderRadius ; public float wanderRate ; public float wanderOrientation ; public float maxLinearAccelerationMagnitude ; public DynamicWander ( Rigidbody2D character , float maxLinearAccelerationMagnitude , float maxAngularSpeed , float maxAngularAccelerationMagnitude , float slowAngleThreshold , float targetAngleThreshold , float wanderOffset , float wanderRadius , float wanderRate , float wanderOrientation ) { } @ Override public SteeringOutput getSteering ( ) { this . wanderOrientation += ( MathUtils . randomBinomial ( ) ) * ( this . wanderRate ) ; float targetOrientation = ( this . wanderOrientation ) + ( face . align . character . getOrientation ( ) ) ; PVector characterOrientationAsVector = PVector . fromAngle ( face . align . character . getOrientation ( ) ) ; PVector centerOfWanderCircleOffset = PVector . mult ( characterOrientationAsVector , this . wanderOffset ) ; PVector centerOfWanderCircle = PVector . add ( face . align . character . getPosition ( ) , centerOfWanderCircleOffset ) ; PVector targetOrientationAsVector = PVector . fromAngle ( targetOrientation ) ; PVector circleTargetLocation = PVector . mult ( targetOrientationAsVector , this . wanderRadius ) ; PVector targetPosition = PVector . add ( centerOfWanderCircle , circleTargetLocation ) ; <START_BUG> face . align . target . setPosition ( targetPosition ) ; <END_BUG> DynamicSteeringOutput steering = ( ( DynamicSteeringOutput ) ( face . getSteering ( ) ) ) ; if ( steering != null ) { characterOrientationAsVector . normalize ( ) ; PVector linearAcceleration = PVector . mult ( characterOrientationAsVector , this . maxLinearAccelerationMagnitude ) ; steering . setLinearAcceleration ( linearAcceleration ) ; } return steering ; } }

Fix:
face . faceTarget . setPosition ( targetPosition ) ;
Buggy code:
public class SharedResourceRequestTarget implements ISharedResourceRequestTarget { private static final Logger log = LoggerFactory . getLogger ( SharedResourceRequestTarget . class ) ; private final RequestParameters requestParameters ; public SharedResourceRequestTarget ( RequestParameters requestParameters ) { } public void detach ( RequestCycle requestCycle ) { } public boolean equals ( Object obj ) { } public final RequestParameters getRequestParameters ( ) { } public final String getResourceKey ( ) { } public int hashCode ( ) { } public void respond ( RequestCycle requestCycle ) { Application application = requestCycle . getApplication ( ) ; SharedResources sharedResources = application . getSharedResources ( ) ; final String resourceKey = getRequestParameters ( ) . getResourceKey ( ) ; Resource resource = sharedResources . get ( resourceKey ) ; if ( resource == null ) { int ix = resourceKey . indexOf ( '//' ) ; if ( ix != ( - 1 ) ) { String className = resourceKey . substring ( 0 , ix ) ; IClassResolver resolver = application . getApplicationSettings ( ) . getClassResolver ( ) ; Class scope = null ; try { scope = Application . get ( ) . getSharedResources ( ) . getAliasClass ( className ) ; if ( scope == null ) { scope = resolver . resolveClass ( className ) ; } String path = resourceKey . substring ( ( ix + 1 ) ) ; PackageResource packageResource = PackageResource . get ( scope , path ) ; if ( ( sharedResources . get ( resourceKey ) ) == null ) { <START_BUG> sharedResources . add ( resourceKey , packageResource ) ; <END_BUG> } resource = packageResource ; } catch ( Exception e ) { SharedResourceRequestTarget . log . error ( ( "unable<seq2seq4repair_space>to<seq2seq4repair_space>lazily<seq2seq4repair_space>register<seq2seq4repair_space>shared<seq2seq4repair_space>resource<seq2seq4repair_space>" + resourceKey ) , e ) ; } } } if ( resource == null ) { Response response = requestCycle . getResponse ( ) ; if ( response instanceof WebResponse ) { ( ( WebResponse ) ( response ) ) . getHttpServletResponse ( ) . setStatus ( SC_NOT_FOUND ) ; SharedResourceRequestTarget . log . error ( ( ( "shared<seq2seq4repair_space>resource<seq2seq4repair_space>" + resourceKey ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ) ; return ; } else { throw new WicketRuntimeException ( ( ( "shared<seq2seq4repair_space>resource<seq2seq4repair_space>" + resourceKey ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ) ; } } if ( ( requestParameters ) != null ) { resource . setParameters ( requestParameters . getParameters ( ) ) ; } resource . onResourceRequested ( ) ; } public String toString ( ) { } }

Fix:
sharedResources . add ( scope , path , null , null , packageResource ) ;
Buggy code:
public class DateActivity extends AppCompatActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; RecyclerView recyclerView = ( ( RecyclerView ) ( findViewById ( recyclerView ) ) ) ; recyclerView . setAdapter ( new DemoAdapter ( this ) ) ; recyclerView . setLayoutManager ( new LinearLayoutManager ( this ) ) ; <START_BUG> new com . turingtechnologies . materialscrollbar . MaterialScrollBar ( this , recyclerView , false ) . addIndicator ( new DateAndTimeIndicator ( this , false , true , true , true ) ) ; <END_BUG> } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
new com . turingtechnologies . materialscrollbar . MaterialScrollBar ( this , recyclerView , false ) . addIndicator ( new DateAndTimeIndicator ( this , false , true , true , true ) , true ) ;
Buggy code:
public class Util { private static Log log = LogFactory . getLog ( Util . class ) ; private static String serviceProviderId = null ; private static String identityProviderURI = null ; private static String authorizationEndpointURI = null ; private static String tokenEndpointURI = null ; private static String userInfoURI = null ; private static String jwksURI = null ; private static String clientId = null ; private static String clientSecret = null ; private static String responseType = null ; private static String authorizationType = null ; private static String scope = null ; private static String redirectURI = null ; private static String loginPage = "//carbon//admin//login.jsp" ; private static boolean initSuccess = false ; public static boolean initOIDCConfigParams ( ) { } public static boolean isAuthenticatorEnabled ( ) { AuthenticatorsConfiguration authenticatorsConfiguration = AuthenticatorsConfiguration . getInstance ( ) ; AuthenticatorsConfiguration . AuthenticatorConfig authenticatorConfig = authenticatorsConfiguration . getAuthenticatorConfig ( AUTHENTICATOR_NAME ) ; <START_BUG> return ! ( authenticatorConfig . isDisabled ( ) ) ; <END_BUG> } public static String buildAuthRequestUrl ( String nonce , String state ) { } public static String createRandomString ( ) { } public static String getLoginPage ( ) { } public static String getIdentityProviderURI ( ) { } public static String getServiceProviderId ( ) { } public static String getTokenEndpointURI ( ) { } public static String getUserInfoURI ( ) { } public static String getJwksURI ( ) { } public static String getClientId ( ) { } public static String getClientSecret ( ) { } public static String getAuthorizationType ( ) { } }

Fix:
return authenticatorConfig == null ? false : ! ( authenticatorConfig . isDisabled ( ) ) ;
Buggy code:
final class WSVirtualFileFilter implements VirtualFileFilterWithAttributes { private VisitorAttributes attributes ; WSVirtualFileFilter ( ) { } WSVirtualFileFilter ( final VisitorAttributes attributes ) { } public VisitorAttributes getAttributes ( ) { } public boolean accepts ( final VirtualFile file ) { if ( file == null ) { return false ; } <START_BUG> final String fileName = file . getName ( ) . toLowerCase ( ) ; <END_BUG> final boolean hasWsdlSuffix = fileName . endsWith ( ".wsdl" ) ; final boolean hasXsdSuffix = fileName . endsWith ( ".xsd" ) ; final boolean hasXmlSuffix = fileName . endsWith ( ".xml" ) ; return ( hasWsdlSuffix || hasXsdSuffix ) || hasXmlSuffix ; } }

Fix:
final String fileName = file . getLowerCaseName ( ) ;
Buggy code:
public class Concat extends AbstractVal { private final Val _val1 ; private final Val _val2 ; private ClassMetaData _meta = null ; public Concat ( Val val1 , Val val2 ) { } public Val getVal1 ( ) { } public Val getVal2 ( ) { } public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } public ExpState initialize ( Select sel , ExpContext ctx , int flags ) { } public void select ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void selectColumns ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void groupBy ( Select sel , ExpContext ctx , ExpState state ) { } public void orderBy ( Select sel , ExpContext ctx , ExpState state , boolean asc ) { <START_BUG> sel . orderBy ( newSQLBuffer ( sel , ctx , state ) , asc , false ) ; <END_BUG> } private SQLBuffer newSQLBuffer ( Select sel , ExpContext ctx , ExpState state ) { } public Object load ( ExpContext ctx , ExpState state , Result res ) throws SQLException { } public void calculateValue ( Select sel , ExpContext ctx , ExpState state , Val other , ExpState otherState ) { } public int length ( Select sel , ExpContext ctx , ExpState state ) { } public void appendTo ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql , int index ) { } public void acceptVisit ( ExpressionVisitor visitor ) { } public int getId ( ) { } }

Fix:
sel . orderBy ( newSQLBuffer ( sel , ctx , state ) , asc , false , getSelectAs ( ) ) ;
Buggy code:
public class FileFileFilter extends AbstractFileFilter implements Serializable { public static final IOFileFilter FILE = new FileFileFilter ( ) ; protected FileFileFilter ( ) { } @ Override <START_BUG> public boolean accept ( File file ) { <END_BUG> return file . isFile ( ) ; } }

Fix:
public boolean accept ( final File file ) {
Buggy code:
@ RunWith ( Arquillian . class ) public class DefaultInterceptorsTestCase { @ Deployment public static Archive < ? > deploy ( ) { } @ Test public void testDefaultInterceptorApplied ( ) throws NamingException { } @ Test public void testDefaultInterceptorAppliedTwice ( ) throws NamingException { } @ Test public void testClassLevelExcludeDefaultInterceptors ( ) throws NamingException { } @ Test public void testClassLevelExcludeDefaultMethodLevelExcludeClassInterceptors ( ) throws NamingException { InitialContext ctx = new InitialContext ( ) ; NoDefaultInterceptorsSLSB bean = ( ( NoDefaultInterceptorsSLSB ) ( ctx . lookup ( ( "java:module//" + ( NoDefaultInterceptorsSLSB . class . getSimpleName ( ) ) ) ) ) ) ; final String message = bean . noClassLevel ( ) ; <START_BUG> Assert . assertEquals ( "Hello" , ( ( MethodInterceptor . MESSAGE ) + message ) ) ; <END_BUG> Assert . assertTrue ( ( ! ( bean . isPostConstructCalled ( ) ) ) ) ; } @ Test public void testMethodLevelExcludeDefaultInterceptors ( ) throws NamingException { } @ Test public void testMethodLevelExcludeDefaultAndClassInterceptors ( ) throws NamingException { } }

Fix:
Assert . assertEquals ( ( ( MethodInterceptor . MESSAGE ) + "Hello" ) , message ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class BasicIIOPInvocationTestCase { @ Deployment ( name = "server" , testable = false ) @ TargetsContainer ( "iiop-server" ) public static Archive < ? > deployment ( ) { } @ Deployment ( name = "client" , testable = true ) @ TargetsContainer ( "iiop-client" ) public static Archive < ? > clientDeployment ( ) { } @ Test @ OperateOnDeployment ( "client" ) public void testRemoteIIOPInvocation ( ) throws IOException , NamingException { } @ Test @ OperateOnDeployment ( "client" ) public void testHomeHandle ( ) throws IOException , NamingException { } @ Test @ OperateOnDeployment ( "client" ) public void testHandle ( ) throws IOException , NamingException { } @ Test @ OperateOnDeployment ( "client" ) public void testWrappedHandle ( ) throws IOException , NamingException { final ClientEjb ejb = client ( ) ; <START_BUG> Assert . assertEquals ( "hello" , ejb . getRemoteViaHandleMessage ( ) ) ; <END_BUG> } @ Test @ OperateOnDeployment ( "client" ) public void testEjbMetadata ( ) throws IOException , NamingException { } @ Test @ OperateOnDeployment ( "client" ) public void testIsIdentical ( ) throws IOException , NamingException { } private ClientEjb client ( ) throws NamingException { } }

Fix:
Assert . assertEquals ( "hello" , ejb . getRemoteViaWrappedHandle ( ) ) ;
Buggy code:
@ Entity @ Table ( name = "ANNONCE" ) public class Annonce { private Long id ; private String title ; private double costPerHour ; private String description ; private String location ; private String subject ; private String level ; private User user ; public Annonce ( ) { } public String toString ( ) { } @ Id @ GeneratedValue ( strategy = GenerationType . IDENTITY ) @ Column ( name = "ANNONCE_ID" ) public Long getId ( ) { } public void setId ( Long id ) { } @ Column ( name = "TITLE" ) public String getTitle ( ) { } public void setTitle ( String title ) { } @ Column ( name = "COST_PER_HOUR" ) public double getCostPerHour ( ) { } public void setCostPerHour ( double costPerHour ) { } @ Column ( name = "DESCRIPTION" ) public String getDescription ( ) { } public void setDescription ( String description ) { } @ Column ( name = "LOCATION" ) public String getLocation ( ) { } public void setLocation ( String location ) { } @ Column ( name = "SUBJECT" ) public String getSubject ( ) { } public void setSubject ( String subject ) { } @ Column ( name = "LEVEL" ) public String getLevel ( ) { } public void setLevel ( String level ) { } <START_BUG> @ ManyToOne ( fetch = FetchType . LAZY ) <END_BUG> @ JoinColumn ( name = "USER_ID" , nullable = false ) public User getUser ( ) { return user ; } public void setUser ( User user ) { } }

Fix:
@ ManyToOne ( fetch = FetchType . EAGER )
Buggy code:
public class Logger { private final Class classObj ; public Logger ( Class classObj ) { } public void log ( String msg ) { } <START_BUG> public void logError ( IOException e ) { <END_BUG> System . err . println ( ( ( ( ( ( "[" + ( new Date ( ) ) ) + "]<seq2seq4repair_space>" ) + ( classObj . getName ( ) ) ) + "\n\t\t<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) ) ; } }

Fix:
public void logError ( Exception e ) {
Buggy code:
public class XMPPID extends BaseID implements IChatID { private static final long serialVersionUID = 3257289140701049140L ; public static final char USER_HOST_DELIMITER = '@' ; public static final char PORT_DELIMITER = ':' ; public static final char PATH_DELIMITER = '//' ; URI uri ; String username ; String hostname ; String resourcename ; int port = - 1 ; protected static String fixEscape ( String src ) { } public XMPPID ( Namespace namespace , String unamehost ) throws URISyntaxException { } protected int namespaceCompareTo ( BaseID o ) { } protected boolean namespaceEquals ( BaseID o ) { } protected String namespaceGetName ( ) { } protected int namespaceHashCode ( ) { <START_BUG> return uri . hashCode ( ) ; <END_BUG> } public String getUsername ( ) { } public String getHostname ( ) { } public String getResourceName ( ) { } public int getPort ( ) { } public String getUsernameAtHost ( ) { } public String toString ( ) { } public Object getAdapter ( Class clazz ) { } }

Fix:
return getUsernameAtHost ( ) . hashCode ( ) ;
Buggy code:
public class JavaHTMLViewerPlugin extends JScrollPane implements IHTMLViewerPlugin { private HTMLEditorKit htmlEditorKit ; private JavaHTMLViewerPlugin . AsynchronousHTMLDocument doc ; private JTextPane textPane ; public JavaHTMLViewerPlugin ( ) { } private void postView ( ) { <START_BUG> URL baseUrl = DiskIO . getResourceURL ( "org//columba//core//images//" ) ; <END_BUG> ( ( HTMLDocument ) ( textPane . getDocument ( ) ) ) . setBase ( baseUrl ) ; textPane . setCaretPosition ( 0 ) ; } public void view ( String text ) { } public JComponent getComponent ( ) { } public class AsynchronousHTMLDocument extends HTMLDocument { public AsynchronousHTMLDocument ( ) { } public int getAsynchronousLoadPriority ( ) { } public String getTextWithLineBreaks ( int start , int end ) throws BadLocationException { } } public boolean initialized ( ) { } public String getSelectedText ( ) { } public JComponent getContainer ( ) { } }

Fix:
URL baseUrl = DiskIO . getResourceURL ( "org//columba//core//icons//MISC//" ) ;
Buggy code:
public class Aj implements ClassPreProcessor { private IWeavingContext weavingContext ; private static Trace trace = TraceFactory . getTraceFactory ( ) . getTrace ( Aj . class ) ; public Aj ( ) { } public Aj ( IWeavingContext context ) { } public void initialize ( ) { } public byte [ ] preProcess ( String className , byte [ ] bytes , ClassLoader loader ) { } static class WeaverContainer { private static Map weavingAdaptors = new WeakHashMap ( ) ; static WeavingAdaptor getWeaver ( ClassLoader loader , IWeavingContext weavingContext ) { Aj . ExplicitlyInitializedClassLoaderWeavingAdaptor adaptor = null ; synchronized ( Aj . WeaverContainer . weavingAdaptors ) { adaptor = ( ( Aj . ExplicitlyInitializedClassLoaderWeavingAdaptor ) ( Aj . WeaverContainer . weavingAdaptors . get ( loader ) ) ) ; if ( adaptor == null ) { String loaderClassName = loader . getClass ( ) . getName ( ) ; if ( loaderClassName . equals ( "sun.reflect.DelegatingClassLoader" ) ) { return null ; } else { <START_BUG> ClassLoaderWeavingAdaptor weavingAdaptor = new ClassLoaderWeavingAdaptor ( loader , weavingContext ) ; <END_BUG> adaptor = new Aj . ExplicitlyInitializedClassLoaderWeavingAdaptor ( weavingAdaptor ) ; Aj . WeaverContainer . weavingAdaptors . put ( loader , adaptor ) ; } } } return adaptor . getWeavingAdaptor ( loader , weavingContext ) ; } } static class ExplicitlyInitializedClassLoaderWeavingAdaptor { private final ClassLoaderWeavingAdaptor weavingAdaptor ; private boolean isInitialized ; public ExplicitlyInitializedClassLoaderWeavingAdaptor ( ClassLoaderWeavingAdaptor weavingAdaptor ) { } private void initialize ( ClassLoader loader , IWeavingContext weavingContext ) { } public ClassLoaderWeavingAdaptor getWeavingAdaptor ( ClassLoader loader , IWeavingContext weavingContext ) { } } public String getNamespace ( ClassLoader loader ) { } public boolean generatedClassesExist ( ClassLoader loader ) { } public void flushGeneratedClasses ( ClassLoader loader ) { } }

Fix:
ClassLoaderWeavingAdaptor weavingAdaptor = new ClassLoaderWeavingAdaptor ( ) ;
Buggy code:
public class CreateSignatureTest extends TestCase { private Signature signature = null ; private static final String SIGNATURE_ID = "JUnitTest" ; private static final String SIGNED_FILE_NAME = "result.xml" ; private static final String KEYSTORE_PATH = "resources//sample_keystore.jks" ; private static final String KEYSTORE_PASSWORD = "sampleKeystore" ; private static final String KEY_ALIAS = "sampleKey" ; private static final String KEY_PASSWORD = "sampleKey" ; protected void setUp ( ) throws Exception { Init . init ( ) ; Keystore sampleKeyStore = new Keystore ( XMLSecurityToolsTestPlugin . getTestFileLocation ( CreateSignatureTest . KEYSTORE_PATH ) , CreateSignatureTest . KEYSTORE_PASSWORD , Globals . KEYSTORE_TYPE ) ; sampleKeyStore . load ( ) ; signature = new Signature ( ) ; signature . setBsp ( false ) ; signature . setLaunchEncryptionWizard ( false ) ; signature . setCanonicalizationAlgorithm ( "Exclusive<seq2seq4repair_space>with<seq2seq4repair_space>comments" ) ; <START_BUG> signature . setKeyAlias ( CreateSignatureTest . KEY_ALIAS ) ; <END_BUG> signature . setKeyPassword ( CreateSignatureTest . KEY_PASSWORD . toCharArray ( ) ) ; signature . setDetachedFile ( null ) ; signature . setFile ( XMLSecurityToolsTestPlugin . getTestFileLocation ( "resources//FirstSteps.xml" ) ) ; signature . setKeystore ( sampleKeyStore ) ; signature . setKeystorePassword ( CreateSignatureTest . KEYSTORE_PASSWORD . toCharArray ( ) ) ; signature . setMessageDigestAlgorithm ( "SHA<seq2seq4repair_space>1" ) ; signature . setResource ( "document" ) ; signature . setSignatureAlgorithm ( "DSA<seq2seq4repair_space>with<seq2seq4repair_space>SHA<seq2seq4repair_space>1<seq2seq4repair_space>(DSS)" ) ; signature . setSignatureId ( CreateSignatureTest . SIGNATURE_ID ) ; signature . setSignatureProperties ( null ) ; signature . setSignatureType ( "enveloped" ) ; signature . setTransformationAlgorithm ( "None" ) ; signature . setXpath ( null ) ; } public void tearDown ( ) throws Exception { } public void testSign ( ) { } }

Fix:
signature . setKeyName ( CreateSignatureTest . KEY_ALIAS ) ;
Buggy code:
public class SeamProcessor implements DeploymentUnitProcessor { public static final String SEAM_PROPERTIES = "seam.properties" ; public static final String SEAM_PROPERTIES_META_INF = "META-INF//" + ( SeamProcessor . SEAM_PROPERTIES ) ; public static final String SEAM_PROPERTIES_WEB_INF = "WEB-INF//classes//" + ( SeamProcessor . SEAM_PROPERTIES ) ; public static final String SEAM_COMPONENTS = "components.xml" ; public static final String SEAM_COMPONENTS_META_INF = "META-INF//" + ( SeamProcessor . SEAM_COMPONENTS ) ; public static final String SEAM_COMPONENTS_WEB_INF = "WEB-INF//" + ( SeamProcessor . SEAM_COMPONENTS ) ; public static final String [ ] SEAM_FILES = new String [ ] { SeamProcessor . SEAM_PROPERTIES , SeamProcessor . SEAM_PROPERTIES_META_INF , SeamProcessor . SEAM_PROPERTIES_WEB_INF , SeamProcessor . SEAM_COMPONENTS_META_INF , SeamProcessor . SEAM_COMPONENTS_WEB_INF } ; public static final String SEAM_INT_JAR = "jboss-seam-int.jar" ; public static final ModuleIdentifier EXT_CONTENT_MODULE = ModuleIdentifier . create ( "org.jboss.integration.ext-content" ) ; public static final ModuleIdentifier VFS_MODULE = ModuleIdentifier . create ( "org.jboss.vfs" ) ; private ServiceTarget serviceTarget ; private ResourceLoaderSpec seamIntResourceLoader ; public SeamProcessor ( ServiceTarget serviceTarget ) { } protected synchronized ResourceLoaderSpec getSeamIntResourceLoader ( ) throws DeploymentUnitProcessingException { } public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; <START_BUG> if ( ( deploymentUnit . getParent ( ) ) == null ) { <END_BUG> return ; } final List < DeploymentUnit > deploymentUnits = new ArrayList < DeploymentUnit > ( ) ; deploymentUnits . add ( deploymentUnit ) ; deploymentUnits . addAll ( deploymentUnit . getAttachmentList ( SUB_DEPLOYMENTS ) ) ; for ( DeploymentUnit unit : deploymentUnits ) { final ResourceRoot mainRoot = unit . getAttachment ( DEPLOYMENT_ROOT ) ; if ( mainRoot == null ) continue ; VirtualFile root = mainRoot . getRoot ( ) ; for ( String path : SeamProcessor . SEAM_FILES ) { if ( root . getChild ( path ) . exists ( ) ) { final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , SeamProcessor . VFS_MODULE , false , false , false ) ) ; moduleSpecification . addResourceLoader ( getSeamIntResourceLoader ( ) ) ; return ; } } } } public void undeploy ( DeploymentUnit context ) { } }

Fix:
if ( ( deploymentUnit . getParent ( ) ) != null ) {
Buggy code:
public class Student implements Serializable , Comparable < Student > { private static final long serialVersionUID = 6298208303690715171L ; private final String name ; private final String id ; private Roster roster ; public Student ( String name , String id ) { } public Student ( String name , String id , Roster roster ) { } public void setRoster ( Roster roster ) { } public String getName ( ) { User currentUser = Grader . getUser ( ) ; <START_BUG> if ( ( ( currentUser != null ) && ( currentUser . getPermissions ( ) . contains ( VIEW_STUDENTS ) ) ) && ( ! ( currentUser . getId ( ) . equals ( id ) ) ) ) { <END_BUG> return "*******" ; } return name ; } public String getId ( ) { } public double getTotalScore ( ) { } public double getTotalPercentage ( ) { } public Grade getGrade ( ) { } public Grade getGrade ( String asgn ) { } public Double getAssignmentScore ( String asgn ) { } public void setScore ( String asgn , Double sc ) { } public void setPercentScore ( String asgn , double percent ) { } public int compareTo ( Student other ) { } public boolean equals ( Object other ) { } public static String Save ( ArrayList < Student > students ) { } }

Fix:
if ( ( ( currentUser != null ) && ( ! ( currentUser . getPermissions ( ) . contains ( VIEW_STUDENTS ) ) ) ) && ( ! ( currentUser . getId ( ) . equals ( id ) ) ) ) {
Buggy code:
public class AjaxServerAndClientTimeFilter implements IResponseFilter { private static Logger log = LoggerFactory . getLogger ( AjaxServerAndClientTimeFilter . class ) ; public AppendingStringBuffer filter ( AppendingStringBuffer responseBuffer ) { int headIndex = responseBuffer . indexOf ( "<head>" ) ; int bodyIndex = responseBuffer . indexOf ( "<//body>" ) ; int ajaxStart = responseBuffer . indexOf ( "<ajax-response>" ) ; int ajaxEnd = responseBuffer . indexOf ( "<//ajax-response>" ) ; long timeTaken = ( System . currentTimeMillis ( ) ) - ( RequestCycle . get ( ) . getStartTime ( ) ) ; if ( ( headIndex != ( - 1 ) ) && ( bodyIndex != ( - 1 ) ) ) { AppendingStringBuffer endScript = new AppendingStringBuffer ( 150 ) ; endScript . append ( "\n" ) . append ( SCRIPT_OPEN_TAG ) ; endScript . append ( "\nwindow.defaultStatus=\'" ) ; endScript . append ( getStatusString ( timeTaken , "ServerAndClientTimeFilter.statustext" ) ) ; endScript . append ( "\';\n" ) . append ( SCRIPT_CLOSE_TAG ) . append ( "\n" ) ; responseBuffer . insert ( ( bodyIndex - 1 ) , endScript ) ; responseBuffer . insert ( ( headIndex + 6 ) , ( ( ( ( "\n" + ( JavascriptUtils . SCRIPT_OPEN_TAG ) ) + "\nvar<seq2seq4repair_space>clientTimeVariable<seq2seq4repair_space>=<seq2seq4repair_space>new<seq2seq4repair_space>Date().getTime();\n" ) + ( JavascriptUtils . SCRIPT_CLOSE_TAG ) ) + "\n" ) ) ; } else if ( ( ajaxStart != ( - 1 ) ) && ( ajaxEnd != ( - 1 ) ) ) { AppendingStringBuffer startScript = new AppendingStringBuffer ( 250 ) ; startScript . append ( "<evaluate><![CDATA[window.defaultStatus='" ) ; startScript . append ( getStatusString ( timeTaken , "ajax.ServerAndClientTimeFilter.statustext" ) ) ; startScript . append ( "';]]><//evaluate>" ) ; responseBuffer . insert ( ajaxEnd , startScript . toString ( ) ) ; responseBuffer . insert ( ( ajaxStart + 15 ) , "<evaluate><![CDATA[clientTimeVariable<seq2seq4repair_space>=<seq2seq4repair_space>new<seq2seq4repair_space>Date().getTime();]]><//evaluate>" ) ; } <START_BUG> AjaxServerAndClientTimeFilter . log . info ( ( ( ( ( timeTaken + "ms<seq2seq4repair_space>server<seq2seq4repair_space>time<seq2seq4repair_space>taken<seq2seq4repair_space>for<seq2seq4repair_space>request<seq2seq4repair_space>" ) + ( RequestCycle . get ( ) . getRequest ( ) . getURL ( ) ) ) + "<seq2seq4repair_space>response<seq2seq4repair_space>size:<seq2seq4repair_space>" ) + ( responseBuffer . length ( ) ) ) ) ; <END_BUG> return responseBuffer ; } private String getStatusString ( long timeTaken , String resourceKey ) { } }

Fix:
AjaxServerAndClientTimeFilter . log . info ( ( ( ( ( timeTaken + "ms<seq2seq4repair_space>server<seq2seq4repair_space>time<seq2seq4repair_space>taken<seq2seq4repair_space>for<seq2seq4repair_space>request<seq2seq4repair_space>" ) + ( RequestCycle . get ( ) . getRequest ( ) . getUrl ( ) ) ) + "<seq2seq4repair_space>response<seq2seq4repair_space>size:<seq2seq4repair_space>" ) + ( responseBuffer . length ( ) ) ) ) ;
Buggy code:
public class Server extends AbstractServer { private ServerCommunicationHandler serverCommunicationHandler ; private final MessageHandler messageHandler = new MessageHandler ( this ) ; public Server ( ServerEnvironment environment ) { } public void start ( ) { } public void start ( Standalone config ) throws ServerStartException { } public void stop ( ) { } Callback createListenerCallback ( ) { return new ServerStartupListener . Callback ( ) { public void run ( Map < ServiceName , StartException > serviceFailures , long elapsedTime , int totalServices , int onDemandServices , int startedServices ) { if ( serviceFailures . isEmpty ( ) ) { <START_BUG> log . infof ( "JBoss<seq2seq4repair_space>AS<seq2seq4repair_space>started<seq2seq4repair_space>-<seq2seq4repair_space>Installed<seq2seq4repair_space>%d<seq2seq4repair_space>and<seq2seq4repair_space>started<seq2seq4repair_space>%d<seq2seq4repair_space>services<seq2seq4repair_space>in<seq2seq4repair_space>%dms." , totalServices , startedServices , elapsedTime ) ; <END_BUG> sendMessage ( "STARTED" ) ; } else { sendMessage ( "START<seq2seq4repair_space>FAILED" ) ; final StringBuilder buff = new StringBuilder ( String . format ( "JBoss<seq2seq4repair_space>AS<seq2seq4repair_space>server<seq2seq4repair_space>start<seq2seq4repair_space>failed.<seq2seq4repair_space>Attempted<seq2seq4repair_space>to<seq2seq4repair_space>start<seq2seq4repair_space>%d<seq2seq4repair_space>services<seq2seq4repair_space>in<seq2seq4repair_space>%dms" , totalServices , elapsedTime ) ) ; buff . append ( "\nThe<seq2seq4repair_space>following<seq2seq4repair_space>services<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>start:\n" ) ; for ( Map . Entry < ServiceName , StartException > entry : serviceFailures . entrySet ( ) ) { buff . append ( String . format ( "\t%s<seq2seq4repair_space>=><seq2seq4repair_space>%s\n" , entry . getKey ( ) , entry . getValue ( ) . getMessage ( ) ) ) ; } log . error ( buff . toString ( ) ) ; } } } ; } private void launchCommunicationHandler ( ) { } private void sendMessage ( final String message ) { } }

Fix:
log . infof ( "JBoss<seq2seq4repair_space>AS<seq2seq4repair_space>started<seq2seq4repair_space>in<seq2seq4repair_space>%dms.<seq2seq4repair_space>-<seq2seq4repair_space>Services<seq2seq4repair_space>[Total:<seq2seq4repair_space>%d,<seq2seq4repair_space>On-demand:<seq2seq4repair_space>%d.<seq2seq4repair_space>Started:<seq2seq4repair_space>%d]" , elapsedTime , totalServices , onDemandServices , startedServices ) ;
Buggy code:
public class Mouse extends playn . core . Mouse { public static abstract class Listener extends Slot < Object > { public void onMotion ( MotionEvent event , Mouse . Interaction iact ) { } public void onButton ( ButtonEvent event , Mouse . Interaction iact ) { } public void onDrag ( MotionEvent event , Mouse . Interaction iact ) { } public void onWheel ( WheelEvent event , Mouse . Interaction iact ) { } public void onCancel ( ) { } @ Override public final void onEmit ( Object event ) { } } public static class Interaction extends playn . scene . Interaction < Event > { private final boolean solo ; Interaction ( Layer hitLayer , boolean solo ) { } private int buttons ; void add ( ButtonEvent . Id button ) { } boolean remove ( ButtonEvent . Id button ) { } void emit ( Mouse . Listener lner ) { } } public static class Dispatcher extends Slot < Event > { private final Layer root ; private final boolean bubble ; private final Point scratch = new Point ( ) ; private Mouse . Interaction currentIact ; public Dispatcher ( Layer root , boolean bubble ) { } @ Override public void onEmit ( Event event ) { if ( event instanceof ButtonEvent ) { ButtonEvent bevent = ( ( ButtonEvent ) ( event ) ) ; if ( bevent . down ) { if ( ( currentIact ) == null ) { Layer hitLayer = LayerUtil . getHitLayer ( root , scratch . set ( event . x , event . y ) ) ; if ( hitLayer != null ) <START_BUG> new Mouse . Interaction ( hitLayer , false ) ; <END_BUG> } if ( ( currentIact ) != null ) { currentIact . add ( bevent . button ) ; currentIact . dispatch ( event , bubble ) ; } } else if ( ( currentIact ) == null ) dispatchSolo ( event ) ; else { boolean done = currentIact . remove ( bevent . button ) ; currentIact . dispatch ( event , bubble ) ; if ( done ) currentIact = null ; } } else if ( event instanceof MotionEvent ) { if ( ( currentIact ) != null ) currentIact . dispatch ( event , bubble ) ; else dispatchSolo ( event ) ; } else if ( event instanceof WheelEvent ) { if ( ( currentIact ) != null ) currentIact . dispatch ( event , bubble ) ; else dispatchSolo ( event ) ; } } private void dispatchSolo ( Event event ) { } } protected static final Object cancelEvent = new Object ( ) ; }

Fix:
currentIact = new Mouse . Interaction ( hitLayer , false ) ;
Buggy code:
public class MyCanvas extends Activity { private MyCanvas mSelf ; public MySurfaceView mView ; private MySocket mMySocket ; private MyImgEditView mImageEditingView ; private RelativeLayout mRL ; boolean mIsServer ; private PorterDuffColorFilter mColorFilter ; private ImageButton CcBtn ; private ImageButton eraserBtn ; private ImageButton undoBtn ; private ImageButton redoBtn ; private ImageButton clearBtn ; private Button imgEdtOKBtn ; private Button imgEdtCancelBtn ; public ImageView loadedImage ; private boolean iCanUndo ; private boolean iCanRedo ; public static final int VIEWMODE_CANVAS = 2735 ; public static final int VIEWMODE_IMAGE_EDITING = 5512 ; private void myFindViewByID ( ) { } private String remoteIP ; private ProgressDialog connectingDialog ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void clientTimeOut ( ) { } @ Override public void onBackPressed ( ) { } public MySocket getSocket ( ) { } private void useColorPicker ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { switch ( item . getItemId ( ) ) { case 0 : Toast . makeText ( getApplicationContext ( ) , "¬I¤u¤¤..." , LENGTH_SHORT ) . show ( ) ; break ; case 1 : Toast . makeText ( getApplicationContext ( ) , "¬I¤u¤¤..." , LENGTH_SHORT ) . show ( ) ; break ; case 2 : Intent intent = new Intent ( ) ; intent . setClass ( this , ImgLoaderActivity . class ) ; Bundle bundle = new Bundle ( ) ; intent . putExtras ( bundle ) ; startActivityForResult ( intent , 1 ) ; break ; case 3 : checkIP ( ) ; break ; case 4 : String fileName = mView . mBufferDealer . saveBitmapToMemory ( mView . getBitmap ( ) ) ; <START_BUG> mView . errorToast ( ( "Save<seq2seq4repair_space>picture<seq2seq4repair_space>to<seq2seq4repair_space>" + fileName ) ) ; <END_BUG> break ; default : } return super . onOptionsItemSelected ( item ) ; } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } public void checkIP ( ) { } public void checkUnReDoValid ( ) { } public void enableUndoDisableRedo ( ) { } public void transformIV ( float angle , RelativeLayout . LayoutParams params , Bitmap img ) { } public void setCanvasViewMode ( int mode ) { } }

Fix:
mView . errorToast ( ( ( "Save<seq2seq4repair_space>picture<seq2seq4repair_space>to<seq2seq4repair_space>" + fileName ) + ".jpg" ) ) ;
Buggy code:
public class TimeoutObserver implements Observer { protected static final ObjectMapper mapper = new ObjectMapper ( ) ; public void update ( Observable obs , Object arg ) { if ( ! ( obs instanceof Game ) ) { return ; } Game game = ( ( Game ) ( obs ) ) ; if ( ( ( Integer ) ( game . getState ( ) . get ( "isActive" ) ) ) == 0 ) { return ; } Map < String , Object > params = new HashMap < > ( ) ; params . put ( "id" , game . getGameId ( ) ) ; params . put ( "timeout" , ( ( System . currentTimeMillis ( ) ) + ( ( game . getTimeoutInterval ( ) ) * 1000 ) ) ) ; params . put ( "version" , game . getState ( ) . get ( "version" ) ) ; Properties props = new Properties ( ) ; props . put ( "bootstrap.servers" , "localhost:9092" ) ; props . put ( "acks" , "all" ) ; props . put ( "retries" , 0 ) ; props . put ( "batch.size" , 16384 ) ; props . put ( "linger.ms" , 1 ) ; props . put ( "buffer.memory" , 33554432 ) ; props . put ( "key.serializer" , "org.apache.kafka.common.serialization.IntegerSerializer" ) ; props . put ( "value.serializer" , "org.apache.kafka.common.serialization.StringSerializer" ) ; Producer < Integer , String > producer = new org . apache . kafka . clients . producer . KafkaProducer ( props ) ; try { <START_BUG> producer . send ( new org . apache . kafka . clients . producer . ProducerRecord < Integer , String > ( "timeout" , game . getGameId ( ) , TimeoutObserver . mapper . writeValueAsString ( params ) ) ) ; <END_BUG> } catch ( IOException e ) { e . printStackTrace ( ) ; } producer . close ( ) ; } }

Fix:
producer . send ( new org . apache . kafka . clients . producer . ProducerRecord < Integer , String > ( game . getGameName ( ) , game . getGameId ( ) , TimeoutObserver . mapper . writeValueAsString ( params ) ) ) ;
Buggy code:
public class VersionHandler { private int mod_major ; private int mod_minor ; private int mod_rev ; private boolean needsUpdate ; private boolean isDirect ; private boolean promptMsg ; private String version ; private String downloadURL ; private String jsonURL ; private String modname ; private String currentVer ; private List < String > changeList ; public VersionHandler ( String jsonURL , String modname , int major , int minor , int rev ) { } public void checkForUpdates ( ) { int major = 0 ; int minor = 0 ; int revision = 0 ; try { URL url = new URL ( this . jsonURL ) ; JsonParser parser = new JsonParser ( ) ; JsonReader reader = new JsonReader ( new InputStreamReader ( url . openStream ( ) ) ) ; if ( reader != null ) { JsonElement element = parser . parse ( reader ) ; JsonObject jsonObject = element . getAsJsonObject ( ) ; major = jsonObject . get ( "major" ) . getAsInt ( ) ; minor = jsonObject . get ( "minor" ) . getAsInt ( ) ; revision = jsonObject . get ( "revision" ) . getAsInt ( ) ; this . downloadURL = jsonObject . get ( "downloadURL" ) . getAsString ( ) ; this . isDirect = jsonObject . get ( "direct" ) . getAsBoolean ( ) ; if ( jsonObject . has ( "changeLog" ) ) { if ( jsonObject . get ( "changeLog" ) . isJsonArray ( ) ) { JsonArray changeLog = jsonObject . get ( "changeLog" ) . getAsJsonArray ( ) ; Iterator < JsonElement > it = changeLog . iterator ( ) ; while ( it . hasNext ( ) ) { this . changeList . add ( it . next ( ) . getAsString ( ) ) ; } } else this . changeList . add ( jsonObject . get ( "changeLog" ) . getAsString ( ) ) ; } reader . close ( ) ; } } catch ( Exception e ) { Logger . logError ( "Exception<seq2seq4repair_space>when<seq2seq4repair_space>reading<seq2seq4repair_space>update<seq2seq4repair_space>JSON." ) ; } <START_BUG> this . needsUpdate = ( ( this . mod_major ) >= major ) ? ( this . mod_minor ) >= minor ? ( this . mod_rev ) >= revision ? false : true : true : true ; <END_BUG> if ( this . needsUpdate ) { this . version = ( ( ( major + "." ) + minor ) + "." ) + revision ; this . promptMsg = true ; sendMessage ( ) ; } else Logger . logInfo ( ( ( TrophySlots . MOD_NAME ) + "<seq2seq4repair_space>is<seq2seq4repair_space>up-to-date" ) ) ; } private void sendMessage ( ) { } @ SubscribeEvent @ SideOnly ( CLIENT ) public void onClientTick ( TickEvent . ClientTickEvent event ) { } }

Fix:
this . needsUpdate = ( ( ( this . mod_major ) < major ) || ( ( ( this . mod_minor ) < minor ) && ( ( this . mod_major ) <= major ) ) ) || ( ( ( ( this . mod_rev ) < revision ) && ( ( this . mod_minor ) <= minor ) ) && ( ( this . mod_major ) <= major ) ) ;
Buggy code:
public class SimpleStuffTest { public SimpleStuffTest ( ) { } @ Test public void testArraySum ( ) { System . out . println ( "arraySum" ) ; <START_BUG> double [ ] vals = new double [ ] { 2 , 4 , 8 } ; <END_BUG> double expResult = 14 ; double result = SimpleStuff . arraySum ( vals ) ; assertEquals ( expResult , result , 0.0 ) ; } @ Test public void testArraySub ( ) { } @ Test public void testArrayProduct ( ) { } }

Fix:
double [ ] vals = new double [ ] { 2 , 4 , 9 } ;