nus-yam/ex-repair huggingface dataset:
Buggy code:
@ RunWith ( Arquillian . class ) public class RemoteLocalCallTestCase { private static final Logger log = Logger . getLogger ( RemoteLocalCallTestCase . class ) ; public static final String ARCHIVE_NAME_CLIENT = "remotelocalcall-test-client" ; public static final String ARCHIVE_NAME_SERVER = "remotelocalcall-test-server" ; @ BeforeClass public static void printSysProps ( ) { } @ Deployment ( name = "server" ) @ TargetsContainer ( "multinode-server" ) public static Archive < ? > deployment0 ( ) { } @ Deployment ( name = "client" ) @ TargetsContainer ( "multinode-client" ) public static Archive < ? > deployment1 ( ) { JavaArchive jar = RemoteLocalCallTestCase . createJar ( RemoteLocalCallTestCase . ARCHIVE_NAME_CLIENT ) ; jar . addClasses ( RemoteLocalCallTestCase . class ) ; <START_BUG> jar . addAsManifestResource ( "META-INF//jboss-ejb-client.xml" , "jboss-ejb-client.xml" ) ; <END_BUG> return jar ; } private static JavaArchive createJar ( String archiveName ) { } @ Test @ OperateOnDeployment ( "client" ) public void testStatelessLocalFromRemote ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatelessLocalHomeFromRemoteHome ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatelessRemoteFromRemote ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatelessRemoteHomeFromRemoteHome ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatefulRemoteFromRemote ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatefulRemoteHomeFromRemoteHome ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatefulLocalFromRemote ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatefulLocalHomeFromRemoteHome ( @ ArquillianResource InitialContext ctx ) throws Exception { } }

Fix:
jar . addAsManifestResource ( "META-INF//jboss-ejb-client-receivers.xml" , "jboss-ejb-client.xml" ) ;
Buggy code:
@ SuppressWarnings ( { "rawtypes" , "unchecked" , "deprecation" } ) public class JasperReportsResult extends StrutsResultSupport implements JasperReportConstants { private static final long serialVersionUID = - 2523174799621182907L ; private static final Logger LOG = LoggerFactory . getLogger ( JasperReportsResult . class ) ; protected String dataSource ; protected String format ; protected String documentName ; protected String contentDisposition ; protected String delimiter ; protected String imageServletUrl = "//images//" ; protected String timeZone ; protected boolean wrapField = true ; protected String connection ; protected String reportParameters ; protected String exportParameters ; public JasperReportsResult ( ) { } public JasperReportsResult ( String location ) { } public String getImageServletUrl ( ) { } public void setImageServletUrl ( final String imageServletUrl ) { } public void setDataSource ( String dataSource ) { } public void setFormat ( String format ) { } public void setDocumentName ( String documentName ) { } public void setContentDisposition ( String contentDisposition ) { } public void setDelimiter ( String delimiter ) { } public void setTimeZone ( final String timeZone ) { } public void setWrapField ( boolean wrapField ) { } public String getReportParameters ( ) { } public void setReportParameters ( String reportParameters ) { } public String getExportParameters ( ) { } public void setExportParameters ( String exportParameters ) { } public String getConnection ( ) { } public void setConnection ( String connection ) { } protected void doExecute ( String finalLocation , ActionInvocation invocation ) throws Exception { } private void writeReport ( HttpServletResponse response , byte [ ] output ) throws ServletException { } private void initializeProperties ( ActionInvocation invocation ) throws Exception { if ( ( ( dataSource ) == null ) && ( ( connection ) == null ) ) { String message = "No<seq2seq4repair_space>dataSource<seq2seq4repair_space>specified..." ; <START_BUG> JasperReportsResult . LOG . error ( message ) ; <END_BUG> throw new RuntimeException ( message ) ; } if ( ( dataSource ) != null ) dataSource = conditionalParse ( dataSource , invocation ) ; format = conditionalParse ( format , invocation ) ; if ( StringUtils . isEmpty ( format ) ) { format = FORMAT_PDF ; } if ( ( contentDisposition ) != null ) { contentDisposition = conditionalParse ( contentDisposition , invocation ) ; } if ( ( documentName ) != null ) { documentName = conditionalParse ( documentName , invocation ) ; } reportParameters = conditionalParse ( reportParameters , invocation ) ; exportParameters = conditionalParse ( exportParameters , invocation ) ; } private byte [ ] exportReportToBytes ( JasperPrint jasperPrint , JRExporter exporter ) throws JRException { } }

Fix:
JasperReportsResult . LOG . error ( message , new Object [ 0 ] ) ;
Buggy code:
public class FetchManifest extends AbstractCurationTask { private String archFmt = ConfigurationManager . getProperty ( "replicate" , "packer.archfmt" ) ; private final String manifestGroupName = ConfigurationManager . getProperty ( "replicate" , "group.manifest.name" ) ; @ Override public int perform ( DSpaceObject dso ) throws IOException { ReplicaManager repMan = ReplicaManager . instance ( ) ; <START_BUG> String objId = repMan . storageId ( dso . getHandle ( ) , null ) ; <END_BUG> File archive = repMan . fetchObject ( manifestGroupName , objId ) ; boolean found = archive != null ; setResult ( ( ( ( "Manifest<seq2seq4repair_space>for<seq2seq4repair_space>object:<seq2seq4repair_space>" + ( dso . getHandle ( ) ) ) + "<seq2seq4repair_space>found:<seq2seq4repair_space>" ) + found ) ) ; return found ? Curator . CURATE_SUCCESS : Curator . CURATE_FAIL ; } }

Fix:
String objId = repMan . storageId ( dso . getHandle ( ) , MANIFEST_EXTENSION ) ;
Buggy code:
public class SubspaceClientTest { @ Test public final void testConstructor ( ) { } @ Test public final void testBehavior ( ) { final String serviceUrl = "http:////localhost:8082//c3grid" ; ApplicationContext context = new ClassPathXmlApplicationContext ( "classpath:META-INF//client-context.xml" ) ; SubspaceClient subspaceClient = ( ( SubspaceClient ) ( context . getAutowireCapableBeanFactory ( ) . createBean ( SubspaceClient . class , AUTOWIRE_BY_TYPE , true ) ) ) ; subspaceClient . setServiceURL ( serviceUrl ) ; String dn = "dn" ; String subspace = "sub" ; String path = "//var//tmp//GNDMS//dspace//" ; String gsiftp = "gsiftp" ; boolean visible = true ; final long value = 6000 ; String mode = "CREATE" ; <START_BUG> SubspaceConfiguration config = new SubspaceConfiguration ( path , gsiftp , visible , value , mode ) ; <END_BUG> config . setSubspace ( new ImmutableScopedName ( "scope" , subspace ) ) ; subspaceClient . createSubspace ( subspace , config , dn ) ; } }

