nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ParameterizedGenericMethodBinding extends ParameterizedMethodBinding implements Substitution { public TypeBinding [ ] typeArguments ; private LookupEnvironment environment ; public boolean inferredReturnType ; public boolean wasInferred ; public boolean isRaw ; private MethodBinding tiebreakMethod ; public boolean isUnchecked ; public static MethodBinding computeCompatibleMethod ( MethodBinding originalMethod , TypeBinding [ ] arguments , Scope scope , InvocationSite invocationSite ) { } private static ParameterizedGenericMethodBinding inferFromArgumentTypes ( Scope scope , MethodBinding originalMethod , TypeBinding [ ] arguments , TypeBinding [ ] parameters , InferenceContext inferenceContext ) { } private static boolean resolveSubstituteConstraints ( Scope scope , TypeVariableBinding [ ] typeVariables , InferenceContext inferenceContext , boolean considerEXTENDSConstraints ) { } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , RawTypeBinding rawType , LookupEnvironment environment ) { } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , TypeBinding [ ] typeArguments , LookupEnvironment environment ) { } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public LookupEnvironment environment ( ) { } public boolean hasSubstitutedParameters ( ) { } public boolean hasSubstitutedReturnType ( ) { } private ParameterizedGenericMethodBinding inferFromExpectedType ( Scope scope , InferenceContext inferenceContext ) { } public boolean isRawSubstitution ( ) { } public TypeBinding substitute ( TypeVariableBinding originalVariable ) { } public MethodBinding tiebreakMethod ( ) { if ( ( this . tiebreakMethod ) == null ) { TypeVariableBinding [ ] originalVariables = this . originalMethod . typeVariables ; int length = originalVariables . length ; TypeBinding [ ] newArguments = new TypeBinding [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; <START_BUG> if ( ( originalVariable . boundsCount ( ) ) == 1 ) { <END_BUG> newArguments [ i ] = this . environment . convertToRawType ( originalVariable . upperBound ( ) , false ) ; } else { newArguments [ i ] = this . environment . convertToRawType ( this . environment . createWildcard ( null , 0 , originalVariable . superclass ( ) , originalVariable . superInterfaces ( ) , Wildcard . EXTENDS ) , false ) ; } } this . tiebreakMethod = this . environment . createParameterizedGenericMethod ( this . originalMethod , newArguments ) ; } return this . tiebreakMethod ; } }

