nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ServerLocatorServiceImpl extends HessianServlet implements ServerLocatorService { private static final String protocol = "jdbc:derby:" ; private Connection shardsConnection ; public ServerLocatorServiceImpl ( ) { } @ Override public void init ( ) throws ServletException { } @ Override public ShardResponse getUserShard ( String username ) { } @ Override public ShardResponse getLocationShard ( double lat , double lng ) { } @ Override public List < ShardResponse > getAllLocationShards ( ) { ResultSet rs = null ; List < ShardResponse > shards = new ArrayList < ShardResponse > ( ) ; try { PreparedStatement locationsStatement = shardsConnection . prepareStatement ( "Select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>locationshard" ) ; locationsStatement . execute ( ) ; rs = locationsStatement . getResultSet ( ) ; <START_BUG> if ( rs . next ( ) ) { <END_BUG> ShardResponse response = new ShardResponse ( rs . getString ( "master" ) , rs . getString ( "slave" ) ) ; response . setLatmin ( rs . getDouble ( "latmin" ) ) ; response . setLngmin ( rs . getDouble ( "lngmin" ) ) ; response . setLatmax ( rs . getDouble ( "latmax" ) ) ; response . setLngmax ( rs . getDouble ( "lngmax" ) ) ; shards . add ( response ) ; } return shards ; } catch ( SQLException e ) { throw new IllegalStateException ( e ) ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { throw new IllegalStateException ( e ) ; } } } } public void addUserShard ( int nodeid , String master , String slave ) { } public void addLocationShard ( double latmin , double lngmin , double latmax , double lngmax , String master , String slave , String name ) { } public void clearTables ( ) { } @ Override public ShardResponse findLocationShard ( String hostname ) { } }

