nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PhotoUploadWorker extends Task { private String groupName ; private HashMap < File , TextField > selectedPhotos = new HashMap < > ( ) ; private Account account ; public PhotoUploadWorker ( String groupname , HashMap < File , TextField > selectedPhotos , Account account ) { } @ Override protected Object call ( ) throws Exception { this . updateProgress ( 0 , selectedPhotos . size ( ) ) ; Gson gson = new Gson ( ) ; String photogroupid = "" ; String code = generateCode ( ) ; photogroupid = HttpController . excutePost ( ( ( FrontEnd . HOST ) + "//createPhotoGroup" ) , ( "photogroup=" + ( gson . toJson ( new PhotoGroup ( this . account . getAccountID ( ) , code , groupName , true , 0 ) ) ) ) ) ; int progress = 0 ; for ( Map . Entry pairs : selectedPhotos . entrySet ( ) ) { File p = ( ( File ) ( pairs . getKey ( ) ) ) ; BufferedImage image = ImageIO . read ( p ) ; Photo photo = new Photo ( p . getName ( ) , new GregorianCalendar ( ) , Float . parseFloat ( ( ( TextField ) ( pairs . getValue ( ) ) ) . getText ( ) ) , image . getHeight ( ) , image . getWidth ( ) ) ; String photoid = HttpController . excutePost ( ( ( FrontEnd . HOST ) + "//uploadGroupPhoto" ) , ( ( ( "photo=" + ( gson . toJson ( photo ) ) ) + "&photogroupID=" ) + photogroupid ) ) ; photoid = photoid . trim ( ) ; <START_BUG> String bla = HttpController . postFile ( "http:////localhost:8080//upload" , p . getPath ( ) , Integer . parseInt ( photoid ) ) ; <END_BUG> progress ++ ; this . updateProgress ( progress , selectedPhotos . size ( ) ) ; } return code ; } public String generateCode ( ) { } }

Fix:
String bla = HttpController . postFile ( ( ( FrontEnd . HOST ) + "//upload" ) , p . getPath ( ) , Integer . parseInt ( photoid ) ) ;
Buggy code:
public class RecorderEntry implements BuildLogger { private String filename = null ; private boolean record = true ; private int loglevel = Project . MSG_INFO ; private PrintStream out = null ; private long targetStartTime = 0L ; private static String lSep = System . getProperty ( "line.separator" ) ; protected RecorderEntry ( String name ) { } public String getFilename ( ) { } public void setRecordState ( Boolean state ) { } public void buildStarted ( BuildEvent event ) { } public void buildFinished ( BuildEvent event ) { } public void targetStarted ( BuildEvent event ) { } public void targetFinished ( BuildEvent event ) { } public void taskStarted ( BuildEvent event ) { } public void taskFinished ( BuildEvent event ) { } public void messageLogged ( BuildEvent event ) { } private void log ( String mesg , int level ) { } public void setMessageOutputLevel ( int level ) { } public void setOutputPrintStream ( PrintStream output ) { } public void setEmacsMode ( boolean emacsMode ) { <START_BUG> throw new UnsupportedOperationException ( "Method<seq2seq4repair_space>setEmacsMode()<seq2seq4repair_space>not<seq2seq4repair_space>yet<seq2seq4repair_space>implemented." ) ; <END_BUG> } public void setErrorPrintStream ( PrintStream err ) { } private static String formatTime ( long millis ) { } }

Fix:
throw new RuntimeException ( "Method<seq2seq4repair_space>setEmacsMode()<seq2seq4repair_space>not<seq2seq4repair_space>yet<seq2seq4repair_space>implemented." ) ;
Buggy code:
public class User implements ClusteringStringItem { String name ; ArrayList < Event > events ; ArrayList < DataObject > dataObjects ; ArrayList < Point > gazes ; ArrayList < Point > mouses ; String hoverString = "" ; String eyeString = "" ; BufferedImage image = null ; BufferedImage heatmap = null ; ArrayList < DataObject > viewedObjects ; BufferedImage scarfplot = null ; double [ ] [ ] heatmapVal ; int cellWidth = 1 ; int cellHeight = 12 ; long currentTime = 0 ; int timeStep = 600 ; long timePeriodStart = 0 ; long timePeriodEnd = 0 ; boolean withProb = true ; HashMap < DataObject , Integer > dataToIndex ; ArrayList < ViewEvent > viewEvents ; ArrayList < HoverEvent > hoverEvents ; ArrayList < Event > mouseEvents ; ArrayList < ArrayList < String > > vectorLabel ; ArrayList < ArrayList < Double > > vectorLabelScores ; int heatmapXOffset = 200 ; boolean isAggregated ; ArrayList < ArrayList < String > > coding ; double cellFilter = 1.0 ; double rowFilter = 1.0 ; String sort = "First<seq2seq4repair_space>Viewed" ; public User ( String name , boolean ag ) { } public User ( File f ) { } public void loadUser ( String path ) { } private String stringValue = "" ; private void calculateStringValue ( ) { } public void createScarfplot ( ) { } public void createHeatmap ( ) { } public void changeTime ( long t ) { } public int timeToPixel ( long t ) { } public long pixelToTime ( int p ) { } public void setPeriodStart ( long ts ) { } public void setPeriodEnd ( long te ) { } public void setCellWidth ( int cw ) { } public void setTimeStep ( int ts ) { } public double rankDistance ( ArrayList < String > v1 , ArrayList < Double > v1score , ArrayList < String > v2 ) { } public void addToAggregate ( User u ) { } public void loadCoding ( String path ) { } ArrayList < ArrayList < String > > changeCodingTimeBase ( int base ) { } public void setCellFilter ( double cf ) { } public void setRowFilter ( double rf ) { } public void setSort ( String sort ) { } @ Override public String toString ( ) { } @ Override public String getId ( ) { } @ Override public String getStringValue ( ) { } @ Override public int getDistance ( ClusteringStringItem otherItem ) { <START_BUG> return LevenshteinDistance . getLevenshteinDistanceDelimitedString ( this . stringValue , otherItem . getStringValue ( ) ) ; <END_BUG> } }

Fix:
return LevenshteinDistance . getLevenshteinDistanceDelimitedString ( getStringValue ( ) , otherItem . getStringValue ( ) ) ;
Buggy code:
<START_BUG> public class AccessDeniedPage extends WebPage < Object > { <END_BUG> private static final long serialVersionUID = 1L ; public AccessDeniedPage ( ) { } @ Override protected void configureResponse ( ) { super . configureResponse ( ) ; getWebRequestCycle ( ) . getWebResponse ( ) . getHttpServletResponse ( ) . setStatus ( SC_FORBIDDEN ) ; } @ Override public boolean isVersioned ( ) { } @ Override public boolean isErrorPage ( ) { } }

