nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TempFile extends Task { private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private String property ; private File destDir = null ; private String prefix ; private String suffix = "" ; private boolean deleteOnExit ; public void setProperty ( String property ) { } public void setDestDir ( File destDir ) { } public void setPrefix ( String prefix ) { } public void setSuffix ( String suffix ) { } public void setDeleteOnExit ( boolean deleteOnExit ) { } public boolean isDeleteOnExit ( ) { } public void execute ( ) throws BuildException { if ( ( ( property ) == null ) || ( ( property . length ( ) ) == 0 ) ) { throw new BuildException ( "no<seq2seq4repair_space>property<seq2seq4repair_space>specified" ) ; } if ( ( destDir ) == null ) { <START_BUG> destDir = TempFile . FILE_UTILS . resolveFile ( getProject ( ) . getBaseDir ( ) , "." ) ; <END_BUG> } File tfile = TempFile . FILE_UTILS . createTempFile ( prefix , suffix , destDir , deleteOnExit ) ; getProject ( ) . setNewProperty ( property , tfile . toString ( ) ) ; } }

Fix:
destDir = getProject ( ) . resolveFile ( "." ) ;
Buggy code:
public class HostConfigurationPersisterImpl implements HostConfigurationPersister { public static final String CONFIG_FILE = "host.xml" ; public static final String BACKUP_SUFFIX = ".last-known-good" ; private static Logger logger = Logger . getLogger ( "org.jboss.as.server.manager" ) ; private final File configFile ; public HostConfigurationPersisterImpl ( File configDir ) { } @ Override public InputStream getConfigurationInputStream ( ) throws IOException { } @ Override public void persistConfiguration ( final HostModel hostModel ) { } private void backupConfigFile ( ) throws IOException { } private static void copyFile ( File file , File backup ) throws IOException { } private static class RootElementWriter implements XMLContentWriter { private final HostModel hostModel ; private RootElementWriter ( final HostModel hostModel ) { } @ Override public void writeContent ( XMLExtendedStreamWriter streamWriter ) throws XMLStreamException { streamWriter . writeStartDocument ( ) ; <START_BUG> streamWriter . writeStartElement ( DOMAIN . getLocalName ( ) ) ; <END_BUG> hostModel . writeContent ( streamWriter ) ; streamWriter . writeEndDocument ( ) ; } } }

Fix:
streamWriter . writeStartElement ( HOST . getLocalName ( ) ) ;
Buggy code:
public class KnightsTour { static final String clear = "[2J" ; static final String hide = "[?25l" ; static final String show = "[?25h" ; private int [ ] [ ] board ; boolean debug = false ; private String go ( int x , int y ) { } public void clearTerminal ( ) { } public void wait ( int millis ) { } public String name ( ) { } public String toString ( ) { } public KnightsTour ( int size ) { } public boolean solve ( ) { } public boolean solve ( int startx , int starty ) { } public boolean solve ( int x , int y , int currentMoveNumber ) { if ( debug ) { System . out . println ( this ) ; wait ( 10 ) ; } <START_BUG> if ( ( ( ( x < 0 ) || ( y < 0 ) ) || ( x >= ( board . length ) ) ) || ( ( y >= ( board [ 0 ] . length ) ) && ( ( board [ x ] [ y ] ) != 0 ) ) ) { <END_BUG> return false ; } if ( ( currentMoveNumber == ( ( board . length ) * ( board [ 0 ] . length ) ) ) && ( ( board [ x ] [ y ] ) == 0 ) ) { return true ; } if ( ( board [ x ] [ y ] ) == 0 ) { board [ x ] [ y ] = currentMoveNumber ; if ( ( ( ( ( ( ( ( solve ( ( x + 2 ) , ( y + 1 ) , ( currentMoveNumber + 1 ) ) ) || ( solve ( ( x + 2 ) , ( y - 1 ) , ( currentMoveNumber + 1 ) ) ) ) || ( solve ( ( x - 2 ) , ( y + 1 ) , ( currentMoveNumber + 1 ) ) ) ) || ( solve ( ( x - 2 ) , ( y - 1 ) , ( currentMoveNumber + 1 ) ) ) ) || ( solve ( ( x + 1 ) , ( y + 2 ) , ( currentMoveNumber + 1 ) ) ) ) || ( solve ( ( x - 1 ) , ( y + 2 ) , ( currentMoveNumber + 1 ) ) ) ) || ( solve ( ( x + 1 ) , ( y - 2 ) , ( currentMoveNumber + 1 ) ) ) ) || ( solve ( ( x - 1 ) , ( y - 2 ) , ( currentMoveNumber + 1 ) ) ) ) { board [ x ] [ y ] = currentMoveNumber ; return true ; } board [ x ] [ y ] = 0 ; return false ; } return false ; } No newline ; at end ; of file ; }