Fix:
SubspaceConfiguration config = new SubspaceConfiguration ( path , gsiftp , visible , value , mode , subspace ) ;
Buggy code:
public class FilterWithCustomIntent extends Filter { public ComponentName customTaskList = null ; public Bundle customExtras = null ; protected FilterWithCustomIntent ( ) { } public FilterWithCustomIntent ( String listingTitle , String title , QueryTemplate sqlQuery , ContentValues valuesForNewTasks ) { } public FilterWithCustomIntent ( String listingTitle , String title , String sqlQuery , ContentValues valuesForNewTasks ) { } public Intent getCustomIntent ( ) { Intent intent = new Intent ( ) ; intent . putExtra ( "filter" , this ) ; <START_BUG> intent . setComponent ( new ComponentName ( AstridApiConstants . PACKAGE , "com.todoroo.astrid.activity.TaskListActivity" ) ) ; <END_BUG> if ( ( customExtras ) != null ) intent . putExtras ( customExtras ) ; return intent ; } public void start ( Activity activity , int resultCode ) { } @ Override public int describeContents ( ) { } @ Override public void writeToParcel ( Parcel dest , int flags ) { } @ Override public void readFromParcel ( Parcel source ) { } @ SuppressWarnings ( "hiding" ) public static final Parcelable . Creator < FilterWithCustomIntent > CREATOR = new Parcelable . Creator < FilterWithCustomIntent > ( ) { public FilterWithCustomIntent createFromParcel ( Parcel source ) { } public FilterWithCustomIntent [ ] newArray ( int size ) { } } ; }