Fix:
if ( ( originalVariable . boundsCount ( ) ) <= 1 ) {
Buggy code:
public interface PlayerDataSource { ListMultimap < TeamDraftOrder , Integer > getAllKeepers ( ) throws DataSourceException { } void populateQueueEntry ( QueueEntry queueEntry ) throws DataSourceException { } void populateDraftPick ( DraftPick draftPick ) throws DataSourceException { } void postDraftPick ( DraftPick draftPick , DraftStatus status ) throws DataSourceException { } void backOutLastDraftPick ( int pickToRemove ) throws DataSourceException { } void populateDraftStatus ( DraftStatus status ) throws DataSourceException { } void copyTableSpecToCustom ( TeamId teamID , TableSpec tableSpec ) throws DataSourceException { } GraphsData getGraphsData ( TeamDraftOrder myTeam ) throws DataSourceException { } <START_BUG> List < Player > getPlayers ( TeamId teamId , TableSpec tableSpec ) throws DataSourceException ; <END_BUG> void shiftInBetweenRanks ( TeamId teamID , int lesserRank , int greaterRank , boolean increase ) { } void updatePlayerRank ( TeamId teamID , int newRank , long playerID ) { } No newline ; at end ; of file ; }

Fix:
List < Player > getPlayers ( TeamId teamId , PlayerDataSet playerDataSet ) throws DataSourceException ;
Buggy code:
public class DefaultCase extends Statement { public CaseLabel targetLabel ; public DefaultCase ( int sourceEnd , int sourceStart ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( ( bits ) & ( IsReachableMASK ) ) == 0 ) { return ; } int pc = codeStream . position ; targetLabel . place ( ) ; <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public Constant resolveCase ( BlockScope scope , TypeBinding testType , SwitchStatement switchStatement ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class UnionFindTest { private static final String PATH = "test//com//barrybecker4//common//util//" ; private UnionFind uf ; @ Test public void testTiny ( ) throws Exception { } @ Test public void testMedium ( ) throws Exception { } @ Test public void testLarge ( ) throws Exception { long start = System . currentTimeMillis ( ) ; uf = UnionFind . create ( new FileInputStream ( ( ( UnionFindTest . PATH ) + "data//largeUF.txt" ) ) ) ; long elapsed = ( System . currentTimeMillis ( ) ) - start ; assertEquals ( "Unexpected<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>sets" , 6 , uf . getCount ( ) ) ; <START_BUG> assertTrue ( ( "Too<seq2seq4repair_space>long:<seq2seq4repair_space>" + elapsed ) , ( elapsed < 4500 ) ) ; <END_BUG> } @ Test public void testFind ( ) throws Exception { } @ Test public void testConnected ( ) throws Exception { } }

Fix:
assertTrue ( ( "Too<seq2seq4repair_space>long:<seq2seq4repair_space>" + elapsed ) , ( elapsed < 8500 ) ) ;
Buggy code:
public class SocketReader extends Thread { private final TS3Query ts3 ; private volatile boolean stop ; public SocketReader ( TS3Query ts3 ) { } @ Override public void run ( ) { while ( ( ( ( ( ts3 . getSocket ( ) ) != null ) && ( ts3 . getSocket ( ) . isConnected ( ) ) ) && ( ( ts3 . getIn ( ) ) != null ) ) && ( ! ( stop ) ) ) { try { if ( ts3 . getIn ( ) . ready ( ) ) { <START_BUG> final String line = StringUtil . convertFromUTF8 ( ts3 . getIn ( ) . readLine ( ) ) ; <END_BUG> if ( ! ( line . isEmpty ( ) ) ) { final Command c = ts3 . getCommandList ( ) . peek ( ) ; if ( line . startsWith ( "notify" ) ) { log . info ( ( "<<seq2seq4repair_space>[event]<seq2seq4repair_space>" + line ) ) ; new Thread ( new Runnable ( ) { public void run ( ) { final String [ ] arr = line . split ( "<seq2seq4repair_space>" , 2 ) ; ts3 . getEventManager ( ) . fireEvent ( arr [ 0 ] , arr [ 1 ] ) ; } } ) . start ( ) ; } else if ( ( c != null ) && ( c . isSent ( ) ) ) { log . info ( ( ( ( "[" + ( c . getName ( ) ) ) + "]<seq2seq4repair_space><<seq2seq4repair_space>" ) + line ) ) ; if ( line . startsWith ( "error" ) ) { c . feedError ( line . substring ( "error<seq2seq4repair_space>" . length ( ) ) ) ; if ( ( c . getError ( ) . getId ( ) ) != 0 ) { log . severe ( ( "[ERROR]<seq2seq4repair_space>" + ( c . getError ( ) ) ) ) ; } c . setAnswered ( ) ; ts3 . getCommandList ( ) . remove ( c ) ; } else if ( ! ( line . isEmpty ( ) ) ) { c . feed ( line ) ; } } else { log . info ( ( "<<seq2seq4repair_space>" + line ) ) ; } } } } catch ( final IOException e ) { e . printStackTrace ( ) ; } try { Thread . sleep ( 50 ) ; } catch ( final InterruptedException e ) { e . printStackTrace ( ) ; } } log . warning ( "SocketReader<seq2seq4repair_space>has<seq2seq4repair_space>stopped!" ) ; } public void finish ( ) { } }

Fix:
final String line = ts3 . getIn ( ) . readLine ( ) ;
Buggy code:
public final class BodyOnLoadHandler extends AbstractMarkupFilter { public static final String BODY_ID = ( Component . AUTO_COMPONENT_PREFIX ) + "<body>" ; public BodyOnLoadHandler ( final IMarkupFilter parent ) { } public MarkupElement nextTag ( ) throws ParseException { <START_BUG> ComponentTag tag = ( ( ComponentTag ) ( getParent ( ) . nextTag ( ) ) ) ; <END_BUG> if ( tag == null ) { return tag ; } if ( ( ( tag . isOpen ( ) ) && ( "body" . equalsIgnoreCase ( tag . getName ( ) ) ) ) && ( ( tag . getNamespace ( ) ) == null ) ) { if ( ( tag . getId ( ) ) == null ) { tag . setId ( BodyOnLoadHandler . BODY_ID ) ; } } return tag ; } }

Fix:
ComponentTag tag = nextComponentTag ( ) ;
Buggy code:
public class XsltTransformer implements ITransformer { private static final String extension = "xsl" ; private final String xslFile ; public XsltTransformer ( ) { } public XsltTransformer ( final String xslFile ) { } public CharSequence transform ( final Component component , final String output ) throws Exception { } private IResourceStream getResourceStream ( final Component component ) { final IResourceStream resourceStream ; String filePath = this . xslFile ; if ( filePath == null ) { filePath = ( ( component . findParentWithAssociatedMarkup ( ) . getClass ( ) . getPackage ( ) . getName ( ) . replace ( '.' , '//' ) ) + "//" ) + ( component . getId ( ) ) ; } <START_BUG> resourceStream = Application . get ( ) . getResourceSettings ( ) . getResourceStreamLocator ( ) . locate ( getClass ( ) , filePath , component . getStyle ( ) , component . getLocale ( ) , XsltTransformer . extension ) ; <END_BUG> return resourceStream ; } }

Fix:
resourceStream = Application . get ( ) . getResourceSettings ( ) . getResourceStreamFactory ( ) . locate ( getClass ( ) , filePath , component . getStyle ( ) , component . getLocale ( ) , XsltTransformer . extension ) ;
Buggy code:
public class Touch extends Task { private File file ; private long millis = - 1 ; private String dateTime ; private Vector filesets = new Vector ( ) ; private FileUtils fileUtils ; public Touch ( ) { } public void setFile ( File file ) { } public void setMillis ( long millis ) { } public void setDatetime ( String dateTime ) { } public void addFileset ( FileSet set ) { } public void execute ( ) throws BuildException { } protected void touch ( ) throws BuildException { if ( ( file ) != null ) { if ( ! ( file . exists ( ) ) ) { log ( ( "Creating<seq2seq4repair_space>" + ( file ) ) , MSG_INFO ) ; try { fileUtils . createNewFile ( file ) ; } catch ( IOException ioe ) { throw new BuildException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>" + ( file ) ) , ioe , location ) ; } } } <START_BUG> if ( ( ( millis ) >= 0 ) && ( ! ( JavaEnvUtils . isJavaVersion ( JAVA_1_1 ) ) ) ) { <END_BUG> log ( "modification<seq2seq4repair_space>time<seq2seq4repair_space>of<seq2seq4repair_space>files<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>set<seq2seq4repair_space>in<seq2seq4repair_space>JDK<seq2seq4repair_space>1.1" , MSG_WARN ) ; return ; } boolean resetMillis = false ; if ( ( millis ) < 0 ) { resetMillis = true ; millis = System . currentTimeMillis ( ) ; } if ( ( file ) != null ) { touch ( file ) ; } for ( int i = 0 ; i < ( filesets . size ( ) ) ; i ++ ) { FileSet fs = ( ( FileSet ) ( filesets . elementAt ( i ) ) ) ; DirectoryScanner ds = fs . getDirectoryScanner ( project ) ; File fromDir = fs . getDir ( project ) ; String [ ] srcFiles = ds . getIncludedFiles ( ) ; String [ ] srcDirs = ds . getIncludedDirectories ( ) ; for ( int j = 0 ; j < ( srcFiles . length ) ; j ++ ) { touch ( new File ( fromDir , srcFiles [ j ] ) ) ; } for ( int j = 0 ; j < ( srcDirs . length ) ; j ++ ) { touch ( new File ( fromDir , srcDirs [ j ] ) ) ; } } if ( resetMillis ) { millis = - 1 ; } } protected void touch ( File file ) throws BuildException { } }

Fix:
if ( ( ( millis ) >= 0 ) && ( JavaEnvUtils . isJavaVersion ( JAVA_1_1 ) ) ) {
Buggy code:
public class EchoAudioFilter implements AudioFilter { FileSource fsource ; FileSink fsink ; AudioModel audioModel ; int delay ; float attenuation ; public EchoAudioFilter ( FileSource fsource , FileSink fsink , AudioModel audioModel , int delay , float attenuation ) { } @ Override public void process ( ) { if ( validateData ( ) ) { int sampleSize = ( audioModel . getBitsPerSample ( ) ) // 8 ; byte [ ] sampleArray ; boolean finishedProcessing = false ; int n = 0 ; int modificationSampleIndex ; int modificationSampleSignalValue ; LinkedList < LinkedList < Integer > > modificationsList = new LinkedList < LinkedList < Integer > > ( ) ; <START_BUG> audioModel . setDataSize ( ( ( audioModel . getSubchunk2Size ( ) ) + ( ( ( audioModel . getSampleRate ( ) ) * ( delay ) ) // 1000 ) ) ) ; <END_BUG> fsink . push ( audioModel . getHeaderByteArray ( ) ) ; while ( ! finishedProcessing ) { sampleArray = fsource . pop ( sampleSize ) ; int sampleSignalValue = sampleArray [ 0 ] ; if ( ( sampleSignalValue == 0 ) && ( ( modificationsList . size ( ) ) == 0 ) ) { finishedProcessing = true ; break ; } if ( sampleSignalValue != 0 ) { LinkedList < Integer > modification = new LinkedList < Integer > ( ) ; modificationSampleIndex = n + ( ( ( audioModel . getSampleRate ( ) ) * ( delay ) ) // 1000 ) ; modificationSampleSignalValue = sampleSignalValue ; modification . push ( modificationSampleIndex ) ; modification . push ( modificationSampleSignalValue ) ; modificationsList . push ( modification ) ; } if ( ( modificationsList . size ( ) ) > 0 ) { LinkedList < Integer > nextModification = modificationsList . getLast ( ) ; if ( ( nextModification . getLast ( ) ) == n ) { nextModification . removeLast ( ) ; Byte echoSampleByte = nextModification . removeLast ( ) . byteValue ( ) ; short currentSampleShort = ( ( short ) ( sampleSignalValue & 255 ) ) ; short echoShort = ( ( short ) ( echoSampleByte & 255 ) ) ; short resultSampleShortValue = ( ( short ) ( currentSampleShort + ( echoShort * ( attenuation ) ) ) ) ; sampleArray [ 0 ] = ( ( byte ) ( resultSampleShortValue ) ) ; modificationsList . removeLast ( ) ; } } fsink . push ( sampleArray ) ; n ++ ; } System . out . println ( ( n + "<seq2seq4repair_space>samples" ) ) ; fsink . close ( ) ; } } private boolean validateData ( ) { } }

Fix:
audioModel . setChunksSize ( ( ( audioModel . getSubchunk2Size ( ) ) + ( ( ( audioModel . getSampleRate ( ) ) * ( delay ) ) // 1000 ) ) ) ;
Buggy code:
@ Controller @ RequestMapping ( "//task//{taskId}//rail_truck" ) public class RailTruckController extends BaseTaskController { private static final Logger logger = LoggerFactory . getLogger ( RailTruckController . class ) ; private static final String TASK_PATH = "rail_truck" ; @ Autowired private ShippingContainerService scService ; @ Autowired private ShipmentService shipmentService ; @ Autowired private ChargeService chargeService ; @ Autowired private ServiceProviderService serviceProviderService ; @ Autowired private ServiceSubtypeService serviceSubtypeService ; @ RequestMapping ( method = RequestMethod . GET ) public String init ( @ PathVariable String taskId , Model model ) { RailTruckController . logger . debug ( "taskId:<seq2seq4repair_space>{}" , taskId ) ; Long orderId = taskService . getOrderIdByTaskId ( taskId ) ; model . addAttribute ( "containers" , scService . initializeRailContainers ( orderId ) ) ; model . addAttribute ( "rail_task" , RailTruckController . TASK_PATH ) ; Iterable < ShipmentEntity > shipmentSet = shipmentService . findByOrderId ( orderId ) ; model . addAttribute ( "shipmentSet" , shipmentSet ) ; Iterable < ServiceSubtypeEntity > serviceSubtypes = serviceSubtypeService . findEnabled ( ) ; model . addAttribute ( "serviceSubtypes" , serviceSubtypes ) ; model . addAttribute ( "chargeWays" , ChargeWay . values ( ) ) ; model . addAttribute ( "transModes" , TransMode . toMap ( ) ) ; Iterable < ChargeEntity > charges = chargeService . findByTaskId ( taskId ) ; model . addAttribute ( "charges" , charges ) ; model . addAttribute ( "total" , chargeService . total ( charges ) ) ; <START_BUG> return "rail//main" ; <END_BUG> } @ RequestMapping ( value = "//{containerId}" , method = RequestMethod . GET ) public String initRecord ( @ PathVariable String taskId , @ PathVariable long containerId , Model model ) { } @ RequestMapping ( value = "//{containerId}" , method = RequestMethod . POST ) public String record ( @ PathVariable String taskId , @ PathVariable long containerId , @ Valid @ ModelAttribute ( "truck" ) Truck truck , BindingResult bindingResult ) { } @ RequestMapping ( value = "//sending" , method = RequestMethod . GET ) public String initTrucking ( @ PathVariable String taskId , @ RequestParam ( required = false ) boolean done , Model model ) { } @ RequestMapping ( value = "//sending" , method = RequestMethod . POST ) public String trucking ( @ PathVariable String taskId , @ Valid @ ModelAttribute ( "trucking" ) TruckingDto trucking , Model model ) { } }

Fix:
return "rail//<seq2seq4repair_space>" ;
Buggy code:
public class RenameTestProjectHandler extends AbstractRenameHandler { @ Inject private IEclipseContext context ; @ Inject private TestProjectService testProjectService ; @ Inject private TestEditorTranslationService translationService ; private static final Logger LOGGER = Logger . getLogger ( RenameTestProjectHandler . class ) ; @ Override protected void executeSpecials ( TestStructure selected , String sbname ) { } @ Override protected AbstractRenameTestStructureWizardPage getRenameTestStructureWizardPage ( TestStructure selectedTS ) { } @ Override protected void executeRenaming ( TestStructure selectedTestStructure , String sbname ) throws SystemException { } @ Override @ Execute public boolean canExecute ( IEclipseContext context ) { TestExplorer explorer = ( ( TestExplorer ) ( context . get ( TEST_EXPLORER_VIEW ) ) ) ; CanExecuteTestExplorerHandlerRules rules = ContextInjectionFactory . make ( CanExecuteTestExplorerHandlerRules . class , context ) ; <START_BUG> return ( super . canExecute ( context ) ) && ( ( rules . canExecuteOnTestProjectRule ( explorer ) ) & ( ( ( ( TestStructure ) ( explorer . getSelection ( ) . getFirstElement ( ) ) ) . getRootElement ( ) . getTestProjectConfig ( ) . getTeamShareConfig ( ) ) == null ) ) ; <END_BUG> } }

Fix:
return ( super . canExecute ( context ) ) && ( ( rules . canExecuteOnTestProjectRule ( explorer ) ) && ( ( ( ( TestStructure ) ( explorer . getSelection ( ) . getFirstElement ( ) ) ) . getRootElement ( ) . getTestProjectConfig ( ) . getTeamShareConfig ( ) ) == null ) ) ;
Buggy code:
public class MakeMessageSelectorImpl implements MakeMessageSelector { boolean transfer ; boolean answer ; boolean mixture ; boolean function ; public MakeMessageSelectorImpl ( ) { } @ Override public MakeMessage select ( Parsable parser , ResourceBundle domBundle ) { if ( parser . getNormalFlg ( ) ) { transfer = this . checkForTransfer ( parser . getKeys ( ) , domBundle ) ; answer = this . checkForAnswer ( parser . getKeys ( ) , domBundle ) ; mixture = this . checkForMixture ( parser . getKeys ( ) , domBundle ) ; } else if ( parser . getFunctionFlg ( ) ) { function = true ; } if ( transfer ) <START_BUG> return null ; <END_BUG> if ( answer ) return null ; if ( mixture ) return null ; if ( function ) return null ; else return null ; } private boolean checkForTransfer ( ArrayList < String > keys , ResourceBundle domBundle ) { } private boolean checkForAnswer ( ArrayList < String > keys , ResourceBundle domBundle ) { } private boolean checkForMixture ( ArrayList < String > keys , ResourceBundle domBundle ) { } }

Fix:
return new MakeTransfer ( parser ) ;
Buggy code:
public class ReconcileWorkingCopyOperation extends JavaModelOperation { boolean forceProblemDetection ; public ReconcileWorkingCopyOperation ( IJavaElement workingCopy , boolean forceProblemDetection ) { } protected void executeOperation ( ) throws JavaModelException { if ( ( fMonitor ) != null ) { if ( fMonitor . isCanceled ( ) ) return ; fMonitor . beginTask ( Util . bind ( "element.reconciling" ) , 10 ) ; } CompilationUnit workingCopy = getWorkingCopy ( ) ; boolean wasConsistent = workingCopy . isConsistent ( ) ; JavaElementDeltaBuilder deltaBuilder = null ; try { if ( ! wasConsistent ) { deltaBuilder = new JavaElementDeltaBuilder ( workingCopy ) ; workingCopy . makeConsistent ( fMonitor ) ; deltaBuilder . buildDeltas ( ) ; } if ( ( fMonitor ) != null ) fMonitor . worked ( 2 ) ; if ( ( forceProblemDetection ) && wasConsistent ) { if ( ( ( fMonitor ) != null ) && ( fMonitor . isCanceled ( ) ) ) return ; <START_BUG> IProblemRequestor problemRequestor = ( ( IProblemRequestor ) ( JavaModelManager . getJavaModelManager ( ) . getInfo ( workingCopy ) ) ) ; <END_BUG> if ( ( problemRequestor != null ) && ( problemRequestor . isActive ( ) ) ) { problemRequestor . beginReporting ( ) ; CompilationUnitProblemFinder . process ( workingCopy , problemRequestor , fMonitor ) ; problemRequestor . endReporting ( ) ; } } if ( deltaBuilder != null ) { if ( ( ( deltaBuilder . delta ) != null ) && ( ( deltaBuilder . delta . getAffectedChildren ( ) . length ) > 0 ) ) { addReconcileDelta ( workingCopy , deltaBuilder . delta ) ; } } } finally { if ( ( fMonitor ) != null ) fMonitor . done ( ) ; } } protected CompilationUnit getWorkingCopy ( ) { } public boolean isReadOnly ( ) { } protected IJavaModelStatus verify ( ) { } }

Fix:
IProblemRequestor problemRequestor = ( ( IProblemRequestor ) ( workingCopy . getPerWorkingCopyInfo ( ) ) ) ;
Buggy code:
public class WorkbenchHelp { private WorkbenchHelp ( ) { } public static void displayHelp ( ) { } public static void displayContext ( IContext context , int x , int y ) { } public static void displayHelpResource ( String href ) { } public static HelpListener createHelpListener ( ICommand command ) { <START_BUG> return org . eclipse . ui . PlatformUI . getWorkbench ( ) . getHelpSystem ( ) . createHelpListener ( command ) ; <END_BUG> } public static void displayHelp ( String contextId ) { } public static void displayHelp ( IContext context ) { } public static Object getHelp ( Control control ) { } public static Object getHelp ( Menu menu ) { } public static Object getHelp ( MenuItem menuItem ) { } public static IHelp getHelpSupport ( ) { } public static boolean isContextHelpDisplayed ( ) { } public static void setHelp ( IAction action , final Object [ ] contexts ) { } public static void setHelp ( IAction action , final IContextComputer computer ) { } public static void setHelp ( Control control , Object [ ] contexts ) { } public static void setHelp ( Control control , IContextComputer computer ) { } public static void setHelp ( Menu menu , Object [ ] contexts ) { } public static void setHelp ( Menu menu , IContextComputer computer ) { } public static void setHelp ( MenuItem item , Object [ ] contexts ) { } public static void setHelp ( MenuItem item , IContextComputer computer ) { } public static void setHelp ( IAction action , final String contextId ) { } public static void setHelp ( Control control , String contextId ) { } public static void setHelp ( Menu menu , String contextId ) { } public static void setHelp ( MenuItem item , String contextId ) { } }

Fix:
return org . eclipse . ui . internal . help . WorkbenchHelpSystem . getInstance ( ) . createHelpListener ( command ) ;
Buggy code:
public class SendProfileAPI extends AsyncTaskLoader < LinePayData > implements HttpClient . HttpClientInterface { private String user_id = "" ; private String password = "" ; private String sei ; private String mei ; private String post ; private String address_tdfk ; private String address_city ; private String address_street ; private String mail_address ; private String tel ; public SendProfileAPI ( Context context , Bundle bundle ) { } @ Override public LinePayData loadInBackground ( ) { String result = null ; HashMap < String , String > parameter = new HashMap < String , String > ( ) ; parameter . put ( "app_id" , APP_ID ) ; parameter . put ( "app_key" , APP_KEY ) ; parameter . put ( "uuid" , Common . getUUID ( getContext ( ) ) ) ; parameter . put ( "Sei" , sei ) ; parameter . put ( "Mei" , mei ) ; parameter . put ( "Post" , post ) ; parameter . put ( "Address_tdfk" , address_tdfk ) ; parameter . put ( "Address_city" , address_city ) ; parameter . put ( "Address_street" , address_street ) ; parameter . put ( "mail_address" , mail_address ) ; parameter . put ( "Tel" , tel ) ; parameter . put ( "user_id" , user_id ) ; parameter . put ( "Password" , password ) ; <START_BUG> AppUtil . debugLog ( "Data" , ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( Config . APP_ID ) + "\n" ) + ( Config . APP_KEY ) ) + "\n" ) + ( Common . getUUID ( getContext ( ) ) ) ) + ( sei ) ) + "\n" ) + ( mei ) ) + "\n" ) + ( post ) ) + "\n" ) + ( address_city ) ) + "\n" ) + ( address_street ) ) + "\n" ) + ( address_tdfk ) ) + "\n" ) + ( mail_address ) ) + "\n" ) + ( tel ) ) + "\n" ) ) ; <END_BUG> String url = Config . SENDID_SEND_PROFILE ; try { byte [ ] resData = HttpClient . getByteArrayFromUrlPost ( url , parameter , this ) ; if ( resData == null ) { return null ; } result = new String ( resData , "UTF-8" ) ; AppUtil . debugLog ( "RESULT" , result ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; return null ; } catch ( MalformedURLException e ) { e . printStackTrace ( ) ; return null ; } try { JSONObject rootObject = new JSONObject ( result ) ; AppUtil . debugLog ( "JSON" , rootObject . toString ( ) ) ; int error_code = rootObject . getInt ( "error_code" ) ; if ( error_code != 0 ) { return null ; } } catch ( JSONException e ) { e . printStackTrace ( ) ; } return null ; } @ Override public void HttpClientProgress ( float progress ) { } }

