nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SharedMemoryDeliveryManager implements DeliveryManager { private static final Log log = LogFactory . getLog ( SharedMemoryDeliveryManager . class ) ; private ExecutorService executor ; private NotificationManager notificationManager ; private String topicStoragePath ; private EventBroker eventBroker ; public SharedMemoryDeliveryManager ( ExecutorService executor , String topicStoragePath ) { } public void subscribe ( Subscription subscription ) throws EventBrokerException { } public void setNotificationManager ( NotificationManager notificationManager ) { } public void publish ( Message message , String topicName , int deliveryMode ) throws EventBrokerException { } public void setMatchingManager ( MatchingManager matchingManager ) { } public void unSubscribe ( String id ) throws EventBrokerException { } public void cleanUp ( ) { } public void renewSubscription ( Subscription subscription ) throws EventBrokerException { } public void initializeTenant ( ) throws EventBrokerException { } private static Cache < Integer , SharedMemoryMatchingManager > getInMemoryMatchingCache ( ) { } public synchronized MatchingManager getMatchingManager ( ) throws EventBrokerConfigurationException { SharedMemoryMatchingManager inMemoryMatchingManager = SharedMemoryDeliveryManager . getInMemoryMatchingCache ( ) . get ( 1 ) ; if ( inMemoryMatchingManager == null ) { inMemoryMatchingManager = new SharedMemoryMatchingManager ( ) ; SharedMemoryDeliveryManager . getInMemoryMatchingCache ( ) . put ( 1 , inMemoryMatchingManager ) ; } try { inMemoryMatchingManager . initializeTenant ( ) ; } catch ( EventBrokerException e ) { <START_BUG> throw new EventBrokerConfigurationException ( "Can<seq2seq4repair_space>not<seq2seq4repair_space>initialize<seq2seq4repair_space>the<seq2seq4repair_space>in<seq2seq4repair_space>memory<seq2seq4repair_space>mathing<seq2seq4repair_space>manager" , e ) ; <END_BUG> } return inMemoryMatchingManager ; } public void setEventBroker ( EventBroker eventbroker ) { } }