Fix:
intent . setComponent ( new ComponentName ( "com.timsu.astrid" , "com.todoroo.astrid.activity.TaskListActivity" ) ) ;
Buggy code:
public class FonctionnalitiesRequest { public static int addFonctionnality ( String name , String description , int avancement , Date deadLine ) { String sql = "Insert<seq2seq4repair_space>into<seq2seq4repair_space>fonctionnalities(name,<seq2seq4repair_space>description,<seq2seq4repair_space>avancement,<seq2seq4repair_space>deadLine)<seq2seq4repair_space>values<seq2seq4repair_space>(?,?,?,?);" ; try { PreparedStatement stmt = DataBase . getConnection ( ) . prepareStatement ( sql ) ; stmt . setString ( 1 , name ) ; stmt . setString ( 2 , description ) ; stmt . setInt ( 3 , avancement ) ; stmt . setDate ( 4 , deadLine ) ; stmt . executeUpdate ( ) ; stmt . close ( ) ; Statement stmt2 = DataBase . getConnection ( ) . createStatement ( ) ; ResultSet rs = stmt2 . executeQuery ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>fonctionnalities;" ) ; <START_BUG> return rs . getInt ( 1 ) ; <END_BUG> } catch ( SQLException e ) { e . printStackTrace ( ) ; System . err . println ( sql ) ; return - 1 ; } } public static List < Fonctionnality > getAllfonctionnalities ( ) { } public static Fonctionnality getFonctionnality ( int id ) { } }

Fix:
return rs . getInt ( "id" ) ;
Buggy code:
public abstract class MemberHandle extends AbstractHandle < AccessibleObject > implements AnnotatedElementHandle < AccessibleObject > { protected String className ; protected String name ; protected String desc ; public String getClassName ( ) { } public String getName ( ) { } public String getDesc ( ) { } @ Override public String toString ( ) { } public int compareTo ( AnnotatedElementHandle < ? > oo ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } public abstract AccessibleObject hydrate ( ClassLoader cl ) { } public abstract < T extends Annotation > T getAnnotation ( ClassLoader cl , Class < T > c ) { } public abstract Type [ ] getGenericTypes ( ClassLoader cl ) { } public abstract Class < ? > [ ] getRawTypes ( ClassLoader cl ) { } public String getSignature ( ) { <START_BUG> return ( name ) + ( desc ) ; <END_BUG> } }

Fix:
return ( name ) + ( desc . substring ( 0 , ( ( desc . lastIndexOf ( ")" ) ) + 1 ) ) ) ;
Buggy code:
public class NamespaceImpl extends ModelElementImpl implements Namespace { public Vector _ownedElement = new Vector ( ) ; public NamespaceImpl ( ) { } public NamespaceImpl ( Name name ) { } public NamespaceImpl ( String nameStr ) { } public Vector getOwnedElement ( ) { <START_BUG> return ( ( Vector ) ( _ownedElement . clone ( ) ) ) ; <END_BUG> } public void setOwnedElement ( Vector x ) throws PropertyVetoException { } public void addOwnedElement ( ElementOwnership x ) throws PropertyVetoException { } public void removeOwnedElement ( ElementOwnership x ) throws PropertyVetoException { } public void addPublicOwnedElement ( ModelElement x ) throws PropertyVetoException { } public void addPrivateOwnedElement ( ModelElement x ) throws PropertyVetoException { } public void addProtectedOwnedElement ( ModelElement x ) throws PropertyVetoException { } public void addUnspecOwnedElement ( ModelElement x ) throws PropertyVetoException { } public ElementOwnership elementOwnershipFor ( ModelElement me , VisibilityKind vk ) { } public boolean contains ( ModelElement me ) { } public boolean contains ( ModelElement me , VisibilityKind vk ) { } public boolean containsPublic ( ModelElement me ) { } }

Fix:
return ( ( Vector ) ( _ownedElement ) ) ;
Buggy code:
public class ResourceInjectionAnnotationParsingProcessor extends AbstractComponentConfigProcessor { private static final DotName RESOURCE_ANNOTATION_NAME = DotName . createSimple ( Resource . class . getName ( ) ) ; private static final DotName RESOURCES_ANNOTATION_NAME = DotName . createSimple ( Resources . class . getName ( ) ) ; protected void processComponentConfig ( final DeploymentUnit deploymentUnit , final DeploymentPhaseContext phaseContext , final CompositeIndex index , final ComponentConfiguration componentConfiguration ) { final ClassInfo classInfo = index . getClassByName ( DotName . createSimple ( componentConfiguration . getComponentClassName ( ) ) ) ; if ( classInfo == null ) { return ; } componentConfiguration . addResourceInjectionConfigs ( getResourceConfigurations ( classInfo ) ) ; <START_BUG> final List < MethodInterceptorConfiguration > interceptorConfigurations = componentConfiguration . getMethodInterceptorConfigs ( ) ; <END_BUG> for ( MethodInterceptorConfiguration interceptorConfiguration : interceptorConfigurations ) { final ClassInfo interceptorClassInfo = index . getClassByName ( DotName . createSimple ( interceptorConfiguration . getInterceptorClassName ( ) ) ) ; if ( interceptorClassInfo == null ) { continue ; } interceptorConfiguration . addResourceInjectionConfigs ( getResourceConfigurations ( interceptorClassInfo ) ) ; } } public List < ResourceInjectionConfiguration > getResourceConfigurations ( final ClassInfo classInfo ) { } public ResourceInjectionConfiguration getResourceConfiguration ( final ClassInfo classInfo , final AnnotationInstance annotation ) { } private ResourceInjectionConfiguration processFieldResource ( final AnnotationInstance annotation , final FieldInfo fieldInfo ) { } private ResourceInjectionConfiguration processMethodResource ( final AnnotationInstance annotation , final MethodInfo methodInfo ) { } private ResourceInjectionConfiguration processClassResource ( final AnnotationInstance annotation , final ClassInfo classInfo ) { } private List < ResourceInjectionConfiguration > processClassResources ( final ClassInfo classInfo , final Map < DotName , List < AnnotationInstance > > classAnnotations ) { } private String getTargetContextName ( final AnnotationInstance resource , final String contextNameSuffix , final String injectionType ) { } private static boolean isEnvironmentEntryType ( final String type ) { } }

Fix:
final List < MethodInterceptorConfiguration > interceptorConfigurations = componentConfiguration . getClassInterceptorConfigs ( ) ;
Buggy code:
public class CreationModalViewController { private ControllerManager controllerManager ; @ Getter @ Setter private CameraShotCreationModalView cameraShotCreationModalView ; @ Getter @ Setter private DirectorShotCreationModalView directorShotCreationModalView ; public CreationModalViewController ( ControllerManager controllerManager ) { } public void showCameraCreationWindow ( ) { } private void cameraShotStartCountEnterHandler ( KeyEvent event ) { } private void cameraShotEndCountFocusHandler ( ObservableValue < ? extends Boolean > observable , Boolean oldValue , Boolean newValue ) { } private void cameraShotEndCountEnterHandler ( KeyEvent event ) { } private void cameraShotStartCountFocusHandler ( ObservableValue < ? extends Boolean > observable , Boolean oldValue , Boolean newValue ) { } private void createCameraShot ( MouseEvent event ) { } private void cameraCreationCancelButtonHandler ( MouseEvent event ) { } protected boolean validateCameraShot ( ) { } public void showDirectorCreationWindow ( ) { <START_BUG> directorShotCreationModalView = new DirectorShotCreationModalView ( this . controllerManager . getRootPane ( ) , this . controllerManager . getScriptingProject ( ) . getCameraTimelines ( ) . size ( ) ) ; <END_BUG> directorShotCreationModalView . getCancelButton ( ) . setOnMouseReleased ( ( event ) -> directorShotCreationModalView . getModalStage ( ) . close ( ) ) ; directorShotCreationModalView . getCreationButton ( ) . setOnMouseReleased ( this :: createDirectorShot ) ; directorShotCreationModalView . getStartField ( ) . setOnKeyPressed ( this :: directorShotStartCountEnterHandler ) ; directorShotCreationModalView . getStartField ( ) . focusedProperty ( ) . addListener ( this :: directorShotStartCountFocusHandler ) ; directorShotCreationModalView . getEndField ( ) . setOnKeyPressed ( this :: directorShotEndCountEnterHandler ) ; directorShotCreationModalView . getEndField ( ) . focusedProperty ( ) . addListener ( this :: directorShotEndCountFocusHandler ) ; } private void directorShotStartCountEnterHandler ( KeyEvent event ) { } private void directorShotEndCountFocusHandler ( ObservableValue < ? extends Boolean > observable , Boolean oldValue , Boolean newValue ) { } private void directorShotEndCountEnterHandler ( KeyEvent event ) { } private void directorShotStartCountFocusHandler ( ObservableValue < ? extends Boolean > observable , Boolean oldValue , Boolean newValue ) { } private void createDirectorShot ( MouseEvent event ) { } protected boolean validateDirectorShot ( ) { } private String validateDirectorShotCounts ( String errorString ) { } }

Fix:
directorShotCreationModalView = new DirectorShotCreationModalView ( this . controllerManager . getRootPane ( ) , this . controllerManager . getScriptingProject ( ) . getCameraTimelines ( ) ) ;
Buggy code:
public class Log { public static boolean register ( String path , TypeLog type , String line , boolean addDate , String prefix , String ext ) { boolean a = false ; PrintWriter writer = null ; try { <START_BUG> String split = ( System . getProperty ( "os.name" ) . contains ( "indows" ) ) ? "\\" : "//" ; <END_BUG> String realPrefix = ( prefix . equals ( "" ) ) ? "" : prefix + "_" ; writer = new PrintWriter ( new BufferedWriter ( new FileWriter ( ( ( ( path . endsWith ( split ) ? ( path + realPrefix ) + ( type . name ( ) ) : ( ( path + split ) + realPrefix ) + ( type . name ( ) ) ) + "." ) + ext ) , true ) ) ) ; writer . println ( ( ( addDate ? ( FixData . getDateTime ( ) ) + "|" : "" ) + line ) ) ; writer . close ( ) ; a = true ; } catch ( IOException ex ) { System . out . println ( ex ) ; } finally { try { writer . close ( ) ; } catch ( Exception ex ) { System . out . println ( ex ) ; } } return a ; } public static boolean existLog ( String path , TypeLog type , String prefix ) { } No newline ; at end ; of file ; }

Fix:
String split = FixData . splitSO ( ) ;
Buggy code:
public class saveManagement { public void serializeEverything ( ArrayList < ISupports > components ) { } public void deserializeEverything ( ArrayList < ISupports > components ) { saveGame < ISupports > TheSaver = new saveGame < ISupports > ( ) ; <START_BUG> for ( int i = 0 ; i < 4 ; i ++ ) { <END_BUG> switch ( i ) { case 0 : components . add ( TheSaver . obtainState ( "items" ) ) ; break ; case 1 : components . add ( TheSaver . obtainState ( "player" ) ) ; break ; case 2 : components . add ( TheSaver . obtainState ( "monster" ) ) ; break ; case 3 : components . add ( TheSaver . obtainState ( "map" ) ) ; default : System . out . println ( "ops" ) ; } } } }

Fix:
for ( int i = 0 ; i < ( components . size ( ) ) ; i ++ ) {
Buggy code:
public class NotationImpl extends NodeImpl implements Notation { static final long serialVersionUID = - 764632195890658402L ; protected String name ; protected String publicId ; protected String systemId ; protected String baseURI ; public NotationImpl ( CoreDocumentImpl ownerDoc , String name ) { } public short getNodeType ( ) { } public String getNodeName ( ) { } public String getPublicId ( ) { } public String getSystemId ( ) { } public void setPublicId ( String id ) { } public void setSystemId ( String id ) { } public String getBaseURI ( ) { if ( needsSyncData ( ) ) { synchronizeData ( ) ; } if ( ( ( baseURI ) != null ) && ( ( baseURI . length ( ) ) != 0 ) ) { try { <START_BUG> baseURI = new URI ( baseURI ) . toString ( ) ; <END_BUG> } catch ( org . apache . xerces . util e ) { return null ; } } return baseURI ; } public void setBaseURI ( String uri ) { } }

Fix:
return new URI ( baseURI ) . toString ( ) ;
Buggy code:
public class TTCCLayout extends DateLayout { public static final String THREAD_PRINTING_OPTION = "ThreadPrinting" ; public static final String CATEGORY_PREFIXING_OPTION = "CategoryPrefixing" ; public static final String CONTEXT_PRINTING_OPTION = "ContextPrinting" ; private boolean threadPrinting = true ; private boolean categoryPrefixing = true ; private boolean contextPrinting = true ; protected final StringBuffer buf = new StringBuffer ( 256 ) ; public TTCCLayout ( ) { } public TTCCLayout ( String dateFormatType ) { } public String format ( LoggingEvent event ) { buf . setLength ( 0 ) ; dateFormat ( buf , event ) ; if ( this . threadPrinting ) { buf . append ( '[' ) ; buf . append ( event . getThreadName ( ) ) ; buf . append ( "]<seq2seq4repair_space>" ) ; } buf . append ( event . priority . toString ( ) ) ; buf . append ( '<seq2seq4repair_space>' ) ; if ( this . categoryPrefixing ) { buf . append ( event . categoryName ) ; buf . append ( '<seq2seq4repair_space>' ) ; } if ( this . contextPrinting ) { String ndc = event . getNDC ( ) ; if ( ndc != null ) { buf . append ( ndc ) ; buf . append ( '<seq2seq4repair_space>' ) ; } } buf . append ( "-<seq2seq4repair_space>" ) ; <START_BUG> buf . append ( event . message ) ; <END_BUG> buf . append ( Layout . LINE_SEP ) ; return buf . toString ( ) ; } public String [ ] getOptionStrings ( ) { } public boolean ignoresThrowable ( ) { } public void setOption ( String key , String value ) { } public void setCategoryPrefixing ( boolean categoryPrefixing ) { } public void setThreadPrinting ( boolean threadPrinting ) { } }

Fix:
buf . append ( event . getRenderedMessage ( ) ) ;
Buggy code:
public final class ClassUtil { private ClassUtil ( ) { } public static < ObjectType > List < ObjectType > createInstances ( List < ObjectType > values ) throws Exception { } @ SuppressWarnings ( "unchecked" ) public static < ObjectType > ObjectType createInstance ( Object value ) throws Exception { } @ SuppressWarnings ( "unchecked" ) public static < ClassType > Class < ClassType > createClass ( Object value ) throws Exception { } @ SuppressWarnings ( "unchecked" ) public static < ObjectType > ObjectType createInstance ( String className ) throws Exception { } public static < ObjectType > ObjectType createInstance ( Class < ObjectType > clazz ) throws Exception { } public static < EntityType > EntityType resolveEntityByClassOrByInterfaces ( Class < ? > entityClass , Collection < Object > entities ) { } @ SuppressWarnings ( "unchecked" ) public static < EntityType > EntityType resolveEntityByClass ( Class < ? > entityClass , Collection < Object > entities ) { } @ SuppressWarnings ( "unchecked" ) public static < EntityType > EntityType resolveEntityUsingInterfaces ( Class < ? > entityClass , Collection < Object > entities ) { for ( Object entity : entities ) { if ( entity != null ) { Class < ? > [ ] entityInterfaces = entity . getClass ( ) . getInterfaces ( ) ; for ( Class < ? > entityInterface : entityInterfaces ) { <START_BUG> if ( entityInterface . isAssignableFrom ( entityClass ) ) { <END_BUG> return ( ( EntityType ) ( entity ) ) ; } } } } return null ; } @ SuppressWarnings ( "unchecked" ) public static < EntityType > List < EntityType > resolveEntities ( Class < ? > entityClass , List < Object > entities ) { } }

Fix:
if ( entityClass . isAssignableFrom ( entityInterface ) ) {
Buggy code:
public class WikiGram { public static void count ( String filename ) throws FileNotFoundException { FileInputStream fileStream = null ; BufferedInputStream bufferedStream = null ; BZip2CompressorInputStream decompressorStream = null ; try { fileStream = new FileInputStream ( filename ) ; bufferedStream = new BufferedInputStream ( fileStream , ( ( int ) ( Math . pow ( 2 , 20 ) ) ) ) ; <START_BUG> decompressorStream = new BZip2CompressorInputStream ( bufferedStream ) ; <END_BUG> Writer ngramCounterWriter = new NgramCounterWriter ( ) ; Writer onlyWordFilterWriter = new OnlyWordFilterWriter ( ngramCounterWriter ) ; Writer redirectionRemoverWriter = new RedirectionRemoverWriter ( onlyWordFilterWriter ) ; Writer toLowerLetterWriter = new ToLowerLetterWriter ( redirectionRemoverWriter ) ; Writer htmlTagRemoverWriter = new HtmlTagRemoverWriter ( toLowerLetterWriter ) ; Writer templateRemoverWriter = new TemplateRemoverWriter ( htmlTagRemoverWriter ) ; Writer linkRemoverWriter = new LinkRemoverWriter ( templateRemoverWriter ) ; Writer bufferWriter = new BufferedWriter ( linkRemoverWriter ) ; new norbert . wikigram . xml . ArticleExtractor ( decompressorStream , bufferWriter ) ; } catch ( FileNotFoundException e ) { throw e ; } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { try { if ( fileStream != null ) { fileStream . close ( ) ; } if ( bufferedStream != null ) { bufferedStream . close ( ) ; } if ( decompressorStream != null ) { decompressorStream . close ( ) ; } } catch ( Exception e2 ) { e2 . printStackTrace ( ) ; } } } public static void main ( String [ ] args ) { } public static void testInputStreamOutputStream ( String filename ) { } }

Fix:
decompressorStream = new BZip2CompressorInputStream ( bufferedStream , true ) ;
Buggy code:
public class ContextImpl extends Context { protected Entity entity ; private ContextImpl parent ; private VariableResolverImpl resolver ; private DataSource ds ; private String currProcess ; private Map < String , Object > requestParams ; private DataImporter dataImporter ; private Map < String , Object > entitySession ; private Map < String , Object > globalSession ; DocWrapper doc ; DocBuilder docBuilder ; public ContextImpl ( DataConfig . Entity entity , VariableResolverImpl resolver , DataSource ds , String currProcess , Map < String , Object > global , ContextImpl parentContext , DocBuilder docBuilder ) { } @ Override public String getEntityAttribute ( String name ) { } @ Override public String getResolvedEntityAttribute ( String name ) { } @ Override public List < Map < String , String > > getAllEntityFields ( ) { } @ Override public VariableResolver getVariableResolver ( ) { } @ Override public DataSource getDataSource ( ) { } @ Override public DataSource getDataSource ( String name ) { } @ Override public boolean isRootEntity ( ) { } @ Override public String currentProcess ( ) { } @ Override public Map < String , Object > getRequestParameters ( ) { } @ Override public EntityProcessor getEntityProcessor ( ) { } @ Override public void setSessionAttribute ( String name , Object val , String scope ) { } private void putVal ( String name , Object val , Map map ) { if ( val == null ) map . remove ( name ) ; else <START_BUG> entitySession . put ( name , val ) ; <END_BUG> } @ Override public Object getSessionAttribute ( String name , String scope ) { } @ Override public Context getParentContext ( ) { } private DocWrapper getDocument ( ) { } public void setDoc ( DocBuilder . DocWrapper docWrapper ) { } @ Override public SolrCore getSolrCore ( ) { } @ Override public Map < String , Object > getStats ( ) { } @ Override public String getScript ( ) { } @ Override public String getScriptLanguage ( ) { } @ Override public void deleteDoc ( String id ) { } @ Override public void deleteDocByQuery ( String query ) { } DocBuilder getDocBuilder ( ) { } @ Override public Object resolve ( String var ) { } @ Override public String replaceTokens ( String template ) { } }

Fix:
map . put ( name , val ) ;
Buggy code:
public class LocalDataSourceService extends AbstractDataSourceService { private final InjectedValue < ModifiableDataSource > dataSourceConfig = new InjectedValue < ModifiableDataSource > ( ) ; public LocalDataSourceService ( final String dsName , final String jndiName , final ClassLoader classLoader ) { } public LocalDataSourceService ( final String dsName , final String jndiName ) { } @ Override public AS7DataSourceDeployer getDeployer ( ) throws ValidateException { <START_BUG> return new AS7DataSourceDeployer ( dataSourceConfig . getValue ( ) . getUnModifiableInstance ( ) ) ; <END_BUG> } public Injector < ModifiableDataSource > getDataSourceConfigInjector ( ) { } }

Fix:
return new AS7DataSourceDeployer ( dataSourceConfig . getValue ( ) . getUnModifiableInstance ( ) , dataSourceConfig . getValue ( ) . getProfile ( ) ) ;
Buggy code:
public class AttributeGroup extends org . tigris . scarab . om . BaseAttributeGroup implements Persistent { private static final String GET_ATTRIBUTES = "getAttributes" ; private static final String GET_R_ATTRIBUTE_ATTRGROUP = "getRAttributeAttributeGroup" ; private static final String GET_ATTRIBUTE_GROUPS = "getAttributeGroups" ; public ScarabModule getScarabModule ( ) { } public void setScarabModule ( ScarabModule module ) { } public void setModule ( Module me ) throws TorqueException { } public Module getModule ( ) throws TorqueException { } public List getAttributes ( ) throws Exception { } public int getHighestOrderedAttribute ( ) throws Exception { int highest = 0 ; Criteria crit = new Criteria ( ) . add ( GROUP_ID , getAttributeGroupId ( ) ) . addAscendingOrderByColumn ( PREFERRED_ORDER ) ; List raags = RAttributeAttributeGroupPeer . doSelect ( crit ) ; if ( ( raags . size ( ) ) > 0 ) { RAttributeAttributeGroup raag = ( ( RAttributeAttributeGroup ) ( raags . get ( ( ( raags . size ( ) ) - 1 ) ) ) ) ; highest = raag . getOrder ( ) ; } <START_BUG> return highest ; <END_BUG> } public RAttributeAttributeGroup getRAttributeAttributeGroup ( Attribute attribute ) throws Exception { } public void delete ( ScarabUser user ) throws Exception { } public void addAttribute ( Attribute attribute ) throws Exception { } public void deleteAttribute ( Attribute attribute , ScarabUser user ) throws Exception { } private RAttributeAttributeGroup addRAttributeAttributeGroup ( Attribute attribute ) throws Exception { } }

Fix:
return highest + 1 ;
Buggy code:
public class RolloutPlanTestCase extends AbstractCliTestBase { private static File warFile ; private static final int TEST_PORT = 8081 ; private static final String [ ] serverGroups = new String [ ] { "main-server-group" , "other-server-group" , "test-server-group" } ; @ BeforeClass public static void before ( ) throws Exception { } @ AfterClass public static void after ( ) throws Exception { } @ After public void afterTest ( ) throws Exception { cli . sendLine ( "undeploy<seq2seq4repair_space>RolloutPlanTestCase.war<seq2seq4repair_space>--all-relevant-server-groups" , true ) ; <START_BUG> cli . sendLine ( "//socket-binding-group=standard-sockets//socket-binding=test-binding:remove" , true ) ; <END_BUG> } @ Test public void testInSeriesRolloutPlan ( ) throws Exception { } @ Test public void testMaxFailServersRolloutPlan ( ) throws Exception { } @ Test public void testMaxFailServersPercentageRolloutPlan ( ) throws Exception { } @ Test public void testRollbackAcrossGroupsRolloutPlan ( ) throws Exception { } private CLIOpResult testAddConnector ( String rolloutPlanId ) throws Exception { } private CLIOpResult testRemoveConnector ( String rolloutPlanId ) throws Exception { } private void testCleanupConnector ( String rolloutPlanId ) throws Exception { } private boolean getServerStatus ( String serverName , CLIOpResult result ) throws Exception { } private static String checkURL ( String server , boolean shouldFail ) throws Exception { } private static String checkURL ( String server , boolean shouldFail , String path ) throws Exception { } private static String getServerHost ( String server ) { } private static void waitUntilState ( final String serverName , final String state ) throws TimeoutException { } private static class NoResponseException extends Exception { private static final long serialVersionUID = 1L ; private NoResponseException ( String serverName ) { } } }

Fix:
cli . sendLine ( "//socket-binding-group=standard-sockets//socket-binding=test-binding:remove(){allow-resource-service-restart=true}" , true ) ;
Buggy code:
public abstract class AbstractTextureImage implements TextureImage { protected int height ; protected int width ; protected int pixelformat ; protected File file = null ; protected boolean hasMipMaps ; protected int numMipMaps ; protected int depth ; protected MipMaps mipMaps ; @ Override public int getDepth ( ) { } @ Override public int getChannelDepth ( ) { } @ Override public String getAbsolutePath ( ) { } private String getFileName ( ) { } @ Override public File getFile ( ) { } @ Override public int getHeight ( ) { } @ Override public int getWidth ( ) { } @ Override public int getPixelformat ( ) { } @ Override public void setPixelformat ( final int pixelformat ) { } @ Override public void setPixelformat ( final PixelFormat pixelformat ) { } @ Override public boolean hasMipMaps ( ) { } @ Override public int getNumMipMaps ( ) { } @ Override public void write ( ) throws IOException { } @ Override public boolean isCompressed ( ) { <START_BUG> return DDSUtil . isDXTCompressed ( pixelformat ) ; <END_BUG> } @ Override public String getPixelformatVerbose ( ) { } @ Override public void setHasMipMaps ( final boolean generateMipMaps ) throws IllegalArgumentException { } @ Override public void setData ( final BufferedImage bi ) { } public void setTopMipMap ( BufferedImage bi ) { } public BufferedImage getTopMipMap ( ) { } @ Override public BufferedImage getData ( ) { } public static boolean isPowerOfTwo ( final int value ) { } }

Fix:
return PixelFormats . isDXTCompressed ( pixelformat ) ;
Buggy code:
public class GraphController { private Repository repo ; private Report report ; public GraphController ( int [ ] categoryIds ) { } public int getMaxMonthIndex ( ) { } public int getMaxDiff ( ) { } public List < Integer > getDifferenceByCategoryId ( int categoryId ) { ArrayList < Integer > result = new ArrayList < Integer > ( ) ; ArrayList < Record > records = this . repo . getRecordsByCategoryId ( categoryId ) ; <START_BUG> ArrayList < Record > merged = Utils . removeRecordsForTheSameMonth ( records ) ; <END_BUG> Calculator . recalculateDiff ( merged ) ; for ( Record rec : merged ) { result . add ( rec . getDiff ( ) ) ; } return result ; } public List < String > getMonthsNames ( ) { } }

Fix:
ArrayList < Record > merged = Utils . groupRecords ( records ) ;
Buggy code:
public class RepositoryViewActivity extends TabPagerActivity < RepositoryPagerAdapter > { public static Intent createIntent ( Repository repository ) { } private Repository repository ; @ Inject private AvatarLoader avatars ; private ProgressBar loadingBar ; private boolean isStarred ; private boolean starredStatusChecked ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; repository = getSerializableExtra ( Intents . EXTRA_REPOSITORY ) ; <START_BUG> loadingBar = finder . find ( pb_loading ) ; <END_BUG> User owner = repository . getOwner ( ) ; ActionBar actionBar = getSupportActionBar ( ) ; actionBar . setTitle ( repository . getName ( ) ) ; actionBar . setSubtitle ( owner . getLogin ( ) ) ; actionBar . setDisplayHomeAsUpEnabled ( true ) ; if ( ( ( owner . getAvatarUrl ( ) ) != null ) && ( RepositoryUtils . isComplete ( repository ) ) ) configurePager ( ) ; else { avatars . bind ( getSupportActionBar ( ) , owner ) ; ViewUtils . setGone ( loadingBar , false ) ; setGone ( true ) ; new com . github . mobile . core . repo . RefreshRepositoryTask ( this , repository ) { @ Override protected void onSuccess ( Repository fullRepository ) throws Exception { super . onSuccess ( fullRepository ) ; repository = fullRepository ; configurePager ( ) ; } @ Override protected void onException ( Exception e ) throws RuntimeException { super . onException ( e ) ; com . github . mobile . util . ToastUtils . show ( RepositoryViewActivity . this , R . string . error_repo_load ) ; ViewUtils . setGone ( loadingBar , true ) ; } } . execute ( ) ; } } @ Override public boolean onCreateOptionsMenu ( Menu optionsMenu ) { } @ Override public boolean onPrepareOptionsMenu ( Menu menu ) { } @ Override public void onBackPressed ( ) { } private void configurePager ( ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onDialogResult ( int requestCode , int resultCode , Bundle arguments ) { } @ Override protected RepositoryPagerAdapter createAdapter ( ) { } @ Override protected int getContentView ( ) { } @ Override protected String getIcon ( int position ) { } private void starRepository ( ) { } private void checkStarredRepositoryStatus ( ) { } private void shareRepository ( ) { } private void forkRepository ( ) { } }

Fix:
loadingBar = finder . find ( progress_bar ) ;
Buggy code:
public abstract class AbstractValidator implements IClusterable , IValidator { private static final long serialVersionUID = 1L ; public boolean validateOnNullValue ( ) { } protected abstract void onValidate ( IValidatable validatable ) { } public final void validate ( IValidatable validatable ) { } public void error ( final IValidatable validatable ) { } public void error ( final IValidatable validatable , String resourceKey ) { } public void error ( final IValidatable validatable , final Map vars ) { } public void error ( final IValidatable validatable , final String resourceKey , Map vars ) { if ( validatable == null ) { throw new IllegalArgumentException ( "Argument<seq2seq4repair_space>[[validatable]]<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; } if ( vars == null ) { throw new IllegalArgumentException ( "Argument<seq2seq4repair_space>[[vars]]<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; } if ( resourceKey == null ) { throw new IllegalArgumentException ( "Argument<seq2seq4repair_space>[[resourceKey]]<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; } ValidationError error = new ValidationError ( ) . addMessageKey ( resourceKey ) ; final String defaultKey = Classes . simpleName ( getClass ( ) ) ; if ( ! ( resourceKey . equals ( defaultKey ) ) ) { error . addMessageKey ( defaultKey ) ; } <START_BUG> error . setVars ( vars ) ; <END_BUG> validatable . error ( error ) ; } protected String resourceKey ( ) { } protected Map variablesMap ( IValidatable validatable ) { } protected final Map messageModel ( final FormComponent formComponent ) { } protected final String resourceKey ( final FormComponent formComponent ) { } public final void validate ( final FormComponent component ) { } }

Fix:
error . setVariables ( vars ) ;
Buggy code:
public class PersistenceProviderImpl implements PersistenceProvider , ProviderUtil { static final String CLASS_TRANSFORMER_OPTIONS = "ClassTransformerOptions" ; private static final String EMF_POOL = "EntityManagerFactoryPool" ; private static final Localizer _loc = Localizer . forPackage ( PersistenceProviderImpl . class ) ; private Log _log ; public OpenJPAEntityManagerFactory createEntityManagerFactory ( String name , String resource , Map m ) { PersistenceProductDerivation pd = new PersistenceProductDerivation ( ) ; try { Object poolValue = Configurations . removeProperty ( PersistenceProviderImpl . EMF_POOL , m ) ; ConfigurationProvider cp = pd . load ( resource , name , m ) ; if ( cp == null ) { return null ; } <START_BUG> BrokerFactory factory = getBrokerFactory ( cp , poolValue , null ) ; <END_BUG> OpenJPAConfiguration conf = factory . getConfiguration ( ) ; _log = conf . getLog ( LOG_RUNTIME ) ; pd . checkPuNameCollisions ( _log , name ) ; loadAgent ( factory ) ; loadValidator ( factory ) ; if ( ( conf . getConnectionRetainModeConstant ( ) ) == ( ConnectionRetainModes . CONN_RETAIN_ALWAYS ) ) { _log . warn ( PersistenceProviderImpl . _loc . get ( "retain-always" , conf . getId ( ) ) ) ; } OpenJPAEntityManagerFactory emf = JPAFacadeHelper . toEntityManagerFactory ( factory ) ; if ( _log . isTraceEnabled ( ) ) { _log . trace ( ( ( ( ( ( ( this ) + "<seq2seq4repair_space>creating<seq2seq4repair_space>" ) + emf ) + "<seq2seq4repair_space>for<seq2seq4repair_space>PU<seq2seq4repair_space>" ) + name ) + "." ) ) ; } return emf ; } catch ( Exception e ) { if ( ( _log ) != null ) { _log . error ( PersistenceProviderImpl . _loc . get ( "create-emf-error" , name ) , e ) ; } throw PersistenceExceptions . toPersistenceException ( e ) ; } } private BrokerFactory getBrokerFactory ( ConfigurationProvider cp , Object poolValue , ClassLoader loader ) { } public OpenJPAEntityManagerFactory createEntityManagerFactory ( String name , Map m ) { } public OpenJPAEntityManagerFactory createContainerEntityManagerFactory ( PersistenceUnitInfo pui , Map m ) { } public void setPersistenceEnvironmentInfo ( OpenJPAConfiguration conf , PersistenceUnitInfo pui ) { } public ProviderUtil getProviderUtil ( ) { } protected String getDefaultBrokerAlias ( ) { } protected OpenJPAConfiguration newConfigurationImpl ( ) { } private static class ClassTransformerImpl implements ClassTransformer { private final ClassFileTransformer _trans ; private ClassTransformerImpl ( ConfigurationProvider cp , String props , final ClassLoader tmpLoader , OpenJPAConfiguration conf ) { } public byte [ ] transform ( ClassLoader cl , String name , Class < ? > previousVersion , ProtectionDomain pd , byte [ ] bytes ) throws IllegalClassFormatException { } } private void loadAgent ( BrokerFactory factory ) { } private void loadValidator ( BrokerFactory factory ) { } public LoadState isLoaded ( Object obj ) { } public LoadState isLoadedWithReference ( Object obj , String attr ) { } public LoadState isLoadedWithoutReference ( Object obj , String attr ) { } }

Fix:
BrokerFactory factory = getBrokerFactory ( cp , poolValue , BundleUtils . getBundleClassLoader ( ) ) ;
Buggy code:
public class CookieUtils { private static final Logger log = LoggerFactory . getLogger ( CookieUtils . class ) ; private final CookieDefaults settings ; public CookieUtils ( ) { } public CookieUtils ( final CookieDefaults settings ) { } public final CookieDefaults getSettings ( ) { } public final void remove ( final String key ) { } public final void remove ( final FormComponent < ? > formComponent ) { } protected String getKey ( final FormComponent < ? > component ) { } public final String load ( final String key ) { } public final String load ( final FormComponent < ? > formComponent ) { } protected String [ ] splitValue ( final String value ) { } protected String joinValues ( final String ... values ) { } public final void save ( String key , final String ... values ) { } public final void save ( final FormComponent < ? > formComponent ) { } protected String getSaveKey ( String key ) { } private void remove ( final Cookie cookie ) { } private Cookie getCookie ( final String name ) { } private Cookie save ( final Cookie cookie ) { } protected void initializeCookie ( final Cookie cookie ) { final String comment = settings . getComment ( ) ; if ( comment != null ) { cookie . setComment ( comment ) ; } final String domain = settings . getDomain ( ) ; if ( domain != null ) { cookie . setDomain ( domain ) ; } ServletWebRequest request = ( ( ServletWebRequest ) ( getWebRequest ( ) ) ) ; <START_BUG> String path = ( ( request . getHttpServletRequest ( ) . getContextPath ( ) ) + "//" ) + ( request . getFilterPrefix ( ) ) ; <END_BUG> cookie . setPath ( path ) ; cookie . setVersion ( settings . getVersion ( ) ) ; cookie . setSecure ( settings . getSecure ( ) ) ; } private WebRequest getWebRequest ( ) { } private WebResponse getWebResponse ( ) { } private String cookieToDebugString ( final Cookie cookie ) { } }

Fix:
String path = ( ( request . getContainerRequest ( ) . getContextPath ( ) ) + "//" ) + ( request . getFilterPrefix ( ) ) ;
Buggy code:
public class MainSubsystemExtension implements Extension { public static final String NAMESPACE = "urn:mycompany:main:1.0" ; public static final String SUBSYSTEM_NAME = "main" ; private final MainSubsystemExtension . SubsystemParser parser = new MainSubsystemExtension . SubsystemParser ( ) ; @ Override public void initializeParsers ( ExtensionParsingContext context ) { } @ Override public void initialize ( ExtensionContext context ) { <START_BUG> final SubsystemRegistration subsystem = context . registerSubsystem ( MainSubsystemExtension . SUBSYSTEM_NAME , 1 , 0 ) ; <END_BUG> final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( SUBSYSTEM ) ; registration . registerOperationHandler ( ADD , INSTANCE , SUBSYSTEM_ADD , false ) ; registration . registerOperationHandler ( DESCRIBE , MainSubsystemExtension . SubsystemDescribeHandler . INSTANCE , MainSubsystemExtension . SubsystemDescribeHandler . INSTANCE , false , PRIVATE ) ; registration . registerOperationHandler ( REMOVE , ReloadRequiredRemoveStepHandler . INSTANCE , SUBSYSTEM_REMOVE , false ) ; subsystem . registerXMLElementWriter ( parser ) ; } private static ModelNode createAddSubsystemOperation ( ) { } private static class SubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } } private static class SubsystemDescribeHandler implements OperationStepHandler , DescriptionProvider { static final MainSubsystemExtension . SubsystemDescribeHandler INSTANCE = new MainSubsystemExtension . SubsystemDescribeHandler ( ) ; public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } @ Override public ModelNode getModelDescription ( Locale locale ) { } } }

Fix:
final SubsystemRegistration subsystem = context . registerSubsystem ( MainSubsystemExtension . SUBSYSTEM_NAME , 1 , 0 , 0 ) ;
Buggy code:
public class WebSocketConnectionManagerTests { @ Test public void openConnection ( ) throws Exception { List < String > subprotocols = Arrays . asList ( "abc" ) ; HttpHeaders headers = new HttpHeaders ( ) ; headers . setSecWebSocketProtocol ( subprotocols ) ; WebSocketClient client = mock ( WebSocketClient . class ) ; WebSocketHandler handler = new WebSocketHandlerAdapter ( ) ; WebSocketConnectionManager manager = new WebSocketConnectionManager ( client , handler , "//path//{id}" , "123" ) ; <START_BUG> manager . setSubProtocols ( subprotocols ) ; <END_BUG> manager . openConnection ( ) ; ArgumentCaptor < WebSocketHandlerDecorator > captor = ArgumentCaptor . forClass ( WebSocketHandlerDecorator . class ) ; ArgumentCaptor < HttpHeaders > headersCaptor = ArgumentCaptor . forClass ( HttpHeaders . class ) ; ArgumentCaptor < URI > uriCaptor = ArgumentCaptor . forClass ( URI . class ) ; verify ( client ) . doHandshake ( captor . capture ( ) , headersCaptor . capture ( ) , uriCaptor . capture ( ) ) ; assertEquals ( headers , headersCaptor . getValue ( ) ) ; assertEquals ( new URI ( "//path//123" ) , uriCaptor . getValue ( ) ) ; WebSocketHandlerDecorator loggingHandler = captor . getValue ( ) ; assertEquals ( LoggingWebSocketHandlerDecorator . class , loggingHandler . getClass ( ) ) ; assertSame ( handler , loggingHandler . getDelegate ( ) ) ; } @ Test public void syncClientLifecycle ( ) throws Exception { } @ Test public void dontSyncClientLifecycle ( ) throws Exception { } private static class TestLifecycleWebSocketClient implements SmartLifecycle , WebSocketClient { private boolean running ; public TestLifecycleWebSocketClient ( boolean running ) { } @ Override public void start ( ) { } @ Override public void stop ( ) { } @ Override public boolean isRunning ( ) { } @ Override public int getPhase ( ) { } @ Override public boolean isAutoStartup ( ) { } @ Override public void stop ( Runnable callback ) { } @ Override public WebSocketSession doHandshake ( WebSocketHandler webSocketHandler , String uriTemplate , Object ... uriVariables ) throws WebSocketConnectFailureException { } @ Override public WebSocketSession doHandshake ( WebSocketHandler webSocketHandler , HttpHeaders headers , URI uri ) throws WebSocketConnectFailureException { } } }

Fix:
manager . setSupportedProtocols ( subprotocols ) ;