Fix:
AppUtil . debugLog ( "Data" , ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( Config . APP_ID ) + "\n" ) + ( Config . APP_KEY ) ) + "\n" ) + ( Common . getUUID ( getContext ( ) ) ) ) + "\n" ) + ( sei ) ) + "\n" ) + ( mei ) ) + "\n" ) + ( post ) ) + "\n" ) + ( address_city ) ) + "\n" ) + ( address_street ) ) + "\n" ) + ( address_tdfk ) ) + "\n" ) + ( mail_address ) ) + "\n" ) + ( tel ) ) + "\n" ) ) ;
Buggy code:
public abstract class TypeLiteral < T > implements Typed < T > { @ SuppressWarnings ( "rawtypes" ) private static final TypeVariable < Class < TypeLiteral > > T = TypeLiteral . class . getTypeParameters ( ) [ 0 ] ; public final Type value ; private final String toString ; protected TypeLiteral ( ) { } @ Override <START_BUG> public final boolean equals ( Object obj ) { <END_BUG> if ( obj == ( this ) ) { return true ; } if ( ( obj instanceof TypeLiteral ) == false ) { return false ; } final TypeLiteral < ? > other = ( ( TypeLiteral < ? > ) ( obj ) ) ; return TypeUtils . equals ( value , other . value ) ; } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } @ Override public Type getType ( ) { } }