Fix:
public class AccessDeniedPage extends WebPage {
Buggy code:
public class DefinedClassModuleFactory implements ModuleFactory { private static final RhinoHelper rhino = new RhinoHelper ( ) ; private Map < String , String > map = new HashMap < String , String > ( ) ; public DefinedClassModuleFactory ( Map < String , String > map ) { } public Object create ( String key , Scriptable thisObj , Scriptable scope , Context context ) throws Exception { String defClass = map . get ( key ) ; if ( defClass == null ) { return null ; } else { @ SuppressWarnings ( "unchecked" ) <START_BUG> Object res = DefinedClassModuleFactory . rhino . buildClassCtor ( scope , ( ( Class < ? extends Scriptable > ) ( Class . forName ( defClass ) ) ) , false , false ) ; <END_BUG> if ( res instanceof JavaJsHostObject ) { String script = ( ( JavaJsHostObject ) ( res ) ) . getJsScript ( ) ; DefinedClassModuleFactory . rhino . evaluateReader ( context , new StringReader ( script ) , defClass , scope ) ; } return res ; } } No newline ; at end ; of file ; }

Fix:
Object res = DefinedClassModuleFactory . rhino . buildClassCtor ( scope , ( ( Class < ? extends Scriptable > ) ( Class . forName ( defClass . trim ( ) ) ) ) , false , false ) ;
Buggy code:
public class SQLQueryProbe extends AbstractEnclosingProbe { public static final MeasurementProbe < MethodsEnclosingScope > MODEL_PROBE = new MeasurementProbe ( SQLQueryProbe . class . getName ( ) ) ; public SQLQueryProbe ( IExtension < ? > provider ) { } @ ProbeVariable public SQLQueryRecord _SQLQueryProbe_record ; @ ProbeVariable public String _SQLQueryProbe_query ; @ ProbeBeforePart ( requiredMethodName = { "execute(java.lang.String" , "executeQuery(java.lang.String" , "executeUpdate(java.lang.String" } ) public void beforePart ( ) { } @ ProbeBeforePart ( requiredMethodName = { "execute()" , "executeQuery()" , "executeUpdate()" } ) public void beforePartForPreparedStatement ( ) { } <START_BUG> @ ProbeAfterPart ( requiredMethodName = "prepareStatement(java.lang.String)" ) <END_BUG> public void afterPartForPrepareStatement ( ) { SQLPreparedStatementCache . getInstance ( ) . register ( ( ( PreparedStatement ) ( __returnObject ) ) , ( ( String ) ( __parameter [ 1 ] ) ) ) ; } }

Fix:
@ ProbeAfterPart ( requiredMethodName = "prepareStatement(java.lang.String" )
Buggy code:
class Download_1_8 { XPCOMObject supports ; XPCOMObject download ; XPCOMObject progressDialog ; XPCOMObject webProgressListener ; nsICancelable cancelable ; int refCount = 0 ; Shell shell ; Label status ; Button cancel ; static final boolean is32 = ( OS . PTR_SIZEOF ) == 4 ; public Download_1_8 ( ) { } int AddRef ( ) { } void createCOMInterfaces ( ) { } void disposeCOMInterfaces ( ) { } int getAddress ( ) { } int QueryInterface ( int riid , int ppvObject ) { } int Release ( ) { } public int Init_32 ( int aSource , int aTarget , int aDisplayName , int aMIMEInfo , int startTime1 , int startTime2 , int aTempFile , int aCancelable ) { } public int Init ( int aSource , int aTarget , int aDisplayName , int aMIMEInfo , long startTime , int aTempFile , int aCancelable ) { } int GetAmountTransferred ( int arg0 ) { } int GetCancelable ( int arg0 ) { } public int GetDisplayName ( int aDisplayName ) { } public int GetMIMEInfo ( int aMIMEInfo ) { } public int GetPercentComplete ( int aPercentComplete ) { } int GetSize ( int arg0 ) { } public int GetSource ( int aSource ) { } public int GetStartTime ( int aStartTime ) { } public int GetTarget ( int aTarget ) { } int GetTargetFile ( int arg0 ) { } public int GetCancelDownloadOnClose ( int aCancelDownloadOnClose ) { } public int GetDialog ( int aDialog ) { } public int Open ( int aParent ) { } public int SetCancelDownloadOnClose ( int aCancelDownloadOnClose ) { } public int SetDialog ( int aDialog ) { } int OnLocationChange ( int aWebProgress , int aRequest , int aLocation ) { } int OnProgressChange ( int aWebProgress , int aRequest , int aCurSelfProgress , int aMaxSelfProgress , int aCurTotalProgress , int aMaxTotalProgress ) { } int OnProgressChange64_32 ( int aWebProgress , int aRequest , int aCurSelfProgress1 , int aCurSelfProgress2 , int aMaxSelfProgress1 , int aMaxSelfProgress2 , int aCurTotalProgress1 , int aCurTotalProgress2 , int aMaxTotalProgress1 , int aMaxTotalProgress2 ) { } int OnProgressChange64 ( int aWebProgress , int aRequest , long aCurSelfProgress , long aMaxSelfProgress , long aCurTotalProgress , long aMaxTotalProgress ) { <START_BUG> long currentKBytes = aCurSelfProgress // 1024 ; <END_BUG> long totalKBytes = aMaxTotalProgress // 1024 ; if ( ( ( shell ) != null ) & ( ! ( shell . isDisposed ( ) ) ) ) { Object [ ] arguments = new Object [ ] { new Long ( currentKBytes ) , new Long ( totalKBytes ) } ; String statusMsg = Compatibility . getMessage ( "SWT_Download_Status" , arguments ) ; status . setText ( statusMsg ) ; shell . layout ( true ) ; shell . getDisplay ( ) . update ( ) ; } return XPCOM . NS_OK ; } int OnSecurityChange ( int aWebProgress , int aRequest , int state ) { } int OnStateChange ( int aWebProgress , int aRequest , int aStateFlags , int aStatus ) { } int OnStatusChange ( int aWebProgress , int aRequest , int aStatus , int aMessage ) { } }

Fix:
long currentKBytes = aCurTotalProgress // 1024 ;
Buggy code:
public class CsvBeanReader { private ModelClass modelClass ; private CsvDozerBeanReader dozerBeanReader ; private CellProcessor [ ] processors ; @ Getter private String [ ] headers ; public CsvBeanReader ( ModelClass modelClass , InputStream inputStream ) throws IOException { } private void configureDozerBeanReader ( InputStream inputStream ) throws IOException { CsvPreference csvPreference = new CsvPreference . Builder ( CsvPreference . STANDARD_PREFERENCE ) . surroundingSpacesNeedQuotes ( true ) . build ( ) ; <START_BUG> BufferedReader bufferedReader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; <END_BUG> dozerBeanReader = new CsvDozerBeanReader ( bufferedReader , csvPreference ) ; headers = readHeaders ( ) ; String [ ] mappings = modelClass . getFieldNameMappings ( headers ) ; dozerBeanReader . configureBeanMapping ( modelClass . getClazz ( ) , mappings ) ; } private String [ ] readHeaders ( ) throws IOException { } public Importable read ( ) throws IOException { } public Importable readWithCellProcessors ( ) throws IOException { } public int getRowNumber ( ) { } public int length ( ) { } private void configureProcessors ( ) { } public void validateHeaders ( ) { } }

Fix:
BufferedReader bufferedReader = new BufferedReader ( new InputStreamReader ( inputStream , "UTF-8" ) ) ;
Buggy code:
public class TestNearSpansOrdered extends LuceneTestCase { protected IndexSearcher searcher ; public static final String FIELD = "field" ; public static final QueryParser qp = new QueryParser ( TestNearSpansOrdered . FIELD , new WhitespaceAnalyzer ( ) ) ; public void tearDown ( ) throws Exception { } public void setUp ( ) throws Exception { super . setUp ( ) ; RAMDirectory directory = new RAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( directory , new WhitespaceAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; for ( int i = 0 ; i < ( docFields . length ) ; i ++ ) { Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . Field ( TestNearSpansOrdered . FIELD , docFields [ i ] , Store . NO , Index . ANALYZED ) ) ; writer . addDocument ( doc ) ; } writer . close ( ) ; <START_BUG> searcher = new IndexSearcher ( directory ) ; <END_BUG> } protected String [ ] docFields = new String [ ] { "w1<seq2seq4repair_space>w2<seq2seq4repair_space>w3<seq2seq4repair_space>w4<seq2seq4repair_space>w5" , "w1<seq2seq4repair_space>w3<seq2seq4repair_space>w2<seq2seq4repair_space>w3<seq2seq4repair_space>zz" , "w1<seq2seq4repair_space>xx<seq2seq4repair_space>w2<seq2seq4repair_space>yy<seq2seq4repair_space>w3" , "w1<seq2seq4repair_space>w3<seq2seq4repair_space>xx<seq2seq4repair_space>w2<seq2seq4repair_space>yy<seq2seq4repair_space>w3<seq2seq4repair_space>zz" } ; protected SpanNearQuery makeQuery ( String s1 , String s2 , String s3 , int slop , boolean inOrder ) { } protected SpanNearQuery makeQuery ( ) { } public void testSpanNearQuery ( ) throws Exception { } public String s ( Spans span ) { } public String s ( int doc , int start , int end ) { } public void testNearSpansNext ( ) throws Exception { } public void testNearSpansSkipToLikeNext ( ) throws Exception { } public void testNearSpansNextThenSkipTo ( ) throws Exception { } public void testNearSpansNextThenSkipPast ( ) throws Exception { } public void testNearSpansSkipPast ( ) throws Exception { } public void testNearSpansSkipTo0 ( ) throws Exception { } public void testNearSpansSkipTo1 ( ) throws Exception { } public void testSpanNearScorerSkipTo1 ( ) throws Exception { } public void testSpanNearScorerExplain ( ) throws Exception { } }

Fix:
searcher = new IndexSearcher ( directory , true ) ;
Buggy code:
public class TestHindiAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBasics ( ) throws Exception { } public void testExclusionSet ( ) throws Exception { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new HindiAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new HindiAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class WorldGenerator { private static City city ; public static void generate ( ) { } private static void generateStreets ( ) { String [ ] names = new String [ ] { "Church<seq2seq4repair_space>Street" , "Kingsley<seq2seq4repair_space>Road" , "Ives<seq2seq4repair_space>Street" , "Moore<seq2seq4repair_space>Street" , "Winchester<seq2seq4repair_space>Street" , "Wooler<seq2seq4repair_space>Street" , "Kinglake<seq2seq4repair_space>Road" , "Coopers<seq2seq4repair_space>Road" , "Oldfield<seq2seq4repair_space>Grove" , "Croft<seq2seq4repair_space>Street" , "Mayflower<seq2seq4repair_space>Avenue" , "Downtown<seq2seq4repair_space>Road" , "Silver<seq2seq4repair_space>Walk" , "Fair<seq2seq4repair_space>Street" } ; for ( String name : names ) { WorldGenerator . city . addPlace ( new Street ( name ) ) ; } Street [ ] streets = WorldGenerator . city . getStreets ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { <START_BUG> for ( int j = ( streets . length ) - 5 ; j < ( streets . length ) ; j ++ ) { <END_BUG> WorldGenerator . city . connectPlaces ( streets [ i ] , streets [ j ] ) ; } } } private static void generateResidences ( ) { } private static void generateWorkplaces ( ) { } private static void generateCalendars ( ) { } private static Street getNextStreet ( ) { } private static void assignPersonsToJob ( Queue < Person > persons , int number , Place place ) { } }

Fix:
for ( int j = 5 ; j < ( streets . length ) ; j ++ ) {
Buggy code:
public class RefinedSoundexTest extends StringEncoderAbstractTest < RefinedSoundex > { @ Override protected RefinedSoundex createStringEncoder ( ) { } @ Test public void testDifference ( ) throws EncoderException { } @ Test public void testEncode ( ) { } @ Test public void testGetMappingCodeNonLetter ( ) { <START_BUG> char code = this . getStringEncoder ( ) . getMappingCode ( '#' ) ; <END_BUG> assertEquals ( "Code<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>equals<seq2seq4repair_space>zero" , 0 , code ) ; } @ Test public void testNewInstance ( ) { } @ Test public void testNewInstance2 ( ) { } @ Test public void testNewInstance3 ( ) { } }

Fix:
final char code = this . getStringEncoder ( ) . getMappingCode ( '#' ) ;
Buggy code:
public class DetailView extends JPanel implements Observer { String lagerName ; int mengeKapazitaet ; int mengeBestand ; EditNamePanel editName ; OptionenPanel optionenPanel ; JPanel lagerInfo ; JLabel bestand ; JLabel kapazitaet ; JLabel meldung ; JScrollPane buchungen ; JTable tabelle ; String [ ] columnNames ; Object [ ] [ ] data ; boolean isUnterLager ; LagerVerwaltungsController controller ; public DetailView ( LagerVerwaltungsController controller ) { } @ Override public void update ( Observable o , Object arg1 ) { } public void lagerInfoErstellen ( ) { } public void lagerInfoAktualisieren ( ) { } public void buchungsTabelleErstellen ( ) { } public void zeigeButton ( ) { } public void zeigeBuchungsOptionen ( int gesamtMenge , int maximum , boolean zulieferung ) { } public void bereiteBuchungenAuf ( List < BuchungsModel > listeBuchungen , LagerModel lModel ) { int i = 0 ; data = new Object [ listeBuchungen . size ( ) ] [ 5 ] ; System . out . println ( listeBuchungen . size ( ) ) ; for ( BuchungsModel bModel : listeBuchungen ) { data [ i ] [ 0 ] = bModel . getBuchungsTag ( ) . toLocaleString ( ) ; data [ i ] [ 1 ] = bModel . getVerteilteMenge ( ) ; int j ; for ( j = 0 ; bModel . getAnteile ( ) . get ( j ) . getLager ( ) . equals ( lModel ) ; j ++ ) { } data [ i ] [ 3 ] = bModel . getAnteile ( ) . get ( j ) . getAnteil ( ) ; <START_BUG> double prozent = ( ( ( double ) ( data [ i ] [ 3 ] ) ) // ( ( double ) ( data [ i ] [ 1 ] ) ) ) * 100.0 ; <END_BUG> prozent = ( prozent * 1000 ) + 5 ; int temp = ( ( int ) ( prozent // 10 ) ) ; prozent = ( ( double ) ( temp ) ) // 100.0 ; data [ i ] [ 2 ] = ( "" + prozent ) + "%" ; if ( bModel . getClass ( ) . equals ( new AbBuchungsModel ( null ) . getClass ( ) ) ) { data [ i ] [ 4 ] = "Auslieferung" ; } else { data [ i ] [ 4 ] = "Zulieferung" ; } } tabelle = new JTable ( data , columnNames ) ; tabelle . setEnabled ( false ) ; tabelle . getTableHeader ( ) . setReorderingAllowed ( false ) ; buchungen . removeAll ( ) ; buchungen . add ( tabelle ) ; buchungen . revalidate ( ) ; buchungen . repaint ( ) ; if ( meldung . isVisible ( ) ) { this . remove ( meldung ) ; this . add ( buchungen , BorderLayout . CENTER ) ; } } }

Fix:
double prozent = ( ( ( 1.0 * ( ( int ) ( data [ i ] [ 3 ] ) ) ) // 1.0 ) * ( ( int ) ( data [ i ] [ 1 ] ) ) ) * 100.0 ;
Buggy code:
public class StartWithContentEvaluator extends A_ContentEvaluator { public boolean evaluate ( String str1 , String str2 ) { LOG . debug ( "using<seq2seq4repair_space>StartWithContentEvaluator..." ) ; boolean result = false ; <START_BUG> if ( StringUtils . startsWithIgnoreCase ( str1 , str2 ) ) { <END_BUG> result = true ; } return result ; } }

Fix:
if ( StringUtils . startsWithIgnoreCase ( str2 , str1 ) ) {
Buggy code:
@ Controller @ RequestMapping ( "//device" ) public class DeviceController extends BaseController { @ Autowired DeviceService deviceService ; @ Autowired ProductReleaseService productReleaseService ; private Boolean ok = true ; @ RequestMapping ( method = RequestMethod . GET ) public ModelAndView device ( HttpServletRequest request ) { ModelAndView mav = new ModelAndView ( ) ; TproductRelease re = productReleaseService . getLatestPublished ( getSessionUser ( request ) . getStoreId ( ) ) ; TproductRelease unre = productReleaseService . getUnPublished ( getSessionUser ( request ) . getStoreId ( ) ) ; String [ ] res = new String [ 3 ] ; String Flag ; if ( re != null ) { res [ 0 ] = ( re . getId ( ) ) + "" ; Long time = re . getPublicTime ( ) ; if ( time == null ) { time = System . currentTimeMillis ( ) ; } res [ 1 ] = ConvertTools . longToDateString ( time ) ; } if ( unre != null ) { res [ 2 ] = ( unre . getId ( ) ) + "" ; Flag = "1" ; } else { <START_BUG> res [ 2 ] = "No<seq2seq4repair_space>Version<seq2seq4repair_space>Unpublish" ; <END_BUG> Flag = "2" ; } mav . addObject ( "res" , res ) ; mav . addObject ( "flag" , Flag ) ; mav . setViewName ( "device//device" ) ; return mav ; } @ RequestMapping ( value = "//deviceList" , method = RequestMethod . GET ) @ ResponseBody public String deviceList ( DataTableParamter dtp , HttpServletRequest request ) { } @ RequestMapping ( value = "//{ids}" , method = RequestMethod . DELETE ) @ ResponseBody public String deleteDevice ( HttpServletRequest request , @ PathVariable String ids ) { } }

Fix:
res [ 2 ] = "没有版本可以发布" ;
Buggy code:
public class TLVDecoderTest { @ Test public void testSimpleDecode ( ) throws Exception { } @ Test public void testMultiTags ( ) throws Exception { } @ Test public void testMultiTagsWithExpander ( ) throws Exception { } @ Test ( expected = TLVException . class ) public void testMultiTagsWithExpanderWithWrongExpanderLength ( ) throws Exception { } @ Test public void testExpandedTagWithMoreTagsAfter ( ) throws Exception { TLVDecoder dec = new TLVDecoder ( ) ; dec . addExpandTag ( Hex . hexToByteArray ( "9A" ) ) ; <START_BUG> List < TLV > decodedTags = dec . decode ( Hex . hexToByteArray ( "9A0E9F2602AABB9F2702CCDD5F200101" ) ) ; <END_BUG> Assert . assertEquals ( 3 , decodedTags . size ( ) ) ; } @ Test ( expected = TLVException . class ) public void testMultiTagsWithGarbageEnd ( ) throws Exception { } @ Test public void testNestedExpands ( ) throws Exception { } @ Test public void test5ByteLength ( ) throws Exception { } @ Test public void testMultiTag3ByteLength ( ) throws Exception { } @ Test ( expected = TLVException . class ) public void testInvalidTag ( ) throws Exception { } @ Test public void testExpandedTag ( ) throws Exception { } }

Fix:
List < TLV > decodedTags = dec . decode ( Hex . hexToByteArray ( "9A0A9F2602AABB9F2702AABB5F200101" ) ) ;
Buggy code:
public class MaxAccumulator implements Accumulator < Double > { private Double max = Double . NEGATIVE_INFINITY ; @ Override public synchronized void add ( final Double value ) { } @ Override public synchronized Double getResult ( ) { } @ Override public synchronized void reset ( ) { <START_BUG> max = Double . MIN_VALUE ; <END_BUG> } }

Fix:
max = Double . NEGATIVE_INFINITY ;
Buggy code:
public class WebResponse extends Response { private static final Log log = LogFactory . getLog ( WebResponse . class ) ; protected boolean redirect ; private final HttpServletResponse httpServletResponse ; private boolean ajax ; public WebResponse ( ) { } public WebResponse ( final HttpServletResponse httpServletResponse ) { } public void addCookie ( final Cookie cookie ) { } public void clearCookie ( final Cookie cookie ) { } public void close ( ) { } public CharSequence encodeURL ( CharSequence url ) { } public final HttpServletResponse getHttpServletResponse ( ) { } public OutputStream getOutputStream ( ) { } public final boolean isRedirect ( ) { } public void redirect ( String url ) { if ( ! ( redirect ) ) { if ( ( httpServletResponse ) != null ) { url = encodeURL ( url ) . toString ( ) ; try { if ( httpServletResponse . isCommitted ( ) ) { WebResponse . log . error ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>redirect<seq2seq4repair_space>to:<seq2seq4repair_space>" + url ) + ",<seq2seq4repair_space>HTTP<seq2seq4repair_space>Response<seq2seq4repair_space>has<seq2seq4repair_space>already<seq2seq4repair_space>been<seq2seq4repair_space>committed." ) ) ; } if ( WebResponse . log . isDebugEnabled ( ) ) { WebResponse . log . debug ( ( "Redirecting<seq2seq4repair_space>to<seq2seq4repair_space>" + url ) ) ; } if ( isAjax ( ) ) { httpServletResponse . addHeader ( "Ajax-Location" , url ) ; httpServletResponse . getWriter ( ) . write ( "<seq2seq4repair_space>" ) ; } else { httpServletResponse . sendRedirect ( url ) ; } redirect = true ; } catch ( IOException e ) { <START_BUG> throw new WicketRuntimeException ( "Redirect<seq2seq4repair_space>failed" , e ) ; <END_BUG> } } } else { WebResponse . log . info ( ( "Already<seq2seq4repair_space>redirecting<seq2seq4repair_space>to<seq2seq4repair_space>an<seq2seq4repair_space>url<seq2seq4repair_space>current<seq2seq4repair_space>one<seq2seq4repair_space>ignored:<seq2seq4repair_space>" + url ) ) ; } } public final void setContentType ( final String mimeType ) { } public void setContentLength ( long length ) { } public void setLastModifiedTime ( Time time ) { } public final void setLocale ( final Locale locale ) { } public void write ( final CharSequence string ) { } public void write ( AppendingStringBuffer asb ) { } public void setDateHeader ( String header , long date ) { } public void setHeader ( String header , String value ) { } public void setAttachmentHeader ( String filename ) { } public boolean isAjax ( ) { } public void setAjax ( boolean ajax ) { } }

Fix:
WebResponse . log . warn ( ( ( ( "redirect<seq2seq4repair_space>to<seq2seq4repair_space>" + url ) + "<seq2seq4repair_space>failed:<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) , e ) ;
Buggy code:
public abstract class PageableListView < T > extends ListView < T > implements IPageable { private static final long serialVersionUID = 1L ; private int currentPage ; private int rowsPerPage ; public PageableListView ( final String id , final IModel < List < T > > model , int rowsPerPage ) { } public PageableListView ( final String id , final List < T > list , final int rowsPerPage ) { } public final int getCurrentPage ( ) { } public final int getPageCount ( ) { } public final int getRowsPerPage ( ) { } public final void setRowsPerPage ( int rowsPerPage ) { } @ Override public int getViewSize ( ) { <START_BUG> if ( ( PageableListView . getModelObject ( ) ) != null ) { <END_BUG> super . setStartIndex ( ( ( getCurrentPage ( ) ) * ( getRowsPerPage ( ) ) ) ) ; super . setViewSize ( getRowsPerPage ( ) ) ; } return super . getViewSize ( ) ; } public final void setCurrentPage ( int currentPage ) { } @ Override public ListView < T > setStartIndex ( int startIndex ) throws UnsupportedOperationException { } @ Override public ListView < T > setViewSize ( int size ) throws UnsupportedOperationException { } private class CurrentPageChange extends Change { private static final long serialVersionUID = 1L ; private final int currentPage ; CurrentPageChange ( int currentPage ) { } @ Override public void undo ( ) { } @ Override public String toString ( ) { } } private class RowsPerPageChange extends Change { private static final long serialVersionUID = 1L ; private final int rowsPerPage ; RowsPerPageChange ( int rowsPerPage ) { } @ Override public void undo ( ) { } @ Override public String toString ( ) { } } }

Fix:
if ( ( PageableListView . getDefaultModelObject ( ) ) != null ) {
Buggy code:
public class ReferenceCountingEntityCache implements ReadyEntityCache { private final ConcurrentMap < Object , ReferenceCountingEntityCache . CacheEntry > cache = new ConcurrentHashMap < Object , ReferenceCountingEntityCache . CacheEntry > ( ) ; private final EntityBeanComponent component ; public ReferenceCountingEntityCache ( final EntityBeanComponent component ) { } public synchronized void create ( final EntityBeanComponentInstance instance ) { } private ReferenceCountingEntityCache . CacheEntry realCreate ( final EntityBeanComponentInstance instance ) { } @ Override public synchronized boolean contains ( final Object key ) { } @ Override public synchronized boolean containsNotRemoved ( final Object key ) { } public synchronized EntityBeanComponentInstance get ( final Object key ) throws NoSuchEntityException { } public synchronized void release ( final EntityBeanComponentInstance instance , boolean success ) { } public synchronized void discard ( final EntityBeanComponentInstance instance ) { } public void start ( ) { } public void stop ( ) { } private EntityBeanComponentInstance createInstance ( final Object pk ) { final EntityBeanComponentInstance instance = component . acquireUnAssociatedInstance ( ) ; <START_BUG> instance . associate ( pk ) ; <END_BUG> return instance ; } private class CacheEntry { private final AtomicInteger referenceCount = new AtomicInteger ( 0 ) ; private volatile EntityBeanComponentInstance instance ; private volatile EntityBeanComponentInstance replacedInstance ; private CacheEntry ( EntityBeanComponentInstance instance ) { } } }

Fix:
instance . activate ( pk ) ;
Buggy code:
public final class WebAsyncManager { private static final Object RESULT_NONE = new Object ( ) ; private static final Log logger = LogFactory . getLog ( WebAsyncManager . class ) ; private static final UrlPathHelper urlPathHelper = new UrlPathHelper ( ) ; private static final CallableProcessingInterceptor timeoutCallableInterceptor = new TimeoutCallableProcessingInterceptor ( ) ; private static final DeferredResultProcessingInterceptor timeoutDeferredResultInterceptor = new TimeoutDeferredResultProcessingInterceptor ( ) ; private AsyncWebRequest asyncWebRequest ; private AsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor ( this . getClass ( ) . getSimpleName ( ) ) ; private Object concurrentResult = WebAsyncManager . RESULT_NONE ; private Object [ ] concurrentResultContext ; private final Map < Object , CallableProcessingInterceptor > callableInterceptors = new LinkedHashMap < Object , CallableProcessingInterceptor > ( ) ; private final Map < Object , DeferredResultProcessingInterceptor > deferredResultInterceptors = new LinkedHashMap < Object , DeferredResultProcessingInterceptor > ( ) ; WebAsyncManager ( ) { } public void setAsyncWebRequest ( final AsyncWebRequest asyncWebRequest ) { } public void setTaskExecutor ( AsyncTaskExecutor taskExecutor ) { } public boolean isConcurrentHandlingStarted ( ) { } public boolean hasConcurrentResult ( ) { } public Object getConcurrentResult ( ) { } public Object [ ] getConcurrentResultContext ( ) { } public CallableProcessingInterceptor getCallableInterceptor ( Object key ) { } public DeferredResultProcessingInterceptor getDeferredResultInterceptor ( Object key ) { } public void registerCallableInterceptor ( Object key , CallableProcessingInterceptor interceptor ) { } public void registerCallableInterceptors ( CallableProcessingInterceptor ... interceptors ) { } public void registerDeferredResultInterceptor ( Object key , DeferredResultProcessingInterceptor interceptor ) { } public void registerDeferredResultInterceptors ( DeferredResultProcessingInterceptor ... interceptors ) { } public void clearConcurrentResult ( ) { } <START_BUG> @ SuppressWarnings ( { "unchecked" } ) <END_BUG> public void startCallableProcessing ( final Callable < ? > callable , Object ... processingContext ) throws Exception { Assert . notNull ( callable , "Callable<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; startCallableProcessing ( new WebAsyncTask ( callable ) , processingContext ) ; } public void startCallableProcessing ( final WebAsyncTask < ? > webAsyncTask , Object ... processingContext ) throws Exception { } private void setConcurrentResultAndDispatch ( Object result ) { } public void startDeferredResultProcessing ( final DeferredResult < ? > deferredResult , Object ... processingContext ) throws Exception { } private void startAsyncProcessing ( Object [ ] processingContext ) { } }

Fix:
@ SuppressWarnings ( { "unchecked" , "rawtypes" } )
Buggy code:
public class DB_Trigger { public static final String copyrightNotice = Copyright . SHORT_2004 ; public static void doTriggers ( Connection conn ) throws SQLException { Statement stmt = conn . createStatement ( ) ; ResultSet rs = stmt . executeQuery ( ( "SELECT<seq2seq4repair_space>TRIGGERNAME,<seq2seq4repair_space>SCHEMAID,<seq2seq4repair_space>" + ( ( "EVENT,<seq2seq4repair_space>FIRINGTIME,<seq2seq4repair_space>TYPE,<seq2seq4repair_space>TABLEID,<seq2seq4repair_space>REFERENCEDCOLUMNS,<seq2seq4repair_space>" + "TRIGGERDEFINITION,<seq2seq4repair_space>REFERENCINGOLD,<seq2seq4repair_space>REFERENCINGNEW,<seq2seq4repair_space>OLDREFERENCINGNAME,<seq2seq4repair_space>" ) + "NEWREFERENCINGNAME<seq2seq4repair_space>FROM<seq2seq4repair_space>SYS.SYSTRIGGERS<seq2seq4repair_space>WHERE<seq2seq4repair_space>STATE<seq2seq4repair_space>!=<seq2seq4repair_space>'D'" ) ) ) ; boolean firstTime = true ; while ( rs . next ( ) ) { String trigName = dblook . addQuotes ( dblook . expandDoubleQuotes ( rs . getString ( 1 ) ) ) ; String trigSchema = dblook . lookupSchemaId ( rs . getString ( 2 ) ) ; if ( dblook . isIgnorableSchema ( trigSchema ) ) continue ; trigName = ( trigSchema + "." ) + trigName ; String tableName = dblook . lookupTableId ( rs . getString ( 6 ) ) ; if ( ( ! ( dblook . stringContainsTargetTable ( rs . getString ( 8 ) ) ) ) && ( dblook . isExcludedTable ( tableName ) ) ) continue ; if ( firstTime ) { Logs . reportString ( "----------------------------------------------" ) ; <START_BUG> Logs . reportMessage ( "CSLOOK_Header" , "triggers" ) ; <END_BUG> Logs . reportString ( "----------------------------------------------\n" ) ; } String createTrigString = DB_Trigger . createTrigger ( trigName , tableName , rs ) ; Logs . writeToNewDDL ( createTrigString ) ; Logs . writeStmtEndToNewDDL ( ) ; Logs . writeNewlineToNewDDL ( ) ; firstTime = false ; } rs . close ( ) ; stmt . close ( ) ; } private static String createTrigger ( String trigName , String tableName , ResultSet aTrig ) throws SQLException { } }

Fix:
Logs . reportMessage ( "CSLOOK_TriggersHeader" ) ;
Buggy code:
public class MainGameLoop { private static Map GameMap ; public static void main ( String [ ] args ) { } enum MoveDir { Up , Down , Left , Right ; public static MainGameLoop . MoveDir get ( int i ) { } } private static void TurnLoop ( ) { } private boolean CombatLoop ( ) { } enum Dialog { Wellcome , Action , Move ; } private static Object Interact ( MainGameLoop . Dialog display ) { switch ( display ) { case Action : default : break ; case Move : while ( true ) { Console . Msg ( "Where<seq2seq4repair_space>do<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>go." , true ) ; String Response = Console . readLine ( ) . toLowerCase ( ) ; if ( ( Response . equals ( "up" ) ) || ( Response . equals ( "u" ) ) ) { return MainGameLoop . MoveDir . Up ; } else if ( ( Response . equals ( "down" ) ) || ( Response . equals ( "d" ) ) ) { return MainGameLoop . MoveDir . Down ; } else if ( ( Response . equals ( "left" ) ) || ( Response . equals ( "l" ) ) ) { return MainGameLoop . MoveDir . Left ; } else <START_BUG> if ( ( Response . equals ( "right" ) ) || ( Response . equals ( 'r' ) ) ) { <END_BUG> return MainGameLoop . MoveDir . Right ; } } case Wellcome : Console . Msg ( "Hello<seq2seq4repair_space>and<seq2seq4repair_space>welcome<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>Java<seq2seq4repair_space>Rpg," , true ) ; Console . Msg ( "also<seq2seq4repair_space>known<seq2seq4repair_space>as,<seq2seq4repair_space>The<seq2seq4repair_space>Tower<seq2seq4repair_space>Of<seq2seq4repair_space>Doom." , false ) ; Console . Msg ( "Created<seq2seq4repair_space>by<seq2seq4repair_space>Jesper<seq2seq4repair_space>Baunsgaard<seq2seq4repair_space>and<seq2seq4repair_space>Daniel<seq2seq4repair_space>Jensen" , false ) ; break ; } return "" ; } }

Fix:
if ( ( Response . equals ( "right" ) ) || ( Response . equals ( "r" ) ) ) {
Buggy code:
public abstract class State { protected final Game gameInstance ; private final String identifier ; private final Map < String , Entity > entities ; private final Property properties ; public State ( Game gameInstance , String identifier , String location ) { } public String getIdentifier ( ) { } public Entity getEntity ( String entityName ) { } public void addEntity ( Entity entity ) { } public void removeEntity ( String entityName ) { } public void render ( Graphics2D g2d ) { } public void addProperty ( String propertyName , String property ) { } public void save ( String location ) { } public void load ( ) { for ( int i = 0 ; i < ( properties . getPropertyAmount ( ) ) ; i ++ ) { String propName = properties . getKeyInLocation ( i ) ; <START_BUG> String [ ] nameSplit = propName . split ( "." ) ; <END_BUG> Entity e = getEntity ( nameSplit [ 1 ] ) ; String prop = properties . getProperty ( propName , e . save ( ) [ 1 ] ) ; if ( nameSplit [ 0 ] . equals ( Entity . getEntityType ( ) ) ) { e . setState ( prop ) ; } else if ( nameSplit [ 0 ] . equals ( EntitySprite . getEntityType ( ) ) ) { EntitySprite es = ( ( EntitySprite ) ( e ) ) ; es . setState ( prop ) ; } else if ( nameSplit [ 0 ] . equals ( EntityAnimation . getEntityType ( ) ) ) { EntityAnimation ea = ( ( EntityAnimation ) ( e ) ) ; ea . setState ( prop ) ; } } } public abstract void init ( ) { } public abstract void onEnter ( ) { } public abstract void update ( ) { } public abstract void onExit ( ) { } }

Fix:
String [ ] nameSplit = propName . split ( "<seq2seq4repair_space>" ) ;
Buggy code:
public class TestLucene3xStoredFieldsFormat extends BaseStoredFieldsFormatTestCase { @ Override public void setUp ( ) throws Exception { <START_BUG> LuceneTestCase . PREFLEX_IMPERSONATION_IS_ACTIVE = true ; <END_BUG> super . setUp ( ) ; } @ Override protected Codec getCodec ( ) { } @ Override public void testWriteReadMerge ( ) throws IOException { } }

Fix:
LuceneTestCase . OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true ;
Buggy code:
public class BiomorphCreator { private Random rand ; public BiomorphCreator ( ) { } public Biomorph createBiomorph ( ) { <START_BUG> rand = new Random ( ) ; <END_BUG> int branch = ( rand . nextInt ( 8 ) ) + 3 ; int branchIncrement = rand . nextInt ( 10 ) ; int chain = ( rand . nextInt ( 4 ) ) + 1 ; int red = rand . nextInt ( 256 ) ; int green = rand . nextInt ( 256 ) ; int blue = rand . nextInt ( 256 ) ; int length = ( rand . nextInt ( 8 ) ) + 1 ; int lengthIncrement = ( rand . nextInt ( 4 ) ) - 2 ; int thickness = ( rand . nextInt ( 10 ) ) + 1 ; int thicknessIncrement = ( rand . nextInt ( 10 ) ) + 1 ; Biomorph biomorph = new Biomorph ( branch , branchIncrement , chain , red , green , blue , length , lengthIncrement , thickness , thicknessIncrement ) ; return biomorph ; } public Biomorph createBiomorph ( int branch , int branchIncrement , int chain , int colorB , int colorG , int colorR , int length , int lengthIncrement , int thickness , int thicknessIncrement ) { } No newline ; at end ; of file ; }

Fix:
rand = new Random ( 10 ) ;
Buggy code:
public class DeclareSoft extends Declare { private TypePattern exception ; private Pointcut pointcut ; public DeclareSoft ( TypePattern exception , Pointcut pointcut ) { } public String toString ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public void write ( DataOutputStream s ) throws IOException { } public static Declare read ( DataInputStream s , ISourceContext context ) throws IOException { } public Pointcut getPointcut ( ) { } public TypePattern getException ( ) { } public void resolve ( IScope scope ) { exception = exception . resolveBindings ( scope , null , false , true ) ; TypeX excType = exception . getExactType ( ) ; if ( excType != ( ResolvedTypeX . MISSING ) ) { <START_BUG> if ( ! ( scope . getWorld ( ) . resolve ( TypeX . THROWABLE ) . isAssignableFrom ( excType ) ) ) { <END_BUG> scope . getWorld ( ) . showMessage ( ERROR , WeaverMessages . format ( NOT_THROWABLE , excType . getName ( ) ) , exception . getSourceLocation ( ) , null ) ; pointcut = Pointcut . makeMatchesNothing ( RESOLVED ) ; return ; } } pointcut = pointcut . resolve ( scope ) ; } public boolean isAdviceLike ( ) { } }

Fix:
if ( ! ( scope . getWorld ( ) . getCoreType ( THROWABLE ) . isAssignableFrom ( excType ) ) ) {
Buggy code:
public class BorlandGenerateClient extends Task { static final String JAVA_MODE = "java" ; static final String FORK_MODE = "fork" ; boolean debug = false ; File ejbjarfile = null ; File clientjarfile = null ; String mode = BorlandGenerateClient . JAVA_MODE ; Path classpath ; public void setClasspath ( Path classpath ) throws TaskException { } public void setClientjar ( File clientjar ) { } public void setDebug ( boolean debug ) { } public void setEjbjar ( File ejbfile ) { } public void setMode ( String s ) { } public Path createClasspath ( ) throws TaskException { } public void execute ( ) throws TaskException { } protected void executeFork ( ) throws TaskException { } private Commandline buildCommand ( ) { } protected void executeJava ( ) throws TaskException { try { getLogger ( ) . info ( "mode<seq2seq4repair_space>:<seq2seq4repair_space>java" ) ; org . apache . tools . ant . taskdefs . Java execTask = null ; execTask = null ; execTask . setDir ( new File ( "." ) ) ; execTask . setClassname ( "com.inprise.server.commandline.EJBUtilities" ) ; <START_BUG> execTask . setClasspath ( classpath . concatSystemClasspath ( ) ) ; <END_BUG> execTask . setFork ( true ) ; execTask . createArg ( ) . setValue ( "generateclient" ) ; if ( debug ) { execTask . createArg ( ) . setValue ( "-trace" ) ; } execTask . createArg ( ) . setValue ( "-short" ) ; execTask . createArg ( ) . setValue ( "-jarfile" ) ; execTask . createArg ( ) . setValue ( ejbjarfile . getAbsolutePath ( ) ) ; execTask . createArg ( ) . setValue ( "-single" ) ; execTask . createArg ( ) . setValue ( "-clientjarfile" ) ; execTask . createArg ( ) . setValue ( clientjarfile . getAbsolutePath ( ) ) ; getLogger ( ) . debug ( "Calling<seq2seq4repair_space>EJBUtilities" ) ; execTask . execute ( ) ; } catch ( Exception e ) { String msg = "Exception<seq2seq4repair_space>while<seq2seq4repair_space>calling<seq2seq4repair_space>generateclient<seq2seq4repair_space>Details:<seq2seq4repair_space>" + ( e . toString ( ) ) ; throw new TaskException ( msg , e ) ; } } }

Fix:
execTask . addClasspath ( classpath . concatSystemClasspath ( ) ) ;
Buggy code:
public class EffectGainHealth extends Effect { public final HeroStronghold aPlugin ; public EffectGainHealth ( HeroStronghold plugin ) { } @ Override public void init ( HeroStronghold plugin ) { } public class IntruderListener extends CustomEventListener { private final EffectGainHealth effect ; public IntruderListener ( EffectGainHealth effect ) { } @ Override public void onCustomEvent ( Event event ) { if ( ! ( event instanceof PlayerInRegionEvent ) ) return ; PlayerInRegionEvent pIREvent = ( ( PlayerInRegionEvent ) ( event ) ) ; Player player = pIREvent . getPlayer ( ) ; Hero hero = null ; Heroes heroes = effect . aPlugin . getHeroes ( ) ; if ( heroes != null ) hero = heroes . getHeroManager ( ) . getHero ( player ) ; if ( hero == null ) { if ( ( player . getHealth ( ) ) == 20 ) return ; } else if ( ( hero . getHealth ( ) ) == ( hero . getMaxHealth ( ) ) ) return ; int addHealth = effect . regionHasEffect ( pIREvent . getEffects ( ) , "gainhealth" ) ; if ( addHealth == 0 ) return ; Location l = pIREvent . getRegionLocation ( ) ; RegionManager rm = effect . getPlugin ( ) . getRegionManager ( ) ; Region r = rm . getRegion ( l ) ; RegionType rt = rm . getRegionType ( r . getType ( ) ) ; if ( ( ( ! ( effect . isOwnerOfRegion ( player , l ) ) ) && ( ! ( effect . isMemberOfRegion ( player , l ) ) ) ) && ( hero == null ) ) { return ; } else <START_BUG> if ( ! ( rt . containsFriendlyClass ( hero . getHeroClass ( ) . getName ( ) ) ) ) { <END_BUG> return ; } if ( ! ( effect . hasReagents ( l ) ) ) return ; effect . forceUpkeep ( l ) ; if ( hero == null ) { if ( ( ( player . getHealth ( ) ) + addHealth ) <= 20 ) { player . setHealth ( ( ( player . getHealth ( ) ) + addHealth ) ) ; } else { player . setHealth ( 20 ) ; } } else if ( ( ( hero . getHealth ( ) ) + addHealth ) <= ( hero . getMaxHealth ( ) ) ) { hero . setHealth ( ( ( hero . getHealth ( ) ) + addHealth ) ) ; } else { hero . setHealth ( hero . getMaxHealth ( ) ) ; } } } }

Fix:
if ( ( hero != null ) && ( ! ( rt . containsFriendlyClass ( hero . getHeroClass ( ) . getName ( ) ) ) ) ) {
Buggy code:
public class JavaCorePreferenceModifyListener extends PreferenceModifyListener { static int PREFIX_LENGTH = JavaModelManager . CP_CONTAINER_PREFERENCES_PREFIX . length ( ) ; JavaModel javaModel = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) ; public IEclipsePreferences preApply ( IEclipsePreferences node ) { } void cleanJavaCore ( Preferences preferences ) { } boolean isJavaProjectAccessible ( String propertyName ) { int index = propertyName . indexOf ( '|' , JavaCorePreferenceModifyListener . PREFIX_LENGTH ) ; if ( index > 0 ) { final String projectName = propertyName . substring ( JavaCorePreferenceModifyListener . PREFIX_LENGTH , index ) . trim ( ) ; <START_BUG> JavaProject project = ( ( JavaProject ) ( javaModel . getJavaProject ( projectName ) ) ) ; <END_BUG> if ( project . getProject ( ) . isAccessible ( ) ) { return true ; } } return false ; } }

Fix:
JavaProject project = ( ( JavaProject ) ( this . javaModel . getJavaProject ( projectName ) ) ) ;