nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class WorkbenchKeyboard { private static final boolean DEBUG = Policy . DEBUG_KEY_BINDINGS ; private static final boolean DEBUG_VERBOSE = Policy . DEBUG_KEY_BINDINGS_VERBOSE ; private static final int DELAY = 1000 ; static KeySequence outOfOrderKeys ; private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle . getBundle ( WorkbenchKeyboard . class . getName ( ) ) ; public static List generatePossibleKeyStrokes ( Event event ) { } private static boolean isOutOfOrderKey ( List keyStrokes ) { } private final ICommandManager commandManager ; private final Listener keyDownFilter = new Listener ( ) { public void handleEvent ( Event event ) { } } ; private KeyAssistDialog keyAssistDialog = null ; private long startTime = Long . MAX_VALUE ; private final KeyBindingState state ; private final IWindowListener windowListener = new IWindowListener ( ) { public void windowActivated ( IWorkbenchWindow window ) { } public void windowClosed ( IWorkbenchWindow window ) { } public void windowDeactivated ( IWorkbenchWindow window ) { } public void windowOpened ( IWorkbenchWindow window ) { } } ; private final IWorkbench workbench ; public WorkbenchKeyboard ( Workbench associatedWorkbench ) { } private void checkActiveWindow ( IWorkbenchWindow window ) { } private void closeMultiKeyAssistShell ( ) { } private static boolean isEnabled ( ICommand command ) { } final boolean executeCommand ( String commandId ) throws CommandException { } private void filterKeySequenceBindings ( Event event ) { if ( ( ( event . keyCode ) & ( SWT . MODIFIER_MASK ) ) != 0 ) return ; List keyStrokes = WorkbenchKeyboard . generatePossibleKeyStrokes ( event ) ; if ( WorkbenchKeyboard . isOutOfOrderKey ( keyStrokes ) ) { Widget widget = event . widget ; if ( ( ( ( event . character ) == ( SWT . DEL ) ) && ( ( ( event . stateMask ) & ( SWT . MODIFIER_MASK ) ) == 0 ) ) && ( ( widget instanceof Text ) || ( widget instanceof Combo ) ) ) { return ; } else if ( widget instanceof StyledText ) { if ( ( event . type ) == ( SWT . KeyDown ) ) { ( ( StyledText ) ( widget ) ) . addVerifyKeyListener ( new OutOfOrderVerifyListener ( new OutOfOrderListener ( this ) ) ) ; } } else { <START_BUG> widget . addListener ( event . type , new OutOfOrderListener ( this ) ) ; <END_BUG> } } else { processKeyEvent ( keyStrokes , event ) ; } } public Listener getKeyDownFilter ( ) { } private String getPerfectMatch ( KeySequence keySequence ) { } private void incrementState ( KeySequence sequence ) { } private boolean isPartialMatch ( KeySequence keySequence ) { } private boolean isPerfectMatch ( KeySequence keySequence ) { } final void logException ( final CommandException e ) { } public final void openMultiKeyAssistShell ( ) { } public boolean press ( List potentialKeyStrokes , Event event ) throws CommandException { } void processKeyEvent ( List keyStrokes , Event event ) { } private final void resetState ( final boolean clearRememberedState ) { } }

Fix:
widget . addListener ( KeyDown , new OutOfOrderListener ( this ) ) ;
Buggy code:
public class AlgorithmRuntimeTester { public static final int NUM_OF_ITERATIONS = 10 ; private SortAlgorithm algorithm ; public AlgorithmRuntimeTester ( SortAlgorithm algorithm ) { } public RuntimeStatistics run ( ArrayList < int [ ] > arrays ) { <START_BUG> int [ ] runtimeResults = new int [ AlgorithmRuntimeTester . NUM_OF_ITERATIONS ] ; <END_BUG> int [ ] keyCompResults = new int [ AlgorithmRuntimeTester . NUM_OF_ITERATIONS ] ; for ( int i = 0 ; i < ( AlgorithmRuntimeTester . NUM_OF_ITERATIONS ) ; i ++ ) { algorithm . reset ( ) ; algorithm . sort ( arrays . get ( i ) ) ; runtimeResults [ i ] = algorithm . getRuntimeMilliseconds ( ) ; keyCompResults [ i ] = algorithm . getNumberOfKeyComparisons ( ) ; } return new RuntimeStatistics ( runtimeResults , keyCompResults ) ; } No newline ; at end ; of file ; }

Fix:
long [ ] runtimeResults = new long [ AlgorithmRuntimeTester . NUM_OF_ITERATIONS ] ;
Buggy code:
public class Writer { protected static final String NAMESPACES_FEATURE_ID = "http:////xml.org//sax//features//namespaces" ; protected static final String VALIDATION_FEATURE_ID = "http:////xml.org//sax//features//validation" ; protected static final String SCHEMA_VALIDATION_FEATURE_ID = "http:////apache.org//xml//features//validation//schema" ; protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http:////apache.org//xml//features//validation//schema-full-checking" ; protected static final String DYNAMIC_VALIDATION_FEATURE_ID = "http:////apache.org//xml//features//validation//dynamic" ; protected static final String LOAD_EXTERNAL_DTD_FEATURE_ID = "http:////apache.org//xml//features//nonvalidating//load-external-dtd" ; protected static final String DEFAULT_PARSER_NAME = "dom.wrappers.Xerces" ; protected static final boolean DEFAULT_NAMESPACES = true ; protected static final boolean DEFAULT_VALIDATION = false ; protected static final boolean DEFAULT_LOAD_EXTERNAL_DTD = true ; protected static final boolean DEFAULT_SCHEMA_VALIDATION = false ; protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING = false ; protected static final boolean DEFAULT_DYNAMIC_VALIDATION = false ; protected static final boolean DEFAULT_CANONICAL = false ; protected PrintWriter fOut ; protected boolean fCanonical ; protected boolean fXML11 ; public Writer ( ) { } public Writer ( boolean canonical ) { } public void setCanonical ( boolean canonical ) { } public void setOutput ( OutputStream stream , String encoding ) throws UnsupportedEncodingException { } public void setOutput ( java . io . Writer writer ) { } public void write ( Node node ) { } protected Attr [ ] sortAttributes ( NamedNodeMap attrs ) { } protected void normalizeAndPrint ( String s , boolean isAttValue ) { } protected void normalizeAndPrint ( char c , boolean isAttValue ) { } protected String getVersion ( Document document ) { if ( document == null ) { return null ; } String version = null ; Method getXMLVersion = null ; try { getXMLVersion = document . getClass ( ) . getMethod ( "getXmlVersion" , new Class [ ] { } ) ; if ( getXMLVersion != null ) { <START_BUG> version = ( ( String ) ( getXMLVersion . invoke ( document , null ) ) ) ; <END_BUG> } } catch ( Exception e ) { } return version ; } public static void main ( String [ ] argv ) { } private static void printUsage ( ) { } }

Fix:
version = ( ( String ) ( getXMLVersion . invoke ( document , ( ( Object [ ] ) ( null ) ) ) ) ) ;
Buggy code:
public class XML11DTDValidator extends XMLDTDValidator { protected static final String DTD_VALIDATOR_PROPERTY = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . DTD_VALIDATOR_PROPERTY ) ; public XML11DTDValidator ( ) { } public void reset ( XMLComponentManager manager ) { } protected boolean isSpace ( int c ) { } protected void init ( ) { <START_BUG> if ( fValidation ) { <END_BUG> super . init ( ) ; try { fValID = fDatatypeValidatorFactory . getBuiltInDV ( "XML11ID" ) ; fValIDRef = fDatatypeValidatorFactory . getBuiltInDV ( "XML11IDREFS" ) ; fValIDRefs = fDatatypeValidatorFactory . getBuiltInDV ( "XML11IDREFS" ) ; fValNMTOKEN = fDatatypeValidatorFactory . getBuiltInDV ( "XML11NMTOKENSymbol" ) ; fValNMTOKENS = fDatatypeValidatorFactory . getBuiltInDV ( "XML11NMTOKENS" ) ; } catch ( Exception e ) { e . printStackTrace ( System . err ) ; } } } }