Fix:
if ( ( ( ( x < 0 ) || ( y < 0 ) ) || ( x >= ( board . length ) ) ) || ( y >= ( board [ 0 ] . length ) ) ) {
Buggy code:
public class MultiRetrieveFileTransferServiceTest extends TestCase { private static final String TESTSRCPATH = "test.src" ; private static final String TESTTARGETPATH = "test.target" ; private static List srcFiles = new ArrayList ( ) ; private IRetrieveFileTransfer transferInstance ; protected IRetrieveFileTransfer getTransferInstance ( ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } protected void printFileInfo ( String prefix , IFileTransferEvent event , File targetFile ) { } protected void testReceive ( String url ) throws Exception { } public void testReceives ( ) throws Exception { for ( Iterator i = MultiRetrieveFileTransferServiceTest . srcFiles . iterator ( ) ; i . hasNext ( ) ; ) { testReceive ( ( ( String ) ( i . next ( ) ) ) ) ; } <START_BUG> Thread . sleep ( 50000 ) ; <END_BUG> } }

Fix:
Thread . sleep ( 10000 ) ;
Buggy code:
public class tab_search extends Fragment implements View . OnClickListener { EditText searchname ; Button searchbutton ; TableLayout searchtable ; TextView [ ] tv = new TextView [ 10 ] ; Button [ ] B = new Button [ 10 ] ; public void onCreate ( Bundle savedInstanceState ) { } public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onClick ( View v ) { System . out . println ( ( "id<seq2seq4repair_space>" + ( v . getId ( ) ) ) ) ; if ( ( v . getId ( ) ) == 0 ) { UserController controller = Application . getUserController ( ) ; controller . search ( searchname . getText ( ) . toString ( ) , controller . GetActiveUserName ( ) , controller . GetActiveUserId ( ) ) ; } else { UserController controller = Application . getUserController ( ) ; System . out . println ( tv [ 1 ] . getText ( ) ) ; System . out . println ( tv [ 1 ] . getId ( ) ) ; System . out . println ( controller . GetActiveUserName ( ) ) ; System . out . println ( controller . GetActiveUserId ( ) ) ; <START_BUG> controller . sendRequest ( tv [ 1 ] . getText ( ) . toString ( ) , String . valueOf ( ( ( tv [ 1 ] . getId ( ) ) - 1 ) ) , controller . GetActiveUserName ( ) , controller . GetActiveUserId ( ) ) ; <END_BUG> } } }

Fix:
controller . sendRequest ( tv [ 1 ] . getText ( ) . toString ( ) , String . valueOf ( tv [ 1 ] . getId ( ) ) , controller . GetActiveUserName ( ) , controller . GetActiveUserId ( ) ) ;
Buggy code:
public class TreeModel extends DefaultTreeModel { protected FolderXmlConfig folderXmlConfig ; private final Class [ ] FOLDER_ITEM_ARG = new Class [ ] { FolderItem . class } ; public TreeModel ( FolderXmlConfig folderConfig ) { } public void createDirectories ( XmlElement parentTreeNode , FolderTreeNode parentFolder ) { } public FolderTreeNode add ( XmlElement childNode , FolderTreeNode parentFolder ) { FolderItem item = new FolderItem ( childNode ) ; if ( item == null ) return null ; String name = null ; int uid = item . getInteger ( "uid" ) ; try { if ( uid == 100 ) name = MailResourceLoader . getString ( "tree" , "localfolders" ) ; else if ( uid == 101 ) name = MailResourceLoader . getString ( "tree" , "inbox" ) ; else if ( uid == 102 ) name = MailResourceLoader . getString ( "tree" , "drafts" ) ; else if ( uid == 103 ) name = MailResourceLoader . getString ( "tree" , "outbox" ) ; else if ( uid == 104 ) name = MailResourceLoader . getString ( "tree" , "sent" ) ; else if ( uid == 105 ) name = MailResourceLoader . getString ( "tree" , "trash" ) ; else if ( uid == 106 ) name = MailResourceLoader . getString ( "tree" , "search" ) ; else if ( uid == 107 ) name = MailResourceLoader . getString ( "tree" , "templates" ) ; else name = item . get ( "property" , "name" ) ; item . set ( "property" , "name" , name ) ; } catch ( MissingResourceException ex ) { name = item . get ( "property" , "name" ) ; } String type = item . get ( "type" ) ; <START_BUG> FolderPluginHandler handler = ( ( FolderPluginHandler ) ( pluginManager . getHandler ( "folder" ) ) ) ; <END_BUG> Object [ ] args = new Object [ ] { item } ; FolderTreeNode folder = null ; try { folder = ( ( FolderTreeNode ) ( handler . getPlugin ( type , args ) ) ) ; parentFolder . add ( folder ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } return folder ; } public FolderTreeNode getFolder ( int uid ) { } public FolderTreeNode getTrashFolder ( ) { } public FolderTreeNode getImapFolder ( int accountUid ) { } public FolderTreeNode getFolder ( TreeNodeList list ) { } public FolderTreeNode findFolder ( FolderTreeNode parentFolder , String str ) { } public SelectFolderDialog getSelectFolderDialog ( ) { } }

Fix:
FolderPluginHandler handler = ( ( FolderPluginHandler ) ( pluginManager . getHandler ( "org.columba.mail.folder" ) ) ) ;
Buggy code:
public class NativeManagementWriteAttributeHandler extends ReloadRequiredWriteAttributeHandler { public static OperationStepHandler INSTANCE = new NativeManagementWriteAttributeHandler ( ) ; private NativeManagementWriteAttributeHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode model = context . readResource ( EMPTY_ADDRESS ) . getModel ( ) ; if ( ( model . hasDefined ( INTERFACE . getName ( ) ) ) && ( model . hasDefined ( SOCKET_BINDING . getName ( ) ) ) ) { throw MESSAGES . conflictingConfigs ( INTERFACE . getName ( ) , SOCKET_BINDING . getName ( ) ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } } , MODEL ) ; super . execute ( context , operation ) ; } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class MixedLockManager extends PessimisticLockManager { private static final Localizer _loc = Localizer . forPackage ( MixedLockManager . class ) ; public boolean selectForUpdate ( Select sel , int lockLevel ) { } protected void lockInternal ( OpenJPAStateManager sm , int level , int timeout , Object sdata , boolean postLockVersionCheck ) { if ( level >= ( MixedLockLevels . LOCK_PESSIMISTIC_FORCE_INCREMENT ) ) { setVersionCheckOnReadLock ( true ) ; setVersionUpdateOnWriteLock ( true ) ; super . lockInternal ( sm , level , timeout , sdata , postLockVersionCheck ) ; } else if ( level >= ( MixedLockLevels . LOCK_PESSIMISTIC_READ ) ) { setVersionCheckOnReadLock ( true ) ; setVersionUpdateOnWriteLock ( false ) ; super . lockInternal ( sm , level , timeout , sdata , postLockVersionCheck ) ; } else <START_BUG> if ( level >= ( MixedLockLevels . LOCK_OPTIMISTIC ) ) { <END_BUG> setVersionCheckOnReadLock ( true ) ; setVersionUpdateOnWriteLock ( true ) ; optimisticLockInternal ( sm , level , timeout , sdata , postLockVersionCheck ) ; } } protected void optimisticLockInternal ( OpenJPAStateManager sm , int level , int timeout , Object sdata , boolean postLockVersionCheck ) { } }

Fix:
if ( level >= ( MixedLockLevels . LOCK_READ ) ) {
Buggy code:
class SpinnerTab extends RangeTab { Spinner spinner1 ; Group spinnerGroup ; Button readOnlyButton ; Button wrapButton ; Spinner incrementSpinner ; Spinner pageIncrementSpinner ; Spinner digitsSpinner ; SpinnerTab ( ControlExample instance ) { } void createControlWidgets ( ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } void createIncrementGroup ( ) { } void createPageIncrementGroup ( ) { } void createDigitsGroup ( ) { } Composite createTabFolderPage ( TabFolder tabFolder ) { } void createStyleGroup ( ) { } Widget [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { <START_BUG> return new String [ ] { "Selection" , "ToolTipText" } ; <END_BUG> } String getTabText ( ) { } void setExampleWidgetState ( ) { } int getDefaultMaximum ( ) { } int getDefaultMinimum ( ) { } int getDefaultSelection ( ) { } int getDefaultIncrement ( ) { } int getDefaultPageIncrement ( ) { } int getDefaultDigits ( ) { } void setWidgetIncrement ( ) { } void setWidgetMaximum ( ) { } void setWidgetMinimum ( ) { } void setWidgetPageIncrement ( ) { } void setWidgetDigits ( ) { } void setWidgetSelection ( ) { } }

Fix:
return new String [ ] { "Selection" , "TextLimit" , "ToolTipText" } ;
Buggy code:
public class HibernatePersistenceProviderAdaptor implements PersistenceProviderAdaptor { private static final String DEFAULT_REGION_FACTORY = "org.jboss.as.jpa.hibernate.cache.infinispan.InfinispanRegionFactory" ; private static final String DEFAULT_CACHE_CONTAINER = "hibernate" ; private static final String DEFAULT_ENTITY_CACHE = "entity" ; private static final String DEFAULT_COLLECTION_CACHE = "entity" ; private static final String DEFAULT_QUERY_CACHE = "local-query" ; private static final String DEFAULT_TIMESTAMPS_CACHE = "timestamps" ; private volatile JBossAppServerJtaPlatform appServerJtaPlatform ; @ Override public void injectJtaManager ( JtaManager jtaManager ) { } @ Override public void addProviderProperties ( Map properties , PersistenceUnitMetadata pu ) { } @ Override public Iterable < ServiceName > getProviderDependencies ( PersistenceUnitMetadata pu ) { } private ServiceName getCacheConfigServiceName ( String container , String cache ) { <START_BUG> return JBOSS . append ( "infinispan" , container , "config" , cache ) ; <END_BUG> } private void putPropertyIfAbsent ( Map properties , String property , Object value ) { } @ Override public void beforeCreateContainerEntityManagerFactory ( PersistenceUnitMetadata pu ) { } @ Override public void afterCreateContainerEntityManagerFactory ( PersistenceUnitMetadata pu ) { } @ Override public ManagementAdaptor getManagementAdaptor ( ) { } }

Fix:
return JBOSS . append ( "infinispan" , container , cache , "config" ) ;
Buggy code:
public class Mainlistener implements Listener { @ EventHandler public void PlayerJoin ( PlayerJoinEvent event ) { ArrayList < PotionEffectTypes > possibleEffects = new ArrayList < PotionEffectTypes > ( ) ; Collections . addAll ( possibleEffects , PotionEffectTypes . values ( ) ) ; ArrayList < Integer > strengh = new ArrayList < Integer > ( ) ; strengh . add ( 1 ) ; strengh . add ( 2 ) ; strengh . add ( 3 ) ; strengh . add ( 4 ) ; Player player = event . getPlayer ( ) ; <START_BUG> if ( ( ! ( player . hasPermission ( "pe.bypass" ) ) ) || ( player . isOp ( ) ) ) { <END_BUG> for ( PotionEffectTypes effect : possibleEffects ) { if ( player . hasPermission ( ( "pe." + ( effect . toString ( ) . toLowerCase ( ) ) ) ) ) { for ( Integer integer : strengh ) { if ( player . hasPermission ( ( ( ( "pe." + ( effect . toString ( ) . toLowerCase ( ) ) ) + "." ) + ( integer . toString ( ) ) ) ) ) { player . addPotionEffect ( new org . bukkit . potion . PotionEffect ( PotionEffectType . getByName ( effect . toString ( ) ) , 100000000 , ( integer - 1 ) , false , false ) ) ; } } player . addPotionEffect ( new org . bukkit . potion . PotionEffect ( PotionEffectType . getByName ( effect . toString ( ) ) , 1000000000 , 0 , false , false ) ) ; } } } } }

Fix:
if ( ( ! ( player . hasPermission ( "pe.bypass" ) ) ) || ( ! ( player . isOp ( ) ) ) ) {
Buggy code:
public final class LocalizedImageResource implements Serializable , IResourceListener { private static final long serialVersionUID = 1L ; private Boolean resourceKind ; private Component component ; private Resource resource ; private ResourceReference resourceReference ; private transient Locale locale ; private transient String style ; private static final class ImageValueParser extends MetaPatternParser { private static final Group factoryName = new Group ( MetaPattern . VARIABLE_NAME ) ; private static final Group imageReferenceName = new Group ( MetaPattern . VARIABLE_NAME ) ; private static final Group specification = new Group ( MetaPattern . ANYTHING_NON_EMPTY ) ; private static final MetaPattern pattern = new MetaPattern ( new MetaPattern [ ] { LocalizedImageResource . ImageValueParser . factoryName , MetaPattern . COLON , new wicket . util . parse . metapattern . OptionalMetaPattern ( new MetaPattern [ ] { LocalizedImageResource . ImageValueParser . imageReferenceName } ) , MetaPattern . COLON , LocalizedImageResource . ImageValueParser . specification } ) ; private ImageValueParser ( final CharSequence input ) { } private String getFactoryName ( ) { } private String getImageReferenceName ( ) { } private String getSpecification ( ) { } } public LocalizedImageResource ( final Component component ) { } public final void bind ( ) { } public final void onResourceRequested ( ) { } public final void setResource ( final Resource resource ) { } public final void setResourceReference ( final ResourceReference resourceReference ) { } public final void setSrcAttribute ( final ComponentTag tag ) { if ( ( ( resourceKind ) == null ) && ( ( ! ( Objects . equal ( locale , component . getLocale ( ) ) ) ) || ( ! ( Objects . equal ( style , component . getStyle ( ) ) ) ) ) ) { this . locale = component . getLocale ( ) ; this . style = component . getStyle ( ) ; this . resourceReference = null ; this . resource = null ; } if ( ( ( resource ) == null ) && ( ( resourceReference ) == null ) ) { final String src = tag . getString ( "src" ) ; if ( src != null ) { loadStaticImage ( src ) ; } else { final String value = tag . getString ( "value" ) ; if ( value != null ) { newImage ( value ) ; } else { loadStaticImage ( component . getModelObjectAsString ( ) ) ; } } } final String url ; if ( ( this . resourceReference ) != null ) { url = RequestCycle . get ( ) . urlFor ( resourceReference ) ; } else { <START_BUG> url = component . urlFor ( RESOURCE_LISTENER_INTERFACE ) ; <END_BUG> } tag . put ( "src" , Strings . replaceAll ( component . getResponse ( ) . encodeURL ( url ) , "&" , "&amp;" ) ) ; } private IResourceFactory getResourceFactory ( final Application application , final String factoryName ) { } private void loadStaticImage ( final String path ) { } private void newImage ( final String value ) { } }

Fix:
url = component . urlFor ( INTERFACE ) ;
Buggy code:
public class BundleInstallProcessor implements DeploymentUnitProcessor { private final AttachmentKey < ServiceName > BUNDLE_INSTALL_SERVICE = AttachmentKey . create ( ServiceName . class ) ; private final InitialDeploymentTracker deploymentTracker ; public BundleInstallProcessor ( InitialDeploymentTracker deploymentTracker ) { } @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( final DeploymentUnit depUnit ) { } private void restoreStorageState ( final DeploymentPhaseContext phaseContext , final Deployment deployment ) { ServiceRegistry serviceRegistry = phaseContext . getServiceRegistry ( ) ; <START_BUG> BundleStorage storageProvider = ( ( BundleStorage ) ( serviceRegistry . getRequiredService ( BUNDLE_STORAGE ) . getValue ( ) ) ) ; <END_BUG> StorageState storageState = storageProvider . getStorageState ( deployment . getLocation ( ) ) ; if ( storageState != null ) { deployment . setAutoStart ( storageState . isPersistentlyStarted ( ) ) ; deployment . addAttachment ( StorageState . class , storageState ) ; } } }

Fix:
BundleStorage storageProvider = ( ( BundleStorage ) ( serviceRegistry . getRequiredService ( BUNDLE_STORAGE_PLUGIN ) . getValue ( ) ) ) ;
Buggy code:
public class DNSSECVerifier implements Verifier { class ByteArrayComparator implements Comparator { public int compare ( Object o1 , Object o2 ) throws ClassCastException { } } private Hashtable trustedKeys ; public DNSSECVerifier ( ) { } public synchronized void addTrustedKey ( KEYRecord key ) { } public void addTrustedKey ( Name name , PublicKey key ) { } private PublicKey findMatchingKey ( Enumeration e , int algorithm , int footprint ) { } private synchronized PublicKey findTrustedKey ( Name name , int algorithm , int footprint ) { } private PublicKey findCachedKey ( Cache cache , Name name , int algorithm , int footprint ) { <START_BUG> RRset [ ] keysets = cache . findAnyRecords ( name , KEY , ANY ) ; <END_BUG> if ( keysets == null ) return null ; RRset keys = keysets [ 0 ] ; if ( ( keys . getSecurity ( ) ) < ( DNSSEC . Secure ) ) return null ; return findMatchingKey ( keys . rrs ( ) , algorithm , footprint ) ; } private PublicKey findKey ( Cache cache , Name name , int algorithm , int footprint ) { } private byte verifySIG ( RRset set , SIGRecord sigrec , Cache cache ) { } public byte verify ( RRset set , Cache cache ) { } }

Fix:
RRset [ ] keysets = cache . findAnyRecords ( name , KEY ) ;
Buggy code:
public class CodeSnippetMessageSend extends MessageSend implements ProblemReasons , EvaluationConstants { EvaluationContext evaluationContext ; FieldBinding delegateThis ; public CodeSnippetMessageSend ( EvaluationContext evaluationContext ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ! ( flowInfo . isReachable ( ) ) ) return ; if ( ( ( ( binding . declaringClass ) != ( this . qualifyingType ) ) && ( ! ( this . qualifyingType . isArrayType ( ) ) ) ) && ( ( ( ( ( currentScope . environment ( ) . options . targetJDK ) >= ( JDK1_2 ) ) && ( ( ! ( receiver . isImplicitThis ( ) ) ) || ( ! ( binding . isStatic ( ) ) ) ) ) && ( ( binding . declaringClass . id ) != ( T_Object ) ) ) || ( ! ( binding . declaringClass . canBeSeenBy ( currentScope ) ) ) ) ) { <START_BUG> codegenBinding = currentScope . enclosingSourceType ( ) . getUpdatedMethodBinding ( binding , ( ( ReferenceBinding ) ( this . qualifyingType ) ) ) ; <END_BUG> } } public TypeBinding resolveType ( BlockScope scope ) { } }

Fix:
this . codegenBinding = currentScope . enclosingSourceType ( ) . getUpdatedMethodBinding ( binding , ( ( ReferenceBinding ) ( this . qualifyingType ) ) ) ;
Buggy code:
public class TypeConverter { <START_BUG> public static TypeDeclaration buildTypeDeclaration ( IType type , CompilationUnitDeclaration compilationUnit , CompilationResult compilationResult , ProblemReporter problemReporter ) throws JavaModelException { <END_BUG> char [ ] packageName = type . getPackageFragment ( ) . getElementName ( ) . toCharArray ( ) ; if ( ( packageName != null ) && ( ( packageName . length ) > 0 ) ) { compilationUnit . currentPackage = new ImportReference ( CharOperation . splitOn ( '.' , packageName ) , new long [ ] { 0 } , false ) ; } TypeDeclaration typeDeclaration = TypeConverter . convert ( type , null , null , compilationResult ) ; IType alreadyComputedMember = type ; IType parent = type . getDeclaringType ( ) ; TypeDeclaration previousDeclaration = typeDeclaration ; while ( parent != null ) { TypeDeclaration declaration = TypeConverter . convert ( parent , alreadyComputedMember , ( ( MemberTypeDeclaration ) ( previousDeclaration ) ) , compilationResult ) ; alreadyComputedMember = parent ; previousDeclaration = declaration ; parent = parent . getDeclaringType ( ) ; } compilationUnit . types = new TypeDeclaration [ ] { previousDeclaration } ; return typeDeclaration ; } private static FieldDeclaration convert ( IField field , IType type ) throws JavaModelException { } private static AbstractMethodDeclaration convert ( IMethod method , IType type , CompilationResult compilationResult ) throws JavaModelException { } private static TypeDeclaration convert ( IType type , IType alreadyComputedMember , MemberTypeDeclaration alreadyComputedMemberDeclaration , CompilationResult compilationResult ) throws JavaModelException { } private static TypeReference createTypeReference ( char [ ] type , IType contextType ) { } }

Fix:
public static TypeDeclaration buildTypeDeclaration ( IType type , CompilationUnitDeclaration compilationUnit , CompilationResult compilationResult ) throws JavaModelException {
Buggy code:
public class WsMovieTest extends AbstractRodolpheTestCase { @ Inject private WsMovie wsMovie ; @ Test public void testGetMovies ( ) { final MovieCriteria movieCriteria = new MovieCriteria ( ) ; movieCriteria . setTitle ( "Fantastic" ) ; <START_BUG> final UiListState uiListState = new UiListState ( 0 , 0 , null , false , null ) ; <END_BUG> wsMovie . getMovies ( movieCriteria , uiListState ) ; } }

Fix:
final UiListState uiListState = new UiListState ( 50 , 0 , null , false , null ) ;
Buggy code:
public class FromR2rmlConverterTest { @ Test public void testFromR2rml ( ) { <START_BUG> MappingConverterCMD . main ( new String [ ] { "src//test//resources//mapping-northwind.ttl" } ) ; <END_BUG> } }

Fix:
MappingConverterCMD . main ( new String [ ] { "src//test//resources//npd-v2-ql_test_a.ttl" } ) ;
Buggy code:
public abstract class AjaxHandler implements IBehaviour , IBehaviourListener , IHeaderContributor , IBodyOnloadContributor { private Component component ; private IResourceStream resourceStream ; private static final ThreadLocal bodyOnloadContribHolder = new ThreadLocal ( ) ; private static final ThreadLocal headContribHolder = new ThreadLocal ( ) ; public AjaxHandler ( ) { } public final String getBodyOnload ( ) { } public final void renderHead ( HtmlHeaderContainer container ) { } public final void onComponentTag ( Component component , ComponentTag tag ) { } public void onComponentTag ( ComponentTag tag ) { } public void detachModel ( ) { } public final String getCallbackUrl ( ) { } protected abstract String getImplementationId ( ) { } protected IResourceStream getResponse ( ) { } protected void renderHeadInitContribution ( HtmlHeaderContainer container ) { } protected void renderHeadContribution ( HtmlHeaderContainer container ) { } protected final Component getComponent ( ) { } protected void onBind ( ) { } protected String getBodyOnloadInitContribution ( ) { } protected String getBodyOnloadContribution ( ) { } public void rendered ( Component hostComponent ) { } protected void onComponentRendered ( ) { } protected String getResponseType ( ) { } protected void addJsReference ( HtmlHeaderContainer container , PackageResourceReference ref ) { } public final void bind ( Component hostComponent ) { } public final void onRequest ( ) { } protected void respond ( ) { RequestCycle requestCycle = RequestCycle . get ( ) ; IResourceStream resourceStream = getResponse ( ) ; if ( resourceStream != null ) { requestCycle . setRequestTarget ( new wicket . request . ResourceStreamRequestTarget ( resourceStream , getResponseType ( ) ) ) ; } else { <START_BUG> requestCycle . setRequestTarget ( new EmptyRequestTarget ( ) ) ; <END_BUG> } } private final void write ( HtmlHeaderContainer container , String s ) { } }

Fix:
requestCycle . setRequestTarget ( EmptyRequestTarget . getInstance ( ) ) ;
Buggy code:
public class JaxrsDependencyProcessor implements DeploymentUnitProcessor { public static ModuleIdentifier RESTEASY_ATOM = ModuleIdentifier . create ( "org.jboss.resteasy.resteasy-atom-provider" ) ; public static ModuleIdentifier RESTEASY_CDI = ModuleIdentifier . create ( "org.jboss.resteasy.resteasy-cdi" ) ; public static ModuleIdentifier RESTEASY_JAXRS = ModuleIdentifier . create ( "org.jboss.resteasy.resteasy-jaxrs" ) ; public static ModuleIdentifier RESTEASY_JAXB = ModuleIdentifier . create ( "org.jboss.resteasy.resteasy-jaxb-provider" ) ; public static ModuleIdentifier RESTEASY_JACKSON = ModuleIdentifier . create ( "org.jboss.resteasy.resteasy-jackson-provider" ) ; public static ModuleIdentifier RESTEASY_JSAPI = ModuleIdentifier . create ( "org.jboss.resteasy.resteasy-jsapi" ) ; public static ModuleIdentifier RESTEASY_MULTIPART = ModuleIdentifier . create ( "org.jboss.resteasy.resteasy-multipart-provider" ) ; public static ModuleIdentifier ASYNC_HTTP_SERVLET_30 = ModuleIdentifier . create ( "org.jboss.resteasy.async-http-servlet-30" ) ; public static ModuleIdentifier JAXB_API = ModuleIdentifier . create ( "javax.xml.bind.api" ) ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void addDepdenency ( ModuleSpecification moduleSpecification , ModuleLoader moduleLoader , ModuleIdentifier moduleIdentifier ) { <START_BUG> moduleSpecification . addDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , moduleIdentifier , false , false , false ) ) ; <END_BUG> } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , moduleIdentifier , false , false , false ) ) ;
Buggy code:
public class MethodData extends ItemData { Method method ; public MethodData ( Method method , String str ) { } public static String [ ] getAllFlags ( ) { <START_BUG> return new String [ ] { FLAG_NO_GEN , FLAG_ADDRESS , FLAG_CONST , FLAG_DYNAMIC , FLAG_JNI , FLAG_CPP , FLAG_NEW , FLAG_DELETE } ; <END_BUG> } public Method getMethod ( ) { } public String getAccessor ( ) { } public String getExclude ( ) { } public void setAccessor ( String str ) { } public void setExclude ( String str ) { } }

Fix:
return new String [ ] { FLAG_NO_GEN , FLAG_ADDRESS , FLAG_CONST , FLAG_STRUCT , FLAG_DYNAMIC , FLAG_JNI , FLAG_CPP , FLAG_NEW , FLAG_DELETE , FLAG_GCNEW , FLAG_GCOBJECT , FLAG_SETTER , FLAG_GETTER , FLAG_ADDER } ;
Buggy code:
public class TestInMemoryQueryMatchEscapes extends TestCase { private EntityManagerFactory emf ; public void setUp ( ) { <START_BUG> Map options = new HashMap ( ) ; <END_BUG> options . put ( "openjpa.MetaDataFactory" , ( ( "jpa(Types=" + ( AllFieldTypes . class . getName ( ) ) ) + ")" ) ) ; emf = Persistence . createEntityManagerFactory ( "test" , options ) ; } public void testDatabaseEscape ( ) { } public void testInMemoryEscape ( ) { } private OpenJPAQuery escapeHelper ( boolean inMem ) { } }

Fix:
Map options = new HashMap ( System . getProperties ( ) ) ;
Buggy code:
abstract class XSDAbstractTraverser { protected XSDHandler fSchemaHandler = null ; protected SymbolTable fSymbolTable = null ; protected XSAttributeChecker fAttrChecker = null ; protected XMLErrorReporter fErrorReporter = null ; XSDAbstractTraverser ( XSDHandler handler , XMLErrorReporter errorReporter , XSAttributeChecker attrChecker ) { } void reset ( ) { } void setSymbolTable ( SymbolTable table ) { } int traverseAnnotationDecl ( Element annotationDecl , Object [ ] parentAttrs , boolean isGlobal , XSDocumentInfo schemaDoc ) { Object [ ] attrValues = fAttrChecker . checkAttributes ( annotationDecl , isGlobal , schemaDoc . fNamespaceSupport ) ; fAttrChecker . returnAttrArray ( attrValues , schemaDoc . fNamespaceSupport ) ; for ( Element child = DOMUtil . getFirstChildElement ( annotationDecl ) ; child != null ; child = DOMUtil . getNextSiblingElement ( child ) ) { String name = child . getLocalName ( ) ; if ( ! ( ( name . equals ( ELT_APPINFO ) ) || ( name . equals ( ELT_DOCUMENTATION ) ) ) ) { reportGenericSchemaError ( "an<seq2seq4repair_space><annotation><seq2seq4repair_space>can<seq2seq4repair_space>only<seq2seq4repair_space>contain<seq2seq4repair_space><appinfo><seq2seq4repair_space>and<seq2seq4repair_space><documentation><seq2seq4repair_space>elements" ) ; } attrValues = fAttrChecker . checkAttributes ( child , true , schemaDoc . fNamespaceSupport ) ; fAttrChecker . returnAttrArray ( attrValues , schemaDoc . fNamespaceSupport ) ; } <START_BUG> return - 1 ; <END_BUG> } void reportGenericSchemaError ( String error ) { } Element checkContent ( Element elm , Element content , boolean isEmpty ) { } void checkNotationType ( String refName , XSType typeDecl ) { } }

Fix:
return XSDHandler . I_EMPTY_DECL ;
Buggy code:
public class AspectJElementHierarchy implements IHierarchy { protected IProgramElement root = null ; protected String configFile = null ; private Map fileMap = null ; public IProgramElement getElement ( String handle ) { } public IProgramElement getRoot ( ) { } public void setRoot ( IProgramElement root ) { } public void addToFileMap ( Object key , Object value ) { } public void setFileMap ( HashMap fileMap ) { } public Object findInFileMap ( Object key ) { } public Set getFileMapEntrySet ( ) { } public boolean isValid ( ) { } public IProgramElement findElementForSignature ( IProgramElement parent , IProgramElement . Kind kind , String signature ) { } public IProgramElement findElementForLabel ( IProgramElement parent , IProgramElement . Kind kind , String label ) { } public IProgramElement findElementForType ( String packageName , String typeName ) { } private IProgramElement findClassInNodes ( Collection nodes , String name ) { } public IProgramElement findElementForSourceFile ( String sourceFile ) { } public IProgramElement findElementForSourceLine ( ISourceLocation location ) { } public IProgramElement findElementForSourceLine ( String sourceFilePath , int lineNumber ) { } private IProgramElement createFileStructureNode ( String sourceFilePath ) { } private IProgramElement findNodeForSourceLineHelper ( IProgramElement node , String sourceFilePath , int lineNumber ) { } private boolean matches ( IProgramElement node , String sourceFilePath , int lineNumber ) { } private boolean hasMoreSpecificChild ( IProgramElement node , String sourceFilePath , int lineNumber ) { } public String getConfigFile ( ) { } public void setConfigFile ( String configFile ) { } public IProgramElement findElementForHandle ( String handle ) { <START_BUG> StringTokenizer st = new StringTokenizer ( handle , IProgramElement . ID_DELIM ) ; <END_BUG> String file = st . nextToken ( ) ; int line = new Integer ( st . nextToken ( ) ) . intValue ( ) ; int col = new Integer ( st . nextToken ( ) ) . intValue ( ) ; return findElementForSourceLine ( file , line ) ; } }

Fix:
StringTokenizer st = new StringTokenizer ( handle , ProgramElement . ID_DELIM ) ;
Buggy code:
public class Transformer { private final RewritePolicy policy ; public Transformer ( ) { } public Transformer ( RewritePolicy policy ) { } public byte [ ] transfrom ( String name , byte [ ] data ) { } public byte [ ] transform ( String name , InputStream is ) throws IOException { } protected ClassWriter transform ( String name , ClassReader reader ) { ClassWriter writer = new ClassWriter ( reader , ( ( ClassWriter . COMPUTE_FRAMES ) | ( ClassWriter . COMPUTE_MAXS ) ) ) ; ClassVisitor visitor = new com . github . wolf480pl . sandbox . core . rewrite . SandboxAdapter ( writer , policy ) ; ClassVisitor checker = new org . objectweb . asm . util . CheckClassAdapter ( visitor ) ; <START_BUG> reader . accept ( checker , ( ( ClassReader . SKIP_DEBUG ) | ( ClassReader . SKIP_FRAMES ) ) ) ; <END_BUG> return writer ; } }

Fix:
reader . accept ( checker , ( ( ClassReader . SKIP_DEBUG ) | ( ClassReader . EXPAND_FRAMES ) ) ) ;
Buggy code:
public class JmsCFRemoveHandler extends BatchModeCommandHandler { private final ArgumentWithValue profile ; private final ArgumentWithValue name ; public JmsCFRemoveHandler ( ) { } @ Override public ModelNode buildRequest ( CommandContext ctx ) throws CommandFormatException { final String name = this . name . getValue ( ctx . getParsedArguments ( ) , true ) ; DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder ( ) ; if ( ctx . isDomainMode ( ) ) { final String profile = this . profile . getValue ( ctx . getParsedArguments ( ) ) ; if ( profile == null ) { throw new OperationFormatException ( "Required<seq2seq4repair_space>argument<seq2seq4repair_space>--profile<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ; } builder . addNode ( "profile" , profile ) ; } <START_BUG> builder . addNode ( "subsystem" , "jms" ) ; <END_BUG> builder . addNode ( "connection-factory" , name ) ; builder . setOperationName ( "remove" ) ; return builder . buildRequest ( ) ; } }

Fix:
builder . addNode ( "subsystem" , "messaging" ) ;
Buggy code:
public class RainbowUtil { public static SimpleDateFormat shortDateFormat = new SimpleDateFormat ( "MM//dd//yyyy" ) ; public static String GetDateStringFromLong ( long dt ) { } public static String FullTranslate ( String parm ) { } public static String ConcatArgs ( String [ ] args , int startIdx ) { } public static boolean IsCharLetterOrDigit ( char ch ) { } public static String StringReplace ( String src , String key , String val ) { } public static String SpecialTranslate ( String txt ) { } public static String TranslateColorString ( String parm , boolean IsOp ) { } public static String TranslateColorString ( String parm , boolean IsOp , boolean fAllowSpaces ) { StringBuilder res = new StringBuilder ( ) ; boolean pending = false ; for ( int i = 0 ; i < ( parm . length ( ) ) ; i ++ ) { char ch = parm . charAt ( i ) ; if ( ( ! pending ) && ( ch == '&' ) ) { pending = true ; } else if ( pending ) { pending = false ; <START_BUG> if ( ( ch == '0' ) && IsOp ) { <END_BUG> res . append ( BLACK ) ; } else if ( ch == '1' ) { res . append ( DARK_BLUE ) ; } else if ( ch == '2' ) { res . append ( DARK_GREEN ) ; } else if ( ch == '3' ) { res . append ( DARK_AQUA ) ; } else if ( ch == '4' ) { res . append ( DARK_RED ) ; } else if ( ch == '5' ) { res . append ( DARK_PURPLE ) ; } else if ( ch == '6' ) { res . append ( GOLD ) ; } else if ( ch == '7' ) { res . append ( GRAY ) ; } else if ( ch == '8' ) { res . append ( DARK_GRAY ) ; } else if ( ch == '9' ) { res . append ( BLUE ) ; } else if ( ch == 'a' ) { res . append ( GREEN ) ; } else if ( ch == 'b' ) { res . append ( AQUA ) ; } else if ( ch == 'c' ) { res . append ( RED ) ; } else if ( ch == 'd' ) { res . append ( LIGHT_PURPLE ) ; } else if ( ch == 'e' ) { res . append ( YELLOW ) ; } else if ( ch == 'f' ) { res . append ( WHITE ) ; } else if ( ch == 'l' ) { res . append ( BOLD ) ; } else if ( ch == 'm' ) { res . append ( STRIKETHROUGH ) ; } else if ( ( ch == 'k' ) && IsOp ) { res . append ( MAGIC ) ; } else if ( ( ch == 'n' ) && IsOp ) { res . append ( UNDERLINE ) ; } else if ( ch == 'o' ) { res . append ( ITALIC ) ; } else if ( ch == 'r' ) { res . append ( RESET ) ; } else { if ( ch != '&' ) continue ; res . append ( "&" ) ; } } else if ( IsOp ) { res . append ( ch ) ; } else if ( RainbowUtil . IsCharLetterOrDigit ( ch ) ) { res . append ( ch ) ; } else { if ( ( ! fAllowSpaces ) || ( ch != '<seq2seq4repair_space>' ) ) continue ; res . append ( ch ) ; } } return res . toString ( ) ; } public static String TimeDeltaString_JustMinutesSecs ( long ms ) { } public static String TimeDeltaString ( long ms ) { } public static String TextLabel ( String str , int padLen ) { } public static String TextAlignTrailerPerfect ( String str , int padLen ) { } public static String GetTimeStringFromLong ( long ms ) { } static long GetMSFromString ( String strTime ) { } }

Fix:
if ( ch == '0' ) {
Buggy code:
public class DOMWriterImpl implements DOMConfiguration , DOMWriter { private String fEncoding ; private XMLSerializer serializer ; public DOMWriterImpl ( ) { } public DOMConfiguration getConfig ( ) { } public void setParameter ( String name , Object value ) throws DOMException { } public boolean canSetParameter ( String name , Object state ) { } public Object getParameter ( String name ) throws DOMException { } public String getEncoding ( ) { } public void setEncoding ( String encoding ) { } public DOMErrorHandler getErrorHandler ( ) { } public void setErrorHandler ( DOMErrorHandler errorHandler ) { } public boolean writeNode ( OutputStream destination , Node wnode ) { } public String writeToString ( Node wnode ) throws DOMException { } public void setNewLine ( String newLine ) { } public String getNewLine ( ) { } public DOMWriterFilter getFilter ( ) { } public void setFilter ( DOMWriterFilter filter ) { } private boolean reset ( ) { } private void checkAllFeatures ( ) { <START_BUG> if ( getFeature ( DOM_WHITESPACE_IN_ELEMENT_CONTENT ) ) <END_BUG> serializer . _format . setPreserveSpace ( true ) ; else serializer . _format . setPreserveSpace ( false ) ; } }

Fix:
if ( ( getParameter ( DOM_WHITESPACE_IN_ELEMENT_CONTENT ) ) == ( Boolean . TRUE ) )
Buggy code:
public class TypeValidator extends StringValidator { private static final long serialVersionUID = 1L ; private Locale locale = null ; private Class type ; public TypeValidator ( final Class type ) { } public TypeValidator ( final Class type , final Locale locale ) { } public final Class getType ( ) { } public void onValidate ( FormComponent formComponent , String value ) { } public String toString ( ) { } protected Map messageModel ( FormComponent formComponent , final ConversionException e ) { final Map model = super . messageModel ( formComponent ) ; <START_BUG> model . put ( "type" , Classes . name ( type ) ) ; <END_BUG> final Locale locale = e . getLocale ( ) ; if ( locale != null ) { model . put ( "locale" , locale ) ; } model . put ( "exception" , e ) ; Format format = e . getFormat ( ) ; if ( format instanceof SimpleDateFormat ) { model . put ( "format" , ( ( SimpleDateFormat ) ( format ) ) . toLocalizedPattern ( ) ) ; } return model ; } private final Locale getLocale ( ) { } }

Fix:
model . put ( "type" , Classes . simpleName ( type ) ) ;
Buggy code:
public class SubLine extends AbstractSubHyperplane < Euclidean2D , Euclidean1D > { public SubLine ( final Hyperplane < Euclidean2D > hyperplane , final Region < Euclidean1D > remainingRegion ) { } public SubLine ( final Vector2D start , final Vector2D end ) { } public SubLine ( final Segment segment ) { } public List < Segment > getSegments ( ) { final Line line = ( ( Line ) ( getHyperplane ( ) ) ) ; final List < Interval > list = ( ( IntervalsSet ) ( getRemainingRegion ( ) ) ) . asList ( ) ; <START_BUG> final List < Segment > segments = new ArrayList < Segment > ( ) ; <END_BUG> for ( final Interval interval : list ) { final Vector2D start = line . toSpace ( new org . apache . commons . math3 . geometry . euclidean . oned . Vector1D ( interval . getInf ( ) ) ) ; final Vector2D end = line . toSpace ( new org . apache . commons . math3 . geometry . euclidean . oned . Vector1D ( interval . getSup ( ) ) ) ; segments . add ( new Segment ( start , end , line ) ) ; } return segments ; } public Vector2D intersection ( final SubLine subLine , final boolean includeEndPoints ) { } private static IntervalsSet buildIntervalSet ( final Vector2D start , final Vector2D end ) { } @ Override protected AbstractSubHyperplane < Euclidean2D , Euclidean1D > buildNew ( final Hyperplane < Euclidean2D > hyperplane , final Region < Euclidean1D > remainingRegion ) { } @ Override public Side side ( final Hyperplane < Euclidean2D > hyperplane ) { } @ Override public SplitSubHyperplane < Euclidean2D > split ( final Hyperplane < Euclidean2D > hyperplane ) { } }

Fix:
final List < Segment > segments = new ArrayList < Segment > ( list . size ( ) ) ;
Buggy code:
@ Controller @ RequestMapping ( "//owners//{ownerId}//pets//new" ) @ SessionAttributes ( "pet" ) public class AddPetForm { private final Clinic clinic ; @ Autowired public AddPetForm ( Clinic clinic ) { } @ ModelAttribute ( "types" ) public Collection < PetType > populatePetTypes ( ) { } @ InitBinder public void setAllowedFields ( WebDataBinder dataBinder ) { <START_BUG> dataBinder . setDisallowedFields ( new String [ ] { "id" } ) ; <END_BUG> } @ RequestMapping ( method = RequestMethod . GET ) public String setupForm ( @ PathVariable ( "ownerId" ) int ownerId , Model model ) { } @ RequestMapping ( method = RequestMethod . POST ) public String processSubmit ( @ ModelAttribute ( "pet" ) Pet pet , BindingResult result , SessionStatus status ) { } }

Fix:
dataBinder . setDisallowedFields ( "id" ) ;
Buggy code:
public class WebFragmentParsingDeploymentProcessor implements DeploymentUnitProcessor { private static final String WEB_FRAGMENT_XML = "META-INF//web-fragment.xml" ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ! ( DeploymentTypeMarker . isType ( WAR , deploymentUnit ) ) ) { return ; } WarMetaData warMetaData = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; assert warMetaData != null ; Map < String , WebFragmentMetaData > webFragments = warMetaData . getWebFragmentsMetaData ( ) ; if ( webFragments == null ) { webFragments = new HashMap < String , WebFragmentMetaData > ( ) ; warMetaData . setWebFragmentsMetaData ( webFragments ) ; } List < ResourceRoot > resourceRoots = deploymentUnit . getAttachment ( RESOURCE_ROOTS ) ; if ( resourceRoots == null ) { return ; } for ( ResourceRoot resourceRoot : resourceRoots ) { <START_BUG> if ( resourceRoot . getRoot ( ) . getLowerCaseName ( ) . endsWith ( ".jar" ) ) { <END_BUG> VirtualFile webFragment = resourceRoot . getRoot ( ) . getChild ( WebFragmentParsingDeploymentProcessor . WEB_FRAGMENT_XML ) ; if ( ( webFragment . exists ( ) ) && ( webFragment . isFile ( ) ) ) { InputStream is = null ; try { is = webFragment . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; inputFactory . setXMLResolver ( NoopXMLResolver . create ( ) ) ; XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( is ) ; webFragments . put ( resourceRoot . getRootName ( ) , WebFragmentMetaDataParser . parse ( xmlReader ) ) ; } catch ( XMLStreamException e ) { throw new DeploymentUnitProcessingException ( WebMessages . MESSAGES . failToParseXMLDescriptor ( webFragment , e . getLocation ( ) . getLineNumber ( ) , e . getLocation ( ) . getColumnNumber ( ) ) ) ; } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( WebMessages . MESSAGES . failToParseXMLDescriptor ( webFragment ) , e ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } } } } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
if ( resourceRoot . getRoot ( ) . getName ( ) . toLowerCase ( ) . endsWith ( ".jar" ) ) {
Buggy code:
public class InjectedSocketBindingStreamServerService extends AbstractStreamServerService { private final InjectedValue < SocketBinding > socketBindingValue = new InjectedValue < SocketBinding > ( ) ; public InjectedSocketBindingStreamServerService ( final OptionMap connectorPropertiesOptionMap ) { } public InjectedValue < SocketBinding > getSocketBindingInjector ( ) { } @ Override public void start ( final StartContext context ) throws StartException { super . start ( context ) ; <START_BUG> RemotingConnectorBindingInfoService . install ( context . getChildTarget ( ) , context . getController ( ) . getName ( ) . getSimpleName ( ) , getSocketBinding ( ) , REMOTE ) ; <END_BUG> } @ Override public void stop ( final StopContext context ) { } @ Override InetSocketAddress getSocketAddress ( ) { } @ Override ManagedBinding registerSocketBinding ( SocketBindingManager socketBindingManager ) { } @ Override void unregisterSocketBinding ( ManagedBinding managedBinding , SocketBindingManager socketBindingManager ) { } public SocketBinding getSocketBinding ( ) { } }

Fix:
RemotingConnectorBindingInfoService . install ( context . getChildTarget ( ) , context . getController ( ) . getName ( ) . getSimpleName ( ) , getSocketBinding ( ) , REMOTE . toString ( ) ) ;