nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class MeteoSlidingAdapter extends BaseAdapter { private Context mContext ; private ArrayList < NavDrawerItem > mNavDrawerItems ; private LayoutInflater mInflater ; public MeteoSlidingAdapter ( Context _context , ArrayList < NavDrawerItem > _navDrawerItems ) { } @ Override public final int getCount ( ) { } @ Override public final NavDrawerItem getItem ( int position ) { } @ Override public final long getItemId ( int position ) { } @ Override public final View getView ( int _pos , View convertView , ViewGroup parent ) { if ( convertView == null ) { <START_BUG> convertView = mInflater . inflate ( drawer_list_item , null ) ; <END_BUG> } ImageView imgIcon = ( ( ImageView ) ( convertView . findViewById ( icon ) ) ) ; TextView txtTitle = ( ( TextView ) ( convertView . findViewById ( title ) ) ) ; imgIcon . setImageResource ( mNavDrawerItems . get ( _pos ) . getIcon ( ) ) ; txtTitle . setText ( mNavDrawerItems . get ( _pos ) . getTitle ( ) ) ; return convertView ; } }

Fix:
convertView = mInflater . inflate ( item_drawer_list , null ) ;
Buggy code:
class AccessAuthorizationProviderWriteAttributeHander extends AbstractWriteAttributeHandler < Void > { private final DelegatingConfigurableAuthorizer configurableAuthorizer ; private final RoleMapper rbacRoleMapper ; AccessAuthorizationProviderWriteAttributeHander ( DelegatingConfigurableAuthorizer configurableAuthorizer , RoleMapper rbacRoleMapper ) { } @ Override protected void finishModelStage ( OperationContext context , ModelNode operation , String attributeName , ModelNode newValue , ModelNode oldValue , Resource model ) throws OperationFailedException { <START_BUG> Provider provider = Provider . valueOf ( newValue . asString ( ) ) ; <END_BUG> if ( provider == ( Provider . RBAC ) ) { RbacSanityCheckOperation . registerOperation ( context ) ; } } @ Override protected boolean requiresRuntime ( OperationContext context ) { } @ Override protected boolean applyUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode resolvedValue , ModelNode currentValue , AbstractWriteAttributeHandler . HandbackHolder < Void > handbackHolder ) throws OperationFailedException { } @ Override protected void revertUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode valueToRestore , ModelNode valueToRevert , Void handback ) throws OperationFailedException { } private void updateAuthorizer ( final ModelNode value ) { } private ConfigurableAuthorizer getSimpleAuthorizer ( ) { } private ConfigurableAuthorizer getRoleBasedAuthorizer ( ) { } }

Fix:
Provider provider = Provider . valueOf ( newValue . asString ( ) . toUpperCase ( Locale . ENGLISH ) ) ;
Buggy code:
public class DeploymentDiagramRenderer implements GraphEdgeRenderer , GraphNodeRenderer { protected static Category cat = Category . getInstance ( DeploymentDiagramRenderer . class ) ; public FigNode getFigNodeFor ( GraphModel gm , Layer lay , Object node ) { if ( node instanceof MNode ) return new FigMNode ( gm , node ) ; else if ( node instanceof MNodeInstance ) return new FigMNodeInstance ( gm , node ) ; else if ( node instanceof MComponent ) return new FigComponent ( gm , node ) ; else if ( node instanceof MComponentInstance ) return new FigComponentInstance ( gm , node ) ; else if ( node instanceof MClass ) return new FigClass ( gm , node ) ; else if ( node instanceof MInterface ) return new FigInterface ( gm , node ) ; else if ( node instanceof MObject ) return new FigObject ( gm , node ) ; <START_BUG> DeploymentDiagramRenderer . cat . debug ( "needs-more-work<seq2seq4repair_space>DeploymentDiagramRenderer<seq2seq4repair_space>getFigNodeFor" ) ; <END_BUG> return null ; } public FigEdge getFigEdgeFor ( GraphModel gm , Layer lay , Object edge ) { } static final long serialVersionUID = 8002278834226522224L ; }

Fix:
DeploymentDiagramRenderer . cat . debug ( "TODO<seq2seq4repair_space>DeploymentDiagramRenderer<seq2seq4repair_space>getFigNodeFor" ) ;
Buggy code:
public class SmartRemote { private final int PORT = 55000 ; private final int SO_TIMEOUT = 3 * 1000 ; private final int SO_AUTHENTICATE_TIMEOUT = 600 * 1000 ; private final String APP_STRING = "iphone.iapp.samsung" ; private final char [ ] ALLOWED = new char [ ] { 100 , 0 , 1 , 0 } ; private final char [ ] DENIED = new char [ ] { 100 , 0 , 0 , 0 } ; private final char [ ] TIMEOUT = new char [ ] { 101 , 0 } ; private final Socket socket ; private final BufferedWriter out ; private final BufferedReader in ; private final boolean debug ; private final ArrayList < String > log ; public SmartRemote ( String host ) throws IOException { } public SmartRemote ( String host , boolean debug ) throws IOException { } public TVReply authenticate ( String name ) throws IOException { } public void keycode ( Keycode keycode ) throws IOException { } public void keycode ( String keycode ) throws IOException { } public void keycodeAsync ( Keycode keycode ) throws IOException { } public void keycodeAsync ( String keycode ) throws IOException { } public void checkConnection ( ) throws IOException { <START_BUG> keycode ( "" ) ; <END_BUG> } private String getAuthenticationPayload ( String ip , String id , String name ) throws IOException { } private String getKeycodePayload ( String keycode ) throws IOException { } private char [ ] readRelevantMessage ( Reader reader ) throws IOException { } private char [ ] readMessage ( Reader reader ) throws IOException { } private String readable ( char [ ] charArray ) { } private void writeString ( Writer writer , String string ) throws IOException { } private void writeBase64 ( Writer writer , String string ) throws IOException { } private String readString ( Reader reader ) throws IOException { } private char [ ] readCharArray ( Reader reader ) throws IOException { } private void emptyReaderBuffer ( Reader reader ) throws IOException { } public String [ ] getLog ( ) { } private void log ( String message ) { } public void close ( ) { } }