Fix:
if ( ( fValidation ) || ( fDynamicValidation ) ) {
Buggy code:
public class RouterTest { private Router router ; private Map < String , String > request ; @ Before public void setUp ( ) throws IOException { } @ Test public void itSendsARequestToTheRedirectRoute ( ) throws IOException { } @ Test public void itSendsARequestToAVerbRoute ( ) throws IOException { } @ Test public void itSendsARequestToAuthRoute ( ) throws IOException { } @ Test public void itSendsARequestToAuthRouteFromTheBrokenCobSpecRequest ( ) throws IOException { } @ Test public void itSendsARequestToPartialRouter ( ) throws IOException { } @ Test public void itSendsARequestToParamRouter ( ) throws IOException { } @ Test public void itSendsARequestToGetPatchRouter ( ) throws IOException { <START_BUG> request . put ( "URI" , "//parametersAreCool" ) ; <END_BUG> request . put ( "VERB" , "GET" ) ; request . put ( "HEADERS" , "If-Match:<seq2seq4repair_space>dnisa987" ) ; assertEquals ( "GetPatchFileRouter" , router . sendToRoute ( ) ) ; } No newline ; at end ; of file ; }

Fix:
request . put ( "URI" , "//patch-content.txt" ) ;
Buggy code:
public class ModClusterListProxies implements OperationStepHandler , DescriptionProvider { static final ModClusterListProxies INSTANCE = new ModClusterListProxies ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . isNormalServer ( ) ) { <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 ( ) ) ) ; Map < InetSocketAddress , String > map = modcluster . getProxyInfo ( ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "Mod_cluster<seq2seq4repair_space>ListProxies<seq2seq4repair_space>%s" , map ) ; if ( ! ( map . isEmpty ( ) ) ) { final ModelNode result = new ModelNode ( ) ; Object [ ] addr = map . keySet ( ) . toArray ( ) ; for ( int i = 0 ; i < ( addr . length ) ; i ++ ) { InetSocketAddress address = ( ( InetSocketAddress ) ( addr [ i ] ) ) ; result . add ( ( ( ( address . getHostName ( ) ) + ":" ) + ( address . getPort ( ) ) ) ) ; } context . getResult ( ) . set ( result ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( NAME ) ) != null ) ) {
Buggy code:
public class Kjc extends DefaultCompilerAdapter { public boolean execute ( ) throws TaskException { } protected Commandline setupKjcCommand ( ) throws TaskException { Commandline cmd = new Commandline ( ) ; Path classpath = getCompileClasspath ( ) ; if ( ( m_deprecation ) == true ) { cmd . createArgument ( ) . setValue ( "-deprecation" ) ; } if ( ( m_destDir ) != null ) { cmd . createArgument ( ) . setValue ( "-d" ) ; cmd . createArgument ( ) . setFile ( m_destDir ) ; } cmd . createArgument ( ) . setValue ( "-classpath" ) ; Path cp = new Path ( ) ; if ( ( m_bootclasspath ) != null ) { cp . append ( m_bootclasspath ) ; } if ( ( m_extdirs ) != null ) { <START_BUG> cp . addExtdirs ( m_extdirs ) ; <END_BUG> } cp . append ( classpath ) ; cp . append ( src ) ; cmd . createArgument ( ) . setPath ( cp ) ; if ( ( m_encoding ) != null ) { cmd . createArgument ( ) . setValue ( "-encoding" ) ; cmd . createArgument ( ) . setValue ( m_encoding ) ; } if ( m_debug ) { cmd . createArgument ( ) . setValue ( "-g" ) ; } if ( m_optimize ) { cmd . createArgument ( ) . setValue ( "-O2" ) ; } if ( m_verbose ) { cmd . createArgument ( ) . setValue ( "-verbose" ) ; } addCurrentCompilerArgs ( cmd ) ; logAndAddFilesToCompile ( cmd ) ; return cmd ; } }

Fix:
addExtdirs ( cp ) ;
Buggy code:
public class StormSubmitter { public static Logger LOG = Logger . getLogger ( StormSubmitter . class ) ; private static Iface localNimbus = null ; public static void setLocalNimbus ( Nimbus . Iface localNimbusHandler ) { } public static void submitTopology ( String name , Map stormConf , StormTopology topology ) throws AlreadyAliveException , InvalidTopologyException { } private static String submittedJar = null ; private static void submitJar ( Map conf ) { if ( ( StormSubmitter . submittedJar ) == null ) { StormSubmitter . LOG . info ( "Jar<seq2seq4repair_space>not<seq2seq4repair_space>uploaded<seq2seq4repair_space>to<seq2seq4repair_space>master<seq2seq4repair_space>yet.<seq2seq4repair_space>Submitting<seq2seq4repair_space>jar..." ) ; <START_BUG> String localJar = System . getenv ( "STORM_JAR" ) ; <END_BUG> StormSubmitter . submittedJar = StormSubmitter . submitJar ( conf , localJar ) ; } else { StormSubmitter . LOG . info ( "Jar<seq2seq4repair_space>already<seq2seq4repair_space>uploaded<seq2seq4repair_space>to<seq2seq4repair_space>master.<seq2seq4repair_space>Not<seq2seq4repair_space>submitting<seq2seq4repair_space>jar." ) ; } } public static String submitJar ( Map conf , String localJar ) { } }

Fix:
String localJar = System . getProperty ( "storm.jar" ) ;
Buggy code:
@ WebServlet ( name = "PrincipalPrintingServlet" , urlPatterns = { PrincipalPrintingServlet . SERVLET_PATH } ) public class PrincipalPrintingServlet extends HttpServlet { private static final long serialVersionUID = 1L ; public static final String SERVLET_PATH = "//printPrincipal" ; @ Override protected void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { resp . setContentType ( "text//plain" ) ; final PrintWriter writer = resp . getWriter ( ) ; final Principal principal = req . getUserPrincipal ( ) ; if ( null == principal ) { <START_BUG> resp . sendError ( SC_UNAUTHORIZED , "Principal<seq2seq4repair_space>name<seq2seq4repair_space>is<seq2seq4repair_space>printed<seq2seq4repair_space>only<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>authenticated<seq2seq4repair_space>users." ) ; <END_BUG> } else { writer . write ( req . getUserPrincipal ( ) . getName ( ) ) ; } writer . close ( ) ; } }

Fix:
resp . sendError ( SC_FORBIDDEN , "Principal<seq2seq4repair_space>name<seq2seq4repair_space>is<seq2seq4repair_space>printed<seq2seq4repair_space>only<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>authenticated<seq2seq4repair_space>users." ) ;
Buggy code:
public class JGroupsSubsystemRemoveHandler extends AbstractRemoveStepHandler { private final boolean allowRuntimeOnlyRegistration ; JGroupsSubsystemRemoveHandler ( boolean allowRuntimeOnlyRegistration ) { } @ Override protected void performRemove ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { context . removeService ( SERVICE_NAME ) ; String defaultStack = ModelNodes . asString ( DEFAULT_STACK . resolveModelAttribute ( context , model ) ) ; if ( ( defaultStack != null ) && ( ! ( defaultStack . equals ( DEFAULT ) ) ) ) { context . removeService ( ChannelFactoryService . getServiceName ( DEFAULT ) ) ; } String defaultChannel = ModelNodes . asString ( DEFAULT_CHANNEL . resolveModelAttribute ( context , model ) ) ; if ( ( defaultChannel != null ) && ( ! ( defaultChannel . equals ( ChannelService . DEFAULT ) ) ) ) { context . removeService ( ChannelService . getServiceName ( ChannelService . DEFAULT ) ) ; context . removeService ( ConnectedChannelService . getServiceName ( ChannelService . DEFAULT ) ) ; <START_BUG> context . removeService ( ChannelService . getFactoryServiceName ( ChannelService . DEFAULT ) ) ; <END_BUG> for ( GroupServiceInstaller installer : ServiceLoader . load ( ClusteredGroupServiceInstaller . class , ClusteredGroupServiceInstaller . class . getClassLoader ( ) ) ) { for ( ServiceName name : installer . getServiceNames ( ChannelService . DEFAULT ) ) { context . removeService ( name ) ; } } } } @ Override protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } }

Fix:
context . removeService ( ChannelService . getStackServiceName ( ChannelService . DEFAULT ) ) ;
Buggy code:
public class CharSequenceInputStream extends InputStream { private static final int BUFFER_SIZE = 2048 ; private static final int EOS = - 1 ; private static final int NO_MARK = - 1 ; private final CharsetEncoder encoder ; private final CharBuffer cbuf ; private final ByteBuffer bbuf ; private int mark ; public CharSequenceInputStream ( final CharSequence cs , final Charset charset , final int bufferSize ) { } public CharSequenceInputStream ( final CharSequence cs , final String charset , final int bufferSize ) { } public CharSequenceInputStream ( final CharSequence cs , final Charset charset ) { } public CharSequenceInputStream ( final CharSequence cs , final String charset ) { } private void fillBuffer ( ) throws CharacterCodingException { } @ Override public int read ( final byte [ ] b , int off , int len ) throws IOException { } @ Override public int read ( ) throws IOException { } @ Override public int read ( final byte [ ] b ) throws IOException { } @ Override public long skip ( long n ) throws IOException { <START_BUG> int skipped = 0 ; <END_BUG> while ( ( n > 0 ) && ( this . cbuf . hasRemaining ( ) ) ) { this . cbuf . get ( ) ; n -- ; skipped ++ ; } return skipped ; } @ Override public int available ( ) throws IOException { } @ Override public void close ( ) throws IOException { } @ Override public synchronized void mark ( final int readlimit ) { } @ Override public synchronized void reset ( ) throws IOException { } @ Override public boolean markSupported ( ) { } }

