nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ItemBlockJupiter extends ItemBlock { public ItemBlockJupiter ( Block block ) { } @ Override public int getMetadata ( int meta ) { } @ Override public String getUnlocalizedName ( ItemStack itemstack ) { String name = "" ; switch ( itemstack . getItemDamage ( ) ) { case 0 : { name = "surface" ; break ; } case 1 : { name = "subSurface" ; break ; } case 2 : { name = "stone" ; break ; } case 3 : { name = "oreIron" ; break ; } case 4 : { name = "oreTin" ; break ; } case 5 : { name = "oreCopper" ; break ; } case 6 : { name = "orePalladium" ; break ; } case 7 : { name = "oreNickel" ; break ; } case 8 : { <START_BUG> name = "nickelBlock" ; <END_BUG> break ; } case 9 : { name = "stoneBricks" ; break ; } case 10 : { name = "oreRedGem" ; break ; } default : name = "null" ; } return ( ( this . field_150939_a . getUnlocalizedName ( ) ) + "." ) + name ; } @ Override public String getUnlocalizedName ( ) { } No newline ; at end ; of file ; }

Fix:
name = "palladiumBlock" ;
Buggy code:
public class Character { String name ; Clearing startingLocation ; Weapon startingWeapon ; public String getName ( ) { } public void setName ( String name ) { } public void setStartingLocation ( Clearing location ) { } public Clearing getStartingLocation ( ) { } public Weapon getStartingWeapon ( ) { <START_BUG> return weapon ; <END_BUG> } public void setStartingWeapon ( Weapon weapon ) { } No newline ; at end ; of file ; }

Fix:
return startingWeapon ;
Buggy code:
public class SQLPatternFactory { static int GROUP = 1 ; static int CAPTURE = 2 ; static int OPTIONAL = 4 ; static int CASE_SENSITIVE = 8 ; static int IGNORE_NEW_LINE = 16 ; static int SINGLE_LINE = 32 ; static int LEADING_SPACE = 64 ; static int CHILD_SPACE_SEPARATOR = 128 ; public static class SPF { public static SQLPatternPart statement ( SQLPatternPart ... parts ) { } public static SQLPatternPart statementLeader ( SQLPatternPart ... parts ) { } public static SQLPatternPart statementTrailer ( SQLPatternPart ... parts ) { } public static SQLPatternPart clause ( SQLPatternPart ... parts ) { } public static SQLPatternPart anyClause ( ) { <START_BUG> return new SQLPatternPartString ( ".+" ) ; <END_BUG> } public static SQLPatternPart capture ( SQLPatternPart part ) { } public static SQLPatternPart capture ( String captureLabel , SQLPatternPart part ) { } public static SQLPatternPart optional ( SQLPatternPart part ) { } public static SQLPatternPart or ( SQLPatternPart ... parts ) { } public static SQLPatternPart or ( String ... strs ) { } public static SQLPatternPart token ( String ... strs ) { } public static SQLPatternPart symbol ( ) { } public static SQLPatternPart ddlName ( ) { } public static SQLPatternPart anything ( ) { } public static SQLPatternPart integer ( ) { } } private static SQLPatternPartElement makeStatementPart ( boolean beginLine , boolean endLine , boolean terminated , boolean terminatorRequired , SQLPatternPart ... parts ) { } }