Fix:
keycode ( "PING" ) ;
Buggy code:
public class PerspectiveRegistry implements IExtensionChangeHandler , IPerspectiveRegistry { private String defaultPerspID ; private static final String EXT = "_persp.xml" ; private static final String ID_DEF_PERSP = "PerspectiveRegistry.DEFAULT_PERSP" ; private static final String PERSP = "_persp" ; private static final char SPACE_DELIMITER = '<seq2seq4repair_space>' ; private List perspectives = new ArrayList ( 10 ) ; private ArrayList perspToRemove = new ArrayList ( 5 ) ; private IPropertyChangeListener preferenceListener ; public PerspectiveRegistry ( ) { } private void initializePreferenceChangeListener ( ) { } public void addPerspective ( PerspectiveDescriptor desc ) { } private void add ( PerspectiveDescriptor desc ) { } public PerspectiveDescriptor createPerspective ( String label , PerspectiveDescriptor originalDescriptor ) { } public void revertPerspectives ( ArrayList perspToRevert ) { } public void deletePerspectives ( ArrayList perspToDelete ) { } public void deletePerspective ( IPerspectiveDescriptor in ) { } private void internalDeletePerspective ( PerspectiveDescriptor desc ) { } void deleteCustomDefinition ( PerspectiveDescriptor desc ) { } boolean hasCustomDefinition ( PerspectiveDescriptor desc ) { } public IPerspectiveDescriptor findPerspectiveWithId ( String id ) { } public IPerspectiveDescriptor findPerspectiveWithLabel ( String label ) { } public String getDefaultPerspective ( ) { } public IPerspectiveDescriptor [ ] getPerspectives ( ) { } public void load ( ) { } private void loadCustom ( ) { } private void unableToLoadPerspective ( IStatus status ) { <START_BUG> String msg = WorkbenchMessages . Perspective_errorLoadingState ; <END_BUG> if ( status == null ) { IStatus errStatus = new Status ( IStatus . ERROR , WorkbenchPlugin . PI_WORKBENCH , msg ) ; StatusManager . getManager ( ) . handle ( errStatus , ( ( StatusManager . SHOW ) | ( StatusManager . LOG ) ) ) ; } else { IStatus errStatus = StatusUtil . newStatus ( status , msg ) ; StatusManager . getManager ( ) . handle ( errStatus , ( ( StatusManager . SHOW ) | ( StatusManager . LOG ) ) ) ; } } public void saveCustomPersp ( PerspectiveDescriptor desc , XMLMemento memento ) throws IOException { } public IMemento getCustomPersp ( String id ) throws IOException , WorkbenchException { } private void loadPredefined ( ) { } public void setDefaultPerspective ( String id ) { } public boolean validateLabel ( String label ) { } private void verifyDefaultPerspective ( ) { } public IPerspectiveDescriptor clonePerspective ( String id , String label , IPerspectiveDescriptor originalDescriptor ) { } public void revertPerspective ( IPerspectiveDescriptor perspToRevert ) { } public void dispose ( ) { } public void removeExtension ( IExtension source , Object [ ] objects ) { } public void addExtension ( IExtensionTracker tracker , IExtension addedExtension ) { } }