Fix:
long skipped = 0 ;
Buggy code:
public abstract class AndPattern extends SearchPattern { public AndPattern ( int patternKind , int matchRule ) { } public void findIndexMatches ( Index index , IndexQueryRequestor requestor , SearchParticipant participant , IJavaSearchScope scope , IProgressMonitor progressMonitor ) throws IOException { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) throw new OperationCanceledException ( ) ; this . resetQuery ( ) ; SimpleSet intersectedNames = null ; try { index . startQuery ( ) ; do { SearchPattern pattern = currentPattern ( ) ; EntryResult [ ] entries = pattern . queryIn ( index ) ; if ( entries == null ) return ; SearchPattern decodedResult = pattern . getBlankPattern ( ) ; <START_BUG> SimpleSet newIntersectedNames = new SimpleSet ( ) ; <END_BUG> for ( int i = 0 , l = entries . length ; i < l ; i ++ ) { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) throw new OperationCanceledException ( ) ; EntryResult entry = entries [ i ] ; decodedResult . decodeIndexKey ( entry . getWord ( ) ) ; if ( pattern . matchesDecodedKey ( decodedResult ) ) { String [ ] names = entry . getDocumentNames ( index ) ; if ( intersectedNames != null ) { for ( int j = 0 , n = names . length ; j < n ; j ++ ) if ( intersectedNames . includes ( names [ j ] ) ) newIntersectedNames . add ( names [ j ] ) ; } else { for ( int j = 0 , n = names . length ; j < n ; j ++ ) newIntersectedNames . add ( names [ j ] ) ; } } } if ( ( newIntersectedNames . elementSize ) == 0 ) return ; intersectedNames = newIntersectedNames ; } while ( this . hasNextQuery ( ) ) ; } finally { index . stopQuery ( ) ; } if ( intersectedNames == null ) return ; Object [ ] names = intersectedNames . values ; for ( int i = 0 , l = names . length ; i < l ; i ++ ) if ( ( names [ i ] ) != null ) acceptMatch ( ( ( String ) ( names [ i ] ) ) , null , requestor , participant , scope ) ; } protected abstract boolean hasNextQuery ( ) { } protected abstract void resetQuery ( ) { } }

Fix:
SimpleSet newIntersectedNames = new SimpleSet ( 3 ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) { <START_BUG> if ( ( args . length ( ) ) < 2 ) { <END_BUG> System . out . println ( "Usage:<seq2seq4repair_space>java<seq2seq4repair_space>MusicTransposer<seq2seq4repair_space>music.xml<seq2seq4repair_space>key" ) ; } MusicFile music = new MusicFile ( args [ 0 ] ) ; muaic . transposeTo ( KEY . getKeyByNote ( NOTE . getNoteByNote ( args [ 1 ] . charAt ( 0 ) ) ) ) ; } No newline ; at end ; of file ; }