Fix:
throw new EventBrokerConfigurationException ( "Can<seq2seq4repair_space>not<seq2seq4repair_space>initialize<seq2seq4repair_space>the<seq2seq4repair_space>in<seq2seq4repair_space>memory<seq2seq4repair_space>matching<seq2seq4repair_space>manager" , e ) ;
Buggy code:
public class CompletionOnQualifiedNameReference extends QualifiedNameReference { public char [ ] completionIdentifier ; public boolean isInsideAnnotationAttribute ; public CompletionOnQualifiedNameReference ( char [ ] [ ] previousIdentifiers , char [ ] completionIdentifier , long [ ] positions , boolean isInsideAnnotationAttribute ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { binding = scope . getBinding ( tokens , this ) ; if ( ! ( binding . isValidBinding ( ) ) ) { if ( ( binding ) instanceof ProblemFieldBinding ) { scope . problemReporter ( ) . invalidField ( this , ( ( FieldBinding ) ( binding ) ) ) ; } else <START_BUG> if ( ( binding ) instanceof ProblemReferenceBinding ) { <END_BUG> scope . problemReporter ( ) . invalidType ( this , ( ( TypeBinding ) ( binding ) ) ) ; } else { scope . problemReporter ( ) . unresolvableReference ( this , binding ) ; } if ( ( binding . problemId ( ) ) == ( ProblemReasons . NotFound ) ) { throw new CompletionNodeFound ( this , binding , scope ) ; } throw new CompletionNodeFound ( ) ; } throw new CompletionNodeFound ( this , binding , scope ) ; } }

Fix:
if ( ( ( binding ) instanceof ProblemReferenceBinding ) || ( ( binding ) instanceof MissingTypeBinding ) ) {
Buggy code:
public class CompilationUnitProblemFinder extends Compiler { protected CompilationUnitProblemFinder ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , ICompilerRequestor requestor , IProblemFactory problemFactory ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { CompilationResult result = new CompilationResult ( sourceTypes [ 0 ] . getFileName ( ) , 1 , 1 , this . options . maxProblemsPerUnit ) ; <START_BUG> CompilationUnitDeclaration unit = SourceTypeConverter . buildCompilationUnit ( sourceTypes , ( ( ( SourceTypeConverter . FIELD_AND_METHOD ) | ( SourceTypeConverter . MEMBER_TYPE ) ) | ( SourceTypeConverter . FIELD_INITIALIZATION ) ) , lookupEnvironment . problemReporter , result ) ; <END_BUG> if ( unit != null ) { this . lookupEnvironment . buildTypeBindings ( unit ) ; this . lookupEnvironment . completeTypeBindings ( unit ) ; } } protected static IErrorHandlingPolicy getHandlingPolicy ( ) { } protected static INameEnvironment getNameEnvironment ( ICompilationUnit sourceUnit ) throws JavaModelException { } protected static ICompilerRequestor getRequestor ( ) { } public static CompilationUnitDeclaration process ( CompilationUnitDeclaration unit , ICompilationUnit unitElement , Parser parser , IProblemRequestor problemRequestor , IProblemFactory problemFactory , IProgressMonitor monitor ) throws JavaModelException { } public static CompilationUnitDeclaration process ( ICompilationUnit unitElement , IProblemRequestor problemRequestor , IProgressMonitor monitor ) throws JavaModelException { } private static void reportProblems ( CompilationUnitDeclaration unit , IProblemRequestor problemRequestor , IProgressMonitor monitor ) { } }

Fix:
CompilationUnitDeclaration unit = SourceTypeConverter . buildCompilationUnit ( sourceTypes , ( ( ( SourceTypeConverter . FIELD_AND_METHOD ) | ( SourceTypeConverter . MEMBER_TYPE ) ) | ( SourceTypeConverter . FIELD_INITIALIZATION ) ) , this . lookupEnvironment . problemReporter , result ) ;
Buggy code:
public class FileUploadField extends FormComponent < FileUpload > { private static final long serialVersionUID = 1L ; private boolean hasExplicitModel ; private transient FileUpload fileUpload ; public FileUploadField ( final String id ) { } public FileUploadField ( final String id , IModel < FileUpload > model ) { } public FileUpload getFileUpload ( ) { } @ Override public FileUploadField setModel ( IModel < FileUpload > model ) { } @ Override public void updateModel ( ) { if ( hasExplicitModel ) { <START_BUG> setModelObject ( getFileUpload ( ) ) ; <END_BUG> } } @ Override public String [ ] getInputAsArray ( ) { } @ Override protected FileUpload convertValue ( String [ ] value ) throws ConversionException { } @ Override public boolean isMultiPart ( ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { } @ Override protected boolean supportsPersistence ( ) { } @ Override protected void onDetach ( ) { } protected boolean forceCloseStreamsOnDetach ( ) { } }

Fix:
setModelObject ( getConvertedInput ( ) ) ;
Buggy code:
public final class Main { public static String getVersionString ( ) { } public static void usage ( ) { } private Main ( ) { } public static final String HOST_CONTROLLER_PROCESS_NAME = "Host<seq2seq4repair_space>Controller" ; public static final String HOST_CONTROLLER_MODULE = "org.jboss.as.host-controller" ; public static void main ( String [ ] args ) throws IOException { } public static ProcessController start ( String [ ] args ) throws IOException { } private static String parseValue ( final String arg , final String key ) { } private static void addJavaOption ( String option , List < String > javaOptions ) { } private static boolean handleHelpOrVersion ( String arg , String jbossHome ) { if ( ( ( HELP . equals ( arg ) ) || ( SHORT_HELP . equals ( arg ) ) ) || ( OLD_HELP . equals ( arg ) ) ) { Main . usage ( ) ; return true ; } else if ( ( ( ( VERSION . equals ( arg ) ) || ( SHORT_VERSION . equals ( arg ) ) ) || ( OLD_VERSION . equals ( arg ) ) ) || ( OLD_SHORT_VERSION . equals ( arg ) ) ) { <START_BUG> System . out . println ( new org . jboss . as . version . ProductConfig ( org . jboss . modules . Module . getBootModuleLoader ( ) , jbossHome ) . getPrettyVersionString ( ) ) ; <END_BUG> return true ; } return false ; } private static class PCSocketConfig { private String bindAddress ; private int bindPort = 0 ; private int argIncrement = 0 ; private boolean parseFailed ; private PCSocketConfig ( ) { } private String getBindAddress ( ) { } private int getBindPort ( ) { } private int getArgIncrement ( ) { } private boolean isParseFailed ( ) { } private boolean processPCSocketConfigArgument ( final String arg , final String [ ] args , final int index ) { } } }

Fix:
System . out . println ( new org . jboss . as . version . ProductConfig ( org . jboss . modules . Module . getBootModuleLoader ( ) , jbossHome , null ) . getPrettyVersionString ( ) ) ;
Buggy code:
public class Quad extends BaseObject3D { protected final float [ ] v0 = new float [ 3 ] ; protected final float [ ] v1 = new float [ 3 ] ; protected final float [ ] v2 = new float [ 3 ] ; protected final float [ ] v3 = new float [ 3 ] ; public static final int NUM_VERTICES = 4 ; public Quad ( ) { } public Quad ( float [ ] v0 , float [ ] v1 , float [ ] v2 , float [ ] v3 ) { } public Quad ( float [ ] v0 , float [ ] v1 , float [ ] v2 , float [ ] v3 , float [ ] normal ) { } protected void init ( ) { float [ ] vertices = new float [ ( Quad . NUM_VERTICES ) * 3 ] ; float [ ] textureCoords = new float [ ( Quad . NUM_VERTICES ) * 2 ] ; float [ ] normals = new float [ ( Quad . NUM_VERTICES ) * 3 ] ; float [ ] colors = new float [ ( Quad . NUM_VERTICES ) * 4 ] ; int [ ] indices = new int [ 4 ] ; System . arraycopy ( v0 , 0 , vertices , 0 , 3 ) ; System . arraycopy ( v1 , 0 , vertices , 3 , 3 ) ; System . arraycopy ( v2 , 0 , vertices , 6 , 3 ) ; System . arraycopy ( v3 , 0 , vertices , 9 , 3 ) ; textureCoords [ 0 ] = 0.0F ; textureCoords [ 1 ] = 1.0F ; textureCoords [ 2 ] = 0.0F ; textureCoords [ 3 ] = 0.0F ; textureCoords [ 4 ] = 1.0F ; textureCoords [ 5 ] = 1.0F ; textureCoords [ 6 ] = 1.0F ; textureCoords [ 7 ] = 0.0F ; for ( int i = 0 ; i < ( Quad . NUM_VERTICES ) ; i ++ ) { normals [ ( i * 3 ) ] = 0 ; normals [ ( ( i * 3 ) + 1 ) ] = 0 ; <START_BUG> normals [ ( ( i * 3 ) + 2 ) ] = 1 ; <END_BUG> } int ul = 0 ; int ll = 1 ; int ur = 2 ; int lr = 3 ; indices [ 0 ] = ( ( int ) ( ll ) ) ; indices [ 1 ] = ( ( int ) ( ul ) ) ; indices [ 2 ] = ( ( int ) ( ur ) ) ; indices [ 3 ] = ( ( int ) ( lr ) ) ; int numColors = ( Quad . NUM_VERTICES ) * 4 ; for ( int j = 0 ; j < numColors ; j += 4 ) { colors [ j ] = 1.0F ; colors [ ( j + 1 ) ] = 1.0F ; colors [ ( j + 2 ) ] = 1.0F ; colors [ ( j + 3 ) ] = 1.0F ; } setData ( vertices , normals , textureCoords , colors , indices ) ; } }

Fix:
normals [ ( ( i * 3 ) + 2 ) ] = 0 ;
Buggy code:
public class ResourceUrlProviderJavaConfigTests { private final ResourceUrlProviderJavaConfigTests . TestServlet servlet = new ResourceUrlProviderJavaConfigTests . TestServlet ( ) ; private MockFilterChain filterChain ; private MockHttpServletRequest request ; @ Before @ SuppressWarnings ( "resource" ) public void setup ( ) throws Exception { } @ Test public void rootServletMapping ( ) throws Exception { } @ Test public void prefixServletMapping ( ) throws Exception { } @ Test public void extensionServletMapping ( ) throws Exception { } @ Configuration static class WebConfig extends WebMvcConfigurationSupport { @ Override public void addResourceHandlers ( ResourceHandlerRegistry registry ) { <START_BUG> registry . addResourceHandler ( "//resources//**" ) . addResourceLocations ( "classpath:org//springframework//web//servlet//resource//test//" ) . addResolver ( new VersionResourceResolver ( ) . addContentVersionStrategy ( "//**" ) ) ; <END_BUG> } } @ SuppressWarnings ( "serial" ) private static class TestServlet extends HttpServlet { private HttpServletResponse response ; @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) { } } }

Fix:
registry . addResourceHandler ( "//resources//**" ) . addResourceLocations ( "classpath:org//springframework//web//servlet//resource//test//" ) . resourceChain ( true ) . addResolver ( new VersionResourceResolver ( ) . addContentVersionStrategy ( "//**" ) ) ;
Buggy code:
public class CreateVirtualFolderAction extends AbstractColumbaAction implements ISelectionListener { public CreateVirtualFolderAction ( FrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent evt ) { CreateFolderDialog dialog = new CreateFolderDialog ( getFrameMediator ( ) , null ) ; String name ; if ( dialog . success ( ) ) { name = dialog . getName ( ) ; try { MailFolderCommandReference r = ( ( MailFolderCommandReference ) ( ( ( AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTreeSelection ( ) ) ) ; VirtualFolder vfolder = ( ( VirtualFolder ) ( FolderFactory . getInstance ( ) . createChild ( ( ( IMailFolder ) ( r . getSourceFolder ( ) ) ) , name , "VirtualFolder" ) ) ) ; FolderTreeModel . getInstance ( ) . nodeStructureChanged ( r . getSourceFolder ( ) ) ; <START_BUG> vfolder . getConfiguration ( ) . set ( "property" , "source_uid" , r . getSourceFolder ( ) . getUid ( ) ) ; <END_BUG> new org . columba . mail . gui . config . search . SearchFrame ( ( ( AbstractMailFrameController ) ( frameMediator ) ) , vfolder ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } else { return ; } } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
vfolder . getConfiguration ( ) . setInteger ( "property" , "source_uid" , r . getSourceFolder ( ) . getUid ( ) ) ;
Buggy code:
public class HdrAxisLabelHandler extends GridAxisLabelHandler { protected boolean zoomedIn ; protected int orderAxis ; protected int orderDelta ; protected double baseValue ; @ Override public String getAxisLabel ( Axis1D axis ) { } @ Override protected double [ ] tickPositions ( Axis1D axis , double tickInterval ) { } @ Override public String [ ] getTickLabels ( Axis1D axis , double [ ] tickPositions ) { String [ ] tickLabels = new String [ tickPositions . length ] ; for ( int i = 0 ; i < ( tickPositions . length ) ; i ++ ) { double value = tickPositions [ i ] ; if ( zoomedIn ) { value -= baseValue ; value //= Math . pow ( 10 , orderDelta ) ; } else { value //= Math . pow ( 10 , orderAxis ) ; } String s = String . format ( "%,.3f" , value ) ; <START_BUG> if ( ( tickPositions [ i ] ) < 0 ) { <END_BUG> s = s . substring ( 0 , 6 ) ; } else { s = s . substring ( 0 , 5 ) ; } tickLabels [ i ] = s ; } return tickLabels ; } }

Fix:
if ( value < 0 ) {
Buggy code:
public abstract class AbstractIntegerConverter < I extends Number > extends AbstractNumberConverter < I > { private static final long serialVersionUID = 1L ; private final Map < Locale , NumberFormat > numberFormats = new ConcurrentHashMap < Locale , NumberFormat > ( ) ; @ Override <START_BUG> public NumberFormat getNumberFormat ( Locale locale ) { <END_BUG> NumberFormat numberFormat = numberFormats . get ( locale ) ; if ( numberFormat == null ) { numberFormat = NumberFormat . getIntegerInstance ( locale ) ; numberFormat . setParseIntegerOnly ( true ) ; numberFormat . setGroupingUsed ( false ) ; numberFormats . put ( locale , numberFormat ) ; } return ( ( NumberFormat ) ( numberFormat . clone ( ) ) ) ; } }

Fix:
public NumberFormat getNumberFormat ( final Locale locale ) {
Buggy code:
public class Link extends Control { NSScrollView scrollView ; String text ; Point [ ] offsets ; Point selection ; String [ ] ids ; int [ ] mnemonics ; NSColor linkColor ; public Link ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } boolean textView_clickOnLink_atIndex ( int id , int sel , int textView , int link , int charIndex ) { NSString str = new NSString ( link ) ; Event event = new Event ( ) ; event . text = str . getString ( ) ; <START_BUG> sendEvent ( Selection , event ) ; <END_BUG> return true ; } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createWidget ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } void drawBackground ( int id , NSGraphicsContext context , NSRect rect ) { } void enableWidget ( boolean enabled ) { } String getNameText ( ) { } public String getText ( ) { } boolean shouldDrawInsertionPoint ( int id , int sel ) { } void register ( ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } String parse ( String string ) { } int parseMnemonics ( char [ ] buffer , int start , int end , StringBuffer result ) { } void setBackgroundColor ( NSColor nsColor ) { } void setBackgroundImage ( NSImage image ) { } void setBackground ( NSColor nsColor ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } void setOrientation ( ) { } public void setText ( String string ) { } public void setToolTipText ( String string ) { } void setZOrder ( ) { } NSView topView ( ) { } void updateCursorRects ( boolean enabled ) { } }

Fix:
sendSelectionEvent ( Selection , event , true ) ;
Buggy code:
public class AbsoluteHref extends WebComponent { public AbsoluteHref ( final String componentName ) { } protected void onComponentTag ( ComponentTag tag ) { String href = tag . getString ( "href" ) ; if ( ( href . charAt ( 0 ) ) != '//' ) { WebRequestCycle hcycle = ( ( WebRequestCycle ) ( getRequestCycle ( ) ) ) ; String requestUrl = ( ( wicket . protocol . http . WebRequest ) ( hcycle . getRequest ( ) ) ) . getHttpServletRequest ( ) . getRequestURL ( ) . toString ( ) ; <START_BUG> String urlPrefix = hcycle . urlPrefix ( ) . toString ( ) ; <END_BUG> int idx = requestUrl . indexOf ( urlPrefix ) ; if ( idx > 0 ) { urlPrefix = requestUrl . substring ( 0 , ( idx + ( urlPrefix . length ( ) ) ) ) ; href = ( urlPrefix + "//" ) + href ; } tag . put ( "href" , href ) ; } super . onComponentTag ( tag ) ; } protected void onComponentTagBody ( MarkupStream markupStream , ComponentTag openTag ) { } }

Fix:
String urlPrefix = getPage ( ) . urlFor ( "" ) ;
Buggy code:
public class TestRegexpRandom2 extends LuceneTestCase { protected IndexSearcher searcher1 ; protected IndexSearcher searcher2 ; private IndexReader reader ; private Directory dir ; protected String fieldName ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; fieldName = ( random ( ) . nextBoolean ( ) ) ? "field" : "" ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) , MockTokenizer . KEYWORD , false ) ) . setMaxBufferedDocs ( TestUtil . nextInt ( random ( ) , 50 , 1000 ) ) ) ; Document doc = new Document ( ) ; Field field = newStringField ( fieldName , "" , NO ) ; doc . add ( field ) ; List < String > terms = new ArrayList < > ( ) ; int num = atLeast ( 200 ) ; for ( int i = 0 ; i < num ; i ++ ) { String s = TestUtil . randomUnicodeString ( random ( ) ) ; field . setStringValue ( s ) ; terms . add ( s ) ; writer . addDocument ( doc ) ; } if ( VERBOSE ) { Collections . sort ( terms ) ; System . out . println ( "UTF16<seq2seq4repair_space>order:" ) ; for ( String s : terms ) { System . out . println ( ( "<seq2seq4repair_space>" + ( UnicodeUtil . toHexString ( s ) ) ) ) ; } } reader = writer . getReader ( ) ; searcher1 = newSearcher ( reader ) ; searcher2 = newSearcher ( reader ) ; <START_BUG> writer . close ( ) ; <END_BUG> } @ Override public void tearDown ( ) throws Exception { } private class DumbRegexpQuery extends MultiTermQuery { private final Automaton automaton ; DumbRegexpQuery ( Term term , int flags ) { } @ Override protected TermsEnum getTermsEnum ( Terms terms , AttributeSource atts ) throws IOException { } private class SimpleAutomatonTermsEnum extends FilteredTermsEnum { CharacterRunAutomaton runAutomaton = new CharacterRunAutomaton ( automaton ) ; CharsRef utf16 = new CharsRef ( 10 ) ; private SimpleAutomatonTermsEnum ( TermsEnum tenum ) { } @ Override protected AcceptStatus accept ( BytesRef term ) throws IOException { } } @ Override public String toString ( String field ) { } } public void testRegexps ( ) throws Exception { } protected void assertSame ( String regexp ) throws IOException { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class SourceLocation implements Serializable , ISourceLocation { public static final ISourceLocation UNKNOWN = new SourceLocation ( ISourceLocation . NO_FILE , 0 , 0 , 0 ) ; public static final void validLine ( int line ) { } public static final void validColumn ( int column ) { } private final File sourceFile ; private final int startLine ; private final int column ; private final int endLine ; private boolean noColumn ; public SourceLocation ( File file , int line ) { } public SourceLocation ( File file , int line , int endLine ) { } public SourceLocation ( File file , int line , int endLine , int column ) { } public File getSourceFile ( ) { } public int getLine ( ) { } public int getColumn ( ) { } public int getEndLine ( ) { } public String toString ( ) { StringBuffer sb = new StringBuffer ( ) ; if ( ( sourceFile ) != ( ISourceLocation . NO_FILE ) ) { sb . append ( sourceFile . getPath ( ) ) ; sb . append ( ":" ) ; } <START_BUG> sb . append ( ( "" + ( startLine ) ) ) ; <END_BUG> if ( ! ( noColumn ) ) { sb . append ( ( ":" + ( column ) ) ) ; } return sb . toString ( ) ; } }

Fix:
sb . append ( ( ( ( "" + ( startLine ) ) + "-" ) + ( endLine ) ) ) ;
Buggy code:
public class Main { public static int count ; static int n ; static int x ; public static int i ; public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; System . out . println ( "Digite<seq2seq4repair_space>o<seq2seq4repair_space>numero<seq2seq4repair_space>de<seq2seq4repair_space>threads:" ) ; Main . n = scanner . nextInt ( ) ; System . out . println ( "Digite<seq2seq4repair_space>ate<seq2seq4repair_space>onde<seq2seq4repair_space>o<seq2seq4repair_space>contador<seq2seq4repair_space>vai:" ) ; Main . x = scanner . nextInt ( ) ; Main . count = 1 ; ArrayList < SimpleThread > arraySimpleThread = new ArrayList < SimpleThread > ( ) ; <START_BUG> for ( Main . i = 0 ; ( Main . i ) <= ( Main . x ) ; ( Main . i ) ++ ) { <END_BUG> SimpleThread simpleThread = new SimpleThread ( ) ; arraySimpleThread . add ( simpleThread ) ; simpleThread . start ( ) ; } } No newline ; at end ; of file ; }

Fix:
for ( Main . i = 0 ; ( Main . i ) <= ( Main . n ) ; ( Main . i ) ++ ) {
Buggy code:
public final class ComponentTranslationGenerator extends ComponentProcessor { private static final String OUTPUT_FILE_NAME = "ComponentsTranslation.java" ; private void outputComponent ( ComponentInfo component , StringBuilder sb ) { sb . append ( ( ( "\n\n//*<seq2seq4repair_space>Component:<seq2seq4repair_space>" + ( component . name ) ) + "<seq2seq4repair_space>*//\n\n" ) ) ; sb . append ( "\n\n//*<seq2seq4repair_space>Properties<seq2seq4repair_space>*//\n\n" ) ; for ( Property prop : component . properties . values ( ) ) { String propertyName = prop . name ; <START_BUG> if ( prop . isUserVisible ( ) ) { <END_BUG> sb . append ( ( ( ( ( "<seq2seq4repair_space>map.put(\"PROPERTY-" + propertyName ) + "\",<seq2seq4repair_space>MESSAGES." ) + propertyName ) + "Properties());\n" ) ) ; } } sb . append ( "\n\n//*<seq2seq4repair_space>Events<seq2seq4repair_space>*//\n\n" ) ; for ( Event event : component . events . values ( ) ) { String propertyName = event . name ; if ( event . userVisible ) { sb . append ( ( ( ( ( "<seq2seq4repair_space>map.put(\"EVENT-" + propertyName ) + "\",<seq2seq4repair_space>MESSAGES." ) + propertyName ) + "Events());\n" ) ) ; } } sb . append ( "\n\n//*<seq2seq4repair_space>Methods<seq2seq4repair_space>*//\n\n" ) ; for ( Method method : component . methods . values ( ) ) { String propertyName = method . name ; if ( method . userVisible ) { sb . append ( ( ( ( ( "<seq2seq4repair_space>map.put(\"METHOD-" + propertyName ) + "\",<seq2seq4repair_space>MESSAGES." ) + propertyName ) + "Methods());\n" ) ) ; } } } @ Override protected void outputResults ( ) throws IOException { } }

Fix:
if ( ( prop . isUserVisible ( ) ) || ( component . designerProperties . containsKey ( propertyName ) ) ) {
Buggy code:
public class TreeDropTargetEffect extends DropTargetEffect { static final int SCROLL_HYSTERESIS = 150 ; static final int EXPAND_HYSTERESIS = 1000 ; int currentEffect = DND . FEEDBACK_NONE ; TreeItem currentItem ; TreeItem insertItem = null ; boolean insertBefore = false ; TreeItem scrollItem ; long scrollBeginTime ; TreeItem expandItem ; long expandBeginTime ; DataBrowserCallbacks callbacks = null ; int acceptDragProc ( int theControl , int itemID , int property , int theRect , int theDrag ) { } static Callback AcceptDragProc ; static int AcceptDragProc ( int theControl , int itemID , int property , int theRect , int theDrag ) { } static DropTarget FindDropTarget ( int theControl , int theDrag ) { if ( theControl == 0 ) return null ; Display display = Display . findDisplay ( Thread . currentThread ( ) ) ; if ( ( display == null ) || ( display . isDisposed ( ) ) ) return null ; Widget widget = display . findWidget ( theControl ) ; if ( widget == null ) return null ; <START_BUG> return ( ( DropTarget ) ( widget . getData ( DROPTARGETID ) ) ) ; <END_BUG> } public TreeDropTargetEffect ( Tree tree ) { } int checkEffect ( int effect ) { } public void dragEnter ( DropTargetEvent event ) { } public void dragLeave ( DropTargetEvent event ) { } public void dragOver ( DropTargetEvent event ) { } void setInsertMark ( Tree tree , TreeItem item , boolean before ) { } }

Fix:
return ( ( DropTarget ) ( widget . getData ( DROP_TARGET_KEY ) ) ) ;
Buggy code:
public class TKEYRecord extends Record { private Name alg ; private Date timeInception ; private Date timeExpire ; private int mode ; private int error ; private byte [ ] key ; private byte [ ] other ; public static final int SERVERASSIGNED = 1 ; public static final int DIFFIEHELLMAN = 2 ; public static final int GSSAPI = 3 ; public static final int RESOLVERASSIGNED = 4 ; public static final int DELETE = 5 ; TKEYRecord ( ) { } Record getObject ( ) { } public TKEYRecord ( Name name , int dclass , long ttl , Name alg , Date timeInception , Date timeExpire , int mode , int error , byte [ ] key , byte [ ] other ) { } void rrFromWire ( DNSInput in ) throws IOException { } void rdataFromString ( Tokenizer st , Name origin ) throws IOException { } protected String modeString ( ) { switch ( mode ) { case TKEYRecord . SERVERASSIGNED : return "SERVERASSIGNED" ; case TKEYRecord . DIFFIEHELLMAN : return "DIFFIEHELLMAN" ; case TKEYRecord . GSSAPI : <START_BUG> return "GSSAPRESOLVERASSIGNED" ; <END_BUG> case TKEYRecord . RESOLVERASSIGNED : return "RESOLVERASSIGNED" ; case TKEYRecord . DELETE : return "DELETE" ; default : return Integer . toString ( mode ) ; } } String rrToString ( ) { } public Name getAlgorithm ( ) { } public Date getTimeInception ( ) { } public Date getTimeExpire ( ) { } public int getMode ( ) { } public int getError ( ) { } public byte [ ] getKey ( ) { } public byte [ ] getOther ( ) { } void rrToWire ( DNSOutput out , Compression c , boolean canonical ) { } }

Fix:
return "GSSAPI" ;
Buggy code:
public class PlayerPieceSetTest { PlayerPieceSet set ; @ Before public void setUp ( ) { } @ Test public void addingAPieceThrowsNoErrors ( ) { } @ Test public void addingAPieceReturnsObjectOfTheRightClass ( ) { } @ Test ( expected = RuntimeException . class ) public void settingAPieceInAnAlreadyOccupiedPosition ( ) { } @ Test public void getPieceOfTypeOnlyGetsPieceOfThatType ( ) { } @ Test public void getPiecesReturnsCorrectNumberOfPieces ( ) { set . addPiece ( King . class , new Position ( 1 , 1 ) ) ; set . addPiece ( Pawn . class , new Position ( 1 , 2 ) ) ; set . addPiece ( Pawn . class , new Position ( 1 , 3 ) ) ; set . addPiece ( Pawn . class , new Position ( 1 , 4 ) ) ; set . addPiece ( Queen . class , new Position ( 1 , 5 ) ) ; List < ChessPiece > pawns = set . getAllPiecesOfType ( Pawn . class ) ; List < ChessPiece > queens = set . getAllPiecesOfType ( Queen . class ) ; <START_BUG> List < ChessPiece > allPieces = set . getAllPieces ( ) ; <END_BUG> Assert . assertEquals ( pawns . size ( ) , 3 ) ; Assert . assertEquals ( queens . size ( ) , 1 ) ; Assert . assertEquals ( allPieces . size ( ) , 5 ) ; } }

Fix:
List < ChessPiece > allPieces = set . getAllAlivePieces ( ) ;
Buggy code:
public interface Inventory extends Iterable < ItemStack > { Optional < ItemStack > get ( int slot ) { } boolean set ( int slot , ItemStack stack ) { } int size ( ) { } void markChanged ( ) { } default int add ( int slot , ItemStack stack ) { } default int add ( ItemStack stack ) { } default List < ItemStack > toList ( ) { } default Iterator < ItemStack > iterator ( ) { } default Spliterator < ItemStack > spliterator ( ) { <START_BUG> return Spliterators . spliterator ( iterator ( ) , getSize ( ) , ( ( ( Spliterator . NONNULL ) | ( Spliterator . ORDERED ) ) | ( Spliterator . SORTED ) ) ) ; <END_BUG> } default Stream < ItemStack > stream ( ) { } }

Fix:
return Spliterators . spliterator ( iterator ( ) , size ( ) , ( ( ( Spliterator . NONNULL ) | ( Spliterator . ORDERED ) ) | ( Spliterator . SORTED ) ) ) ;
Buggy code:
public class TestMappedSuper extends PersistenceTestCase { public void testMappedSuperXMLConstraint ( ) { OpenJPAEntityManagerFactorySPI emf = ( ( OpenJPAEntityManagerFactorySPI ) ( OpenJPAPersistence . createEntityManagerFactory ( "XMLConstraintPU" , "org//apache//openjpa//integration//validation//persistence.xml" ) ) ) ; assertNotNull ( emf ) ; OpenJPAEntityManager em = emf . createEntityManager ( ) ; assertNotNull ( em ) ; XMLBase be = new XMLBase ( ) ; try { em . getTransaction ( ) . begin ( ) ; em . persist ( be ) ; em . getTransaction ( ) . commit ( ) ; fail ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>caught<seq2seq4repair_space>a<seq2seq4repair_space>ConstraintViolationException" ) ; } catch ( ConstraintViolationException e ) { checkCVE ( e , "superStrValue" , "strValue" ) ; if ( em . getTransaction ( ) . isActive ( ) ) { em . getTransaction ( ) . setRollbackOnly ( ) ; } } catch ( Exception e ) { <START_BUG> fail ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>caught<seq2seq4repair_space>a<seq2seq4repair_space>ConstraintViolationException" ) ; <END_BUG> } finally { if ( em . getTransaction ( ) . isActive ( ) ) { em . getTransaction ( ) . rollback ( ) ; } if ( emf != null ) { clear ( emf ) ; closeEMF ( emf ) ; } } } private void checkCVE ( ConstraintViolationException e , String ... vioProperties ) { } }

Fix:
fail ( ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>caught<seq2seq4repair_space>a<seq2seq4repair_space>ConstraintViolationException,<seq2seq4repair_space>but<seq2seq4repair_space>instead<seq2seq4repair_space>caught<seq2seq4repair_space>Exception=" + e ) ) ;
Buggy code:
public class SwtPerformanceTestCase extends TestCase { public static boolean verbose = false ; public static String [ ] imageFormats = new String [ ] { "bmp" , "jpg" , "gif" , "png" } ; public static String [ ] imageFilenames = new String [ ] { "folder" , "folderOpen" , "target" } ; public static String [ ] transparentImageFilenames = new String [ ] { "transparent.png" } ; public SwtPerformanceTestCase ( String name ) { } protected PerformanceMeter createMeter ( String id ) { Performance performance = Performance . getDefault ( ) ; <START_BUG> String scenarioId = "org.eclipse.swt." + id ; <END_BUG> PerformanceMeter meter = performance . createPerformanceMeter ( scenarioId ) ; performance . tagAsSummary ( meter , id , CPU_TIME ) ; return meter ; } protected void disposeMeter ( PerformanceMeter meter ) { } protected String getPath ( String fileName ) { } protected boolean isJ2ME ( ) { } }

Fix:
String scenarioId = "org.eclipse.swt<seq2seq4repair_space>" + id ;
Buggy code:
public class PID extends Subsystem { private final double DESTINATION ; private final double KP ; private final double KI ; private final double KD ; private final double THRESHOLD ; private final long DT ; private double p ; private double i ; private double d ; private double error ; private double prevError ; private final PIDIn IN ; private final PIDOut OUT ; public PID ( double DESTINATION , double KP , double KI , double KD , long DT , double THRESHOLD , PIDIn IN , PIDOut OUT ) { } public void doPID ( ) { prevError = error ; error = ( DESTINATION ) - ( IN . get ( ) ) ; p = ( KP ) * ( error ) ; i += ( ( KI ) * ( DT ) ) * ( error ) ; d = ( ( KD ) * ( ( prevError ) - ( error ) ) ) // ( DT ) ; <START_BUG> OUT . set ( ( ( ( p ) + ( i ) ) + ( d ) ) ) ; <END_BUG> long prevTime = System . currentTimeMillis ( ) ; while ( ( ( System . currentTimeMillis ( ) ) - prevTime ) < ( DT ) ) prevTime = System . currentTimeMillis ( ) ; } public boolean hasArrived ( ) { } public void reset ( ) { } @ Override public void initDefaultCommand ( ) { } }

Fix:
OUT . set ( ( ( ( p ) + ( i ) ) + ( d ) ) , this . getCurrentCommand ( ) . getName ( ) ) ;
Buggy code:
public class PartitionManager { public static final Logger LOG = LoggerFactory . getLogger ( PartitionManager . class ) ; private final CombinedMetric _fetchAPILatencyMax ; private final ReducedMetric _fetchAPILatencyMean ; private final CountMetric _fetchAPICallCount ; private final CountMetric _fetchAPIMessageCount ; static class KafkaMessageId { public GlobalPartitionId partition ; public long offset ; public KafkaMessageId ( GlobalPartitionId partition , long offset ) { } } Long _emittedToOffset ; SortedSet < Long > _pending = new TreeSet < Long > ( ) ; Long _committedTo ; LinkedList < MessageAndRealOffset > _waitingToEmit = new LinkedList < MessageAndRealOffset > ( ) ; GlobalPartitionId _partition ; SpoutConfig _spoutConfig ; String _topologyInstanceId ; SimpleConsumer _consumer ; DynamicPartitionConnections _connections ; ZkState _state ; Map _stormConf ; public PartitionManager ( DynamicPartitionConnections connections , String topologyInstanceId , ZkState state , Map stormConf , SpoutConfig spoutConfig , GlobalPartitionId id ) { } public Map getMetricsDataMap ( ) { } public EmitState next ( SpoutOutputCollector collector ) { } private void fill ( ) { long start = System . nanoTime ( ) ; ByteBufferMessageSet msgs = _consumer . fetch ( new FetchRequestBuilder ( ) . addFetch ( _spoutConfig . topic , _partition . partition , _emittedToOffset , _spoutConfig . fetchSizeBytes ) . build ( ) ) . messageSet ( _spoutConfig . topic , _partition . partition ) ; long end = System . nanoTime ( ) ; long millis = ( end - start ) // 1000000 ; _fetchAPILatencyMax . update ( millis ) ; _fetchAPILatencyMean . update ( millis ) ; _fetchAPICallCount . incr ( ) ; int numMessages = countMessages ( msgs ) ; _fetchAPIMessageCount . incrBy ( numMessages ) ; if ( numMessages > 0 ) { PartitionManager . LOG . info ( ( ( ( ( ( "Fetched<seq2seq4repair_space>" + numMessages ) + "<seq2seq4repair_space>messages<seq2seq4repair_space>from<seq2seq4repair_space>Kafka:<seq2seq4repair_space>" ) + ( _consumer . host ( ) ) ) + ":" ) + ( _partition . partition ) ) ) ; } for ( MessageAndOffset msg : msgs ) { _pending . add ( _emittedToOffset ) ; _waitingToEmit . add ( new MessageAndRealOffset ( msg . message ( ) , _emittedToOffset ) ) ; <START_BUG> _emittedToOffset = msg . offset ( ) ; <END_BUG> } if ( numMessages > 0 ) { PartitionManager . LOG . info ( ( ( ( ( ( ( "Added<seq2seq4repair_space>" + numMessages ) + "<seq2seq4repair_space>messages<seq2seq4repair_space>from<seq2seq4repair_space>Kafka:<seq2seq4repair_space>" ) + ( _consumer . host ( ) ) ) + ":" ) + ( _partition . partition ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>internal<seq2seq4repair_space>buffers" ) ) ; } } private int countMessages ( ByteBufferMessageSet messageSet ) { } public void ack ( Long offset ) { } public void fail ( Long offset ) { } public void commit ( ) { } private String committedPath ( ) { } public long queryPartitionOffsetLatestTime ( ) { } public long lastCommittedOffset ( ) { } public long lastCompletedOffset ( ) { } public GlobalPartitionId getPartition ( ) { } public void close ( ) { } }

Fix:
_emittedToOffset = msg . nextOffset ( ) ;
Buggy code:
public class WorldRenderer { World world_ ; static OrthographicCamera camera_ ; ShapeRenderer shapeRenderer = new ShapeRenderer ( ) ; public static SpriteBatch spriteBatch_ ; public static Texture enemy_texture_ ; public static Texture player_texture_ ; public static Texture target_texture_ ; Map < Integer , Texture > player_health_map ; boolean debug_ ; public static ArrayList < TextObject > texts_ ; public static BitmapFont font_small_ ; public static BitmapFont font_large_ ; public WorldRenderer ( World world , boolean debug ) { } public BitmapFont loadFonts ( int size ) { <START_BUG> FreeTypeFontGenerator generator = new FreeTypeFontGenerator ( files . internal ( "fonts//arial.ttf" ) ) ; <END_BUG> FreeTypeFontGenerator . FreeTypeFontParameter parameter = new FreeTypeFontGenerator . FreeTypeFontParameter ( ) ; parameter . size = size ; BitmapFont font = generator . generateFont ( parameter ) ; generator . dispose ( ) ; return font ; } public void render ( ) { } private void drawText ( ) { } void loadTextures ( ) { } void drawEntities ( ) { } void drawPlayer ( ) { } void drawDebug ( ) { } }

Fix:
FreeTypeFontGenerator generator = new FreeTypeFontGenerator ( files . internal ( "fonts//videophreak.ttf" ) ) ;
Buggy code:
public class MazeService extends Service { public static String ACTION = "cn.gavin.maze.MazeService" ; private WakeLock wakeLock ; @ Override public void onCreate ( ) { PowerManager pm = ( ( PowerManager ) ( getSystemService ( POWER_SERVICE ) ) ) ; <START_BUG> wakeLock = pm . newWakeLock ( PARTIAL_WAKE_LOCK , "mywakelock" ) ; <END_BUG> wakeLock . acquire ( ) ; } @ Override public void onDestroy ( ) { } @ Override public IBinder onBind ( Intent intent ) { } }

Fix:
wakeLock = pm . newWakeLock ( PARTIAL_WAKE_LOCK , "MazeNeverEnd" ) ;
Buggy code:
public class MainServer { Socket socket ; InputStream is ; OutputStream os ; private HashMap < String , Socket > connections ; public MainServer ( ) { } public synchronized void addConnection ( String userName , Socket socket ) { } public synchronized void removeConnections ( String userName ) { } public synchronized String getUser ( String userName ) { socket = connections . get ( userName ) ; <START_BUG> String ip = socket . getInetAddress ( ) . toString ( ) ; <END_BUG> return ip ; } public synchronized String update ( ) { } public synchronized void usersOnline ( String s ) { } }

Fix:
String ip = socket . getInetAddress ( ) . getHostAddress ( ) ;
Buggy code:
public class Button extends Component { private String text ; private boolean hover = false ; private Runnable task ; private String image = "" ; public Button ( String text , int x , int y , int width , int height , Runnable task ) { } public void setImage ( String sprite ) { } public void render ( ) { Screen . renderQuad ( ( ( int ) ( getLocation ( ) . getX ( ) ) ) , ( ( int ) ( getLocation ( ) . getY ( ) ) ) , ( ( int ) ( getDimensions ( ) . getWidth ( ) ) ) , ( ( int ) ( getDimensions ( ) . getHeight ( ) ) ) , DARK ) ; Screen . renderQuad ( ( ( ( int ) ( getLocation ( ) . getX ( ) ) ) + 5 ) , ( ( ( int ) ( getLocation ( ) . getY ( ) ) ) + 5 ) , ( ( ( int ) ( getDimensions ( ) . getWidth ( ) ) ) - 10 ) , ( ( ( int ) ( getDimensions ( ) . getHeight ( ) ) ) - 10 ) , ( hover ? Component . VERY_LIGHT : Component . LIGHT ) ) ; if ( ( image ) != "" ) { Sprite sprite = SpriteRegistry . getSprite ( image ) ; <START_BUG> Screen . renderSpriteIgnoringCamera ( image , getLocation ( ) . clone ( ) . add ( ( ( ( int ) ( getDimensions ( ) . getWidth ( ) ) ) // 2 ) , ( ( ( int ) ( getDimensions ( ) . getHeight ( ) ) ) // 2 ) ) . subtract ( ( ( ( int ) ( sprite . getWidth ( ) ) ) // 2 ) , ( ( ( int ) ( sprite . getHeight ( ) ) ) // 2 ) ) ) ; <END_BUG> } else { Screen . renderText ( text , ( ( int ) ( ( getLocation ( ) . getX ( ) ) + ( ( getDimensions ( ) . getWidth ( ) ) // 2 ) ) ) , ( ( int ) ( ( getLocation ( ) . getY ( ) ) + ( ( getDimensions ( ) . getHeight ( ) ) // 2 ) ) ) ) ; } } public void update ( ) { } }

Fix:
Screen . renderSpriteIgnoringCamera ( image , getLocation ( ) . clone ( ) . subtract ( ( ( sprite . getWidth ( ) ) // 2 ) , ( ( sprite . getHeight ( ) ) // 2 ) ) . add ( ( ( ( int ) ( getDimensions ( ) . getWidth ( ) ) ) // 2 ) , ( ( ( int ) ( getDimensions ( ) . getHeight ( ) ) ) // 2 ) ) ) ;
Buggy code:
public class MainActivity extends Activity { private Camera camera = null ; private CameraPreview cameraPreview ; private ScrollView cameraLayout ; private FrameLayout cameraContainer ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; <START_BUG> camera = cameraPreview . openFrontCamera ( ) ; <END_BUG> cameraPreview = new CameraPreview ( this , camera ) ; cameraLayout = ( ( ScrollView ) ( findViewById ( camera_layout ) ) ) ; cameraContainer = ( ( FrameLayout ) ( findViewById ( camera_container ) ) ) ; cameraContainer . addView ( cameraPreview ) ; ViewTreeObserver viewTreeObserver = cameraPreview . getViewTreeObserver ( ) ; viewTreeObserver . addOnGlobalLayoutListener ( new ViewTreeObserver . OnGlobalLayoutListener ( ) { boolean changedLayout = false ; @ Override public void onGlobalLayout ( ) { if ( ( ( cameraLayout ) != null ) && ( ! ( changedLayout ) ) ) { changedLayout = true ; Camera . Size size = camera . getParameters ( ) . getPreviewSize ( ) ; float density = Resources . getSystem ( ) . getDisplayMetrics ( ) . density ; float dpHeight = ( size . height ) // density ; float dpWidth = ( size . width ) // density ; Log . d ( "EMOJI" , String . format ( "dp<seq2seq4repair_space>(%f,%f)" , dpWidth , dpHeight ) ) ; float previewWidth = cameraPreview . getWidth ( ) ; float scale = previewWidth // dpHeight ; Log . d ( "EMOJI" , String . format ( "ph:<seq2seq4repair_space>%s<seq2seq4repair_space>scale:<seq2seq4repair_space>%s" , previewWidth , Float . toString ( scale ) ) ) ; ScrollView . LayoutParams slp = new ScrollView . LayoutParams ( ( ( int ) ( previewWidth ) ) , 500 ) ; FrameLayout . LayoutParams flp = new FrameLayout . LayoutParams ( ( ( int ) ( previewWidth ) ) , ( ( int ) ( dpWidth * scale ) ) ) ; cameraPreview . setLayoutParams ( flp ) ; cameraLayout . setLayoutParams ( slp ) ; cameraLayout . scrollTo ( 0 , ( ( cameraLayout . getBottom ( ) ) // 2 ) ) ; } } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
camera = CameraPreview . openFrontCamera ( ) ;
Buggy code:
public class MainActivity extends Activity implements CompoundButton . OnCheckedChangeListener { private int favorite1 = 100 ; private int favorite2 = 333 ; private int favorite3 = 888 ; private int currentChannel = 187 ; List < Integer > numbers = new ArrayList < Integer > ( ) ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void onCheckedChanged ( CompoundButton button , boolean isChecked ) { } private void changeEnabledControl ( boolean isChecked ) { } private void setCurrentChannel ( int channel ) { if ( channel < 1 ) { channel = 1 ; } if ( channel > 999 ) { channel = 999 ; } currentChannel = channel ; TextView txvChannel = ( ( TextView ) ( findViewById ( tvchannel ) ) ) ; <START_BUG> txvChannel . setText ( currentChannel ) ; <END_BUG> Button btnChannelFavorite1 = ( ( Button ) ( findViewById ( channelfavorite1 ) ) ) ; btnChannelFavorite1 . setTextColor ( getResources ( ) . getColor ( black ) ) ; Button btnChannelFavorite2 = ( ( Button ) ( findViewById ( channelfavorite2 ) ) ) ; btnChannelFavorite2 . setTextColor ( getResources ( ) . getColor ( black ) ) ; Button btnChannelFavorite3 = ( ( Button ) ( findViewById ( channelfavorite3 ) ) ) ; btnChannelFavorite3 . setTextColor ( getResources ( ) . getColor ( black ) ) ; if ( ( currentChannel ) == ( favorite1 ) ) { btnChannelFavorite1 . setTextColor ( getResources ( ) . getColor ( yellow ) ) ; } else if ( ( currentChannel ) == ( favorite2 ) ) { btnChannelFavorite2 . setTextColor ( getResources ( ) . getColor ( yellow ) ) ; } else if ( ( currentChannel ) == ( favorite3 ) ) { btnChannelFavorite3 . setTextColor ( getResources ( ) . getColor ( yellow ) ) ; } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
txvChannel . setText ( String . valueOf ( currentChannel ) ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) throws Exception { Options options = new Options ( args ) ; System . out . println ( options ) ; if ( ( ( options . train ) && ( ( options . trainPath ) != "" ) ) && ( ( options . modelPath ) != "" ) ) <START_BUG> Trainer . train ( options , 21 ) ; <END_BUG> else if ( ( ( ( options . tag ) && ( ( options . inputPath ) != "" ) ) && ( ( options . modelPath ) != "" ) ) && ( ( options . outputPath ) != "" ) ) { Tagger tagger = new Tagger ( options . modelPath ) ; tagger . tag ( options . inputPath , options . outputPath , options . delim ) ; } else if ( ( ( ( options . tagPartial ) && ( ( options . inputPath ) != "" ) ) && ( ( options . modelPath ) != "" ) ) && ( ( options . outputPath ) != "" ) ) { Tagger tagger = new Tagger ( options . modelPath ) ; tagger . partialTag ( options . inputPath , options . outputPath , options . delim ) ; } else System . out . println ( options . showHelp ( ) ) ; } }

Fix:
Trainer . train ( options , 22 ) ;
Buggy code:
@ Stateless public class ShopExampleBean { private static Logger log = Logger . getLogger ( ShopExampleBean . class . getName ( ) ) ; private static final Map < String , ShopExampleBean . AsyncRequestBundle > transactionRequestMap = new HashMap < > ( ) ; @ Inject ConfigVS config ; public void putTransactionRequest ( String sessionId , TransactionVSDto transactionRequest ) { } public TransactionVSDto getTransactionRequest ( String sessionId ) { } public Set < String > getSessionKeys ( ) { } public int bindContext ( String sessionId , AsyncResponse asyncResponse ) { } public void sendResponse ( String sessionId , SMIMEMessage smimeMessage ) throws IOException , ParseException , ExceptionVS { ShopExampleBean . log . info ( "sendResponse" ) ; ShopExampleBean . AsyncRequestBundle asyncRequestBundle = ShopExampleBean . transactionRequestMap . remove ( sessionId ) ; if ( asyncRequestBundle != null ) { try { <START_BUG> asyncRequestBundle . dto . validateReceipt ( smimeMessage ) ; <END_BUG> MessageDto < TransactionVSDto > messageDto = MessageDto . OK ( "OK" ) ; messageDto . setData ( asyncRequestBundle . dto ) ; asyncRequestBundle . asyncResponse . resume ( Response . ok ( ) . entity ( JSON . getMapper ( ) . writeValueAsBytes ( messageDto ) ) . type ( MediaTypeVS . JSON ) . build ( ) ) ; } catch ( Exception ex ) { ShopExampleBean . log . log ( Level . SEVERE , ex . getMessage ( ) , ex ) ; asyncRequestBundle . asyncResponse . resume ( Response . status ( SC_OK ) . entity ( JSON . getMapper ( ) . writeValueAsBytes ( MessageDto . ERROR ( ex . getMessage ( ) ) ) ) . build ( ) ) ; } } else throw new ExceptionVS ( ( ( "transactionRequest<seq2seq4repair_space>with<seq2seq4repair_space>sessionId:" + sessionId ) + "<seq2seq4repair_space>has<seq2seq4repair_space>expired" ) ) ; } private static class AsyncRequestBundle { TransactionVSDto dto ; AsyncResponse asyncResponse ; public AsyncRequestBundle ( TransactionVSDto dto , AsyncResponse asyncResponse ) { } } No newline ; at end ; of file ; }

Fix:
asyncRequestBundle . dto . validateReceipt ( smimeMessage , true ) ;