nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class Diagnostics { private static final String TEST_CLASS = "org.apache.tools.ant.taskdefs.optional.Test" ; private Diagnostics ( ) { } public static boolean isOptionalAvailable ( ) { } public static void validateVersion ( ) throws BuildException { } public static File [ ] listLibraries ( ) { } private static File [ ] listJarFiles ( File libDir ) { } public static void main ( String [ ] args ) { } private static String getImplementationVersion ( Class clazz ) { } private static String getXmlParserName ( ) { } private static SAXParser getSAXParser ( ) { } private static String getXMLParserLocation ( ) { } private static String getClassLocation ( Class clazz ) { } public static void doReport ( PrintStream out ) { } private static void header ( PrintStream out , String section ) { } private static void doReportSystemProperties ( PrintStream out ) { } private static void doReportAntHomeLibraries ( PrintStream out ) { } private static void doReportUserHomeLibraries ( PrintStream out ) { } private static void printLibraries ( File [ ] libs , PrintStream out ) { } private static void doReportWhich ( PrintStream out ) { } private static void doReportTasksAvailability ( PrintStream out ) { InputStream is = Main . class . getResourceAsStream ( TASKDEF_PROPERTIES_RESOURCE ) ; if ( is == null ) { out . println ( "None<seq2seq4repair_space>available" ) ; } else { Properties props = new Properties ( ) ; try { props . load ( is ) ; for ( Enumeration keys = props . keys ( ) ; keys . hasMoreElements ( ) ; ) { String key = ( ( String ) ( keys . nextElement ( ) ) ) ; String classname = props . getProperty ( key ) ; try { Class . forName ( classname ) ; props . remove ( key ) ; } catch ( ClassNotFoundException e ) { out . println ( ( key + "<seq2seq4repair_space>:<seq2seq4repair_space>Not<seq2seq4repair_space>Available" ) ) ; } catch ( NoClassDefFoundError e ) { String pkg = e . getMessage ( ) . replace ( '//' , '.' ) ; out . println ( ( ( key + "<seq2seq4repair_space>:<seq2seq4repair_space>Missing<seq2seq4repair_space>dependency<seq2seq4repair_space>" ) + pkg ) ) ; <START_BUG> } catch ( Error e ) { <END_BUG> out . println ( ( key + "<seq2seq4repair_space>:<seq2seq4repair_space>Initialization<seq2seq4repair_space>error" ) ) ; } } if ( ( props . size ( ) ) == 0 ) { out . println ( "All<seq2seq4repair_space>defined<seq2seq4repair_space>tasks<seq2seq4repair_space>are<seq2seq4repair_space>available" ) ; } } catch ( IOException e ) { out . println ( e . getMessage ( ) ) ; } } } private static void doReportParserInfo ( PrintStream out ) { } private static void doReportTempDir ( PrintStream out ) { } private static void doReportLocale ( PrintStream out ) { } }