Fix:
if ( ( args . length ) < 2 ) {
Buggy code:
public abstract class Continuus extends Task { private static final String CCM_EXE = "ccm" ; public static final String COMMAND_CREATE_TASK = "create_task" ; public static final String COMMAND_CHECKOUT = "co" ; public static final String COMMAND_CHECKIN = "ci" ; public static final String COMMAND_RECONFIGURE = "reconfigure" ; public static final String COMMAND_DEFAULT_TASK = "default_task" ; private String _ccmDir = "" ; private String _ccmAction = "" ; public final void setCcmDir ( String dir ) { <START_BUG> _ccmDir = project . translatePath ( dir ) ; <END_BUG> } public void setCcmAction ( String v ) { } public String getCcmAction ( ) { } protected final String getCcmCommand ( ) { } protected int run ( Commandline cmd , ExecuteStreamHandler handler ) throws TaskException { } protected int run ( Commandline cmd ) throws TaskException { } }

Fix:
_ccmDir = getProject ( ) . translatePath ( dir ) ;
Buggy code:
public class ConcurrentQueryCache extends AbstractQueryCache implements RemoteCommitListener { private CacheMap _cache = newCacheMap ( ) ; public CacheMap getCacheMap ( ) { } public int getCacheSize ( ) { } public void setCacheSize ( int size ) { } public int getSoftReferenceSize ( ) { } public void setSoftReferenceSize ( int size ) { } public void initialize ( DataCacheManager mgr ) { super . initialize ( mgr ) ; <START_BUG> conf . getRemoteCommitEventManager ( ) . addListener ( this ) ; <END_BUG> } public void writeLock ( ) { } public void writeUnlock ( ) { } protected CacheMap newCacheMap ( ) { } protected QueryResult getInternal ( QueryKey qk ) { } protected QueryResult putInternal ( QueryKey qk , QueryResult result ) { } protected QueryResult removeInternal ( QueryKey qk ) { } protected void clearInternal ( ) { } protected boolean pinInternal ( QueryKey qk ) { } protected boolean unpinInternal ( QueryKey qk ) { } protected Collection keySet ( ) { } }

Fix:
conf . getRemoteCommitEventManager ( ) . addInternalListener ( this ) ;
Buggy code:
public class CtsJavaScannerDoclet extends Doclet { private static final String JUNIT4_TEST_ANNOTATION = "org.junit.Test" ; static final String JUNIT_TEST_CASE_CLASS_NAME = "junit.framework.testcase" ; public static boolean start ( RootDoc root ) { ClassDoc [ ] classes = root . classes ( ) ; if ( classes == null ) { return false ; } PrintWriter writer = new PrintWriter ( System . out ) ; for ( ClassDoc clazz : classes ) { if ( clazz . isAbstract ( ) ) { continue ; } final boolean isJUnit3 = CtsJavaScannerDoclet . isJUnit3TestCase ( clazz ) ; if ( ( ! isJUnit3 ) && ( ! ( CtsJavaScannerDoclet . isJUnit4TestClass ( clazz ) ) ) ) { continue ; } writer . append ( "suite:" ) . println ( clazz . containingPackage ( ) . name ( ) ) ; writer . append ( "case:" ) . println ( clazz . name ( ) ) ; for ( ; clazz != null ; clazz = clazz . superclass ( ) ) { for ( MethodDoc method : clazz . methods ( ) ) { int timeout = - 1 ; if ( isJUnit3 ) { if ( ! ( method . name ( ) . startsWith ( "test" ) ) ) { continue ; } AnnotationDesc [ ] annotations = method . annotations ( ) ; for ( AnnotationDesc annot : annotations ) { String atype = annot . annotationType ( ) . toString ( ) ; <START_BUG> if ( atype . equals ( "android.cts.util.TimeoutReq" ) ) { <END_BUG> ElementValuePair [ ] cpairs = annot . elementValues ( ) ; for ( ElementValuePair pair : cpairs ) { AnnotationTypeElementDoc elem = pair . element ( ) ; AnnotationValue value = pair . value ( ) ; if ( elem . name ( ) . equals ( "minutes" ) ) { timeout = ( ( Integer ) ( value . value ( ) ) ) ; } } } } } else { boolean isTest = false ; for ( AnnotationDesc annot : method . annotations ( ) ) { if ( annot . annotationType ( ) . toString ( ) . equals ( CtsJavaScannerDoclet . JUNIT4_TEST_ANNOTATION ) ) { isTest = true ; for ( ElementValuePair pair : annot . elementValues ( ) ) { if ( pair . element ( ) . name ( ) . equals ( "timeout" ) ) { timeout = ( ( int ) ( ( ( Long ) ( pair . value ( ) . value ( ) ) ) // 60000L ) ) ; } } } } if ( ! isTest ) { continue ; } } writer . append ( "test:" ) ; if ( timeout >= 0 ) { writer . append ( method . name ( ) ) . println ( ( ":" + timeout ) ) ; } else { writer . println ( method . name ( ) ) ; } } } } writer . close ( ) ; return true ; } private static boolean isJUnit3TestCase ( ClassDoc clazz ) { } private static boolean isJUnit4TestClass ( ClassDoc clazz ) { } }

Fix:
if ( atype . equals ( "com.android.cts.util.TimeoutReq" ) ) {
Buggy code:
public abstract class OperatorExpression extends Expression implements OperatorIds { public static int [ ] [ ] OperatorSignatures = new int [ OperatorIds . NumberOfTables ] [ ] ; public OperatorExpression ( ) { } public static final void classInitialize ( ) { } public static final String generateTableTestCase ( ) { } public static final int [ ] get_AND ( ) { } public static final int [ ] get_AND_AND ( ) { } public static final int [ ] get_DIVIDE ( ) { } public static final int [ ] get_EQUAL_EQUAL ( ) { } public static final int [ ] get_GREATER ( ) { } public static final int [ ] get_GREATER_EQUAL ( ) { } public static final int [ ] get_LEFT_SHIFT ( ) { } public static final int [ ] get_LESS ( ) { } public static final int [ ] get_LESS_EQUAL ( ) { } public static final int [ ] get_MINUS ( ) { } public static final int [ ] get_MULTIPLY ( ) { } public static final int [ ] get_OR ( ) { } public static final int [ ] get_OR_OR ( ) { } public static final int [ ] get_PLUS ( ) { } public static final int [ ] get_REMAINDER ( ) { } public static final int [ ] get_RIGHT_SHIFT ( ) { } public static final int [ ] get_UNSIGNED_RIGHT_SHIFT ( ) { } public static final int [ ] get_XOR ( ) { } public String operatorToString ( ) { } public int nullStatus ( FlowInfo flowInfo ) { <START_BUG> return FlowInfo . UNKNOWN ; <END_BUG> } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public abstract StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } }

Fix:
return FlowInfo . NON_NULL ;
Buggy code:
public class DetailActivity extends AppCompatActivity implements DetailFragment . CallBack { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_detail ) ; if ( savedInstanceState == null ) { Bundle args = new Bundle ( ) ; args . putParcelable ( DETAIL_URI , getIntent ( ) . getData ( ) ) ; DetailFragment fragment = new DetailFragment ( ) ; fragment . setArguments ( args ) ; <START_BUG> getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( movie_detail_container , new DetailFragment ( ) ) . commit ( ) ; <END_BUG> } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( movie_detail_container , fragment ) . commit ( ) ;
Buggy code:
public class MockHttpApplicationTest extends TestCase { private MockHttpApplication application ; public MockHttpApplicationTest ( String name ) { } protected void setUp ( ) throws Exception { } public void testRenderHomePage ( ) throws Exception { } public void testClickLink ( ) throws Exception { } private boolean validateDocument ( String document , int expectedLinkClickCount ) { HtmlDocumentValidator validator = new HtmlDocumentValidator ( ) ; Tag html = new Tag ( "html" ) ; Tag head = new Tag ( "head" ) ; html . addExpectedChild ( head ) ; Tag title = new Tag ( "title" ) ; head . addExpectedChild ( title ) ; title . addExpectedChild ( new TextContent ( "Mock<seq2seq4repair_space>Page" ) ) ; Tag body = new Tag ( "body" ) ; html . addExpectedChild ( body ) ; Tag a = new Tag ( "a" ) ; <START_BUG> a . addExpectedAttribute ( "href" , "//MockHttpApplication//MockHttpApplication\\?component=[0-9]*.actionLink&rendering=[0-9]*&interface=ILinkListener" ) ; <END_BUG> a . addExpectedAttribute ( "id" , "actionLink" ) ; body . addExpectedChild ( a ) ; a . addExpectedChild ( new TextContent ( "Action<seq2seq4repair_space>link<seq2seq4repair_space>clicked<seq2seq4repair_space>" ) ) ; Tag span = new Tag ( "span" ) ; span . addExpectedChild ( new TextContent ( ( "" + expectedLinkClickCount ) ) ) ; a . addExpectedChild ( span ) ; a . addExpectedChild ( new TextContent ( "<seq2seq4repair_space>times" ) ) ; validator . addRootElement ( html ) ; return validator . isDocumentValid ( document ) ; } }

Fix:
a . addExpectedAttribute ( "href" , "//MockHttpApplication//MockHttpApplication\\?component=[0-9]*.actionLink&amp;rendering=[0-9]*&amp;interface=ILinkListener" ) ;
Buggy code:
public class SearchEngine { public static IJavaSearchScope createHierarchyScope ( IType type ) throws JavaModelException { } public static IJavaSearchScope createJavaSearchScope ( IResource [ ] resources ) { } public static IJavaSearchScope createJavaSearchScope ( IJavaElement [ ] elements ) { } public static IJavaSearchScope createJavaSearchScope ( IJavaElement [ ] elements , boolean includeReferencedProjects ) { JavaSearchScope scope = new JavaSearchScope ( ) ; <START_BUG> Hashtable visitedProjects = new Hashtable ( 2 ) ; <END_BUG> for ( int i = 0 , length = elements . length ; i < length ; i ++ ) { IJavaElement element = elements [ i ] ; if ( element != null ) { try { if ( element instanceof IJavaProject ) { scope . add ( ( ( IJavaProject ) ( element ) ) , includeReferencedProjects , visitedProjects ) ; } else { scope . add ( element ) ; } } catch ( JavaModelException e ) { } } } return scope ; } public static ISearchPattern createOrSearchPattern ( ISearchPattern leftPattern , ISearchPattern rightPattern ) { } public static ISearchPattern createSearchPattern ( String stringPattern , int searchFor , int limitTo , boolean isCaseSensitive ) { } public static ISearchPattern createSearchPattern ( IJavaElement element , int limitTo ) { } public static IJavaSearchScope createWorkspaceScope ( ) { } public void search ( IWorkspace workspace , String patternString , int searchFor , int limitTo , IJavaSearchScope scope , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void search ( IWorkspace workspace , IJavaElement element , int limitTo , IJavaSearchScope scope , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void search ( IWorkspace workspace , ISearchPattern searchPattern , IJavaSearchScope scope , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void searchAllTypeNames ( IWorkspace workspace , char [ ] packageName , char [ ] typeName , int matchMode , boolean isCaseSensitive , int searchFor , IJavaSearchScope scope , final ITypeNameRequestor nameRequestor , int waitingPolicy , IProgressMonitor progressMonitor ) throws JavaModelException { } public void searchDeclarationsOfAccessedFields ( IWorkspace workspace , IJavaElement enclosingElement , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void searchDeclarationsOfReferencedTypes ( IWorkspace workspace , IJavaElement enclosingElement , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void searchDeclarationsOfSentMessages ( IWorkspace workspace , IJavaElement enclosingElement , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } }

Fix:
HashSet visitedProjects = new HashSet ( 2 ) ;
Buggy code:
public class GridNode implements IndexedNode < GridNode > { public Array < Connection < GridNode > > neighbours ; private GridGraph graph ; public final int x ; public final int y ; private int index ; int [ ] xOff = new int [ ] { - 1 , 0 , 1 , 1 , 1 , 0 , - 1 , - 1 } ; int [ ] yOff = new int [ ] { - 1 , - 1 , - 1 , 0 , 1 , 1 , 1 , 0 } ; public GridNode ( GridGraph graph , int x , int y , int index ) { } @ Override public int getIndex ( ) { } @ Override public Array < Connection < GridNode > > getConnections ( ) { if ( ( neighbours ) == null ) { neighbours = new Array ( 8 ) ; for ( int dir = 0 ; dir <= 7 ; dir ++ ) { final int xx = ( x ) + ( xOff [ dir ] ) ; final int yy = ( y ) + ( yOff [ dir ] ) ; if ( ( ( ( ( xx >= 0 ) && ( yy >= 0 ) ) && ( xx < ( graph . width ) ) ) && ( yy < ( graph . height ) ) ) && ( ( graph . nodes [ yy ] [ xx ] ) != null ) ) <START_BUG> neighbours . add ( new GridConnection < GridNode > ( this , graph . nodes [ yy ] [ xx ] , ( ( ( xOff [ dir ] ) == 0 ) || ( ( yOff [ dir ] ) == 0 ) ? 1.0F : 1.414F ) ) ) ; <END_BUG> } } return neighbours ; } }

Fix:
neighbours . add ( new GridConnection < GridNode > ( this , graph . nodes [ yy ] [ xx ] , ( ( ( ( xOff [ dir ] ) == 0 ) || ( ( yOff [ dir ] ) == 0 ) ? 1.0F : 1.414F ) * 10.0F ) ) ) ;
Buggy code:
public abstract class IntersectingPattern extends JavaSearchPattern { public IntersectingPattern ( int patternKind , int matchRule ) { } public void findIndexMatches ( Index index , IndexQueryRequestor requestor , SearchParticipant participant , IJavaSearchScope scope , IProgressMonitor progressMonitor ) throws IOException { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) throw new OperationCanceledException ( ) ; resetQuery ( ) ; SimpleSet intersectedNames = null ; try { index . startQuery ( ) ; do { SearchPattern pattern = currentPattern ( ) ; EntryResult [ ] entries = pattern . queryIn ( index ) ; if ( entries == null ) return ; SearchPattern decodedResult = pattern . getBlankPattern ( ) ; SimpleSet newIntersectedNames = new SimpleSet ( 3 ) ; for ( int i = 0 , l = entries . length ; i < l ; i ++ ) { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) throw new OperationCanceledException ( ) ; EntryResult entry = entries [ i ] ; decodedResult . decodeIndexKey ( entry . getWord ( ) ) ; if ( pattern . matchesDecodedKey ( decodedResult ) ) { String [ ] names = entry . getDocumentNames ( index ) ; if ( intersectedNames != null ) { for ( int j = 0 , n = names . length ; j < n ; j ++ ) if ( intersectedNames . includes ( names [ j ] ) ) newIntersectedNames . add ( names [ j ] ) ; } else { for ( int j = 0 , n = names . length ; j < n ; j ++ ) newIntersectedNames . add ( names [ j ] ) ; } } } if ( ( newIntersectedNames . elementSize ) == 0 ) return ; intersectedNames = newIntersectedNames ; } while ( hasNextQuery ( ) ) ; } finally { index . stopQuery ( ) ; } String containerPath = index . containerPath ; char separator = index . separator ; Object [ ] names = intersectedNames . values ; for ( int i = 0 , l = names . length ; i < l ; i ++ ) if ( ( names [ i ] ) != null ) <START_BUG> acceptMatch ( ( ( String ) ( names [ i ] ) ) , containerPath , separator , null , requestor , participant , scope ) ; <END_BUG> } protected abstract boolean hasNextQuery ( ) { } protected abstract void resetQuery ( ) { } }

Fix:
acceptMatch ( ( ( String ) ( names [ i ] ) ) , containerPath , separator , null , requestor , participant , scope , progressMonitor ) ;
Buggy code:
public class SocketListenerTask implements Runnable { private Thread baseThread ; private volatile boolean isThreadAllowedToRun ; private volatile Socket clientSocket ; private Scanner inputStream ; private boolean hasHistoryResponseBeenReceived = false ; private Queue < String > incomingTokenQueue = new LinkedList < > ( ) ; public SocketListenerTask ( Socket clientSocket ) { } public void StartThread ( ) { } public void TerminateThread ( ) { } @ Override public void run ( ) { } private void handleIncomingTokens ( String inputToken ) { <START_BUG> if ( ( this . hasHistoryResponseBeenReceived ) == false ) { <END_BUG> this . incomingTokenQueue . offer ( inputToken ) ; } else if ( this . incomingTokenQueue . isEmpty ( ) ) { this . deserializeAndReactSpecificTo ( inputToken ) ; } else { while ( ( this . incomingTokenQueue . isEmpty ( ) ) == false ) { this . deserializeAndReactSpecificTo ( this . incomingTokenQueue . poll ( ) ) ; } } } private void deserializeAndReactSpecificTo ( String token ) { } }

Fix:
if ( ( RegisterAndLoginDialog . isMessageHistoryRequested ( ) ) && ( ( this . hasHistoryResponseBeenReceived ) == false ) ) {
Buggy code:
public class MappingJackson2JsonView extends AbstractView { public static final String DEFAULT_CONTENT_TYPE = "application//json" ; private ObjectMapper objectMapper = new ObjectMapper ( ) ; private JsonEncoding encoding = JsonEncoding . UTF8 ; private String jsonPrefix ; private Boolean prettyPrint ; private Set < String > modelKeys ; private boolean extractValueFromSingleKeyModel = false ; private boolean disableCaching = true ; private boolean updateContentLength = false ; public MappingJackson2JsonView ( ) { } public void setObjectMapper ( ObjectMapper objectMapper ) { } public final ObjectMapper getObjectMapper ( ) { } public void setEncoding ( JsonEncoding encoding ) { } public final JsonEncoding getEncoding ( ) { } public void setJsonPrefix ( String jsonPrefix ) { } public void setPrefixJson ( boolean prefixJson ) { <START_BUG> this . jsonPrefix = ( prefixJson ) ? "{}<seq2seq4repair_space>&&<seq2seq4repair_space>" : "" ; <END_BUG> } public void setPrettyPrint ( boolean prettyPrint ) { } private void configurePrettyPrint ( ) { } public void setModelKey ( String modelKey ) { } public void setModelKeys ( Set < String > modelKeys ) { } public final Set < String > getModelKeys ( ) { } @ Deprecated public void setRenderedAttributes ( Set < String > renderedAttributes ) { } @ Deprecated public final Set < String > getRenderedAttributes ( ) { } public void setExtractValueFromSingleKeyModel ( boolean extractValueFromSingleKeyModel ) { } public void setDisableCaching ( boolean disableCaching ) { } public void setUpdateContentLength ( boolean updateContentLength ) { } @ Override protected void prepareResponse ( HttpServletRequest request , HttpServletResponse response ) { } @ Override protected void renderMergedOutputModel ( Map < String , Object > model , HttpServletRequest request , HttpServletResponse response ) throws Exception { } protected Object filterModel ( Map < String , Object > model ) { } protected void writeContent ( OutputStream stream , Object value , String jsonPrefix ) throws IOException { } }

Fix:
this . jsonPrefix = ( prefixJson ) ? "{}<seq2seq4repair_space>&&<seq2seq4repair_space>" : null ;
Buggy code:
public class CopySuppFiles { public static void main ( String [ ] args ) throws Exception { } public static void copyFiles ( File outDir , String suppFiles ) throws IOException , ClassNotFoundException { StringTokenizer st = new StringTokenizer ( suppFiles , "," ) ; String scriptName = "" ; InputStream is = null ; while ( st . hasMoreTokens ( ) ) { scriptName = st . nextToken ( ) ; File suppFile = null ; String fileName = "" ; is = RunTest . loadTestResource ( scriptName ) ; if ( is == null ) System . out . println ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>locate:<seq2seq4repair_space>" + scriptName ) ) ; else { int index = scriptName . lastIndexOf ( '//' ) ; fileName = scriptName . substring ( ( index + 1 ) ) ; try { suppFile = new File ( new File ( outDir , fileName ) . getCanonicalPath ( ) ) ; } catch ( IOException e ) { File f = new File ( outDir , fileName ) ; FileWriter fw = new FileWriter ( f ) ; fw . close ( ) ; suppFile = new File ( f . getCanonicalPath ( ) ) ; } <START_BUG> if ( ( ( ( fileName . indexOf ( "sql" ) ) > 0 ) || ( ( fileName . indexOf ( "txt" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".view" ) ) > 0 ) ) { <END_BUG> BufferedReader inFile = new BufferedReader ( new InputStreamReader ( is , "UTF-8" ) ) ; PrintWriter pw = new PrintWriter ( new BufferedWriter ( new FileWriter ( suppFile ) , 10000 ) , true ) ; int c ; while ( ( c = inFile . read ( ) ) != ( - 1 ) ) pw . write ( c ) ; pw . flush ( ) ; pw . close ( ) ; } else { FileOutputStream fos = new FileOutputStream ( suppFile ) ; byte [ ] data = new byte [ 4096 ] ; int len ; while ( ( len = is . read ( data ) ) != ( - 1 ) ) { fos . write ( data , 0 , len ) ; } fos . close ( ) ; } } } } }

Fix:
if ( ( ( ( ( ( fileName . indexOf ( "sql" ) ) > 0 ) || ( ( fileName . indexOf ( "txt" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".view" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".multi" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".properties" ) ) > 0 ) ) {
Buggy code:
public final class DefaultPageFactory implements IPageFactory { private static final Log log = LogFactory . getLog ( DefaultPageFactory . class ) ; private final Map constructorForClass = new ConcurrentHashMap ( ) ; public final Page newPage ( final Class pageClass ) { try { <START_BUG> pageClass . getConstructor ( null ) ; <END_BUG> return ( ( Page ) ( pageClass . newInstance ( ) ) ) ; } catch ( NoSuchMethodException e ) { throw new WicketRuntimeException ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>page<seq2seq4repair_space>from<seq2seq4repair_space>" + pageClass ) + ".<seq2seq4repair_space>Class<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>default<seq2seq4repair_space>contructor" ) , e ) ; } catch ( InstantiationException e ) { throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>page<seq2seq4repair_space>from<seq2seq4repair_space>" + pageClass ) , e ) ; } catch ( IllegalAccessException e ) { throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>page<seq2seq4repair_space>from<seq2seq4repair_space>" + pageClass ) , e ) ; } } public final Page newPage ( final Class pageClass , final PageParameters parameters ) { } private final Constructor constructor ( final Class pageClass , final Class argumentType ) { } private final Page newPage ( final Constructor constructor , final Object argument ) { } }

Fix:
pageClass . getConstructor ( ( ( Class [ ] ) ( null ) ) ) ;
Buggy code:
public class TestPredicatedBag < T > extends AbstractTestBag < T > { public TestPredicatedBag ( String testName ) { } protected Predicate < T > stringPredicate ( ) { } protected Predicate < T > truePredicate = org . apache . commons . collections . functors . TruePredicate . < T > truePredicate ( ) ; protected Bag < T > decorateBag ( HashBag < T > bag , Predicate < T > predicate ) { <START_BUG> return PredicatedBag . decorate ( bag , predicate ) ; <END_BUG> } @ Override public Bag < T > makeObject ( ) { } protected Bag < T > makeTestBag ( ) { } @ SuppressWarnings ( "unchecked" ) public void testlegalAddRemove ( ) { } @ SuppressWarnings ( "unchecked" ) public void testIllegalAdd ( ) { } @ SuppressWarnings ( "unchecked" ) public void testIllegalDecorate ( ) { } @ Override public String getCompatibilityVersion ( ) { } }

Fix:
return PredicatedBag . predicatedBag ( bag , predicate ) ;
Buggy code:
public class Subscriber { private static final Logger LOG = Logger . getLogger ( Subscriber . class ) ; private static final String QUEUE_NAME = "hello_rabbit_mq2" ; public static void main ( String [ ] args ) throws IOException , InterruptedException { ConnectionFactory factory = new ConnectionFactory ( ) ; factory . setHost ( "localhost" ) ; Connection connection = factory . newConnection ( ) ; Channel channel = ( ( Channel ) ( connection . createChannel ( ) ) ) ; channel . queueDeclare ( Subscriber . QUEUE_NAME , false , false , false , null ) ; Subscriber . LOG . debug ( "<seq2seq4repair_space>[+]<seq2seq4repair_space>Waiting<seq2seq4repair_space>for<seq2seq4repair_space>messages.<seq2seq4repair_space>To<seq2seq4repair_space>exit<seq2seq4repair_space>press<seq2seq4repair_space>CTRL<seq2seq4repair_space>+<seq2seq4repair_space>C" ) ; QueueingConsumer consumer = new QueueingConsumer ( channel ) ; channel . basicConsume ( Subscriber . QUEUE_NAME , true , consumer ) ; while ( true ) { QueueingConsumer . Delivery delivery = consumer . nextDelivery ( ) ; <START_BUG> String message = new String ( delivery . getBody ( ) ) ; <END_BUG> Subscriber . LOG . debug ( ( ( "<seq2seq4repair_space>[x]<seq2seq4repair_space>Received<seq2seq4repair_space>'" + message ) + "'" ) ) ; } } }

Fix:
String message = new String ( delivery . getBody ( ) , "UTF-8" ) ;
Buggy code:
public class HostResolver { private static final String RESOURCE_NAME = ( HostResolver . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; public static ResourceDescriptionResolver getResolver ( final String keyPrefix ) { } public static ResourceDescriptionResolver getResolver ( final String keyPrefix , final boolean useUnprefixedChildTypes ) { <START_BUG> return new StandardResourceDescriptionResolver ( keyPrefix , HostResolver . RESOURCE_NAME , HostEnvironmentResourceDescription . class . getClassLoader ( ) , true , useUnprefixedChildTypes ) ; <END_BUG> } }

Fix:
return new StandardResourceDescriptionResolver ( keyPrefix , HostResolver . RESOURCE_NAME , HostEnvironmentResourceDefinition . class . getClassLoader ( ) , true , useUnprefixedChildTypes ) ;
Buggy code:
public class ThreadFactoryWriteAttributeHandler extends ThreadsWriteAttributeOperationHandler { public static final ThreadFactoryWriteAttributeHandler INSTANCE = new ThreadFactoryWriteAttributeHandler ( ) ; private ThreadFactoryWriteAttributeHandler ( ) { } @ Override protected ServiceController < ? > getService ( final OperationContext context , final ModelNode model ) throws OperationFailedException { } @ Override protected void applyOperation ( final OperationContext context , ModelNode operation , String attributeName , ServiceController < ? > service , boolean forRollback ) throws OperationFailedException { final ThreadFactoryService tf = ( ( ThreadFactoryService ) ( service . getService ( ) ) ) ; if ( GROUP_NAME . equals ( attributeName ) ) { final ModelNode value = PoolAttributeDefinitions . GROUP_NAME . resolveModelAttribute ( context , operation ) ; tf . setThreadGroupName ( ( value . isDefined ( ) ? value . asString ( ) : null ) ) ; } else if ( PRIORITY . equals ( attributeName ) ) { final ModelNode value = PoolAttributeDefinitions . PRIORITY . resolveModelAttribute ( context , operation ) ; <START_BUG> tf . setPriority ( ( value . isDefined ( ) ? value . asInt ( ) : - 1 ) ) ; <END_BUG> } else if ( THREAD_NAME_PATTERN . equals ( attributeName ) ) { final ModelNode value = PoolAttributeDefinitions . THREAD_NAME_PATTERN . resolveModelAttribute ( context , operation ) ; tf . setNamePattern ( ( value . isDefined ( ) ? value . asString ( ) : null ) ) ; } else if ( ! forRollback ) { throw MESSAGES . unsupportedThreadFactoryAttribute ( attributeName ) ; } } }

Fix:
tf . setPriority ( ( value . isDefined ( ) ? new Integer ( value . asInt ( ) ) : null ) ) ;
Buggy code:
public class SqlTools { public static final Logger logger = LoggerFactory . getLogger ( SqlTools . class ) ; public static Connection openConnection ( String connString ) throws SQLException { <START_BUG> Connection conn = DriverManager . getConnection ( "jdbc:h2:mem:test" ) ; <END_BUG> return conn ; } public static void close ( Connection conn ) { } public static void execSql ( Connection conn , String sql ) throws SQLException { } public static int cint ( String s ) { } public static String asDate ( Date d ) { } public static String asDateTime ( Date d ) { } public static String gtData ( String stFormato , Date dtData ) { } public static final String SQL_DATE = "yyyy-MM-dd" ; public static final String SQL_DATETIME = "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss" ; public static String qq ( String s ) { } public static String quoteFieldName ( String s ) { } private static String pvtQuoteString ( StringBuilder sb , String s , String prefix , String postfix ) { } public static void addListToStringBuilder ( StringBuilder sb , Collection < String > lS , String separator , String emptyCase ) { } public static String quoteInEnum ( List < ? extends Enum > clauses , String emptyList ) { } public static String quoteInClause ( List < String > clauses , String emptyList ) { } public static List < String > quoteList ( List < String > values , String emptyCase ) { } }

Fix:
Connection conn = DriverManager . getConnection ( connString ) ;