nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ModClusterEnable implements OperationStepHandler , DescriptionProvider { static final ModClusterEnable INSTANCE = new ModClusterEnable ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . getProcessType ( ) . isServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; modcluster . enable ( ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class ClassificationThread extends Thread { Data data = new Data ( ) ; Command returnState ; Command currentState = new Command ( ) ; Byte returnDirection ; Byte currentDirection = BufferData . STABLE ; BufferData buffer = new BufferData ( ) ; public static Handler mChildHandler ; public void run ( ) { Looper . prepare ( ) ; ClassificationThread . mChildHandler = new Handler ( ) { public void handleMessage ( Message msg ) { data = ( ( Data ) ( msg . obj ) ) ; returnState = buffer . insertData ( data . value , data . valueInver ) ; if ( ( RunningScreen . voltageDiagram ) != null ) { System . out . println ( "add<seq2seq4repair_space>value<seq2seq4repair_space>to<seq2seq4repair_space>voltage<seq2seq4repair_space>diagram" ) ; <START_BUG> voltageDiagram . addVertex ( data . value , data . valueInver ) ; <END_BUG> } if ( ( returnState . compareTo ( currentState ) ) != 0 ) { if ( ( ( returnState . currentCommand ) == ( Command . NORMAL_SHORT_FORCE ) ) || ( ( returnState . currentCommand ) == ( Command . STRONG_SHORT_FORCE ) ) ) { Command command = commandPool . obtain ( ) ; command . currentCommand = returnState . currentCommand ; command . left = returnState . left ; listCommand . add ( command ) ; System . out . println ( "enqueue<seq2seq4repair_space>new<seq2seq4repair_space>command<seq2seq4repair_space>" ) ; } currentState . clone ( returnState ) ; } } } ; Looper . loop ( ) ; } No newline ; at end ; of file ; }

Fix:
voltageDiagram . addVertex ( data . value , data . valueInver , returnState ) ;
Buggy code:
public class RelativeEntity implements Serializable { private static final long serialVersionUID = 1L ; Integer id ; Integer elderId ; String name ; Integer urgent ; String relationship ; String cancelDate ; public Integer getId ( ) { } public void setId ( Integer id ) { } public Integer getElderId ( ) { <START_BUG> return elderId ; <END_BUG> } public void setElderId ( Integer elderId ) { } public String getName ( ) { } public void setName ( String name ) { } public Integer getUrgent ( ) { } public void setUrgent ( Integer urgent ) { } public String getRelationship ( ) { } public void setRelationship ( String relationship ) { } public static long getSerialversionuid ( ) { } public String getCancelDate ( ) { } public void setCancelDate ( String cancelDate ) { } }

Fix:
return this . elderId ;
Buggy code:
public class JsonWebToken implements OToken , OJsonWebToken { public final OJwtHeader header ; public final OJwtPayload payload ; private boolean isVerified ; private boolean isValid ; public JsonWebToken ( ) { } public JsonWebToken ( OJwtHeader header , OJwtPayload payload ) { } @ Override public OJwtHeader getHeader ( ) { } @ Override public OJwtPayload getPayload ( ) { } @ Override public boolean getIsVerified ( ) { } @ Override public void setIsVerified ( boolean verified ) { } @ Override public boolean getIsValid ( ) { } @ Override public void setIsValid ( boolean valid ) { } @ Override public String getUserName ( ) { } @ Override public String getDatabase ( ) { } @ Override public long getExpiry ( ) { } @ Override public ORID getUserId ( ) { } @ Override public String getDatabaseType ( ) { } @ Override public OUser getUser ( ODatabaseDocumentInternal db ) { ORID userRid = ( ( OrientJwtPayload ) ( payload ) ) . getUserRid ( ) ; ODocument result ; result = db . load ( userRid , "roles:1" ) ; <START_BUG> if ( ! ( result . getClassName ( ) . equals ( CLASS_NAME ) ) ) { <END_BUG> result = null ; } return new OUser ( result ) ; } @ Override public void setExpiry ( long expiry ) { } }

Fix:
if ( ! ( result . getSchemaClass ( ) . isSubClassOf ( CLASS_NAME ) ) ) {
Buggy code:
public class CustomControlExample extends ControlExample { public CustomControlExample ( Composite parent ) { } Tab [ ] createTabs ( ) { <START_BUG> return new Tab [ ] { new CComboTab ( this ) , new CLabelTab ( this ) , new CTabFolderTab ( this ) , new SashFormTab ( this ) , new StyledTextTab ( this ) , new TableTreeTab ( this ) } ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return new Tab [ ] { new CComboTab ( this ) , new CLabelTab ( this ) , new CTabFolderTab ( this ) , new SashFormTab ( this ) , new StyledTextTab ( this ) } ;
Buggy code:
public class RetrieveFileTransfer extends AbstractRetrieveFileTransfer { JREProxyHelper proxyHelper = null ; public RetrieveFileTransfer ( ) { } protected void hardClose ( ) { } protected void openStreams ( ) throws IncomingFileTransferException { try { <START_BUG> final IFileStore fileStore = EFS . getStore ( new URI ( getRemoteFileURL ( ) . getFile ( ) ) ) ; <END_BUG> final IFileInfo info = fileStore . fetchInfo ( ) ; setFileLength ( info . getLength ( ) ) ; setInputStream ( fileStore . openInputStream ( 0 , null ) ) ; listener . handleTransferEvent ( new IIncomingFileTransferReceiveStartEvent ( ) { private static final long serialVersionUID = 5693211912862160540L ; public IFileID getFileID ( ) { return remoteFileID ; } public IIncomingFileTransfer receive ( File localFileToSave ) throws IOException { setOutputStream ( new BufferedOutputStream ( new FileOutputStream ( localFileToSave ) ) ) ; job = new FileTransferJob ( getRemoteFileURL ( ) . toString ( ) ) ; job . schedule ( ) ; return RetrieveFileTransfer . this ; } public String toString ( ) { final StringBuffer sb = new StringBuffer ( "IIncomingFileTransferReceiveStartEvent[" ) ; sb . append ( "isdone=" ) . append ( done ) . append ( ";" ) ; sb . append ( "bytesReceived=" ) . append ( bytesReceived ) . append ( "]" ) ; return sb . toString ( ) ; } public void cancel ( ) { hardClose ( ) ; } public IIncomingFileTransfer receive ( OutputStream streamToStore ) throws IOException { setOutputStream ( streamToStore ) ; setCloseOutputStream ( false ) ; job = new FileTransferJob ( getRemoteFileURL ( ) . toString ( ) ) ; job . schedule ( ) ; return RetrieveFileTransfer . this ; } } ) ; } catch ( final Exception e ) { throw new IncomingFileTransferException ( e ) ; } } protected boolean doPause ( ) { } protected boolean doResume ( ) { } protected void setupProxy ( Proxy proxy ) { } }

Fix:
final IFileStore fileStore = EFS . getStore ( new URI ( getRemoteFileURL ( ) . getPath ( ) ) ) ;
Buggy code:
public class ServerStartHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "start" ; private final ServerInventory serverInventory ; public ServerStartHandler ( final ServerInventory serverInventory ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { if ( ( context . getRunningMode ( ) ) == ( RunningMode . ADMIN_ONLY ) ) { throw new OperationFailedException ( new ModelNode ( HostControllerMessages . MESSAGES . cannotStartServersInvalidMode ( context . getRunningMode ( ) ) ) ) ; } final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final PathElement element = address . getLastElement ( ) ; final String serverName = element . getValue ( ) ; <START_BUG> final ModelNode model = Tools . readModel ( context . getRootResource ( ) ) ; <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ServerStatus origStatus = serverInventory . determineServerStatus ( serverName ) ; if ( ( origStatus != ( ServerStatus . STARTED ) ) && ( origStatus != ( ServerStatus . STARTING ) ) ) { final ServerStatus status = serverInventory . startServer ( serverName , model ) ; context . getResult ( ) . set ( status . toString ( ) ) ; } else { context . getResult ( ) . set ( origStatus . toString ( ) ) ; } context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { if ( ( origStatus != ( ServerStatus . STARTED ) ) && ( origStatus != ( ServerStatus . STARTING ) ) ) { serverInventory . stopServer ( serverName , ( - 1 ) ) ; } } } ) ; } } , RUNTIME ) ; context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } @ Override public ModelNode getModelDescription ( final Locale locale ) { } }

