nus-yam/ex-repair huggingface dataset:
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class ServiceProviderRegistrationTestCase extends ClusterAbstractTestCase { private static final Logger log = Logger . getLogger ( ServiceProviderRegistrationTestCase . class ) ; private static final String MODULE_NAME = "service-provider-registration" ; private static final String CLIENT_PROPERTIES = "cluster//ejb3//stateless//jboss-ejb-client.properties" ; @ Deployment ( name = DEPLOYMENT_1 , managed = false , testable = false ) @ TargetsContainer ( CONTAINER_1 ) public static Archive < ? > createDeploymentForContainer1 ( ) { } @ Deployment ( name = DEPLOYMENT_2 , managed = false , testable = false ) @ TargetsContainer ( CONTAINER_2 ) public static Archive < ? > createDeploymentForContainer2 ( ) { } private static Archive < ? > createDeployment ( ) { } @ Test public void test ( ) throws Exception { <START_BUG> String cluster = "ee" ; <END_BUG> String nodeNameFormat = "%s//%s" ; String nodeName1 = String . format ( nodeNameFormat , NODE_1 , cluster ) ; String nodeName2 = String . format ( nodeNameFormat , NODE_2 , cluster ) ; ContextSelector < EJBClientContext > selector = EJBClientContextSelector . setup ( ServiceProviderRegistrationTestCase . CLIENT_PROPERTIES ) ; try ( EJBDirectory directory = new RemoteEJBDirectory ( ServiceProviderRegistrationTestCase . MODULE_NAME ) ) { ServiceProviderRetriever bean = directory . lookupStateless ( ServiceProviderRetrieverBean . class , ServiceProviderRetriever . class ) ; Collection < String > names = bean . getProviders ( ) ; assertEquals ( 2 , names . size ( ) ) ; assertTrue ( names . toString ( ) , names . contains ( nodeName1 ) ) ; assertTrue ( names . toString ( ) , names . contains ( nodeName2 ) ) ; undeploy ( DEPLOYMENT_1 ) ; names = bean . getProviders ( ) ; assertEquals ( 1 , names . size ( ) ) ; assertTrue ( names . contains ( nodeName2 ) ) ; deploy ( DEPLOYMENT_1 ) ; names = bean . getProviders ( ) ; assertEquals ( 2 , names . size ( ) ) ; assertTrue ( names . contains ( nodeName1 ) ) ; assertTrue ( names . contains ( nodeName2 ) ) ; stop ( CONTAINER_2 ) ; names = bean . getProviders ( ) ; assertEquals ( 1 , names . size ( ) ) ; assertTrue ( names . contains ( nodeName1 ) ) ; start ( CONTAINER_2 ) ; names = bean . getProviders ( ) ; assertEquals ( 2 , names . size ( ) ) ; assertTrue ( names . contains ( nodeName1 ) ) ; assertTrue ( names . contains ( nodeName2 ) ) ; } finally { if ( selector != null ) { EJBClientContext . setSelector ( selector ) ; } } } }

