nus-yam/ex-repair huggingface dataset:
Buggy code:
public class LogicLargeArray extends LargeArray { private static final long serialVersionUID = 3135411647668758832L ; private byte [ ] data ; public LogicLargeArray ( long length ) { } public LogicLargeArray ( long length , boolean zeroNativeMemory ) { } public LogicLargeArray ( long length , byte constantValue ) { } public LogicLargeArray ( byte [ ] data ) { } public LogicLargeArray ( boolean [ ] data ) { } @ Override public LogicLargeArray clone ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public Boolean get ( long i ) { } @ Override public Boolean getFromNative ( long i ) { } @ Override public boolean getBoolean ( long i ) { } @ Override public byte getByte ( long i ) { } @ Override public short getShort ( long i ) { } @ Override public int getInt ( long i ) { } @ Override public long getLong ( long i ) { } @ Override public float getFloat ( long i ) { } @ Override public double getDouble ( long i ) { } @ Override public boolean [ ] getBooleanData ( boolean [ ] a , long startPos , long endPos , long step ) { } @ Override public boolean [ ] getBooleanData ( ) { } @ Override public byte [ ] getData ( ) { } @ Override public byte [ ] getByteData ( ) { } @ Override public byte [ ] getByteData ( byte [ ] a , long startPos , long endPos , long step ) { } @ Override public short [ ] getShortData ( ) { } @ Override public short [ ] getShortData ( short [ ] a , long startPos , long endPos , long step ) { } @ Override public int [ ] getIntData ( ) { } @ Override public int [ ] getIntData ( int [ ] a , long startPos , long endPos , long step ) { } @ Override public long [ ] getLongData ( ) { } @ Override public long [ ] getLongData ( long [ ] a , long startPos , long endPos , long step ) { } @ Override public float [ ] getFloatData ( ) { } @ Override public float [ ] getFloatData ( float [ ] a , long startPos , long endPos , long step ) { } @ Override public double [ ] getDoubleData ( ) { } @ Override public double [ ] getDoubleData ( double [ ] a , long startPos , long endPos , long step ) { } @ Override public void setToNative ( long i , Object value ) { } @ Override public void setBoolean ( long i , boolean value ) { } @ Override public void setByte ( long i , byte value ) { } @ Override public void setShort ( long i , short value ) { } @ Override public void setInt ( long i , int value ) { } @ Override public void setLong ( long i , long value ) { } @ Override public void setFloat ( long i , float value ) { } @ Override public void setDouble ( long i , double value ) { } public LogicLargeArray and ( LogicLargeArray array ) { } public LogicLargeArray or ( LogicLargeArray array ) { } public LogicLargeArray xor ( LogicLargeArray array ) { } public LogicLargeArray not ( ) { LogicLargeArray out = new LogicLargeArray ( length , false ) ; for ( long i = 0 ; i < ( length ) ; i ++ ) { <START_BUG> out . setByte ( i , ( ( byte ) ( ~ ( getByte ( i ) ) ) ) ) ; <END_BUG> } return out ; } }