Fix:
final ModelNode model = Tools . readModel ( context . readResourceFromRoot ( EMPTY_ADDRESS , true ) ) ;
Buggy code:
public class CPUStat { private static final Logger s_logger = Logger . getLogger ( CPUStat . class ) ; private Integer _cores ; private CPUStat . UptimeStats _lastStats ; private final String _sysfsCpuDir = "//sys//devices//system//cpu" ; private final String _uptimeFile = "//proc//uptime" ; class UptimeStats { public Double upTime = 0.0 ; public Double cpuIdleTime = 0.0 ; public UptimeStats ( Double upTime , Double cpuIdleTime ) { } } public CPUStat ( ) { } private void init ( ) { } private CPUStat . UptimeStats getUptimeAndCpuIdleTime ( ) { CPUStat . UptimeStats uptime = new CPUStat . UptimeStats ( 0.0 , 0.0 ) ; File f = new File ( _uptimeFile ) ; <START_BUG> try ( Scanner scanner = new Scanner ( f ) ) { <END_BUG> String [ ] stats = scanner . useDelimiter ( "\\Z" ) . next ( ) . split ( "\\s+" ) ; uptime = new CPUStat . UptimeStats ( Double . parseDouble ( stats [ 0 ] ) , Double . parseDouble ( stats [ 1 ] ) ) ; } catch ( FileNotFoundException ex ) { CPUStat . s_logger . warn ( ( ( ( "File<seq2seq4repair_space>" + ( _uptimeFile ) ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found:" ) + ( ex . toString ( ) ) ) ) ; } return uptime ; } private Integer getCoresFromLinux ( ) { } public Integer getCores ( ) { } public Double getCpuUsedPercent ( ) { } }

Fix:
try ( Scanner scanner = new Scanner ( f , "UTF-8" ) ) {
Buggy code:
public class ClusteredCacheMetricsHandler extends AbstractRuntimeOnlyHandler { @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> PathAddress address = context . getCurrentAddress ( ) ; <END_BUG> String containerName = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getValue ( ) ; String cacheName = address . getElement ( ( ( address . size ( ) ) - 1 ) ) . getValue ( ) ; String name = Operations . getAttributeName ( operation ) ; ClusteredCacheMetric metric = ClusteredCacheMetric . forName ( name ) ; if ( metric == null ) { context . getFailureDescription ( ) . set ( ROOT_LOGGER . unknownMetric ( name ) ) ; } else { Cache < ? , ? > cache = ServiceContainerHelper . findValue ( context . getServiceRegistry ( false ) , CACHE . getServiceName ( containerName , cacheName ) ) ; if ( cache != null ) { context . getResult ( ) . set ( metric . getValue ( ( ( RpcManagerImpl ) ( cache . getAdvancedCache ( ) . getRpcManager ( ) ) ) ) ) ; } } context . completeStep ( NOOP_RESULT_HANDLER ) ; } }

Fix:
PathAddress address = Operations . getPathAddress ( operation ) ;
Buggy code:
public class CovReport extends Task { private File home = null ; private String format = null ; private File tofile = null ; private String type = null ; private Integer percent = null ; private String filters = null ; private File snapshot = null ; private Path sourcePath = null ; private boolean includeSource = true ; private Path coveragePath = null ; private CovReport . Reference reference = null ; public CovReport ( ) { } public void setFilters ( String values ) { } public void setFormat ( CovReport . ReportFormat value ) { } public void setHome ( File value ) { } public void setIncludesource ( boolean value ) { } public void setPercent ( Integer value ) { } public void setSnapshot ( File value ) { } public void setTofile ( File value ) { } public void setType ( CovReport . ReportType value ) { } public Path createCoveragepath ( ) { } public CovReport . Reference createReference ( ) { } public Path createSourcepath ( ) { } public void execute ( ) throws TaskException { checkOptions ( ) ; try { Commandline cmdl = new Commandline ( ) ; cmdl . setExecutable ( new File ( home , "jpcovreport" ) . getAbsolutePath ( ) ) ; String [ ] params = getParameters ( ) ; for ( int i = 0 ; i < ( params . length ) ; i ++ ) { cmdl . addArgument ( params [ i ] ) ; } final Execute2 exe = new Execute2 ( ) ; setupLogger ( exe ) ; getLogger ( ) . debug ( cmdl . toString ( ) ) ; <START_BUG> exe . setCommandline ( cmdl . getCommandline ( ) ) ; <END_BUG> int exitValue = exe . execute ( ) ; if ( exitValue != 0 ) { throw new TaskException ( ( ( "JProbe<seq2seq4repair_space>Coverage<seq2seq4repair_space>Report<seq2seq4repair_space>failed<seq2seq4repair_space>(" + exitValue ) + ")" ) ) ; } getLogger ( ) . debug ( ( "coveragePath:<seq2seq4repair_space>" + ( coveragePath ) ) ) ; getLogger ( ) . debug ( ( "format:<seq2seq4repair_space>" + ( format ) ) ) ; if ( ( ( reference ) != null ) && ( "xml" . equals ( format ) ) ) { reference . createEnhancedXMLReport ( ) ; } } catch ( IOException e ) { throw new TaskException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>execute<seq2seq4repair_space>JProbe<seq2seq4repair_space>Coverage<seq2seq4repair_space>Report." , e ) ; } } protected String [ ] getParameters ( ) throws TaskException { } protected void checkOptions ( ) throws TaskException { } public static class ReportFormat extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public static class ReportType extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public class Reference { protected Path classPath ; protected ReportFilters filters ; public Path createClasspath ( ) { } public ReportFilters createFilters ( ) { } protected void createEnhancedXMLReport ( ) throws TaskException { } } }

Fix:
exe . setCommandline ( cmdl ) ;
Buggy code:
public class Snippet23 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; shell . open ( ) ; shell . addListener ( MouseDown , new Listener ( ) { public void handleEvent ( Event e ) { <START_BUG> Tracker tracker = new Tracker ( shell , 0 ) ; <END_BUG> tracker . setRectangles ( new Rectangle [ ] { new Rectangle ( e . x , e . y , 100 , 100 ) } ) ; tracker . open ( ) ; } } ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
Tracker tracker = new Tracker ( shell , SWT . NONE ) ;
Buggy code:
public class BiggerTemporaryClobTest extends InternalClobTest { private static final long CLOBLENGTH = ( 287 * 1024 ) - 115 ; private static final long BYTES_PER_CHAR = 3 ; public BiggerTemporaryClobTest ( String name ) { } public void setUp ( ) throws Exception { super . initialCharLength = BiggerTemporaryClobTest . CLOBLENGTH ; super . initialByteLength = ( BiggerTemporaryClobTest . CLOBLENGTH ) * 3 ; super . bytesPerChar = BiggerTemporaryClobTest . BYTES_PER_CHAR ; EmbedStatement embStmt = ( ( EmbedStatement ) ( createStatement ( ) ) ) ; EmbedConnection embCon = ( ( EmbedConnection ) ( getConnection ( ) ) ) ; <START_BUG> iClob = new TemporaryClob ( embCon . getDBName ( ) , embStmt ) ; <END_BUG> transferData ( new org . apache . derbyTesting . functionTests . util . streams . LoopingAlphabetReader ( BiggerTemporaryClobTest . CLOBLENGTH , CharAlphabet . cjkSubset ( ) ) , iClob . getWriter ( 1L ) , BiggerTemporaryClobTest . CLOBLENGTH ) ; assertEquals ( BiggerTemporaryClobTest . CLOBLENGTH , iClob . getCharLength ( ) ) ; } public void tearDown ( ) throws Exception { } public static Test suite ( ) throws Exception { } }

Fix:
iClob = new TemporaryClob ( embStmt ) ;
Buggy code:
public class GraphicsExample { Composite parent ; GraphicsTab [ ] tabs ; GraphicsTab tab ; Object [ ] tabBackground ; boolean animate ; Listener redrawListener ; ToolBar toolBar ; Tree tabList ; Canvas canvas ; Composite controlPanel ; Composite tabPanel ; ToolItem playItem ; ToolItem pauseItem ; ToolItem backItem ; ToolItem dbItem ; Spinner timerSpinner ; Menu backMenu ; MenuItem customMI ; Image customImage ; Color customColor ; Vector images ; static boolean advanceGraphics ; static boolean advanceGraphicsInit ; static final int TIMER = 30 ; static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle . getBundle ( "examples_graphics" ) ; public GraphicsExample ( final Composite parent ) { } boolean checkAdvancedGraphics ( ) { } void createCanvas ( Composite parent ) { } void createControlPanel ( Composite parent ) { } void createTabPanel ( Composite parent ) { } void createToolBar ( final Composite parent ) { } Image createImage ( Display display , Color color ) { } void createTabList ( Composite parent ) { } GraphicsTab [ ] createTabs ( ) { <START_BUG> return new GraphicsTab [ ] { new LineTab ( this ) , new StarPolyTab ( this ) , tab = new IntroTab ( this ) , new BlackWholeTab ( this ) } ; <END_BUG> } public void dispose ( ) { } TreeItem findItemByData ( TreeItem [ ] items , Object data ) { } public GraphicsTab getTab ( ) { } Listener getRedrawListener ( ) { } static String getResourceString ( String key ) { } Image loadImage ( Display display , String name ) { } void paintBackground ( GC gc , Rectangle rect ) { } public void redraw ( ) { } public void setFocus ( ) { } public void setTab ( GraphicsTab tab ) { } void startAnimationTimer ( ) { } public static void main ( String [ ] args ) { } }

Fix:
return new GraphicsTab [ ] { new LineTab ( this ) , new StarPolyTab ( this ) , tab = new IntroTab ( this ) , new BlackHoleTab ( this ) } ;
Buggy code:
public class TEDetailed extends NetworkTileEntity { public short TypeID = - 1 ; public byte MetaID = 0 ; public BitSet data ; public static final byte Packet_Update = 0 ; public static final byte Packet_Activate = 1 ; protected byte packetType = - 1 ; private BitSet quads ; public TEDetailed ( ) { } @ Override public boolean canUpdate ( ) { } public int getType ( ) { } public int getMeta ( ) { } public boolean getBlockExists ( int x , int y , int z ) { } public void setBlock ( int x , int y , int z ) { } public void setQuad ( int x , int y , int z ) { } public void clearQuad ( int x , int y , int z ) { } public boolean isQuadSolid ( int x , int y , int z ) { } public boolean isBlockEmpty ( ) { <START_BUG> byte [ ] ba = data . toByteArray ( ) ; <END_BUG> for ( byte b : ba ) { if ( b != ( - 1 ) ) return false ; } return true ; } @ Override public void readFromNBT ( NBTTagCompound nbttc ) { } @ Override public void writeToNBT ( NBTTagCompound par1NBTTagCompound ) { } @ Override public void handleInitPacket ( NBTTagCompound nbt ) { } @ Override public void handleDataPacket ( NBTTagCompound nbt ) { } @ Override public void createDataNBT ( NBTTagCompound nbt ) { } @ Override public void createInitNBT ( NBTTagCompound nbt ) { } public static BitSet fromByteArray ( byte [ ] bytes , int size ) { } public static byte [ ] toByteArray ( BitSet bits ) { } public static BitSet turnCube ( byte [ ] bytes , int x_angle , int y_angle , int z_angle ) { } No newline ; at end ; of file ; }

Fix:
byte [ ] ba = TEDetailed . toByteArray ( data ) ;
Buggy code:
public interface DeploymentMountProvider { ServiceName SERVICE_NAME = JBOSS . append ( "deployment-mount-provider" ) ; Closeable mountDeploymentContent ( VirtualFile deploymentContents , VirtualFile mountPoint , MountType mountType ) throws IOException { } static class Factory { public static void addService ( final ServiceTarget serviceTarget ) { } private static class ServerDeploymentRepositoryImpl implements DeploymentMountProvider , Service < DeploymentMountProvider > { private volatile TempFileProvider tempFileProvider ; private ServerDeploymentRepositoryImpl ( ) { } @ Override public Closeable mountDeploymentContent ( final VirtualFile contents , VirtualFile mountPoint , MountType type ) throws IOException { } @ Override public void start ( StartContext context ) throws StartException { try { <START_BUG> final JBossThreadFactory threadFactory = new JBossThreadFactory ( new ThreadGroup ( "ServerDeploymentRepository-temp-threads" ) , Boolean . FALSE , null , "%G<seq2seq4repair_space>-<seq2seq4repair_space>%t" , null , null , AccessController . doPrivileged ( GetAccessControlContextAction . getInstance ( ) ) ) ; <END_BUG> tempFileProvider = TempFileProvider . create ( "temp" , Executors . newScheduledThreadPool ( 2 , threadFactory ) , true ) ; } catch ( IOException e ) { throw MESSAGES . failedCreatingTempProvider ( ) ; } ROOT_LOGGER . debugf ( "%s<seq2seq4repair_space>started" , DeploymentMountProvider . class . getSimpleName ( ) ) ; } @ Override public void stop ( StopContext context ) { } @ Override public DeploymentMountProvider getValue ( ) throws IllegalStateException { } } } }

Fix:
final JBossThreadFactory threadFactory = new JBossThreadFactory ( new ThreadGroup ( "ServerDeploymentRepository-temp-threads" ) , true , null , "%G<seq2seq4repair_space>-<seq2seq4repair_space>%t" , null , null , AccessController . doPrivileged ( GetAccessControlContextAction . getInstance ( ) ) ) ;
Buggy code:
public class ReversedType < T > extends AbstractType < T > { private static final Map < AbstractType , ReversedType > instances = new HashMap < AbstractType , ReversedType > ( ) ; final AbstractType < T > baseType ; public static < T > ReversedType < T > getInstance ( TypeParser parser ) throws ConfigurationException { } public static synchronized < T > ReversedType < T > getInstance ( AbstractType < T > baseType ) { } private ReversedType ( AbstractType < T > baseType ) { } public int compare ( ByteBuffer o1 , ByteBuffer o2 ) { if ( ( o1 . remaining ( ) ) == 0 ) { return ( o2 . remaining ( ) ) == 0 ? 0 : - 1 ; } if ( ( o2 . remaining ( ) ) == 0 ) { return 1 ; } <START_BUG> return - ( baseType . compare ( o1 , o2 ) ) ; <END_BUG> } public String getString ( ByteBuffer bytes ) { } public ByteBuffer fromString ( String source ) { } public void validate ( ByteBuffer bytes ) throws MarshalException { } public T compose ( ByteBuffer bytes ) { } public ByteBuffer decompose ( T value ) { } @ Override public String toString ( ) { } }

Fix:
return baseType . compare ( o2 , o1 ) ;
Buggy code:
public class ModeMsgThread implements Runnable { private ObjectOutputStream leader_obj ; private ObjectOutputStream [ ] obj_os = new ObjectOutputStream [ DataCenter . TOTAL_NUM ] ; ModeDataCenter data_center ; public ModeMsgThread ( ModeDataCenter c ) { } public void initializeOutput ( ) throws IOException { } public void run ( ) { } private void sendMessage ( ) { Packet packet = data_center . getMessage ( ) ; if ( packet != null ) { int i = 0 ; if ( ( ( packet . getModel ( ) ) == 3 ) || ( ( packet . getModel ( ) ) == 4 ) ) { do { <START_BUG> while ( packet == ( NULL ) ) <END_BUG> packet = data_center . getMessage ( ) ; long current_time = System . currentTimeMillis ( ) ; long send_time = packet . getSendTime ( ) ; setPacketVariableInDataCenter ( packet ) ; if ( send_time > current_time ) { try { Thread . sleep ( ( send_time - current_time ) ) ; } catch ( InterruptedException e ) { System . err . println ( "In<seq2seq4repair_space>message<seq2seq4repair_space>thread,<seq2seq4repair_space>message<seq2seq4repair_space>delay<seq2seq4repair_space>is<seq2seq4repair_space>interrupted." ) ; System . err . println ( e ) ; } } try { sendPacket ( packet ) ; } catch ( IOException e ) { System . err . println ( "error<seq2seq4repair_space>in<seq2seq4repair_space>send<seq2seq4repair_space>packet." ) ; System . err . println ( e ) ; } } while ( ( i ++ ) < 4 ) ; } else { long current_time = System . currentTimeMillis ( ) ; long send_time = packet . getSendTime ( ) ; if ( send_time > current_time ) { try { Thread . sleep ( ( send_time - current_time ) ) ; } catch ( InterruptedException e ) { System . err . println ( "In<seq2seq4repair_space>message<seq2seq4repair_space>thread,<seq2seq4repair_space>message<seq2seq4repair_space>delay<seq2seq4repair_space>is<seq2seq4repair_space>interrupted." ) ; System . err . println ( e ) ; } } try { setPacketVariableInDataCenter ( packet ) ; sendPacket ( packet ) ; } catch ( IOException e ) { System . err . println ( "error<seq2seq4repair_space>in<seq2seq4repair_space>send<seq2seq4repair_space>packet." ) ; System . err . println ( e ) ; } } } } private void setPacketVariableInDataCenter ( Packet p ) { } protected synchronized void sendPacket ( Packet packet ) throws IOException { } public ModeDataCenter getDataCenter ( ) { } }

Fix:
while ( packet == null )
Buggy code:
public abstract class AbstractStringValidator extends AbstractDatatypeValidator { protected int fLength = 0 ; protected int fMaxLength = Integer . MAX_VALUE ; protected int fMinLength = 0 ; protected Vector fEnumeration = null ; public static final String FACET_SPECIAL_TOKEN = "specialToken" ; public static final String SPECIAL_TOKEN_NONE = "NONE" ; public static final String SPECIAL_TOKEN_NMTOKEN = "NMTOKEN" ; public static final String SPECIAL_TOKEN_NAME = "Name" ; public static final String SPECIAL_TOKEN_IDNAME = "ID(Name)" ; public static final String SPECIAL_TOKEN_IDREFNAME = "IDREF(Name)" ; public static final String SPECIAL_TOKEN_NCNAME = "NCName" ; public static final String SPECIAL_TOKEN_IDNCNAME = "ID(NCName)" ; public static final String SPECIAL_TOKEN_IDREFNCNAME = "IDREF(NCName)" ; public static final String SPECIAL_TOKEN_ENTITY = "ENTITY(NCName)" ; protected String fTokenType = AbstractStringValidator . SPECIAL_TOKEN_NONE ; public AbstractStringValidator ( ) { } public AbstractStringValidator ( DatatypeValidator base , Hashtable facets , boolean derivedByList , XMLErrorReporter reporter ) { } protected abstract void assignAdditionalFacets ( String key , Hashtable facets ) throws InvalidDatatypeFacetException { } protected void inheritAdditionalFacets ( ) { } protected void checkBaseFacetConstraints ( ) throws InvalidDatatypeFacetException { } protected boolean derivationList ( boolean derivedByList ) { } <START_BUG> public Object validate ( String content , Object state ) throws InvalidDatatypeValueException { <END_BUG> checkContent ( content , state , false ) ; return null ; } private void checkContent ( String content , Object state , boolean asBase ) throws InvalidDatatypeValueException { } protected int getLength ( String content ) { } protected void checkValueSpace ( String content ) throws InvalidDatatypeValueException { } public Object clone ( ) throws CloneNotSupportedException { } public void setTokenType ( String tokenType ) { } protected static void validateToken ( String tokenType , String content ) throws InvalidDatatypeValueException { } }

Fix:
public Object validate ( String content , ValidationContext state ) throws InvalidDatatypeValueException {
Buggy code:
public class CommitWorkingCopyOperation extends JavaModelOperation { public CommitWorkingCopyOperation ( ICompilationUnit element , boolean force ) { } protected void executeOperation ( ) throws JavaModelException { try { beginTask ( Util . bind ( "workingCopy.commit" ) , 2 ) ; <START_BUG> WorkingCopy copy = ( ( WorkingCopy ) ( getCompilationUnit ( ) ) ) ; <END_BUG> ICompilationUnit original = ( ( ICompilationUnit ) ( copy . getOriginalElement ( ) ) ) ; if ( ! ( original . isOpen ( ) ) ) { original . open ( null ) ; } JavaElementDeltaBuilder deltaBuilder ; if ( Util . isExcluded ( original ) ) { deltaBuilder = null ; } else { deltaBuilder = new JavaElementDeltaBuilder ( original ) ; } IBuffer originalBuffer = original . getBuffer ( ) ; if ( originalBuffer == null ) return ; char [ ] originalContents = originalBuffer . getCharacters ( ) ; boolean hasSaved = false ; try { IBuffer copyBuffer = copy . getBuffer ( ) ; if ( copyBuffer == null ) return ; originalBuffer . setContents ( copyBuffer . getCharacters ( ) ) ; original . save ( fMonitor , fForce ) ; this . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ; hasSaved = true ; } finally { if ( ! hasSaved ) { originalBuffer . setContents ( originalContents ) ; } } copy . updateTimeStamp ( ( ( CompilationUnit ) ( original ) ) ) ; copy . makeConsistent ( this ) ; worked ( 1 ) ; if ( deltaBuilder != null ) { deltaBuilder . buildDeltas ( ) ; if ( ( deltaBuilder . delta ) != null ) { addDelta ( deltaBuilder . delta ) ; } } worked ( 1 ) ; } finally { done ( ) ; } } protected ICompilationUnit getCompilationUnit ( ) { } public IJavaModelStatus verify ( ) { } }

Fix:
CompilationUnit copy = ( ( CompilationUnit ) ( getCompilationUnit ( ) ) ) ;
Buggy code:
public class LocalHostAddHandler implements NewStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "add-host" ; private final ModelNodeRegistration registration ; private final DomainModelProxy domainModelProxy ; public static LocalHostAddHandler getInstance ( final ModelNodeRegistration registration , final DomainModelProxy domainModelProxy ) { } private LocalHostAddHandler ( ModelNodeRegistration registration , DomainModelProxy domainModelProxy ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { } public void execute ( NewOperationContext context , ModelNode operation ) { final ModelNode model = context . readModelForUpdate ( EMPTY_ADDRESS ) ; HostModelUtil . initCoreModel ( model ) ; final String hostName = operation . require ( NAME ) . asString ( ) ; model . get ( NAME ) . set ( hostName ) ; <START_BUG> context . getModelNodeRegistration ( ) . registerSubModel ( PathElement . pathElement ( HOST , hostName ) , registration ) ; <END_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { context . addStep ( new NewStepHandler ( ) { public void execute ( NewOperationContext context , ModelNode operation ) { domainModelProxy . getDomainModel ( ) . setLocalHostName ( hostName ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
context . getModelNodeRegistrationForUpdate ( ) . registerSubModel ( PathElement . pathElement ( HOST , hostName ) , registration ) ;
Buggy code:
public class SharedObjectManagerConnectEvent implements ISharedObjectManagerEvent { ID localContainerID = null ; ID [ ] sharedObjectReceiverIDs = null ; ID sharedObjectSenderID = null ; public SharedObjectManagerConnectEvent ( ID localContainerID , ID sharedObjectSenderID , ID [ ] sharedObjectReceiverIDs ) { } public ID getLocalContainerID ( ) { } public ID [ ] getSharedObjectReceiverIDs ( ) { <START_BUG> return sharedObjectReceiverIDs ; <END_BUG> } public ID getSharedObjectSenderID ( ) { } public String toString ( ) { } }

Fix:
return ( sharedObjectReceiverIDs ) == null ? new ID [ 0 ] : sharedObjectReceiverIDs ;
Buggy code:
@ Component public class FileValidator implements Validator { @ Autowired private DocumentInfoService documentInfoService ; @ Autowired private BaseService baseService ; @ Override public boolean supports ( final Class < ? > aClass ) { } @ Override public void validate ( final Object target , final Errors errors ) { } private void validateMD5 ( final DocumentDto dto , final Errors err ) { } private void validateMD5ExceptInGivenCatogory ( final DocumentDto dto , final Errors err , final DocCategoryEnum ignoreCategory ) { } private void validateFileType ( final DocumentDto dto , final Errors err ) { } private void validateFileTypeForDefaultDoc ( final DocumentDto dto , final String contentType , final Errors err ) { } private void validateFileSize ( final DocumentDto dto , final Errors err ) { <START_BUG> if ( ( dto . getFile ( ) . getSize ( ) ) >= ( GDEBaseConstants . MAX_DOCUMENT_UPLOAD_SIZE ) ) { <END_BUG> err . rejectValue ( dto . getHtmlPath ( ) , "file.size.error" ) ; } } }

Fix:
if ( ( ( dto . getFile ( ) ) != null ) && ( ( dto . getFile ( ) . getSize ( ) ) >= ( GDEBaseConstants . MAX_DOCUMENT_UPLOAD_SIZE ) ) ) {
Buggy code:
public class MonotoneChainTest extends ConvexHullGenerator2DAbstractTest { @ Override protected ConvexHullGenerator2D createConvexHullGenerator ( boolean includeCollinearPoints ) { } @ Test ( expected = ConvergenceException . class ) public void testConvergenceException ( ) { final Collection < Vector2D > points = new ArrayList < Vector2D > ( ) ; points . add ( new Vector2D ( 1 , 1 ) ) ; points . add ( new Vector2D ( 1 , 5 ) ) ; points . add ( new Vector2D ( 0 , 7 ) ) ; points . add ( new Vector2D ( 1 , 10 ) ) ; points . add ( new Vector2D ( 1 , 20 ) ) ; points . add ( new Vector2D ( 20 , 20 ) ) ; points . add ( new Vector2D ( 20 , 40 ) ) ; points . add ( new Vector2D ( 40 , 1 ) ) ; @ SuppressWarnings ( "unused" ) <START_BUG> final ConvexHull2D hull = new MonotoneChain ( true , 1 ) . generate ( points ) ; <END_BUG> } }

Fix:
final ConvexHull2D hull = new MonotoneChain ( true , 2 ) . generate ( points ) ;
Buggy code:
public class UUIDGen { public static synchronized UUID makeType1UUIDFromHost ( InetAddress addr ) { } public static UUID getUUID ( ByteBuffer raw ) { <START_BUG> return new UUID ( raw . getLong ( ( ( raw . position ( ) ) + ( raw . arrayOffset ( ) ) ) ) , raw . getLong ( ( ( ( raw . position ( ) ) + ( raw . arrayOffset ( ) ) ) + 8 ) ) ) ; <END_BUG> } public static byte [ ] decompose ( UUID uuid ) { } }

Fix:
return new UUID ( raw . getLong ( raw . position ( ) ) , raw . getLong ( ( ( raw . position ( ) ) + 8 ) ) ) ;
Buggy code:
public class SimpleHttpProtocol implements Serializable , WebSocketProtocol { private static final Logger logger = LoggerFactory . getLogger ( SimpleHttpProtocol . class ) ; private String contentType ; private String methodType ; private String delimiter ; private AtmosphereResource < HttpServletRequest , HttpServletResponse > resource ; @ Override public void configure ( AtmosphereServlet . AtmosphereConfig config ) { } @ Override public AtmosphereRequest onMessage ( WebSocket webSocket , String d ) { } @ Override public AtmosphereRequest onMessage ( WebSocket webSocket , byte [ ] d , final int offset , final int length ) { } @ Override public void onOpen ( WebSocket webSocket ) { } @ Override public void onClose ( WebSocket webSocket ) { } @ Override public void onError ( WebSocket webSocket , WebSocketProcessor . WebSocketException t ) { <START_BUG> SimpleHttpProtocol . logger . error ( ( ( t . getMessage ( ) ) + "<seq2seq4repair_space>Status<seq2seq4repair_space>{}<seq2seq4repair_space>Message<seq2seq4repair_space>{}" ) , t . response ( ) . getStatus ( ) , t . response ( ) . getStatusMessage ( ) ) ; <END_BUG> } @ Override public boolean inspectResponse ( ) { } @ Override public String handleResponse ( AtmosphereResponse < ? > res , String message ) { } @ Override public byte [ ] handleResponse ( AtmosphereResponse < ? > res , byte [ ] message , int offset , int length ) { } }

Fix:
SimpleHttpProtocol . logger . debug ( ( ( t . getMessage ( ) ) + "<seq2seq4repair_space>Status<seq2seq4repair_space>{}<seq2seq4repair_space>Message<seq2seq4repair_space>{}" ) , t . response ( ) . getStatus ( ) , t . response ( ) . getStatusMessage ( ) ) ;
Buggy code:
public class DescribeDeploymentPolicyCommand implements Command < StratosCommandContext > { private static final Logger logger = LoggerFactory . getLogger ( DescribeDeploymentPolicyCommand . class ) ; @ Override public String getName ( ) { } @ Override public String getDescription ( ) { } @ Override public String getArgumentSyntax ( ) { <START_BUG> return "[application-id]" ; <END_BUG> } @ Override public Options getOptions ( ) { } @ Override public int execute ( StratosCommandContext context , String [ ] args ) throws CommandException { } }

Fix:
return "[deployment-policy-id]" ;
Buggy code:
public class Group extends Composite { NSView contentView ; String text = "" ; public Group ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { checkWidget ( ) ; NSBox widget = ( ( NSBox ) ( view ) ) ; <START_BUG> int border = ( ( int ) ( Math . ceil ( widget . borderWidth ( ) ) ) ) ; <END_BUG> NSSize margins = widget . contentViewMargins ( ) ; NSRect frame = contentView . frame ( ) ; width += ( ( margins . width ) + border ) * 2 ; height += ( ( ( margins . height ) + border ) * 2 ) + ( frame . y ) ; return super . computeTrim ( x , y , width , height ) ; } NSView contentView ( ) { } void deregister ( ) { } void createHandle ( ) { } public Rectangle getClientArea ( ) { } String getNameText ( ) { } public String getText ( ) { } float getThemeAlpha ( ) { } void register ( ) { } void releaseHandle ( ) { } void setFont ( NSFont font ) { } public void setText ( String string ) { } }

Fix:
int border = ( ( int ) ( 0.5F + ( widget . borderWidth ( ) ) ) ) ;
Buggy code:
@ Extension public class EnvInjectListener extends RunListener < Run > implements Serializable { private static Logger LOG = Logger . getLogger ( EnvInjectListener . class . getName ( ) ) ; @ Override public Environment setUpEnvironment ( AbstractBuild build , Launcher launcher , BuildListener listener ) throws IOException , InterruptedException { } private boolean isMatrixRun ( AbstractBuild build ) { } private Map < String , String > getJenkinsSystemVariablesMaster ( AbstractBuild build ) throws IOException , InterruptedException { } private Node getNode ( ) { } private FilePath getNodeRootPath ( ) { } @ Override public void onCompleted ( Run run , TaskListener listener ) { EnvInjectLogger logger = new EnvInjectLogger ( listener ) ; EnvVars envVars = new EnvVars ( ) ; for ( EnvironmentContributingAction a : Util . filter ( run . getActions ( ) , EnvironmentContributingAction . class ) ) { <START_BUG> if ( ! ( a . getDisplayName ( ) . equals ( ENVINJECT_BUILDER_ACTION_NAME ) ) ) { <END_BUG> a . buildEnvVars ( ( ( AbstractBuild < ? , ? > ) ( run ) ) , envVars ) ; } } EnvInjectActionSetter envInjectActionSetter = new EnvInjectActionSetter ( getNodeRootPath ( ) ) ; try { envInjectActionSetter . addEnvVarsToEnvInjectBuildAction ( ( ( AbstractBuild < ? , ? > ) ( run ) ) , envVars ) ; } catch ( EnvInjectException e ) { logger . error ( ( "SEVERE<seq2seq4repair_space>ERROR<seq2seq4repair_space>occurs:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; throw new Run . RunnerAbortedException ( ) ; } catch ( IOException e ) { logger . error ( ( "SEVERE<seq2seq4repair_space>ERROR<seq2seq4repair_space>occurs:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; throw new Run . RunnerAbortedException ( ) ; } catch ( InterruptedException e ) { logger . error ( ( "SEVERE<seq2seq4repair_space>ERROR<seq2seq4repair_space>occurs:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; throw new Run . RunnerAbortedException ( ) ; } } }

Fix:
if ( ! ( ENVINJECT_BUILDER_ACTION_NAME . equals ( a . getDisplayName ( ) ) ) ) {
Buggy code:
public class EndpointListenerTest extends TestCase { private EndpointListener createEndpointListener ( ) { } public void testEndpointListenerNotification ( ) throws Exception { Properties props = new Properties ( ) ; props . put ( ENDPOINT_LISTENER_SCOPE , ( ( "(" + ( RemoteConstants . ENDPOINT_ID ) ) + "=*)" ) ) ; <START_BUG> ServiceRegistration endpointListenerRegistration = Activator . getContext ( ) . registerService ( EndpointListener . class . getName ( ) , createEndpointListener ( ) , props ) ; <END_BUG> Thread . sleep ( 5000 ) ; endpointListenerRegistration . unregister ( ) ; } }

Fix:
ServiceRegistration endpointListenerRegistration = Activator . getDefault ( ) . getContext ( ) . registerService ( EndpointListener . class . getName ( ) , createEndpointListener ( ) , props ) ;
Buggy code:
public class IdentityRemovalStrategy extends AbstractTraversalStrategy { private static final IdentityRemovalStrategy INSTANCE = new IdentityRemovalStrategy ( ) ; private IdentityRemovalStrategy ( ) { } @ Override public void apply ( final Traversal . Admin < ? , ? > traversal , final TraversalEngine engine ) { if ( ! ( TraversalHelper . hasStepOfClass ( IdentityStep . class , traversal ) ) ) return ; <START_BUG> TraversalHelper . getStepsOfClass ( IdentityStep . class , traversal ) . stream ( ) . filter ( ( step ) -> step . getLabel ( ) . isPresent ( ) ) . forEach ( traversal :: removeStep ) ; <END_BUG> } public static IdentityRemovalStrategy instance ( ) { } }

Fix:
TraversalHelper . getStepsOfClass ( IdentityStep . class , traversal ) . stream ( ) . filter ( ( step ) -> ! ( step . getLabel ( ) . isPresent ( ) ) ) . forEach ( traversal :: removeStep ) ;
Buggy code:
public class PaletteStorageHelper { private SQLiteDatabase database ; private DBManager dBManager ; private String [ ] allColumns = new String [ ] { DBManager . COLUMN_ID , DBManager . COLUMN_NAME , DBManager . COLUMN_COLORS } ; public static final int SUCCESS = 0 ; public static final int DUPLICATE = 1 ; public static final int FAILURE = 2 ; public PaletteStorageHelper ( Context context ) { } public void open ( ) throws SQLException { } public void close ( ) { } public int save ( Palette p ) { } public boolean remove ( Palette p ) { } public boolean isSaved ( Palette p ) { String temp = colorsToString ( p ) ; open ( ) ; <START_BUG> Cursor cursor = database . rawQuery ( ( ( ( ( ( ( ( ( "SELECT<seq2seq4repair_space>" + ( DBManager . COLUMN_COLORS ) ) + "<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) + ( DBManager . TABLE_PALETTES ) ) + "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) + ( DBManager . COLUMN_COLORS ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>\'" ) + temp ) + "'" ) , null ) ; <END_BUG> close ( ) ; if ( ( cursor . getCount ( ) ) > 0 ) return true ; return false ; } public Palette [ ] getAllPalettes ( ) { } private String colorsToString ( Palette p ) { } private Palette cursorToPalette ( Cursor cursor ) { } }

Fix:
Cursor cursor = database . rawQuery ( ( ( ( ( ( ( ( ( "SELECT<seq2seq4repair_space>" + ( DBManager . COLUMN_COLORS ) ) + "<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) + ( DBManager . TABLE_PALETTES ) ) + "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) + ( DBManager . COLUMN_COLORS ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>'" ) + temp ) + "'" ) , null ) ;
Buggy code:
public class FactionsCommandManager1_6UUID extends FactionsCommandManager { private HashMap < FactionsCommand , FactionsCommand1_6UUIDWrapper > wrappers = new HashMap < FactionsCommand , FactionsCommand1_6UUIDWrapper > ( ) ; private ArrayList < ArrayList < String > > pagesBackup ; private HashMap < FactionsCommand , String > helpLine = new HashMap < FactionsCommand , String > ( ) ; @ Override public void addCommand ( FactionsCommand cmd ) { } @ Override public void removeCommand ( FactionsCommand cmd ) { try { <START_BUG> cmdBase . getClass ( ) . getField ( "subCommands" ) . getClass ( ) . getMethod ( "remove" , MCommand . class ) . invoke ( this , wrappers . get ( cmd ) ) ; <END_BUG> } catch ( Exception e ) { FactionsFramework . get ( ) . logError ( e ) ; } wrappers . remove ( cmd ) ; helpLine . remove ( cmd ) ; rebuldPages ( ) ; } @ Override public void notify ( NotifyEvent event ) { } public void revertPages ( ) { } public void rebuldPages ( ) { } }

Fix:
cmdBase . getClass ( ) . getField ( "subCommands" ) . getClass ( ) . getMethod ( "remove" , MCommand . class ) . invoke ( cmdBase , wrappers . get ( cmd ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class SeeChangesView extends JFrame { private JPanel panel ; private JList < Appointment > appointmentListBox ; private JList < User > userListBox ; private DefaultListModel < User > userListModel ; private DefaultListModel < Appointment > appointmentListModel ; private JButton cancelButton ; private JButton btnConfirm ; public static void main ( String [ ] args ) { <START_BUG> new RoomReservationView ( ) ; <END_BUG> } public SeeChangesView ( ) { } public void addCancelButtonListener ( ActionListener cancelButtonListener ) { } public void addConfirmButtonListener ( ActionListener confirmButtonListener ) { } public List < Appointment > getSelectedAppointments ( ) { } public List < User > getSelectedUsers ( ) { } public void setAppointmentList ( List < Appointment > appointmentList ) { } public void setUserList ( List < User > userList ) { } }

Fix:
new SeeChangesView ( ) ;
Buggy code:
public class TestSurrogates extends LuceneTestCase { @ BeforeClass public static void beforeClass ( ) { <START_BUG> LuceneTestCase . PREFLEX_IMPERSONATION_IS_ACTIVE = true ; <END_BUG> } private static String makeDifficultRandomUnicodeString ( Random r ) { } private String toHexString ( Term t ) { } private String getRandomString ( Random r ) { } private static class SortTermAsUTF16Comparator implements Comparator < Term > { private static final Comparator < BytesRef > legacyComparator = BytesRef . getUTF8SortedAsUTF16Comparator ( ) ; public int compare ( Term term1 , Term term2 ) { } } private static final TestSurrogates . SortTermAsUTF16Comparator termAsUTF16Comparator = new TestSurrogates . SortTermAsUTF16Comparator ( ) ; private void doTestStraightEnum ( List < Term > fieldTerms , IndexReader reader , int uniqueTermCount ) throws IOException { } private void doTestSeekExists ( Random r , List < Term > fieldTerms , IndexReader reader ) throws IOException { } private void doTestSeekDoesNotExist ( Random r , int numField , List < Term > fieldTerms , Term [ ] fieldTermsArray , IndexReader reader ) throws IOException { } @ Test public void testSurrogatesOrder ( ) throws Exception { } }

Fix:
LuceneTestCase . OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true ;
Buggy code:
public class TrackableSession { private static final Logger logger = LoggerFactory . getLogger ( TrackableSession . class ) ; private static final TrackableSession factory = new TrackableSession ( ) ; private final ConcurrentHashMap < String , TrackableResource > factoryCache = new ConcurrentHashMap < String , TrackableResource > ( ) ; private final ConcurrentHashMap < String , CountDownLatch > pendingLock = new ConcurrentHashMap < String , CountDownLatch > ( ) ; private final TrackableSession . AliveChecker aliveChecker = new TrackableSession . AliveChecker ( ) ; private TrackableSession ( ) { } public static TrackableSession getDefault ( ) { } public void track ( TrackableResource < ? extends Trackable > trackableResource ) { } public TrackableResource < ? extends Trackable > lookup ( String trackingID ) { TrackableResource t = factoryCache . get ( trackingID ) ; <START_BUG> if ( t != null ) { <END_BUG> if ( AtmosphereResource . class . isAssignableFrom ( t . resource ( ) . getClass ( ) ) ) { AtmosphereResource . class . cast ( t . resource ( ) ) . addEventListener ( aliveChecker ) ; } } return t ; } public TrackableResource < ? extends Trackable > lookupAndWait ( String trackingID ) { } private static final class AliveChecker extends AtmosphereResourceEventListenerAdapter { @ Override public void onResume ( AtmosphereResourceEvent < HttpServletRequest , HttpServletResponse > event ) { } @ Override public void onDisconnect ( AtmosphereResourceEvent < HttpServletRequest , HttpServletResponse > event ) { } } }

Fix:
if ( ( t != null ) && ( ( t . resource ( ) ) != null ) ) {
Buggy code:
public class BSFTimer extends BSFTestElement implements Cloneable , TestBean , Timer { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 4 ; public long delay ( ) { long delay = 0 ; BSFManager mgr = null ; try { mgr = getManager ( ) ; Object o = evalFileOrScript ( mgr ) ; if ( o == null ) { BSFTimer . log . warn ( "Script<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>return<seq2seq4repair_space>a<seq2seq4repair_space>value" ) ; return 0 ; } <START_BUG> delay = Long . valueOf ( o . toString ( ) ) . longValue ( ) ; <END_BUG> } catch ( NumberFormatException e ) { BSFTimer . log . warn ( ( "Problem<seq2seq4repair_space>in<seq2seq4repair_space>BSF<seq2seq4repair_space>script<seq2seq4repair_space>" + e ) ) ; } catch ( BSFException e ) { BSFTimer . log . warn ( ( "Problem<seq2seq4repair_space>in<seq2seq4repair_space>BSF<seq2seq4repair_space>script<seq2seq4repair_space>" + e ) ) ; } finally { if ( mgr != null ) { mgr . terminate ( ) ; } } return delay ; } }

Fix:
delay = Long . parseLong ( o . toString ( ) ) ;