Fix:
String msg = "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>perspective." ;
Buggy code:
public class TabFolder extends Composite { TabItem [ ] items ; ImageList imageList ; static final int TabFolderProc ; static final TCHAR TabFolderClass = new TCHAR ( 0 , OS . WC_TABCONTROL , true ) ; static final char [ ] TAB = new char [ ] { 'T' , 'A' , 'B' , 0 } ; static final int ID_UPDOWN = 1 ; public TabFolder ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createItem ( TabItem item , int index ) { } void createHandle ( ) { } void createWidget ( ) { } void destroyItem ( TabItem item ) { } void drawThemeBackground ( int hDC , RECT rect ) { } Control findThemeControl ( ) { } public Rectangle getClientArea ( ) { } public TabItem getItem ( int index ) { } public int getItemCount ( ) { } public TabItem [ ] getItems ( ) { } public TabItem [ ] getSelection ( ) { } public int getSelectionIndex ( ) { } int imageIndex ( Image image ) { if ( image == null ) return OS . I_IMAGENONE ; if ( ( imageList ) == null ) { Rectangle bounds = image . getBounds ( ) ; <START_BUG> imageList = display . getImageList ( bounds . width , bounds . height ) ; <END_BUG> int hImageList = imageList . getHandle ( ) ; OS . SendMessage ( handle , TCM_SETIMAGELIST , 0 , hImageList ) ; } int index = imageList . indexOf ( image ) ; if ( index == ( - 1 ) ) { index = imageList . add ( image ) ; } else { imageList . put ( index , image ) ; } return index ; } public int indexOf ( TabItem item ) { } Point minimumSize ( int wHint , int hHint , boolean flushCache ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setSelection ( TabItem [ ] items ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify ) { } String toolTipText ( NMTTDISPINFO hdr ) { } boolean traversePage ( boolean next ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_GETDLGCODE ( int wParam , int lParam ) { } LRESULT WM_NCHITTEST ( int wParam , int lParam ) { } LRESULT WM_NOTIFY ( int wParam , int lParam ) { } LRESULT WM_PARENTNOTIFY ( int wParam , int lParam ) { } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT WM_WINDOWPOSCHANGING ( int wParam , int lParam ) { } LRESULT wmNotifyChild ( int wParam , int lParam ) { } }

Fix:
imageList = display . getImageList ( ( ( style ) & ( SWT . RIGHT_TO_LEFT ) ) , bounds . width , bounds . height ) ;
Buggy code:
public abstract class InternalSearchPattern { IJavaElement focus ; int kind ; boolean mustResolve = true ; void acceptMatch ( String documentName , SearchPattern pattern , IndexQueryRequestor requestor , SearchParticipant participant , IJavaSearchScope scope ) { String documentPath = Index . convertPath ( documentName ) ; if ( scope instanceof JavaSearchScope ) { JavaSearchScope javaSearchScope = ( ( JavaSearchScope ) ( scope ) ) ; AccessRestriction access = javaSearchScope . getAccessRestriction ( documentPath ) ; <START_BUG> if ( ( UNINIT_RESTRICTION ) != access ) { <END_BUG> if ( ! ( requestor . acceptIndexMatch ( documentPath , pattern , participant , access ) ) ) throw new OperationCanceledException ( ) ; } } else if ( scope . encloses ( documentPath ) ) { if ( ! ( requestor . acceptIndexMatch ( documentPath , pattern , participant , null ) ) ) throw new OperationCanceledException ( ) ; } } SearchPattern currentPattern ( ) { } void findIndexMatches ( Index index , IndexQueryRequestor requestor , SearchParticipant participant , IJavaSearchScope scope , IProgressMonitor monitor ) throws IOException { } boolean isPolymorphicSearch ( ) { } EntryResult [ ] queryIn ( Index index ) throws IOException { } }

Fix:
if ( ( NOT_INITIALIZED_RESTRICTION ) != access ) {
Buggy code:
public final class MongoOperation extends AbstractCustomizableDatabaseOperation < MongoDbConnectionCallback , Mongo > { private static Logger LOGGER = LoggerFactory . getLogger ( MongoOptions . class ) ; private Mongo mongo ; private MongoDbConfiguration mongoDbConfiguration ; protected MongoOperation ( Mongo mongo , MongoDbConfiguration mongoDbConfiguration ) { } public MongoOperation ( MongoDbConfiguration mongoDbConfiguration ) { } @ Override public void insert ( InputStream contentStream ) { } private void insertData ( InputStream contentStream ) { } @ Override public void deleteAll ( ) { } private void deleteAllElements ( DB mongoDb ) { } private boolean isNotASystemCollection ( String collectionName ) { <START_BUG> return ! ( collectionName . startsWith ( "system" ) ) ; <END_BUG> } @ Override public boolean databaseIs ( InputStream contentStream ) { } private boolean compareData ( InputStream contentStream ) throws NoSqlAssertionError { } private DB getMongoDb ( ) { } @ Override public Mongo connectionManager ( ) { } }

Fix:
return ! ( collectionName . startsWith ( "system." ) ) ;
Buggy code:
public class UnboundedQueueThreadPoolMetricsHandler extends ThreadPoolMetricsHandler { public static final List < AttributeDefinition > METRICS = Arrays . asList ( ACTIVE_COUNT , COMPLETED_TASK_COUNT , CURRENT_THREAD_COUNT , LARGEST_THREAD_COUNT , REJECTED_COUNT , TASK_COUNT , QUEUE_SIZE ) ; public UnboundedQueueThreadPoolMetricsHandler ( final ServiceName serviceNameBase ) { } @ Override protected void setResult ( OperationContext context , final String attributeName , final Service < ? > service ) throws OperationFailedException { final UnboundedQueueThreadPoolService pool = ( ( UnboundedQueueThreadPoolService ) ( service ) ) ; if ( attributeName . equals ( CommonAttributes . ACTIVE_COUNT ) ) { context . getResult ( ) . set ( pool . getActiveCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . COMPLETED_TASK_COUNT ) ) { context . getResult ( ) . set ( pool . getCompletedTaskCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . CURRENT_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getCurrentThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . LARGEST_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getLargestThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . REJECTED_COUNT ) ) { context . getResult ( ) . set ( pool . getRejectedCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . TASK_COUNT ) ) { context . getResult ( ) . set ( pool . getTaskCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . QUEUE_SIZE ) ) { context . getResult ( ) . set ( pool . getQueueSize ( ) ) ; } else { <START_BUG> throw ROOT_LOGGER . unsupportedUnboundedQueueThreadPoolMetric ( attributeName ) ; <END_BUG> } } }

Fix:
throw MESSAGES . unsupportedUnboundedQueueThreadPoolMetric ( attributeName ) ;
Buggy code:
public class ZipTest extends BuildFileTest { ZipFile zfPrefixAddsDir = null ; public ZipTest ( String name ) { } public void setUp ( ) { } public void test1 ( ) { } public void test2 ( ) { } public void test3 ( ) { } public void tearDown ( ) { } public void test5 ( ) { } public void test6 ( ) { } public void test7 ( ) { } public void test8 ( ) { } public void testZipgroupfileset ( ) throws IOException { } public void testUpdateNotNecessary ( ) { } public void testUpdateIsNecessary ( ) { } public void testPrefixAddsDir ( ) throws IOException { } public void testFilesOnlyDoesntCauseRecreate ( ) throws InterruptedException { executeTarget ( "testFilesOnlyDoesntCauseRecreateSetup" ) ; long l = getProject ( ) . resolveFile ( "test3.zip" ) . lastModified ( ) ; <START_BUG> Thread . currentThread ( ) . sleep ( 3000 ) ; <END_BUG> executeTarget ( "testFilesOnlyDoesntCauseRecreate" ) ; assertEquals ( l , getProject ( ) . resolveFile ( "test3.zip" ) . lastModified ( ) ) ; } public void testEmptySkip ( ) { } public void testZipEmptyDir ( ) { } }

Fix:
Thread . sleep ( 3000 ) ;
Buggy code:
public final class DlvDebugProcess extends DebugProcessImpl < RemoteVmConnection > implements Disposable { public static final boolean IS_DLV_DISABLED = ( SystemInfo . isWindows ) || ( ! ( AMD64 . equals ( GoUtil . systemArch ( ) ) ) ) ; static final Logger LOG = Logger . getInstance ( DlvDebugProcess . class ) ; private final AtomicBoolean breakpointsInitiated = new AtomicBoolean ( ) ; private final AtomicBoolean connectedListenerAdded = new AtomicBoolean ( ) ; private static final Consumer < Throwable > THROWABLE_CONSUMER ; @ NotNull private final Consumer < DebuggerState > myStateConsumer ; @ NotNull private < T > Promise < T > send ( @ NotNull DlvRequest < T > request ) { } @ NotNull static < T > Promise < T > send ( @ NotNull DlvRequest < T > request , @ NotNull DlvCommandProcessor processor ) { } @ NotNull private DlvCommandProcessor getProcessor ( ) { } public DlvDebugProcess ( @ NotNull XDebugSession session , @ NotNull RemoteVmConnection connection , @ Nullable ExecutionResult er ) { } @ NotNull @ Override protected XBreakpointHandler < ? > [ ] createBreakpointHandlers ( ) { } @ NotNull @ Override public ExecutionConsole createConsole ( ) { } @ Override protected boolean isVmStepOutCorrect ( ) { } @ Override public void dispose ( ) { } @ Override public boolean checkCanInitBreakpoints ( ) { } private boolean initBreakpointHandlersAndSetBreakpoints ( boolean setBreakpoints ) { } private void doSetBreakpoints ( ) { } private void command ( @ NotNull @ MagicConstant ( stringValues = { NEXT , CONTINUE , HALT , SWITCH_THREAD , STEP } ) String name ) { } @ Override protected void continueVm ( @ NotNull StepAction stepAction ) { } @ NotNull @ Override public List < Location > getLocationsForBreakpoint ( @ NotNull <START_BUG> XLineBreakpoint < ? > breakpoint , boolean b ) { <END_BUG> return Collections . emptyList ( ) ; } @ Override public void runToPosition ( @ NotNull XSourcePosition position ) { } @ Override public void stop ( ) { } private static class MyEditorsProvider extends XDebuggerEditorsProviderBase { @ NotNull @ Override public FileType getFileType ( ) { } @ Override protected PsiFile createExpressionCodeFragment ( @ NotNull Project project , @ NotNull String text , @ Nullable PsiElement context , boolean isPhysical ) { } } private static final Key < Integer > ID = Key . create ( "DLV_BP_ID" ) ; private final Map < Integer , XBreakpoint < DlvBreakpointProperties > > breakpoints = ContainerUtil . newConcurrentMap ( ) ; private class MyBreakpointHandler extends XBreakpointHandler < XLineBreakpoint < DlvBreakpointProperties > > { public MyBreakpointHandler ( ) { } @ Override public void registerBreakpoint ( @ NotNull final XLineBreakpoint < DlvBreakpointProperties > breakpoint ) { } @ Override public void unregisterBreakpoint ( @ NotNull XLineBreakpoint < DlvBreakpointProperties > breakpoint , boolean temporary ) { } } No newline ; at end ; of file ; }

Fix:
XLineBreakpoint < ? > breakpoint ) {
Buggy code:
public class CCFile extends File { private boolean checkedout ; private boolean versioned ; private boolean described ; public CCFile ( String parent , String child ) { } public CCFile ( File parent , String child ) { } public CCFile ( String pathname ) { } public boolean isCheckedOut ( ) { } public boolean isVersioned ( ) { } public boolean isCheckedIn ( ) { } public void refresh ( ) { <START_BUG> String [ ] args = new String [ ] { "describe" , "-fmt" , "%m<seq2seq4repair_space>%o" , getAbsolutePath ( ) } ; <END_BUG> CmdResult res = CCUtils . cleartool ( args ) ; if ( ( res . getStatus ( ) ) != 0 ) { throw new org . apache . tools . ant . BuildException ( res . getStdErr ( ) ) ; } String stdout = res . getStdout ( ) ; versioned = ( stdout . indexOf ( "view<seq2seq4repair_space>private<seq2seq4repair_space>object" ) ) == ( - 1 ) ; checkedout = ( stdout . indexOf ( "checkout" ) ) != ( - 1 ) ; } }

Fix:
String [ ] args = new String [ ] { "describe" , "-fmt" , "\"%m<seq2seq4repair_space>%o\"" , getAbsolutePath ( ) } ;
Buggy code:
public interface ContainerEventHandlerAdapterBuilder { <START_BUG> ServiceBuilder < ? > build ( ServiceTarget target , String connector , int statusInterval ) ; <END_BUG> }

Fix:
ServiceBuilder < ? > build ( ServiceTarget target , String connector ) ;
Buggy code:
public class HeadlessSimulationLoader { private static void configureHeadLessSimulation ( ) { } public static void preloadGAMA ( ) { } public static synchronized IModel loadModel ( final File myFile ) { String fileName = myFile . getAbsolutePath ( ) ; Logger . getLogger ( HeadlessSimulationLoader . class . getName ( ) ) . finer ( ( fileName + "<seq2seq4repair_space>Model<seq2seq4repair_space>is<seq2seq4repair_space>loading..." ) ) ; try { List < GamlCompilationError > errors = new ArrayList ( ) ; <START_BUG> IModel model = GAML . getModelFactory ( ) . compile ( URI . createURI ( ( "file://////" + fileName ) , false ) , errors ) ; <END_BUG> if ( model == null ) { System . err . println ( ( "GAMA<seq2seq4repair_space>cannot<seq2seq4repair_space>build<seq2seq4repair_space>model<seq2seq4repair_space>" + fileName ) ) ; for ( GamlCompilationError d : errors ) { System . err . println ( ( ">><seq2seq4repair_space>Error<seq2seq4repair_space>" + ( d . toString ( ) ) ) ) ; } } Logger . getLogger ( HeadlessSimulationLoader . class . getName ( ) ) . finer ( "Experiment<seq2seq4repair_space>created<seq2seq4repair_space>" ) ; return model ; } catch ( Exception e1 ) { throw new RuntimeException ( e1 ) ; } } }

Fix:
IModel model = GAML . getModelFactory ( ) . compile ( URI . createURI ( ( "file:////" + fileName ) , false ) , errors ) ;
Buggy code:
public class LoginController extends Controller implements ILoginController , Observer { private IMessageView messageView ; private IAction loginAction ; private IMasterManager master ; public LoginController ( ILoginView view , IMessageView messageView ) { } public ILoginView getLoginView ( ) { } public IMessageView getMessageView ( ) { } public void setLoginAction ( IAction value ) { } public IAction getLoginAction ( ) { } @ Override public void start ( ) { } @ Override public void signIn ( ) { } @ Override public void register ( ) { } private boolean isAscii ( String word ) { <START_BUG> return word . matches ( "[a-zA-Z0-9]+" ) ; <END_BUG> } @ Override public void update ( Observable o , Object arg ) { } }

Fix:
return word . matches ( "[a-zA-Z0-9<,>.?//:;\"\'\\!@#$%^&*()_~`]+" ) ;
Buggy code:
<START_BUG> public class Enderman extends LivingEntity { <END_BUG> public Enderman ( ) { } @ Override public boolean canSpawn ( Block b ) { if ( ! ( super . canSpawn ( b ) ) ) { return false ; } for ( int y = 0 ; y < 3 ; y ++ ) { Block testBlock = b . getWorld ( ) . getBlockAt ( b . getX ( ) , ( ( b . getY ( ) ) + y ) , b . getZ ( ) ) ; if ( ( testBlock . getType ( ) ) != ( Material . AIR ) ) { return false ; } } return true ; } }

Fix:
public class Enderman extends Monster {
Buggy code:
public final class Locator { private static final int NIBBLE = 4 ; private static final int NIBBLE_MASK = 15 ; private static final int ASCII_SIZE = 128 ; private static final int BYTE_SIZE = 256 ; private static final int WORD = 16 ; private static final int SPACE = 32 ; private static final int DEL = 127 ; public static final String URI_ENCODING = "UTF-8" ; private static boolean [ ] gNeedEscaping = new boolean [ Locator . ASCII_SIZE ] ; private static char [ ] gAfterEscaping1 = new char [ Locator . ASCII_SIZE ] ; private static char [ ] gAfterEscaping2 = new char [ Locator . ASCII_SIZE ] ; private static char [ ] gHexChs = new char [ ] { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' } ; public static final String ERROR_NOT_FILE_URI = "Can<seq2seq4repair_space>only<seq2seq4repair_space>handle<seq2seq4repair_space>valid<seq2seq4repair_space>file:<seq2seq4repair_space>URIs,<seq2seq4repair_space>not<seq2seq4repair_space>" ; private Locator ( ) { } public static File getClassSource ( Class < ? > c ) { } public static File getResourceSource ( ClassLoader c , String resource ) { } public static String fromURI ( String uri ) { } private static String fromURIJava13 ( String uri ) { } public static String fromJarURI ( String uri ) { } public static String decodeUri ( String uri ) throws UnsupportedEncodingException { } public static String encodeURI ( String path ) throws UnsupportedEncodingException { } @ Deprecated public static URL fileToURL ( File file ) throws MalformedURLException { <START_BUG> return new URL ( file . getAbsoluteFile ( ) . toURI ( ) . toASCIIString ( ) ) ; <END_BUG> } public static File getToolsJar ( ) { } public static URL [ ] getLocationURLs ( File location ) throws MalformedURLException { } public static URL [ ] getLocationURLs ( File location , final String [ ] extensions ) throws MalformedURLException { } }

Fix:
return new URL ( file . toURI ( ) . toASCIIString ( ) ) ;
Buggy code:
public class DefaultSessionListener implements SessionListener { private Map < Object , Session > sessions = new HashMap < Object , Session > ( ) ; protected DefaultSessionListener ( ) { } public Session getCommunicationSession ( Object userObject ) { } protected final void addCommunicationSession ( Session session , Object userObject ) { } protected final boolean removeCommunicationSession ( Session session ) { Object userObject = session . getUserObject ( ) ; session . setUserObject ( null ) ; <START_BUG> return sessions . remove ( userObject , session ) ; <END_BUG> } public void sessionCreated ( TransportProvider p , Session session ) { } public void sessionTerminated ( TransportProvider p , Session session ) { } public void sessionFailedToOpen ( TransportProvider p , Throwable t ) { } public void connectionLost ( TransportProvider p , Session session ) { } public void sessionStale ( TransportProvider p , Session session ) { } public void sessionRecovered ( TransportProvider p , Session session ) { } public void stateChangeComplete ( TransportProvider p , Session session ) { } }

Fix:
return sessions . remove ( userObject ) ;
Buggy code:
public class RTypeInstruction implements IInstruction { private int rs ; private int rd ; private String opcode ; private int funct ; private int rt ; private int shamt ; public RTypeInstruction ( ) { } public RTypeInstruction ( String opc , int rd , int rs , int rt , int shamt , int funct ) { } public int getFUNCT ( ) { } public void setFUNCT ( int aFUNCT ) { } public int getImmediate ( ) { } public void setImmediate ( int aImmediate ) { } public String getOpcode ( ) { } public void setOpcode ( String aOpcode ) { } public int getRD ( ) { } public void setRD ( int aRD ) { } public int getRS ( ) { } public void setRS ( int aRS ) { } public int getRT ( ) { } public void setRT ( int aRT ) { } public int getSHAMT ( ) { } public void setSHAMT ( int aSHAMT ) { } public InstructionType getType ( ) { } public int getJumpdest ( ) { } public void setJumpdest ( int aJumpdest ) { } public String toString ( ) { String message = ( ( ( ( ( ( ( ( ( ( ( "" + ( opcode ) ) + ",<seq2seq4repair_space>" ) + ( rd ) ) + ",<seq2seq4repair_space>" ) + ( rs ) ) + ",<seq2seq4repair_space>" ) + ( rt ) ) + ",<seq2seq4repair_space>" ) + ( shamt ) ) + ",<seq2seq4repair_space>" ) + ( funct ) ) + "\n" ; message = ( ( ( ( ( ( ( opcode ) + "<seq2seq4repair_space>" ) + ( rd ) ) + ",<seq2seq4repair_space>" ) + ( rs ) ) + ",<seq2seq4repair_space>" ) + ( rt ) ) + "\n" ; switch ( opcode . toLowerCase ( ) ) { case "jr" : message = ( ( ( opcode ) + "<seq2seq4repair_space>" ) + ( rs ) ) + "\n" ; break ; case "mul" : break ; case "add" : break ; case "sub" : break ; case "sll" : message = ( ( ( ( ( ( ( opcode ) + "<seq2seq4repair_space>" ) + ( rd ) ) + ",<seq2seq4repair_space>" ) + ( rs ) ) + ",<seq2seq4repair_space>" ) + ( shamt ) ) + "\n" ; break ; case "srl" : message = ( ( ( ( ( ( ( opcode ) + "<seq2seq4repair_space>" ) + ( rd ) ) + ",<seq2seq4repair_space>" ) + ( rs ) ) + ",<seq2seq4repair_space>" ) + ( shamt ) ) + "\n" ; break ; case "nop" : <START_BUG> message = "NO-OP" ; <END_BUG> break ; case "and" : break ; case "or" : break ; case "slt" : break ; case "sltu" : break ; case "nor" : break ; case "div" : break ; default : break ; } return message ; } No newline ; at end ; of file ; }

Fix:
message = "NOP\n" ;
Buggy code:
public class ServerGroupDeploymentStartStopUpdate extends AbstractModelUpdate < ServerGroupDeploymentElement , ServerDeploymentActionResult > { private static final long serialVersionUID = 5773083013951607950L ; private final String deploymentUnitName ; private final boolean isStart ; public ServerGroupDeploymentStartStopUpdate ( final String deploymentUnitName , boolean isStart ) { } public String getDeploymentUnitName ( ) { } public boolean isStart ( ) { } @ Override public ServerGroupDeploymentStartStopUpdate getCompensatingUpdate ( ServerGroupDeploymentElement original ) { } @ Override protected ServerModelDeploymentStartStopUpdate getServerModelUpdate ( ) { <START_BUG> return new ServerModelDeploymentStartStopUpdate ( this ) ; <END_BUG> } @ Override protected void applyUpdate ( ServerGroupDeploymentElement deploymentElement ) throws UpdateFailedException { } @ Override public Class < ServerGroupDeploymentElement > getModelElementType ( ) { } }

Fix:
return new ServerModelDeploymentStartStopUpdate ( deploymentUnitName , isStart ) ;
Buggy code:
public class ExpressionParser { private ExpressionParser ( ) { } public static String removeParenBody ( String s ) { } public static String parse ( String expression ) { for ( Regexp p : Regexp . getValues ( ) ) { if ( ! ( expression . matches ( p . getRegexp ( ) ) ) ) continue ; if ( ( p . getId ( ) ) == ( - 1 ) ) return "" ; <START_BUG> Logger . debug ( "matches:<seq2seq4repair_space>{0}" , p ) ; <END_BUG> return expression . replaceAll ( p . getRegexp ( ) , String . format ( "$%s" , p . getId ( ) ) ) ; } return expression ; } public static String lastElement ( String expression , String delimitor ) { } public static String lastElement ( String expression ) { } }

Fix:
Logger . debug ( "matches:<seq2seq4repair_space>{}" , p ) ;
Buggy code:
public final class DrawBoolean extends Drawable { private GeoBoolean geoBool ; private boolean isVisible ; private boolean hit = false ; private String oldCaption ; private Point textSize = new Point ( 0 , 0 ) ; private DrawBoolean . CheckBoxIcon checkBoxIcon ; public DrawBoolean ( EuclidianView view , GeoBoolean geoBool ) { } public final void update ( ) { } private void updateLabel ( ) { } public final void draw ( Graphics2D g2 ) { if ( isVisible ) { int size = view . getBooleanSize ( ) ; g2 . setFont ( fontPoint ) ; g2 . setStroke ( EuclidianView . getDefaultStroke ( ) ) ; checkBoxIcon . paintIcon ( geoBool . getBoolean ( ) , geoBool . doHighlighting ( ) , g2 , ( ( geoBool . labelOffsetX ) + 5 ) , ( ( geoBool . labelOffsetY ) + 5 ) ) ; g2 . setPaint ( geo . getObjectColor ( ) ) ; <START_BUG> textSize = Drawable . drawIndexedString ( view . getApplication ( ) , g2 , labelDesc , ( ( ( geoBool . labelOffsetX ) + size ) + 9 ) , ( ( ( geoBool . labelOffsetY ) + ( ( size + 9 ) // 2 ) ) + 5 ) ) ; <END_BUG> updateLabel ( ) ; } } public final void remove ( ) { } public final boolean hit ( int x , int y ) { } public final boolean isInside ( Rectangle rect ) { } public boolean hitLabel ( int x , int y ) { } public final GeoElement getGeoElement ( ) { } public final void setGeoElement ( GeoElement geo ) { } public static class CheckBoxIcon { EuclidianView ev ; public static Color highlightBackground = new Color ( 230 , 230 , 230 ) ; public CheckBoxIcon ( EuclidianView ev ) { } public void paintIcon ( boolean checked , boolean highlighted , Graphics g , int x , int y ) { } public int getIconWidth ( ) { } public int getIconHeight ( ) { } } }

Fix:
textSize = Drawable . drawIndexedString ( view . getApplication ( ) , g2 , labelDesc , ( ( ( geoBool . labelOffsetX ) + size ) + 9 ) , ( ( ( geoBool . labelOffsetY ) + ( ( size + 9 ) // 2 ) ) + 5 ) , false ) ;
Buggy code:
class PatchingXmlArtifact < E extends Patch > extends AbstractArtifact < PatchingFileArtifact . FileArtifactState , PatchingXmlArtifact . XmlArtifactState < E > > { PatchingXmlArtifact ( PatchingArtifact < PatchingXmlArtifact . XmlArtifactState < E > , ? extends ArtifactState > ... artifacts ) { } @ Override public boolean process ( PatchingFileArtifact . FileArtifactState parent , PatchingArtifactProcessor processor ) { } protected E resolveMetaData ( PatchMetadataResolver resolver ) throws PatchingException { } static class XmlArtifactState < E extends Patch > implements PatchingArtifact . ArtifactState { private final File xmlFile ; private final PatchingXmlArtifact < E > artifact ; private E patch ; XmlArtifactState ( File xmlFile , PatchingXmlArtifact < E > artifact ) { } public E getPatch ( ) { } @ Override public boolean isValid ( PatchingArtifactValidationContext context ) { if ( ( patch ) != null ) { return true ; } try { <START_BUG> final PatchMetadataResolver resolver = PatchXml . parse ( xmlFile , context . getCurrentPatchIdentity ( ) ) ; <END_BUG> patch = artifact . resolveMetaData ( resolver ) ; return true ; } catch ( Exception e ) { context . getErrorHandler ( ) . addError ( artifact , this ) ; } return false ; } @ Override public String toString ( ) { } } }

Fix:
final PatchMetadataResolver resolver = PatchXml . parse ( xmlFile , context . getInstalledIdentity ( ) ) ;
Buggy code:
public class JMSTopicReadAttributeHandler extends AbstractRuntimeOnlyHandler { public static final JMSTopicReadAttributeHandler INSTANCE = new JMSTopicReadAttributeHandler ( ) ; private ParametersValidator validator = new ParametersValidator ( ) ; private JMSTopicReadAttributeHandler ( ) { } @ Override public void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validate ( operation ) ; final String attributeName = operation . require ( NAME ) . asString ( ) ; String topicName = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; final ServiceName hqServiceName = MessagingServices . getHornetQServiceName ( PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ) ; ServiceController < ? > hqService = context . getServiceRegistry ( false ) . getService ( hqServiceName ) ; HornetQServer hqServer = HornetQServer . class . cast ( hqService . getValue ( ) ) ; TopicControl control = TopicControl . class . cast ( hqServer . getManagementService ( ) . getResource ( ( ( ResourceNames . JMS_TOPIC ) + topicName ) ) ) ; if ( control == null ) { ManagementUtil . rollbackOperationWithNoHandler ( context , operation ) ; return ; } if ( MESSAGE_COUNT . getName ( ) . equals ( attributeName ) ) { try { context . getResult ( ) . set ( control . getMessageCount ( ) ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } else if ( DELIVERING_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getDeliveringCount ( ) ) ; } else if ( MESSAGES_ADDED . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getMessagesAdded ( ) ) ; } else if ( JMSTopicDefinition . DURABLE_MESSAGE_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getDurableMessageCount ( ) ) ; } else if ( JMSTopicDefinition . NON_DURABLE_MESSAGE_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getNonDurableMessageCount ( ) ) ; } else if ( JMSTopicDefinition . SUBSCRIPTION_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getSubscriptionCount ( ) ) ; } else if ( JMSTopicDefinition . DURABLE_SUBSCRIPTION_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getDurableSubscriptionCount ( ) ) ; } else if ( JMSTopicDefinition . NON_DURABLE_SUBSCRIPTION_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getNonDurableSubscriptionCount ( ) ) ; } else if ( JMSTopicDefinition . TOPIC_ADDRESS . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getAddress ( ) ) ; } else if ( TEMPORARY . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . isTemporary ( ) ) ; } else { throw MessagingMessages . MESSAGES . unsupportedAttribute ( attributeName ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class BlockGroupingCollector extends Collector { private int [ ] pendingSubDocs ; private float [ ] pendingSubScores ; private int subDocUpto ; private final Sort groupSort ; private final int topNGroups ; private final Filter lastDocPerGroup ; private final boolean needsScores ; private final FieldComparator [ ] comparators ; private final int [ ] reversed ; private final int compIDXEnd ; private int bottomSlot ; private boolean queueFull ; private AtomicReaderContext currentReaderContext ; private int topGroupDoc ; private int totalHitCount ; private int totalGroupCount ; private int docBase ; private int groupEndDocID ; private DocIdSetIterator lastDocPerGroupBits ; private Scorer scorer ; private final BlockGroupingCollector . GroupQueue groupQueue ; private boolean groupCompetes ; private static final class FakeScorer extends Scorer { float score ; int doc ; public FakeScorer ( ) { } @ Override public float score ( ) { } @ Override public int docID ( ) { } @ Override public int advance ( int target ) { } @ Override public int nextDoc ( ) { } } private static final class OneGroup { AtomicReaderContext readerContext ; int topGroupDoc ; int [ ] docs ; float [ ] scores ; int count ; int comparatorSlot ; } private final class GroupQueue extends PriorityQueue < BlockGroupingCollector . OneGroup > { public GroupQueue ( int size ) { } @ Override protected boolean lessThan ( final BlockGroupingCollector . OneGroup group1 , final BlockGroupingCollector . OneGroup group2 ) { } } private void processGroup ( ) { } public BlockGroupingCollector ( Sort groupSort , int topNGroups , boolean needsScores , Filter lastDocPerGroup ) throws IOException { } public TopGroups getTopGroups ( Sort withinGroupSort , int groupOffset , int withinGroupOffset , int maxDocsPerGroup , boolean fillSortFields ) throws IOException { } @ Override public void setScorer ( Scorer scorer ) throws IOException { } @ Override public void collect ( int doc ) throws IOException { } @ Override public boolean acceptsDocsOutOfOrder ( ) { } @ Override public void setNextReader ( AtomicReaderContext readerContext ) throws IOException { if ( ( subDocUpto ) != 0 ) { processGroup ( ) ; } subDocUpto = 0 ; docBase = readerContext . docBase ; <START_BUG> lastDocPerGroupBits = lastDocPerGroup . getDocIdSet ( readerContext ) . iterator ( ) ; <END_BUG> groupEndDocID = - 1 ; currentReaderContext = readerContext ; for ( int i = 0 ; i < ( comparators . length ) ; i ++ ) { comparators [ i ] = comparators [ i ] . setNextReader ( readerContext ) ; } } }

Fix:
lastDocPerGroupBits = lastDocPerGroup . getDocIdSet ( readerContext , readerContext . reader . getLiveDocs ( ) ) . iterator ( ) ;
Buggy code:
public class ServerListenerDTP extends ServerListener { private static DeathTpPlus plugin ; private LoggerDTP log ; private ConfigDTP config ; private boolean missingEconomyWarn = true ; public ServerListenerDTP ( DeathTpPlus plugin ) { } @ Override public void onPluginDisable ( PluginDisableEvent event ) { } @ Override public void onPluginEnable ( PluginEnableEvent event ) { log . debug ( "onPluginEnable<seq2seq4repair_space>executing" ) ; PluginManager pm = ServerListenerDTP . plugin . getServer ( ) . getPluginManager ( ) ; Plugin checkVault = pm . getPlugin ( "Vault" ) ; Plugin checkMobArena = pm . getPlugin ( "MobArena" ) ; if ( ( checkVault != null ) && ( ! ( ServerListenerDTP . plugin . isUseVault ( ) ) ) ) { ServerListenerDTP . plugin . setUseVault ( true ) ; log . info ( "Vault<seq2seq4repair_space>detected" ) ; log . info ( "Checking<seq2seq4repair_space>ecnomony<seq2seq4repair_space>providers<seq2seq4repair_space>now!" ) ; } if ( ( ! ( ServerListenerDTP . plugin . isEconomyActive ( ) ) ) && ( ServerListenerDTP . plugin . isUseVault ( ) ) ) { RegisteredServiceProvider < Economy > economyProvider = ServerListenerDTP . plugin . getServer ( ) . getServicesManager ( ) . getRegistration ( Economy . class ) ; if ( economyProvider != null ) { ServerListenerDTP . plugin . setEconomy ( economyProvider . getProvider ( ) ) ; ServerListenerDTP . plugin . setEconomyActive ( true ) ; log . info ( ( "Economy<seq2seq4repair_space>provider<seq2seq4repair_space>found:<seq2seq4repair_space>" + ( ServerListenerDTP . plugin . getEconomy ( ) . getName ( ) ) ) ) ; } else { if ( missingEconomyWarn ) { log . warning ( "No<seq2seq4repair_space>economy<seq2seq4repair_space>provider<seq2seq4repair_space>found." ) ; log . info ( "Still<seq2seq4repair_space>waiting<seq2seq4repair_space>for<seq2seq4repair_space>economy<seq2seq4repair_space>provider<seq2seq4repair_space>to<seq2seq4repair_space>show<seq2seq4repair_space>up." ) ; missingEconomyWarn = false ; } } } if ( ( ServerListenerDTP . plugin . getLwcPlugin ( ) ) == null ) { if ( event . getPlugin ( ) . getDescription ( ) . getName ( ) . equalsIgnoreCase ( "LWC" ) ) { ServerListenerDTP . plugin . setLwcPlugin ( ( ( LWCPlugin ) ( ServerListenerDTP . plugin . checkPlugin ( event . getPlugin ( ) ) ) ) ) ; } } if ( ( ServerListenerDTP . plugin . getLockettePlugin ( ) ) == null ) { if ( event . getPlugin ( ) . getDescription ( ) . getName ( ) . equalsIgnoreCase ( "Lockette" ) ) { ServerListenerDTP . plugin . setLockettePlugin ( ( ( Lockette ) ( ServerListenerDTP . plugin . checkPlugin ( event . getPlugin ( ) ) ) ) ) ; } } <START_BUG> if ( checkMobArena != null ) { <END_BUG> log . info ( "Enabling<seq2seq4repair_space>MobArena<seq2seq4repair_space>protection" ) ; ServerListenerDTP . plugin . setMaHandler ( new MobArenaHandler ( ) ) ; ServerListenerDTP . plugin . setMobArenaEnabled ( true ) ; } } }

Fix:
if ( ( checkMobArena != null ) && ( ! ( ServerListenerDTP . plugin . isMobArenaEnabled ( ) ) ) ) {
Buggy code:
public class MsZoomer { private final IsEuclidianController tc ; private HasOffsets off ; private class MsOffset extends ZeroOffset { private EuclidianControllerW ec ; public MsOffset ( EuclidianControllerW ec ) { } @ Override public int mouseEventX ( int clientX ) { } private native int zoom ( ) { } @ Override public int mouseEventY ( int clientY ) { } @ Override public int touchEventX ( int clientX ) { } @ Override public int touchEventY ( int clientY ) { } @ Override public int getEvID ( ) { <START_BUG> return ec . getViewID ( ) ; <END_BUG> } } public MsZoomer ( IsEuclidianController tc ) { } private void pointersUp ( ) { } private void twoPointersDown ( double x1 , double y1 , double x2 , double y2 ) { } private void twoPointersMove ( double x1 , double y1 , double x2 , double y2 ) { } private void setPointerTypeTouch ( boolean b ) { } public native void reset ( ) { } public static native void attachTo ( Element element , MsZoomer zoomer ) { } }

Fix:
return ec . getEvNo ( ) ;
Buggy code:
public class OperationNode extends TreeNode { public final String operationSign ; protected TreeNode leftTree ; protected TreeNode rightTree ; public OperationNode ( String operationSign , TreeNode left , TreeNode right ) { } private OperationNode ( String operationSign ) { } @ Override public String toString ( ) { } @ Override public OperationNode clone ( ) { } @ Override protected boolean canReturnConstant ( ) throws LProgramRuntimeException { } @ Override public TreeNode evaluate ( ) throws LProgramRuntimeException { } @ Override public ConstantNode getConstantValue ( ) throws LProgramRuntimeException { int leftValue = leftTree . getConstantValue ( ) . value ; <START_BUG> int rightValue = leftTree . getConstantValue ( ) . value ; <END_BUG> if ( this . operationSign . endsWith ( "+" ) ) { return new ConstantNode ( ( leftValue + rightValue ) ) ; } if ( this . operationSign . endsWith ( "-" ) ) { return new ConstantNode ( ( leftValue - rightValue ) ) ; } if ( this . operationSign . endsWith ( "*" ) ) { return new ConstantNode ( ( leftValue * rightValue ) ) ; } if ( this . operationSign . endsWith ( "//" ) ) { return new ConstantNode ( ( leftValue // rightValue ) ) ; } if ( this . operationSign . endsWith ( "%" ) ) { return new ConstantNode ( ( leftValue % rightValue ) ) ; } throw new IllegalArgumentException ( "Undefined<seq2seq4repair_space>sign" ) ; } }

Fix:
int rightValue = rightTree . getConstantValue ( ) . value ;
Buggy code:
public final class SubmissionServiceImpl extends AbstractSubmissionServiceImpl < SubmissionModel , GradingModel > { private final SubmissionDao submissionDao ; private final GradingDao gradingDao ; private final SessionProblemDao sessionProblemDao ; private final UserItemDao userItemDao ; public SubmissionServiceImpl ( SubmissionDao submissionDao , GradingDao gradingDao , Sealtiel sealtiel , String gabrielClientJid , SessionProblemDao sessionProblemDao , UserItemDao userItemDao ) { } @ Override public void afterGrade ( String gradingJid , GradingResult result ) { GradingModel gradingModel = gradingDao . findByJid ( gradingJid ) ; SubmissionModel submissionModel = submissionDao . findByJid ( gradingModel . submissionJid ) ; String userJid = submissionModel . userCreate ; String sessionJid = submissionModel . contestJid ; String problemJid = submissionModel . problemJid ; <START_BUG> List < Submission > submissionList = this . findAllSubmissionsByContestJid ( sessionJid ) ; <END_BUG> boolean completed = false ; int i = 0 ; while ( ( ! completed ) && ( i < ( submissionList . size ( ) ) ) ) { if ( ( submissionList . get ( i ) . getLatestScore ( ) ) == 100 ) { completed = true ; } ++ i ; } UserItemModel userItemModel = userItemDao . findByUserJidAndItemJid ( userJid , problemJid ) ; if ( completed ) { userItemModel . status = COMPLETED . name ( ) ; } else { userItemModel . status = VIEWED . name ( ) ; } userItemDao . edit ( userItemModel , userJid , userItemModel . ipUpdate ) ; completed = true ; List < SessionProblemModel > sessionProblemModels = sessionProblemDao . findBySessionJid ( sessionJid ) ; for ( SessionProblemModel sessionProblemModel : sessionProblemModels ) { if ( ! ( userItemDao . existByUserJidItemJidAndStatus ( userJid , sessionProblemModel . problemJid , COMPLETED . name ( ) ) ) ) { completed = false ; break ; } } userItemModel = userItemDao . findByUserJidAndItemJid ( userJid , sessionJid ) ; if ( completed ) { userItemModel . status = COMPLETED . name ( ) ; } else { userItemModel . status = VIEWED . name ( ) ; } userItemDao . edit ( userItemModel , userJid , userItemModel . ipUpdate ) ; } }

Fix:
List < Submission > submissionList = this . findAllSubmissionsByContestJidProblemJidAndUserJid ( sessionJid , problemJid , userJid ) ;