Fix:
while ( rs . next ( ) ) {
Buggy code:
public final class BondedNodesConvertor extends PrimitiveConvertor { private static final Logger logger = LoggerFactory . getLogger ( BondedNodesConvertor . class ) ; private BondedNodesConvertor ( ) { } private static final BondedNodesConvertor instance = new BondedNodesConvertor ( ) ; public static BondedNodesConvertor getInstance ( ) { } public static final int TYPE_SIZE = 32 ; @ Override public int getGenericTypeSize ( ) { } @ Override public short [ ] toProtoValue ( Object value ) throws ValueConversionException { } @ Override public Object toObject ( short [ ] protoValue ) throws ValueConversionException { BondedNodesConvertor . logger . debug ( "toObject<seq2seq4repair_space>-<seq2seq4repair_space>start:<seq2seq4repair_space>protoValue={}" , protoValue ) ; final int MAX_BONDED_NODE_NUMBER = 239 ; <START_BUG> final int MAX_BYTES_USED = MAX_BONDED_NODE_NUMBER // 8 ; <END_BUG> List < Integer > bondedNodesList = new LinkedList < > ( ) ; for ( int byteId = 0 ; byteId < 32 ; byteId ++ ) { if ( byteId >= MAX_BYTES_USED ) { break ; } if ( ( protoValue [ byteId ] ) == 0 ) { continue ; } int bitComp = 1 ; for ( int bitId = 0 ; bitId < 8 ; bitId ++ ) { if ( ( ( protoValue [ byteId ] ) & bitComp ) == bitComp ) { bondedNodesList . add ( ( ( byteId * 8 ) + bitId ) ) ; } bitComp *= 2 ; } } BondedNodes bondedNodes = new BondedNodes ( bondedNodesList ) ; BondedNodesConvertor . logger . debug ( "toObject<seq2seq4repair_space>-<seq2seq4repair_space>end:<seq2seq4repair_space>{}" , bondedNodes ) ; return bondedNodes ; } }

Fix:
final int MAX_BYTES_USED = ( ( int ) ( Math . ceil ( ( MAX_BONDED_NODE_NUMBER // 8.0 ) ) ) ) ;
Buggy code:
public class LeaderBoard { ArrayList < LeaderBoard . SimpleUser > userScores = new ArrayList < LeaderBoard . SimpleUser > ( ) ; public LeaderBoard ( ) { } private void addUser ( User u ) { } public void updateUsers ( User u ) { } public String getRank ( User u ) { } public int getNumUsersInLeaderboard ( ) { } public String getTopScores ( ) { String top = "" ; int sizeTo = 5 ; if ( ( userScores . size ( ) ) < sizeTo ) { sizeTo = userScores . size ( ) ; } <START_BUG> top += "Top<seq2seq4repair_space>sizeTo<seq2seq4repair_space>Scores:\n" ; <END_BUG> for ( int i = 1 ; i <= sizeTo ; i ++ ) { top += ( ( ( userScores . get ( ( i - 1 ) ) . getName ( ) ) + "<seq2seq4repair_space>" ) + ( userScores . get ( ( i - 1 ) ) . getScore ( ) ) ) + "\n" ; } return top ; } private class SimpleUser implements Comparable { private String name ; private int score ; public SimpleUser ( User u ) { } public String getName ( ) { } public int getScore ( ) { } public boolean equals ( User u ) { } public boolean equals ( LeaderBoard . SimpleUser u ) { } public int compareTo ( Object o ) { } } No newline ; at end ; of file ; }

Fix:
top += ( "Top<seq2seq4repair_space>" + sizeTo ) + "<seq2seq4repair_space>Scores:\n" ;
Buggy code:
class ML { public static hsv [ ] [ ] img2RGB2HSV ( String ip ) throws IOException { } public static void HSV2File ( hsv [ ] [ ] hsvImage , int width , int height ) throws IOException { BufferedImage image = new BufferedImage ( width , height , BufferedImage . TYPE_INT_RGB ) ; WritableRaster raster = image . getRaster ( ) ; for ( int i = 0 ; i < height ; i ++ ) { for ( int j = 0 ; j < width ; j ++ ) { int RGB = Color . HSBtoRGB ( hsvImage [ j ] [ i ] . h , hsvImage [ j ] [ i ] . s , hsvImage [ j ] [ i ] . v ) ; Color c = new Color ( RGB ) ; <START_BUG> int [ ] temp = new int [ ] { c . getRed ( ) , c . getBlue ( ) , c . getGreen ( ) } ; <END_BUG> raster . setPixel ( j , i , temp ) ; } } ImageIO . write ( image , "PNG" , new File ( "hsv2file.png" ) ) ; } public static void main ( String [ ] args ) throws IOException { } No newline ; at end ; of file ; }

Fix:
int [ ] temp = new int [ ] { c . getRed ( ) , c . getGreen ( ) , c . getBlue ( ) } ;
Buggy code:
public class StringProperty extends AbstractProperty { private static final long serialVersionUID = 233L ; private String value ; private transient String savedValue ; public StringProperty ( String name , String value ) { } public StringProperty ( ) { } @ Override public void setRunningVersion ( boolean runningVersion ) { } public void setObjectValue ( Object v ) { } public String getStringValue ( ) { } public Object getObjectValue ( ) { } @ Override <START_BUG> public Object clone ( ) { <END_BUG> StringProperty prop = ( ( StringProperty ) ( super . clone ( ) ) ) ; prop . value = value ; return prop ; } public void setValue ( String value ) { } public void recoverRunningVersion ( TestElement owner ) { } }

Fix:
public StringProperty clone ( ) {
Buggy code:
public class Course implements Disposable { static final int MIN_HEIGHT = - 3 ; static final int MAX_HEIGHT = 4 ; static final float HEIGHT_SCALE = 1.0F // ( ( Course . MAX_HEIGHT ) - ( Course . MIN_HEIGHT ) ) ; protected String path ; protected String name ; protected String desc ; protected int width ; protected int height ; protected Vector2 startpos ; protected Vector2 holepos ; protected ArrayList < Obstacle > obstacles ; protected int [ ] [ ] heightmap ; protected boolean [ ] [ ] isOutside ; protected Color color ; protected Mesh mesh ; private float [ ] vertices ; private short [ ] indices ; private int index ; private int stride ; private int posPos ; private int norPos ; private int colPos ; Course ( int width , int height ) { } public void setCorner ( int x , int y , int h ) { } public void raiseCorner ( int x , int y ) { } public void lowerCorner ( int x , int y ) { } public void setTileInMap ( int x , int y , boolean isInMap ) { } public void setStartPosition ( Vector2 pos ) { } public void setHolePosition ( Vector2 pos ) { } private void addVertex ( MeshPartBuilder . VertexInfo v ) { } private void generateTriangle ( MeshPartBuilder . VertexInfo v0 , MeshPartBuilder . VertexInfo v1 , MeshPartBuilder . VertexInfo v2 ) { } private void generateHole ( int h ) { MeshPartBuilder . VertexInfo v0 = new MeshPartBuilder . VertexInfo ( ) ; MeshPartBuilder . VertexInfo v1 = new MeshPartBuilder . VertexInfo ( ) ; MeshPartBuilder . VertexInfo v2 = new MeshPartBuilder . VertexInfo ( ) ; <START_BUG> float r = 0.25 ; <END_BUG> } public void updateMesh ( ) { } @ Override public void dispose ( ) { } public static void main ( String [ ] args ) { } }

Fix:
float r = 0.25F ;
Buggy code:
public class SortElementsOperation extends JavaModelOperation { Comparator comparator ; boolean hasChanged ; int [ ] positions ; public SortElementsOperation ( IJavaElement [ ] elements , int [ ] positions , Comparator comparator ) { } protected int getMainAmountOfWork ( ) { } protected void executeOperation ( ) throws JavaModelException { try { beginTask ( Util . bind ( "operation.sortelements" ) , getMainAmountOfWork ( ) ) ; CompilationUnit copy = ( ( CompilationUnit ) ( fElementsToProcess [ 0 ] ) ) ; <START_BUG> ICompilationUnit unit = ( ( ICompilationUnit ) ( copy . getOriginalElement ( ) ) ) ; <END_BUG> IBuffer buffer = copy . getBuffer ( ) ; if ( buffer == null ) { return ; } char [ ] bufferContents = buffer . getCharacters ( ) ; String result = processElement ( unit , positions , bufferContents ) ; if ( ! ( CharOperation . equals ( result . toCharArray ( ) , bufferContents ) ) ) { copy . getBuffer ( ) . setContents ( result ) ; } worked ( 1 ) ; } finally { done ( ) ; } } private String processElement ( ICompilationUnit unit , int [ ] positionsToMap , char [ ] source ) throws JavaModelException { } public IJavaModelStatus verify ( ) { } }

Fix:
ICompilationUnit unit = copy . getPrimary ( ) ;
Buggy code:
public class HandlerFileChange implements OperationStepHandler { public static final String OPERATION_NAME = "change-file" ; public static final HandlerFileChange INSTANCE = new HandlerFileChange ( ) ; @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final Resource resource = context . readResourceForUpdate ( EMPTY_ADDRESS ) ; final ModelNode originalModel = resource . getModel ( ) . clone ( ) ; final ModelNode model = resource . getModel ( ) ; CommonAttributes . FILE . validateAndSet ( operation , model ) ; <START_BUG> if ( ( ( context . getType ( ) ) == ( Type . SERVER ) ) && ( ! ( context . isBooting ( ) ) ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String name = address . getLastElement ( ) . getValue ( ) ; final ModelNode oldFile = CommonAttributes . FILE . resolveModelAttribute ( context , originalModel ) ; final ModelNode file = CommonAttributes . FILE . resolveModelAttribute ( context , model ) ; if ( FileHandlers . changeFile ( context , oldFile , file , name ) ) { context . restartRequired ( ) ; } if ( ( context . completeStep ( ) ) == ( ResultAction . ROLLBACK ) ) { FileHandlers . revertFileChange ( context , CommonAttributes . FILE . resolveModelAttribute ( context , originalModel ) , name ) ; } } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( ( context . isNormalServer ( ) ) && ( ! ( context . isBooting ( ) ) ) ) {
Buggy code:
public class BeiderMorseEncoderTest extends StringEncoderAbstractTest { private void assertNotEmpty ( BeiderMorseEncoder bmpm , final String value ) throws EncoderException { } private BeiderMorseEncoder createGenericApproxEncoder ( ) { } @ Override protected StringEncoder createStringEncoder ( ) { } @ Test public void testAllChars ( ) throws EncoderException { } @ Test public void testAsciiEncodeNotEmpty1Letter ( ) throws EncoderException { } @ Test public void testAsciiEncodeNotEmpty2Letters ( ) throws EncoderException { } @ Test public void testEncodeAtzNotEmpty ( ) throws EncoderException { } @ Test public void testEncodeGna ( ) throws EncoderException { } @ Test ( expected = IllegalArgumentException . class ) public void testInvalidLangIllegalArgumentException ( ) { } @ Test ( expected = IllegalStateException . class ) public void testInvalidLangIllegalStateException ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testInvalidLanguageIllegalArgumentException ( ) { } @ Test ( timeout = 10000L ) public void testLongestEnglishSurname ( ) throws EncoderException { } @ Test ( expected = IndexOutOfBoundsException . class ) public void testNegativeIndexForRuleMatchIndexOutOfBoundsException ( ) { } @ Test public void testSetConcat ( ) { } @ Test public void testSetNameTypeAsh ( ) { } @ Test public void testSetRuleTypeExact ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testSetRuleTypeToRulesIllegalArgumentException ( ) { } <START_BUG> @ Test ( timeout = 20000L ) <END_BUG> public void testSpeedCheck ( ) throws EncoderException { char [ ] chars = new char [ ] { 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'o' , 'u' } ; BeiderMorseEncoder bmpm = createGenericApproxEncoder ( ) ; StringBuffer stringBuffer = new StringBuffer ( ) ; Random rand = new Random ( ) ; stringBuffer . append ( chars [ rand . nextInt ( chars . length ) ] ) ; long start ; for ( int i = 0 ; i < 30 ; i ++ ) { start = System . currentTimeMillis ( ) ; bmpm . encode ( stringBuffer . toString ( ) ) ; stringBuffer . append ( chars [ rand . nextInt ( chars . length ) ] ) ; } } }

Fix:
@ Test
Buggy code:
public class ArchiveDeployer { private static final Logger log = Logger . getLogger ( ArchiveDeployer . class ) ; private final ServerDeploymentHelper deployer ; public ArchiveDeployer ( ModelControllerClient modelControllerClient ) { } public String deploy ( Archive < ? > archive ) throws DeploymentException { } public String deploy ( String name , InputStream input ) throws DeploymentException { } public void undeploy ( String runtimeName ) throws DeploymentException { } private String deployInternal ( Archive < ? > archive ) throws DeploymentException { } private String deployInternal ( String name , InputStream input ) throws DeploymentException { try { return deployer . deploy ( name , input ) ; } catch ( Exception ex ) { Throwable rootCause = ex . getCause ( ) ; <START_BUG> while ( null != rootCause ) { <END_BUG> rootCause = rootCause . getCause ( ) ; } throw new DeploymentException ( ( "Cannot<seq2seq4repair_space>deploy:<seq2seq4repair_space>" + name ) , rootCause ) ; } } }

Fix:
while ( ( null != rootCause ) && ( ( rootCause . getCause ( ) ) != null ) ) {
Buggy code:
public class RefineConnectionFeature extends AbstractCustomFeature { private final AadlModificationService aadlModService ; private final ShapeService shapeService ; private final BusinessObjectResolutionService bor ; @ Inject public RefineConnectionFeature ( final AadlModificationService aadlModService , final ShapeService shapeService , final BusinessObjectResolutionService bor , final IFeatureProvider fp ) { } @ Override public String getName ( ) { } @ Override public boolean canUndo ( final IContext context ) { } @ Override public boolean isAvailable ( final IContext context ) { final ICustomContext customCtx = ( ( ICustomContext ) ( context ) ) ; final PictogramElement [ ] pes = customCtx . getPictogramElements ( ) ; if ( ( ( customCtx . getPictogramElements ( ) . length ) < 1 ) || ( ! ( ( customCtx . getPictogramElements ( ) [ 0 ] ) instanceof Connection ) ) ) { return false ; } final Connection connection = ( ( Connection ) ( pes [ 0 ] ) ) ; final Object bo = bor . getBusinessObjectForPictogramElement ( connection ) ; final ComponentImplementation ci = getComponentImplementation ( connection ) ; <START_BUG> return ( ( bo instanceof org . osate . aadl2 . Connection ) && ( ci != null ) ) && ( ( ( ( org . osate . aadl2 . Connection ) ( bo ) ) . getContainingClassifier ( ) ) != ci ) ; <END_BUG> } @ Override public boolean canExecute ( final ICustomContext context ) { } private ComponentImplementation getComponentImplementation ( final Connection connection ) { } @ Override public void execute ( final ICustomContext context ) { } }

Fix:
return ( ( ( bo instanceof org . osate . aadl2 . Connection ) && ( ci != null ) ) && ( ( ( ( org . osate . aadl2 . Connection ) ( bo ) ) . getContainingClassifier ( ) ) != ci ) ) && ( ci . getAllConnections ( ) . contains ( ( ( org . osate . aadl2 . Connection ) ( bo ) ) ) ) ;
Buggy code:
public class NotAnnotationTypePattern extends AnnotationTypePattern { private AnnotationTypePattern negatedPattern ; public NotAnnotationTypePattern ( AnnotationTypePattern pattern ) { } public FuzzyBoolean matches ( AnnotatedElement annotated ) { } public AnnotationTypePattern resolveBindings ( IScope scope , Bindings bindings , boolean allowBinding ) { } public void write ( DataOutputStream s ) throws IOException { } public static AnnotationTypePattern read ( DataInputStream s , ISourceContext context ) throws IOException { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } public String toString ( ) { <START_BUG> return ( "(!" + ( negatedPattern . toString ( ) ) ) + ")" ; <END_BUG> } public AnnotationTypePattern getNegatedPattern ( ) { } }

Fix:
return "!" + ( negatedPattern . toString ( ) ) ;
Buggy code:
public class Main extends Game implements Screen { public static final float TOWER_RADIUS = 16 ; public static final float ENEMY_SIZE = 8 ; public static final float ENEMY_SPEED = 32 ; public static final float TOWER_SPEED = 4 ; public static final float BULLET_SPEED = 96 ; public static final float TURN_RADIUS = 10 ; public static final float UI_WIDTH = 720 ; public static final float SELL_RATE = 0.75F ; public static final float GENERATOR_SPEED = 8 ; public static final float WAVE_INTERVAL = 10 ; public static final float HEALTH_RATE = 1.2F ; public static final float COMBO_TIME = 40 ; private static final AssetManager manager = new AssetManager ( ) ; public static Skin skin ; private static Main instance ; private static SpriteBatch batch ; private Stage loadingStage ; public static void changeScreen ( Screen screen ) { } public static Drawable getDrawable ( String name ) { } @ Override public void create ( ) { } @ Override public void show ( ) { } @ Override public void render ( float delta ) { } @ Override public void hide ( ) { } @ Override public void pause ( ) { } @ Override public void resume ( ) { } @ Override public void resize ( int width , int height ) { } @ Override public void dispose ( ) { } @ Override public void render ( ) { gl . glClearColor ( 0 , 0.015F , 0.025F , 1 ) ; gl . glClear ( ( ( GL20 . GL_COLOR_BUFFER_BIT ) | ( GL20 . GL_DEPTH_BUFFER_BIT ) ) ) ; <START_BUG> getScreen ( ) . render ( Gdx . graphics . getDeltaTime ( ) ) ; <END_BUG> } }

Fix:
getScreen ( ) . render ( Math . min ( 0.1F , Gdx . graphics . getDeltaTime ( ) ) ) ;
Buggy code:
public abstract class CommandHandlerWithHelp extends CommandHandlerWithArguments { private final String filename ; private final boolean connectionRequired ; protected final ArgumentWithoutValue helpArg = new ArgumentWithoutValue ( this , "--help" , "-h" ) ; public CommandHandlerWithHelp ( String command ) { } public CommandHandlerWithHelp ( String command , boolean connectionRequired ) { } @ Override public boolean isAvailable ( CommandContext ctx ) { } @ Override public void handle ( CommandContext ctx ) throws CommandFormatException { <START_BUG> if ( helpArg . isPresent ( ctx . getParsedArguments ( ) ) ) { <END_BUG> printHelp ( ctx ) ; return ; } if ( ! ( isAvailable ( ctx ) ) ) { ctx . printLine ( "The<seq2seq4repair_space>command<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>available<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>current<seq2seq4repair_space>context<seq2seq4repair_space>(e.g.<seq2seq4repair_space>required<seq2seq4repair_space>subsystems<seq2seq4repair_space>or<seq2seq4repair_space>connection<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>controller<seq2seq4repair_space>might<seq2seq4repair_space>be<seq2seq4repair_space>unavailable)." ) ; return ; } doHandle ( ctx ) ; } protected void printHelp ( CommandContext ctx ) { } protected abstract void doHandle ( CommandContext ctx ) throws CommandFormatException { } @ Override public boolean isBatchMode ( ) { } protected void printList ( CommandContext ctx , List < String > list , boolean l ) { } }

Fix:
if ( helpArg . isPresent ( ctx . getParsedCommandLine ( ) ) ) {
Buggy code:
public class UndertowConnectorTestCase { private final AbstractListenerService < ? > listener = mock ( AbstractListenerService . class ) ; private final Connector connector = new UndertowConnector ( this . listener ) ; @ Test public void getType ( ) { assertSame ( AJP , new UndertowConnector ( new org . wildfly . extension . undertow . AjpListenerService ( "" , "" , 0 ) ) . getType ( ) ) ; <START_BUG> assertSame ( HTTP , new UndertowConnector ( new org . wildfly . extension . undertow . HttpListenerService ( "" , "" , 0 , false ) ) . getType ( ) ) ; <END_BUG> assertSame ( HTTPS , new UndertowConnector ( new org . wildfly . extension . undertow . HttpsListenerService ( "" , "" , 0 ) ) . getType ( ) ) ; } @ Test public void getAddress ( ) throws UnknownHostException { } @ Test public void getPort ( ) throws UnknownHostException { } @ Test public void setAddress ( ) throws UnknownHostException { } }

Fix:
assertSame ( HTTP , new UndertowConnector ( new org . wildfly . extension . undertow . HttpListenerService ( "" , "" , 0 ) ) . getType ( ) ) ;
Buggy code:
public class OSQLFunctionLast extends OSQLFunctionConfigurableAbstract { public static final String NAME = "last" ; private Object last ; public OSQLFunctionLast ( ) { } public Object execute ( Object iThis , final OIdentifiable iCurrentRecord , Object iCurrentResult , final Object [ ] iParams , final OCommandContext iContext ) { } public boolean aggregateResults ( ) { } @ Override public Object getResult ( ) { } @ Override public boolean filterResult ( ) { <START_BUG> return true ; <END_BUG> } public String getSyntax ( ) { } }

Fix:
return false ;
Buggy code:
public class GameBoard extends Activity implements onTrickListener , onBidListener , onDiscardListener , onGamePlayListener { private BidFragment bidFragment ; private DiscardFragment discardFragment ; private GameFragment gameFragment ; private String trumpColor ; private CountDownTimer highlight1 ; private CountDownTimer highlight2 ; private CountDownTimer advanceGame ; private Game game ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void setupNewRound ( ) { } public void startBiddingFragment ( int [ ] bids ) { } public void onPlayerPassedBid ( View v ) { } @ Override public void onBidPlayed ( int bid ) { } @ Override public void resetAllTrickCards ( ) { } public void startDiscardFragment ( ) { } @ Override public void doneDiscarding ( int [ ] playerHand , int [ ] playerDiscards ) { } public void startGameFragment ( ) { } public void playerDidntLeadInitialize ( ) { } public void onPlayerPlayed ( int indexToPlay ) { if ( ( game . getNumberOfCompletedTricks ( ) ) != 10 ) { int currentTrickWinnerLocation = game . getTrickWinnerLocation ( ) ; gameFragment . setWhoLed ( game . getTrickWinnerLocation ( ) ) ; if ( ( game . getTrickWinnerLocation ( ) ) == 3 ) { game . playerPlayed ( indexToPlay ) ; game . advanceGameState ( ) ; } else { game . playerPlayed ( indexToPlay ) ; game . advanceGameState ( ) ; } Card [ ] playedCards = game . getCurrentTrick ( ) ; int [ ] playerHand = game . getPlayerCardsUI ( ) ; gameFragment . displayPlayerCards ( playerHand ) ; gameFragment . setOpponentsCards ( playedCards , currentTrickWinnerLocation ) ; if ( ( ( ( ( playedCards [ 0 ] . getValue ( ) ) != ( - 1 ) ) && ( ( playedCards [ 1 ] . getValue ( ) ) != ( - 1 ) ) ) && ( ( playedCards [ 2 ] . getValue ( ) ) != ( - 1 ) ) ) && ( ( playedCards [ 3 ] . getValue ( ) ) != ( - 1 ) ) ) { game . incrementNumberOfTricks ( ) ; highlight2 = new CountDownTimer ( 4000 , 1000 ) { public void onTick ( long millisTillFinished ) { } public void onFinish ( ) { if ( ( game . getNumberOfCompletedTricks ( ) ) < 10 ) { resetAllTrickCards ( ) ; } } } . start ( ) ; highlight1 = new CountDownTimer ( 2000 , 1000 ) { public void onTick ( long millisTillFinished ) { } public void onFinish ( ) { <START_BUG> if ( ( game . getNumberOfCompletedTricks ( ) ) >= 10 ) { <END_BUG> gameFragment . winnerHighlightToggle ( ( ( game . getTrickWinnerLocation ( ) ) + 1 ) ) ; } } } . start ( ) ; if ( ( game . getNumberOfCompletedTricks ( ) ) == 10 ) { showFinalScores ( game . getCurrentTeamScores ( ) ) ; } } } } public void cardPlayed ( View v ) { } public void showBidWinner ( int winner , String color ) { } public void showFinalScores ( int [ ] scores ) { } public void gameEnd ( ) { } public void cardClick ( View v ) { } public void blackTrumpSelect ( View v ) { } public void redTrumpSelect ( View v ) { } public void greenTrumpSelect ( View v ) { } public void blueTrumpSelect ( View v ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } }

Fix:
if ( ( game . getNumberOfCompletedTricks ( ) ) <= 10 ) {
Buggy code:
public class TestObjectFactory extends JMeterTestCase { private ObjectFactory of ; private Status status ; @ Override public void setUp ( ) { } public void testStatus ( ) throws Exception { } public void testNoStatus ( ) throws Exception { status = of . parseString ( "<a><//a>" ) ; <START_BUG> assertNotNull ( status ) ; <END_BUG> } public void testFileData ( ) throws Exception { } public void testStringData ( ) throws Exception { } private void checkResult ( ) { } }

Fix:
assertNull ( status ) ;
Buggy code:
final class HandlerAuthority extends ExpressionAuthority { private static final boolean DEBUG = Policy . DEBUG_HANDLERS ; private static final boolean DEBUG_VERBOSE = ( Policy . DEBUG_HANDLERS ) && ( Policy . DEBUG_HANDLERS_VERBOSE ) ; private static final String DEBUG_VERBOSE_COMMAND_ID = Policy . DEBUG_HANDLERS_VERBOSE_COMMAND_ID ; private final Set [ ] activationsBySourcePriority = new Set [ 33 ] ; private final CommandManager commandManager ; private final Map handlerActivationsByCommandId = new HashMap ( ) ; HandlerAuthority ( final CommandManager commandManager ) { } final void activateHandler ( final IHandlerActivation activation ) { } final void deactivateHandler ( final IHandlerActivation activation ) { } final Shell getActiveShell ( ) { } private final IHandlerActivation resolveConflicts ( final String commandId , final Collection handlerActivations ) { final Collection activations = trimInactive ( handlerActivations ) ; if ( activations . isEmpty ( ) ) { return null ; } final Iterator activationItr = activations . iterator ( ) ; IHandlerActivation bestActivation = ( ( IHandlerActivation ) ( activationItr . next ( ) ) ) ; boolean conflict = false ; while ( activationItr . hasNext ( ) ) { final IHandlerActivation currentActivation = ( ( IHandlerActivation ) ( activationItr . next ( ) ) ) ; final int comparison = bestActivation . compareTo ( currentActivation ) ; <START_BUG> if ( comparison < 0 ) { <END_BUG> bestActivation = currentActivation ; conflict = false ; } else if ( comparison == 0 ) { if ( ( currentActivation . getHandler ( ) ) != ( bestActivation . getHandler ( ) ) ) { conflict = true ; } } } if ( HandlerAuthority . DEBUG ) { if ( conflict ) { Tracing . printTrace ( "HANDLERS" , ( ( "Unresolved<seq2seq4repair_space>conflict<seq2seq4repair_space>detected<seq2seq4repair_space>for<seq2seq4repair_space>'" + commandId ) + '\'' ) ) ; } else if ( ( HandlerAuthority . DEBUG_VERBOSE ) && ( ( ( HandlerAuthority . DEBUG_VERBOSE_COMMAND_ID ) == null ) || ( HandlerAuthority . DEBUG_VERBOSE_COMMAND_ID . equals ( commandId ) ) ) ) { Tracing . printTrace ( "HANDLERS" , "Resolved<seq2seq4repair_space>conflict<seq2seq4repair_space>detected.<seq2seq4repair_space>The<seq2seq4repair_space>following<seq2seq4repair_space>activation<seq2seq4repair_space>won:<seq2seq4repair_space>" ) ; Tracing . printTrace ( "HANDLERS" , ( "<seq2seq4repair_space>" + bestActivation ) ) ; } } if ( conflict ) { return null ; } return bestActivation ; } protected final void sourceChanged ( final int sourcePriority ) { } private final Collection trimInactive ( final Collection activations ) { } private final void updateCommand ( final String commandId , final IHandlerActivation activation ) { } final void updateShellKludge ( ) { } }

Fix:
if ( comparison > 0 ) {
Buggy code:
public class RequestListenerInterface { private static final Map interfaces = Collections . synchronizedMap ( new HashMap ( ) ) ; public static final RequestListenerInterface forName ( final String interfaceName ) { } private Method method ; private String name ; public RequestListenerInterface ( final Class listenerInterfaceClass ) { } public final Method getMethod ( ) { } public final String getName ( ) { } public final void invoke ( final Page page , final Component component ) { } public IRequestTarget newRequestTarget ( final Page page , final Component component , final RequestListenerInterface listener , final RequestParameters requestParameters ) { } public String toString ( ) { <START_BUG> return ( ( ( "RequestListenerInterface{name=" + ( name ) ) + ",method=" ) + ( method ) ) + "}" ; <END_BUG> } private final void registerRequestListenerInterface ( final RequestListenerInterface requestListenerInterface ) { } }

Fix:
return ( ( ( "[RequestListenerInterface<seq2seq4repair_space>name=" + ( name ) ) + ",<seq2seq4repair_space>method=" ) + ( method ) ) + "]" ;
Buggy code:
public class MapGenDeeperCaves extends MapGenBase { private static final String __OBFID = "CL_00000393" ; protected void func_151542_a ( long p_151542_1_ , int p_151542_3_ , int p_151542_4_ , Block [ ] p_151542_5_ , double p_151542_6_ , double p_151542_8_ , double p_151542_10_ ) { } protected void func_151541_a ( long p_151541_1_ , int p_151541_3_ , int p_151541_4_ , Block [ ] p_151541_5_ , double p_151541_6_ , double p_151541_8_ , double p_151541_10_ , float p_151541_12_ , float p_151541_13_ , float p_151541_14_ , int p_151541_15_ , int p_151541_16_ , double p_151541_17_ ) { } protected void func_151538_a ( World p_151538_1_ , int p_151538_2_ , int p_151538_3_ , int p_151538_4_ , int p_151538_5_ , Block [ ] p_151538_6_ ) { int i1 = this . rand . nextInt ( ( ( this . rand . nextInt ( ( ( this . rand . nextInt ( 47 ) ) + 1 ) ) ) + 1 ) ) ; if ( ( this . rand . nextInt ( 3 ) ) != 0 ) { i1 = 0 ; } for ( int j1 = 0 ; j1 < i1 ; ++ j1 ) { double d0 = ( ( double ) ( ( p_151538_2_ * 16 ) + ( this . rand . nextInt ( 16 ) ) ) ) ; <START_BUG> double d1 = ( ( double ) ( this . rand . nextInt ( ( ( this . rand . nextInt ( 248 ) ) + 8 ) ) ) ) ; <END_BUG> double d2 = ( ( double ) ( ( p_151538_3_ * 16 ) + ( this . rand . nextInt ( 16 ) ) ) ) ; int k1 = 1 ; if ( ( this . rand . nextInt ( 4 ) ) == 0 ) { this . func_151542_a ( this . rand . nextLong ( ) , p_151538_4_ , p_151538_5_ , p_151538_6_ , d0 , d1 , d2 ) ; k1 += this . rand . nextInt ( 4 ) ; } for ( int l1 = 0 ; l1 < k1 ; ++ l1 ) { float f = ( ( this . rand . nextFloat ( ) ) * ( ( float ) ( Math . PI ) ) ) * 2.0F ; float f1 = ( ( ( this . rand . nextFloat ( ) ) - 0.5F ) * 2.0F ) // 8.0F ; float f2 = ( ( this . rand . nextFloat ( ) ) * 2.0F ) + ( this . rand . nextFloat ( ) ) ; if ( ( this . rand . nextInt ( 10 ) ) == 0 ) { f2 *= ( ( ( this . rand . nextFloat ( ) ) * ( this . rand . nextFloat ( ) ) ) * 3.0F ) + 1.0F ; } this . func_151541_a ( this . rand . nextLong ( ) , p_151538_4_ , p_151538_5_ , p_151538_6_ , d0 , d1 , d2 , f2 , f , f1 , 0 , 0 , 1.0 ) ; } } } protected boolean isOceanBlock ( Block [ ] data , int index , int x , int y , int z , int chunkX , int chunkZ ) { } private boolean isExceptionBiome ( BiomeGenBase biome ) { } private boolean isTopBlock ( Block [ ] data , int index , int x , int y , int z , int chunkX , int chunkZ ) { } protected void digBlock ( Block [ ] data , int index , int x , int y , int z , int chunkX , int chunkZ , boolean foundTop ) { } No newline ; at end ; of file ; }

Fix:
double d1 = ( ( double ) ( this . rand . nextInt ( 254 ) ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class VirtualServerTestCase extends AbstractMgmtTestBase { @ ArquillianResource URL url ; private static String defaultHost ; private static String virtualHost ; private static final Logger log = Logger . getLogger ( VirtualServerTestCase . class . getName ( ) ) ; @ Deployment ( order = 1 ) public static Archive < ? > getDeployment ( ) { } @ Deployment ( managed = false , name = "vsdeployment" , order = 2 ) public static Archive < ? > getVDeployment ( ) { } @ Before public void before ( ) throws IOException { } @ AfterClass public static void after ( ) throws IOException { } @ Test public void testDefaultVirtualServer ( ) throws IOException , MgmtOperationException { } @ Test public void addRemoveVirtualServer ( @ ArquillianResource Deployer deployer ) throws Exception { if ( ! ( resolveHosts ( ) ) ) { VirtualServerTestCase . log . info ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>resolve<seq2seq4repair_space>alternate<seq2seq4repair_space>server<seq2seq4repair_space>host<seq2seq4repair_space>name." ) ; return ; } addVirtualServer ( ) ; deployer . deploy ( "vsdeployment" ) ; URL vURL = new URL ( url . getProtocol ( ) , VirtualServerTestCase . virtualHost , url . getPort ( ) , "//vsDeployment//index.html" ) ; String response = HttpRequest . get ( vURL . toString ( ) , 10 , TimeUnit . SECONDS ) ; assertTrue ( ( "Invalid<seq2seq4repair_space>response:<seq2seq4repair_space>" + response ) , ( ( response . indexOf ( "Virtual<seq2seq4repair_space>Server<seq2seq4repair_space>Deployment" ) ) >= 0 ) ) ; URL dURL = new URL ( url . getProtocol ( ) , VirtualServerTestCase . defaultHost , url . getPort ( ) , "//vsDeployment//index.html" ) ; boolean failed = false ; try { response = HttpRequest . get ( dURL . toString ( ) , 10 , TimeUnit . SECONDS ) ; } catch ( Exception e ) { failed = true ; } <START_BUG> assertTrue ( "Deployment<seq2seq4repair_space>also<seq2seq4repair_space>on<seq2seq4repair_space>defaul<seq2seq4repair_space>server.<seq2seq4repair_space>" , failed ) ; <END_BUG> deployer . undeploy ( "vsdeployment" ) ; removeVirtualServer ( ) ; } private void addVirtualServer ( ) throws IOException , MgmtOperationException { } private void removeVirtualServer ( ) throws IOException , MgmtOperationException { } private boolean resolveHosts ( ) { } }

Fix:
assertTrue ( "Deployment<seq2seq4repair_space>also<seq2seq4repair_space>on<seq2seq4repair_space>default<seq2seq4repair_space>server.<seq2seq4repair_space>" , failed ) ;
Buggy code:
@ Controller public class RegistrationController extends AbstractBaseController { @ Autowired private MarketingDataService marketingDataService ; @ Autowired private CountryService countryService ; @ Autowired private UserRegistrationInformationService userRegistrationInformationService ; @ Autowired private RegistrationValidator registrationValidator ; @ Autowired private UserService userService ; @ Autowired private MailService mailService ; @ Autowired private WithdrawRequestService withdrawRequestService ; @ RequestMapping ( "//registration" ) public ModelAndView registration ( final HttpServletRequest httpServletRequest , final HttpServletResponse httpServletResponse , final Map < String , Object > model , @ ModelAttribute ( "registrationForm" ) final RegistrationDto registrationDtoObj , final BindingResult result , final Locale locale ) { } private MailMetaData getMailMetaDataForSubmitRegistration ( final RegistrationDto registrationDtoObj , final Locale locale , final String contextpath , final String email ) { } private void sentWithdrawUserNotificationMailToAdmin ( final GdeUser user , final HttpServletRequest request , final Locale locale ) { } private MailMetaData getMailMetaDataForWithdrawAUserNotification ( final Locale locale , final String contextpath ) { List < String > toList = new ArrayList < String > ( ) ; <START_BUG> toList . add ( ADMIN_EMAIL_ADDRESS ) ; <END_BUG> MailMetaData mailMetaData = new MailMetaData ( ) ; mailMetaData . setToAddresses ( toList ) ; mailMetaData . setSubject ( getMessageSource ( ) . getMessage ( "withdraw.application.notification.subject" , null , locale ) ) ; mailMetaData . setFromName ( getMessageSource ( ) . getMessage ( "gde.sender.name" , null , locale ) ) ; mailMetaData . setTemplateName ( GDEStringUtils . concat ( locale , WITHDRAW_NOTIFICATION_TEMPLATE ) ) ; mailMetaData . setContextPath ( contextpath ) ; mailMetaData . setReplyTo ( SUPPORT_CONTACT_EMAIL ) ; mailMetaData . setFromAddress ( SUPPORT_CONTACT_EMAIL ) ; return mailMetaData ; } private void sentWithdrawNotificationMail ( final MailMetaData mailMetaData , final Locale locale , final GdeUser user , final String reason ) { } }

Fix:
toList . add ( getMessageSource ( ) . getMessage ( "support.email.address" , null , Locale . ENGLISH ) ) ;
Buggy code:
class BSHPrimarySuffix extends SimpleNode { public static final int CLASS = 0 ; public static final int INDEX = 1 ; public static final int NAME = 2 ; public static final int PROPERTY = 3 ; public int operation ; Object index ; public String field ; BSHPrimarySuffix ( int id ) { } public Object doSuffix ( Object obj , boolean toLHS , CallStack callstack , Interpreter interpreter ) throws EvalError { } private Object doName ( Object obj , boolean toLHS , CallStack callstack , Interpreter interpreter ) throws EvalError , ReflectError , InvocationTargetException { } static int getIndexAux ( Object obj , CallStack callstack , Interpreter interpreter , SimpleNode callerInfo ) throws EvalError { if ( ! ( obj . getClass ( ) . isArray ( ) ) ) throw new EvalError ( "Not<seq2seq4repair_space>an<seq2seq4repair_space>array" , callerInfo , callstack ) ; int index ; try { Object indexVal = ( ( SimpleNode ) ( callerInfo . jjtGetChild ( 0 ) ) ) . eval ( callstack , interpreter ) ; if ( ! ( indexVal instanceof Primitive ) ) <START_BUG> indexVal = NameSpace . getAssignableForm ( indexVal , Integer . TYPE ) ; <END_BUG> index = ( ( Primitive ) ( indexVal ) ) . intValue ( ) ; } catch ( UtilEvalError e ) { Interpreter . debug ( ( "doIndex:<seq2seq4repair_space>" + e ) ) ; throw e . toEvalError ( "Arrays<seq2seq4repair_space>may<seq2seq4repair_space>only<seq2seq4repair_space>be<seq2seq4repair_space>indexed<seq2seq4repair_space>by<seq2seq4repair_space>integer<seq2seq4repair_space>types." , callerInfo , callstack ) ; } return index ; } private Object doIndex ( Object obj , boolean toLHS , CallStack callstack , Interpreter interpreter ) throws EvalError , ReflectError { } private Object doProperty ( boolean toLHS , Object obj , CallStack callstack , Interpreter interpreter ) throws EvalError { } }

Fix:
indexVal = Types . getAssignableForm ( indexVal , Integer . TYPE ) ;
Buggy code:
public class SourceIndexer extends AbstractIndexer implements SuffixConstants { public SourceIndexer ( SearchDocument document ) { } public void indexDocument ( ) { SourceIndexerRequestor requestor = new SourceIndexerRequestor ( this ) ; String documentPath = this . document . getPath ( ) ; SourceElementParser parser = ( ( InternalSearchDocument ) ( this . document ) ) . parser ; if ( parser == null ) { IPath path = new Path ( documentPath ) ; IProject project = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProject ( path . segment ( 0 ) ) ; parser = JavaModelManager . getJavaModelManager ( ) . indexManager . getSourceElementParser ( JavaCore . create ( project ) , requestor ) ; } else { <START_BUG> parser . requestor = requestor ; <END_BUG> } char [ ] source = null ; char [ ] name = null ; try { source = document . getCharContents ( ) ; name = documentPath . toCharArray ( ) ; } catch ( Exception e ) { } if ( ( source == null ) || ( name == null ) ) return ; CompilationUnit compilationUnit = new CompilationUnit ( source , name ) ; try { parser . parseCompilationUnit ( compilationUnit , true , null ) ; } catch ( Exception e ) { if ( JobManager . VERBOSE ) { e . printStackTrace ( ) ; } } } }

Fix:
parser . setRequestor ( requestor ) ;
Buggy code:
public class EntryPoint { public static void main ( String [ ] args ) { try { <START_BUG> LocateRegistry . createRegistry ( 1099 ) ; <END_BUG> new IncomingServer ( "1099" ) ; } catch ( RemoteException e1 ) { e1 . printStackTrace ( ) ; System . exit ( 0 ) ; } } }

Fix:
LocateRegistry . createRegistry ( 80 ) ;
Buggy code:
public class ModClusterReset implements OperationStepHandler , DescriptionProvider { static final ModClusterReset INSTANCE = new ModClusterReset ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; modcluster . reset ( ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . getProcessType ( ) . isServer ( ) ) {
Buggy code:
public class InventoryUtil implements Listener { public static void addItem ( Inventory inv , ItemStack item ) { } public static void clearInventory ( final Player p ) { } public static void clearHandler ( CommandSender cs , Player player , String [ ] args , int offset , boolean showExtended ) { } public static boolean isFullInventory ( Inventory inv ) { } @ SuppressWarnings ( "deprecation" ) public static boolean isEmptyInventory ( PlayerInventory inv ) { } @ SuppressWarnings ( "deprecation" ) public static String convertInventoryToString ( Inventory invInventory ) { } @ SuppressWarnings ( "deprecation" ) public static Inventory convertStringToInventory ( String invString , String name ) { String [ ] serializedBlocks = invString . split ( ";" ) ; String invInfo = serializedBlocks [ 0 ] ; <START_BUG> Inventory deserializedInventory = Bukkit . getServer ( ) . createInventory ( null , Integer . valueOf ( invInfo ) , name ) ; <END_BUG> for ( int i = 1 ; i < ( serializedBlocks . length ) ; i ++ ) { String [ ] serializedBlock = serializedBlocks [ i ] . split ( "#" ) ; int stackPosition = Integer . valueOf ( serializedBlock [ 0 ] ) ; if ( stackPosition >= ( deserializedInventory . getSize ( ) ) ) { continue ; } ItemStack is = null ; Boolean createdItemStack = false ; String [ ] serializedItemStack = serializedBlock [ 1 ] . split ( ":" ) ; for ( String itemInfo : serializedItemStack ) { String [ ] itemAttribute = itemInfo . split ( "@" ) ; if ( itemAttribute [ 0 ] . equals ( "t" ) ) { is = new ItemStack ( Material . getMaterial ( Integer . valueOf ( itemAttribute [ 1 ] ) ) ) ; createdItemStack = true ; } else if ( ( itemAttribute [ 0 ] . equals ( "d" ) ) && createdItemStack ) { is . setDurability ( Short . valueOf ( itemAttribute [ 1 ] ) ) ; } else if ( ( itemAttribute [ 0 ] . equals ( "a" ) ) && createdItemStack ) { is . setAmount ( Integer . valueOf ( itemAttribute [ 1 ] ) ) ; } else if ( ( itemAttribute [ 0 ] . equals ( "e" ) ) && createdItemStack ) { is . addEnchantment ( Enchantment . getById ( Integer . valueOf ( itemAttribute [ 1 ] ) ) , Integer . valueOf ( itemAttribute [ 2 ] ) ) ; } } deserializedInventory . setItem ( stackPosition , is ) ; } return deserializedInventory ; } }

Fix:
Inventory deserializedInventory = Bukkit . getServer ( ) . createInventory ( null , Integer . valueOf ( invInfo ) , name . substring ( 0 , 31 ) ) ;
Buggy code:
public class ImmediateExecutor extends AbstractExecutor implements IExecutor , IRunnableExecutor { protected AbstractFuture createFuture ( IProgressMonitor monitor ) { } public IFuture execute ( IProgressRunnable runnable , IProgressMonitor monitor ) { Assert . isNotNull ( runnable ) ; AbstractFuture sof = createFuture ( monitor ) ; <START_BUG> sof . safeRun ( runnable ) ; <END_BUG> return sof ; } }

Fix:
sof . runWithProgress ( runnable ) ;
Buggy code:
public class JoinGroupWizardAction implements IObjectActionDelegate , IWorkbenchWindowActionDelegate { private static final String CONNECT_PROJECT_MENU_TEXT = "Connect<seq2seq4repair_space>Project<seq2seq4repair_space>to<seq2seq4repair_space>Collaboration<seq2seq4repair_space>Group..." ; private static final String DISCONNECT_PROJECT_MENU_TEXT = "Disconnect<seq2seq4repair_space>Project" ; private IResource resource ; private boolean connected = false ; private IWorkbenchPart targetPart ; private IWorkbenchWindow window ; private ClientEntry isConnected ( IResource res ) { } private void setAction ( IAction action , IResource resource ) { } public void setActivePart ( IAction action , IWorkbenchPart targetPart ) { } public void run ( IAction action ) { if ( ! ( connected ) ) { JoinGroupWizard wizard = new JoinGroupWizard ( resource , PlatformUI . getWorkbench ( ) ) ; Shell shell = null ; if ( ( targetPart ) == null ) { <START_BUG> shell = window . getShell ( ) ; <END_BUG> } else { shell = targetPart . getSite ( ) . getShell ( ) ; } WizardDialog dialog = new WizardDialog ( shell , wizard ) ; dialog . open ( ) ; } else { ClientEntry client = isConnected ( resource ) ; if ( client == null ) { connected = false ; action . setText ( JoinGroupWizardAction . CONNECT_PROJECT_MENU_TEXT ) ; } else { EclipseCollabSharedObject collab = client . getSharedObject ( ) ; if ( collab != null ) { collab . chatGUIDestroy ( ) ; } } } } public void selectionChanged ( IAction action , ISelection selection ) { } public void dispose ( ) { } public void init ( IWorkbenchWindow window ) { } }

Fix:
shell = ( ( window ) == null ) ? null : window . getShell ( ) ;
Buggy code:
public class ProxyListValidator implements ParameterValidator { @ Override public void validateParameter ( String parameterName , ModelNode value ) throws OperationFailedException { if ( value . isDefined ( ) ) { String str = value . asString ( ) ; String [ ] results = str . split ( "," ) ; for ( String result : results ) { int i = result . lastIndexOf ( ":" ) ; int port = 0 ; String host = null ; if ( i > 0 ) { host = result . substring ( 0 , i ) ; port = Integer . valueOf ( result . substring ( ( i + 1 ) ) ) ; } try { InetAddress . getByName ( host ) ; } catch ( UnknownHostException e ) { host = null ; } if ( ( host == null ) || ( port == 0 ) ) { <START_BUG> throw new OperationFailedException ( ROOT_LOGGER . needHostAndPort ( ) ) ; <END_BUG> } } } } @ Override public void validateResolvedParameter ( String parameterName , ModelNode value ) throws OperationFailedException { } }

Fix:
throw new OperationFailedException ( new ModelNode ( ) . set ( ROOT_LOGGER . needHostAndPort ( ) ) ) ;
Buggy code:
public class Echo extends Task { protected String message = "" ; protected File file = null ; protected boolean append = false ; protected int logLevel = Project . MSG_WARN ; public void execute ( ) throws BuildException { if ( ( file ) == null ) { log ( message , logLevel ) ; } else { FileWriter out = null ; try { out = new FileWriter ( file . getAbsolutePath ( ) , append ) ; out . write ( message , 0 , message . length ( ) ) ; } catch ( IOException ioe ) { <START_BUG> throw new BuildException ( ioe , location ) ; <END_BUG> } finally { if ( out != null ) { try { out . close ( ) ; } catch ( IOException ioex ) { } } } } } public void setMessage ( String msg ) { } public void setFile ( File file ) { } public void setAppend ( boolean append ) { } public void addText ( String msg ) { } public void setLevel ( Echo . EchoLevel echoLevel ) { } public static class EchoLevel extends EnumeratedAttribute { public String [ ] getValues ( ) { } } }

Fix:
throw new BuildException ( ioe , getLocation ( ) ) ;