nus-yam/ex-repair huggingface dataset:
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class JmsClientTestCase { private static final String QUEUE_NAME = "createdTestQueue" ; @ Deployment public static Archive < ? > createDeployment ( ) { } @ Test public void testMessagingClient ( ) throws Exception { } static void applyUpdate ( ModelNode update , final ModelControllerClient client ) throws IOException { } private < T > T lookup ( ModelControllerClient client , String name , Class < T > expected ) throws Exception { <START_BUG> MBeanServerConnection mbeanServer = JMXConnectorFactory . connect ( new JMXServiceURL ( "service:jmx:remote:////127.0.0.1:9999" ) ) . getMBeanServerConnection ( ) ; <END_BUG> ObjectName objectName = new ObjectName ( "jboss:name=test,type=fakejndi" ) ; PollingUtils . retryWithTimeout ( 10000 , new PollingUtils . WaitForMBeanTask ( mbeanServer , objectName ) ) ; Object o = mbeanServer . invoke ( objectName , "lookup" , new Object [ ] { name } , new String [ ] { "java.lang.String" } ) ; return expected . cast ( o ) ; } }

Fix:
MBeanServerConnection mbeanServer = JMXConnectorFactory . connect ( new JMXServiceURL ( "service:jmx:remoting-jmx:////127.0.0.1:9999" ) ) . getMBeanServerConnection ( ) ;
Buggy code:
public class DataHandler { private static Random rand = new Random ( ) ; private static int FEATURE_SIZE = 4697 ; private static DateFormat dateFormat = new SimpleDateFormat ( "HH:mm:ss" ) ; private static DataHandler . DataType type ; private static Map < String , Map < Integer , Integer > > masks = new HashMap < String , Map < Integer , Integer > > ( ) ; public static enum DataType { FULL , ONE , FIVE , TEN ; } public DataHandler ( ) { } public static Dataset getCompositeDataset ( int numRecords ) { } public static Dataset getMaskedCompositeDataset ( String maskFile , int numRecords ) { } public static Dataset getDataset ( int numRecords , DataHandler . DataType type ) { } public static Dataset removeFeatures ( Dataset d , String maskFile ) { } public static Instance removeFeatures ( Instance i , String maskFile ) { } private static Dataset loadFile ( String filename , int numRecords ) { } private static Dataset loadMaskedFile ( String maskFile , String filename , int numRecords ) { System . out . println ( ( ( ( "Loading<seq2seq4repair_space>" + filename ) + "<seq2seq4repair_space>and<seq2seq4repair_space>keeping<seq2seq4repair_space>features<seq2seq4repair_space>as<seq2seq4repair_space>specified<seq2seq4repair_space>by<seq2seq4repair_space>" ) + maskFile ) ) ; Dataset data = new DefaultDataset ( ) ; Map < Integer , Integer > mask = DataHandler . getMask ( maskFile ) ; <START_BUG> int featureCount = 0 ; <END_BUG> try { BufferedReader r = new BufferedReader ( new FileReader ( filename ) ) ; Pattern p = Pattern . compile ( "(.*)\\s\\{(.*)\\}" ) ; Matcher m ; String s = "" ; Instance feature_vector ; for ( int i = 0 ; ( i < ( 10 * numRecords ) ) && ( s != null ) ; i ++ ) { s = r . readLine ( ) ; m = p . matcher ( s ) ; if ( m . matches ( ) ) { feature_vector = new SparseInstance ( featureCount ) ; feature_vector . setClassValue ( m . group ( 1 ) ) ; for ( String idx : m . group ( 2 ) . replaceAll ( "<seq2seq4repair_space>" , "" ) . split ( "," ) ) { if ( ( idx . length ( ) ) > 0 ) { try { int index = Integer . parseInt ( idx ) ; if ( mask . containsKey ( index ) ) feature_vector . put ( mask . get ( index ) , 1.0 ) ; } catch ( Exception e ) { i -- ; continue ; } } } data . add ( feature_vector ) ; } } } catch ( IOException e ) { e . printStackTrace ( ) ; } return data . folds ( ( ( data . size ( ) ) // numRecords ) , DataHandler . rand ) [ 0 ] ; } private static Map < Integer , Integer > getMask ( String maskFile ) { } public static String getMaskFile ( DataHandler . DataType type ) { } }

Fix:
int featureCount = DataHandler . FEATURE_SIZE ;
Buggy code:
public class IdTest { private static final ObjectMapper MAPPER = Jackson . newObjectMapper ( ) ; private final Id id = new Id ( 1234L ) ; @ Test public void serializesToJSON ( ) throws Exception { } @ Test public void deserializesFromJSON ( ) throws Exception { final Id actual = IdTest . MAPPER . readValue ( FixtureHelpers . fixture ( "fixtures//id.json" ) , Id . class ) ; <START_BUG> assertThat ( actual ) . isEqualsToByComparingFields ( id ) ; <END_BUG> } @ Test public void testEquals ( ) { } @ Test public void testToString ( ) { } @ Test public void testHashCode ( ) { } }

Fix:
assertThat ( actual ) . isEqualTo ( id ) ;
Buggy code:
public class DecimalToNewBase { private int decimal ; public DecimalToNewBase ( int num ) { } public String DecToN ( int base ) { <START_BUG> return performBaseConversion ( base , ( ( decimal ) // base ) , ( ( decimal ) // base ) ) ; <END_BUG> } private String performBaseConversion ( int base , int quotient , int remainder ) { } public String decToBaseTwo ( ) { } private String decToBaseTwo ( int quotient , int remainder ) { } public String decToBaseThree ( ) { } private String decToBaseThree ( int quotient , int remainder ) { } public String decToBaseFive ( ) { } private String decToBaseFive ( int quotient , int remainder ) { } public String decToBaseEight ( ) { } private String decToBaseEight ( int quotient , int remainder ) { } public String decToBaseNine ( ) { } private String decToBaseNine ( int quotient , int remainder ) { } public String decToBaseTwelve ( ) { } private String decToBaseTwelve ( int quotient , int remainder ) { } public String decToBaseSixteen ( ) { } private String decToBaseSixteen ( int quotient , int remainder ) { } private String integerToLetter ( int integer ) { } }

Fix:
return performBaseConversion ( base , ( ( decimal ) // base ) , ( ( decimal ) % base ) ) ;
Buggy code:
public interface IAppModel { public abstract List < HotelRoom > getAllRecords ( ) { } public abstract Map < Integer , HotelRoom > queryRecords ( String name , String location ) { } public abstract String [ ] getRoomFeilds ( ) { } public abstract void updateRecord ( long recNo , String owner , long cookie ) throws SecurityException , RecordNotAvailableException , RecordNotFoundException { } public abstract void addObserver ( Observer observer ) { } public abstract void removeObserver ( Observer observer ) { } <START_BUG> public abstract Long getActualIndexMap ( long selection ) ; <END_BUG> public abstract int getTotalNumberRecords ( ) { } public long getCookie ( ) { } No newline ; at end ; of file ; }

Fix:
public abstract Long getActualIndexMap ( int selection ) ;
Buggy code:
public class main { public static void main ( String [ ] args ) throws IOException , InterruptedException { <START_BUG> Site site = new Site ( main . readFile ( "config5.txt" ) ) ; <END_BUG> } public static ArrayList < String [ ] > readFile ( String fileName ) throws IOException { } }

Fix:
Site site = new Site ( main . readFile ( "config.txt" ) ) ;
Buggy code:
public class FinishedGameState implements GameState { private final EventDispatcher eventDispatcher ; private final Game game ; private static final int WAIT_TO_START_GAME = 5000 ; public FinishedGameState ( final EventDispatcher dispatcher , final Game aGame ) { } @ Override public void dispose ( ) { } public Event getStateEvent ( ) { } @ Override public GameState start ( ) { } @ Override public GameState stop ( ) { } @ Override <START_BUG> public GameState finish ( Integer team ) { <END_BUG> return this ; } @ Override public GameState waitForPlayers ( ) { } }

Fix:
public GameState finish ( final Integer team ) {
Buggy code:
public class UBCHelper { public static void registerOreBlock ( Block block , int meta , String name , FMLPreInitializationEvent event ) { } public static void registerOreBlock ( Block block , int meta , String modname , String texturename , String name , FMLPreInitializationEvent event ) { ItemStack placeholder = new ItemStack ( block , 1 , meta ) ; try { <START_BUG> ubOreTexturizer . setupUBOre ( block , meta , ( ( modname + ":" ) + texturename ) , ( "ore" + name ) , event ) ; <END_BUG> } catch ( Exception e ) { if ( e instanceof UBOreTexturizer . BlocksAreAlreadySet ) Log . error ( ( ( placeholder . getDisplayName ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>registered<seq2seq4repair_space>with<seq2seq4repair_space>UBC.<seq2seq4repair_space>Skipping" ) ) ; placeholder = null ; } if ( placeholder != null ) Log . info ( ( ( "Added<seq2seq4repair_space>" + ( placeholder . getDisplayName ( ) ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>Underground<seq2seq4repair_space>Biomes<seq2seq4repair_space>Ore<seq2seq4repair_space>Texturization" ) ) ; } public static void registerModOresWithMeta ( String MODID , String BLOCKNAME , int METASTART , int METASTEP , String [ ] ORENAMES , FMLPreInitializationEvent event ) { } public static void registerModOresWithoutMeta ( String MODID , String [ ] BLOCKNAME , String [ ] NAME , FMLPreInitializationEvent event ) { } No newline ; at end ; of file ; }

Fix:
ubOreTexturizer . setupUBOre ( block , meta , ( ( modname + ":" ) + texturename ) , ( "ore." + name ) , event ) ;
Buggy code:
public class SQLAPI { private boolean initialized ; private String user ; private String password ; private String driver ; private String db = "" ; private String url ; private String completeUrl ; private String host = "localhost" ; private int port ; public synchronized SQLAPI user ( String user ) { } public synchronized SQLAPI password ( String password ) { } public synchronized SQLAPI driver ( String driver ) { } public synchronized SQLAPI host ( String host ) { } public synchronized SQLAPI port ( int port ) { } public synchronized SQLAPI db ( String databaseName ) { } public synchronized SQLAPI url ( String url ) { } public SQLAPI mysql ( ) { } public SQLAPI h2 ( ) { } public SQLAPI hsql ( ) { <START_BUG> return driver ( "org.hsqldb.jdbc.JDBCDriver" ) . url ( "jdbc:h2:mem:<db>" ) . user ( "sa" ) . password ( "" ) ; <END_BUG> } private String dbUrl ( ) { } private void registerJDBCDriver ( ) { } private void validateArgNotNull ( String argName , String argValue ) { } private synchronized void ensureIsInitialized ( ) { } private void setupCompleteUrl ( ) { } private Connection getConnection ( ) { } private static void close ( Connection conn ) { } private static void close ( PreparedStatement stmt ) { } private static void close ( ResultSet rs ) { } static PreparedStatement createStatement ( Connection conn , String sql , Object [ ] args ) { } public void run ( String sql , Object ... args ) { } public void tryToRun ( String sql , Object ... args ) { } public < T > List < Map < String , Object > > getRows ( String sql , Object ... args ) { } static Map < String , Object > readRow ( ResultSet rs ) throws SQLException { } }

Fix:
return driver ( "org.hsqldb.jdbc.JDBCDriver" ) . url ( "jdbc:hsqldb:mem:<db>" ) . user ( "sa" ) . password ( "" ) ;
Buggy code:
public class WebPage extends Page implements IHeaderRenderer { private String bodyOnLoad ; protected WebPage ( ) { } protected WebPage ( final IModel model ) { } public String urlFor ( final String pageMapName , final Class pageClass , final PageParameters parameters ) { final WebRequestCycle cycle = getWebRequestCycle ( ) ; final StringBuffer buffer = urlPrefix ( cycle ) ; if ( pageMapName == null ) { appendPageMapName ( buffer ) ; } else { buffer . append ( "?pagemap=" ) ; buffer . append ( pageMapName ) ; buffer . append ( '&' ) ; } buffer . append ( "bookmarkablePage=" ) ; <START_BUG> buffer . append ( pageClass . getName ( ) ) ; <END_BUG> if ( parameters != null ) { for ( final Iterator iterator = parameters . keySet ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { final String key = ( ( String ) ( iterator . next ( ) ) ) ; buffer . append ( '&' ) ; buffer . append ( key ) ; buffer . append ( '=' ) ; buffer . append ( parameters . getString ( key ) ) ; } } return cycle . getResponse ( ) . encodeURL ( buffer . toString ( ) ) ; } public String urlFor ( final Component component , final Class listenerInterface ) { } public String urlFor ( final String path ) { } public String getMarkupType ( ) { } protected final WebRequestCycle getWebRequestCycle ( ) { } protected final BookmarkablePageLink homePageLink ( final String id ) { } private void appendPageMapName ( final StringBuffer buffer ) { } private StringBuffer urlPrefix ( final WebRequestCycle cycle ) { } public final void renderHeadSections ( final HtmlHeaderContainer container ) { } public String getBodyOnLoad ( ) { } public final void appendToBodyOnLoad ( final String onLoad ) { } protected void onEndRequest ( ) { } }

Fix:
buffer . append ( cycle . getApplication ( ) . getPages ( ) . getBookmarkablePageName ( pageClass ) ) ;
Buggy code:
@ Description ( "Logs<seq2seq4repair_space>clonal<seq2seq4repair_space>frame<seq2seq4repair_space>corresponding<seq2seq4repair_space>to<seq2seq4repair_space>conversion<seq2seq4repair_space>graph." ) public class ClonalFrameLogger extends CalculationNode implements Loggable { public Input < ConversionGraph > acgInput = new Input < ConversionGraph > ( "acg" , "Conversion<seq2seq4repair_space>graph<seq2seq4repair_space>whose<seq2seq4repair_space>clonal<seq2seq4repair_space>frame<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>log." , Validate . REQUIRED ) ; @ Override public void initAndValidate ( ) { } @ Override public void init ( PrintStream out ) throws Exception { } @ Override public void log ( int nSample , PrintStream out ) { ConversionGraph arg = acgInput . get ( ) ; out . print ( ( ( "tree<seq2seq4repair_space>STATE_" + nSample ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) ) ; <START_BUG> out . print ( ( ( arg . getRoot ( ) . toSortedNewick ( new int [ 1 ] , false ) ) + ";" ) ) ; <END_BUG> } @ Override public void close ( PrintStream out ) { } }

Fix:
out . print ( ( ( arg . getRoot ( ) . toShortNewick ( true ) ) + ";" ) ) ;
Buggy code:
public class TreeColumn extends Item { Tree parent ; boolean resizable ; boolean moveable ; public TreeColumn ( Tree parent , int style ) { } public TreeColumn ( Tree parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public int getAlignment ( ) { } boolean getMoveable ( ) { } String getNameText ( ) { } public Tree getParent ( ) { } public boolean getResizable ( ) { } public int getWidth ( ) { } public void pack ( ) { } void releaseChild ( ) { } void releaseWidget ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image image ) { checkWidget ( ) ; if ( ( image != null ) && ( image . isDisposed ( ) ) ) { error ( ERROR_INVALID_ARGUMENT ) ; } super . setImage ( image ) ; <START_BUG> if ( ( ( parent . sortColumn ) != ( this ) ) && ( ( parent . sortDirection ) != ( SWT . NULL ) ) ) { <END_BUG> setImage ( image , false , false ) ; } } void setImage ( Image image , boolean sort , boolean right ) { } void setMoveable ( boolean moveable ) { } public void setResizable ( boolean resizable ) { } void setSortDirection ( int direction ) { } public void setText ( String string ) { } public void setWidth ( int width ) { } }

Fix:
if ( ( ( parent . sortColumn ) != ( this ) ) || ( ( parent . sortDirection ) != ( SWT . NULL ) ) ) {
Buggy code:
public class Problem3 { public static boolean isPrime ( long numbah ) { } public static long findMaxPrimeFactor ( long num ) { <START_BUG> for ( long i = num ; i > 0 ; i -- ) { <END_BUG> if ( ( ( num % i ) == 0 ) && ( num != i ) ) { if ( Problem3 . isPrime ( i ) ) return i ; } } return - 1 ; } public static void main ( String [ ] args ) { } }

Fix:
for ( long i = ( ( int ) ( Math . sqrt ( num ) ) ) ; i > 1 ; i -- ) {
Buggy code:
public class CompilationUnitVisitor extends Compiler { public CompilationUnitVisitor ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , ICompilerRequestor requestor , IProblemFactory problemFactory ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { CompilationResult result = new CompilationResult ( sourceTypes [ 0 ] . getFileName ( ) , 1 , 1 , this . options . maxProblemsPerUnit ) ; <START_BUG> CompilationUnitDeclaration unit = SourceTypeConverter . buildCompilationUnit ( sourceTypes , ( ( SourceTypeConverter . FIELD_AND_METHOD ) | ( SourceTypeConverter . MEMBER_TYPE ) ) , lookupEnvironment . problemReporter , result ) ; <END_BUG> if ( unit != null ) { this . lookupEnvironment . buildTypeBindings ( unit ) ; this . lookupEnvironment . completeTypeBindings ( unit , true ) ; } } protected static IErrorHandlingPolicy getHandlingPolicy ( ) { } protected static INameEnvironment getNameEnvironment ( ICompilationUnit sourceUnit ) throws JavaModelException { } protected static ICompilerRequestor getRequestor ( ) { } public static void visit ( ICompilationUnit unitElement , ASTVisitor visitor ) throws JavaModelException { } protected static IProblemFactory getProblemFactory ( final ASTVisitor visitor ) { } }

Fix:
CompilationUnitDeclaration unit = SourceTypeConverter . buildCompilationUnit ( sourceTypes , ( ( SourceTypeConverter . FIELD_AND_METHOD ) | ( SourceTypeConverter . MEMBER_TYPE ) ) , this . lookupEnvironment . problemReporter , result ) ;
Buggy code:
public class MemoryMXBeanGCHandler implements OperationStepHandler , DescriptionProvider { public static final MemoryMXBeanGCHandler INSTANCE = new MemoryMXBeanGCHandler ( ) ; private MemoryMXBeanGCHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } @ Override public ModelNode getModelDescription ( Locale locale ) { <START_BUG> return PlatformMBeanDescriptions . getDescriptionOnlyOperation ( locale , ( ( PlatformMBeanConstants . MEMORY ) + ".gc" ) ) ; <END_BUG> } }

Fix:
return PlatformMBeanDescriptions . getDescriptionOnlyOperation ( locale , "gc" , MEMORY ) ;
Buggy code:
public abstract class AbstractMgmtTestBase { private static File brokenWar = null ; protected abstract ModelControllerClient getModelControllerClient ( ) { } protected ModelNode executeOperation ( final ModelNode op , boolean unwrapResult ) throws IOException , MgmtOperationException { } protected void executeOperations ( final List < ModelNode > operations ) throws IOException , MgmtOperationException { } protected ModelNode executeOperation ( final ModelNode op ) throws IOException , MgmtOperationException { } protected ModelNode executeOperation ( final String address , final String operation ) throws IOException , MgmtOperationException { } protected ModelNode executeAndRollbackOperation ( final ModelNode op ) throws IOException , OperationFormatException { } protected void remove ( final ModelNode address ) throws IOException , MgmtOperationException { } private File getBrokenWar ( ) { } protected Map < String , ModelNode > getChildren ( final ModelNode result ) { } protected ModelNode findNodeWithProperty ( List < ModelNode > newList , String propertyName , String setTo ) { } public String modelToXml ( String subsystemName , String childType , XMLElementWriter < SubsystemMarshallingContext > parser ) throws Exception { final ModelNode address = new ModelNode ( ) ; address . add ( "subsystem" , subsystemName ) ; address . protect ( ) ; final ModelNode operation = new ModelNode ( ) ; operation . get ( OP ) . set ( "read-children-resources" ) ; operation . get ( "child-type" ) . set ( childType ) ; operation . get ( RECURSIVE ) . set ( true ) ; operation . get ( OP_ADDR ) . set ( address ) ; final ModelNode result = executeOperation ( operation ) ; Assert . assertNotNull ( result ) ; ModelNode dsNode = new ModelNode ( ) ; dsNode . get ( childType ) . set ( result ) ; StringWriter strWriter = new StringWriter ( ) ; <START_BUG> XMLExtendedStreamWriter writer = XMLExtendedStreamWriterFactory . create ( XMLOutputFactory . newFactory ( ) . createXMLStreamWriter ( strWriter ) ) ; <END_BUG> parser . writeContent ( writer , new SubsystemMarshallingContext ( dsNode , writer ) ) ; writer . flush ( ) ; return strWriter . toString ( ) ; } public static List < ModelNode > xmlToModelOperations ( String xml , String nameSpaceUriString , XMLElementReader < List < ModelNode > > parser ) throws Exception { } public static ModelNode operationListToCompositeOperation ( List < ModelNode > operations ) { } public static ModelNode operationListToCompositeOperation ( List < ModelNode > operations , boolean skipFirst ) { } public static String readXmlResource ( final String name ) throws IOException { } protected void takeSnapShot ( ) throws Exception { } }

Fix:
XMLExtendedStreamWriter writer = XMLExtendedStreamWriterFactory . create ( XMLOutputFactory . newInstance ( ) . createXMLStreamWriter ( strWriter ) ) ;
Buggy code:
public class HotelSystem { public enum State { NOT_LOGGED_IN , CUSTOMER_LOGGED_IN , MANAGER_LOGGED_IN ; } HotelSystem . State state ; ArrayList < User > users ; ArrayList < Building > buildings ; Database db ; public HotelSystem ( ) { } public User findUser ( String email ) { } public boolean addUser ( User u ) { } User login ( String email , String password ) { } void logout ( ) { } ArrayList < Room > getMatchingRooms ( boolean smoking , int beds , int rating ) { } boolean isLoggedIn ( ) { } void loadUsers ( ) { } private void loadBuildings ( ) { } private ArrayList < Floor > loadFloors ( int building ) { } private ArrayList < Room > loadRooms ( int floor ) { String statement = String . format ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>rooms<seq2seq4repair_space>where<seq2seq4repair_space>floor<seq2seq4repair_space>=<seq2seq4repair_space>%d;" , floor ) ; ResultSet rooms = db . execute ( statement ) ; ArrayList < Room > rs = new ArrayList ( ) ; try { while ( rooms . next ( ) ) { int number = rooms . getInt ( "number" ) ; <START_BUG> Room room = new Room ( number , 0 , 0 , Rank . FIVE_STAR ) ; <END_BUG> rs . add ( room ) ; } } catch ( Exception e ) { CLI . println ( "Error<seq2seq4repair_space>loading<seq2seq4repair_space>rooms!" ) ; } return rs ; } boolean createAccount ( String name , String email , String password ) { } void removeAccount ( User account ) { } void checkin ( Room room , Customer customer ) { } void checkout ( Room room , Customer customer ) { } void reserveRoom ( Room room , Customer customer , Date start , Date end ) { } void getHotelStats ( ) { } boolean setDiscount ( int building , int room , int percentOff ) { } void removeBuilding ( Building building ) { } void addBuilding ( ) { } Building getBuilding ( int index ) { } int getNumOfBuildings ( ) { } @ Override public String toString ( ) { } }

Fix:
Room room = new Room ( number , 0 , 100.0 , Rank . FIVE_STAR , Condition . CLEAN , Smoking . NO_SMOKING ) ;
Buggy code:
public class CookieValuePersister implements IValuePersister { private static final long serialVersionUID = 1L ; private static final Log log = LogFactory . getLog ( CookieValuePersister . class ) ; public void clear ( final FormComponent component ) { } public void load ( final FormComponent component ) { final Cookie cookie = getCookie ( component ) ; if ( cookie != null ) { final String value = cookie . getValue ( ) ; if ( value != null ) { <START_BUG> component . setModelValue ( value . split ( ";" ) ) ; <END_BUG> } } } public void save ( final FormComponent component ) { } private void clear ( final Cookie cookie ) { } private String cookieToDebugString ( final Cookie cookie ) { } private Cookie getCookie ( final FormComponent component ) { } private Cookie [ ] getCookies ( ) { } private CookieValuePersisterSettings getSettings ( ) { } private WebRequest getWebRequest ( ) { } private WebResponse getWebResponse ( ) { } private Cookie save ( final Cookie cookie ) { } }

Fix:
component . setModelValue ( value . split ( VALUE_SEPARATOR ) ) ;
Buggy code:
public class CameraActivity extends Fragment { public interface CameraPreviewListener { public void onPictureTaken ( String originalPicturePath , String previewPicturePath ) { } } private CameraActivity . CameraPreviewListener eventListener ; private static final String TAG = "CameraPreview" ; public FrameLayout mainLayout ; public FrameLayout frameContainerLayout ; private Preview mPreview ; private boolean canTakePicture = true ; private View view ; private Parameters cameraParameters ; private Camera mCamera ; private int numberOfCameras ; private int cameraCurrentlyLocked ; private int defaultCameraId ; public String defaultCamera ; public boolean tapToTakePicture ; public boolean dragEnabled ; public int width ; public int height ; public int x ; public int y ; public void setEventListener ( CameraActivity . CameraPreviewListener listener ) { } private String appResourcesPackage ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } public void setRect ( int x , int y , int width , int height ) { } private void createCameraPreview ( ) { } private void setDefaultCameraId ( ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } public Camera getCamera ( ) { } public void switchCamera ( ) { } public void setCameraParameters ( Camera . Parameters params ) { } public boolean hasFrontCamera ( ) { } public Bitmap cropBitmap ( Bitmap bitmap , Rect rect ) { } public void takePicture ( final double maxWidth , final double maxHeight ) { } private void processPicture ( Bitmap bitmap ) { ByteArrayOutputStream jpeg_data = new ByteArrayOutputStream ( ) ; CompressFormat compressFormat = CompressFormat . JPEG ; int mQuality = 90 ; try { <START_BUG> if ( bitmap . compress ( jpegCompressFormat , mQuality , jpeg_data ) ) { <END_BUG> byte [ ] code = jpeg_data . toByteArray ( ) ; byte [ ] output = Base64 . encode ( code , NO_WRAP ) ; String js_out = new String ( output ) ; eventListener . onPictureTaken ( js_out ) ; js_out = null ; output = null ; code = null ; } } catch ( Exception e ) { this . failPicture ( "Error<seq2seq4repair_space>compressing<seq2seq4repair_space>image." ) ; } jpeg_data = null ; } private void generatePictureFromView ( final Bitmap originalPicture , final Bitmap picture ) { } private File getOutputMediaFile ( String suffix ) { } private File storeImage ( Bitmap image , String suffix ) { } public int calculateInSampleSize ( BitmapFactory . Options options , int reqWidth , int reqHeight ) { } private Bitmap loadBitmapFromView ( View v ) { } @ Override public void onDestroy ( ) { } public void printPreviewSize ( String from ) { } }

Fix:
if ( bitmap . compress ( compressFormat , mQuality , jpeg_data ) ) {
Buggy code:
@ Reversible public class SequenceRule extends Rule { private static final long serialVersionUID = 2L ; final Rule [ ] sequence ; private Condition c ; final List < Set < String > > tagList ; class SequenceMatcher extends NonterminalMatcher { LinkedList < Matcher > matchers = new LinkedList < Matcher > ( ) ; LinkedList < Match > matched = new LinkedList < Match > ( ) ; public SequenceMatcher ( CharSequence cs , Integer offset , Map < Integer , CachedMatch > [ ] cache , Matcher master ) { } @ Override protected void fetchNext ( ) { } } public SequenceRule ( Label l , List < Rule > list , List < Set < String > > tagList ) { } public SequenceRule ( Label label , Rule [ ] sequence , List < Set < String > > tagList ) { } @ Override public Matcher matcher ( CharSequence cs , Integer offset , Map < Integer , CachedMatch > [ ] cache , Matcher master ) { } @ Override protected String uniqueId ( ) { } @ Override public String description ( boolean inBrackets ) { } @ Override public Set < Integer > study ( CharSequence s , Map < Integer , CachedMatch > [ ] cache , Set < Rule > studiedRules , GlobalState options ) { } @ Override public boolean zeroWidth ( ) { } @ Override public Rule shallowClone ( ) { } @ Override public Rule conditionalize ( Condition c , String id ) { if ( ( this . c ) == null ) { this . c = c ; this . condition = id ; } else { if ( ( this . c ) instanceof LogicalCondition ) { if ( ! ( ( ( LogicalCondition ) ( this . c ) ) . replace ( id , c ) ) ) <START_BUG> throw new GrammarException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>defined<seq2seq4repair_space>" + id ) + "<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>condition" ) ) ; <END_BUG> } else if ( ( this . c ) instanceof LeafCondition ) { LeafCondition lc = ( ( LeafCondition ) ( this . c ) ) ; if ( lc . cnd . equals ( id ) ) this . c = c ; else throw new GrammarException ( ( ( ( "rule<seq2seq4repair_space>" + ( this ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>carry<seq2seq4repair_space>condition<seq2seq4repair_space>" ) + id ) ) ; } else throw new GrammarException ( ( ( "condition<seq2seq4repair_space>on<seq2seq4repair_space>rule<seq2seq4repair_space>" + ( this ) ) + "<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>redefined" ) ) ; } return this ; } @ Override public void addLabels ( Match match , Set < String > labels ) { } @ Override protected void setUid ( ) { } @ Override protected void setCacheIndex ( Map < String , Integer > uids ) { } @ Override protected int maxCacheIndex ( int currentMax , Set < Rule > visited ) { } @ Override protected void rules ( Map < String , Rule > map ) { } @ Override protected void fixAlternation ( ) { } }

Fix:
throw new GrammarException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>define<seq2seq4repair_space>" + id ) + "<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>condition" ) ) ;
Buggy code:
public class LongType extends AbstractType { public int compare ( byte [ ] o1 , byte [ ] o2 ) { if ( ( o1 . length ) == 0 ) { return ( o2 . length ) == 0 ? 0 : - 1 ; } if ( ( o2 . length ) == 0 ) { return 1 ; } long L1 = ByteBuffer . wrap ( o1 ) . order ( ByteOrder . LITTLE_ENDIAN ) . getLong ( ) ; long L2 = ByteBuffer . wrap ( o2 ) . order ( ByteOrder . LITTLE_ENDIAN ) . getLong ( ) ; <START_BUG> return new Long ( L1 ) . compareTo ( L2 ) ; <END_BUG> } public String getString ( byte [ ] bytes ) { } }

Fix:
return Long . valueOf ( L1 ) . compareTo ( Long . valueOf ( L2 ) ) ;
Buggy code:
public class ThumbnailImageResource extends DynamicImageResource { private static Log log = LogFactory . getLog ( ThumbnailImageResource . class ) ; private final ImageResource unscaledImageResource ; private final int maxSize ; private int scaleHints = Image . SCALE_SMOOTH ; public ThumbnailImageResource ( ImageResource unscaledImageResource , int maxSize ) { } protected byte [ ] getImageData ( ) { } protected final BufferedImage getScaledImageInstance ( ) { InputStream is = null ; BufferedImage originalImage = null ; try { <START_BUG> is = unscaledImageResource . getResource ( ) . getInputStream ( ) ; <END_BUG> originalImage = ImageIO . read ( is ) ; if ( originalImage == null ) { throw new IOException ( "unable<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>image" ) ; } } catch ( IOException e ) { throw new WicketRuntimeException ( e ) ; } catch ( ResourceStreamNotFoundException e ) { throw new WicketRuntimeException ( e ) ; } finally { if ( is != null ) try { is . close ( ) ; } catch ( IOException e ) { ThumbnailImageResource . log . error ( e . getMessage ( ) , e ) ; } } int originalWidth = originalImage . getWidth ( ) ; int originalHeight = originalImage . getHeight ( ) ; if ( ( originalWidth > ( maxSize ) ) || ( originalHeight > ( maxSize ) ) ) { final int newWidth ; final int newHeight ; if ( originalWidth > originalHeight ) { newWidth = maxSize ; newHeight = ( ( maxSize ) * originalHeight ) // originalWidth ; } else { newWidth = ( ( maxSize ) * originalWidth ) // originalHeight ; newHeight = maxSize ; } Image image = originalImage . getScaledInstance ( newWidth , newHeight , scaleHints ) ; BufferedImage bufferedImage = new BufferedImage ( newWidth , newHeight , BufferedImage . TYPE_INT_BGR ) ; bufferedImage . createGraphics ( ) . drawImage ( image , 0 , 0 , null ) ; return bufferedImage ; } return originalImage ; } public final void setScaleHints ( int scaleHints ) { } }

Fix:
is = unscaledImageResource . getResourceStream ( ) . getInputStream ( ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class JaxrsEjbInterceptorsEarTestCase { @ Deployment ( testable = false ) public static Archive < ? > deploy ( ) { EnterpriseArchive ear = ShrinkWrap . create ( EnterpriseArchive . class , "jaxrsnoap.ear" ) ; final JavaArchive ejbJar = ShrinkWrap . create ( JavaArchive . class , "ejbjar.jar" ) ; <START_BUG> ejbJar . addClasses ( EJBResource . class , EjbInterceptor . class ) ; <END_BUG> ear . addAsModule ( ejbJar ) ; WebArchive war = ShrinkWrap . create ( WebArchive . class , "jaxrsnoap.war" ) ; war . addPackage ( HttpRequest . class . getPackage ( ) ) ; war . addAsWebInfResource ( WebXml . get ( ( "<servlet-mapping>\n" + ( ( ( "<seq2seq4repair_space><servlet-name>javax.ws.rs.core.Application<//servlet-name>\n" + "<seq2seq4repair_space><url-pattern>//myjaxrs//*<//url-pattern>\n" ) + "<seq2seq4repair_space><//servlet-mapping>\n" ) + "\n" ) ) ) , "web.xml" ) ; ear . addAsModule ( war ) ; return ear ; } @ ArquillianResource private URL url ; private String performCall ( String urlPattern ) throws Exception { } @ Test public void testJaxRsWithNoApplication ( ) throws Exception { } }

Fix:
ejbJar . addClasses ( EJBResource . class , EjbInterceptor . class , EjbInterface . class ) ;
Buggy code:
public class BorderTool extends ActionTool { public BorderTool ( DrawingEditor editor ) { } public void mouseDown ( MouseEvent e , int x , int y ) { setView ( ( ( DrawingView ) ( e . getSource ( ) ) ) ) ; if ( ( ( e . getModifiers ( ) ) & ( InputEvent . CTRL_MASK ) ) == 0 ) { super . mouseDown ( e , x , y ) ; } else { Figure target = drawing ( ) . findFigure ( x , y ) ; <START_BUG> if ( ( target != null ) && ( target instanceof DecoratorFigure ) ) { <END_BUG> view ( ) . addToSelection ( target ) ; reverseAction ( target ) ; } } } public void action ( Figure figure ) { } public void reverseAction ( Figure figure ) { } protected Undoable createUndoActivity ( ) { } public static class UndoActivity extends UndoableAdapter { public UndoActivity ( DrawingView newDrawingView ) { } public boolean undo ( ) { } public boolean redo ( ) { } public boolean replaceAffectedFigures ( ) { } } }

Fix:
if ( ( target != null ) && ( target != ( target . getDecoratedFigure ( ) ) ) ) {
Buggy code:
public class SpringWebApplicationFactory implements IWebApplicationFactory { private ConfigurableWebApplicationContext additionalContext ; protected final String getContextConfigLocation ( WicketFilter filter ) { } protected ConfigurableWebApplicationContext newApplicationContext ( ) { } public WebApplication createApplication ( WicketFilter filter ) { } private WebApplication createApplication ( ApplicationContext ac , String beanName ) { if ( beanName != null ) { WebApplication application = ( ( WebApplication ) ( ac . getBean ( beanName ) ) ) ; if ( application == null ) { throw new IllegalArgumentException ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>WebApplication<seq2seq4repair_space>bean<seq2seq4repair_space>with<seq2seq4repair_space>name<seq2seq4repair_space>[" + beanName ) + "]" ) ) ; } return application ; } else { Map < ? , ? > beans = BeanFactoryUtils . beansOfTypeIncludingAncestors ( ac , WebApplication . class , false , false ) ; if ( ( beans . size ( ) ) == 0 ) { throw new IllegalStateException ( ( ( "bean<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>[" + ( WebApplication . class . getName ( ) ) ) + "]<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ) ; } if ( ( beans . size ( ) ) > 1 ) { <START_BUG> throw new IllegalStateException ( ( ( "more<seq2seq4repair_space>then<seq2seq4repair_space>one<seq2seq4repair_space>bean<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>[" + ( WebApplication . class . getName ( ) ) ) + "]<seq2seq4repair_space>found,<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>only<seq2seq4repair_space>one" ) ) ; <END_BUG> } return ( ( WebApplication ) ( beans . values ( ) . iterator ( ) . next ( ) ) ) ; } } protected final ConfigurableWebApplicationContext createWebApplicationContext ( WebApplicationContext parent , WicketFilter filter ) throws BeansException { } protected void postProcessWebApplicationContext ( ConfigurableWebApplicationContext wac , WicketFilter filter ) { } public void destroy ( ) { } }

Fix:
throw new IllegalStateException ( ( ( "More<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>bean<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>[" + ( WebApplication . class . getName ( ) ) ) + "]<seq2seq4repair_space>found,<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>only<seq2seq4repair_space>one" ) ) ;
Buggy code:
public class Util { public static final int ESCAPE = 27 ; public static final char [ ] START_ERR_MARKER = new char [ ] { Util . ESCAPE , '[' , '1' , '2' , 'u' } ; public static final char [ ] END_ERR_MARKER = new char [ ] { Util . ESCAPE , '[' , '1' , '1' , 'u' } ; public static final char [ ] EOF_MARKER = new char [ ] { Util . ESCAPE , '[' , '9' , '9' , ';' , '9' , '9' , 'u' } ; <START_BUG> public static void copyThread ( final Reader fromInferior , boolean errStream , final Writer out ) { <END_BUG> Thread th = new Thread ( ) { char [ ] buffer = new char [ 1024 ] ; public void run ( ) { for ( ; ; ) { try { int count = fromInferior . read ( buffer ) ; if ( count < 0 ) { out . write ( Util . EOF_MARKER , 0 , Util . EOF_MARKER . length ) ; break ; } if ( errStream ) { synchronized ( out ) { out . write ( Util . START_ERR_MARKER , 0 , Util . START_ERR_MARKER . length ) ; out . write ( buffer , 0 , count ) ; out . write ( Util . END_ERR_MARKER , 0 , Util . END_ERR_MARKER . length ) ; } } else { out . write ( buffer , 0 , count ) ; } } catch ( Throwable ex ) { ex . printStackTrace ( ) ; System . exit ( ( - 1 ) ) ; } } } } ; th . start ( ) ; } public static String parseSimpleJsonString ( String str , int start , int end ) { } }

Fix:
public static void copyThread ( final Reader fromInferior , final boolean errStream , final Writer out ) {
Buggy code:
public class P4Add extends P4Base { private String addCmd = "" ; private ArrayList filesets = new ArrayList ( ) ; private int m_cmdLength = 450 ; private int m_changelist ; public void setChangelist ( int changelist ) throws TaskException { } public void setCommandlength ( int len ) throws TaskException { } public void addFileset ( FileSet set ) { } public void execute ( ) throws TaskException { } private void execP4Add ( final StringBuffer list ) throws TaskException { if ( getContext ( ) . isInfoEnabled ( ) ) { final String message = ( ( ( "Execing<seq2seq4repair_space>add<seq2seq4repair_space>" + ( m_p4CmdOpts ) ) + "<seq2seq4repair_space>" ) + ( addCmd ) ) + list ; <START_BUG> getContext ( ) . info ( message ) ; <END_BUG> } final String command = ( ( ( "-s<seq2seq4repair_space>add<seq2seq4repair_space>" + ( m_p4CmdOpts ) ) + "<seq2seq4repair_space>" ) + ( addCmd ) ) + list ; execP4Command ( command , null ) ; } }

Fix:
getContext ( ) . verbose ( message ) ;
Buggy code:
public class ComposerModel { ColumbaMessage message ; AccountItem accountItem ; String bodytext ; String charsetName ; List attachments ; List toList ; List ccList ; List bccList ; boolean signMessage ; boolean encryptMessage ; private boolean isHtmlMessage ; public ComposerModel ( ) { } public ComposerModel ( ColumbaMessage message ) { } public ComposerModel ( boolean html ) { } public ComposerModel ( ColumbaMessage message , boolean html ) { } public void setTo ( String s ) { <START_BUG> log . debug ( ( "to-headerfield:" + s ) ) ; <END_BUG> if ( s == null ) { return ; } if ( ( s . length ( ) ) == 0 ) { return ; } List v = ListParser . parseString ( s ) ; for ( Iterator it = v . iterator ( ) ; it . hasNext ( ) ; ) { String str = ( ( String ) ( it . next ( ) ) ) ; HeaderItem item = new HeaderItem ( HeaderItem . CONTACT ) ; item . add ( "displayname" , AddressParser . getDisplayname ( str ) ) ; item . add ( "email;internet" , AddressParser . getAddress ( str ) ) ; item . add ( "field" , "To" ) ; getToList ( ) . add ( item ) ; } } public void setHeaderField ( String key , String value ) { } public void setHeader ( Header header ) { } public String getHeaderField ( String key ) { } public void setToList ( List v ) { } public void setCcList ( List v ) { } public void setBccList ( List v ) { } public List getToList ( ) { } public List getCcList ( ) { } public List getBccList ( ) { } public void setAccountItem ( AccountItem item ) { } public AccountItem getAccountItem ( ) { } public void setMessage ( ColumbaMessage message ) { } public ColumbaMessage getMessage ( ) { } public String getHeader ( String key ) { } public void addMimePart ( StreamableMimePart mp ) { } public void setBodyText ( String str ) { } public String getSignature ( ) { } public String getBodyText ( ) { } public String getSubject ( ) { } public void setSubject ( String s ) { } public List getAttachments ( ) { } public void setAccountItem ( String host , String address ) { } public String getCharsetName ( ) { } public void setCharsetName ( String charsetName ) { } public boolean isSignMessage ( ) { } public void setSignMessage ( boolean signMessage ) { } public boolean isEncryptMessage ( ) { } public void setEncryptMessage ( boolean encryptMessage ) { } public String getPriority ( ) { } public void setPriority ( String s ) { } public boolean isHtml ( ) { } public void setHtml ( boolean html ) { } public List getRCPTVector ( ) { } }

Fix:
log . info ( ( "to-headerfield:" + s ) ) ;
Buggy code:
public abstract class AsyncInvocationTask implements Runnable , Future { private final CancellationFlag cancelledFlag ; private volatile boolean running = false ; private boolean done = false ; private Object result ; private Exception failed ; public AsyncInvocationTask ( final CancellationFlag cancelledFlag ) { } @ Override public synchronized boolean cancel ( final boolean mayInterruptIfRunning ) { } protected abstract Object runInvocation ( ) throws Exception { } public void run ( ) { } private synchronized void setResult ( final Object result ) { } private synchronized void setFailed ( final Exception e ) { } private void done ( ) { } @ Override public boolean isCancelled ( ) { <START_BUG> return cancelledFlag . get ( ) ; <END_BUG> } @ Override public boolean isDone ( ) { } @ Override public synchronized Object get ( ) throws InterruptedException , ExecutionException { } @ Override public synchronized Object get ( final long timeout , final TimeUnit unit ) throws InterruptedException , ExecutionException , TimeoutException { } }

Fix:
return ( done ) && ( cancelledFlag . get ( ) ) ;
Buggy code:
public class DecoratorsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private Text descriptionText ; private CheckboxTableViewer checkboxViewer ; protected Control createContents ( Composite parent ) { } private void createDecoratorsArea ( Composite mainComposite ) { } private void createDescriptionArea ( Composite mainComposite ) { } private void populateDecorators ( ) { } private void showDescription ( DecoratorDefinition definition ) { } private void clearDescription ( ) { } protected void performDefaults ( ) { } public boolean performOk ( ) { if ( super . performOk ( ) ) { DecoratorManager manager = getDecoratorManager ( ) ; DecoratorDefinition [ ] definitions = manager . getAllDecoratorDefinitions ( ) ; for ( int i = 0 ; i < ( definitions . length ) ; i ++ ) { boolean checked = checkboxViewer . getChecked ( definitions [ i ] ) ; <START_BUG> definitions [ i ] . setEnabledWithErrorHandling ( checked ) ; <END_BUG> } manager . reset ( ) ; return true ; } return false ; } public void init ( IWorkbench workbench ) { } private DecoratorDefinition [ ] getAllDefinitions ( ) { } private DecoratorManager getDecoratorManager ( ) { } }

Fix:
definitions [ i ] . setEnabled ( checked ) ;
Buggy code:
public abstract class AbstractXDocReportRenderer implements ReportRenderer { protected Logger log = LoggerFactory . getLogger ( getClass ( ) ) ; @ Inject InjectionPoint injectionPoint ; @ Inject BeanManager beanManager ; private String via ; @ PostConstruct protected void init ( ) { } @ Override public final void render ( Report report , OutputStream output ) throws IOException { XDocReportSeamReport seamReport = ( ( XDocReportSeamReport ) ( report ) ) ; IXDocReport delegate = seamReport . getDelegate ( ) ; IContext context = seamReport . getContext ( ) ; <START_BUG> Options options = Options . getFrom ( delegate . getKind ( ) ) . to ( "PDF" ) ; <END_BUG> if ( ( via ) != null ) { options . via ( via ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Using<seq2seq4repair_space>Options<seq2seq4repair_space>from={},<seq2seq4repair_space>to={},<seq2seq4repair_space>via={}" , new Object [ ] { options . getFrom ( ) , options . getTo ( ) , options . getVia ( ) } ) ; } try { delegate . convert ( context , options , output ) ; } catch ( XDocReportException e ) { throw new org . jboss . seam . reports . exceptions . ReportException ( e ) ; } } protected abstract String getOutput ( ) { } protected Via getConvertVia ( ) { } }

Fix:
Options options = Options . getFrom ( delegate . getKind ( ) ) . to ( getOutput ( ) ) ;
Buggy code:
public class UninstallAction extends AbstractAction { public UninstallAction ( BasicSubsystem requestor , BasicSubsystem target , boolean disableRootCheck ) { } @ Override public Object run ( ) { checkValid ( ) ; checkRoot ( ) ; State state = target . getState ( ) ; if ( EnumSet . of ( UNINSTALLED ) . contains ( state ) ) return null ; else if ( EnumSet . of ( INSTALL_FAILED , INSTALLING , RESOLVING , STARTING , STOPPING , UNINSTALLING ) . contains ( state ) ) { <START_BUG> waitForStateChange ( ) ; <END_BUG> target . uninstall ( ) ; } else if ( state . equals ( ACTIVE ) ) { new StopAction ( requestor , target , disableRootCheck ) . run ( ) ; target . uninstall ( ) ; } else ResourceUninstaller . newInstance ( requestor , target ) . uninstall ( ) ; return null ; } }

Fix:
waitForStateChange ( state ) ;