Fix:
public final boolean equals ( final Object obj ) {
Buggy code:
public class common { public static void runExpTest ( String componentName , String testName , int expectedReturnCode , boolean isJson ) { } public static void runExpTest ( String componentName , String testName , int expectedReturnCode , boolean isJson , boolean useNullOutputPath , String ... extraArgs ) { } public static void runCustomTest ( String componentName , String testName , int expectedReturnCode , String ... args ) { } public static void runCustomTest ( String componentName , String testName , int expectedReturnCode , boolean quiet , String ... args ) { } public static void compareText ( File expectedOutput , File actualOutput ) throws Exception { } public static void compareJson ( File expectedOutput , File actualOutput ) { } public static void compareXml ( File expectedOutput , File actualOutput ) { Diff diff ; try { FileReader expectedReader = new FileReader ( expectedOutput ) ; FileReader actualReader = new FileReader ( actualOutput ) ; diff = new Diff ( expectedReader , actualReader ) ; } catch ( Exception ex ) { System . err . println ( Messages . get ( "there_were_errors" ) ) ; ex . printStackTrace ( ) ; <START_BUG> Assert . assertTrue ( "Error<seq2seq4repair_space>performing<seq2seq4repair_space>the<seq2seq4repair_space>json<seq2seq4repair_space>comparison:<seq2seq4repair_space>" , false ) ; <END_BUG> return ; } OutputDifferenceListener listener = new OutputDifferenceListener ( ) ; diff . overrideDifferenceListener ( listener ) ; diff . overrideElementQualifier ( new ElementNameAndTextQualifier ( ) ) ; Assert . assertTrue ( "There<seq2seq4repair_space>were<seq2seq4repair_space>skipped<seq2seq4repair_space>comparisons." , ( ( listener . getSkippedComparisons ( ) ) == 0 ) ) ; if ( ! ( diff . similar ( ) ) ) { DetailedDiff details = new DetailedDiff ( diff ) ; List differences = details . getAllDifferences ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( Object difference : differences ) { sb . append ( difference . toString ( ) ) ; } Assert . assertTrue ( ( "The<seq2seq4repair_space>expected<seq2seq4repair_space>xml<seq2seq4repair_space>was<seq2seq4repair_space>different:<seq2seq4repair_space>" + ( sb . toString ( ) ) ) , diff . similar ( ) ) ; } } }

Fix:
Assert . assertTrue ( "Error<seq2seq4repair_space>performing<seq2seq4repair_space>the<seq2seq4repair_space>xml<seq2seq4repair_space>comparison:<seq2seq4repair_space>" , false ) ;
Buggy code:
public class GoalManager { public static final int CONFIG_MAX_PLAYER_GOALS = 3 ; public static final int MAX_ORIGIN_DEST_DISTANCE = 300 ; public static final int MAX_VIA_DISTANCE = ( ( GoalManager . MAX_ORIGIN_DEST_DISTANCE ) * 2 ) // 3 ; public static final int SEARCH_RADIUS_INCREASE_STEP = ( GoalManager . MAX_ORIGIN_DEST_DISTANCE ) // 10 ; private ResourceManager resourceManager ; public GoalManager ( ResourceManager resourceManager ) { } private Goal generateRandom ( int turn ) { Random random = new Random ( ) ; float randomGoalDifficulty = random . nextFloat ( ) ; Goal goal ; <START_BUG> if ( randomGoalDifficulty >= 0.0 ) { <END_BUG> goal = generateDifficultGoal ( turn ) ; } else if ( randomGoalDifficulty >= 0.5 ) { goal = generateMediumGoal ( turn ) ; } else { goal = generateEasyGoal ( turn ) ; } return goal ; } public void addRandomGoalToPlayer ( Player player ) { } public ArrayList < String > trainArrived ( Train train , Player player ) { } public Goal generateEasyGoal ( int turn ) { } public Goal generateMediumGoal ( int turn ) { } public Goal generateDifficultGoal ( int turn ) { } }

Fix:
if ( randomGoalDifficulty >= 0.8 ) {
Buggy code:
public class PrintMessageCommand extends FolderCommand { private cPrintObject mailHeader ; private cPrintObject mailFooter ; private DateFormat mailDateFormat ; private String [ ] headerKeys = new String [ ] { "from" , "to" , "date" , "subject" } ; public PrintMessageCommand ( FrameController frameController , DefaultCommandReference [ ] references ) { } public cPrintObject getMailHeader ( ) { } public cPrintObject getMailFooter ( ) { } public String [ ] getHeaderKeys ( ) { } public DateFormat getMailDateFormat ( ) { } public void updatedGUI ( ) throws Exception { } public void execute ( Worker worker ) throws Exception { MailFrameController mailFrameController = ( ( MailFrameController ) ( frameController ) ) ; FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ; <START_BUG> Object [ ] uids = MessageNode . toUidArray ( ( ( MessageNode [ ] ) ( r [ 0 ] . getUids ( ) ) ) ) ; <END_BUG> Folder srcFolder = ( ( Folder ) ( r [ 0 ] . getFolder ( ) ) ) ; for ( int j = 0 ; j < ( uids . length ) ; j ++ ) { Object uid = uids [ j ] ; Message message = ( ( Message ) ( srcFolder . getMessage ( uid , worker ) ) ) ; ColumbaHeader header = srcFolder . getMessageHeader ( uid , worker ) ; MimePartTree mimePartTree = srcFolder . getMimePartTree ( uid , worker ) ; boolean viewhtml = MailConfig . getMainFrameOptionsConfig ( ) . getWindowItem ( ) . getHtmlViewer ( ) ; MimePart bodyPart = null ; if ( viewhtml ) bodyPart = mimePartTree . getFirstTextPart ( "html" ) ; else bodyPart = mimePartTree . getFirstTextPart ( "plain" ) ; if ( bodyPart == null ) { bodyPart = new MimePart ( ) ; bodyPart . setBody ( new String ( "<No<seq2seq4repair_space>Message-Text>" ) ) ; } else bodyPart = srcFolder . getMimePart ( uid , bodyPart . getAddress ( ) , worker ) ; cDocument messageDoc = new cDocument ( ) ; messageDoc . setHeader ( getMailHeader ( ) ) ; messageDoc . setFooter ( getMailFooter ( ) ) ; String [ ] headerKeys = getHeaderKeys ( ) ; cParagraph hKey ; cParagraph hValue ; cHGroup hLine ; Object value ; for ( int i = 0 ; i < ( Array . getLength ( headerKeys ) ) ; i ++ ) { hKey = new cParagraph ( ) ; hKey . setText ( MailResourceLoader . getString ( "header" , headerKeys [ i ] ) ) ; hKey . setFontStyle ( Font . BOLD ) ; hValue = new cParagraph ( ) ; if ( headerKeys [ i ] . equals ( "date" ) ) { value = header . get ( "columba.date" ) ; } else { value = header . get ( headerKeys [ i ] ) ; } if ( value instanceof Date ) { hValue . setText ( getMailDateFormat ( ) . format ( ( ( Date ) ( value ) ) ) ) ; } else { hValue . setText ( ( ( String ) ( value ) ) ) ; } hValue . setLeftMargin ( new org . columba . core . print . cCmUnit ( 3.0 ) ) ; hLine = new cHGroup ( ) ; hLine . add ( hKey ) ; hLine . add ( hValue ) ; messageDoc . appendPrintObject ( hLine ) ; cParagraph body = new cParagraph ( ) ; body . setTopMargin ( new org . columba . core . print . cCmUnit ( 1.0 ) ) ; messageDoc . appendPrintObject ( body ) ; messageDoc . print ( ) ; } } } }

Fix:
Object [ ] uids = r [ 0 ] . getUids ( ) ;
Buggy code:
public class Vec3i { public int x ; public int y ; public int z ; public Vec3i ( int x , int y , int z ) { } public Vec3i add ( Vec3i v ) { } public Vec3i sub ( Vec3i v ) { } public Vec3i cross ( Vec3i v ) { } public Vec3i mul ( float f ) { } public int mul ( Vec3i v ) { } public float norm ( ) { } public Vec3i normalize ( ) { } public Vec3i normalize ( int l ) { } public String toString ( ) { <START_BUG> return String . format ( "Vec3<seq2seq4repair_space>|<seq2seq4repair_space>x<seq2seq4repair_space>:<seq2seq4repair_space>%d;<seq2seq4repair_space>y<seq2seq4repair_space>:<seq2seq4repair_space>%d;<seq2seq4repair_space>z<seq2seq4repair_space>:<seq2seq4repair_space>%d" , x , y , z ) ; <END_BUG> } }

Fix:
return String . format ( "Vec3i<seq2seq4repair_space>|<seq2seq4repair_space>x<seq2seq4repair_space>:<seq2seq4repair_space>%d;<seq2seq4repair_space>y<seq2seq4repair_space>:<seq2seq4repair_space>%d;<seq2seq4repair_space>z<seq2seq4repair_space>:<seq2seq4repair_space>%d" , x , y , z ) ;
Buggy code:
public class CreateNote extends Activity { private static final String TAG = "notepad" ; private Button addNoteToDB ; private EditText titleEditText ; private EditText contentEditText ; private boolean isEdit ; private DBHelper dbhelper ; private SQLiteDatabase db ; private String editTitle ; private int id = 0 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { super . onPause ( ) ; <START_BUG> SimpleNotepadActivity . requestToShowArrow ( ) ; <END_BUG> } }

Fix:
SimpleNotepadActivity . requestToShowArrow ( this ) ;
Buggy code:
public class GoalsContainer extends GuiElement { private final Color backgroundColour = new Color ( 0 , 0 , 0 , 0.8F ) ; private final Color blue = new Color ( 84 , 198 , 198 ) ; private final float [ ] centres = new float [ 3 ] ; private final Color green = new Color ( 45 , 242 , 145 ) ; private final Rect [ ] nodeLinks = new Rect [ 6 ] ; private final Font normalFont ; private final Color pink = new Color ( 230 , 113 , 229 ) ; private final Font titleFont ; GoalsContainer ( Rect bounds ) { } @ Override public void draw ( Graphics2D graphics ) { } @ Override protected void mouseMoved ( MouseEvent e ) { <START_BUG> for ( int i = 0 ; i < ( nodeLinks . length ) ; i ++ ) { <END_BUG> if ( nodeLinks [ i ] . contains ( e . getPoint ( ) ) ) { self . setCursor ( Cursor . HAND_CURSOR ) ; if ( ( i % 2 ) == 0 ) { Node n = Game . getCurrentPlayer ( ) . getCurrentGoals ( ) . get ( ( i // 2 ) ) . getStart ( ) ; GUI . reticuleRect = new Rect ( ( ( ( int ) ( ( n . getLocation ( ) . getX ( ) ) * ( Screen . WIDTH ) ) ) - ( 15 * ( GUI . scale ) ) ) , ( ( ( int ) ( ( n . getLocation ( ) . getY ( ) ) * ( Screen . HEIGHT ) ) ) - ( 15 * ( GUI . scale ) ) ) , ( 30 * ( GUI . scale ) ) , ( 30 * ( GUI . scale ) ) ) ; } else { Node n = Game . getCurrentPlayer ( ) . getCurrentGoals ( ) . get ( ( i // 2 ) ) . getEnd ( ) ; GUI . reticuleRect = new Rect ( ( ( ( int ) ( ( n . getLocation ( ) . getX ( ) ) * ( Screen . WIDTH ) ) ) - ( 15 * ( GUI . scale ) ) ) , ( ( ( int ) ( ( n . getLocation ( ) . getY ( ) ) * ( Screen . HEIGHT ) ) ) - ( 15 * ( GUI . scale ) ) ) , ( 30 * ( GUI . scale ) ) , ( 30 * ( GUI . scale ) ) ) ; } return ; } } self . setCursor ( Cursor . DEFAULT_CURSOR ) ; } @ Override public void onClick ( MouseEvent e ) { } @ Override public void onMouseDown ( MouseEvent e ) { } @ Override public void onMouseUp ( MouseEvent e ) { } }

Fix:
for ( int i = 0 ; i < ( ( Game . getCurrentPlayer ( ) . getCurrentGoals ( ) . size ( ) ) * 2 ) ; i ++ ) {
Buggy code:
public class ArrayConverter implements IString2ValueConverter { @ SuppressWarnings ( "unused" ) private static final Logger log = Logger . getLogger ( ArrayConverter . class . getName ( ) ) ; private final IString2ValueConverter parent ; public ArrayConverter ( final IString2ValueConverter parent ) { } @ Override public boolean supportedClass ( final Class < ? > clazz ) { } @ Override public Object parseString ( final Class < ? > impl , final String value ) { } @ Override public String toString ( final Class < ? > impl , final Object value ) { Object [ ] arr = convertPrimitiveArrays ( value ) ; StringBuilder sb = new StringBuilder ( ) ; boolean first = true ; for ( Object v : arr ) { if ( ! first ) { sb . append ( ';' ) ; } first = false ; <START_BUG> sb . append ( toString ( impl . getComponentType ( ) , v ) ) ; <END_BUG> } return sb . toString ( ) ; } private Object [ ] convertPrimitiveArrays ( final Object arr ) { } }

Fix:
sb . append ( parent . toString ( impl . getComponentType ( ) , v ) ) ;
Buggy code:
public class Sha256CryptTest { @ Test public void testSha256CryptStrings ( ) { } @ Test public void testSha256CryptBytes ( ) { } @ Test public void testSha2CryptRounds ( ) { } @ Test public void testSha256CryptExplicitCall ( ) { } @ Test ( expected = NullPointerException . class ) public void testSha256CryptNullData ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testSha256CryptWithEmptySalt ( ) { } @ Test public void testSha256LargetThanBlocksize ( ) { <START_BUG> byte [ ] buffer = new byte [ 200 ] ; <END_BUG> Arrays . fill ( buffer , 0 , 200 , ( ( byte ) ( 'A' ) ) ) ; assertEquals ( "$5$abc$HbF3RRc15OwNKB//RZZ5F.1I6zsLcKXHQoSdB9Owx//Q8" , Sha2Crypt . sha256Crypt ( buffer , "$5$abc" ) ) ; } }

Fix:
final byte [ ] buffer = new byte [ 200 ] ;
Buggy code:
@ Controller @ RequestMapping ( "//module//dataimporttool//addMigrationSettings.form" ) @ SessionAttributes ( "dit" ) public class DataImportToolStartMigrationController { protected final Log log = LogFactory . getLog ( getClass ( ) ) ; private DataImportToolValidator validator ; @ Autowired public DataImportToolStartMigrationController ( DataImportToolValidator validator ) { } @ RequestMapping ( method = RequestMethod . GET ) public ModelAndView showForm ( HttpServletRequest request , ModelMap model ) throws ServletRequestBindingException { } @ RequestMapping ( method = RequestMethod . POST ) protected ModelAndView onSubmit ( @ ModelAttribute ( "dit" ) DataImportTool dit , BindingResult result , SessionStatus status ) { validator . validate ( dit , result ) ; if ( result . hasErrors ( ) ) { return new ModelAndView ( "//module//dataimporttool//addMigrationSettings" ) ; } Context . getService ( DataImportToolService . class ) . saveDataImportTool ( dit ) ; status . setComplete ( ) ; <START_BUG> return new ModelAndView ( "redirect://module//dataimporttool//continueMigration.page" ) ; <END_BUG> } }

Fix:
return new ModelAndView ( "redirect://module//dataimporttool//continueMigration" ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( BasicDeployment10TestCase . BasicDeploymentTestCaseSetup . class ) public class BasicDeployment10TestCase extends ContainerResourceMgmtTestBase { static class BasicDeploymentTestCaseSetup extends AbstractMgmtServerSetupTask { @ Override public void doSetup ( final ManagementClient managementClient ) throws Exception { String xml = FileUtils . readFile ( BasicDeployment10TestCase . class , "basic10.xml" ) ; <START_BUG> List < ModelNode > operations = xmlToModelOperations ( xml , CURRENT . getUriString ( ) , new ResourceAdapterSubsystemParser ( ) ) ; <END_BUG> executeOperation ( operationListToCompositeOperation ( operations ) ) ; } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } } @ Deployment public static ResourceAdapterArchive createDeployment ( ) throws Exception { } @ Resource ( mappedName = "java:jboss//name1" ) private MultipleConnectionFactory1 connectionFactory1 ; @ Test public void testConfiguration ( ) throws Throwable { } }

Fix:
List < ModelNode > operations = xmlToModelOperations ( xml , RESOURCEADAPTERS_1_0 . getUriString ( ) , new ResourceAdapterSubsystemParser ( ) ) ;
Buggy code:
public class RegisterCommands { public static void registerallCommands ( ) { try { <START_BUG> Main m = Main . getIntance ( ) ; <END_BUG> m . getCommand ( "Location" ) . setExecutor ( new Location_Command ( ) ) ; } catch ( NullPointerException e ) { System . err . println ( ( ( Main . pr ) + "Es<seq2seq4repair_space>konnten<seq2seq4repair_space>nicht<seq2seq4repair_space>oder<seq2seq4repair_space>nur<seq2seq4repair_space>zum<seq2seq4repair_space>teil<seq2seq4repair_space>die<seq2seq4repair_space>Befehle<seq2seq4repair_space>regestriet<seq2seq4repair_space>werden!" ) ) ; } } }

Fix:
Main m = Main . getInstance ( ) ;
Buggy code:
public class XmlLogger implements BuildListener { private static final DocumentBuilder builder = XmlLogger . getDocumentBuilder ( ) ; private static DocumentBuilder getDocumentBuilder ( ) { } private static final String BUILD_TAG = "build" ; private static final String TARGET_TAG = "target" ; private static final String TASK_TAG = "task" ; private static final String MESSAGE_TAG = "message" ; private static final String NAME_ATTR = "name" ; private static final String TIME_ATTR = "time" ; private static final String PRIORITY_ATTR = "priority" ; private static final String LOCATION_ATTR = "location" ; private static final String ERROR_ATTR = "error" ; private Document doc ; private Hashtable tasks = new Hashtable ( ) ; private Hashtable targets = new Hashtable ( ) ; private Hashtable threadStacks = new Hashtable ( ) ; private XmlLogger . TimedElement buildElement = null ; private static class TimedElement { long startTime ; Element element ; } public XmlLogger ( ) { } public void buildStarted ( BuildEvent event ) { } public void buildFinished ( BuildEvent event ) { } private Stack getStack ( ) { } public void targetStarted ( BuildEvent event ) { } public void targetFinished ( BuildEvent event ) { } public void taskStarted ( BuildEvent event ) { } public void taskFinished ( BuildEvent event ) { } public void messageLogged ( BuildEvent event ) { Element messageElement = doc . createElement ( XmlLogger . MESSAGE_TAG ) ; String name = "debug" ; switch ( event . getPriority ( ) ) { case Project . MSG_ERR : name = "error" ; break ; case Project . MSG_WARN : name = "warn" ; break ; case Project . MSG_INFO : name = "info" ; break ; default : name = "debug" ; break ; } messageElement . setAttribute ( XmlLogger . PRIORITY_ATTR , name ) ; <START_BUG> Text messageText = doc . createTextNode ( event . getMessage ( ) ) ; <END_BUG> messageElement . appendChild ( messageText ) ; XmlLogger . TimedElement parentElement = null ; Task task = event . getTask ( ) ; Target target = event . getTarget ( ) ; if ( task != null ) { parentElement = ( ( XmlLogger . TimedElement ) ( tasks . get ( task ) ) ) ; } if ( ( parentElement == null ) && ( target != null ) ) { parentElement = ( ( XmlLogger . TimedElement ) ( targets . get ( target ) ) ) ; } if ( parentElement == null ) { Stack threadStack = ( ( Stack ) ( threadStacks . get ( Thread . currentThread ( ) ) ) ) ; if ( threadStack != null ) { if ( ! ( threadStack . empty ( ) ) ) { parentElement = ( ( XmlLogger . TimedElement ) ( threadStack . peek ( ) ) ) ; } } } if ( parentElement != null ) { parentElement . element . appendChild ( messageElement ) ; } else { buildElement . element . appendChild ( messageElement ) ; } } }

Fix:
Text messageText = doc . createCDATASection ( event . getMessage ( ) ) ;
Buggy code:
public class GameBoard extends Activity implements onTrickListener , onBidListener , onTrumpListener , onDiscardListener , onGamePlayListener { private BidFragment bidFragment ; private DiscardFragment discardFragment ; private GameFragment gameFragment ; private String trumpColor ; private CountDownTimer highlight1 ; private CountDownTimer highlight2 ; private CountDownTimer advanceGame ; private Game game ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void setupNewRound ( ) { } public void startBiddingFragment ( int [ ] bids ) { } public void onPlayerPassedBid ( View v ) { } @ Override public void onBidPlayed ( int bid ) { } public void chooseTrumpColor ( ) { } @ Override public void trumpPass ( int color ) { } @ Override public void resetAllTrickCards ( ) { } public void startDiscardFragment ( ) { } @ Override public void doneDiscarding ( int [ ] playerHand , int [ ] playerDiscards ) { } public void startGameFragment ( ) { } public void playerDidntLeadInitialize ( ) { } public void onPlayerPlayed ( int indexToPlay ) { if ( ( game . getNumberOfCompletedTricks ( ) ) != 10 ) { int currentTrickWinnerLocation = game . getTrickWinnerLocation ( ) ; gameFragment . setWhoLed ( game . getTrickWinnerLocation ( ) ) ; if ( ( game . getTrickWinnerLocation ( ) ) == 3 ) { game . playerPlayed ( indexToPlay ) ; game . advanceGameState ( ) ; } else { game . playerPlayed ( indexToPlay ) ; game . advanceGameState ( ) ; } Card [ ] playedCards = game . getCurrentTrick ( ) ; int [ ] playerHand = game . getPlayerCardsUI ( ) ; gameFragment . displayPlayerCards ( playerHand ) ; gameFragment . setOpponentsCards ( playedCards , currentTrickWinnerLocation ) ; if ( ( ( ( ( playedCards [ 0 ] . getValue ( ) ) != ( - 1 ) ) && ( ( playedCards [ 1 ] . getValue ( ) ) != ( - 1 ) ) ) && ( ( playedCards [ 2 ] . getValue ( ) ) != ( - 1 ) ) ) && ( ( playedCards [ 3 ] . getValue ( ) ) != ( - 1 ) ) ) { game . incrementNumberOfTricks ( ) ; highlight2 = new CountDownTimer ( 4000 , 1000 ) { public void onTick ( long millisTillFinished ) { } public void onFinish ( ) { if ( ( game . getNumberOfCompletedTricks ( ) ) < 10 ) { resetAllTrickCards ( ) ; } } } . start ( ) ; highlight1 = new CountDownTimer ( 2000 , 1000 ) { public void onTick ( long millisTillFinished ) { } public void onFinish ( ) { <START_BUG> if ( ( game . getNumberOfCompletedTricks ( ) ) != 10 ) { <END_BUG> gameFragment . winnerHighlightToggle ( ( ( game . getTrickWinnerLocation ( ) ) + 1 ) ) ; } } } . start ( ) ; if ( ( game . getNumberOfCompletedTricks ( ) ) == 10 ) { showFinalScores ( game . getCurrentTeamScores ( ) ) ; } } } } public void cardPlayed ( View v ) { } public void showBidWinner ( int winner , String color ) { } public void showFinalScores ( int [ ] scores ) { } public void gameEnd ( ) { } public void cardClick ( View v ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } }

Fix:
if ( ( game . getNumberOfCompletedTricks ( ) ) >= 10 ) {
Buggy code:
public class CmpEntityBeanHomeFinderInterceptorFactory extends EntityBeanHomeFinderInterceptorFactory { private final Method finderMethod ; public CmpEntityBeanHomeFinderInterceptorFactory ( final Method finderMethod ) { } protected Object invokeFind ( final InterceptorContext context , final EntityBeanComponentInstance instance ) throws Exception { final CmpEntityBeanComponentInstance cmpInstance = CmpEntityBeanComponentInstance . class . cast ( instance ) ; final CmpEntityBeanComponent cmpComponent = cmpInstance . getComponent ( ) ; try { cmpComponent . getComponentClass ( ) . getDeclaredMethod ( finderMethod . getName ( ) , finderMethod . getParameterTypes ( ) ) ; return super . invokeFind ( context , instance ) ; } catch ( NoSuchMethodException ignored ) { } final JDBCEntityPersistenceStore store = cmpComponent . getStoreManager ( ) ; <START_BUG> final CmpEntityBeanContext entityContext = cmpInstance . getEntityContext ( ) ; <END_BUG> if ( ! ( store . getCmpConfig ( ) . isSyncOnCommitOnly ( ) ) ) { cmpComponent . synchronizeEntitiesWithinTransaction ( entityContext . getTransaction ( ) ) ; } if ( ( getReturnType ( ) ) == ( ReturnType . SINGLE ) ) { return store . findEntity ( context . getMethod ( ) , context . getParameters ( ) , entityContext ) ; } else { return store . findEntities ( context . getMethod ( ) , context . getParameters ( ) , entityContext ) ; } } protected Object prepareResults ( final InterceptorContext context , final Object result , final EntityBeanComponent component ) throws ObjectNotFoundException { } }

Fix:
final CmpEntityBeanContext entityContext = cmpInstance . getEjbContext ( ) ;