nus-yam/ex-repair huggingface dataset:
Buggy code:
public class LoopingAlphabetStream extends InputStream { private static final int MAX_BUF_SIZE = 32 * 1024 ; private static final byte SPACE = ( ( byte ) ( '<seq2seq4repair_space>' ) ) ; private final long length ; private final int trailingBlanks ; private long remainingBlanks ; private long remainingNonBlanks ; private byte [ ] buffer = new byte [ 0 ] ; private final ByteAlphabet alphabet ; public LoopingAlphabetStream ( long length ) { } public LoopingAlphabetStream ( long length , int trailingBlanks ) { } public LoopingAlphabetStream ( long length , ByteAlphabet alphabet ) { } public LoopingAlphabetStream ( long length , ByteAlphabet alphabet , int trailingBlanks ) { } public int read ( ) { if ( ( ( remainingBlanks ) <= 0 ) && ( ( remainingNonBlanks ) <= 0 ) ) { return - 1 ; } if ( ( remainingNonBlanks ) <= 0 ) { ( remainingBlanks ) -- ; return LoopingAlphabetStream . SPACE ; } ( remainingNonBlanks ) -- ; <START_BUG> return alphabet . nextByte ( ) ; <END_BUG> } public int read ( byte [ ] buf , int off , int length ) { } public void reset ( ) { } public int available ( ) { } private void fillBuffer ( int bufSize ) { } private int fillBlanks ( byte [ ] buf , int off , int length ) { } }

Fix:
return ( alphabet . nextByte ( ) ) & 255 ;
Buggy code:
public class CodeSnippetReturnStatement extends ReturnStatement implements InvocationSite , EvaluationConstants { MethodBinding setResultMethod ; public CodeSnippetReturnStatement ( Expression expr , int s , int e , EvaluationContext evaluationContext ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateReturnBytecode ( BlockScope currentScope , CodeStream codeStream ) { } public void generateStoreSaveValueIfNecessary ( BlockScope currentScope , CodeStream codeStream ) { codeStream . aload_0 ( ) ; if ( ( ( this . expression ) == null ) || ( ( this . expressionType ) == ( VoidBinding ) ) ) { codeStream . aconst_null ( ) ; codeStream . generateClassLiteralAccessForType ( VoidBinding , null ) ; } else { int valueTypeID = this . expressionType . id ; if ( ( valueTypeID == ( TypeIds . T_long ) ) || ( valueTypeID == ( TypeIds . T_double ) ) ) { codeStream . dup_x2 ( ) ; codeStream . pop ( ) ; } else { codeStream . swap ( ) ; } <START_BUG> if ( this . expressionType . isBaseType ( ) ) { <END_BUG> ( ( CodeSnippetCodeStream ) ( codeStream ) ) . generateObjectWrapperForType ( this . expressionType ) ; } codeStream . generateClassLiteralAccessForType ( this . expressionType , null ) ; } codeStream . invokevirtual ( this . setResultMethod ) ; } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } public boolean needValue ( ) { } public void prepareSaveValueLocation ( TryStatement targetTryStatement ) { } public void resolve ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } }

Fix:
if ( ( this . expressionType . isBaseType ( ) ) && ( ( this . expressionType ) != ( NullBinding ) ) ) {
Buggy code:
public class TimerFragment extends Fragment { @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { <START_BUG> return inflater . inflate ( task_detail , container ) ; <END_BUG> } private void setDescAndText ( Activity activity , int id , int desc , String value ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } }

Fix:
return inflater . inflate ( task_detail , null ) ;
Buggy code:
public class TableProviderTest extends ComponentTestCase { @ Test public void testLookup ( ) throws Exception { } @ Test public void testUser ( ) throws Exception { defineComponent ( TableProvider . class , "user" , TableProviderTest . MockUserTableProvider . class ) ; defineComponent ( QueryExecutor . class , TableProviderTest . MockQueryExecutor . class ) ; EntityInfoManager manager = lookup ( EntityInfoManager . class ) ; UserDao dao = lookup ( UserDao . class ) ; TableProviderTest . MockQueryExecutor executor = ( ( TableProviderTest . MockQueryExecutor ) ( lookup ( QueryExecutor . class ) ) ) ; manager . register ( UserEntity . class ) ; dao . findByPK ( 123 , READSET_FULL ) ; <START_BUG> Assert . assertEquals ( "SELECT<seq2seq4repair_space>u.user_id,u.full_name,u.creation_date,u.last_modified_date<seq2seq4repair_space>FROM<seq2seq4repair_space>user_3<seq2seq4repair_space>u<seq2seq4repair_space>WHERE<seq2seq4repair_space>u.user_id<seq2seq4repair_space>=<seq2seq4repair_space>?" , executor . getSql ( ) ) ; <END_BUG> } public static class MockQueryExecutor implements QueryExecutor { private String m_sql ; @ SuppressWarnings ( "unchecked" ) @ Override public < T extends DataObject > List < T > executeQuery ( QueryContext ctx ) throws DalException { } @ Override public int executeUpdate ( QueryContext ctx ) throws DalException { } @ Override public < T extends DataObject > int [ ] executeUpdateBatch ( QueryContext ctx , T [ ] protos ) throws DalException { } public String getSql ( ) { } } public static class MockUserTableProvider implements TableProvider { private String m_logicalTableName = "user" ; private String m_dataSourceName = "user" ; @ Override public String getDataSourceName ( Map < String , Object > hints ) { } @ Override public String getLogicalTableName ( ) { } @ Override public String getPhysicalTableName ( Map < String , Object > hints ) { } public void setDataSourceName ( String dataSourceName ) { } public void setLogicalTableName ( String logicalTableName ) { } } }

Fix:
Assert . assertEquals ( "SELECT<seq2seq4repair_space>u.user_id,u.full_name,u.creation_date,u.last_modified_date<seq2seq4repair_space>FROM<seq2seq4repair_space>`user_3`<seq2seq4repair_space>u<seq2seq4repair_space>WHERE<seq2seq4repair_space>u.user_id<seq2seq4repair_space>=<seq2seq4repair_space>?" , executor . getSql ( ) ) ;
Buggy code:
public class ToolBar extends Composite { int lastFocusId ; ToolItem [ ] items ; boolean ignoreResize ; boolean ignoreMouse ; ImageList imageList ; ImageList disabledImageList ; ImageList hotImageList ; static final int ToolBarProc ; static final TCHAR ToolBarClass = new TCHAR ( 0 , OS . TOOLBARCLASSNAME , true ) ; static final int DEFAULT_WIDTH = 24 ; static final int DEFAULT_HEIGHT = 22 ; public ToolBar ( Composite parent , int style ) { } 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 createHandle ( ) { } void createItem ( ToolItem item , int index ) { } void createWidget ( ) { } int defaultBackground ( ) { } void destroyItem ( ToolItem item ) { } void enableWidget ( boolean enabled ) { } ImageList getDisabledImageList ( ) { } ImageList getHotImageList ( ) { } ImageList getImageList ( ) { } public ToolItem getItem ( int index ) { } public ToolItem getItem ( Point point ) { } public int getItemCount ( ) { } public ToolItem [ ] getItems ( ) { } public int getRowCount ( ) { } public int indexOf ( ToolItem item ) { } void layoutItems ( ) { } boolean mnemonicHit ( char ch ) { } boolean mnemonicMatch ( char ch ) { } void releaseChildren ( boolean destroy ) { if ( ( items ) != null ) { for ( int i = 0 ; i < ( items . length ) ; i ++ ) { ToolItem item = items [ i ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { <START_BUG> item . releaseChildren ( false ) ; <END_BUG> } } items = null ; } super . releaseChildren ( destroy ) ; } void releaseWidget ( ) { } void removeControl ( Control control ) { } void setBackgroundPixel ( int pixel ) { } void setBounds ( int x , int y , int width , int height , int flags ) { } void setDefaultFont ( ) { } void setDisabledImageList ( ImageList imageList ) { } public void setFont ( Font font ) { } void setHotImageList ( ImageList imageList ) { } void setImageList ( ImageList imageList ) { } public boolean setParent ( Composite parent ) { } void setRowCount ( int count ) { } boolean setTabItemFocus ( ) { } String toolTipText ( NMTTDISPINFO hdr ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_CAPTURECHANGED ( int wParam , int lParam ) { } LRESULT WM_CHAR ( int wParam , int lParam ) { } LRESULT WM_COMMAND ( int wParam , int lParam ) { } LRESULT WM_GETDLGCODE ( int wParam , int lParam ) { } LRESULT WM_KEYDOWN ( int wParam , int lParam ) { } LRESULT WM_KILLFOCUS ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_LBUTTONUP ( int wParam , int lParam ) { } LRESULT WM_NOTIFY ( int wParam , int lParam ) { } LRESULT WM_SETFOCUS ( int wParam , int lParam ) { } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT WM_WINDOWPOSCHANGING ( int wParam , int lParam ) { } LRESULT wmCommandChild ( int wParam , int lParam ) { } LRESULT wmNotifyChild ( int wParam , int lParam ) { } }

Fix:
item . release ( false ) ;
Buggy code:
public class Global extends GlobalSettings { private Injector injector ; public void onStart ( final Application app ) { super . onStart ( app ) ; <START_BUG> this . injector = Guice . createInjector ( new JPAModule ( ) , new BaseConverterModule ( ) , new DatabaseServiceModule ( ) , new CloudModule ( ) , new SolutionModule ( ) , new JobModule ( ) ) ; <END_BUG> ExecutionService executionService = new components . execution . TransactionAwareExecutionService ( new DefaultExecutionService ( ) ) ; LocationWatchdog locationWatchdog = injector . getInstance ( LocationWatchdog . class ) ; HardwareWatchdog hardwareWatchdog = injector . getInstance ( HardwareWatchdog . class ) ; ImageWatchdog imageWatchdog = injector . getInstance ( ImageWatchdog . class ) ; executionService . scheduleAtFixedRate ( locationWatchdog , 1 , TimeUnit . MINUTES ) ; executionService . scheduleAtFixedRate ( hardwareWatchdog , 1 , TimeUnit . MINUTES ) ; executionService . scheduleAtFixedRate ( imageWatchdog , 1 , TimeUnit . MINUTES ) ; executionService . executeInLoop ( injector . getInstance ( Solver . class ) ) ; executionService . executeInLoop ( injector . getInstance ( JobWorker . class ) ) ; final InitialData initialData = this . injector . getInstance ( InitialData . class ) ; JPA . withTransaction ( initialData :: loadInitialData ) ; this . registerFormatters ( ) ; } public void onStop ( Application app ) { } @ Override public < A > A getControllerInstance ( Class < A > aClass ) throws Exception { } protected void registerFormatters ( ) { } }

Fix:
this . injector = Guice . createInjector ( new JPAModule ( ) , new dtos . conversion . BaseConverterModule ( app . classloader ( ) ) , new DatabaseServiceModule ( ) , new CloudModule ( ) , new SolutionModule ( ) , new JobModule ( ) ) ;
Buggy code:
public class CustomLayoutAjaxAutocompleteTextField extends AutocompleteTextFieldSupport { private final Class page ; public CustomLayoutAjaxAutocompleteTextField ( String id , Class page ) { } public void renderHead ( HtmlHeaderContainer container ) { super . renderHead ( container ) ; PageParameters parameters = new PageParameters ( ) ; parameters . put ( "fieldName" , this . getId ( ) ) ; <START_BUG> String url = this . getPage ( ) . urlFor ( null , page , parameters ) ; <END_BUG> write ( container , "<script<seq2seq4repair_space>type=\'text//javascript\'>\n" ) ; write ( container , "var<seq2seq4repair_space>myrules<seq2seq4repair_space>=<seq2seq4repair_space>{<seq2seq4repair_space>\n" ) ; write ( container , "\t\'#" ) ; write ( container , getId ( ) ) ; write ( container , "\'<seq2seq4repair_space>:<seq2seq4repair_space>function(el){<seq2seq4repair_space>\n" ) ; write ( container , "\t\tnew<seq2seq4repair_space>Ajax.Autocompleter(\'" ) ; write ( container , getId ( ) ) ; write ( container , "',<seq2seq4repair_space>'" ) ; write ( container , getAutocompleteId ( ) ) ; write ( container , "',<seq2seq4repair_space>'" ) ; write ( container , url ) ; write ( container , "\',<seq2seq4repair_space>{});\n" ) ; write ( container , "\t}<seq2seq4repair_space>\n" ) ; write ( container , "}<seq2seq4repair_space>\nBehaviour.register(myrules);\n" ) ; write ( container , "<//script>\n" ) ; } }

Fix:
String url = this . urlFor ( null , page , parameters ) ;
Buggy code:
} } if ( maxAbsoluteValue != 0.0 ) { for ( int i = 0 ; i < n ; i ++ ) { if ( ( Math . abs ( realEigenvalues [ i ] ) ) <= ( ( MathUtils . EPSILON ) * maxAbsoluteValue ) ) { realEigenvalues [ i ] = 0.0 ; } if ( ( Math . abs ( e [ i ] ) ) <= ( ( MathUtils . EPSILON ) * maxAbsoluteValue ) ) { e [ i ] = 0.0 ; } } } for ( int j = 0 ; j < n ; j ++ ) { int its = 0 ; int m ; do { for ( m = j ; m < ( n - 1 ) ; m ++ ) { double delta = ( Math . abs ( realEigenvalues [ m ] ) ) + ( Math . abs ( realEigenvalues [ ( m + 1 ) ] ) ) ; if ( ( ( Math . abs ( e [ m ] ) ) + delta ) == delta ) { break ; } } if ( m != j ) { if ( its == ( maxIter ) ) throw new InvalidMatrixException ( new MaxIterationsExceededException ( maxIter ) ) ; its ++ ; double q = ( ( realEigenvalues [ ( j + 1 ) ] ) - ( realEigenvalues [ j ] ) ) // ( 2 * ( e [ j ] ) ) ; double t = Math . sqrt ( ( 1 + ( q * q ) ) ) ; if ( q < 0.0 ) { q = ( ( realEigenvalues [ m ] ) - ( realEigenvalues [ j ] ) ) + ( ( e [ j ] ) // ( q - t ) ) ; } else { q = ( ( realEigenvalues [ m ] ) - ( realEigenvalues [ j ] ) ) + ( ( e [ j ] ) // ( q + t ) ) ; } double u = 0.0 ; double s = 1.0 ; double c = 1.0 ; int i ; for ( i = m - 1 ; i >= j ; i -- ) { double p = s * ( e [ i ] ) ; double h = c * ( e [ i ] ) ; if ( ( Math . abs ( p ) ) >= ( Math . abs ( q ) ) ) { c = q // p ; t = Math . sqrt ( ( ( c * c ) + 1.0 ) ) ; e [ ( i + 1 ) ] = p * t ; s = 1.0 // t ; c = c * s ; } else { s = p // q ; t = Math . sqrt ( ( ( s * s ) + 1.0 ) ) ; e [ ( i + 1 ) ] = q * t ; c = 1.0 // t ; s = s * c ; } if ( ( e [ ( i + 1 ) ] ) == 0.0 ) { realEigenvalues [ ( i + 1 ) ] -= u ; e [ m ] = 0.0 ; break ; } q = ( realEigenvalues [ ( i + 1 ) ] ) - u ; t = ( ( ( realEigenvalues [ i ] ) - q ) * s ) + ( ( 2.0 * c ) * h ) ; u = s * t ; realEigenvalues [ ( i + 1 ) ] = q + u ; q = ( c * t ) - h ; for ( int ia = 0 ; ia < n ; ia ++ ) { p = z [ ia ] [ ( i + 1 ) ] ; z [ ia ] [ ( i + 1 ) ] = ( s * ( z [ ia ] [ i ] ) ) + ( c * p ) ; z [ ia ] [ i ] = ( c * ( z [ ia ] [ i ] ) ) - ( s * p ) ; } } <START_BUG> if ( ( ( e [ ( i + 1 ) ] ) == 0.0 ) && ( i >= j ) ) <END_BUG> continue ; realEigenvalues [ j ] -= u ; e [ j ] = q ; e [ m ] = 0.0 ; } } while ( m != j ) ; } for ( int i = 0 ; i < n ; i ++ ) { int k = i ; double p = realEigenvalues [ i ] ; for ( int j = i + 1 ; j < n ; j ++ ) { if ( ( realEigenvalues [ j ] ) > p ) { k = j ; p = realEigenvalues [ j ] ; } } if ( k != i ) { realEigenvalues [ k ] = realEigenvalues [ i ] ; realEigenvalues [ i ] = p ; for ( int j = 0 ; j < n ; j ++ ) { p = z [ j ] [ i ] ; z [ j ] [ i ] = z [ j ] [ k ] ; z [ j ] [ k ] = p ; } } } maxAbsoluteValue = 0.0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( Math . abs ( realEigenvalues [ i ] ) ) > maxAbsoluteValue ) { maxAbsoluteValue = Math . abs ( realEigenvalues [ i ] ) ;

Fix:
if ( ( t == 0.0 ) && ( i >= j ) )
Buggy code:
public class OverviewOptionPane extends AbstractOptionPane { public OverviewOptionPane ( ) { } public void _init ( ) { setLayout ( new BorderLayout ( ) ) ; JEditorPane ep = new JEditorPane ( ) ; try { ep . setPage ( getClass ( ) . getResource ( "overview.html" ) ) ; } catch ( IOException io ) { Log . log ( ERROR , this , io ) ; } ep . setEditable ( false ) ; JScrollPane scroller = new JScrollPane ( ep ) ; <START_BUG> scroller . setPreferredSize ( new Dimension ( 400 , 0 ) ) ; <END_BUG> add ( BorderLayout . CENTER , scroller ) ; } public void _save ( ) { } }

Fix:
scroller . setPreferredSize ( new Dimension ( 300 , 0 ) ) ;
Buggy code:
public class MockApplication extends WebApplication { public MockApplication ( ) { } @ Override public Class < ? extends Page > getHomePage ( ) { } @ Override public String getConfigurationType ( ) { <START_BUG> return DEPLOYMENT ; <END_BUG> } @ Override protected MockRequestCycle newRequestCycle ( RequestCycleContext context ) { } private IRequestablePage lastRenderedPage ; public IRequestablePage getLastRenderedPage ( ) { } public void clearLastRenderedPage ( ) { } @ Override public RenderPageRequestHandlerDelegate getRenderPageRequestHandlerDelegate ( RenderPageRequestHandler renderPageRequestHandler ) { } @ Override protected IPageManager newPageManager ( IPageManagerContext context ) { } @ Override public ISessionStore newSessionStore ( ) { } public Session getSession ( ) { } private MockServletContext mockServletContext ; @ Override public ServletContext getServletContext ( ) { } @ Override public final String getInitParameter ( String key ) { } @ Override protected void internalInit ( ) { } public void destroy ( ) { } }

Fix:
return DEVELOPMENT ;
Buggy code:
public class WorkingCopyPreferences implements IEclipsePreferences { private static final String TRUE = "true" ; private final Map temporarySettings ; private final IEclipsePreferences original ; private ListenerList preferenceListeners ; private boolean removed = false ; private WorkingCopyManager manager ; public WorkingCopyPreferences ( IEclipsePreferences original , WorkingCopyManager manager ) { } private void checkRemoved ( ) { } public void addNodeChangeListener ( IEclipsePreferences . INodeChangeListener listener ) { } public void removeNodeChangeListener ( IEclipsePreferences . INodeChangeListener listener ) { } public void addPreferenceChangeListener ( IEclipsePreferences . IPreferenceChangeListener listener ) { } public void removePreferenceChangeListener ( IEclipsePreferences . IPreferenceChangeListener listener ) { } public void removeNode ( ) throws BackingStoreException { } private WorkingCopyManager getManager ( ) { } public Preferences node ( String path ) { } public void accept ( IPreferenceNodeVisitor visitor ) throws BackingStoreException { } public void put ( String key , String value ) { } private void firePropertyChangeEvent ( String key , Object oldValue , Object newValue ) { } public String get ( String key , String defaultValue ) { } private String internalGet ( String key , String defaultValue ) { } public void remove ( String key ) { } public void clear ( ) { } public void putInt ( String key , int value ) { } public int getInt ( String key , int defaultValue ) { } public void putLong ( String key , long value ) { } public long getLong ( String key , long defaultValue ) { } public void putBoolean ( String key , boolean value ) { checkRemoved ( ) ; if ( key == null ) throw new NullPointerException ( ) ; String oldValue = null ; if ( temporarySettings . containsKey ( key ) ) oldValue = ( ( String ) ( temporarySettings . get ( key ) ) ) ; else oldValue = getOriginal ( ) . get ( key , null ) ; <START_BUG> String newValue = Boolean . toString ( value ) ; <END_BUG> temporarySettings . put ( key , newValue ) ; if ( ! ( newValue . equalsIgnoreCase ( oldValue ) ) ) firePropertyChangeEvent ( key , oldValue , newValue ) ; } public boolean getBoolean ( String key , boolean defaultValue ) { } public void putFloat ( String key , float value ) { } public float getFloat ( String key , float defaultValue ) { } public void putDouble ( String key , double value ) { } public double getDouble ( String key , double defaultValue ) { } public void putByteArray ( String key , byte [ ] value ) { } public byte [ ] getByteArray ( String key , byte [ ] defaultValue ) { } public String [ ] keys ( ) throws BackingStoreException { } public String [ ] childrenNames ( ) throws BackingStoreException { } public Preferences parent ( ) { } public boolean nodeExists ( String pathName ) throws BackingStoreException { } public String name ( ) { } public String absolutePath ( ) { } public void flush ( ) throws BackingStoreException { } public void sync ( ) throws BackingStoreException { } private IEclipsePreferences getOriginal ( ) { } }

Fix:
String newValue = String . valueOf ( value ) ;
Buggy code:
public class KEYRecord extends Record { private static KEYRecord member = new KEYRecord ( ) ; private short flags ; private byte proto ; private byte alg ; private byte [ ] key ; private int footprint = - 1 ; public static final int FLAG_NOCONF = 32768 ; public static final int FLAG_NOAUTH = 16384 ; public static final int FLAG_NOKEY = 49152 ; public static final int OWNER_ZONE = 256 ; public static final int OWNER_HOST = 512 ; public static final int OWNER_USER = 0 ; public static final int PROTOCOL_TLS = 1 ; public static final int PROTOCOL_EMAIL = 2 ; public static final int PROTOCOL_DNSSEC = 3 ; public static final int PROTOCOL_IPSEC = 4 ; public static final int PROTOCOL_ANY = 255 ; private KEYRecord ( ) { } private KEYRecord ( Name name , short dclass , int ttl ) { } static KEYRecord getMember ( ) { } public KEYRecord ( Name name , short dclass , int ttl , int flags , int proto , int alg , byte [ ] key ) { } Record rrFromWire ( Name name , short type , short dclass , int ttl , int length , DataByteInputStream in ) throws IOException { } Record rdataFromString ( Name name , short dclass , int ttl , MyStringTokenizer st , Name origin ) throws TextParseException { KEYRecord rec = new KEYRecord ( name , dclass , ttl ) ; rec . flags = ( ( short ) ( Integer . decode ( nextString ( st ) ) . intValue ( ) ) ) ; rec . proto = ( ( byte ) ( Integer . parseInt ( nextString ( st ) ) ) ) ; rec . alg = ( ( byte ) ( Integer . parseInt ( nextString ( st ) ) ) ) ; if ( ! ( ( ( rec . flags ) & ( KEYRecord . FLAG_NOKEY ) ) == ( KEYRecord . FLAG_NOKEY ) ) ) <START_BUG> rec . key = base64 . fromString ( st . remainingTokens ( ) ) ; <END_BUG> else rec . key = null ; return rec ; } public String rdataToString ( ) { } public short getFlags ( ) { } public byte getProtocol ( ) { } public byte getAlgorithm ( ) { } public byte [ ] getKey ( ) { } public short getFootprint ( ) { } void rrToWire ( DataByteOutputStream out , Compression c , boolean canonical ) { } }

Fix:
rec . key = base64 . fromString ( remainingStrings ( st ) ) ;
Buggy code:
public class DateFilter extends AbstractFilter { public DateFilter ( ) { } public Object [ ] getAttributes ( ) { } protected Date transformDate ( String pattern ) { } public boolean process ( Object [ ] args , Folder folder , Object uid ) throws Exception { int condition = FilterCriteria . getCriteria ( ( ( String ) ( args [ 0 ] ) ) ) ; Date date = transformDate ( ( ( String ) ( args [ 1 ] ) ) ) ; boolean result = false ; Date d = ( ( Date ) ( folder . getAttribute ( uid , "columba.date" ) ) ) ; if ( d == null ) { <START_BUG> log . error ( "field<seq2seq4repair_space>date<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; <END_BUG> return false ; } switch ( condition ) { case FilterCriteria . DATE_BEFORE : { if ( d . before ( date ) ) { result = true ; } break ; } case FilterCriteria . DATE_AFTER : { if ( d . after ( date ) ) { result = true ; } break ; } } return result ; } }

Fix:
log . severe ( "field<seq2seq4repair_space>date<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ;
Buggy code:
public final class TextLayout { static class StyleItem { TextStyle style ; int start ; int atsuStyle ; void createStyle ( Font defaultFont ) { } void freeStyle ( ) { } } Device device ; Font font ; String text ; int textPtr ; TextLayout . StyleItem [ ] styles ; int layout ; int spacing ; int ascent ; int descent ; int [ ] tabs ; int [ ] segments ; int tabsPtr ; int [ ] breaks ; int [ ] lineX ; int [ ] lineWidth ; int [ ] lineHeight ; int [ ] lineAscent ; static final int TAB_COUNT = 32 ; public TextLayout ( Device device ) { } void checkLayout ( ) { } void computeRuns ( ) { } public void dispose ( ) { } public void draw ( GC gc , int x , int y ) { } public void draw ( GC gc , int x , int y , int selectionStart , int selectionEnd , Color selectionForeground , Color selectionBackground ) { } void freeRuns ( ) { } public int getAlignment ( ) { } public int getAscent ( ) { } public Rectangle getBounds ( ) { } public Rectangle getBounds ( int start , int end ) { } public int getDescent ( ) { } public Font getFont ( ) { } public int getLevel ( int offset ) { } public int [ ] getLineOffsets ( ) { } public int getLineIndex ( int offset ) { } public Rectangle getLineBounds ( int lineIndex ) { } public int getLineCount ( ) { } public FontMetrics getLineMetrics ( int lineIndex ) { } public Point getLocation ( int offset , boolean trailing ) { } public int getNextOffset ( int offset , int movement ) { } int _getOffset ( int offset , int movement , boolean forward ) { } public int getOffset ( Point point , int [ ] trailing ) { } public int getOffset ( int x , int y , int [ ] trailing ) { } public int getOrientation ( ) { } public int getPreviousOffset ( int index , int movement ) { } public int [ ] getSegments ( ) { } public int getSpacing ( ) { } public TextStyle getStyle ( int offset ) { } public int [ ] getTabs ( ) { } public String getText ( ) { } public int getWidth ( ) { } public boolean isDisposed ( ) { } public void setAlignment ( int alignment ) { } public void setAscent ( int ascent ) { } public void setDescent ( int descent ) { } void setLayoutControl ( int tag , int value , int size ) { } public void setFont ( Font font ) { } public void setOrientation ( int orientation ) { } public void setSegments ( int [ ] segments ) { } public void setSpacing ( int spacing ) { } public void setStyle ( TextStyle style , int start , int end ) { } public void setTabs ( int [ ] tabs ) { } public void setText ( String text ) { } public void setWidth ( int width ) { checkLayout ( ) ; if ( ( width < ( - 1 ) ) || ( width == 0 ) ) SWT . error ( ERROR_INVALID_ARGUMENT ) ; if ( width == ( getWidth ( ) ) ) return ; freeRuns ( ) ; <START_BUG> setLayoutControl ( kATSULineWidthTag , OS . Long2Fix ( width ) , 4 ) ; <END_BUG> } int skipHardBreak ( int lineBreak ) { } public String toString ( ) { } }

Fix:
setLayoutControl ( kATSULineWidthTag , OS . Long2Fix ( Math . max ( 0 , width ) ) , 4 ) ;
Buggy code:
public class CompoundAssignment extends Assignment implements OperatorIds { public int operator ; public int assignmentImplicitConversion ; public CompoundAssignment ( Expression lhs , Expression expression , int operator , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public String operatorToString ( ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; TypeBinding lhsType = lhs . resolveType ( scope ) ; TypeBinding expressionType = expression . resolveType ( scope ) ; if ( ( lhsType == null ) || ( expressionType == null ) ) return null ; int lhsId = lhsType . id ; int expressionId = expressionType . id ; if ( ( restrainUsageToNumericTypes ( ) ) && ( ! ( lhsType . isNumericType ( ) ) ) ) { scope . problemReporter ( ) . operatorOnlyValidOnNumericType ( this , lhsType , expressionType ) ; return null ; } if ( ( lhsId > 15 ) || ( expressionId > 15 ) ) { if ( lhsId != ( T_String ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } expressionId = T_Object ; } int result = ResolveTypeTables [ operator ] [ ( ( lhsId << 4 ) + expressionId ) ] ; if ( result == ( TypeIds . T_undefined ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } if ( ( operator ) == ( OperatorIds . PLUS ) ) { if ( scope . isJavaLangObject ( lhsType ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } else if ( ( ( lhsType . isNumericType ( ) ) || ( lhsId == ( TypeIds . T_boolean ) ) ) && ( ! ( expressionType . isNumericType ( ) ) ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } } lhs . implicitConversion = result > > > 12 ; expression . implicitConversion = ( result > > > 4 ) & 255 ; assignmentImplicitConversion = ( lhsId << 4 ) + ( result & 15 ) ; <START_BUG> return lhsType ; <END_BUG> } public boolean restrainUsageToNumericTypes ( ) { } public String toStringExpressionNoParenthesis ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
return this . expressionType = lhsType ;
Buggy code:
public final class ProxyHandler implements InvocationHandler { private final Callable < Object > target ; private final InvocationHandler core ; private final InvocationHandlerWrapper wrapper ; private final AbstractProxyManager proxyManager ; public ProxyHandler ( AbstractProxyManager abstractProxyManager , Callable < Object > dispatcher , InvocationHandlerWrapper wrapper ) { } public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { if ( ( method . getName ( ) . equals ( "equals" ) ) && ( ( method . getDeclaringClass ( ) ) == ( Object . class ) ) ) { Object targetObject = args [ 0 ] ; if ( proxyManager . isProxy ( targetObject ) ) { <START_BUG> args [ 0 ] = proxyManager . unwrap ( proxy ) . call ( ) ; <END_BUG> } } else if ( ( method . getName ( ) . equals ( "finalize" ) ) && ( ( method . getParameterTypes ( ) . length ) == 0 ) ) { return null ; } return wrapper . invoke ( proxy , method , args , core ) ; } public Callable < Object > getTarget ( ) { } }

Fix:
args [ 0 ] = proxyManager . unwrap ( targetObject ) . call ( ) ;
Buggy code:
public final class TrunkInvoker extends ServiceMBeanSupport implements ITrunkListener , TrunkInvokerMBean { private static final Logger log = Logger . getLogger ( TrunkInvoker . class ) ; public static final String COMM_TRUNK_INVOCATION_PAYLOAD_KEY = "CommTrunk" ; private boolean enableTcpNoDelay = false ; private String serverBindAddress = null ; private int serverBindPort = 0 ; private int timeoutMillis = 0 ; private String clientConnectAddress = null ; private int clientConnectPort = 0 ; private IServer serverProtocol ; private ObjectName workManagerName ; private WorkManager workManager ; private ObjectName transactionManagerService ; private Invoker invoker ; public String getName ( ) { } public void startService ( ) throws Exception { } public void stopService ( ) throws Exception { } protected void destroyService ( ) throws Exception { } public void exceptionEvent ( ICommTrunk trunk , Exception e ) { } public void requestEvent ( ICommTrunk trunk , TrunkRequest request ) { } public MarshalledObject invoke ( Invocation invocation ) throws Exception { ClassLoader oldCl = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { ObjectName mbean = ( ( ObjectName ) ( Registry . lookup ( invocation . getObjectName ( ) ) ) ) ; <START_BUG> Object obj = getServer ( ) . invoke ( mbean , "" , new Object [ ] { invocation } , Invocation . INVOKE_SIGNATURE ) ; <END_BUG> return new MarshalledObject ( obj ) ; } catch ( Exception e ) { JMXExceptionDecoder . rethrow ( e ) ; throw new UnreachableStatementException ( ) ; } finally { Thread . currentThread ( ) . setContextClassLoader ( oldCl ) ; } } public int getServerBindPort ( ) { } public void setServerBindPort ( int serverBindPort ) { } public String getClientConnectAddress ( ) { } public void setClientConnectAddress ( String clientConnectAddress ) { } public int getClientConnectPort ( ) { } public void setClientConnectPort ( int clientConnectPort ) { } public boolean isEnableTcpNoDelay ( ) { } public void setEnableTcpNoDelay ( boolean enableTcpNoDelay ) { } public String getServerBindAddress ( ) { } public void setServerBindAddress ( String serverBindAddress ) { } public int getClientConnectTimeoutMilliseconds ( ) { } public void setClientConnectTimeoutMilliseconds ( int timeoutMillis ) { } public ObjectName getWorkManager ( ) { } public void setWorkManager ( final ObjectName workManagerName ) { } public ObjectName getTransactionManagerService ( ) { } public void setTransactionManagerService ( ObjectName transactionManagerService ) { } }

Fix:
Object obj = getServer ( ) . invoke ( mbean , "invoke" , new Object [ ] { invocation } , Invocation . INVOKE_SIGNATURE ) ;
Buggy code:
public class War extends Jar { private File deploymentDescriptor ; private boolean needxmlfile = true ; private File addedWebXmlFile ; private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private static final String XML_DESCRIPTOR_PATH = "WEB-INF//web.xml" ; private static final String XML_DESCRIPTOR_PATH_LC = War . XML_DESCRIPTOR_PATH . toLowerCase ( Locale . ENGLISH ) ; public War ( ) { } public void setWarfile ( File warFile ) { } public void setWebxml ( File descr ) { } public void setNeedxmlfile ( boolean needxmlfile ) { } public void addLib ( ZipFileSet fs ) { } public void addClasses ( ZipFileSet fs ) { } public void addWebinf ( ZipFileSet fs ) { } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected void zipFile ( File file , ZipOutputStream zOut , String vPath , int mode ) throws IOException { String vPathLowerCase = vPath . toLowerCase ( Locale . ENGLISH ) ; boolean addFile = true ; if ( War . XML_DESCRIPTOR_PATH_LC . equals ( vPathLowerCase ) ) { if ( ( addedWebXmlFile ) != null ) { addFile = false ; if ( ! ( War . FILE_UTILS . fileNameEquals ( addedWebXmlFile , file ) ) ) { <START_BUG> log ( ( ( ( ( ( ( ( ( ( "Warning:<seq2seq4repair_space>selected<seq2seq4repair_space>" + ( archiveType ) ) + "<seq2seq4repair_space>files<seq2seq4repair_space>include<seq2seq4repair_space>a<seq2seq4repair_space>second<seq2seq4repair_space>" ) + ( War . XML_DESCRIPTOR_PATH ) ) + "<seq2seq4repair_space>which<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>ignored.\n" ) + "The<seq2seq4repair_space>duplicate<seq2seq4repair_space>entry<seq2seq4repair_space>is<seq2seq4repair_space>at<seq2seq4repair_space>" ) + file ) + '\n' ) + "The<seq2seq4repair_space>file<seq2seq4repair_space>that<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>is<seq2seq4repair_space>" ) + ( addedWebXmlFile ) ) , MSG_WARN ) ; <END_BUG> } } else { addedWebXmlFile = file ; addFile = true ; deploymentDescriptor = file ; } } if ( addFile ) { super . zipFile ( file , zOut , vPath , mode ) ; } } protected void cleanUp ( ) { } }

Fix:
logOnFirstPass ( ( ( ( ( ( ( ( ( ( "Warning:<seq2seq4repair_space>selected<seq2seq4repair_space>" + ( archiveType ) ) + "<seq2seq4repair_space>files<seq2seq4repair_space>include<seq2seq4repair_space>a<seq2seq4repair_space>second<seq2seq4repair_space>" ) + ( War . XML_DESCRIPTOR_PATH ) ) + "<seq2seq4repair_space>which<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>ignored.\n" ) + "The<seq2seq4repair_space>duplicate<seq2seq4repair_space>entry<seq2seq4repair_space>is<seq2seq4repair_space>at<seq2seq4repair_space>" ) + file ) + '\n' ) + "The<seq2seq4repair_space>file<seq2seq4repair_space>that<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>is<seq2seq4repair_space>" ) + ( addedWebXmlFile ) ) , MSG_WARN ) ;
Buggy code:
public class RaAdd implements OperationStepHandler { static final RaAdd INSTANCE = new RaAdd ( ) ; protected void populateModel ( ModelNode operation , ModelNode model ) { } public void execute ( OperationContext context , ModelNode operation ) { final ModelNode subModel = context . readModelForUpdate ( EMPTY_ADDRESS ) ; populateModel ( operation , subModel ) ; final ModelNode address = operation . require ( OP_ADDR ) ; final String name = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; String archiveName = operation . get ( Constants . ARCHIVE . getName ( ) ) . asString ( ) ; if ( ( name . startsWith ( archiveName ) ) && ( ( name . substring ( archiveName . length ( ) ) . contains ( RA_SERVICE_NAME_SEPARATOR ) ) || ( name . equals ( archiveName ) ) ) ) { archiveName = name ; } else { Integer identifier = ConnectorServices . getResourceIdentifier ( archiveName ) ; if ( ( identifier != null ) && ( identifier != 0 ) ) { archiveName = ( archiveName + ( ConnectorServices . RA_SERVICE_NAME_SEPARATOR ) ) + identifier ; } } operation . get ( Constants . ARCHIVE . getName ( ) ) . set ( archiveName ) ; subModel . get ( Constants . ARCHIVE . getName ( ) ) . set ( archiveName ) ; final String archive = archiveName ; if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; <START_BUG> ModifiableResourceAdapter resourceAdapter = RaOperationUtil . buildResourceAdaptersObject ( operation ) ; <END_BUG> final ServiceController < ? > resourceAdaptersService = context . getServiceRegistry ( false ) . getService ( RESOURCEADAPTERS_SERVICE ) ; ServiceController < ? > controller = null ; if ( resourceAdaptersService == null ) { controller = serviceTarget . addService ( RESOURCEADAPTERS_SERVICE , new ResourceAdaptersService ( ) ) . setInitialMode ( ACTIVE ) . addListener ( verificationHandler ) . install ( ) ; } ServiceName raServiceName = ServiceName . of ( RA_SERVICE , name ) ; ResourceAdapterService raService = new ResourceAdapterService ( resourceAdapter ) ; serviceTarget . addService ( raServiceName , raService ) . setInitialMode ( ACTIVE ) . addDependency ( RESOURCEADAPTERS_SERVICE , ModifiableResourceAdaptors . class , raService . getResourceAdaptersInjector ( ) ) . addListener ( verificationHandler ) . install ( ) ; context . addStep ( verificationHandler , VERIFY ) ; if ( ( context . completeStep ( ) ) == ( ResultAction . ROLLBACK ) ) { if ( controller != null ) { context . removeService ( RESOURCEADAPTERS_SERVICE ) ; } } } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
ModifiableResourceAdapter resourceAdapter = RaOperationUtil . buildResourceAdaptersObject ( context , operation ) ;
Buggy code:
public class Startup { public static void main ( String [ ] args ) { TipCalculatorService tipCalculatorMaster = new TipCalculatorService ( ) ; <START_BUG> tipCalculatorMaster . processTip ( new RestaurantTipCalculator ( ) ) ; <END_BUG> } }

Fix:
tipCalculatorMaster . processTip ( new RestaurantTipCalculator ( ) , new TipOutputConsole ( ) , new TipInputConsole ( ) ) ;
Buggy code:
public class Notification extends AbstractBaseEvent { private Calendar calendar ; private Context mContext ; private String lifestyleContainerKey ; private String reminderContainerKey ; private String actionKey ; private ArrayList < Integer > repeatDays ; private boolean repeatDaysEnabled ; private int repeatEveryBlankDays ; private boolean repeatEveryBlankDaysEnabled ; public Notification ( ) { } public Calendar makeNextNotificationTime ( ) { } public Calendar makeInitialCorrectDay ( ) { } public boolean removeAlarm ( Context context ) { } public void sendNotification ( Context context ) { Scanner in = new Scanner ( this . getKey ( ) ) . useDelimiter ( "[^0-9]+" ) ; int requestID = in . nextInt ( ) ; String title = Storage . getInstance ( ) . getReminder ( reminderContainerKey ) . getName ( ) ; String subTitle = Storage . getInstance ( ) . getLifestyle ( lifestyleContainerKey ) . getName ( ) ; if ( Storage . getInstance ( ) . getReminder ( reminderContainerKey ) . getKey ( ) . equals ( REMINDER_FAILED_KEY ) ) title = "One<seq2seq4repair_space>time<seq2seq4repair_space>Notification" ; if ( Storage . getInstance ( ) . getLifestyle ( lifestyleContainerKey ) . getKey ( ) . equals ( LIFESTYLE_FAILED_KEY ) ) subTitle = "" ; <START_BUG> Storage . getInstance ( ) . getAction ( ACTION_TEST_KEY ) . sendCorrectNotification ( context , title , subTitle , requestID , reminderContainerKey ) ; <END_BUG> } public void setAlarm ( Context context ) { } public String getActionKey ( ) { } public void setActionKey ( String newActionKey ) { } public Calendar getTime ( ) { } public void setTime ( Calendar newCalendar ) { } public ArrayList < Integer > getRepeatDays ( ) { } public void setRepeatDay ( int dayToRepeat , boolean isRepeat ) { } public int getRepeatEveryBlankDays ( ) { } public void setRepeatEveryBlankDays ( int newRepeatEveryBlankDays ) { } public boolean isRepeating ( ) { } public String getLifestyleContainerKey ( ) { } public void setLifestyleContainerKey ( String lifestyleContainerKey ) { } public String getReminderContainerKey ( ) { } public void setReminderContainerKey ( String reminderContainerKey ) { } public boolean isRepeatEveryBlankDaysEnabled ( ) { } public boolean isRepeatDaysEnabled ( ) { } public void setRepeatDaysEnabled ( boolean repeatDaysEnabled ) { } public void setRepeatEveryBlankDaysEnabled ( boolean repeatEveryBlankDaysEnabled ) { } @ Override public void clean ( ) { } }

Fix:
Storage . getInstance ( ) . getAction ( this . getActionKey ( ) ) . sendCorrectNotification ( context , title , subTitle , requestID , reminderContainerKey ) ;
Buggy code:
public abstract class AbstractTrace implements Trace { protected Class tracedClass ; private static SimpleDateFormat timeFormat ; protected AbstractTrace ( Class clazz ) { } public abstract void enter ( String methodName , Object thiz , Object [ ] args ) { } public abstract void enter ( String methodName , Object thiz ) { } public abstract void exit ( String methodName , Object ret ) { } public abstract void exit ( String methodName , Throwable th ) { } public void enter ( String methodName ) { } public void enter ( String methodName , Object thiz , Object arg ) { } public void enter ( String methodName , Object thiz , boolean z ) { } public void exit ( String methodName , boolean b ) { } public void event ( String methodName , Object thiz , Object arg ) { } public void warn ( String message ) { } public void error ( String message ) { } public void fatal ( String message ) { } protected String formatMessage ( String kind , String className , String methodName , Object thiz , Object [ ] args ) { } protected String formatMessage ( String kind , String text , Throwable th ) { } private static String formatDate ( Date date ) { } protected Object formatObj ( Object obj ) { if ( ( ( ( ( ( ( ( ( obj == null ) || ( obj instanceof String ) ) || ( obj instanceof Number ) ) || ( obj instanceof Boolean ) ) || ( obj instanceof Exception ) ) || ( obj instanceof Character ) ) || ( obj instanceof Class ) ) || ( obj instanceof File ) ) || ( obj instanceof StringBuffer ) ) return obj ; else if ( obj . getClass ( ) . isArray ( ) ) { return formatArray ( obj ) ; } else if ( obj instanceof Collection ) { return formatCollection ( ( ( Collection ) ( obj ) ) ) ; } else try { if ( obj instanceof Traceable ) { Traceable t = ( ( Traceable ) ( obj ) ) ; return t . toTraceString ( ) ; } else <START_BUG> return ( ( obj . getClass ( ) . getName ( ) ) + "@" ) + ( Integer . toHexString ( obj . hashCode ( ) ) ) ; <END_BUG> } catch ( Exception ex ) { return ( obj . getClass ( ) . getName ( ) ) + "@FFFFFFFF" ; } } protected String formatArray ( Object obj ) { } protected String formatCollection ( Collection c ) { } protected String formatArgs ( Object [ ] args ) { } protected Object [ ] formatObjects ( Object [ ] args ) { } }

Fix:
return ( ( obj . getClass ( ) . getName ( ) ) + "@" ) + ( Integer . toHexString ( System . identityHashCode ( obj ) ) ) ;
Buggy code:
public interface CacheGroupConfiguration { Cache < ? , ? > getCache ( ) { } <START_BUG> InfinispanNodeFactory getNodeFactory ( ) ; <END_BUG> }

Fix:
CacheNodeFactory getNodeFactory ( ) ;
Buggy code:
@ Slf4j @ RestController @ RequestMapping ( "//rest//tagconfigurations" ) public class TagConfigurationController { @ Resource private Validator validator ; @ Resource ( name = "alien-es-dao" ) private IGenericSearchDAO dao ; private void ensureNameAndTypeUnicity ( final String name , final String target , final String id ) { } @ ApiOperation ( "Save<seq2seq4repair_space>tag<seq2seq4repair_space>configuration." ) @ RequestMapping ( method = RequestMethod . POST , produces = MediaType . APPLICATION_JSON_VALUE , consumes = MediaType . APPLICATION_JSON_VALUE ) @ PreAuthorize ( "hasAuthority('ADMIN')" ) @ Audit public RestResponse < TagConfigurationSaveResponse > saveConfiguration ( @ RequestBody MetaPropConfiguration configuration ) { } @ ApiOperation ( "Search<seq2seq4repair_space>for<seq2seq4repair_space>tag<seq2seq4repair_space>configurations<seq2seq4repair_space>registered<seq2seq4repair_space>in<seq2seq4repair_space>ALIEN." ) @ RequestMapping ( value = "//search" , method = RequestMethod . POST , consumes = MediaType . APPLICATION_JSON_VALUE , produces = MediaType . APPLICATION_JSON_VALUE ) <START_BUG> @ PreAuthorize ( "authenticated()" ) <END_BUG> public RestResponse < FacetedSearchResult > search ( @ RequestBody SearchRequest request ) { FacetedSearchResult result = dao . facetedSearch ( MetaPropConfiguration . class , request . getQuery ( ) , request . getFilters ( ) , null , request . getFrom ( ) , request . getSize ( ) ) ; return RestResponseBuilder . < FacetedSearchResult > builder ( ) . data ( result ) . build ( ) ; } @ ApiOperation ( "Remove<seq2seq4repair_space>tag<seq2seq4repair_space>configuration." ) @ RequestMapping ( value = "//{tagConfigurationId}" , method = RequestMethod . DELETE , produces = MediaType . APPLICATION_JSON_VALUE ) @ PreAuthorize ( "hasAuthority('ADMIN')" ) @ Audit public RestResponse < Void > removeConfiguration ( @ PathVariable String tagConfigurationId ) { } @ ApiOperation ( "Get<seq2seq4repair_space>tag<seq2seq4repair_space>configuration." ) @ RequestMapping ( value = "//{tagConfigurationId}" , method = RequestMethod . GET , produces = MediaType . APPLICATION_JSON_VALUE ) @ PreAuthorize ( "hasAuthority('ADMIN')" ) public RestResponse < MetaPropConfiguration > getConfiguration ( @ PathVariable String tagConfigurationId ) { } }

Fix:
@ PreAuthorize ( "isAuthenticated()" )
Buggy code:
@ SuppressWarnings ( "unchecked" ) public class TestEntityService extends ReefConnectionTestBase { private interface IKeyGen < T > { public String getKey ( T value ) { } } private static < T > Map < String , T > toMap ( List < T > list , TestEntityService . IKeyGen < T > gen ) { } private Map < String , Entity > getEntityMap ( List < Entity > list ) { } private Map < String , Point > getPointMap ( List < Point > list ) { } @ Test public void getAllEntities ( ) throws ReefServiceException { } @ Test public void getSubstationEntities ( ) throws ReefServiceException { } @ Test public void getStatusOfTypeBreaker ( ) throws ReefServiceException { } @ Test public void getCommandOfTypeSetpoint ( ) throws ReefServiceException { } @ Test public void pointToPointEntityConsistency ( ) throws ReefServiceException { } @ Test public void equipmentToPointConsistency ( ) throws ReefServiceException { } @ Test public void allControlsHaveOnePointForFeedback ( ) throws ReefServiceException { } @ Test public void commandsToPointsMapping ( ) throws ReefServiceException { EntityService es = helpers ; Entity sub = es . getEntityByName ( "StaticSubstation" ) ; List < EntityRelation > relations = new LinkedList < EntityRelation > ( ) ; relations . add ( new EntityRelation ( "owns" , "Point" , true ) ) ; relations . add ( new EntityRelation ( "feedback" , "Command" , true ) ) ; List < Entity > points = es . getEntityRelations ( sub . getUuid ( ) , relations ) ; assertEquals ( points . size ( ) , 3 ) ; int cmdCount = 0 ; for ( Entity point : points ) { if ( ( point . getRelationsCount ( ) ) > 0 ) { assertEquals ( point . getRelationsCount ( ) , 1 ) ; Relationship feedback = point . getRelationsList ( ) . get ( 0 ) ; assertEquals ( feedback . getRelationship ( ) , "feedback" ) ; List < Entity > commands = feedback . getEntitiesList ( ) ; assertTrue ( ( ( commands . size ( ) ) > 0 ) ) ; for ( Entity command : commands ) { assertTrue ( command . getTypesList ( ) . contains ( "Command" ) ) ; cmdCount ++ ; } } } <START_BUG> assertEquals ( cmdCount , 3 ) ; <END_BUG> } @ Test public void getEquipmentInASubstation ( ) throws ReefServiceException { } @ Test public void testEntityRelationCallsFailWithBadRequests ( ) throws ReefServiceException { } }

Fix:
assertEquals ( cmdCount , 4 ) ;