Fix:
String cluster = "server" ;
Buggy code:
public class Native2Ascii extends MatchingTask { private boolean reverse = false ; private String encoding = null ; private File srcDir = null ; private File destDir = null ; private String extension = null ; private Mapper mapper ; public void setDest ( File destDir ) { } public void setEncoding ( String encoding ) { } public void setExt ( String ext ) { } public void setReverse ( boolean reverse ) { } public void setSrc ( File srcDir ) { } public Mapper createMapper ( ) throws TaskException { } public void execute ( ) throws TaskException { Commandline baseCmd = null ; DirectoryScanner scanner = null ; String [ ] files ; if ( ( srcDir ) == null ) { <START_BUG> srcDir = resolveFile ( "." ) ; <END_BUG> } if ( ( destDir ) == null ) { throw new TaskException ( "The<seq2seq4repair_space>dest<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set." ) ; } if ( ( ( srcDir . equals ( destDir ) ) && ( ( extension ) == null ) ) && ( ( mapper ) == null ) ) { throw new TaskException ( ( "The<seq2seq4repair_space>ext<seq2seq4repair_space>attribute<seq2seq4repair_space>or<seq2seq4repair_space>a<seq2seq4repair_space>mapper<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set<seq2seq4repair_space>if" + "<seq2seq4repair_space>src<seq2seq4repair_space>and<seq2seq4repair_space>dest<seq2seq4repair_space>dirs<seq2seq4repair_space>are<seq2seq4repair_space>the<seq2seq4repair_space>same." ) ) ; } FileNameMapper m = null ; if ( ( mapper ) == null ) { if ( ( extension ) == null ) { m = new IdentityMapper ( ) ; } else { m = new Native2Ascii . ExtMapper ( ) ; } } else { m = mapper . getImplementation ( ) ; } scanner = getDirectoryScanner ( srcDir ) ; files = scanner . getIncludedFiles ( ) ; SourceFileScanner sfs = new SourceFileScanner ( this ) ; files = sfs . restrict ( files , srcDir , destDir , m ) ; int count = files . length ; if ( count == 0 ) { return ; } String message = ( ( ( "Converting<seq2seq4repair_space>" + count ) + "<seq2seq4repair_space>file" ) + ( count != 1 ? "s" : "" ) ) + "<seq2seq4repair_space>from<seq2seq4repair_space>" ; getLogger ( ) . info ( ( ( ( message + ( srcDir ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( destDir ) ) ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { convert ( files [ i ] , m . mapFileName ( files [ i ] ) [ 0 ] ) ; } } private void convert ( String srcName , String destName ) throws TaskException { } private class ExtMapper implements FileNameMapper { public void setFrom ( String s ) { } public void setTo ( String s ) { } public String [ ] mapFileName ( String fileName ) { } } }

Fix:
srcDir = getBaseDirectory ( ) ;
Buggy code:
public class Taskdef extends Task { private String name ; private String value ; public void init ( ) throws BuildException { } public void setName ( String name ) { } public void setClass ( String v ) { <START_BUG> project . log ( ( "The<seq2seq4repair_space>class<seq2seq4repair_space>attribute<seq2seq4repair_space>is<seq2seq4repair_space>deprecated.<seq2seq4repair_space>" + "Please<seq2seq4repair_space>use<seq2seq4repair_space>the<seq2seq4repair_space>classname<seq2seq4repair_space>attribute." ) , MSG_WARN ) ; <END_BUG> value = v ; } public String getClassname ( ) { } public void setClassname ( String v ) { } }

Fix:
log ( ( "The<seq2seq4repair_space>class<seq2seq4repair_space>attribute<seq2seq4repair_space>is<seq2seq4repair_space>deprecated.<seq2seq4repair_space>" + "Please<seq2seq4repair_space>use<seq2seq4repair_space>the<seq2seq4repair_space>classname<seq2seq4repair_space>attribute." ) , MSG_WARN ) ;
Buggy code:
class MockCharFilter extends CharStream { final Reader in ; final int remainder ; public MockCharFilter ( Reader in , int remainder ) { } @ Override public void close ( ) throws IOException { } int currentOffset = - 1 ; int delta = 0 ; int bufferedCh = - 1 ; @ Override public int read ( ) throws IOException { if ( ( bufferedCh ) >= 0 ) { int ch = bufferedCh ; bufferedCh = - 1 ; ( currentOffset ) ++ ; <START_BUG> addOffCorrectMap ( ( ( currentOffset ) + ( delta ) ) , ( ( delta ) - 1 ) ) ; <END_BUG> ( delta ) -- ; return ch ; } int ch = in . read ( ) ; if ( ch < 0 ) return ch ; ( currentOffset ) ++ ; if ( ( ( ( ch % 10 ) != ( remainder ) ) || ( Character . isHighSurrogate ( ( ( char ) ( ch ) ) ) ) ) || ( Character . isLowSurrogate ( ( ( char ) ( ch ) ) ) ) ) { return ch ; } bufferedCh = ch ; return ch ; } @ Override public int read ( char [ ] cbuf , int off , int len ) throws IOException { } @ Override public int correctOffset ( int currentOff ) { } protected void addOffCorrectMap ( int off , int cumulativeDiff ) { } TreeMap < Integer , Integer > corrections = new TreeMap < Integer , Integer > ( ) ; }

Fix:
addOffCorrectMap ( currentOffset , ( ( delta ) - 1 ) ) ;
Buggy code:
@ Path ( "//stats" ) public class StatsResource extends ResourceBase { @ GET @ Produces ( MediaType . TEXT_PLAIN ) public Response getStats ( ) { StringBuilder sb = new StringBuilder ( ) ; for ( Map . Entry < String , Stats > entry : rs . getStatsMap ( ) . entrySet ( ) ) { Stats stats = entry . getValue ( ) ; sb . append ( "name=" ) . append ( entry . getKey ( ) ) . append ( "\n" ) ; sb . append ( "numRequests=" ) . append ( stats . numRequests . get ( ) ) . append ( "\n" ) ; sb . append ( "numValidRequests=" ) . append ( stats . numValidRequests . get ( ) ) . append ( "\n" ) ; sb . append ( "numInvalidRequests=" ) . append ( stats . numInvalidRequests . get ( ) ) . append ( "\n" ) ; sb . append ( "numForbiddenRequests=" ) . append ( stats . numForbiddenRequests . get ( ) ) . append ( "\n" ) ; sb . append ( "numPuts=" ) . append ( stats . numPuts . get ( ) ) . append ( "\n" ) ; sb . append ( "numGets=" ) . append ( stats . numGets . get ( ) ) . append ( "\n" ) ; <START_BUG> sb . append ( "numDels=" ) . append ( stats . numDels . get ( ) ) ; <END_BUG> } return Response . ok ( sb . toString ( ) , APPLICATION_JSON ) . build ( ) ; } @ GET @ Path ( "reset" ) public Response resetStats ( ) { } No newline ; at end ; of file ; }

Fix:
sb . append ( "numDels=" ) . append ( stats . numDels . get ( ) ) . append ( "\n" ) ;
Buggy code:
public class Map { private Maplocation [ ] [ ] map = null ; private int mapSizeX = 0 ; private int mapSizeY = 0 ; public Map ( int x , int y ) { } public Map ( int x , int y , boolean tester ) { } private void initMap ( ) { } public Maplocation [ ] [ ] getMap ( ) { } public int getMapSizeX ( ) { } public int getMapSizeY ( ) { } public boolean setMap ( int x , int y ) { } public Maplocation getLocation ( int x , int y ) { if ( ( map ) == null ) { return null ; } else <START_BUG> if ( ( ( ( ( mapSizeX ) < x ) || ( x < 0 ) ) || ( ( mapSizeY ) < y ) ) || ( y < 0 ) ) { <END_BUG> return null ; } else { return map [ x ] [ y ] ; } } }

Fix:
if ( ( ( ( ( ( mapSizeX ) - 1 ) < x ) || ( x < 0 ) ) || ( ( ( mapSizeY ) - 1 ) < y ) ) || ( y < 0 ) ) {
Buggy code:
public final class KeySequence implements Comparable { private static final KeySequence EMPTY_KEY_SEQUENCE = new KeySequence ( Collections . EMPTY_LIST ) ; private static final int HASH_FACTOR = 89 ; private static final int HASH_INITIAL = KeySequence . class . getName ( ) . hashCode ( ) ; public static final String KEY_STROKE_DELIMITERS = ( KeyFormatter . KEY_STROKE_DELIMITER ) + "\b\r\f\n\t<seq2seq4repair_space>" ; public static KeySequence getInstance ( ) { } public static KeySequence getInstance ( KeySequence keySequence , KeyStroke keyStroke ) { } public static KeySequence getInstance ( KeyStroke keyStroke ) { } public static KeySequence getInstance ( KeyStroke [ ] keyStrokes ) { } public static KeySequence getInstance ( List keyStrokes ) { } public static KeySequence getInstance ( String string ) throws ParseException { } private transient int hashCode ; private transient boolean hashCodeComputed ; private List keyStrokes ; private KeySequence ( List keyStrokes ) { } public int compareTo ( Object object ) { } public boolean equals ( Object object ) { } public String format ( ) { <START_BUG> return format ( NATIVE ) ; <END_BUG> } public String format ( int format ) { } public List getKeyStrokes ( ) { } public int hashCode ( ) { } public boolean isComplete ( ) { } public boolean isEmpty ( ) { } public boolean startsWith ( KeySequence keySequence , boolean equals ) { } public String toString ( ) { } }

Fix:
return format ( XEMACS ) ;
Buggy code:
public class FileIndex extends Observable implements Index { private String directory = "C:\\Users\\Jonas\\Documents\\IRLab1\\postings1\\" ; private HashSet < String > dictionary ; private HashMap < String , PostingsList > tempDictionary ; private Search search ; private int writtenFiles ; private int numFiles ; private Configuration configuration ; public FileIndex ( int numFiles , Observer observer ) { } @ Override public boolean hasSavedIndex ( ) { } @ Override public void insert ( String token , int docID , int offset ) { if ( configuration . isSavedIndex ( ) ) { return ; } int span = 1748 ; if ( docID == ( ( numFiles ) - 2 ) ) { span = 0 ; } if ( docID > ( ( writtenFiles ) + span ) ) { int counter = 0 ; int total = tempDictionary . size ( ) ; Iterator < String > iterator = tempDictionary . keySet ( ) . iterator ( ) ; String key ; PostingsList postingsList ; <START_BUG> ExecutorService pool = Executors . newFixedThreadPool ( 8 ) ; <END_BUG> while ( iterator . hasNext ( ) ) { key = iterator . next ( ) ; if ( isValidName ( key ) ) { postingsList = tempDictionary . get ( key ) ; pool . execute ( new java . io . FileWriter ( postingsList , ( ( ( directory ) + key ) + ".txt" ) ) ) ; } counter ++ ; setChanged ( ) ; notifyObservers ( ( ( counter * 100 ) // total ) ) ; } tempDictionary = new HashMap < String , PostingsList > ( ) ; writtenFiles = docID ; } PostingsList postingsList = tempDictionary . get ( token ) ; if ( postingsList == null ) { postingsList = new PostingsList ( ) ; postingsList . addLast ( new PostingsEntry ( docID , offset ) ) ; } else { PostingsEntry postingsEntry = postingsList . getLast ( ) ; if ( ( postingsEntry . getDocID ( ) ) != docID ) { postingsList . addLast ( new PostingsEntry ( docID , offset ) ) ; } else { postingsEntry . addOccurance ( offset ) ; } } tempDictionary . put ( token , postingsList ) ; dictionary . add ( token ) ; } @ Override public Iterator < String > getDictionary ( ) { } @ Override public PostingsList getPostings ( String token ) { } @ Override public PostingsList search ( Query query , int queryType , int rankingType , int structureType ) { } private ArrayList < PostingsList > collectPostings ( Query query ) { } @ Override public void cleanup ( ) { } private boolean isValidName ( String text ) { } }

Fix:
ExecutorService pool = Executors . newFixedThreadPool ( 16 ) ;
Buggy code:
public class RPMPackagerStrategy extends BasePackagerStrategy { @ Override public void createPackage ( File packagerDirectory , File workingDirectory , Collection < RunnerStrategy > runners , Log log ) throws MojoExecutionException { if ( packagerDirectory == null ) { get_log ( ) . error ( "'packagerDirectory'<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; throw new MojoExecutionException ( "'packagerDirectory'<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; } Project project = new Project ( ) ; project . setCoreLoader ( getClass ( ) . getClassLoader ( ) ) ; project . init ( ) ; RedlineTask task = new RedlineTask ( ) ; task . setProject ( project ) ; task . setDestination ( packagerDirectory ) ; task . setName ( getRequiredParam ( "PKG_NAME" ) ) ; task . setArchitecture ( "NOARCH" ) ; task . setLicense ( "proprietary" ) ; task . setVersion ( getRequiredParam ( "PKG_VERSION" ) ) ; task . setRelease ( getRequiredParam ( "PKG_RELEASE" ) ) ; task . setGroup ( "Application//Office" ) ; task . setSourcePackage ( ( ( ( getRequiredParam ( "PKG_NAME" ) ) + ( getRequiredParam ( "PKG_VERSION" ) ) ) + ".src.rpm" ) ) ; task . setPreInstallScript ( new File ( ( ( ( ( workingDirectory + ( File . separator ) ) + "rpm" ) + ( File . separator ) ) + "preinstall.sh" ) ) ) ; task . setPostInstallScript ( new File ( ( ( ( ( workingDirectory + ( File . separator ) ) + "rpm" ) + ( File . separator ) ) + "postinstall.sh" ) ) ) ; task . setPostUninstallScript ( new File ( ( ( ( ( workingDirectory + ( File . separator ) ) + "rpm" ) + ( File . separator ) ) + "postremove.sh" ) ) ) ; for ( RunnerStrategy runner : runners ) { Map < File , Collection < File > > installSet = runner . getInstallSet ( workingDirectory ) ; for ( Map . Entry < File , Collection < File > > instEntry : installSet . entrySet ( ) ) { String leafDirName = instEntry . getKey ( ) . getName ( ) ; File installDir ; if ( isServiceDir ( leafDirName ) ) { <START_BUG> installDir = new File ( ( ( ( getServiceDirectory ( ) ) + ( File . separator ) ) + leafDirName ) ) ; <END_BUG> } else { installDir = new File ( ( ( ( getInstallLoc ( ) ) + ( File . separator ) ) + leafDirName ) ) ; } for ( File destFile : instEntry . getValue ( ) ) { RpmFileSet fs = new RpmFileSet ( ) ; fs . setPrefix ( installDir . getAbsolutePath ( ) ) ; fs . setFile ( new File ( ( ( ( instEntry . getKey ( ) . getName ( ) ) + ( File . separator ) ) + ( destFile . getName ( ) ) ) ) ) ; fs . setDir ( new File ( ( ( ( workingDirectory . getPath ( ) ) + ( File . separator ) ) + ( instEntry . getKey ( ) ) ) ) ) ; fs . setConfig ( true ) ; fs . setNoReplace ( true ) ; fs . setDoc ( true ) ; task . addRpmfileset ( fs ) ; } } } task . execute ( ) ; } private boolean isServiceDir ( String dirName ) { } private String getServiceDirectory ( ) { } @ Override public Map < File , File > getConversionFiles ( File outputDirectory , RunnerStrategy runner ) { } protected String getRequiredParam ( String parameter ) throws MojoExecutionException { } private String getPrefix ( ) { } }

Fix:
installDir = new File ( getServiceDirectory ( ) ) ;
Buggy code:
public class SWExplorer implements ActionListener , MenuListener { private static class RunModel implements Runnable { private SWExplorer . SoilWat model ; public RunModel ( SWExplorer . SoilWat model ) { } public void run ( ) { } } public class SoilWat implements SoilwatListener , ChangeListener { private InputData inputData ; private SW_CONTROL control = new SW_CONTROL ( ) ; private String ProjectName ; private FILES files ; private MODEL model ; private SITE site ; private SOILS soils ; private PROD prod ; private ESTABL estab ; private CLOUD cloud ; private WEATHER weather ; private MARKOV markov ; private SWC swc ; private OUTPUT out ; private OUTDATA output ; private JTabbedPane tabbedPane ; public SoilWat ( String ProjectName , boolean defaultData , String filesIn ) { } public String onGetPrjName ( ) { } private void onSetInput ( ) { } private void onGetInput ( ) { } public void onSave ( String Project ) { } public void onRun ( ) { tabbedPane . setSelectedIndex ( 0 ) ; control . onGetLog ( ) . clear ( ) ; try { <START_BUG> control . onStartModel ( false , files . getSaveOutData ( ) ) ; <END_BUG> if ( ( control . onGetLog ( ) . size ( ) ) != 0 ) files . textArea_logFile . setText ( control . onGetLog ( ) . toString ( ) ) ; } catch ( Exception e ) { JOptionPane . showMessageDialog ( null , e . toString ( ) , "Error" , JOptionPane . ERROR_MESSAGE ) ; } if ( ( output ) != null ) { tabbedPane . remove ( output ) ; } output = new OUTDATA ( control , inputData . outputSetupIn , files . progressBar ) ; soilwatEvent ( new SoilwatEvent ( 0 , 100 ) ) ; tabbedPane . addTab ( "Output<seq2seq4repair_space>Data" , output ) ; tabbedPane . setSelectedComponent ( output ) ; } public void onVerify ( ) { } public void resetProgressBar ( ) { } private JTabbedPane onGetPanel ( ) { } @ Override public void soilwatEvent ( SoilwatEvent e ) { } @ Override public void stateChanged ( ChangeEvent e ) { } } private JFrame frame ; private JTabbedPane tabbedPane ; private List < String > titles ; private SortedMap < String , SWExplorer . SoilWat > nameToProject ; private Path file ; private JFileChooser fc ; private JMenu mn_File ; private JMenuItem mntm_new ; private JMenuItem mntm_newDefault ; private JMenuItem mntm_open ; private JMenuItem mntm_close ; private JMenuItem mntm_closeAll ; private JMenuItem mntm_save ; private JMenuItem mntm_saveAs ; private JMenuItem mntm_saveAll ; private JMenuItem mntm_exit ; private JMenu mn_Project ; private JMenuItem mntm_Verify ; private JSeparator separator_3 ; private JMenuItem mntm_Run ; public static void main ( String [ ] args ) { } public SWExplorer ( ) { } private void initialize ( ) { } private void addProject ( String Name , boolean defaultData , String files ) { } @ Override public void actionPerformed ( ActionEvent e ) { } @ Override public void menuCanceled ( MenuEvent arg0 ) { } @ Override public void menuDeselected ( MenuEvent arg0 ) { } @ Override public void menuSelected ( MenuEvent e ) { } public List < Integer > FindDuplicates ( List < Integer > ints ) { } }

Fix:
control . onStartModel ( false , true , files . getSaveOutData ( ) ) ;
Buggy code:
public class MatrixIndexExceptionTest extends TestCase { public void testConstructorMessage ( ) { String msg = "message" ; <START_BUG> MatrixIndexException ex = new MatrixIndexException ( msg , new Object [ 0 ] ) ; <END_BUG> assertEquals ( msg , ex . getMessage ( ) ) ; } }

Fix:
MatrixIndexException ex = new MatrixIndexException ( msg , null ) ;
Buggy code:
public class BansMessageListener implements Listener { @ EventHandler public void receivePluginMessage ( PluginMessageEvent event ) throws IOException , SQLException { if ( event . isCancelled ( ) ) { return ; } if ( ! ( ( event . getSender ( ) ) instanceof Server ) ) { return ; } if ( ! ( event . getTag ( ) . equalsIgnoreCase ( "geSuitBans" ) ) ) { return ; } if ( instance . isDebugEnabled ( ) ) { <START_BUG> Utilities . dumpPacket ( event . getTag ( ) , "SEND" , event . getData ( ) , true ) ; <END_BUG> } event . setCancelled ( true ) ; DataInputStream in = new DataInputStream ( new ByteArrayInputStream ( event . getData ( ) ) ) ; String task = in . readUTF ( ) ; if ( task . equals ( "KickPlayer" ) ) { BansManager . kickPlayer ( in . readUTF ( ) , in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "BanPlayer" ) ) { BansManager . banPlayer ( in . readUTF ( ) , in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "WarnPlayer" ) ) { BansManager . warnPlayer ( in . readUTF ( ) , in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "TempBanPlayer" ) ) { BansManager . tempBanPlayer ( in . readUTF ( ) , in . readUTF ( ) , in . readInt ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "KickAll" ) ) { BansManager . kickAll ( in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "UnbanPlayer" ) ) { BansManager . unbanPlayer ( in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "IPBanPlayer" ) ) { BansManager . banIP ( in . readUTF ( ) , in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "CheckPlayerBans" ) ) { BansManager . checkPlayersBan ( in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "DisplayPlayerBanHistory" ) ) { BansManager . displayPlayerBanHistory ( in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "DisplayPlayerWarnHistory" ) ) { BansManager . displayPlayerWarnHistory ( in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "DisplayWhereHistory" ) ) { BansManager . displayWhereHistory ( in . readUTF ( ) , in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "DisplayOnTimeHistory" ) ) { BansManager . displayPlayerOnTime ( in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "DisplayOnTimeTop" ) ) { BansManager . displayOnTimeTop ( in . readUTF ( ) , in . readUTF ( ) ) ; return ; } if ( task . equals ( "ReloadBans" ) ) { BansManager . reloadBans ( in . readUTF ( ) ) ; return ; } if ( task . equals ( "SendVersion" ) ) { LoggingManager . log ( in . readUTF ( ) ) ; return ; } } }

Fix:
Utilities . dumpPacket ( event . getTag ( ) , "RECV" , event . getData ( ) , true ) ;
Buggy code:
public class BusinessUtil { public static String getCampaignSummaryTitle ( HashMap < String , List < RelayCamapignStatisticsResult > > statisticsHash , CampaignSummary cc ) { } public static String getFishWeight ( HashMap < String , List < RelayCamapignStatisticsResult > > statisticsHash , CampaignSummary cc ) { int weight = 0 ; <START_BUG> for ( RelayCamapignStatisticsResult rcsr : statisticsHash . get ( cc . getId ( ) ) ) { <END_BUG> weight = weight + ( ( Integer . parseInt ( rcsr . getWeight ( ) ) ) * ( Integer . parseInt ( rcsr . getCount ( ) ) ) ) ; } DecimalFormat df = new DecimalFormat ( "##.#" ) ; return df . format ( ( weight // 500.0 ) ) ; } public static String getFishUnit ( int grams ) { } public static String getWindDirDegreeName ( String code ) { } public static String getWindspeedName ( String code ) { } public static String getWeatherName ( String code ) { } }

Fix:
for ( RelayCamapignStatisticsResult rcsr : statisticsHash . get ( cc . getDate ( ) ) ) {
Buggy code:
public class AsmAdapter { public static final String ADVISES = "advises" ; public static final String ADVISED_BY = "advised<seq2seq4repair_space>by" ; public static final String DECLARES_ON = "declares<seq2seq4repair_space>on" ; public static final String DECLAREDY_BY = "declared<seq2seq4repair_space>by" ; public static void checkerMunger ( StructureModel model , Shadow shadow ) { } public static void nodeMunger ( StructureModel model , Shadow shadow , ShadowMunger munger ) { if ( munger instanceof Advice ) { Advice a = ( ( Advice ) ( munger ) ) ; if ( ( a . getKind ( ) . isPerEntry ( ) ) || ( a . getKind ( ) . isCflow ( ) ) ) { return ; } <START_BUG> IRelationshipMapper mapper = StructureModelManager . getDefault ( ) . getMapper ( ) ; <END_BUG> IProgramElement targetNode = AsmAdapter . getNode ( model , shadow ) ; IProgramElement adviceNode = AsmAdapter . getNode ( model , a ) ; if ( ( adviceNode != null ) && ( targetNode != null ) ) { IRelationship foreward = mapper . get ( adviceNode ) ; if ( foreward == null ) { foreward = new Relationship ( AsmAdapter . ADVISES , Kind . ADVICE , adviceNode , new ArrayList ( ) ) ; mapper . put ( adviceNode , foreward ) ; } foreward . getTargets ( ) . add ( targetNode ) ; IRelationship back = mapper . get ( targetNode ) ; if ( back == null ) { back = new Relationship ( AsmAdapter . ADVISED_BY , Kind . ADVICE , targetNode , new ArrayList ( ) ) ; mapper . put ( targetNode , back ) ; } back . getTargets ( ) . add ( adviceNode ) ; } } } private static IProgramElement getNode ( StructureModel model , Advice a ) { } private static IProgramElement getNode ( StructureModel model , Shadow shadow ) { } private static IProgramElement findOrCreateBodyNode ( IProgramElement enclosingNode , Member shadowSig , Shadow shadow ) { } public static IProgramElement lookupMember ( StructureModel model , Member member ) { } private static IProgramElement findMemberInClass ( IProgramElement classNode , Member member ) { } }

Fix:
IRelationshipMapper mapper = AsmManager . getDefault ( ) . getMapper ( ) ;
Buggy code:
public class JtaTransactionManagerBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { private static final String WEBLOGIC_JTA_TRANSACTION_MANAGER_CLASS_NAME = "org.springframework.transaction.jta.WebLogicJtaTransactionManager" ; private static final String WEBSPHERE_TRANSACTION_MANAGER_CLASS_NAME = "org.springframework.transaction.jta.WebSphereUowTransactionManager" ; private static final String OC4J_TRANSACTION_MANAGER_CLASS_NAME = "org.springframework.transaction.jta.OC4JJtaTransactionManager" ; private static final String JTA_TRANSACTION_MANAGER_CLASS_NAME = "org.springframework.transaction.jta.JtaTransactionManager" ; private static final boolean weblogicPresent = ClassUtils . isPresent ( "weblogic.transaction.UserTransaction" , JtaTransactionManagerBeanDefinitionParser . class . getClassLoader ( ) ) ; private static final boolean webspherePresent = ClassUtils . isPresent ( "com.ibm.wsspi.uow.UOWManager" , JtaTransactionManagerBeanDefinitionParser . class . getClassLoader ( ) ) ; private static final boolean oc4jPresent = ClassUtils . isPresent ( "oracle.j2ee.transaction.OC4JTransactionManager" , JtaTransactionManagerBeanDefinitionParser . class . getClassLoader ( ) ) ; @ Override protected String getBeanClassName ( Element element ) { } @ Override protected String resolveId ( Element element , AbstractBeanDefinition definition , ParserContext parserContext ) { <START_BUG> return TxNamespaceHandler . DEFAULT_TRANSACTION_MANAGER_BEAN_NAME ; <END_BUG> } }

Fix:
return TxAnnotationDriven . DEFAULT_TRANSACTION_MANAGER_BEAN_NAME ;
Buggy code:
public class ConstantValueEncoder extends FeatureVectorEncoder { public ConstantValueEncoder ( String name ) { } @ Override public void addToVector ( byte [ ] originalForm , double weight , Vector data ) { int probes = getProbes ( ) ; String name = getName ( ) ; for ( int i = 0 ; i < probes ; i ++ ) { int n = hashForProbe ( originalForm , data . size ( ) , name , i ) ; if ( isTraceEnabled ( ) ) { <START_BUG> trace ( name , n ) ; <END_BUG> } data . set ( n , ( ( data . get ( n ) ) + ( getWeight ( originalForm , weight ) ) ) ) ; } } @ Override protected double getWeight ( byte [ ] originalForm , double w ) { } @ Override public String asString ( String originalForm ) { } @ Override protected int hashForProbe ( byte [ ] originalForm , int dataSize , String name , int probe ) { } }

Fix:
trace ( ( ( String ) ( null ) ) , n ) ;
Buggy code:
<START_BUG> public class UploadSearchParams extends BaseSearchParams { <END_BUG> private File imageFile ; private InputStream imageStream ; private Box box ; private String imageUrl ; public UploadSearchParams ( File imageFile ) { } public UploadSearchParams ( InputStream imageStream ) { } public UploadSearchParams ( String imageUrl ) { } public UploadSearchParams setBox ( Box box ) { } public Box getBox ( ) { } public UploadSearchParams setImageFile ( File imageFile ) { } public File getImageFile ( ) { } public UploadSearchParams setImageStream ( InputStream imageStream ) { } public InputStream getImageStream ( ) { } public String getImageUrl ( ) { } public void setImageUrl ( String imageUrl ) { } @ Override public Multimap < String , String > toMap ( ) { Multimap < String , String > map = super . toMap ( ) ; if ( ( ( box ) != null ) && ( box . allCoordsExist ( ) ) ) { map . put ( "box" , ( ( ( ( ( ( ( box . getX1 ( ) ) + "," ) + ( box . getY1 ( ) ) ) + "," ) + ( box . getX2 ( ) ) ) + "," ) + ( box . getY2 ( ) ) ) ) ; } if ( ( imageUrl ) != null ) { map . put ( "im_url" , imageUrl ) ; } return map ; } }

Fix:
public class UploadSearchParams extends BaseSearchParams < UploadSearchParams > {
Buggy code:
public abstract class AbstractAnnotatorServlet extends HttpServlet { private static final long serialVersionUID = - 7313493486599524614L ; protected abstract String getAnnotatorBaseURL ( ) { } @ Override protected void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } private static String getFirst ( String [ ] values , String defaultValue ) { } private JSON queryAnnotator ( UrlParameters parameters ) { String url = parameters . makeUrl ( getAnnotatorBaseURL ( ) ) ; CloseableHttpClient client = HttpClientBuilder . create ( ) . build ( ) ; HttpResponse httpResponse = null ; try { <START_BUG> URI uri = new URI ( url . replace ( "<seq2seq4repair_space>" , "%20" ) ) ; <END_BUG> httpResponse = client . execute ( new HttpGet ( uri ) ) ; } catch ( URISyntaxException e ) { return new JSON ( e ) ; } catch ( IOException e ) { return new JSON ( e ) ; } JSON annotations ; try { annotations = new JSON ( httpResponse . getEntity ( ) . getContent ( ) ) ; } catch ( IOException e ) { annotations = new JSON ( e ) ; } try { client . close ( ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } return annotations ; } }

Fix:
URI uri = new URI ( url . replace ( "<seq2seq4repair_space>" , "%20" ) . replace ( "\n" , "%0A" ) ) ;
Buggy code:
public class CategoryClickHandler { public static void categoryClicker ( Context context , CategoryDetail categoryDetail ) { } public static void goNextPage ( Context context , CategoryDetail categoryDetail ) { } private static void goSignActivity ( Context context , String title , Task task ) { } private static void goHTML ( Context context , int type , String rid , String url , String title ) { Intent intent = new Intent ( ) ; intent . setClass ( context , BackWebActivity . class ) ; intent . putExtra ( KEY_URL , url ) ; intent . putExtra ( KEY_TITLE , title ) ; intent . putExtra ( KEY_RID , rid ) ; intent . putExtra ( KEY_SHOW_STATISTICAL , true ) ; intent . putExtra ( KEY_SHOW_RATING , ( ( type == ( Category . CATEGORY_TRAINING ) ) || ( type == ( Category . CATEGORY_SHELF ) ) ) ) ; <START_BUG> intent . putExtra ( KEY_SHOW_COMMENT , true ) ; <END_BUG> context . startActivity ( intent ) ; } public static void goVedio ( Context context , String rid , String title , String url , String subject ) { } public static void goAudio ( Context context , String rid , String title , String url , String subject ) { } public static void goPdfView ( Context context , int type , String rid , String title , String url ) { } public static void goPDFAndWeb ( Context context , int type , String rid , String url , String title ) { } }

Fix:
intent . putExtra ( KEY_SHOW_COMMENT , ( ( ( type == ( Category . CATEGORY_TRAINING ) ) || ( type == ( Category . CATEGORY_SHELF ) ) ) || ( type == ( Category . CATEGORY_NOTICE ) ) ) ) ;
Buggy code:
public class CXFClasspathContainer implements IClasspathContainer { private IPath path ; private List < IClasspathEntry > classpathEntries ; private String cxfLibraryEdition ; private String cxfLibraryVersion ; private String cxfLibraryLocation ; public CXFClasspathContainer ( IPath path , IJavaProject javaProject ) { } public IClasspathEntry [ ] getClasspathEntries ( ) { <START_BUG> if ( ( cxfLibraryVersion ) != ( getCxfRuntimeVersion ( ) ) ) { <END_BUG> classpathEntries = new ArrayList < IClasspathEntry > ( ) ; cxfLibraryLocation = getCxfRuntimeLocation ( ) ; cxfLibraryVersion = getCxfRuntimeVersion ( ) ; cxfLibraryEdition = getCxfRuntimeEdition ( ) ; } if ( ( classpathEntries . size ( ) ) == 0 ) { File cxfLibDirectory = getCXFLibraryDirectory ( ) ; if ( ( cxfLibDirectory . exists ( ) ) && ( cxfLibDirectory . isDirectory ( ) ) ) { String [ ] files = cxfLibDirectory . list ( ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { File file = new File ( ( ( ( cxfLibDirectory . getPath ( ) ) + ( File . separator ) ) + ( files [ i ] ) ) ) ; String fileName = file . getName ( ) ; if ( ( ( fileName . indexOf ( "." ) ) != ( - 1 ) ) && ( fileName . substring ( fileName . lastIndexOf ( "." ) , fileName . length ( ) ) . equals ( ".jar" ) ) ) { classpathEntries . add ( JavaCore . newLibraryEntry ( new Path ( file . getAbsolutePath ( ) ) , null , new Path ( "//" ) ) ) ; } } } } return classpathEntries . toArray ( new IClasspathEntry [ classpathEntries . size ( ) ] ) ; } public boolean isValid ( ) { } public String getDescription ( ) { } public int getKind ( ) { } public IPath getPath ( ) { } private String getCxfRuntimeLocation ( ) { } private String getCxfRuntimeVersion ( ) { } private String getCxfRuntimeEdition ( ) { } private File getCXFLibraryDirectory ( ) { } }

Fix:
if ( ! ( cxfLibraryVersion . equals ( getCxfRuntimeVersion ( ) ) ) ) {
Buggy code:
public class DDAG extends OneVSOne { public DDAG ( Classifier baseClassifier , boolean concurrentTrain ) { } public DDAG ( Classifier baseClassifier ) { } @ Override public CategoricalResults classify ( DataPoint data ) { } @ Override <START_BUG> public Classifier clone ( ) { <END_BUG> DDAG clone = new DDAG ( baseClassifier . clone ( ) , isConcurrentTraining ( ) ) ; if ( ( oneVone ) != null ) { clone . oneVone = new Classifier [ oneVone . length ] [ ] ; for ( int i = 0 ; i < ( oneVone . length ) ; i ++ ) { clone . oneVone [ i ] = new Classifier [ oneVone [ i ] . length ] ; for ( int j = 0 ; j < ( oneVone [ i ] . length ) ; j ++ ) clone . oneVone [ i ] [ j ] = oneVone [ i ] [ j ] . clone ( ) ; } } if ( ( predicting ) != null ) clone . predicting = predicting . clone ( ) ; return clone ; } }

Fix:
public DDAG clone ( ) {
Buggy code:
public abstract class AnnSBTest { @ ContainerResource private ManagementClient managementClient ; public static Archive < JavaArchive > testAppDeployment ( final Logger LOG , final String MODULE , final Class SB_TO_TEST ) { final JavaArchive jar = ShrinkWrap . create ( JavaArchive . class , ( MODULE + ".jar" ) ) . addClass ( SB_TO_TEST ) . addClass ( SimpleAuthorizationRemote . class ) . addClass ( ParentAnnOnlyCheck . class ) . addClass ( AnnOnlyCheckSLSBForInjection . class ) . addClass ( AnnOnlyCheckSFSBForInjection . class ) . addAsManifestResource ( "ejb3//security//EMPTY_MANIFEST.MF" , "MANIFEST.MF" ) ; <START_BUG> jar . addAsManifestResource ( SB_TO_TEST . getPackage ( ) , "jboss-ejb3.xml" , "jboss-ejb3.xml" ) ; <END_BUG> jar . addPackage ( CommonCriteria . class . getPackage ( ) ) ; LOG . info ( jar . toString ( true ) ) ; return jar ; } private SimpleAuthorizationRemote getBean ( final String MODULE , final Logger log , final Class SB_CLASS , Context ctx ) throws NamingException { } public void testSingleMethodAnnotationsNoUserTemplate ( final String MODULE , final Logger log , final Class SB_CLASS ) throws Exception { } public void testSingleMethodAnnotationsUser1Template ( final String MODULE , final Logger log , final Class SB_CLASS ) throws Exception { } public void testSingleMethodAnnotationsUser2Template ( final String MODULE , final Logger log , final Class SB_CLASS ) throws Exception { } protected ContextSelector < EJBClientContext > setupEJBClientContextSelector ( String username , String password ) throws IOException { } private class ClosableContextSelector implements Closeable , ContextSelector < EJBClientContext > { private EJBClientContext context ; private Endpoint endpoint ; private Connection connection ; private EJBReceiver reciever ; private ClosableContextSelector ( EJBClientContext context , Endpoint endpoint , Connection connection , EJBReceiver receiver ) { } public EJBClientContext getCurrent ( ) { } public void close ( ) throws IOException { } } private void safeClose ( Closeable c ) { } private class AuthenticationCallbackHandler implements CallbackHandler { private final String username ; private final String password ; private AuthenticationCallbackHandler ( final String username , final String password ) { } public void handle ( Callback [ ] callbacks ) throws IOException , UnsupportedCallbackException { } } protected static boolean isBeanClassStatefull ( Class bean ) { } }

Fix:
jar . addAsManifestResource ( AnnSBTest . class . getPackage ( ) , "jboss-ejb3.xml" , "jboss-ejb3.xml" ) ;
Buggy code:
public class BotBorder extends AccountImpl implements Player { private PokemonGameManager server ; private Bot botModel ; public static Player createBot ( long id , String name , String password , AccountType type ) { } public BotBorder ( long id , String name , String password , AccountType type ) { } private Color playerColor ; @ Override public List < Card > playerChoosesCards ( List < Card > cards , int amount , boolean exact , String message ) { } @ Override public List < PositionID > playerChoosesPositions ( List < PositionID > positionList , int amount , boolean exact , String message ) { } @ Override public List < Element > playerChoosesElements ( List < Element > elements , int amount , boolean exact , String message ) { } @ Override public List < String > playerChoosesAttacks ( List < Card > attackOwner , List < String > attacks , int amount , boolean exact , String message ) { } @ Override public List < Card > playerPaysEnergyCosts ( List < Element > costs , List < Card > energyCards ) { } @ Override public void playerUpdatesGameModel ( GameModelUpdate gameModelUpdate ) { } @ Override public List < Integer > playerDistributesDamage ( List < Position > positionList , List < Integer > damageList , List < Integer > maxDistList , DistributionMode mode ) { <START_BUG> return null ; <END_BUG> } @ Override public void playerMakesMove ( ) { } @ Override public Color getColor ( ) { } @ Override public void setColor ( Color color ) { } @ Override public void receiveGameDeleted ( ) { } @ Override public void playerReceivesGameTextMessage ( String message ) { } @ Override public void playerReceivesCardMessage ( String message , Card card ) { } @ Override public void playerReceivesCardMessage ( String message , List < Card > cardList ) { } @ Override public void startGame ( ) { } @ Override public void setServer ( PokemonGameManager server ) { } @ Override public void exit ( ) { } }

Fix:
return damageList ;
Buggy code:
public class DataFileParser implements DataParser { FileReader fr ; BufferedReader br ; public DataFileParser ( ) { } public DataFileParser ( String pathToFile ) { } private String readFileLine ( ) { } private Modul parseNextModule ( ) { String line ; do { line = readFileLine ( ) ; if ( line == null ) return null ; } while ( ! ( isModuleName ( line ) ) ) ; String name = "" ; boolean wintersem = false ; boolean sose = false ; short cp = 0 ; int houres = 0 ; short semester = 0 ; String tmps = "" ; char [ ] tmp = line . toCharArray ( ) ; int i = 0 ; while ( isSpecialSign ( tmp [ i ] ) ) i ++ ; while ( ! ( isSpecialSignWithoutSpace ( tmp [ i ] ) ) ) { name += tmp [ i ] ; i ++ ; } while ( isSpecialSign ( tmp [ i ] ) ) i ++ ; while ( ! ( isSpecialSign ( tmp [ i ] ) ) ) { tmps += tmp [ i ] ; i ++ ; } semester = Short . parseShort ( tmps ) ; tmps = "" ; while ( isSpecialSign ( tmp [ i ] ) ) i ++ ; while ( ! ( isSpecialSign ( tmp [ i ] ) ) ) { tmps += tmp [ i ] ; i ++ ; } if ( tmps . equals ( "1" ) ) wintersem = true ; tmps = "" ; while ( isSpecialSign ( tmp [ i ] ) ) i ++ ; while ( ! ( isSpecialSign ( tmp [ i ] ) ) ) { tmps += tmp [ i ] ; i ++ ; } if ( tmps . equals ( "1" ) ) sose = true ; tmps = "" ; while ( isSpecialSign ( tmp [ i ] ) ) i ++ ; while ( ! ( isSpecialSign ( tmp [ i ] ) ) ) { tmps += tmp [ i ] ; i ++ ; } cp = Short . parseShort ( tmps ) ; tmps = "" ; while ( isSpecialSign ( tmp [ i ] ) ) i ++ ; while ( ! ( isSpecialSign ( tmp [ i ] ) ) ) { tmps += tmp [ i ] ; i ++ ; } houres = Integer . parseInt ( tmps ) ; tmps = "" ; <START_BUG> SommerWinterSemester sw = SommerWinterSemester . WINTER ; <END_BUG> if ( sose && wintersem ) sw = SommerWinterSemester . BEIDE ; else if ( wintersem ) sw = SommerWinterSemester . SOMMER ; else sw = SommerWinterSemester . WINTER ; return new Modul ( name , semester , null , null , null , null , houres , cp , sw ) ; } private ArrayList < Modul > parseModules ( ) { } private String parseStudiumName ( ) { } @ Override public Studium parseStudium ( String pathToFile ) { } private boolean isSpecialSign ( char c ) { } private boolean isSpecialSignWithoutSpace ( char c ) { } private boolean isEndSign ( char c ) { } private boolean isCommentOrEmtpy ( String s ) { } private boolean isName ( String s ) { } private boolean isModuleName ( String s ) { } private boolean isEmpfehlung ( String s ) { } private boolean isVerdraengung ( String s ) { } private boolean isVoraussetzung ( String s ) { } private void createDependencies ( Studium s , String pathToFile ) { } private void reOpen ( String s ) { } private void close ( ) { } private void closeThenReOpen ( String s ) { } private void createDependenciesHard ( Studium s , String p ) { } private void createDependenciesMiddle ( Studium s , String p ) { } private void createDependenciesSoft ( Studium s , String p ) { } }

Fix:
SommerWinterSemester sw ;
Buggy code:
public class ExternalEditor { String Cmd ; public ExternalEditor ( ) { } public ExternalEditor ( String EditorCommand ) { } public boolean startExternalEditor ( AbstractEditorController EditCtrl ) { MimeHeader myHeader = new MimeHeader ( "text" , "plain" ) ; MimeTypeViewer viewer = new MimeTypeViewer ( ) ; File tmpFile = TempFileStore . createTempFileWithSuffix ( "extern_edit" ) ; FileWriter FO ; FileReader FI ; try { FO = new FileWriter ( tmpFile ) ; } catch ( IOException ex ) { JOptionPane . showMessageDialog ( null , ( "Error:<seq2seq4repair_space>Cannot<seq2seq4repair_space>write<seq2seq4repair_space>to<seq2seq4repair_space>temp<seq2seq4repair_space>file<seq2seq4repair_space>needed<seq2seq4repair_space>" + "for<seq2seq4repair_space>external<seq2seq4repair_space>editor." ) ) ; return false ; } try { String M = EditCtrl . getViewText ( ) ; if ( M != null ) { FO . write ( M ) ; } FO . close ( ) ; } catch ( IOException ex ) { JOptionPane . showMessageDialog ( null , ( "Error:<seq2seq4repair_space>Cannot<seq2seq4repair_space>write<seq2seq4repair_space>to<seq2seq4repair_space>temp<seq2seq4repair_space>file<seq2seq4repair_space>needed<seq2seq4repair_space>" + "for<seq2seq4repair_space>external<seq2seq4repair_space>editor." ) ) ; return false ; } Font OldFont = EditCtrl . getViewFont ( ) ; System . out . println ( "Setting<seq2seq4repair_space>Font<seq2seq4repair_space>to<seq2seq4repair_space>REALLY<seq2seq4repair_space>BIG!!!<seq2seq4repair_space>:-)" ) ; Font font = Config . getOptionsConfig ( ) . getGuiItem ( ) . getTextFont ( ) ; font = font . deriveFont ( 30 ) ; EditCtrl . setViewFont ( font ) ; EditCtrl . setViewText ( MailResourceLoader . getString ( "menu" , "composer" , "extern_editor_using_msg" ) ) ; Process child = viewer . open ( myHeader , tmpFile ) ; if ( child == null ) { return false ; } try { child . waitFor ( ) ; } catch ( InterruptedException ex ) { JOptionPane . showMessageDialog ( null , ( "Error:<seq2seq4repair_space>External<seq2seq4repair_space>editor<seq2seq4repair_space>exited<seq2seq4repair_space>" + "abnormally." ) ) ; return false ; } EditCtrl . setViewFont ( OldFont ) ; try { FI = new FileReader ( tmpFile ) ; } catch ( FileNotFoundException ex ) { JOptionPane . showMessageDialog ( null , ( "Error:<seq2seq4repair_space>Cannot<seq2seq4repair_space>read<seq2seq4repair_space>from<seq2seq4repair_space>temp<seq2seq4repair_space>file<seq2seq4repair_space>used<seq2seq4repair_space>" + "by<seq2seq4repair_space>external<seq2seq4repair_space>editor." ) ) ; return false ; } char [ ] buf = new char [ 1000 ] ; int i ; <START_BUG> String message = new String ( "" ) ; <END_BUG> try { while ( ( i = FI . read ( buf ) ) >= 0 ) { message += new String ( buf , 0 , i ) ; } FI . close ( ) ; } catch ( IOException ex ) { JOptionPane . showMessageDialog ( null , ( "Error:<seq2seq4repair_space>Cannot<seq2seq4repair_space>read<seq2seq4repair_space>from<seq2seq4repair_space>temp<seq2seq4repair_space>file<seq2seq4repair_space>used<seq2seq4repair_space>" + "by<seq2seq4repair_space>external<seq2seq4repair_space>editor." ) ) ; return false ; } EditCtrl . setViewText ( message ) ; return true ; } }

Fix:
String message = "" ;
Buggy code:
public class StoreMetricsHandler extends AbstractRuntimeOnlyHandler { @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> PathAddress address = context . getCurrentAddress ( ) ; <END_BUG> String containerName = address . getElement ( ( ( address . size ( ) ) - 3 ) ) . getValue ( ) ; String cacheName = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getValue ( ) ; String name = Operations . getAttributeName ( operation ) ; StoreMetric metric = StoreMetric . forName ( name ) ; if ( metric == null ) { context . getFailureDescription ( ) . set ( ROOT_LOGGER . unknownMetric ( name ) ) ; } else { Cache < ? , ? > cache = ServiceContainerHelper . findValue ( context . getServiceRegistry ( false ) , CACHE . getServiceName ( containerName , cacheName ) ) ; if ( cache != null ) { ActivationInterceptor interceptor = CacheMetric . findInterceptor ( cache , ActivationInterceptor . class ) ; context . getResult ( ) . set ( ( interceptor != null ? metric . getValue ( interceptor ) : new ModelNode ( 0 ) ) ) ; } } context . completeStep ( NOOP_RESULT_HANDLER ) ; } }

Fix:
PathAddress address = Operations . getPathAddress ( operation ) ;
Buggy code:
public class OpenSessionInViewInterceptor extends HibernateAccessor implements AsyncWebRequestInterceptor { public static final String PARTICIPATE_SUFFIX = ".PARTICIPATE" ; private boolean singleSession = true ; public OpenSessionInViewInterceptor ( ) { } public void setSingleSession ( boolean singleSession ) { } protected boolean isSingleSession ( ) { } public void preHandle ( WebRequest request ) throws DataAccessException { } public AbstractDelegatingCallable getAsyncCallable ( WebRequest request ) { String attributeName = getParticipateAttributeName ( ) ; if ( ( ( request . getAttribute ( attributeName , SCOPE_REQUEST ) ) != null ) || ( ! ( isSingleSession ( ) ) ) ) { return null ; } final SessionHolder sessionHolder = ( ( SessionHolder ) ( TransactionSynchronizationManager . getResource ( getSessionFactory ( ) ) ) ) ; return new AbstractDelegatingCallable ( ) { public Object call ( ) throws Exception { TransactionSynchronizationManager . bindResource ( getSessionFactory ( ) , sessionHolder ) ; <START_BUG> getNextCallable ( ) . call ( ) ; <END_BUG> return null ; } } ; } public void postHandleAsyncStarted ( WebRequest request ) { } public void postHandle ( WebRequest request , ModelMap model ) throws DataAccessException { } public void afterCompletion ( WebRequest request , Exception ex ) throws DataAccessException { } protected String getParticipateAttributeName ( ) { } }

Fix:
getNext ( ) . call ( ) ;
Buggy code:
public class TrendlineSlope implements AbstractFeature { @ Override public double forEvent ( Event event , Collection < Event > pastEvents ) { } private double normalizeTime ( Event event , Event baseEvent ) { <START_BUG> return ( ( ( ( double ) ( ( baseEvent . getTime ( ) ) - ( event . getTime ( ) ) ) ) // 1000 ) // 3600 ) // 24 ; <END_BUG> } }

Fix:
return ( ( ( ( double ) ( ( event . getTime ( ) ) - ( baseEvent . getTime ( ) ) ) ) // 1000 ) // 3600 ) // 24 ;