Fix:
return new SQLPatternPartElement ( ".+" ) ;
Buggy code:
public final class Program { String name ; String command ; String iconName ; String extension ; static final String [ ] ARGUMENTS = new String [ ] { "%1" , "%l" , "%L" } ; Program ( ) { } static String assocQueryString ( int assocStr , TCHAR key , boolean expand ) { } public static Program findProgram ( String extension ) { } public static String [ ] getExtensions ( ) { } static String getKeyValue ( String string , boolean expand ) { } static Program getProgram ( String key , String extension ) { } public static Program [ ] getPrograms ( ) { } public static boolean launch ( String fileName ) { } public boolean execute ( String fileName ) { } public ImageData getImageData ( ) { if ( ( extension ) != null ) { SHFILEINFO shfi = ( OS . IsUnicode ) ? ( ( SHFILEINFO ) ( new SHFILEINFOW ( ) ) ) : new SHFILEINFOA ( ) ; int flags = ( ( OS . SHGFI_ICON ) | ( OS . SHGFI_SMALLICON ) ) | ( OS . SHGFI_USEFILEATTRIBUTES ) ; TCHAR pszPath = new TCHAR ( 0 , extension , true ) ; OS . SHGetFileInfo ( pszPath , FILE_ATTRIBUTE_NORMAL , shfi , sizeof , flags ) ; if ( ( shfi . hIcon ) != 0 ) { Image image = Image . win32_new ( null , ICON , shfi . hIcon ) ; ImageData imageData = image . getImageData ( ) ; image . dispose ( ) ; return imageData ; } } int nIconIndex = 0 ; String fileName = iconName ; int index = iconName . indexOf ( ',' ) ; if ( index != ( - 1 ) ) { fileName = iconName . substring ( 0 , index ) ; String iconIndex = iconName . substring ( ( index + 1 ) , iconName . length ( ) ) . trim ( ) ; try { nIconIndex = Integer . parseInt ( iconIndex ) ; } catch ( NumberFormatException e ) { } } int length = fileName . length ( ) ; <START_BUG> if ( ( length != 0 ) && ( ( fileName . charAt ( 0 ) ) == '\"' ) ) { <END_BUG> if ( ( fileName . charAt ( ( length - 1 ) ) ) == '\"' ) { fileName = fileName . substring ( 1 , ( length - 1 ) ) ; } } TCHAR lpszFile = new TCHAR ( 0 , fileName , true ) ; int [ ] phiconSmall = new int [ 1 ] ; int [ ] phiconLarge = null ; OS . ExtractIconEx ( lpszFile , nIconIndex , phiconLarge , phiconSmall , 1 ) ; if ( ( phiconSmall [ 0 ] ) == 0 ) return null ; Image image = Image . win32_new ( null , ICON , phiconSmall [ 0 ] ) ; ImageData imageData = image . getImageData ( ) ; image . dispose ( ) ; return imageData ; } public String getName ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
if ( ( length > 1 ) && ( ( fileName . charAt ( 0 ) ) == '\"' ) ) {
Buggy code:
abstract class AbstractChoice extends FormComponent { private IChoiceList choices ; public AbstractChoice ( final String id ) { } public AbstractChoice ( final String id , final Collection choices ) { } public AbstractChoice ( final String id , final IChoiceList choices ) { } public AbstractChoice ( final String id , IModel model , final Collection choices ) { } public AbstractChoice ( final String id , IModel model , final IChoiceList choices ) { } public IChoiceList getChoices ( ) { } public final void setChoices ( IChoiceList choices ) { } protected void detachModel ( ) { } protected String getDefaultChoice ( final Object selected ) { } protected abstract boolean isSelected ( final IChoice choice ) { } protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { final StringBuffer buffer = new StringBuffer ( ) ; final Object selected = getModelObject ( ) ; final IChoiceList choices = getChoices ( ) ; buffer . append ( getDefaultChoice ( selected ) ) ; for ( int i = 0 ; i < ( choices . size ( ) ) ; i ++ ) { final IChoice choice = choices . get ( i ) ; if ( choice != null ) { final String displayValue = choice . getDisplayValue ( ) ; buffer . append ( "\n<option<seq2seq4repair_space>" ) ; if ( isSelected ( choice ) ) { buffer . append ( "selected=\"selected\"" ) ; } buffer . append ( "value=\"" ) ; buffer . append ( choice . getId ( ) ) ; buffer . append ( "\">" ) ; String display = getLocalizer ( ) . getString ( ( ( ( getId ( ) ) + "." ) + displayValue ) , this , displayValue ) ; <START_BUG> String escaped = Strings . escapeMarkup ( display ) ; <END_BUG> buffer . append ( escaped ) ; buffer . append ( "<//option>" ) ; } else { throw new IllegalArgumentException ( ( "Choice<seq2seq4repair_space>list<seq2seq4repair_space>has<seq2seq4repair_space>null<seq2seq4repair_space>value<seq2seq4repair_space>at<seq2seq4repair_space>index<seq2seq4repair_space>" + i ) ) ; } } buffer . append ( "\n" ) ; replaceComponentTagBody ( markupStream , openTag , buffer . toString ( ) ) ; } protected boolean supportsPersistence ( ) { } protected abstract void updateModel ( ) { } }

Fix:
String escaped = Strings . escapeMarkup ( display , false , true ) ;
Buggy code:
public class MinimumValue extends Validation < String > { int minimum ; int msgId ; public MinimumValue ( int minimum , @ StringRes int msgId ) { } @ Override public boolean isValid ( String value ) { int i ; try { <START_BUG> i = Integer . valueOf ( value ) ; <END_BUG> } catch ( NumberFormatException e ) { setMessage ( tika_error_number_required ) ; return false ; } if ( i < ( minimum ) ) { setMessage ( msgId ) ; return false ; } return true ; } }

Fix:
i = Integer . parseInt ( value ) ;
Buggy code:
public class RandomDataTest extends RetryTestCase { public RandomDataTest ( String name ) { } protected long smallSampleSize = 1000 ; protected double [ ] expected = new double [ ] { 250 , 250 , 250 , 250 } ; protected int largeSampleSize = 10000 ; private String [ ] hex = new String [ ] { "0" , "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "a" , "b" , "c" , "d" , "e" , "f" } ; protected RandomDataImpl randomData = null ; protected ChiSquareTestImpl testStatistic = new ChiSquareTestImpl ( ) ; public void setUp ( ) { } public static Test suite ( ) { } public void testNextIntExtremeValues ( ) { } public void testNextLongExtremeValues ( ) { } public void testNextInt ( ) { } public void testNextLong ( ) { } public void testNextSecureLong ( ) { } public void testNextSecureInt ( ) { } public void testNextPoisson ( ) { } public void testNextHex ( ) { } public void testNextSecureHex ( ) { } public void testNextUniform ( ) { } public void testNextUniformExclusiveEndpoints ( ) { } public void testNextGaussian ( ) { try { randomData . nextGaussian ( 0 , 0 ) ; fail ( "zero<seq2seq4repair_space>sigma<seq2seq4repair_space>--<seq2seq4repair_space>IllegalArgumentException<seq2seq4repair_space>expected" ) ; } catch ( IllegalArgumentException ex ) { } <START_BUG> SummaryStatistics u = SummaryStatistics . newInstance ( ) ; <END_BUG> for ( int i = 0 ; i < ( largeSampleSize ) ; i ++ ) { u . addValue ( randomData . nextGaussian ( 0 , 1 ) ) ; } double xbar = u . getMean ( ) ; double s = u . getStandardDeviation ( ) ; double n = ( ( double ) ( u . getN ( ) ) ) ; assertTrue ( ( ( ( Math . abs ( xbar ) ) // ( s // ( Math . sqrt ( n ) ) ) ) < 3.29 ) ) ; } public void testNextExponential ( ) { } public void testConfig ( ) throws NoSuchAlgorithmException , NoSuchProviderException { } public void testNextSample ( ) { } private int findSample ( Object [ ] u , Object [ ] samp ) { } public void testNextPermutation ( ) { } private int findPerm ( int [ ] [ ] p , int [ ] samp ) { } }

Fix:
SummaryStatistics u = new SummaryStatistics ( ) ;
Buggy code:
public final class AutoNetwork { private static DPA_Simply simply = null ; private static void printMessageAndExit ( String message ) { } public static void main ( String [ ] args ) throws InterruptedException { try { AutoNetwork . simply = DPA_SimplyFactory . getSimply ( ( ( "config" + ( File . separator ) ) + "Simply.properties" ) ) ; } catch ( SimplyException ex ) { AutoNetwork . printMessageAndExit ( ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>creating<seq2seq4repair_space>Simply:<seq2seq4repair_space>" + ex ) ) ; } Network network1 = AutoNetwork . simply . getNetwork ( "1" , Network . class ) ; if ( network1 == null ) { AutoNetwork . printMessageAndExit ( "Network<seq2seq4repair_space>1<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist" ) ; } <START_BUG> AutoNetworkAlgorithm algo = new com . microrisc . simply . iqrf . dpa . v210 . autonetwork . AutoNetworkAlgorithmImpl . Builder ( network1 , AutoNetwork . simply . getBroadcastServices ( ) ) . discoveryTxPower ( 7 ) . prebondingInterval ( 10 ) . authorizeRetries ( 1 ) . discoveryRetries ( 1 ) . temporaryAddressTimeout ( 100 ) . autoUseFrc ( true ) . p2pPrebonderMethodIdTransformer ( P2PPrebonderStandardTransformer . getInstance ( ) ) . numberOfNodesToBond ( 5 ) . build ( ) ; <END_BUG> algo . start ( ) ; Thread . sleep ( 80000 ) ; if ( algo . isFinished ( ) ) { System . out . println ( "Algorithm<seq2seq4repair_space>succesfully<seq2seq4repair_space>finished." ) ; } else { algo . cancel ( ) ; System . out . println ( "Algorithm<seq2seq4repair_space>cancelled." ) ; } Network resultNetwork = ( ( com . microrisc . simply . iqrf . dpa . v210 . autonetwork . AutoNetworkAlgorithmImpl ) ( algo ) ) . getResultNetwork ( ) ; System . out . println ( ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>nodes<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>network:<seq2seq4repair_space>" + ( resultNetwork . getNodesMap ( ) . size ( ) ) ) ) ; AutoNetwork . simply . destroy ( ) ; } }

Fix:
AutoNetworkAlgorithm algo = new com . microrisc . simply . iqrf . dpa . v210 . autonetwork . AutoNetworkAlgorithmImpl . Builder ( network1 , AutoNetwork . simply . getBroadcastServices ( ) ) . discoveryTxPower ( 7 ) . prebondingInterval ( 10 ) . authorizeRetries ( 1 ) . discoveryRetries ( 1 ) . temporaryAddressTimeout ( 10 ) . autoUseFrc ( true ) . p2pPrebonderMethodIdTransformer ( P2PPrebonderStandardTransformer . getInstance ( ) ) . numberOfNodesToBond ( 5 ) . build ( ) ;
Buggy code:
public class Minhasher { @ SuppressWarnings ( "unchecked" ) private static Set < Integer > readColumn ( String shingledDocument ) throws IOException , ClassNotFoundException { } private static List < Set < Integer > > readAllColumns ( String [ ] shingledDocuments ) throws IOException , ClassNotFoundException { } private static int getNumOfRows ( List < Set < Integer > > columns ) { } private static int calculateMinhash ( Set < Integer > column , RandomHashFunction hashFun ) { } public static int [ ] [ ] calculateSignatures ( List < Set < Integer > > columns , int numOfSignatureElements , int numOfRows ) { } public static void main ( String [ ] args ) throws IOException , ClassNotFoundException { <START_BUG> if ( ( ( ( args . length ) % 2 ) != 0 ) || ( ( args . length ) < 3 ) ) { <END_BUG> throw new IllegalArgumentException ( ( "Usage:<seq2seq4repair_space>java<seq2seq4repair_space>similarity.Minhasher<seq2seq4repair_space><num_of_signature_elems><seq2seq4repair_space><output><seq2seq4repair_space>" + "<shingled1><seq2seq4repair_space><shingled2><seq2seq4repair_space>..." ) ) ; } int numOfSignatureElems = Integer . parseInt ( args [ 0 ] ) ; String outputFileName = args [ 1 ] ; List < Set < Integer > > columns = Minhasher . readAllColumns ( Arrays . copyOfRange ( args , 2 , args . length ) ) ; int numOfRows = Minhasher . getNumOfRows ( columns ) ; int [ ] [ ] signatures = Minhasher . calculateSignatures ( columns , numOfSignatureElems , numOfRows ) ; ObjectToFileExporter . exportObjectToFile ( signatures , outputFileName ) ; } }

Fix:
if ( ( args . length ) < 3 ) {
Buggy code:
public class Scanner { private static final Pattern DIRECTORY_PATTERN = Pattern . compile ( "^\\[[dD]\\]\\s+\\*+\\s+(\\d+)$" ) ; private static final Pattern FILE_PATTERN = Pattern . compile ( "^(?<hash>\\w+)\\s+(?<filename>.+)$" ) ; public static TreeNode < FileInformation > fromHashTable ( String table , Path root ) { } public static TreeNode < FileInformation > scanDirectory ( java . util . Scanner src , Path root ) { } private static void scanDirectory ( TreeNode < FileInformation > parent , java . util . Scanner src , int parentDepth , Path root ) { } private static Scanner . Directory nextDirectory ( java . util . Scanner src ) { String nextLine = Scanner . nextNonemptyLine ( src ) ; if ( nextLine == null ) { return null ; } Matcher matcher = Scanner . DIRECTORY_PATTERN . matcher ( nextLine ) ; if ( ! ( matcher . matches ( ) ) ) { throw new RuntimeException ( ( "unkonw<seq2seq4repair_space>title:" + nextLine ) ) ; } Scanner . Directory result = new Scanner . Directory ( ) ; <START_BUG> result . depth = Integer . valueOf ( matcher . group ( 1 ) ) ; <END_BUG> nextLine = Scanner . nextNonemptyLine ( src ) ; if ( nextLine == null ) { throw new RuntimeException ( "should<seq2seq4repair_space>has<seq2seq4repair_space>directory" ) ; } result . directory = nextLine ; return result ; } private static void addFiles ( TreeNode < FileInformation > directory , java . util . Scanner src ) { } private static FileInformation parseFile ( String directoryPath , String fileLine ) { } private static String nextNonemptyLine ( java . util . Scanner src ) { } private static class Directory { public String directory = null ; public int depth = Integer . MAX_VALUE ; } }

Fix:
result . depth = Integer . parseInt ( matcher . group ( 1 ) ) ;
Buggy code:
public class ArduinoConnector implements SerialPortEventListener { private OutputStream output ; private BufferedReader input ; private int send = 0 ; private SerialPort serialPort ; public ArduinoConnector ( ) { } public static CommPortIdentifier [ ] getAvailablePorts ( ) { } public boolean connect ( CommPortIdentifier commPortIdentifier ) { try { serialPort = ( ( SerialPort ) ( commPortIdentifier . open ( this . getClass ( ) . getName ( ) , 2 ) ) ) ; serialPort . setSerialPortParams ( 9600 , DATABITS_8 , STOPBITS_1 , PARITY_NONE ) ; input = new BufferedReader ( new InputStreamReader ( serialPort . getInputStream ( ) ) ) ; output = serialPort . getOutputStream ( ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; <START_BUG> Thread . sleep ( 1000 ) ; <END_BUG> return true ; } catch ( Exception e ) { return false ; } } public void sendPixels ( Pixel ... pixels ) { } public CommPortIdentifier tryPorts ( CommPortIdentifier [ ] commPortIdentifiers ) { } @ Override public void serialEvent ( SerialPortEvent serialPortEvent ) { } }

Fix:
Thread . sleep ( 2000 ) ;
Buggy code:
public class PerspectiveDescriptor implements IPerspectiveDescriptor , IPluginContribution { private String id ; private String pluginId ; private String originalId ; private String label ; private String className ; private String description ; private boolean singleton ; private boolean fixed ; private ImageDescriptor image ; static final String ATT_ID = "id" ; private static final String ATT_DEFAULT = "default" ; private static final String ATT_NAME = "name" ; private static final String ATT_ICON = "icon" ; private static final String ATT_CLASS = "class" ; private static final String ATT_SINGLETON = "singleton" ; private static final String ATT_FIXED = "fixed" ; private IConfigurationElement configElement ; public PerspectiveDescriptor ( String id , String label , PerspectiveDescriptor originalDescriptor ) { } public PerspectiveDescriptor ( String id , IConfigurationElement configElement ) throws CoreException { } private void registerOpenPerspectiveHandler ( ) { } public IPerspectiveFactory createFactory ( ) throws CoreException { } public void deleteCustomDefinition ( ) { } public String getDescription ( ) { } public boolean getFixed ( ) { } public String getId ( ) { } public ImageDescriptor getImageDescriptor ( ) { if ( ( image ) == null ) { if ( ( configElement ) != null ) { String icon = configElement . getAttribute ( PerspectiveDescriptor . ATT_ICON ) ; if ( icon != null ) { image = AbstractUIPlugin . imageDescriptorFromPlugin ( configElement . getNamespace ( ) , icon ) ; } if ( ( image ) == null ) { <START_BUG> image = WorkbenchImages . getImageDescriptor ( IMG_ETOOL_DEF_PERSPECTIVE_HOVER ) ; <END_BUG> } } } return image ; } public String getLabel ( ) { } public String getOriginalId ( ) { } public boolean hasCustomDefinition ( ) { } public boolean hasDefaultFlag ( ) { } public boolean isPredefined ( ) { } public boolean isSingleton ( ) { } public IStatus restoreState ( IMemento memento ) { } public void revertToPredefined ( ) { } public IStatus saveState ( IMemento memento ) { } public IConfigurationElement getConfigElement ( ) { } public String getLocalId ( ) { } public String getPluginId ( ) { } public String getClassName ( ) { } }

Fix:
image = WorkbenchImages . getImageDescriptor ( IMG_ETOOL_DEF_PERSPECTIVE ) ;
Buggy code:
public class MobSpawnManager implements Service , Listener { private final Goldiriath plugin ; private final YamlConfig config ; private BukkitTask spawnTask ; private final Set < MobSpawn > spawns ; private final Set < MobSpawnProfile > profiles ; private boolean enabled ; private boolean devMode ; private int radiusSquared ; private int maxMobs ; private int spawnThreshold ; private int playerRadiusThresholdSquared ; public MobSpawnManager ( Goldiriath plugin ) { } public Set < MobSpawn > getSpawns ( ) { } public void addSpawn ( MobSpawn spawn ) { } public void removeSpawn ( MobSpawn spawn ) { } public void setDevMode ( boolean devMode ) { } public boolean isDevMode ( ) { } protected int getRadiusSquared ( ) { } protected int getMaxMobs ( ) { } protected int getSpawnThreshold ( ) { } @ Override public void start ( ) { if ( ( spawnTask ) != null ) { stop ( ) ; } loadConfig ( ) ; setDevMode ( devMode ) ; if ( ! ( enabled ) ) { return ; } Bukkit . getPluginManager ( ) . registerEvents ( this , plugin ) ; spawnTask = new BukkitRunnable ( ) { @ Override public void run ( ) { if ( devMode ) { return ; } spawnLoop : for ( MobSpawn spawn : spawns ) { <START_BUG> for ( Player player : Bukkit . getOnlinePlayers ( ) ) { <END_BUG> if ( ( player . getLocation ( ) . distanceSquared ( spawn . getLocation ( ) ) ) > ( playerRadiusThresholdSquared ) ) { continue ; } spawn . tick ( ) ; break spawnLoop ; } } } } . runTaskTimer ( Goldiriath . plugin , 2 , 2 ) ; } @ Override public void stop ( ) { } @ EventHandler public void onSignEdit ( SignChangeEvent event ) { } @ EventHandler public void onSignDelete ( BlockBreakEvent event ) { } private void updateDevModeSign ( MobSpawn spawn ) { } private MobSpawnProfile determineProfile ( String profileName ) { } private void loadConfig ( ) { } private void saveConfig ( ) { } }

Fix:
for ( Player player : Bukkit . getServer ( ) . getOnlinePlayers ( ) ) {
Buggy code:
public class JavaPackager extends PackageToolPackager { public static final String ID = "com.mobilesorcery.sdk.build.j2me.packager" ; public JavaPackager ( ) { } @ Override protected void addPlatformSpecifics ( MoSyncProject project , IBuildVariant variant , CommandLineBuilder commandLine ) throws Exception { } @ Override public void createPackage ( MoSyncProject project , IBuildVariant variant , IBuildResult buildResult ) throws CoreException { } @ Override protected File computeBuildResult ( MoSyncProject project , IBuildVariant variant ) throws ParameterResolverException { DefaultPackager intern = new DefaultPackager ( project , variant ) ; <START_BUG> return new File ( intern . get ( PACKAGE_OUTPUT_DIR ) , ( ( intern . get ( PROJECT_NAME ) ) + ".jar" ) ) ; <END_BUG> } }

Fix:
return new File ( intern . get ( PACKAGE_OUTPUT_DIR ) , ( ( intern . get ( APP_NAME ) ) + ".jar" ) ) ;
Buggy code:
public class CloudSolrServer extends SolrServer { private volatile ZkStateReader zkStateReader ; private String zkHost ; private int zkConnectTimeout = 10000 ; private int zkClientTimeout = 10000 ; private String defaultCollection ; private LBHttpSolrServer lbServer ; Random rand = new Random ( ) ; public CloudSolrServer ( String zkHost ) throws MalformedURLException { } public CloudSolrServer ( String zkHost , LBHttpSolrServer lbServer ) { } public void setDefaultCollection ( String collection ) { } public void setZkConnectTimeout ( int zkConnectTimeout ) { } public void setZkClientTimeout ( int zkClientTimeout ) { } public void connect ( ) { if ( ( zkStateReader ) == null ) { synchronized ( this ) { if ( ( zkStateReader ) == null ) { try { <START_BUG> ZkStateReader zk = new ZkStateReader ( zkHost , zkConnectTimeout , zkClientTimeout , true ) ; <END_BUG> zk . createClusterStateWatchersAndUpdate ( ) ; zkStateReader = zk ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new org . apache . solr . common . cloud . ZooKeeperException ( ErrorCode . SERVER_ERROR , "" , e ) ; } catch ( KeeperException e ) { throw new org . apache . solr . common . cloud . ZooKeeperException ( ErrorCode . SERVER_ERROR , "" , e ) ; } catch ( IOException e ) { throw new org . apache . solr . common . cloud . ZooKeeperException ( ErrorCode . SERVER_ERROR , "" , e ) ; } catch ( TimeoutException e ) { throw new org . apache . solr . common . cloud . ZooKeeperException ( ErrorCode . SERVER_ERROR , "" , e ) ; } } } } } @ Override public NamedList < Object > request ( SolrRequest request ) throws IOException , SolrServerException { } public void close ( ) { } }

Fix:
ZkStateReader zk = new ZkStateReader ( zkHost , zkConnectTimeout , zkClientTimeout ) ;
Buggy code:
public class WorkbenchPreferenceGroup { private String id ; private String name ; private String parentGroupId ; private Collection childGroups = new ArrayList ( ) ; private Collection pages = new ArrayList ( ) ; private Collection pageIds ; private ImageDescriptor imageDescriptor ; private Image image ; private boolean highlight = false ; private Object lastSelection = null ; public WorkbenchPreferenceGroup ( String uniqueID , String displayableName , String parentId , Collection ids , ImageDescriptor icon ) { } public String getParent ( ) { } public void addChild ( WorkbenchPreferenceGroup category ) { } public String getId ( ) { } public void addNode ( WorkbenchPreferenceNode node ) { } public Image getImage ( ) { } public String getName ( ) { } public void disposeResources ( ) { } public IPreferenceNode [ ] getPreferenceNodes ( ) { } public Collection getPageIds ( ) { } public Collection getChildren ( ) { } public Object [ ] getGroupsAndNodes ( ) { } public void highlightHits ( String text ) { Iterator pagesIterator = pages . iterator ( ) ; Pattern pattern = Pattern . compile ( ( ( ".*" + text ) + ".*" ) ) ; while ( pagesIterator . hasNext ( ) ) { WorkbenchPreferenceNode node = ( ( WorkbenchPreferenceNode ) ( pagesIterator . next ( ) ) ) ; matchNode ( pattern , node ) ; } Iterator groupsIterator = childGroups . iterator ( ) ; while ( groupsIterator . hasNext ( ) ) { <START_BUG> WorkbenchPreferenceGroup group = ( ( WorkbenchPreferenceGroup ) ( pagesIterator . next ( ) ) ) ; <END_BUG> Matcher m = pattern . matcher ( group . getName ( ) ) ; group . highlight = m . matches ( ) ; group . highlightHits ( text ) ; } } private void matchNode ( Pattern pattern , WorkbenchPreferenceNode node ) { } public boolean isHighlighted ( ) { } public Object getLastSelection ( ) { } public void setLastSelection ( Object lastSelection ) { } public Object findParent ( Object element ) { } private Object findParent ( WorkbenchPreferenceGroup group , Object element ) { } private Object findParent ( IPreferenceNode node , Object element ) { } public void highlightIds ( String [ ] filteredIds ) { } private void checkId ( String id ) { } private boolean checkHighlightNode ( String id , IPreferenceNode node ) { } }

Fix:
WorkbenchPreferenceGroup group = ( ( WorkbenchPreferenceGroup ) ( groupsIterator . next ( ) ) ) ;
Buggy code:
public class BeanDeploymentTestCase extends AbstractMcDeploymentTest { private static final ServiceName TEST_SERVICE_NAME = ServiceName . of ( "some-old-mc-bean" ) ; @ BeforeClass public static void setupChain ( ) { } @ Override protected void setupServices ( final ServiceTarget serviceTarget ) throws Exception { super . setupServices ( serviceTarget ) ; final DeploymentChain deploymentChain = new DeploymentChainImpl ( ) ; deploymentChain . addProcessor ( new ManifestAttachmentProcessor ( ) , PARSE_MANIFEST ) ; deploymentChain . addProcessor ( new AnnotationIndexProcessor ( ) , PARSE_ANNOTATION_INDEX ) ; deploymentChain . addProcessor ( new ModuleDependencyProcessor ( ) , DEPENDENCIES_MODULE ) ; deploymentChain . addProcessor ( new ModuleConfigProcessor ( ) , MODULARIZE_CONFIG ) ; <START_BUG> deploymentChain . addProcessor ( new DeploymentModuleLoaderProcessor ( new DeploymentModuleLoaderImpl ( ) ) , MODULARIZE_DEPLOYMENT_MODULE_LOADER ) ; <END_BUG> deploymentChain . addProcessor ( new ModuleDeploymentProcessor ( ) , MODULARIZE_DEPLOYMENT ) ; deploymentChain . addProcessor ( new KernelDeploymentParsingProcessor ( ) , PARSE_MC_BEAN_DEPLOYMENT ) ; deploymentChain . addProcessor ( new ParsedKernelDeploymentProcessor ( ) , INSTALL_MC_BEAN_DEPLOYMENT ) ; serviceTarget . addService ( SERVICE_NAME , new DeploymentChainService ( deploymentChain ) ) ; Service < Context > ns = new org . jboss . msc . service . AbstractService < Context > ( ) { @ Override public Context getValue ( ) throws IllegalStateException { try { return new MockContext ( ) ; } catch ( NamingException e ) { throw new IllegalStateException ( e ) ; } } } ; serviceTarget . addService ( GLOBAL_CONTEXT_SERVICE_NAME , ns ) ; } @ Test public void testDeployment ( ) throws Exception { } private VirtualFile initializeDeployment ( final String path ) throws Exception { } }

Fix:
deploymentChain . addProcessor ( new DeploymentModuleLoaderProcessor ( new org . jboss . as . server . deployment . module . DeploymentModuleLoaderImpl ( mainModuleLoader ) ) , MODULARIZE_DEPLOYMENT_MODULE_LOADER ) ;
Buggy code:
public class Snippet186 { static int CodePage = OS . GetACP ( ) ; public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setLayout ( new GridLayout ( 2 , false ) ) ; final Text text = new Text ( shell , SWT . BORDER ) ; text . setLayoutData ( new GridData ( SWT . FILL , SWT . CENTER , true , false , 1 , 1 ) ) ; Button go = new Button ( shell , SWT . PUSH ) ; go . setText ( "Go" ) ; OleFrame oleFrame = new OleFrame ( shell , SWT . NONE ) ; oleFrame . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true , 2 , 1 ) ) ; OleControlSite controlSite ; OleAutomation automation ; try { controlSite = new OleControlSite ( oleFrame , SWT . NONE , "Shell.Explorer" ) ; automation = new OleAutomation ( controlSite ) ; controlSite . doVerb ( OLEIVERB_INPLACEACTIVATE ) ; } catch ( SWTException ex ) { return ; } final OleAutomation auto = automation ; go . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event e ) { String url = text . getText ( ) ; int [ ] rgdispid = auto . getIDsOfNames ( new String [ ] { "Navigate" , "URL" } ) ; int dispIdMember = rgdispid [ 0 ] ; Variant [ ] rgvarg = new Variant [ 1 ] ; rgvarg [ 0 ] = new Variant ( url ) ; int [ ] rgdispidNamedArgs = new int [ 1 ] ; rgdispidNamedArgs [ 0 ] = rgdispid [ 1 ] ; auto . invoke ( dispIdMember , rgvarg , rgdispidNamedArgs ) ; } } ) ; int BeforeNavigate2 = 250 ; controlSite . addEventListener ( BeforeNavigate2 , new OleListener ( ) { public void handleEvent ( OleEvent event ) { Variant url = event . arguments [ 1 ] ; Variant postData = event . arguments [ 4 ] ; if ( postData != null ) { System . out . println ( ( ( ( "PostData<seq2seq4repair_space>=<seq2seq4repair_space>" + ( Snippet186 . readSafeArray ( postData ) ) ) + ",<seq2seq4repair_space>URL<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( url . getString ( ) ) ) ) ; } } } ) ; <START_BUG> text . setText ( "http:////cmis.mis.brighton.ac.uk//cgi-bin//mas//mas_form" ) ; <END_BUG> int [ ] rgdispid = automation . getIDsOfNames ( new String [ ] { "Navigate" , "URL" , "PostData" } ) ; int dispIdMember = rgdispid [ 0 ] ; Variant [ ] rgvarg = new Variant [ 2 ] ; rgvarg [ 0 ] = new Variant ( text . getText ( ) ) ; rgvarg [ 1 ] = Snippet186 . writeSafeArray ( "hello<seq2seq4repair_space>world" ) ; int [ ] rgdispidNamedArgs = new int [ 2 ] ; rgdispidNamedArgs [ 0 ] = rgdispid [ 1 ] ; rgdispidNamedArgs [ 1 ] = rgdispid [ 2 ] ; automation . invoke ( dispIdMember , rgvarg , rgdispidNamedArgs ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } static String readSafeArray ( Variant variantByRef ) { } static Variant writeSafeArray ( String string ) { } }

Fix:
text . setText ( ( "file:////" + ( Snippet186 . class . getResource ( "Snippet186.html" ) . getFile ( ) ) ) ) ;
Buggy code:
public abstract class AbstractAjaxTimerBehavior extends AbstractDefaultAjaxBehavior { private final Duration updateInterval ; private boolean attachedBodyOnLoadModifier = false ; public AbstractAjaxTimerBehavior ( final Duration updateInterval ) { } @ Override protected void onBind ( ) { } @ Override protected void onRenderHeadContribution ( final Response response ) { } protected final String getJsTimeoutCall ( final Duration updateInterval ) { } @ Override protected final void respond ( final AjaxRequestTarget target ) { onTimer ( target ) ; <START_BUG> target . addJavascript ( getJsTimeoutCall ( updateInterval ) ) ; <END_BUG> } protected abstract void onTimer ( final AjaxRequestTarget target ) { } }

Fix:
target . appendJavascript ( getJsTimeoutCall ( updateInterval ) ) ;
Buggy code:
public class WebMethodNoPackagePrivateMethodRuleTest extends AbstractWebMethodPublicStaticFinalRuleTest { @ Override public IMethod getMethodToTeset ( ) { } @ Override public String getErrorMessage ( ) { <START_BUG> return JAXWSCoreMessages . WEBMETHOD_ONLY_ON_PUBLIC_METHODS_MESSAGE ; <END_BUG> } }

Fix:
return JAXWSCoreMessages . WEBMETHOD_ONLY_ON_PUBLIC_METHODS ;
Buggy code:
public class ManagementChannel extends ProtocolChannel { private final ManagementChannel . RequestReceiver requestReceiver = new ManagementChannel . RequestReceiver ( ) ; private final ManagementChannel . ResponseReceiver responseReceiver = new ManagementChannel . ResponseReceiver ( ) ; ManagementChannel ( String name , Channel channel ) { } public void setOperationHandler ( final ManagementOperationHandler handler ) { } @ Override protected void doHandle ( final Channel channel , final MessageInputStream message ) { } void executeRequest ( ManagementRequest < ? > request , ManagementResponseHandler < ? > responseHandler ) throws IOException { } void throwFormattedException ( Exception e ) throws IOException { } private class RequestReceiver { private volatile ManagementOperationHandler operationHandler ; private void handleRequest ( final ManagementRequestHeader header , final DataInput input ) throws IOException { } private ManagementRequestHandler getRequestHandler ( final ManagementRequestHeader header ) throws IOException { } private void writeResponseHeader ( final ManagementRequestHeader header , DataOutput output , Exception exception ) throws IOException { } private void setOperationHandler ( final ManagementOperationHandler operationHandler ) { } private String formatException ( Exception exception ) { } } private class ResponseReceiver { private final Map < Integer , ManagementResponseHandler < ? > > responseHandlers = Collections . synchronizedMap ( new HashMap < Integer , ManagementResponseHandler < ? > > ( ) ) ; private void registerResponseHandler ( final int requestId , final ManagementResponseHandler < ? > handler ) throws IOException { } private void handleResponse ( ManagementResponseHeader header , DataInput input ) throws IOException { ManagementResponseHandler < ? > responseHandler = responseHandlers . get ( header . getResponseId ( ) ) ; if ( responseHandler == null ) { throw new IOException ( ( "No<seq2seq4repair_space>response<seq2seq4repair_space>handler<seq2seq4repair_space>for<seq2seq4repair_space>request<seq2seq4repair_space>" + ( header . getResponseId ( ) ) ) ) ; } <START_BUG> responseHandler . setContext ( new ManagementResponseContext ( header ) ) ; <END_BUG> try { responseHandler . readResponse ( input ) ; expectHeader ( input , RESPONSE_END ) ; } catch ( Exception e ) { throwFormattedException ( e ) ; } } } }

Fix:
responseHandler . setContext ( new ManagementResponseContext ( header , ManagementChannel . this ) ) ;
Buggy code:
public class TimeStepBuilder { private static ScalarOperator sop = new ScalarOperator ( ) ; public static void addTimestep ( Component4D component , Map < Integer , Point3D > newPoints , Date date ) { } private static void addNormalTimeStep ( Component4D component , Map < Integer , Point3D > newPoints , Date date ) { Iterator < Integer > it = newPoints . keySet ( ) . iterator ( ) ; Map < Integer , List < Point3D > > pointTubes = component . getPointTubes ( ) ; LinkedList < Date > timesteps = component . getTimesteps ( ) ; while ( it . hasNext ( ) ) { if ( ( pointTubes . get ( it . next ( ) ) . get ( ( ( timesteps . size ( ) ) - 1 ) ) ) == null ) throw new IllegalArgumentException ( "New<seq2seq4repair_space>Object<seq2seq4repair_space>is<seq2seq4repair_space>neither<seq2seq4repair_space>a<seq2seq4repair_space>Postobject<seq2seq4repair_space>nor<seq2seq4repair_space>it<seq2seq4repair_space>fits<seq2seq4repair_space>the<seq2seq4repair_space>size<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>last<seq2seq4repair_space>object" ) ; } Set < Integer > ids = pointTubes . keySet ( ) ; int cnt = 0 ; for ( final Integer id : ids ) { if ( ( pointTubes . get ( id ) . get ( ( ( timesteps . size ( ) ) - 1 ) ) ) != null ) cnt ++ ; } if ( cnt != ( newPoints . size ( ) ) ) <START_BUG> throw new IllegalArgumentException ( "New<seq2seq4repair_space>Object<seq2seq4repair_space>is<seq2seq4repair_space>neither<seq2seq4repair_space>a<seq2seq4repair_space>Postobject<seq2seq4repair_space>nor<seq2seq4repair_space>it<seq2seq4repair_space>fits<seq2seq4repair_space>the<seq2seq4repair_space>size<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>last<seq2seq4repair_space>object" ) ; <END_BUG> timesteps . add ( date ) ; for ( Integer id : newPoints . keySet ( ) ) { if ( pointTubes . get ( id ) . get ( ( ( timesteps . size ( ) ) - 2 ) ) . isEqual ( newPoints . get ( id ) , TimeStepBuilder . sop ) ) { pointTubes . get ( id ) . add ( pointTubes . get ( id ) . get ( ( ( timesteps . size ( ) ) - 2 ) ) ) ; } else { pointTubes . get ( id ) . add ( newPoints . get ( id ) ) ; } } } private static void polthierAndRumpf ( Component4D component , Map < Integer , Point3D > newPoints , Date date ) { } private static void firstStep ( Component4D component , Map < Integer , Point3D > newPoints , Date date ) { } public static Map < Integer , Point3D > getPointTubesAtInstance ( Component4D component , Date date ) { } }

Fix:
throw new IllegalArgumentException ( ( ( ( "New<seq2seq4repair_space>Object<seq2seq4repair_space>is<seq2seq4repair_space>neither<seq2seq4repair_space>a<seq2seq4repair_space>Postobject<seq2seq4repair_space>nor<seq2seq4repair_space>it<seq2seq4repair_space>fits<seq2seq4repair_space>the<seq2seq4repair_space>size<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>last<seq2seq4repair_space>object.<seq2seq4repair_space>Number<seq2seq4repair_space>of<seq2seq4repair_space>points:<seq2seq4repair_space>OLD:<seq2seq4repair_space>" + ( newPoints . size ( ) ) ) + "<seq2seq4repair_space>New:<seq2seq4repair_space>" ) + cnt ) ) ;
Buggy code:
class JMSSubsystemDescribeHandler implements ModelQueryOperationHandler { static final JMSSubsystemDescribeHandler INSTANCE = new JMSSubsystemDescribeHandler ( ) ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) { final PathAddress rootAddress = PathAddress . pathAddress ( PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) ) ; final ModelNode result = new ModelNode ( ) ; final ModelNode subModel = context . getSubModel ( ) ; final ModelNode subsystemAdd = new ModelNode ( ) ; subsystemAdd . get ( OP ) . set ( ADD ) ; subsystemAdd . get ( OP_ADDR ) . set ( rootAddress . toModelNode ( ) ) ; result . add ( subsystemAdd ) ; if ( subModel . hasDefined ( CONNECTION_FACTORY ) ) { for ( final Property property : subModel . get ( CONNECTION_FACTORY ) . asPropertyList ( ) ) { final ModelNode address = rootAddress . toModelNode ( ) ; address . add ( CONNECTION_FACTORY , property . getName ( ) ) ; <START_BUG> result . add ( ConnectionFactoryAdd . getAddOperation ( address , subModel ) ) ; <END_BUG> } } if ( subModel . hasDefined ( QUEUE ) ) { for ( final Property property : subModel . get ( QUEUE ) . asPropertyList ( ) ) { final ModelNode address = rootAddress . toModelNode ( ) ; address . add ( QUEUE , property . getName ( ) ) ; result . add ( JMSQueueAdd . getOperation ( address , property . getValue ( ) ) ) ; } } if ( subModel . hasDefined ( TOPIC ) ) { for ( final Property property : subModel . get ( TOPIC ) . asPropertyList ( ) ) { final ModelNode address = rootAddress . toModelNode ( ) ; address . add ( TOPIC , property . getName ( ) ) ; result . add ( JMSTopicAdd . getOperation ( address , property . getValue ( ) ) ) ; } } resultHandler . handleResultFragment ( NO_LOCATION , result ) ; resultHandler . handleResultComplete ( ) ; return new BasicOperationResult ( ) ; } }

Fix:
result . add ( ConnectionFactoryAdd . getAddOperation ( address , property . getValue ( ) ) ) ;
Buggy code:
public class FastViewDnDHandler implements IDragOverListener { private String id ; private ToolBarManager tbm ; private WorkbenchWindow wbw ; private FastViewDnDHandler . ViewDropTarget dropTarget = null ; private Listener dragListener = new Listener ( ) { public void handleEvent ( Event event ) { } } ; class ViewDropTarget extends AbstractDropTarget { List panes ; ToolItem curItem ; public ViewDropTarget ( List panesToDrop , ToolItem position ) { } public void setTarget ( List panesToDrop , ToolItem position ) { } public void drop ( ) { } private void adoptRef ( IViewReference ref ) { } public Cursor getCursor ( ) { } public Rectangle getSnapRectangle ( ) { } } public FastViewDnDHandler ( String id , final ToolBarManager tbm , WorkbenchWindow wbw ) { } private ToolItem getToolItem ( Point position ) { } public IDropTarget drag ( Control currentControl , Object draggedObject , Point position , Rectangle dragRectangle ) { } private boolean isStandaloneStack ( ) { } private IDropTarget createDropTarget ( List viewList , ToolItem targetItem ) { } public Rectangle getLocationOfNextIcon ( ) { } private int getIndex ( IViewReference toFind ) { } protected void startDraggingFastView ( IViewReference ref , Point position , boolean usingKeyboard ) { } private void startDrag ( Object toDrag , Rectangle dragRect , Point position , boolean usingKeyboard ) { WorkbenchPage page = wbw . getActiveWorkbenchPage ( ) ; Perspective persp = page . getActivePerspective ( ) ; if ( toDrag instanceof ViewPane ) { ViewPane pane = ( ( ViewPane ) ( toDrag ) ) ; if ( ! ( persp . isMoveable ( pane . getViewReference ( ) ) ) ) return ; } IViewReference oldFastView = null ; if ( persp != null ) { oldFastView = persp . getActiveFastView ( ) ; if ( page != null ) { page . hideFastView ( ) ; } } <START_BUG> if ( page . isZoomed ( ) ) { <END_BUG> page . zoomOut ( ) ; } boolean success = DragUtil . performDrag ( toDrag , dragRect , position , ( ! usingKeyboard ) ) ; if ( ( ( ! success ) && ( oldFastView != null ) ) && ( page != null ) ) { page . toggleFastView ( oldFastView ) ; } } }

Fix:
if ( page . isPageZoomed ( ) ) {
Buggy code:
public class ColumnDefinitionTest { @ Test public void testSerializeDeserialize ( ) throws Exception { } protected void testSerializeDeserialize ( ColumnDefinition cd ) throws Exception { <START_BUG> ColumnDefinition newCd = ColumnDefinition . deserialize ( ColumnDefinition . serialize ( cd ) ) ; <END_BUG> assert cd != newCd ; assert ( cd . hashCode ( ) ) == ( newCd . hashCode ( ) ) ; assert cd . equals ( newCd ) ; } }

Fix:
ColumnDefinition newCd = ColumnDefinition . inflate ( cd . deflate ( ) ) ;
Buggy code:
public class SequencedReceiver implements Runnable { PacketHandler handler ; DatagramSocket socketLocal ; InetSocketAddress addrSequencer ; int localPort ; Object handleLock = new Object ( ) ; public SequencedReceiver ( int port , InetSocketAddress addrSeq , PacketHandler handler ) { } private void deliverPacket ( final String header , final String request ) { } private void sendRespond ( String header , String response ) { <START_BUG> String msg = ( header + "\n" ) + response ; <END_BUG> byte [ ] buf = msg . getBytes ( ) ; try { DatagramPacket p = new DatagramPacket ( buf , buf . length , addrSequencer ) ; socketLocal . send ( p ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } public void sendRMControlMsg ( int serverID , String ctrlMsg ) { } @ Override public void run ( ) { } Thread thReceiver ; public synchronized void startReceiver ( ) { } public synchronized void stopReceiver ( ) { } public boolean isRunning ( ) { } }

Fix:
String msg = ( header + "\tTYPE:RESPOND\t\n" ) + response ;
Buggy code:
public class BeanShell { public static void evalSelection ( View view , JEditTextArea textArea ) { } public static void showEvaluateDialog ( View view ) { } public static void showEvaluateLinesDialog ( View view ) { } public static void showRunScriptDialog ( View view ) { } public static void runScript ( View view , String path , boolean ownNamespace , boolean rethrowBshErrors ) { } public static void runScript ( View view , String path , Reader in , boolean ownNamespace , boolean rethrowBshErrors ) { } public static Object eval ( View view , String command , boolean rethrowBshErrors ) { } public static Object eval ( View view , NameSpace namespace , String command , boolean rethrowBshErrors ) { } public static String cacheBlock ( String id , String code , boolean childNamespace ) { } public static Object runCachedBlock ( String id , View view , NameSpace namespace ) { if ( namespace == null ) <START_BUG> namespace = BeanShell . internal ; <END_BUG> Object [ ] args = new Object [ ] { namespace } ; try { if ( view != null ) { namespace . setVariable ( "view" , view ) ; EditPane editPane = view . getEditPane ( ) ; namespace . setVariable ( "editPane" , editPane ) ; namespace . setVariable ( "buffer" , editPane . getBuffer ( ) ) ; namespace . setVariable ( "textArea" , editPane . getTextArea ( ) ) ; } Object retVal = BeanShell . internal . invokeMethod ( id , args , BeanShell . interpForMethods ) ; if ( retVal instanceof Primitive ) { if ( retVal == ( Primitive . VOID ) ) return null ; else return ( ( Primitive ) ( retVal ) ) . getValue ( ) ; } else return retVal ; } catch ( Throwable e ) { if ( e instanceof TargetError ) e = ( ( TargetError ) ( e ) ) . getTarget ( ) ; if ( e instanceof InvocationTargetException ) e = ( ( InvocationTargetException ) ( e ) ) . getTargetException ( ) ; Log . log ( ERROR , BeanShell . class , e ) ; new org . gjt . sp . jedit . gui . BeanShellErrorDialog ( view , e . toString ( ) ) ; } finally { try { namespace . setVariable ( "view" , null ) ; namespace . setVariable ( "editPane" , null ) ; namespace . setVariable ( "buffer" , null ) ; namespace . setVariable ( "textArea" , null ) ; } catch ( EvalError e ) { } } return null ; } public static boolean isScriptRunning ( ) { } public static NameSpace getNameSpace ( ) { } static void init ( ) { } private static Interpreter interpForMethods ; private static NameSpace global ; private static NameSpace internal ; private static boolean running ; private static int cachedBlockCounter ; private static Interpreter createInterpreter ( NameSpace nameSpace ) { } }

Fix:
namespace = BeanShell . global ;
Buggy code:
@ Configuration public class ModuleDefinition { @ Value ( "${format}" ) private String format ; @ Bean public MessageChannel output ( ) { } @ Bean <START_BUG> @ InboundChannelAdapter ( value = "output" , autoStartup = "false" , poller = @ Poller ( fixedDelay = "${fixedDelay}" ) ) <END_BUG> public MessageSource < String > timerMessageSource ( ) { return ( ) -> new GenericMessage < > ( new java . text . SimpleDateFormat ( format ) . format ( new java . util . Date ( ) ) ) ; } }

Fix:
@ InboundChannelAdapter ( value = "output" , autoStartup = "false" , poller = @ Poller ( fixedDelay = "${fixedDelay}" , maxMessagesPerPoll = "1" ) )
Buggy code:
public class ListFragment extends ProgressFragment { protected Context context ; public Context getContext ( ) { } protected SlidingUpPanelLayout slidingUpPanelLayout ; public SlidingUpPanelLayout getSlidingUpPanelLayout ( ) { } protected SwipeRefreshLayout swipeRefreshLayout ; public SwipeRefreshLayout getSwipeRefreshLayout ( ) { } protected ListView listView ; public ListView getListView ( ) { } protected ImageButton fab ; public ImageButton getFab ( ) { } protected View profile ; public View getProfile ( ) { } private ProfileTask profileTask ; @ Override public void onActivityCreated ( Bundle savedInstanceState ) { super . onActivityCreated ( savedInstanceState ) ; setContentView ( list_fragment ) ; setContentEmpty ( false ) ; <START_BUG> setContentShown ( true ) ; <END_BUG> context = getActivity ( ) ; initUI ( ) ; } private void initUI ( ) { } public void showProfile ( String screenName ) { } protected void cancelProfileTask ( ) { } }

Fix:
setContentShownNoAnimation ( true ) ;