Fix:
out . setByte ( i , ( ( byte ) ( 1 - ( getByte ( i ) ) ) ) ) ;
Buggy code:
public class ORMInsertAnalyzer extends ORMSqlAnalyzer { public ORMInsertAnalyzer ( DAOSupportSession session ) { } @ Override public SqlType getSqlType ( ) { } @ Override protected void mapping ( Object obj ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>" ) ; builder . append ( getTableName ( obj ) ) ; builder . append ( "<seq2seq4repair_space>(" ) ; Field [ ] fields = ReflectUtil . getAllField ( obj . getClass ( ) ) ; boolean first = true ; for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { Object generatedValue = null ; Field field = fields [ i ] ; if ( AnnotationUtil . isKey ( field ) ) { Key key = field . getAnnotation ( Key . class ) ; KeyPolicy keyPolicy = key . policy ( ) ; if ( ( KeyPolicy . AUTO_INC_POLICY ) == keyPolicy ) { continue ; } else if ( ( KeyPolicy . UUID_POLICY ) == keyPolicy ) { generatedValue = UUID . randomUUID ( ) . toString ( ) ; } else if ( ( KeyPolicy . SEQUENCE_POLICY ) == keyPolicy ) { String sequenceName = key . sequenceName ( ) ; if ( StringUtil . isEmpty ( sequenceName ) ) { throw new SqlAnalyzeException ( "Sequence<seq2seq4repair_space>Name<seq2seq4repair_space>is<seq2seq4repair_space>required<seq2seq4repair_space>for<seq2seq4repair_space>SEQUENCE_POLICY<seq2seq4repair_space>key." ) ; } generatedValue = new com . elminster . easydao . db . analyze . data . SeqenceSelectValue ( getDialect ( ) , sequenceName ) ; } else if ( ( KeyPolicy . GUID_POLICY ) == keyPolicy ) { generatedValue = new com . elminster . easydao . db . analyze . data . GUIDSelectValue ( getDialect ( ) ) ; } } if ( AnnotationUtil . isColumn ( field ) ) { if ( ! first ) { builder . append ( ",<seq2seq4repair_space>" ) ; } else { first = false ; } builder . append ( getColumnName ( field , getColumnConverter ( obj ) ) ) ; try { Object value ; <START_BUG> if ( null == generatedValue ) { <END_BUG> value = generatedValue ; } else { value = ReflectUtil . getFieldValue ( obj , field ) ; value = AnnotationUtil . getCustomerDBValue ( field , value ) ; } analyzedSqlParameters . add ( value ) ; } catch ( IllegalArgumentException e ) { throw new SqlAnalyzeException ( e ) ; } catch ( IllegalAccessException e ) { throw new SqlAnalyzeException ( e ) ; } } } builder . append ( ")<seq2seq4repair_space>VALUES<seq2seq4repair_space>(" ) ; for ( int i = 0 ; i < ( analyzedSqlParameters . size ( ) ) ; i ++ ) { if ( 0 != i ) { builder . append ( ",<seq2seq4repair_space>" ) ; } builder . append ( "?" ) ; } builder . append ( ")" ) ; analyzedSql = builder . toString ( ) ; } }

Fix:
if ( null != generatedValue ) {
Buggy code:
public class Settings { public static void write ( Context context , String frequency , long value ) { SharedPreferences prefs = PreferenceManager . getDefaultSharedPreferences ( context ) ; <START_BUG> prefs . edit ( ) . putLong ( frequency , value ) . commit ( ) ; <END_BUG> } public static long read ( Context context , String key ) { } }

Fix:
prefs . edit ( ) . putLong ( frequency , value ) . apply ( ) ;
Buggy code:
public class WorkbenchContextSupport implements IWorkbenchContextSupport { private Map activationsBySubmission = null ; private IBindingService bindingService ; private IContextService contextService ; private ContextManagerLegacyWrapper contextManagerWrapper ; private final Workbench workbench ; public WorkbenchContextSupport ( final Workbench workbenchToSupport , final ContextManager contextManager ) { } public final void addEnabledSubmission ( final EnabledSubmission enabledSubmission ) { int sourcePriorities = 0 ; if ( ( enabledSubmission . getActivePartId ( ) ) != null ) { <START_BUG> sourcePriorities |= ISources . ACTIVE_PART ; <END_BUG> } if ( ( enabledSubmission . getActiveShell ( ) ) != null ) { sourcePriorities |= ( ISources . ACTIVE_SHELL ) | ( ISources . ACTIVE_WORKBENCH_WINDOW ) ; } if ( ( enabledSubmission . getActiveWorkbenchPartSite ( ) ) != null ) { sourcePriorities |= ISources . ACTIVE_SITE ; } final IContextActivation activation = contextService . activateContext ( enabledSubmission . getContextId ( ) , new org . eclipse . ui . LegacyHandlerSubmissionExpression ( enabledSubmission . getActivePartId ( ) , enabledSubmission . getActiveShell ( ) , enabledSubmission . getActiveWorkbenchPartSite ( ) ) ) ; if ( ( activationsBySubmission ) == null ) { activationsBySubmission = new HashMap ( ) ; } activationsBySubmission . put ( enabledSubmission , activation ) ; } public final void addEnabledSubmissions ( final Collection enabledSubmissions ) { } public final IContextManager getContextManager ( ) { } public final int getShellType ( Shell shell ) { } public final boolean isKeyFilterEnabled ( ) { } public final void openKeyAssistDialog ( ) { } public final boolean registerShell ( final Shell shell , final int type ) { } public final void removeEnabledSubmission ( final EnabledSubmission enabledSubmission ) { } public final void removeEnabledSubmissions ( final Collection enabledSubmissions ) { } public final void setKeyFilterEnabled ( final boolean enabled ) { } public final boolean unregisterShell ( final Shell shell ) { } }

Fix:
sourcePriorities |= ISources . ACTIVE_PART_ID ;
Buggy code:
public class CrMergeClasses extends CrUML { public CrMergeClasses ( ) { } public boolean predicate ( Object dm , Designer dsgr ) { if ( ! ( dm instanceof MMClass ) ) return NO_PROBLEM ; MMClass cls = ( ( MMClass ) ( dm ) ) ; Vector ends = cls . getAssociationEnd ( ) ; <START_BUG> if ( ( ends == null ) || ( ( ends . size ( ) ) > 1 ) ) <END_BUG> return NO_PROBLEM ; AssociationEnd myEnd = ( ( AssociationEnd ) ( ends . elementAt ( 0 ) ) ) ; IAssociation asc = myEnd . getAssociation ( ) ; Vector conns = asc . getConnection ( ) ; AssociationEnd ae0 = ( ( AssociationEnd ) ( conns . elementAt ( 0 ) ) ) ; AssociationEnd ae1 = ( ( AssociationEnd ) ( conns . elementAt ( 1 ) ) ) ; if ( ( ae0 . getMultiplicity ( ) . equals ( ONE ) ) && ( ae1 . getMultiplicity ( ) . equals ( ONE ) ) ) return PROBLEM_FOUND ; return NO_PROBLEM ; } }

Fix:
if ( ( ends == null ) || ( ( ends . size ( ) ) != 1 ) )
Buggy code:
public class Ssdp implements Runnable { public static String TAG = "SSDP" ; public static String SSDP_ADDRESS = "239.255.255.250" ; public static int SSDP_PORT = 1900 ; public static int SSDP_SOURCE_PORT = 1901 ; public static String SSDP_HOST = ( ( Ssdp . SSDP_ADDRESS ) + ":" ) + ( Ssdp . SSDP_PORT ) ; public static String MAX_AGE = "max-age=1800" ; public static int TTL = 128 ; public static int MX = 2 ; public static String ALIVE = "ssdp:alive" ; public static String BYEBYE = "ssdp:byebye" ; public static String UPDATE = "ssdp:update" ; public static String TYPE_M_SEARCH = "M-SEARCH" ; public static String TYPE_NOTIFY = "NOTIFY" ; public static String TYPE_200_OK = "200<seq2seq4repair_space>OK" ; private Ssdp . SsdpCallback mSsdpCallback ; private SocketAddress mMulticastGroup ; private DatagramSocket mMulticastSocket ; private Thread mThread ; public Ssdp ( Ssdp . SsdpCallback ssdpCallback ) throws IOException { } public synchronized boolean start ( Integer timeout ) throws IOException { if ( ( mThread ) == null ) { <START_BUG> mMulticastSocket = new MulticastSocket ( Ssdp . SSDP_PORT ) ; <END_BUG> if ( ( timeout != null ) && ( timeout > 0 ) ) { mMulticastSocket . setSoTimeout ( timeout ) ; } mThread = new Thread ( this ) ; mThread . start ( ) ; return true ; } return false ; } public synchronized boolean stop ( ) throws IOException { } public void search ( SsdpMessage msg ) throws IOException { } public SsdpMessage search ( String ST ) throws IOException { } @ Override public void run ( ) { } public interface SsdpCallback { public void onSsdpMessageReceived ( SsdpMessage ssdpMessage ) { } } }

Fix:
mMulticastSocket = new DatagramSocket ( Ssdp . SSDP_PORT ) ;
Buggy code:
public class Disjunction extends BinaryOperation { public Disjunction ( Formula left , Formula right ) { } public Disjunction ( Formula left , Formula right , LogicalValue value ) { } @ Override public Sequence [ ] expand ( Sequence sigma ) { } @ Override public Disjunction clone ( ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( "(" + ( right ) ) + ")<seq2seq4repair_space>||<seq2seq4repair_space>(" ) + ( left ) ) + ")" ; <END_BUG> } }

Fix:
return ( ( ( "(" + ( left ) ) + ")<seq2seq4repair_space>||<seq2seq4repair_space>(" ) + ( right ) ) + ")" ;
Buggy code:
public class PrefixHandler extends CommandHandlerWithHelp { private final ArgumentWithValue nodePath ; public PrefixHandler ( ) { } public PrefixHandler ( String command ) { } @ Override protected void doHandle ( CommandContext ctx ) { final String nodePath = this . nodePath . getValue ( ctx . getParsedCommandLine ( ) ) ; OperationRequestAddress prefix = ctx . getPrefix ( ) ; if ( nodePath == null ) { ctx . printLine ( ctx . getPrefixFormatter ( ) . format ( prefix ) ) ; return ; } CommandLineParser . CallbackHandler handler = new org . jboss . as . cli . operation . impl . DefaultCallbackHandler ( prefix ) ; try { ctx . getCommandLineParser ( ) . parse ( ctx . getArgumentsString ( ) , handler ) ; } catch ( CommandFormatException e ) { <START_BUG> ctx . printLine ( e . getLocalizedMessage ( ) ) ; <END_BUG> } } }

Fix:
ctx . error ( e . getLocalizedMessage ( ) ) ;
Buggy code:
public class LevelMatchFilter extends Filter { boolean acceptOnMatch = true ; Level levelToMatch ; public void setLevelToMatch ( String level ) { } public String getLevelToMatch ( ) { } public void setAcceptOnMatch ( boolean acceptOnMatch ) { } public boolean getAcceptOnMatch ( ) { } public int decide ( LoggingEvent event ) { if ( ( this . levelToMatch ) == null ) { return Filter . NEUTRAL ; } boolean matchOccured = false ; <START_BUG> if ( this . levelToMatch . equals ( event . level ) ) { <END_BUG> matchOccured = true ; } if ( matchOccured ) { if ( this . acceptOnMatch ) return Filter . ACCEPT ; else return Filter . DENY ; } else { return Filter . NEUTRAL ; } } }

Fix:
if ( this . levelToMatch . equals ( event . getLevel ( ) ) ) {
Buggy code:
public class WorkbenchControlAnimator extends ControlAnimator { private UIJob slideJob ; private Control control ; private int endY ; private boolean finished ; private boolean inTransition = false ; private int LONG_DELAY = 1000 ; private int SHORT_DELAY = 25 ; public void setVisible ( boolean visible , Control control ) { this . control = control ; finished = false ; control . setVisible ( true ) ; Rectangle parentBounds = control . getParent ( ) . getBounds ( ) ; <START_BUG> int bottom = ( parentBounds . y ) + ( parentBounds . height ) ; <END_BUG> endY = ( visible ) ? bottom - ( control . getBounds ( ) . height ) : bottom ; if ( ( slideJob ) != null ) slideJob . cancel ( ) ; slideJob = getSlideJob ( ) ; control . addDisposeListener ( new DisposeListener ( ) { public void widgetDisposed ( DisposeEvent e ) { slideJob = null ; } } ) ; if ( ( ( getAnimationState ( ) ) == ( OPENING ) ) && ( ! ( inTransition ) ) ) { slideJob . schedule ( LONG_DELAY ) ; } else { slideJob . schedule ( SHORT_DELAY ) ; } } private UIJob getSlideJob ( ) { } }

Fix:
int bottom = parentBounds . height ;
Buggy code:
String tableName ; if ( splitTables ) { <START_BUG> tableName = ( "tbl" + ( player . getRealm ( ) ) ) + ( tableSuffix ) ; <END_BUG>

Fix:
tableName = ( "tbl" + ( player . getRealm ( ) . toLowerCase ( ) ) ) + ( tableSuffix ) ;
Buggy code:
public class MigrationManager implements IEndpointStateChangeSubscriber { private static final Logger logger = LoggerFactory . getLogger ( MigrationManager . class ) ; public void onJoin ( InetAddress endpoint , EndpointState epState ) { } public void onChange ( InetAddress endpoint , ApplicationState state , VersionedValue value ) { } public void onAlive ( InetAddress endpoint , EndpointState state ) { } public void onDead ( InetAddress endpoint , EndpointState state ) { } public void onRemove ( InetAddress endpoint ) { } public static void rectify ( UUID theirVersion , InetAddress endpoint ) { } public static void announce ( final UUID version , Set < InetAddress > hosts ) { MessageProducer prod = new CachingMessageProducer ( new MessageProducer ( ) { <START_BUG> public Message getMessage ( int protocolVersion ) throws IOException { <END_BUG> return MigrationManager . makeVersionMessage ( version , protocolVersion ) ; } } ) ; for ( InetAddress host : hosts ) { try { MessagingService . instance ( ) . sendOneWay ( prod . getMessage ( instance . getVersion ( host ) ) , host ) ; } catch ( IOException ex ) { throw new IOError ( ex ) ; } } MigrationManager . passiveAnnounce ( version ) ; } public static void passiveAnnounce ( UUID version ) { } public static void applyMigrations ( final UUID from , final UUID to ) throws IOException { } public static void pushMigrations ( UUID from , UUID to , InetAddress host ) { } private static Message makeVersionMessage ( UUID version , int protocolVersion ) { } private static Message makeMigrationMessage ( Collection < IColumn > migrations , int version ) throws IOException { } public static Collection < Column > makeColumns ( Message msg ) throws IOException { } }

Fix:
public Message getMessage ( Integer protocolVersion ) throws IOException {
Buggy code:
@ Retention ( RetentionPolicy . RUNTIME ) @ Target ( { ElementType . TYPE , ElementType . PACKAGE } ) @ Documented public @ interface JsNamespace { <START_BUG> String value ( ) default "" ; <END_BUG> }

Fix:
String value ( ) ;
Buggy code:
public class OSGiXServiceParseProcessor implements DeploymentUnitProcessor { public static final String XSERVICE_PROPERTIES_NAME = "META-INF//jbosgi-xservice.properties" ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; OSGiMetaData metadata = OSGiMetaDataAttachment . getOSGiMetaData ( deploymentUnit ) ; if ( metadata != null ) return ; VirtualFile virtualFile = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ; VirtualFile xserviceFile = virtualFile . getChild ( OSGiXServiceParseProcessor . XSERVICE_PROPERTIES_NAME ) ; if ( ( xserviceFile . exists ( ) ) == false ) return ; try { metadata = OSGiMetaDataBuilder . load ( xserviceFile . openStream ( ) ) ; OSGiMetaDataAttachment . attachOSGiMetaData ( deploymentUnit , metadata ) ; } catch ( IOException ex ) { <START_BUG> throw new DeploymentUnitProcessingException ( OSGiMessages . MESSAGES . cannotParse ( xserviceFile ) ) ; <END_BUG> } } @ Override public void undeploy ( final DeploymentUnit deploymentUnit ) { } }

Fix:
throw OSGiMessages . MESSAGES . cannotParseOSGiMetadata ( ex , xserviceFile ) ;
Buggy code:
public class BookmarkablePageRequestTarget implements IBookmarkablePageRequestTarget , IAccessCheck { private Page page ; private final Class pageClass ; private final String pageMapName ; private final PageParameters pageParameters ; public BookmarkablePageRequestTarget ( Class pageClass ) { } public BookmarkablePageRequestTarget ( Class pageClass , PageParameters pageParameters ) { } public BookmarkablePageRequestTarget ( String pageMapName , Class pageClass ) { } public BookmarkablePageRequestTarget ( String pageMapName , Class pageClass , PageParameters pageParameters ) { } public boolean checkAccess ( RequestCycle requestCycle ) { } public void cleanUp ( RequestCycle requestCycle ) { } public boolean equals ( Object obj ) { } public final Class getPageClass ( ) { } public final String getPageMapName ( ) { } public final PageParameters getPageParameters ( ) { } public int hashCode ( ) { } public void respond ( RequestCycle requestCycle ) { } public Object getLock ( RequestCycle requestCycle ) { } public String toString ( ) { } protected Page newPage ( Class pageClass , RequestCycle requestCycle ) { PageParameters params = pageParameters ; <START_BUG> IPageFactory pageFactory = requestCycle . getApplication ( ) . getSettings ( ) . getPageFactory ( ) ; <END_BUG> return pageFactory . newPage ( pageClass , params ) ; } private final Page getPage ( RequestCycle requestCycle ) { } }

Fix:
IPageFactory pageFactory = requestCycle . getApplication ( ) . getSessionSettings ( ) . getPageFactory ( ) ;
Buggy code:
public class Server implements Service < Server > { private final String defaultHost ; private final String name ; private final NameVirtualHostHandler virtualHostHandler = new NameVirtualHostHandler ( ) ; private final InjectedValue < ServletContainerService > servletContainer = new InjectedValue ( ) ; private final InjectedValue < UndertowService > undertowService = new InjectedValue ( ) ; private volatile HttpHandler root ; private final List < AbstractListenerService < ? > > listeners = new LinkedList < > ( ) ; private final Set < Host > hosts = new CopyOnWriteArraySet < > ( ) ; protected Server ( String name , String defaultHost ) { } @ Override public void start ( StartContext startContext ) throws StartException { } protected void registerListener ( AbstractListenerService < ? > listener ) { } protected void unregisterListener ( AbstractListenerService < ? > listener ) { <START_BUG> listeners . add ( listener ) ; <END_BUG> if ( listener . isSecure ( ) ) { servletContainer . getValue ( ) . unregisterSecurePort ( listener . getName ( ) ) ; } } protected void registerHost ( final Host host ) { } protected void unregisterHost ( Host host ) { } @ Override public void stop ( StopContext stopContext ) { } @ Override public Server getValue ( ) throws IllegalArgumentException , IllegalStateException { } protected InjectedValue < ServletContainerService > getServletContainer ( ) { } protected HttpHandler getRoot ( ) { } protected InjectedValue < UndertowService > getUndertowService ( ) { } public String getName ( ) { } public String getDefaultHost ( ) { } public Set < Host > getHosts ( ) { } public List < AbstractListenerService < ? > > getListeners ( ) { } }

Fix:
listeners . remove ( listener ) ;
Buggy code:
public class Match { private Murder plugin ; private boolean hasStarted = false ; private boolean hasGameStarted = false ; private Arena arena = null ; private int matchCountdownID = - 1 ; private int arenaLoopID = - 1 ; private List < MPlayer > mplayers ; public Match ( Murder plugin ) { } public MPlayer getClostestBystander ( Location locationFrom ) { } public void clearItems ( World world ) { } public void startMatch ( ) { } public void endMatch ( ) { } public boolean canMatchStart ( boolean showMessages ) { <START_BUG> if ( ( mplayers . size ( ) ) < 3 ) { <END_BUG> if ( showMessages ) { Tools . sendMessageAll ( plugin . getServer ( ) , ERROR_NOTENOUGHPLAYERSTOSTART ) ; } return false ; } return true ; } public void finishMatch ( ) { } public void selectActors ( ) { } public void updateSpectators ( ) { } public void checkForGameEnd ( ) { } public boolean isStarted ( ) { } public void setHasStarted ( boolean hasStarted ) { } public boolean isGameStarted ( ) { } public void kickDeadPlayers ( ) { } public void setHasGameStarted ( boolean hasGameStarted ) { } public List < MPlayer > getGunners ( ) { } public MPlayer getMurderer ( ) { } public void addMPlayer ( MPlayer mplayer ) { } public void removeMPlayer ( MPlayer mplayer ) { } public List < MPlayer > getMPlayers ( ) { } public MPlayer getMPlayer ( Player player ) { } public List < MPlayer > getBystandesr ( ) { } public List < MPlayer > getBystanders ( boolean ignoreGunner ) { } public Arena getArena ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( mplayers . size ( ) ) < 2 ) {
Buggy code:
public class LoggingWebSocketHandlerDecorator extends WebSocketHandlerDecorator { private final Log logger = LogFactory . getLog ( LoggingWebSocketHandlerDecorator . class ) ; public LoggingWebSocketHandlerDecorator ( WebSocketHandler delegate ) { } @ Override public void afterConnectionEstablished ( WebSocketSession session ) throws Exception { } @ Override public void handleMessage ( WebSocketSession session , WebSocketMessage < ? > message ) throws Exception { if ( logger . isDebugEnabled ( ) ) { <START_BUG> logger . debug ( ( ( ( "Received<seq2seq4repair_space>" + message ) + ",<seq2seq4repair_space>" ) + session ) ) ; <END_BUG> } super . handleMessage ( session , message ) ; } @ Override public void handleTransportError ( WebSocketSession session , Throwable exception ) throws Exception { } @ Override public void afterConnectionClosed ( WebSocketSession session , CloseStatus closeStatus ) throws Exception { } }

Fix:
logger . debug ( ( ( message + ",<seq2seq4repair_space>" ) + session ) ) ;
Buggy code:
public class TreeStructureViewBuilder { private StructureViewNodeFactory nodeFactory ; public TreeStructureViewBuilder ( StructureViewNodeFactory nodeFactory ) { } public void buildView ( StructureView view , StructureModel model ) { } private void addPackageNode ( StructureView view , StructureViewNode viewRoot ) { } private StructureViewNode createViewNode ( StructureNode node , StructureViewProperties properties ) { } private boolean isFileView ( StructureView view ) { } private boolean acceptGranularity ( ProgramElementNode . Kind kind , StructureViewProperties . Granularity granularity ) { if ( granularity == ( Granularity . DECLARED_ELEMENTS ) ) { return true ; } else <START_BUG> if ( ( granularity == ( Granularity . MEMBER ) ) && ( kind == ( Kind . CODE ) ) ) { <END_BUG> return true ; } else if ( ( granularity == ( Granularity . TYPE ) ) && ( ( ( ( kind == ( Kind . PROJECT ) ) || ( kind == ( Kind . PACKAGE ) ) ) || ( kind . isSourceFileKind ( ) ) ) || ( kind . isTypeKind ( ) ) ) ) { return true ; } else if ( ( granularity == ( Granularity . FILE ) ) && ( ( ( kind == ( Kind . PROJECT ) ) || ( kind == ( Kind . PACKAGE ) ) ) || ( kind . isSourceFileKind ( ) ) ) ) { return true ; } else if ( ( granularity == ( Granularity . PACKAGE ) ) && ( ( kind == ( Kind . PROJECT ) ) || ( kind == ( Kind . PACKAGE ) ) ) ) { return true ; } else { return false ; } } private boolean acceptNode ( StructureNode node , StructureViewProperties properties ) { } private void sortView ( StructureViewNode node , Comparator comparator ) { } private StructureViewNode buildCustomTree ( GlobalStructureView view , StructureModel model ) { } private void getRoots ( StructureNode rootNode , List roots , StructureViewProperties . Hierarchy hierarchy ) { } public boolean acceptNodeAsRoot ( ProgramElementNode node , StructureViewProperties . Hierarchy hierarchy ) { } private StructureViewNode getInheritanceChildren ( StructureNode node , List associations ) { } private StructureViewNode getCrosscuttingChildren ( StructureNode node ) { } private StructureViewNode buildTree ( StructureNode node , List associations ) { } private StructureViewNode getRelations ( RelationNode node ) { } private void dumpView ( StructureViewNode root , int level ) { } private static final Comparator ALPHABETICAL_COMPARATOR = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { } } ; private static final Comparator DECLARATIONAL_COMPARATOR = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { } } ; }

Fix:
if ( ( granularity == ( Granularity . MEMBER ) ) && ( kind != ( Kind . CODE ) ) ) {
Buggy code:
public class FileOpener implements DropTargetListener { public FileOpener ( ) { } public void dragEnter ( final DropTargetDragEvent dtde ) { } public void dragExit ( final DropTargetEvent e ) { } public void dragOver ( final DropTargetDragEvent e ) { } public void dragScroll ( final DropTargetDragEvent e ) { } private static final Pattern filePattern = Pattern . compile ( ( ( "file:////[^\\s" + ( File . pathSeparatorChar ) ) + "]+" ) ) ; @ SuppressWarnings ( "unchecked" ) public void drop ( final DropTargetDropEvent dtde ) { if ( ! ( isDropAcceptable ( dtde ) ) ) { dtde . rejectDrop ( ) ; return ; } dtde . acceptDrop ( DnDConstants . ACTION_COPY ) ; try { final Transferable transferable = dtde . getTransferable ( ) ; Controller . getCurrentController ( ) . selectMode ( MODENAME ) ; ModeController modeController = Controller . getCurrentModeController ( ) ; if ( transferable . isDataFlavorSupported ( DataFlavor . javaFileListFlavor ) ) { final List < File > list = ( ( List < File > ) ( transferable . getTransferData ( DataFlavor . javaFileListFlavor ) ) ) ; for ( final File file : list ) { String fileName = file . getName ( ) ; if ( ( file . isDirectory ( ) ) || ( ! ( isMindMapUrl ( fileName ) ) ) ) { continue ; } modeController . getMapController ( ) . newMap ( Compat . fileToUrl ( file ) ) ; } <START_BUG> } <END_BUG> if ( transferable . isDataFlavorSupported ( DataFlavor . stringFlavor ) ) { final String urls = ( ( String ) ( transferable . getTransferData ( DataFlavor . stringFlavor ) ) ) ; if ( urls . startsWith ( "file:" ) ) { final Matcher matcher = FileOpener . filePattern . matcher ( urls ) ; while ( matcher . find ( ) ) { final String urlString = matcher . group ( ) ; if ( ! ( isMindMapUrl ( urlString ) ) ) { continue ; } try { final URI uri = new URI ( urlString ) ; final URL url = new URL ( uri . getScheme ( ) , uri . getHost ( ) , uri . getPath ( ) ) ; final File file = Compat . urlToFile ( url ) ; if ( ( ! ( file . exists ( ) ) ) || ( file . isDirectory ( ) ) ) continue ; modeController . getMapController ( ) . newMap ( url ) ; } catch ( final Exception e ) { e . printStackTrace ( ) ; continue ; } } } else if ( ( urls . startsWith ( "http:////" ) ) && ( isMindMapUrl ( urls ) ) ) { final URL url = new URL ( urls ) ; modeController . getMapController ( ) . newMap ( url ) ; } } } catch ( final Exception e ) { UITools . errorMessage ( TextUtils . format ( "dropped_file_error" , e . getMessage ( ) ) ) ; dtde . dropComplete ( false ) ; return ; } dtde . dropComplete ( true ) ; } private boolean isMindMapUrl ( final String urlString ) { } public void dropActionChanged ( final DropTargetDragEvent e ) { } private boolean isDragAcceptable ( final DropTargetDragEvent event ) { } private boolean isDropAcceptable ( final DropTargetDropEvent event ) { } }

Fix:
} else
Buggy code:
public abstract class P4Base extends org . apache . tools . ant . Task implements ExecOutputHandler { protected Perl5Util util ; protected String m_p4Port = "" ; protected String m_p4Client = "" ; protected String m_p4User = "" ; protected String m_p4View = "" ; protected String P4Opts = "" ; protected String m_p4CmdOpts = "" ; protected String shell ; private TaskException m_error ; public void setClient ( String P4Client ) { } public void setCmdopts ( String P4CmdOpts ) { } public void setPort ( String P4Port ) { } public void setUser ( String P4User ) { } public void setView ( String P4View ) { } private void prepare ( ) { } public void execute ( ) throws TaskException { } protected void execP4Command ( final String command , ExecOutputHandler handler ) throws TaskException { try { final Commandline cmd = new Commandline ( ) ; cmd . setExecutable ( "p4" ) ; if ( ( ( m_p4Port ) != null ) && ( ( m_p4Port . length ( ) ) != 0 ) ) { cmd . addArgument ( m_p4Port ) ; } if ( ( ( m_p4User ) != null ) && ( ( m_p4User . length ( ) ) != 0 ) ) { cmd . addArgument ( m_p4User ) ; } if ( ( ( m_p4Client ) != null ) && ( ( m_p4Client . length ( ) ) != 0 ) ) { cmd . addArgument ( m_p4Client ) ; } cmd . addLine ( command ) ; String [ ] cmdline = cmd . getCommandline ( ) ; String cmdl = "" ; for ( int i = 0 ; i < ( cmdline . length ) ; i ++ ) { cmdl += ( cmdline [ i ] ) + "<seq2seq4repair_space>" ; } getLogger ( ) . debug ( ( "Execing<seq2seq4repair_space>" + cmdl ) ) ; if ( handler == null ) { handler = this ; } final Execute2 exe = new Execute2 ( ) ; exe . setExecOutputHandler ( handler ) ; <START_BUG> exe . setCommandline ( cmd . getCommandline ( ) ) ; <END_BUG> try { exe . execute ( ) ; } catch ( IOException e ) { throw new TaskException ( "Error" , e ) ; } if ( null != ( m_error ) ) { throw m_error ; } } catch ( TaskException te ) { throw te ; } catch ( Exception e ) { throw new TaskException ( ( "Problem<seq2seq4repair_space>exec'ing<seq2seq4repair_space>P4<seq2seq4repair_space>command:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } protected final void registerError ( final TaskException error ) { } public void stdout ( final String line ) { } public void stderr ( final String line ) { } }

Fix:
exe . setCommandline ( cmd ) ;
Buggy code:
public class TypedValue { public static final TypedValue NULL_TYPED_VALUE = new TypedValue ( null , TypeDescriptor . NULL ) ; private final Object value ; private TypeDescriptor typeDescriptor ; public TypedValue ( Object value ) { } public TypedValue ( Object value , TypeDescriptor typeDescriptor ) { } public Object getValue ( ) { } public TypeDescriptor getTypeDescriptor ( ) { } @ Override public String toString ( ) { StringBuilder str = new StringBuilder ( ) ; <START_BUG> str . append ( "TypedValue:<seq2seq4repair_space>" ) . append ( this . value ) . append ( "<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>" ) . append ( this . typeDescriptor . asString ( ) ) ; <END_BUG> return str . toString ( ) ; } }

Fix:
str . append ( "TypedValue:<seq2seq4repair_space>" ) . append ( this . value ) . append ( "<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>" ) . append ( this . getTypeDescriptor ( ) . asString ( ) ) ;
Buggy code:
class SecurityActions { static ModuleClassLoader getModuleClassLoader ( ) throws ModuleLoadException { try { return AccessController . doPrivileged ( new PrivilegedExceptionAction < ModuleClassLoader > ( ) { public ModuleClassLoader run ( ) throws ModuleLoadException { <START_BUG> ModuleLoader loader = Module . getCurrentModuleLoader ( ) ; <END_BUG> ModuleIdentifier identifier = ModuleIdentifier . create ( "org.jboss.as.security" , "main" ) ; return loader . loadModule ( identifier ) . getClassLoader ( ) ; } } ) ; } catch ( PrivilegedActionException pae ) { throw new ModuleLoadException ( pae ) ; } } }

Fix:
ModuleLoader loader = Module . getCallerModuleLoader ( ) ;
Buggy code:
public class LockInterruptTest extends BaseJDBCTestCase { private static final String INTERRUPTED = "08000" ; private static final int LOCK_TIMEOUT = 60 ; private static final int DEADLOCK_TIMEOUT = ( LockInterruptTest . LOCK_TIMEOUT ) // 2 ; public LockInterruptTest ( String name ) { } public static Test suite ( ) { <START_BUG> if ( ! ( isSunJVM ( ) ) ) { <END_BUG> if ( getSystemProperty ( "java.version" ) . startsWith ( "1.5.0" ) ) { println ( "Test<seq2seq4repair_space>skipped<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>VM,<seq2seq4repair_space>cf.<seq2seq4repair_space>DERBY-4463" ) ; return new TestSuite ( "empty<seq2seq4repair_space>LockInterruptTest" ) ; } } Test test = TestConfiguration . embeddedSuite ( LockInterruptTest . class ) ; test = DatabasePropertyTestSetup . setLockTimeouts ( test , LockInterruptTest . DEADLOCK_TIMEOUT , LockInterruptTest . LOCK_TIMEOUT ) ; Properties syspros = new Properties ( ) ; syspros . put ( "derby.stream.error.extendedDiagSeverityLevel" , "50000" ) ; test = new org . apache . derbyTesting . junit . SystemPropertyTestSetup ( test , syspros , true ) ; return new org . apache . derbyTesting . junit . CleanDatabaseTestSetup ( test ) ; } public void testInterruptLockWaiter ( ) throws Exception { } private class Waiter extends Thread { private final Connection c ; private final PreparedStatement ps ; private Throwable throwable ; private boolean InterruptFlagSetOnThrow ; private long elapsedTime ; private Waiter ( ) throws SQLException { } public void run ( ) { } private void runWaiter ( ) throws SQLException { } } }

Fix:
if ( isIBMJVM ( ) ) {
Buggy code:
public class CategoryController extends Controller { static String usernameSes ; static Form < MainCategory > newMainCategory = new Form < MainCategory > ( MainCategory . class ) ; static Finder < Integer , MainCategory > findMainCategory = new Finder < Integer , MainCategory > ( Integer . class , MainCategory . class ) ; public static Result categories ( int id ) { List < MainCategory > mainCategoryList = find . all ( ) ; MainCategory mc = MainCategory . findMainCategory ( id ) ; <START_BUG> List < Product > productList = findProduct . where ( ) . eq ( "id" , mc . id ) . findList ( ) ; <END_BUG> return ok ( kategorija . render ( productList , mainCategoryList ) ) ; } @ Security . Authenticated ( AdminFilter . class ) public static Result allCategory ( ) { } @ Security . Authenticated ( AdminFilter . class ) public static Result editMainCategory ( int id ) { } public static Result saveEditMainCategory ( int id ) { } public static Result deleteMainCategory ( int id ) { } public static Result addMainCategory ( ) { } }

Fix:
List < Product > productList = findProduct . where ( ) . eq ( "category" , mc ) . findList ( ) ;
Buggy code:
public class PersistenceExtensionDynamicDependencyAppender implements ApplicationArchiveProcessor { @ Inject Instance < PersistenceConfiguration > configuration ; @ Override public void process ( Archive < ? > applicationArchive , TestClass testClass ) { } private Set < ResourceDescriptor < ? > > fetchAllDataResources ( TestClass testClass ) { } private void addResources ( Archive < ? > applicationArchive , final JavaArchive dataArchive ) { <START_BUG> if ( applicationArchive instanceof JavaArchive ) { <END_BUG> addAsResource ( applicationArchive , dataArchive ) ; } else { addAsLibrary ( applicationArchive , dataArchive ) ; } } private void addAsResource ( Archive < ? > applicationArchive , JavaArchive dataArchive ) { } private void addAsLibrary ( Archive < ? > applicationArchive , JavaArchive dataArchive ) { } private JavaArchive toJavaArchive ( final Collection < ? extends ResourceDescriptor < ? > > descriptors ) { } private JavaArchive createArchiveWithResources ( String ... resourcePaths ) { } private void addSqlScriptAsResource ( Archive < ? > applicationArchive , String script ) { } }

Fix:
if ( JavaArchive . class . isInstance ( applicationArchive ) ) {
Buggy code:
public class BasicListener implements IWorldView { private World currWorld = null ; Channel channel ; String sendTo ; BasicProperties properties ; long execTime ; long timeout ; JSONArray accu ; public BasicListener ( Channel channel , String sendTo , long timeout ) { } public void setProps ( BasicProperties properties ) { } public void setWorld ( World world ) { } @ Override public BasicListener clone ( ) { } @ Override public void worldHasMoved ( ) { } @ Override public void worldHasChanged ( ) { } @ SuppressWarnings ( "unchecked" ) private void send ( JSONObject msgItem ) { } @ SuppressWarnings ( "unchecked" ) public void send ( ) { JSONObject msgJson = new JSONObject ( ) ; msgJson . put ( "type" , "stream" ) ; msgJson . put ( "content" , accu ) ; <START_BUG> String message = accu . toJSONString ( ) ; <END_BUG> try { channel . basicPublish ( "" , sendTo , properties , message . getBytes ( "UTF-8" ) ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; } System . out . println ( ( ( "<seq2seq4repair_space>[D]<seq2seq4repair_space>Sent<seq2seq4repair_space>stream<seq2seq4repair_space>message<seq2seq4repair_space>(" + ( properties . getCorrelationId ( ) ) ) + ")" ) ) ; } }

Fix:
String message = msgJson . toJSONString ( ) ;
Buggy code:
public class DatabaseMigrationImplFlyway implements DatabaseMigration { @ Autowired DataSourceFactory dataSourceFactory ; @ Override public void migrateDB ( ) { try { Flyway flyway = new Flyway ( ) ; flyway . setDataSource ( dataSourceFactory . getDataSource ( ) ) ; <START_BUG> flyway . setLocations ( "com.fpmislata.daw2.database.impl.flyway.script" ) ; <END_BUG> flyway . setEncoding ( "utf-8" ) ; flyway . migrate ( ) ; } catch ( Exception ex ) { throw new RuntimeException ( ) ; } } }

Fix:
flyway . setLocations ( "com.fpmislata.daw2.database.sql" ) ;
Buggy code:
public class ATMMachine { Account acc ; TransactionProcessor transactionProcessor ; public ATMMachine ( ) { } public void run ( ) { Scanner inputScanner = new Scanner ( System . in ) ; MainForm mainform = new MainForm ( ) ; String accID ; String password ; do { synchronized ( mainform ) { try { mainform . wait ( ) ; } catch ( InterruptedException e ) { } mainform . setSubmitted ( false ) ; String accountID = mainform . getAccountID ( ) ; String accountPassword = new String ( mainform . getPassword ( ) ) ; acc = new DebitAccount ( accountID , accountPassword ) ; doCommand ( "AccountSignIn" ) ; if ( ( acc ) == null ) { mainform . setAccepted ( false ) ; } } } while ( ( acc ) == null ) ; AccountAutoSaver accAutoSaver = new AccountAutoSaver ( acc , 5 ) ; <START_BUG> accAutoSaver . run ( ) ; <END_BUG> mainform . setAccepted ( true ) ; mainform . dispose ( ) ; mainMenuForm mainmenuform = new mainMenuForm ( ) ; transactionProcessor = new TransactionProcessor ( acc ) ; TransactionsAutoStarter transactionsAutoStarter = new TransactionsAutoStarter ( transactionProcessor , 1 ) ; while ( ( acc ) != null ) { synchronized ( mainmenuform ) { try { mainmenuform . wait ( ) ; } catch ( InterruptedException e ) { } String command = mainmenuform . getCommand ( ) . replace ( "<seq2seq4repair_space>" , "" ) ; doCommand ( command ) ; } } } private void doCommand ( String cmd ) { } }

Fix:
accAutoSaver . start ( ) ;
Buggy code:
public class ForgotPassword extends ScarabTemplateAction { private static final int UNIQUE_ID_MAX_LEN = 10 ; public void doForgotpassword ( RunData data , TemplateContext context ) throws Exception { } public boolean forgotPassword ( RunData data , TemplateContext context ) throws Exception { IntakeTool intake = getIntakeTool ( context ) ; Group password = intake . get ( "ForgotPassword" , DEFAULT_KEY ) ; String username = password . get ( "Username" ) . toString ( ) ; ScarabUser user = null ; try { user = ( ( ScarabUser ) ( TurbineSecurity . getUser ( username ) ) ) ; String tempPassword = GenerateUniqueId . getIdentifier ( ) ; if ( ( tempPassword . length ( ) ) > ( ForgotPassword . UNIQUE_ID_MAX_LEN ) ) { tempPassword = tempPassword . substring ( 0 , ForgotPassword . UNIQUE_ID_MAX_LEN ) ; } user . setPasswordExpire ( Calendar . getInstance ( ) ) ; user . setHasLoggedIn ( Boolean . FALSE ) ; data . setUser ( user ) ; data . save ( ) ; TurbineSecurity . forcePassword ( user , tempPassword ) ; context . put ( "password" , tempPassword ) ; TemplateEmail te = new TemplateEmail ( ) ; te . setContext ( new org . apache . turbine . modules . ContextAdapter ( context ) ) ; te . setTo ( ( ( ( user . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( user . getLastName ( ) ) ) , user . getEmail ( ) ) ; te . setFrom ( Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.fromName" , "Scarab<seq2seq4repair_space>System" ) , Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.fromAddress" , "help@localhost" ) ) ; te . setSubject ( Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.subject" , "Account<seq2seq4repair_space>Password" ) ) ; <START_BUG> te . setTemplate ( Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.template" , "ForgotPassword.vm" ) ) ; <END_BUG> te . send ( ) ; } catch ( TurbineSecurityException e ) { getScarabRequestTool ( context ) . setAlertMessage ( "Invalid<seq2seq4repair_space>username." ) ; Log . get ( ) . error ( "ForgotPassword:<seq2seq4repair_space>" , e ) ; setTarget ( data , "ForgotPassword.vm" ) ; return false ; } return true ; } }

Fix:
te . setTemplate ( Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.template" , "email//ForgotPassword.vm" ) ) ;
Buggy code:
public interface Model { <START_BUG> public void addObserver ( String field , ModelMethod modelMethod ) ; <END_BUG> public < T > T getValue ( String field ) { } public < T > void setValue ( String field , T value ) { } public Class < ? > getType ( String field ) { } }

Fix:
public void addObserver ( String field , ModelObserver modelObserver ) ;
Buggy code:
public final class HTMLTableElementImpl extends HTMLElementImpl implements HTMLTableElement { public synchronized HTMLTableCaptionElement getCaption ( ) { } public synchronized void setCaption ( HTMLTableCaptionElement caption ) { } public synchronized HTMLElement createCaption ( ) { HTMLElement section ; section = getCaption ( ) ; if ( section != null ) return section ; <START_BUG> section = new HTMLTableSectionElementImpl ( ( ( HTMLDocumentImpl ) ( getOwnerDocument ( ) ) ) , "CAPTION" ) ; <END_BUG> appendChild ( section ) ; return section ; } public synchronized void deleteCaption ( ) { } public synchronized HTMLTableSectionElement getTHead ( ) { } public synchronized void setTHead ( HTMLTableSectionElement tHead ) { } public synchronized HTMLElement createTHead ( ) { } public synchronized void deleteTHead ( ) { } public synchronized HTMLTableSectionElement getTFoot ( ) { } public synchronized void setTFoot ( HTMLTableSectionElement tFoot ) { } public synchronized HTMLElement createTFoot ( ) { } public synchronized void deleteTFoot ( ) { } public HTMLCollection getRows ( ) { } public HTMLCollection getTBodies ( ) { } public String getAlign ( ) { } public void setAlign ( String align ) { } public String getBgColor ( ) { } public void setBgColor ( String bgColor ) { } public String getBorder ( ) { } public void setBorder ( String border ) { } public String getCellPadding ( ) { } public void setCellPadding ( String cellPadding ) { } public String getCellSpacing ( ) { } public void setCellSpacing ( String cellSpacing ) { } public String getFrame ( ) { } public void setFrame ( String frame ) { } public String getRules ( ) { } public void setRules ( String rules ) { } public String getSummary ( ) { } public void setSummary ( String summary ) { } public String getWidth ( ) { } public void setWidth ( String width ) { } public HTMLElement insertRow ( int index ) { } void insertRowX ( int index , HTMLTableRowElementImpl newRow ) { } public synchronized void deleteRow ( int index ) { } public HTMLTableElementImpl ( HTMLDocumentImpl owner , String name ) { } private HTMLCollectionImpl _rows ; private HTMLCollectionImpl _bodies ; }

Fix:
section = new HTMLTableCaptionElementImpl ( ( ( HTMLDocumentImpl ) ( getOwnerDocument ( ) ) ) , "CAPTION" ) ;
Buggy code:
@ RunAsClient @ RunWith ( Arquillian . class ) public class EnterpriseDeploymentTestCase { private static final String WAR_JBOSS_FILE = "WEB-INF//jboss-web.xml" ; private static final String JAR_JBOSS_FILE = "META-INF//jboss.xml" ; private static final String EAR_JBOSS_FILE = "META-INF//jboss-app.xml" ; private DeploymentManager deploymentManager ; @ Test public void testDeploymentManager ( ) throws Exception { } @ Test public void testDistributeWebApp ( ) throws Exception { } @ Test <START_BUG> @ Ignore ( "[AS7-1929]<seq2seq4repair_space>Invalid<seq2seq4repair_space>webapp<seq2seq4repair_space>deploys<seq2seq4repair_space>without<seq2seq4repair_space>error<seq2seq4repair_space>in<seq2seq4repair_space>management<seq2seq4repair_space>API" ) <END_BUG> public void testDistributeBadWar ( ) throws Exception { ProgressObject progress = jsr88Deploy ( getBadWebArchive ( ) ) ; TargetModuleID [ ] targetModules = progress . getResultTargetModuleIDs ( ) ; try { DeploymentStatus state = progress . getDeploymentStatus ( ) ; Assert . assertEquals ( FAILED , state . getState ( ) ) ; } finally { jsr88Undeploy ( targetModules ) ; } } @ Test public void testDistributeEjbApp ( ) throws Exception { } @ Test public void testDistributeEARApp ( ) throws Exception { } @ Test public void testListAvailableModules ( ) throws Exception { } private DeploymentManager getDeploymentManager ( ) throws Exception { } private ProgressObject jsr88Deploy ( Archive < ? > archive ) throws Exception { } private ProgressObject jsr88Undeploy ( TargetModuleID [ ] resultTargetModuleIDs ) throws Exception { } private void awaitCompletion ( ProgressObject progress , long timeout ) throws InterruptedException { } private void assertServletAccess ( String context ) throws IOException { } private InputStream createDeploymentPlan ( String deploymentFile ) throws Exception { } private String getJBossFile ( String deploymentFile ) { } private File getResourceFile ( String resource ) { } private Archive < ? > getWebArchive ( ) { } private Archive < ? > getBadWebArchive ( ) { } private Archive < ? > getEjbArchive ( ) { } private Archive < ? > getEarArchive ( ) { } }

Fix:
@ Ignore
Buggy code:
public class ParallelClassTest { public static class Example1 { @ Test public void one ( ) throws InterruptedException { } } public static class Example2 { @ Test public void one ( ) throws InterruptedException { } } @ RunWith ( Suite . class ) @ SuiteClasses ( { ParallelClassTest . Example1 . class , ParallelClassTest . Example2 . class } ) public static class ExampleSuite { } @ Test ( timeout = 1500 ) public void testsRunInParallel ( ) { long start = System . currentTimeMillis ( ) ; <START_BUG> Result result = JUnitCore . runClasses ( ParallelExecutioner . classes ( ) , ParallelClassTest . Example1 . class , ParallelClassTest . Example2 . class ) ; <END_BUG> Assert . assertTrue ( result . wasSuccessful ( ) ) ; long end = System . currentTimeMillis ( ) ; Assert . assertThat ( ( end - start ) , greaterThan ( 999 ) ) ; } private Matcher < Long > greaterThan ( final long l ) { } }

Fix:
Result result = JUnitCore . runClasses ( ParallelComputer . classes ( ) , ParallelClassTest . Example1 . class , ParallelClassTest . Example2 . class ) ;