Fix:
} catch ( LinkageError e ) {
Buggy code:
public class ResultCollector extends AbstractListenerElement implements Serializable , NoThreadClone , Clearable , Remoteable , SampleListener , TestListener { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String FILENAME = "filename" ; private static boolean functionalMode = false ; public static final String ERROR_LOGGING = "ResultCollector.error_logging" ; private int current ; private transient DefaultConfigurationSerializer serializer ; private transient PrintWriter out ; private boolean inTest = false ; private static Map files = new HashMap ( ) ; private Set hosts = new HashSet ( ) ; public ResultCollector ( ) { } private void setFilenameProperty ( String f ) { } public String getFilename ( ) { } public boolean isErrorLogging ( ) { } public void setErrorLogging ( boolean errorLogging ) { } public void setFilename ( String f ) { } public void testEnded ( String host ) { } public void testStarted ( String host ) { } public void testEnded ( ) { } public void testStarted ( ) { } public void loadExistingFile ( ) throws IOException , ConfigurationException , SAXException { } private static void writeFileStart ( PrintWriter writer ) { } private void writeFileEnd ( ) { if ( ( SaveService . getOutputFormat ( ) ) == ( SaveService . SAVE_AS_XML ) ) { <START_BUG> out . print ( "<//testResults>" ) ; <END_BUG> } } private static synchronized PrintWriter getFileWriter ( String filename ) throws IOException { } private static boolean trimLastLine ( String filename ) { } public static void enableFunctionalMode ( boolean mode ) { } public boolean getFunctionalMode ( ) { } private String getSerializedSampleResult ( SampleResult result ) throws IOException , ConfigurationException , SAXException { } private void readSamples ( Configuration testResults ) throws IOException , ConfigurationException , SAXException { } private Configuration getConfiguration ( String filename ) throws IOException , ConfigurationException , SAXException { } public void clearVisualizer ( ) { } public void setListener ( Object l ) { } public void sampleStarted ( SampleEvent e ) { } public void sampleStopped ( SampleEvent e ) { } public void sampleOccurred ( SampleEvent e ) { } protected void sendToVisualizer ( SampleResult r ) { } private void recordResult ( SampleResult result ) throws IOException , ConfigurationException , SAXException { } private synchronized boolean isResultMarked ( SampleResult res ) { } private void initializeFileOutput ( ) throws IOException , ConfigurationException , SAXException { } private synchronized void finalizeFileOutput ( ) { } public void testIterationStart ( LoopIterationEvent event ) { } }

Fix:
out . print ( "\n<//testResults>" ) ;
Buggy code:
public class WriteResponseHandler implements IAsyncCallback { protected static final Logger logger = LoggerFactory . getLogger ( WriteResponseHandler . class ) ; protected final SimpleCondition condition = new SimpleCondition ( ) ; private final int responseCount ; protected final Collection < Message > responses ; protected AtomicInteger localResponses = new AtomicInteger ( 0 ) ; private final long startTime ; public WriteResponseHandler ( int responseCount , String table ) { } public void get ( ) throws TimeoutException { try { <START_BUG> long timeout = ( ( System . currentTimeMillis ( ) ) - ( startTime ) ) + ( DatabaseDescriptor . getRpcTimeout ( ) ) ; <END_BUG> boolean success ; try { success = condition . await ( timeout , TimeUnit . MILLISECONDS ) ; } catch ( InterruptedException ex ) { throw new AssertionError ( ex ) ; } if ( ! success ) { throw new TimeoutException ( ( ( ( "Operation<seq2seq4repair_space>timed<seq2seq4repair_space>out<seq2seq4repair_space>-<seq2seq4repair_space>received<seq2seq4repair_space>only<seq2seq4repair_space>" + ( responses . size ( ) ) ) + ( localResponses ) ) + "<seq2seq4repair_space>responses" ) ) ; } } finally { for ( Message response : responses ) { MessagingService . removeRegisteredCallback ( response . getMessageId ( ) ) ; } } } public void response ( Message message ) { } public void localResponse ( ) { } private void maybeSignal ( ) { } }

Fix:
long timeout = ( DatabaseDescriptor . getRpcTimeout ( ) ) - ( ( System . currentTimeMillis ( ) ) - ( startTime ) ) ;
Buggy code:
public class MainGame { public static void main ( String [ ] args ) throws SlickException { <START_BUG> AppGameContainer jumper = new AppGameContainer ( new GameApp ( "Jump<seq2seq4repair_space>And<seq2seq4repair_space>Run<seq2seq4repair_space>alpha<seq2seq4repair_space>0.8.5" ) ) ; <END_BUG> jumper . setDisplayMode ( 800 , 450 , false ) ; jumper . setAlwaysRender ( true ) ; jumper . setShowFPS ( false ) ; jumper . start ( ) ; } }

Fix:
AppGameContainer jumper = new AppGameContainer ( new GameApp ( "Jump<seq2seq4repair_space>And<seq2seq4repair_space>Run<seq2seq4repair_space>beta<seq2seq4repair_space>0.2.5" ) ) ;
Buggy code:
public class MidpointIntegratorTest { @ Test ( expected = DimensionMismatchException . class ) public void testDimensionCheck ( ) { } @ Test public void testDecreasingSteps ( ) { } @ Test public void testSmallStep ( ) { } @ Test public void testBigStep ( ) { } @ Test public void testBackward ( ) { } @ Test public void testStepSize ( ) { final double step = 1.23456 ; FirstOrderIntegrator integ = new MidpointIntegrator ( step ) ; integ . addStepHandler ( new StepHandler ( ) { public void handleStep ( StepInterpolator interpolator , boolean isLast ) { if ( ! isLast ) { Assert . assertEquals ( step , ( ( interpolator . getCurrentTime ( ) ) - ( interpolator . getPreviousTime ( ) ) ) , 1.0E-12 ) ; } } <START_BUG> public void reset ( ) { <END_BUG> } } ) ; integ . integrate ( new FirstOrderDifferentialEquations ( ) { public void computeDerivatives ( double t , double [ ] y , double [ ] dot ) { dot [ 0 ] = 1.0 ; } public int getDimension ( ) { return 1 ; } } , 0.0 , new double [ ] { 0.0 } , 5.0 , new double [ 1 ] ) ; } }

Fix:
public void init ( double t0 , double [ ] y0 , double t ) {
Buggy code:
public class StandardServletAsyncWebRequestTests { private StandardServletAsyncWebRequest asyncRequest ; private HttpServletRequest request ; private MockHttpServletResponse response ; @ Before public void setup ( ) { } @ Test public void isAsyncStarted ( ) throws Exception { } @ Test public void startAsync ( ) throws Exception { } @ Test public void startAsync_notSupported ( ) throws Exception { } @ Test public void startAsync_alreadyStarted ( ) throws Exception { } @ Test public void startAsync_stale ( ) throws Exception { expect ( this . request . isAsyncSupported ( ) ) . andReturn ( true ) ; replay ( this . request ) ; this . asyncRequest . onComplete ( new AsyncEvent ( null ) ) ; try { this . asyncRequest . startAsync ( ) ; fail ( "expected<seq2seq4repair_space>exception" ) ; } catch ( IllegalStateException ex ) { <START_BUG> assertEquals ( "Cannot<seq2seq4repair_space>use<seq2seq4repair_space>async<seq2seq4repair_space>request<seq2seq4repair_space>after<seq2seq4repair_space>completion" , ex . getMessage ( ) ) ; <END_BUG> } } @ Test public void complete_stale ( ) throws Exception { } @ Test public void sendError ( ) throws Exception { } @ Test public void sendError_stale ( ) throws Exception { } }

Fix:
assertEquals ( "Cannot<seq2seq4repair_space>use<seq2seq4repair_space>async<seq2seq4repair_space>request<seq2seq4repair_space>that<seq2seq4repair_space>has<seq2seq4repair_space>completed" , ex . getMessage ( ) ) ;
Buggy code:
public class MultipleChoiceInputRequest extends InputRequest { private Vector choices = new Vector ( ) ; public MultipleChoiceInputRequest ( String prompt , Vector choices ) { } public Vector getChoices ( ) { } public boolean isInputValid ( ) { <START_BUG> return choices . contains ( getInput ( ) ) ; <END_BUG> } }

Fix:
return ( choices . contains ( getInput ( ) ) ) || ( ( "" . equals ( getInput ( ) ) ) && ( ( getDefaultValue ( ) ) != null ) ) ;
Buggy code:
public class CompositeAnnotationPanel extends Box implements ActionListener { private static final long serialVersionUID = - 3955122899870904199L ; public SemSimModel semsimmodel ; public DataStructure datastructure ; public AnnotationPanel ad ; public JButton addpropertybutton = new JButton ( "Add<seq2seq4repair_space>property" ) ; public JLabel propertyoflabel = new JLabel ( "property_of" ) ; public JButton addentbutton = new JButton ( "Add<seq2seq4repair_space>entity" ) ; public JButton addprocbutton = new JButton ( "Add<seq2seq4repair_space>process" ) ; protected SemGenSettings settings ; public CompositeAnnotationPanel ( int orientation , SemGenSettings sets , AnnotationPanel ad ) { } public void refreshUI ( ) { } public void alignAndPaint ( ) { } public void setAddButtonsEnabled ( ) { } public void actionPerformed ( ActionEvent arg0 ) { if ( ( arg0 . getSource ( ) ) == ( addentbutton ) ) { if ( ( datastructure . getPhysicalProperty ( ) . getPhysicalPropertyOf ( ) ) == null ) { datastructure . getPhysicalProperty ( ) . setPhysicalPropertyOf ( semsimmodel . getCustomPhysicalEntityByName ( unspecifiedName ) ) ; } else { ArrayList < PhysicalEntity > ents = new ArrayList < PhysicalEntity > ( ) ; ArrayList < StructuralRelation > rels = new ArrayList < StructuralRelation > ( ) ; for ( Component c : getComponents ( ) ) { if ( c instanceof SemSimComponentAnnotationPanel ) { Annotatable smc = ( ( SemSimComponentAnnotationPanel ) ( c ) ) . smc ; if ( smc instanceof PhysicalEntity ) { ents . add ( ( ( PhysicalEntity ) ( smc ) ) ) ; } } if ( c instanceof StructuralRelationPanel ) { StructuralRelationPanel srp = ( ( StructuralRelationPanel ) ( c ) ) ; rels . add ( srp . structuralRelation ) ; } } ents . add ( semsimmodel . getCustomPhysicalEntityByName ( unspecifiedName ) ) ; <START_BUG> rels . add ( CONTAINED_IN_RELATION ) ; <END_BUG> datastructure . getPhysicalProperty ( ) . setPhysicalPropertyOf ( semsimmodel . addCompositePhysicalEntity ( ents , rels ) ) ; } ad . annotator . setModelSaved ( false ) ; if ( ( ad . thebutton . refreshAllCodes ( ) ) && ( settings . organizeByPropertyType ( ) ) ) { ad . annotator . AlphabetizeAndSetCodewords ( ) ; if ( ! ( settings . useTreeView ( ) ) ) ad . annotator . codewordscrollpane . scrollToComponent ( ad . thebutton ) ; } refreshUI ( ) ; } if ( ( arg0 . getSource ( ) ) == ( addprocbutton ) ) { if ( ( datastructure . getPhysicalProperty ( ) . getPhysicalPropertyOf ( ) ) == null ) { datastructure . getPhysicalProperty ( ) . setPhysicalPropertyOf ( semsimmodel . getCustomPhysicalProcessByName ( unspecifiedName ) ) ; ad . annotator . setModelSaved ( false ) ; } refreshUI ( ) ; } } }

Fix:
rels . add ( PART_OF_RELATION ) ;
Buggy code:
public class Robotter { protected static OtpNode myOtpNode ; protected static OtpMbox myOtpMbox ; protected static OtpErlangPid erl_master ; protected static OtpErlangPid pixel_pid ; public static void doHandshake ( ) { } public static void startGame ( ) { Robot robot = null ; try { robot = new Robot ( ) ; } catch ( AWTException e1 ) { e1 . printStackTrace ( ) ; } try { <START_BUG> Runtime . getRuntime ( ) . exec ( "java<seq2seq4repair_space>-jar<seq2seq4repair_space>//Users//maxjohansen//Minecraft.jar" ) ; <END_BUG> } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } robot . delay ( 8000 ) ; robot . mouseMove ( 624 , 760 ) ; robot . mousePress ( InputEvent . BUTTON1_DOWN_MASK ) ; robot . mouseRelease ( InputEvent . BUTTON1_DOWN_MASK ) ; robot . delay ( 3500 ) ; robot . mouseMove ( 346 , 199 ) ; robot . mousePress ( InputEvent . BUTTON1_DOWN_MASK ) ; robot . mouseRelease ( InputEvent . BUTTON1_DOWN_MASK ) ; robot . delay ( 3500 ) ; robot . mouseMove ( 658 , 280 ) ; robot . mousePress ( InputEvent . BUTTON1_DOWN_MASK ) ; robot . mouseRelease ( InputEvent . BUTTON1_DOWN_MASK ) ; robot . delay ( 3500 ) ; robot . mouseMove ( 606 , 54 ) ; robot . mousePress ( InputEvent . BUTTON1_DOWN_MASK ) ; robot . mouseRelease ( InputEvent . BUTTON1_DOWN_MASK ) ; } public static void delegateJobs ( ) { } public static void main ( String [ ] args ) { } }

Fix:
Runtime . getRuntime ( ) . exec ( "java<seq2seq4repair_space>-jar<seq2seq4repair_space>//Users//philkuz//Documents//Minecraft.jar" ) ;
Buggy code:
public class DataLineTest extends MahoutTestCase { private static final String [ ] datalines = new String [ ] { "842302,M,17.99,10.38,122.8,1001,0.1184,0.2776,0.3001,0.1471,0.2419,0.07871,1.095,0.9053,8.589,153.4,0.006399,0.04904,0.05373,0.01587,0.03003,0.006193,25.38,17.33,184.6,2019,0.1622,0.6656,0.7119,0.2654,0.4601,0.1189" , "8510426,B,13.54,14.36,87.46,566.3,0.09779,0.08129,0.06664,0.04781,0.1885,0.05766,0.2699,0.7886,2.058,23.56,0.008462,0.0146,0.02387,0.01315,0.0198,0.0023,15.11,19.26,99.7,711.2,0.144,0.1773,0.239,0.1288,0.2977,0.07259" , "852781,M,18.61,20.25,122.1,1094,0.0944,0.1066,0.149,0.07731,0.1697,0.05699,0.8529,1.849,5.632,93.54,0.01075,0.02722,0.05081,0.01911,0.02293,0.004217,21.31,27.26,139.9,1403,0.1338,0.2117,0.3446,0.149,0.2341,0.07421" } ; public void testSet ( ) throws Exception { <START_BUG> Path inpath = new Path ( "target//test-classes//wdbc" ) ; <END_BUG> FileSystem fs = FileSystem . get ( inpath . toUri ( ) , new Configuration ( ) ) ; DataSet dataset = FileInfoParser . parseFile ( fs , inpath ) ; DataSet . initialize ( dataset ) ; DataLine dl = new DataLine ( ) ; int labelpos = dataset . getLabelIndex ( ) ; dl . set ( DataLineTest . datalines [ 0 ] ) ; assertEquals ( dataset . valueIndex ( labelpos , "M" ) , dl . getLabel ( ) ) ; dl . set ( DataLineTest . datalines [ 1 ] ) ; assertEquals ( dataset . valueIndex ( labelpos , "B" ) , dl . getLabel ( ) ) ; dl . set ( DataLineTest . datalines [ 2 ] ) ; assertEquals ( dataset . valueIndex ( labelpos , "M" ) , dl . getLabel ( ) ) ; } }

Fix:
Path inpath = new Path ( this . getClass ( ) . getResource ( "//wdbc//" ) . getPath ( ) ) ;
Buggy code:
public final class LibraryApplication extends WicketExampleApplication { public LibraryApplication ( ) { } @ Override protected void init ( ) { getExceptionSettings ( ) . setThrowExceptionOnMissingResource ( false ) ; getRequestCycleSettings ( ) . setRenderStrategy ( REDIRECT_TO_RENDER ) ; IAuthorizationStrategy authorizationStrategy = new SimplePageAuthorizationStrategy ( AuthenticatedWebPage . class , SignIn . class ) { @ Override protected boolean isAuthorized ( ) { <START_BUG> return ( ( LibrarySession ) ( wicket . Session . get ( ) ) ) . isSignedIn ( ) ; <END_BUG> } } ; getSecuritySettings ( ) . setAuthorizationStrategy ( authorizationStrategy ) ; } @ Override public ISessionFactory getSessionFactory ( ) { } @ Override public Class < ? extends Page > getHomePage ( ) { } }

Fix:
return LibrarySession . get ( ) . isSignedIn ( ) ;
Buggy code:
public class ToolsPanel extends JPanel { private Color currentColor ; private List < Color > availableColors ; private List < ColorObserver > colorObservers ; private int margin ; private int columns ; private int boxLength ; public ToolsPanel ( ) { } public void paintComponent ( Graphics g ) { } public void paintColoringBoxes ( Graphics g ) { } public void paintSingleBox ( Graphics g , int x , int y , int length , boolean border ) { } public void setSelectedColor ( Color c ) { } public void addColorObserver ( ColorObserver obs ) { } public int getMargin ( ) { } public int getColumns ( ) { } public int getBoxLength ( ) { } public List < Color > getAvailableColors ( ) { } public Area getColorSelectionArea ( ) { <START_BUG> Area area = new Area ( margin , ( ( margin ) + ( ( ( availableColors . size ( ) ) + ( 1 // ( columns ) ) ) * ( boxLength ) ) ) , margin , ( ( margin ) + ( ( boxLength ) * ( columns ) ) ) ) ; <END_BUG> return area ; } }

Fix:
Area area = new Area ( margin , ( ( margin ) + ( ( ( ( availableColors . size ( ) ) + 1 ) // ( columns ) ) * ( boxLength ) ) ) , margin , ( ( margin ) + ( ( boxLength ) * ( columns ) ) ) ) ;
Buggy code:
public class MAudit extends AbstractMetamataTask { static final String AUDIT_PATTERN = "(?:file:)?(.+):(\\d+)\\s*:\\s+(.*)" ; protected File outFile = null ; protected Path searchPath = null ; protected boolean fix = false ; protected boolean list = false ; protected boolean unused = false ; public MAudit ( ) { } static final MAudit . Violation createViolation ( int line , String msg ) { } public void setFix ( boolean flag ) { } public void setList ( boolean flag ) { } public void setTofile ( File outFile ) { } public void setUnused ( boolean flag ) { } public Path createSearchpath ( ) { if ( ( searchPath ) == null ) { <START_BUG> searchPath = new Path ( project ) ; <END_BUG> } return searchPath ; } protected Vector getOptions ( ) { } protected void checkOptions ( ) throws TaskException { } protected void cleanUp ( ) throws TaskException { } protected ExecuteStreamHandler createStreamHandler ( ) throws TaskException { } static final class Violation { String error ; int line ; } }

Fix:
searchPath = new Path ( getProject ( ) ) ;
Buggy code:
public class PermissiblePEX extends PermissibleBase { protected Player player = null ; protected boolean strictMode = false ; protected boolean injectMetadata = true ; protected BukkitPermissions bridge ; protected Map < String , Boolean > cache = new HashMap < String , Boolean > ( ) ; protected PermissiblePEX ( Player player , BukkitPermissions bridge ) { } public static void inject ( Player player , BukkitPermissions bridge ) { } protected static void injectCraftBukkit ( Player player , Permissible permissible ) throws Throwable { } protected static void injectSpout ( Player player , Permissible permissible ) throws Throwable { } @ Override public boolean hasPermission ( String permission ) { } public boolean performCheck ( String permission , String worldName ) { } @ Override public void recalculatePermissions ( ) { } @ Override public boolean hasPermission ( Permission perm ) { } @ Override public boolean isPermissionSet ( String permission ) { PermissionUser user = PermissionsEx . getUser ( this . player ) ; if ( ( user != null ) && ( ( user . getMatchingExpression ( permission , this . player . getWorld ( ) . getName ( ) ) ) != null ) ) { return true ; } <START_BUG> return super . hasPermission ( permission ) ; <END_BUG> } @ Override public boolean isPermissionSet ( Permission perm ) { } @ Override public Set < PermissionAttachmentInfo > getEffectivePermissions ( ) { } }

Fix:
return super . isPermissionSet ( permission ) ;
Buggy code:
public abstract class HibernateStatisticsTestSupport extends HibernateTestSupport { protected SessionFactory sf ; protected SessionFactory sf2 ; @ Before public void postConstruct ( ) { } @ After public void preDestroy ( ) { } protected HazelcastInstance getHazelcastInstance ( SessionFactory sf ) { } protected abstract Properties getCacheProperties ( ) { } protected void insertDummyEntities ( int count ) { } protected void insertDummyEntities ( int count , int childCount ) { } @ Test public void testEntity ( ) { } @ Test public void testQuery ( ) { final int entityCount = 10 ; final int queryCount = 3 ; insertDummyEntities ( entityCount ) ; sleep ( 2 ) ; List < DummyEntity > list = null ; for ( int i = 0 ; i < queryCount ; i ++ ) { list = executeQuery ( sf ) ; assertEquals ( entityCount , list . size ( ) ) ; <START_BUG> sleep ( 2 ) ; <END_BUG> } assertNotNull ( list ) ; Session session = sf . openSession ( ) ; Transaction tx = session . beginTransaction ( ) ; try { for ( DummyEntity dummy : list ) { session . delete ( dummy ) ; } tx . commit ( ) ; } catch ( Exception e ) { tx . rollback ( ) ; e . printStackTrace ( ) ; } finally { session . close ( ) ; } Statistics stats = sf . getStatistics ( ) ; assertEquals ( 1 , stats . getQueryCachePutCount ( ) ) ; assertEquals ( 1 , stats . getQueryCacheMissCount ( ) ) ; assertEquals ( ( queryCount - 1 ) , stats . getQueryCacheHitCount ( ) ) ; assertEquals ( 1 , stats . getQueryExecutionCount ( ) ) ; assertEquals ( entityCount , stats . getEntityInsertCount ( ) ) ; assertEquals ( entityCount , stats . getEntityLoadCount ( ) ) ; assertEquals ( entityCount , stats . getEntityDeleteCount ( ) ) ; assertEquals ( ( ( entityCount * ( queryCount - 1 ) ) * 2 ) , stats . getSecondLevelCacheHitCount ( ) ) ; assertEquals ( entityCount , stats . getSecondLevelCacheMissCount ( ) ) ; stats . logSummary ( ) ; } protected List < DummyEntity > executeQuery ( SessionFactory factory ) { } protected DummyEntity executeQuery ( SessionFactory factory , long id ) { } @ Test public void testQuery2 ( ) { } @ Test @ Category ( NightlyTest . class ) public void testQueryCacheCleanup ( ) { } }

Fix:
sleepAtLeastSeconds ( 1 ) ;
Buggy code:
public class BoundedQueueThreadPoolMetricsHandler extends ThreadPoolMetricsHandler { public static final List < AttributeDefinition > METRICS = Arrays . asList ( CURRENT_THREAD_COUNT , LARGEST_THREAD_COUNT , REJECTED_COUNT ) ; public BoundedQueueThreadPoolMetricsHandler ( final ServiceName serviceNameBase ) { } @ Override protected void setResult ( OperationContext context , final String attributeName , final Service < ? > service ) throws OperationFailedException { BoundedQueueThreadPoolService bounded = ( ( BoundedQueueThreadPoolService ) ( service ) ) ; if ( attributeName . equals ( CommonAttributes . CURRENT_THREAD_COUNT ) ) { context . getResult ( ) . set ( bounded . getCurrentThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . LARGEST_THREAD_COUNT ) ) { context . getResult ( ) . set ( bounded . getLargestThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . REJECTED_COUNT ) ) { context . getResult ( ) . set ( bounded . getRejectedCount ( ) ) ; } else { <START_BUG> throw new IllegalStateException ( ( ( "Unsupported<seq2seq4repair_space>attribute<seq2seq4repair_space>'" + attributeName ) + "'" ) ) ; <END_BUG> } } }

Fix:
throw MESSAGES . unsupportedBoundedQueueThreadPoolMetric ( attributeName ) ;
Buggy code:
public class WeightsAdapter extends ArrayAdapter < HealthMeasureHistory > { public WeightsAdapter ( Context context , int resource , List < HealthMeasureHistory > objects ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { View v = convertView ; if ( v == null ) { LayoutInflater vi ; vi = LayoutInflater . from ( getContext ( ) ) ; v = vi . inflate ( row_list_weights , null ) ; } HealthMeasureHistory hm = getItem ( position ) ; if ( hm != null ) { TextView tvWeight = ( ( TextView ) ( v . findViewById ( textViewWeight ) ) ) ; TextView tvDate = ( ( TextView ) ( v . findViewById ( textViewDate ) ) ) ; if ( tvWeight != null ) { tvWeight . setText ( ( ( hm . getValue ( ) ) + "<seq2seq4repair_space>Kg<seq2seq4repair_space>" ) ) ; } if ( tvDate != null ) { <START_BUG> tvDate . setText ( String . valueOf ( new Date ( hm . getTimestamp ( ) ) ) ) ; <END_BUG> } } return v ; } }

Fix:
tvDate . setText ( hm . getTimestamp ( ) ) ;
Buggy code:
public class KafkaUtilsTest { private KafkaTestBroker broker ; private SimpleConsumer simpleConsumer ; private KafkaConfig config ; private BrokerHosts brokerHosts ; @ Before public void setup ( ) { } @ After public void shutdown ( ) { } @ Test ( expected = FailedFetchException . class ) public void topicDoesNotExist ( ) throws Exception { } @ Test ( expected = FailedFetchException . class ) public void brokerIsDown ( ) throws Exception { } @ Test public void fetchMessage ( ) throws Exception { } @ Test ( expected = FailedFetchException . class ) public void fetchMessagesWithInvalidOffsetAndDefaultHandlingDisabled ( ) throws Exception { } <START_BUG> @ Test ( expected = TopicOffsetOutOfRangeException . class ) <END_BUG> public void fetchMessagesWithInvalidOffsetAndDefaultHandlingEnabled ( ) throws Exception { config = new KafkaConfig ( brokerHosts , "newTopic" ) ; String value = "test" ; createTopicAndSendMessage ( value ) ; KafkaUtils . fetchMessages ( config , simpleConsumer , new Partition ( Broker . fromString ( broker . getBrokerConnectionString ( ) ) , 0 ) , ( - 99 ) ) ; } @ Test public void getOffsetFromConfigAndDontForceFromStart ( ) { } @ Test public void getOffsetFromConfigAndFroceFromStart ( ) { } @ Test public void generateTuplesWithoutKeyAndKeyValueScheme ( ) { } @ Test public void generateTuplesWithKeyAndKeyValueScheme ( ) { } @ Test public void generateTupelsWithValueScheme ( ) { } @ Test public void generateTuplesWithValueSchemeAndKeyValueMessage ( ) { } private ByteBufferMessageSet getLastMessage ( ) { } private void runGetValueOnlyTuplesTest ( ) { } private void createTopicAndSendMessage ( ) { } private void createTopicAndSendMessage ( String value ) { } private void createTopicAndSendMessage ( String key , String value ) { } @ Test public void assignOnePartitionPerTask ( ) { } @ Test public void assignTwoPartitionsPerTask ( ) { } @ Test public void assignAllPartitionsToOneTask ( ) { } public void runPartitionToTaskMappingTest ( int numPartitions , int partitionsPerTask ) { } @ Test public void moreTasksThanPartitions ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void assignInvalidTask ( ) { } }

Fix:
@ Test ( expected = UpdateOffsetException . class )
Buggy code:
public class Way { public final LatLong labelPosition ; public final LatLong [ ] [ ] latLongs ; public final byte layer ; public final List < Tag > tags ; Way ( byte layer , List < Tag > tags , LatLong [ ] [ ] latLongs , LatLong labelPosition ) { } @ Override public boolean equals ( Object obj ) { if ( ( this ) == obj ) { return true ; } else if ( ! ( obj instanceof Way ) ) { return false ; } Way other = ( ( Way ) ( obj ) ) ; if ( ( this . layer ) != ( other . layer ) ) { return false ; } else if ( ! ( this . tags . equals ( other . tags ) ) ) { return false ; } else if ( ( ( this . labelPosition ) == null ) && ( ( other . labelPosition ) != null ) ) { return false ; } else <START_BUG> if ( ( ( this . labelPosition ) != null ) && ( this . labelPosition . equals ( other . labelPosition ) ) ) { <END_BUG> return false ; } else if ( ( this . latLongs . length ) != ( other . latLongs . length ) ) { return false ; } else { for ( int i = 0 ; i < ( this . latLongs . length ) ; i ++ ) { if ( ( this . latLongs [ i ] . length ) != ( other . latLongs [ i ] . length ) ) { return false ; } else { for ( int j = 0 ; j < ( this . latLongs [ i ] . length ) ; j ++ ) { if ( ! ( latLongs [ i ] [ j ] . equals ( other . latLongs [ i ] [ j ] ) ) ) { return false ; } } } } } return true ; } @ Override public int hashCode ( ) { } }

Fix:
if ( ( ( this . labelPosition ) != null ) && ( ! ( this . labelPosition . equals ( other . labelPosition ) ) ) ) {
Buggy code:
public class SubDeploymentProcessor implements DeploymentUnitProcessor { public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final List < ResourceRoot > childRoots = deploymentUnit . getAttachment ( RESOURCE_ROOTS ) ; if ( childRoots != null ) { final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; for ( final ResourceRoot childRoot : childRoots ) { if ( ! ( ResourceRootTypeMarker . isSubDeployment ( childRoot ) ) ) { continue ; } final SubDeploymentUnitService service = new SubDeploymentUnitService ( childRoot , deploymentUnit ) ; final ServiceName serviceName = deploymentUnit . getServiceName ( ) . append ( childRoot . getRootName ( ) ) ; serviceTarget . addService ( serviceName , service ) . addDependency ( JBOSS_DEPLOYMENT_CHAINS , DeployerChains . class , service . getDeployerChainsInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; <START_BUG> deploymentUnit . addToAttachmentList ( SUB_DEPLOYMENTS , serviceName ) ; <END_BUG> } } } public void undeploy ( DeploymentUnit deploymentUnit ) { } }

Fix:
phaseContext . addDeploymentDependency ( serviceName , SUB_DEPLOYMENTS ) ;
Buggy code:
public class SelectionParser extends AssistParser { public int selectionStart ; public int selectionEnd ; public static final char [ ] SUPER = "super" . toCharArray ( ) ; public static final char [ ] THIS = "this" . toCharArray ( ) ; public SelectionParser ( ProblemReporter problemReporter , long sourceLevel ) { } public char [ ] assistIdentifier ( ) { } protected void attachOrphanCompletionNode ( ) { } private boolean checkRecoveredType ( ) { } protected void classInstanceCreation ( boolean alwaysQualified ) { } protected void consumeArrayCreationExpressionWithoutInitializer ( ) { } protected void consumeArrayCreationExpressionWithInitializer ( ) { } protected void consumeEnterAnonymousClassBody ( ) { } protected void consumeEnterVariable ( ) { } protected void consumeExitVariableWithInitialization ( ) { } protected void consumeFieldAccess ( boolean isSuperAccess ) { } protected void consumeFormalParameter ( ) { } protected void consumeInstanceOfExpression ( int op ) { } protected void consumeMethodInvocationName ( ) { } protected void consumeMethodInvocationPrimary ( ) { } protected void consumeTypeImportOnDemandDeclarationName ( ) { } public ImportReference createAssistImportReference ( char [ ] [ ] tokens , long [ ] positions , int mod ) { } public ImportReference createAssistPackageReference ( char [ ] [ ] tokens , long [ ] positions ) { } protected LocalDeclaration createLocalDeclaration ( Expression initialization , char [ ] assistName , int sourceStart , int sourceEnd ) { } public NameReference createQualifiedAssistNameReference ( char [ ] [ ] previousIdentifiers , char [ ] assistName , long [ ] positions ) { } public TypeReference createQualifiedAssistTypeReference ( char [ ] [ ] previousIdentifiers , char [ ] assistName , long [ ] positions ) { } public NameReference createSingleAssistNameReference ( char [ ] assistName , long position ) { } public TypeReference createSingleAssistTypeReference ( char [ ] assistName , long position ) { } public CompilationUnitDeclaration dietParse ( ICompilationUnit sourceUnit , CompilationResult compilationResult , int start , int end ) { } protected NameReference getUnspecifiedReference ( ) { } protected NameReference getUnspecifiedReferenceOptimized ( ) { } public void initializeScanner ( ) { <START_BUG> this . scanner = new SelectionScanner ( this . assertMode ) ; <END_BUG> } protected MessageSend newMessageSend ( ) { } public CompilationUnitDeclaration parse ( ICompilationUnit sourceUnit , CompilationResult compilationResult , int start , int end ) { } protected boolean resumeAfterRecovery ( ) { } public void selectionIdentifierCheck ( ) { } public void setAssistIdentifier ( char [ ] assistIdent ) { } protected void updateRecoveryState ( ) { } }

Fix:
this . scanner = new SelectionScanner ( this . sourceLevel ) ;
Buggy code:
public class BatchOperation extends JavaModelOperation { protected IWorkspaceRunnable runnable ; public BatchOperation ( IWorkspaceRunnable runnable ) { } protected void executeOperation ( ) throws JavaModelException { try { <START_BUG> this . runnable . run ( fMonitor ) ; <END_BUG> } catch ( CoreException ce ) { if ( ce instanceof JavaModelException ) { throw ( ( JavaModelException ) ( ce ) ) ; } else { if ( ( ce . getStatus ( ) . getCode ( ) ) == ( IResourceStatus . OPERATION_FAILED ) ) { Throwable e = ce . getStatus ( ) . getException ( ) ; if ( e instanceof JavaModelException ) { throw ( ( JavaModelException ) ( e ) ) ; } } throw new JavaModelException ( ce ) ; } } } protected IJavaModelStatus verify ( ) { } }

Fix:
this . runnable . run ( progressMonitor ) ;
Buggy code:
public class LineCapTab extends GraphicsTab { Button colorButton ; GraphicsBackground foreground ; Menu menu ; public LineCapTab ( GraphicsExample example ) { } public String getCategory ( ) { } public String getText ( ) { } public String getDescription ( ) { } public void dispose ( ) { } public void createControlPanel ( Composite parent ) { Composite comp ; comp = new Composite ( parent , SWT . NONE ) ; comp . setLayout ( new GridLayout ( ) ) ; ColorMenu cm = new ColorMenu ( ) ; <START_BUG> cm . setPatternItems ( true ) ; <END_BUG> menu = cm . createMenu ( parent . getParent ( ) , new ColorListener ( ) { public void setColor ( GraphicsBackground gb ) { foreground = gb ; colorButton . setImage ( gb . getThumbNail ( ) ) ; example . redraw ( ) ; } } ) ; foreground = ( ( GraphicsBackground ) ( menu . getItem ( 2 ) . getData ( ) ) ) ; colorButton = new Button ( comp , SWT . PUSH ) ; colorButton . setText ( GraphicsExample . getResourceString ( "Color" ) ) ; colorButton . setImage ( foreground . getThumbNail ( ) ) ; colorButton . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event event ) { final Button button = ( ( Button ) ( event . widget ) ) ; final Composite parent = button . getParent ( ) ; Rectangle bounds = button . getBounds ( ) ; Point point = parent . toDisplay ( new Point ( bounds . x , bounds . y ) ) ; menu . setLocation ( point . x , ( ( point . y ) + ( bounds . height ) ) ) ; menu . setVisible ( true ) ; } } ) ; } public void paint ( GC gc , int width , int height ) { } static String getPlatformFont ( ) { } }

Fix:
cm . setPatternItems ( example . checkAdvancedGraphics ( ) ) ;
Buggy code:
public class ExceptionUtils { static final String WRAPPED_MARKER = "<seq2seq4repair_space>[wrapped]<seq2seq4repair_space>" ; private static final String [ ] CAUSE_METHOD_NAMES = new String [ ] { "getCause" , "getNextException" , "getTargetException" , "getException" , "getSourceException" , "getRootCause" , "getCausedByException" , "getNested" , "getLinkedException" , "getNestedException" , "getLinkedCause" , "getThrowable" } ; public ExceptionUtils ( ) { } @ Deprecated public static String [ ] getDefaultCauseMethodNames ( ) { } @ Deprecated public static Throwable getCause ( Throwable throwable ) { } @ Deprecated public static Throwable getCause ( Throwable throwable , String [ ] methodNames ) { } public static Throwable getRootCause ( Throwable throwable ) { } private static Throwable getCauseUsingMethodName ( Throwable throwable , String methodName ) { } public static int getThrowableCount ( Throwable throwable ) { } public static Throwable [ ] getThrowables ( Throwable throwable ) { } public static List < Throwable > getThrowableList ( Throwable throwable ) { } public static int indexOfThrowable ( Throwable throwable , Class < ? > clazz ) { } public static int indexOfThrowable ( Throwable throwable , Class < ? > clazz , int fromIndex ) { } public static int indexOfType ( Throwable throwable , Class < ? > type ) { } public static int indexOfType ( Throwable throwable , Class < ? > type , int fromIndex ) { } private static int indexOf ( Throwable throwable , Class < ? > type , int fromIndex , boolean subclass ) { } public static void printRootCauseStackTrace ( Throwable throwable ) { } public static void printRootCauseStackTrace ( Throwable throwable , PrintStream stream ) { } public static void printRootCauseStackTrace ( Throwable throwable , PrintWriter writer ) { } public static String [ ] getRootCauseStackTrace ( Throwable throwable ) { } public static void removeCommonFrames ( List < String > causeFrames , List < String > wrapperFrames ) { } public static String getStackTrace ( Throwable throwable ) { } public static String [ ] getStackFrames ( Throwable throwable ) { } static String [ ] getStackFrames ( String stackTrace ) { } static List < String > getStackFrameList ( Throwable t ) { String stackTrace = ExceptionUtils . getStackTrace ( t ) ; String linebreak = SystemUtils . LINE_SEPARATOR ; StringTokenizer frames = new StringTokenizer ( stackTrace , linebreak ) ; List < String > list = new ArrayList < String > ( ) ; boolean traceStarted = false ; while ( frames . hasMoreTokens ( ) ) { String token = frames . nextToken ( ) ; int at = token . indexOf ( "at" ) ; <START_BUG> if ( ( at != ( - 1 ) ) && ( ( token . substring ( 0 , at ) . trim ( ) . length ( ) ) == 0 ) ) { <END_BUG> traceStarted = true ; list . add ( token ) ; } else if ( traceStarted ) { break ; } } return list ; } public static String getMessage ( Throwable th ) { } public static String getRootCauseMessage ( Throwable th ) { } }

Fix:
if ( ( at != ( - 1 ) ) && ( token . substring ( 0 , at ) . trim ( ) . isEmpty ( ) ) ) {
Buggy code:
public class IncrementalImageBuilder extends AbstractImageBuilder { protected ArrayList locations ; protected ArrayList previousLocations ; protected ArrayList typeNames ; protected ArrayList qualifiedStrings ; protected ArrayList simpleStrings ; public static int MaxCompileLoop = 5 ; protected IncrementalImageBuilder ( JavaBuilder javaBuilder ) { } public boolean build ( SimpleLookupTable deltas ) { } protected void addAffectedSourceFiles ( ) { } protected void addDependentsOf ( IPath path , boolean hasStructuralChanges ) { if ( hasStructuralChanges ) <START_BUG> newState . hasStructuralChanges ( ) ; <END_BUG> path = path . setDevice ( null ) ; String packageName = path . uptoSegment ( ( ( path . segmentCount ( ) ) - 1 ) ) . toString ( ) ; if ( ! ( qualifiedStrings . contains ( packageName ) ) ) qualifiedStrings . add ( packageName ) ; String typeName = path . lastSegment ( ) ; int memberIndex = typeName . indexOf ( '$' ) ; if ( memberIndex > 0 ) typeName = typeName . substring ( 0 , memberIndex ) ; if ( ! ( simpleStrings . contains ( typeName ) ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( ( ( ( "<seq2seq4repair_space>adding<seq2seq4repair_space>dependents<seq2seq4repair_space>of<seq2seq4repair_space>" + typeName ) + "<seq2seq4repair_space>in<seq2seq4repair_space>" ) + packageName ) ) ; simpleStrings . add ( typeName ) ; } } protected void cleanUp ( ) { } protected boolean findAffectedSourceFiles ( IResourceDelta delta , IResource [ ] binaryResources ) { } protected void findAffectedSourceFiles ( IResourceDelta binaryDelta , int segmentCount ) { } protected boolean findSourceFiles ( IResourceDelta delta ) throws CoreException { } protected void findSourceFiles ( IResourceDelta sourceDelta , int segmentCount ) throws CoreException { } protected void finishedWith ( String sourceLocation , CompilationResult result , char [ ] mainTypeName , ArrayList definedTypeNames , ArrayList duplicateTypeNames ) throws CoreException { } protected void removeClassFile ( IPath typePath ) throws CoreException { } protected void resetCollections ( ) { } protected void updateProblemsFor ( String sourceLocation , CompilationResult result ) throws CoreException { } protected boolean writeClassFileCheck ( IFile file , String fileName , byte [ ] newBytes , boolean isSecondaryType ) throws CoreException { } public String toString ( ) { } }

Fix:
newState . tagAsStructurallyChanged ( ) ;
Buggy code:
public class Validatable < T > implements IValidatable < T > { private T value ; private ArrayList < IValidationError > errors ; private IModel < T > model ; public Validatable ( ) { } public Validatable ( T value ) { } public void setModel ( IModel < T > model ) { } public void setValue ( T value ) { } public T getValue ( ) { } public void error ( IValidationError error ) { } public List < IValidationError > getErrors ( ) { } public boolean isValid ( ) { } public IModel < T > getModel ( ) { <START_BUG> return null ; <END_BUG> } }

Fix:
return model ;
Buggy code:
public class ClassNamePatternConverter extends NamedPatternConverter { StringBuffer buf ; int precision ; public ClassNamePatternConverter ( ) { } String getFullyQualifiedName ( LoggingEvent event ) { <START_BUG> return event . getLocationInformation ( ) . getClassName ( ) ; <END_BUG> } }

Fix:
return ( event . getLocationInformation ( ) ) != null ? event . getLocationInformation ( ) . getClassName ( ) : "" ;
Buggy code:
public abstract class ThreadPoolMetricsHandler extends AbstractRuntimeOnlyHandler { private final List < AttributeDefinition > metrics ; private final ServiceName serviceNameBase ; protected ThreadPoolMetricsHandler ( List < AttributeDefinition > metrics , ServiceName serviceNameBase ) { } public void registerAttributes ( final ManagementResourceRegistration registration ) { } @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } protected abstract void setResult ( OperationContext context , String attributeName , Service < ? > service ) throws OperationFailedException { } protected ServiceController < ? > getService ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final String name = Util . getNameFromAddress ( operation . require ( OP_ADDR ) ) ; ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( serviceNameBase . append ( name ) ) ; if ( controller == null ) { <START_BUG> throw ROOT_LOGGER . threadPoolServiceNotFoundForMetrics ( serviceNameBase . append ( name ) ) ; <END_BUG> } return controller ; } }

Fix:
throw MESSAGES . threadPoolServiceNotFoundForMetrics ( serviceNameBase . append ( name ) ) ;
Buggy code:
public class CentroidTest extends AbstractVectorTest < Centroid > { @ Test public void testUpdate ( ) { } @ Override public Centroid vectorToTest ( int size ) { } @ Override public void testSize ( ) { <START_BUG> assertEquals ( "size" , 3 , getTestVector ( ) . getNumNondefaultElements ( ) ) ; <END_BUG> } @ Override Vector generateTestVector ( int cardinality ) { } }

Fix:
assertEquals ( "size" , 3 , getTestVector ( ) . getNumNonZeroElements ( ) ) ;
Buggy code:
public class AddPOP3MessageCommand extends FolderCommand { private MessageFolder inboxFolder ; public AddPOP3MessageCommand ( DefaultCommandReference [ ] references ) { } public void execute ( WorkerStatusController worker ) throws Exception { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ; inboxFolder = ( ( MessageFolder ) ( r [ 0 ] . getFolder ( ) ) ) ; ColumbaMessage message = ( ( ColumbaMessage ) ( r [ 0 ] . getMessage ( ) ) ) ; SourceInputStream messageStream = new SourceInputStream ( message . getSource ( ) ) ; <START_BUG> Object uid = inboxFolder . addMessage ( messageStream , message . getHeader ( ) . getAttributes ( ) ) ; <END_BUG> messageStream . close ( ) ; inboxFolder . getFlags ( uid ) . set ( RECENT ) ; inboxFolder . getMessageFolderInfo ( ) . incRecent ( ) ; applySpamFilter ( uid , worker ) ; applyFilters ( uid ) ; } private void applySpamFilter ( Object uid , WorkerStatusController worker ) throws Exception { } private void applyFilters ( Object uid ) throws Exception { } public void updateGUI ( ) throws Exception { } }

Fix:
Object uid = inboxFolder . addMessage ( messageStream , message . getHeader ( ) . getAttributes ( ) , message . getFlags ( ) ) ;
Buggy code:
public final class PathSetter extends BaseInterceptor { private static StringManager sm = StringManager . getManager ( "org.apache.tomcat.resources" ) ; public static final String DEFAULT_WORK_DIR = "work" ; public PathSetter ( ) { } public void addInterceptor ( ContextManager cm , Context ctx , BaseInterceptor module ) throws TomcatException { if ( ( this ) != module ) return ; String home = cm . getHome ( ) ; if ( home == null ) { home = System . getProperty ( TOMCAT_HOME ) ; } if ( home == null ) { home = IntrospectionUtils . guessHome ( "tomcat.home" , "tomcat_core.jar" , "org//apache//tomcat//core//Request.class" ) ; } if ( home == null ) { System . out . println ( PathSetter . sm . getString ( "tomcat.nohome" ) ) ; home = "." ; } home = FileUtil . getCanonicalPath ( home ) ; cm . setHome ( home ) ; log ( ( "engineInit:<seq2seq4repair_space>home=<seq2seq4repair_space>" + home ) ) ; String installDir = cm . getInstallDir ( ) ; if ( installDir != null ) { installDir = FileUtil . getCanonicalPath ( installDir ) ; cm . setInstallDir ( installDir ) ; log ( ( "engineInit:<seq2seq4repair_space>install=<seq2seq4repair_space>" + installDir ) ) ; } if ( ( home != null ) && ( installDir == null ) ) { cm . setInstallDir ( home ) ; installDir = home ; } if ( ( home == null ) && ( installDir != null ) ) { cm . setHome ( installDir ) ; home = installDir ; } if ( ( home == null ) && ( installDir == null ) ) { home = FileUtil . getCanonicalPath ( "." ) ; installDir = home ; cm . setHome ( home ) ; cm . setInstallDir ( home ) ; } <START_BUG> System . setProperty ( "tomcat.home" , cm . getHome ( ) ) ; <END_BUG> } public void engineInit ( ContextManager cm ) throws TomcatException { } private void initLoggers ( Hashtable Loggers ) { } public void addContext ( ContextManager cm , Context ctx ) throws TomcatException { } }

Fix:
System . getProperties ( ) . put ( "tomcat.home" , cm . getHome ( ) ) ;