nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CLInterface extends CLIOption implements Runnable { private CLInput input ; private String menuCommand = "" ; public CLInterface ( DataStorage newData ) { } public CLInterface ( PodcastList podcasts , URLDownloadList urlDownloads , ProgSettings settings ) { } private void initializeMenus ( ) { } public void userInput ( ) { debug = true ; System . out . print ( "->" ) ; String menuInput = input . getStringInput ( ) ; String methodCall = "" ; if ( ( ( menuInput . length ( ) ) > 0 ) && ( menuInput != null ) ) { methodCall = menuInput . split ( "<seq2seq4repair_space>" , 2 ) [ 0 ] ; if ( ! ( options . containsKey ( methodCall ) ) ) { if ( ( ( data . getSettings ( ) . findSetting ( "menuVisible" ) ) == null ) || ( data . getSettings ( ) . findSetting ( "menuVisible" ) . equalsIgnoreCase ( "true" ) ) ) { ReturnCall returnValue = new ReturnCall ( ) ; returnValue . execute = true ; if ( ( menuCommand . length ( ) ) > 0 ) { returnValue . methodCall = menuCommand . split ( "<seq2seq4repair_space>" ) [ 0 ] ; returnValue . methodParameters = ( ( ( menuCommand . substring ( menuCommand . split ( "<seq2seq4repair_space>" ) [ 0 ] . length ( ) ) ) + "<seq2seq4repair_space>" ) + menuInput ) . trim ( ) ; } else { returnValue . methodCall = menuCommand ; returnValue . methodParameters = menuInput ; } if ( debug ) { debugLog . logInfo ( "Before<seq2seq4repair_space>the<seq2seq4repair_space>methodCall" ) ; debugLog . logInfo ( ( "methodCall:<seq2seq4repair_space>" + ( returnValue . methodCall ) ) ) ; debugLog . logInfo ( ( "methodParameters:<seq2seq4repair_space>" + ( returnValue . methodParameters ) ) ) ; } returnValue = options . get ( returnValue . methodCall . toLowerCase ( ) ) . execute ( returnValue . methodParameters ) ; if ( debug ) { debugLog . logInfo ( "After<seq2seq4repair_space>the<seq2seq4repair_space>methodCall" ) ; debugLog . logInfo ( ( "methodCall:<seq2seq4repair_space>" + ( returnValue . methodCall ) ) ) ; debugLog . logInfo ( ( "methodParameters:<seq2seq4repair_space>" + ( returnValue . methodParameters ) ) ) ; } if ( ( returnValue . methodCall . length ( ) ) > 0 ) { menuCommand = returnValue . methodCall ; if ( ( returnValue . methodParameters . length ( ) ) > 0 ) menuCommand += "<seq2seq4repair_space>" + ( returnValue . methodParameters ) ; } else menuCommand = "" ; if ( debug ) debugLog . logInfo ( ( "menuCommand:<seq2seq4repair_space>" + ( menuCommand ) ) ) ; } } else { <START_BUG> options . get ( methodCall . toLowerCase ( ) ) . execute ( menuInput . split ( "<seq2seq4repair_space>" , 2 ) [ 1 ] ) ; <END_BUG> } } } @ Override public void run ( ) { } private Date convertDate ( String menuInput ) { } public DataStorage getData ( ) { } public void setData ( DataStorage data ) { } @ Override public ReturnCall execute ( String command ) { } public static class MenuPath { public String name ; public String value ; public MenuPath ( String newName , String newValue ) { } } }

Fix:
options . get ( methodCall . toLowerCase ( ) ) . execute ( ( ( menuInput . split ( "<seq2seq4repair_space>" , 2 ) . length ) == 2 ? menuInput . split ( "<seq2seq4repair_space>" , 2 ) [ 1 ] : "" ) ) ;
Buggy code:
public abstract class LzoRecordReader < K , V > extends RecordReader < K , V > { private static final Logger LOG = LoggerFactory . getLogger ( LzoRecordReader . class ) ; protected long start_ ; protected long pos_ ; protected long end_ ; private FSDataInputStream fileIn_ ; @ Override public float getProgress ( ) { } public synchronized long getPos ( ) throws IOException { } public long getLzoFilePos ( ) throws IOException { } @ Override public void initialize ( InputSplit genericSplit , TaskAttemptContext context ) throws IOException , InterruptedException { FileSplit split = ( ( FileSplit ) ( genericSplit ) ) ; start_ = split . getStart ( ) ; end_ = ( start_ ) + ( split . getLength ( ) ) ; final Path file = split . getPath ( ) ; Configuration job = context . getConfiguration ( ) ; FileSystem fs = file . getFileSystem ( job ) ; CompressionCodecFactory compressionCodecs = new CompressionCodecFactory ( job ) ; final CompressionCodec codec = compressionCodecs . getCodec ( file ) ; if ( codec == null ) { <START_BUG> throw new IOException ( ( ( "No<seq2seq4repair_space>codec<seq2seq4repair_space>for<seq2seq4repair_space>file<seq2seq4repair_space>" + file ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found,<seq2seq4repair_space>cannot<seq2seq4repair_space>run" ) ) ; <END_BUG> } fileIn_ = fs . open ( split . getPath ( ) ) ; createInputReader ( codec . createInputStream ( fileIn_ ) , job ) ; LzoRecordReader . LOG . info ( ( "Seeking<seq2seq4repair_space>to<seq2seq4repair_space>split<seq2seq4repair_space>start<seq2seq4repair_space>at<seq2seq4repair_space>pos<seq2seq4repair_space>" + ( start_ ) ) ) ; if ( ( start_ ) != 0 ) { fileIn_ . seek ( start_ ) ; skipToNextSyncPoint ( false ) ; start_ = fileIn_ . getPos ( ) ; LzoRecordReader . LOG . info ( ( "Start<seq2seq4repair_space>is<seq2seq4repair_space>now<seq2seq4repair_space>" + ( start_ ) ) ) ; } else { skipToNextSyncPoint ( true ) ; } pos_ = start_ ; } protected abstract void createInputReader ( InputStream input , Configuration conf ) throws IOException { } protected abstract void skipToNextSyncPoint ( boolean atFirstRecord ) throws IOException { } }

Fix:
throw new IOException ( ( ( "No<seq2seq4repair_space>codec<seq2seq4repair_space>for<seq2seq4repair_space>file<seq2seq4repair_space>" + file ) + "<seq2seq4repair_space>found,<seq2seq4repair_space>cannot<seq2seq4repair_space>run" ) ) ;
Buggy code:
public class NeedsNetworkJob extends Job { public NeedsNetworkJob ( ) { } @ Override protected void run ( ) { } @ Override protected void addedToQueue ( ) { } public static class Builder extends Job . Builder { public Job build ( ) { <START_BUG> return new SleepForTwentyJob ( ) ; <END_BUG> } } }

Fix:
return new NeedsNetworkJob ( ) ;
Buggy code:
public class BinaryMemtable { private static Logger logger_ = Logger . getLogger ( Memtable . class ) ; private int threshold_ = ( ( DatabaseDescriptor . getBMTThreshold ( ) ) * 1024 ) * 1024 ; private AtomicInteger currentSize_ = new AtomicInteger ( 0 ) ; private String table_ ; private String cfName_ ; private boolean isFrozen_ = false ; private Map < String , byte [ ] > columnFamilies_ = new org . cliffc . high_scale_lib . NonBlockingHashMap < String , byte [ ] > ( ) ; Lock lock_ = new ReentrantLock ( ) ; Condition condition_ ; BinaryMemtable ( String table , String cfName ) throws IOException { } public int getMemtableThreshold ( ) { } void resolveSize ( int oldSize , int newSize ) { } boolean isThresholdViolated ( ) { } String getColumnFamily ( ) { } void put ( String key , byte [ ] buffer ) throws IOException { } private void resolve ( String key , byte [ ] buffer ) { } void flush ( ) throws IOException { if ( ( columnFamilies_ . size ( ) ) == 0 ) return ; String path ; SSTableWriter writer ; ColumnFamilyStore cfStore = Table . open ( table_ ) . getColumnFamilyStore ( cfName_ ) ; List < String > keys = new ArrayList < String > ( columnFamilies_ . keySet ( ) ) ; lock_ . lock ( ) ; try { path = cfStore . getTempSSTablePath ( ) ; writer = new SSTableWriter ( path , keys . size ( ) , StorageService . getPartitioner ( ) ) ; } finally { lock_ . unlock ( ) ; } final IPartitioner partitioner = StorageService . getPartitioner ( ) ; final Comparator < String > dc = partitioner . getDecoratedKeyComparator ( ) ; Collections . sort ( keys , dc ) ; for ( String key : keys ) { byte [ ] bytes = columnFamilies_ . get ( key ) ; if ( ( bytes . length ) > 0 ) { writer . append ( key , bytes ) ; } } <START_BUG> cfStore . storeLocation ( writer . closeAndOpenReader ( DatabaseDescriptor . getKeysCachedFraction ( table_ ) ) ) ; <END_BUG> columnFamilies_ . clear ( ) ; } }

Fix:
cfStore . storeLocation ( writer . closeAndOpenReader ( ) ) ;
Buggy code:
public class PropertiesProxy { private boolean utf8 ; private MultiLineProperties mp ; public PropertiesProxy ( ) { } public PropertiesProxy ( boolean utf8 ) { } public void setPaths ( String ... paths ) { mp = new MultiLineProperties ( ) ; List < NutResource > list = Scans . me ( ) . loadResource ( "^.+[.]properties$" , paths ) ; try { if ( utf8 ) for ( NutResource nr : list ) <START_BUG> mp . load ( nr . getReader ( ) ) ; <END_BUG> else { Properties p = new Properties ( ) ; for ( NutResource nr : list ) { p . load ( nr . getInputStream ( ) ) ; } mp . putAll ( p ) ; } } catch ( IOException e ) { throw Lang . wrapThrow ( e ) ; } } public void put ( String key , String value ) { } public String get ( String key ) { } public String get ( String key , String defaultValue ) { } public int getInt ( String key ) { } public int getInt ( String key , int defaultValue ) { } public long getLong ( String key ) { } public long getLong ( String key , long dfval ) { } public String getTrim ( String key ) { } public String getTrim ( String key , String defaultValue ) { } public List < String > getKeys ( ) { } public Collection < String > getValues ( ) { } }

Fix:
mp . load ( nr . getReader ( ) , false ) ;
Buggy code:
public final class EditBook extends AuthenticatedWebPage { static final Book otherBook = new Book ( "Frisbee<seq2seq4repair_space>Techniques" , "Marty<seq2seq4repair_space>van<seq2seq4repair_space>Hoff" , Book . FICTION ) ; public EditBook ( final Book book ) { } public static PageLink link ( final String name , final long id ) { } public static final class EditBookForm extends Form { public EditBookForm ( final String id , final Book book ) { } public final void onSubmit ( ) { final RequestCycle cycle = getRequestCycle ( ) ; PageParameters parameters = new PageParameters ( ) ; final Book book = ( ( Book ) ( getModelObject ( ) ) ) ; <START_BUG> parameters . put ( "id" , new Long ( book . getId ( ) ) ) ; <END_BUG> cycle . setResponsePage ( getPageFactory ( ) . newPage ( BookDetails . class , parameters ) ) ; cycle . setRedirect ( true ) ; } } }

Fix:
parameters . put ( "id" , book . getId ( ) ) ;
Buggy code:
public final class BatchResponse implements Serializable { private static final long serialVersionUID = 1057416839397037706L ; private final List < BatchResponse . Result < Boolean > > deleteResult ; private final List < BatchResponse . Result < BlobInfo > > updateResult ; private final List < BatchResponse . Result < BlobInfo > > getResult ; private final List < BatchResponse . Result < BlobInfo > > patchResult ; public static class Result < T extends Serializable > implements Serializable { private static final long serialVersionUID = - 1946539570170529094L ; private static final BatchResponse . Result < Serializable > EMPTY = BatchResponse . Result . of ( null ) ; private final T value ; private final StorageException exception ; public Result ( T value ) { } public Result ( StorageException exception ) { } static < T extends Serializable > BatchResponse . Result < T > of ( T value ) { } public T get ( ) throws StorageException { } public StorageException failure ( ) { } public boolean failed ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { if ( ! ( obj instanceof BatchResponse . Result ) ) { return false ; } BatchResponse . Result < ? > other = ( ( BatchResponse . Result < ? > ) ( obj ) ) ; return ( Objects . equals ( value , other . value ) ) && ( Objects . equals ( exception , other . exception ) ) ; } @ Override public String toString ( ) { } static < T extends Serializable > BatchResponse . Result < T > empty ( ) { } } public BatchResponse ( List < BatchResponse . Result < Boolean > > deleteResult , List < BatchResponse . Result < BlobInfo > > updateResult , List < BatchResponse . Result < BlobInfo > > getResult , List < BatchResponse . Result < BlobInfo > > patchResult ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { if ( ! ( obj instanceof BatchResponse ) ) { return false ; } BatchResponse other = ( ( BatchResponse ) ( obj ) ) ; <START_BUG> return ( ( ( Objects . equals ( deleteResult , other . deleteResult ) ) && ( Objects . equals ( updateResult , other . updateResult ) ) ) && ( Objects . equals ( updateResult , other . updateResult ) ) ) && ( Objects . equals ( patchResult , other . patchResult ) ) ; <END_BUG> } public List < BatchResponse . Result < Boolean > > deletes ( ) { } public List < BatchResponse . Result < BlobInfo > > updates ( ) { } public List < BatchResponse . Result < BlobInfo > > gets ( ) { } public List < BatchResponse . Result < BlobInfo > > patches ( ) { } }

Fix:
return ( ( ( Objects . equals ( deleteResult , other . deleteResult ) ) && ( Objects . equals ( updateResult , other . updateResult ) ) ) && ( Objects . equals ( getResult , other . getResult ) ) ) && ( Objects . equals ( patchResult , other . patchResult ) ) ;
Buggy code:
public class ScheduledThreadPoolMetricsHandler extends ThreadPoolMetricsHandler { public static final List < AttributeDefinition > METRICS = Arrays . asList ( ACTIVE_COUNT , COMPLETED_TASK_COUNT , CURRENT_THREAD_COUNT , LARGEST_THREAD_COUNT , TASK_COUNT , QUEUE_SIZE ) ; public ScheduledThreadPoolMetricsHandler ( final ServiceName serviceNameBase ) { } @ Override protected void setResult ( OperationContext context , final String attributeName , final Service < ? > service ) throws OperationFailedException { final ScheduledThreadPoolService pool = ( ( ScheduledThreadPoolService ) ( 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 . TASK_COUNT ) ) { context . getResult ( ) . set ( pool . getTaskCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . QUEUE_SIZE ) ) { context . getResult ( ) . set ( pool . getQueueSize ( ) ) ; } else { <START_BUG> throw MESSAGES . unsupportedScheduledThreadPoolMetric ( attributeName ) ; <END_BUG> } } }

Fix:
throw ROOT_LOGGER . unsupportedScheduledThreadPoolMetric ( attributeName ) ;
Buggy code:
class ConnectionFactoryAdd implements ModelAddOperationHandler { static final ConnectionFactoryAdd INSTANCE = new ConnectionFactoryAdd ( ) ; private static final String [ ] NO_BINDINGS = new String [ 0 ] ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) { } static ConnectionFactoryConfiguration createConfiguration ( final String name , final ModelNode operation ) { } static String [ ] jndiBindings ( final ModelNode node ) { } static ModelNode getAddOperation ( final ModelNode address , ModelNode subModel ) { final ModelNode operation = new ModelNode ( ) ; operation . get ( OP ) . set ( ADD ) ; operation . get ( OP_ADDR ) . set ( address ) ; for ( final NodeAttribute attribute : JMSServices . CONNECTION_FACTORY_ATTRS ) { final String attrName = attribute . getName ( ) ; <START_BUG> if ( operation . hasDefined ( attrName ) ) { <END_BUG> operation . get ( attrName ) . set ( subModel . get ( attrName ) ) ; } } return operation ; } }

Fix:
if ( subModel . has ( attrName ) ) {
Buggy code:
public class MSVSSGET extends MSVSS { private String m_LocalPath = null ; private boolean m_Recursive = false ; private boolean m_Writable = false ; private String m_Version = null ; private String m_Date = null ; private String m_Label = null ; private String m_AutoResponse = null ; public void execute ( ) throws BuildException { } public void setLocalpath ( Path localPath ) { } public void getLocalpathCommand ( Commandline cmd ) { if ( ( m_LocalPath ) == null ) { return ; } else { File dir = project . resolveFile ( m_LocalPath ) ; if ( ! ( dir . exists ( ) ) ) { boolean done = dir . mkdirs ( ) ; if ( done == false ) { <START_BUG> String msg = ( ( "Directory<seq2seq4repair_space>" + ( m_LocalPath ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "succesful<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ; <END_BUG> throw new BuildException ( msg , location ) ; } project . log ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } cmd . createArgument ( ) . setValue ( ( ( FLAG_OVERRIDE_WORKING_DIR ) + ( m_LocalPath ) ) ) ; } } public void setRecursive ( boolean recursive ) { } public void getRecursiveCommand ( Commandline cmd ) { } public final void setWritable ( boolean argWritable ) { } public void getWritableCommand ( Commandline cmd ) { } public void setVersion ( String version ) { } public void setDate ( String date ) { } public void setLabel ( String label ) { } public void getVersionCommand ( Commandline cmd ) { } public void setAutoresponse ( String response ) { } public void getAutoresponse ( Commandline cmd ) { } }

Fix:
String msg = ( ( "Directory<seq2seq4repair_space>" + ( m_LocalPath ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "succesfull<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ;
Buggy code:
class RemoteNamingLogger implements RemoteNamingServerLogger { static final RemoteNamingLogger INSTANCE = new RemoteNamingLogger ( ) ; private RemoteNamingLogger ( ) { } public void failedToSendHeader ( final IOException exception ) { } public void failedToDetermineClientVersion ( final IOException exception ) { } public void closingChannel ( final Channel channel , final Throwable t ) { } public void closingChannelOnChannelEnd ( final Channel channel ) { } public void unnexpectedError ( final Throwable t ) { <START_BUG> NamingLogger . ROOT_LOGGER . unnexpectedError ( t ) ; <END_BUG> } public void nullCorrelationId ( final Throwable t ) { } public void failedToSendExceptionResponse ( final IOException exception ) { } public void unexpectedParameterType ( final byte expected , final byte actual ) { } }

Fix:
NamingLogger . ROOT_LOGGER . unexpectedError ( t ) ;
Buggy code:
if ( ( referFixed != null ) && ( ( defaultAtt != null ) || ( ( fixedAtt != null ) && ( ! ( referFixed . equals ( fixedStr ) ) ) ) ) ) { reportGenericSchemaError ( ( "au-props-correct.2:<seq2seq4repair_space>If<seq2seq4repair_space>the<seq2seq4repair_space>{attribute<seq2seq4repair_space>declaration}<seq2seq4repair_space>has<seq2seq4repair_space>a<seq2seq4repair_space>fixed<seq2seq4repair_space>{value<seq2seq4repair_space>constraint},<seq2seq4repair_space>then<seq2seq4repair_space>if<seq2seq4repair_space>the<seq2seq4repair_space>attribute<seq2seq4repair_space>use<seq2seq4repair_space>itself<seq2seq4repair_space>has<seq2seq4repair_space>a<seq2seq4repair_space>{value<seq2seq4repair_space>constraint},<seq2seq4repair_space>it<seq2seq4repair_space>must<seq2seq4repair_space>also<seq2seq4repair_space>be<seq2seq4repair_space>fixed<seq2seq4repair_space>and<seq2seq4repair_space>its<seq2seq4repair_space>value<seq2seq4repair_space>must<seq2seq4repair_space>match<seq2seq4repair_space>that<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>{attribute<seq2seq4repair_space>declaration}'s<seq2seq4repair_space>{value<seq2seq4repair_space>constraint}" + errorContext ) ) ; } if ( ( ! isOptional ) || ( ( fixedStr . length ( ) ) > 0 ) ) { int referredAttName = fStringPool . addSymbol ( referredAttribute . getAttribute ( ATT_NAME ) ) ; uriIndex = StringPool . EMPTY_STRING ; if ( ( fTargetNSURIString . length ( ) ) > 0 ) { uriIndex = fTargetNSURI ; } QName referredAttQName = new QName ( ( - 1 ) , referredAttName , referredAttName , uriIndex ) ; int tempIndex = fSchemaGrammar . getAttributeDeclIndex ( typeInfo . templateElementIndex , referredAttQName ) ; XMLAttributeDecl referredAttrDecl = new XMLAttributeDecl ( ) ; fSchemaGrammar . getAttributeDecl ( tempIndex , referredAttrDecl ) ; boolean updated = false ; int useDigits = ( ( XMLAttributeDecl . USE_TYPE_OPTIONAL ) | ( XMLAttributeDecl . USE_TYPE_PROHIBITED ) ) | ( XMLAttributeDecl . USE_TYPE_REQUIRED ) ; int valueDigits = ( XMLAttributeDecl . VALUE_CONSTRAINT_DEFAULT ) | ( XMLAttributeDecl . VALUE_CONSTRAINT_FIXED ) ; if ( ( ! isOptional ) && ( ( ( referredAttrDecl . defaultType ) & useDigits ) != ( attValueAndUseType & useDigits ) ) ) { if ( ( referredAttrDecl . defaultType ) != ( XMLAttributeDecl . USE_TYPE_PROHIBITED ) ) { referredAttrDecl . defaultType |= useDigits ; referredAttrDecl . defaultType ^= useDigits ; referredAttrDecl . defaultType |= attValueAndUseType & useDigits ; updated = true ; } } if ( ( fixedStr . length ( ) ) > 0 ) { if ( ( ( referredAttrDecl . defaultType ) & ( XMLAttributeDecl . VALUE_CONSTRAINT_FIXED ) ) == 0 ) { referredAttrDecl . defaultType |= valueDigits ; referredAttrDecl . defaultType ^= valueDigits ; referredAttrDecl . defaultType |= XMLAttributeDecl . VALUE_CONSTRAINT_FIXED ; <START_BUG> referredAttrDecl . defaultValue = fStringPool . toString ( attValueConstraint ) ; <END_BUG>

Fix:
referredAttrDecl . defaultValue = fixedStr ;
Buggy code:
public class Aspects { private static final Class [ ] EMPTY_CLASS_ARRAY = new Class [ 0 ] ; private static final Class [ ] PEROBJECT_CLASS_ARRAY = new Class [ ] { Object . class } ; private static final Object [ ] EMPTY_OBJECT_ARRAY = new Object [ 0 ] ; private static final String ASPECTOF = "aspectOf" ; public static Object aspectOf ( Class aspectClass ) throws NoAspectBoundException { } public static Object aspectOf ( Class aspectClass , Object perObject ) throws NoAspectBoundException { } public static Object aspectOf ( Class aspectClass , Thread perThread ) throws NoAspectBoundException { } private static Method getSingletonAspectOf ( Class aspectClass ) throws NoSuchMethodException { } private static Method getPerObjectAspectOf ( Class aspectClass ) throws NoSuchMethodException { } private static Method checkAspectOf ( Method method , Class aspectClass ) throws NoSuchMethodException { method . setAccessible ( true ) ; if ( ( ( ! ( method . isAccessible ( ) ) ) || ( ! ( Modifier . isPublic ( method . getModifiers ( ) ) ) ) ) || ( ! ( Modifier . isStatic ( method . getModifiers ( ) ) ) ) ) { <START_BUG> new NoSuchMethodException ( ( ( aspectClass . getName ( ) ) + ".aspectOf(..)<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>accessible<seq2seq4repair_space>public<seq2seq4repair_space>static" ) ) ; <END_BUG> } return method ; } }

Fix:
throw new NoSuchMethodException ( ( ( aspectClass . getName ( ) ) + ".aspectOf(..)<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>accessible<seq2seq4repair_space>public<seq2seq4repair_space>static" ) ) ;
Buggy code:
public class ScatterZipOutputStream { private final Queue < ScatterZipOutputStream . CompressedEntry > items = new ConcurrentLinkedQueue < ScatterZipOutputStream . CompressedEntry > ( ) ; private final ScatterGatherBackingStore backingStore ; private final StreamCompressor streamCompressor ; private static class CompressedEntry { final ZipArchiveEntry entry ; final long crc ; final long compressedSize ; final int method ; final long size ; public CompressedEntry ( ZipArchiveEntry entry , long crc , long compressedSize , int method , long size ) { } public ZipArchiveEntry transferToArchiveEntry ( ) { } } public ScatterZipOutputStream ( ScatterGatherBackingStore backingStore , StreamCompressor streamCompressor ) { } public void addArchiveEntry ( ZipArchiveEntry zipArchiveEntry , InputStream payload , int method ) throws IOException { } public void writeTo ( ZipArchiveOutputStream target ) throws IOException { <START_BUG> backingStore . close ( ) ; <END_BUG> InputStream data = backingStore . getInputStream ( ) ; for ( ScatterZipOutputStream . CompressedEntry compressedEntry : items ) { final BoundedInputStream rawStream = new BoundedInputStream ( data , compressedEntry . compressedSize ) ; target . addRawArchiveEntry ( compressedEntry . transferToArchiveEntry ( ) , rawStream ) ; rawStream . close ( ) ; } data . close ( ) ; } public static ScatterZipOutputStream fileBased ( File file ) throws FileNotFoundException { } public static ScatterZipOutputStream fileBased ( File file , int compressionLevel ) throws FileNotFoundException { } }

Fix:
backingStore . closeForWriting ( ) ;
Buggy code:
public class WebRequestWithCryptedUrl extends ServletWebRequest { private final String queryString ; private final ValueMap parameters ; public WebRequestWithCryptedUrl ( final HttpServletRequest request ) { } public String decodeURL ( final String url ) { } private String rebuildUrl ( String queryString ) { } private ValueMap analyzeQueryString ( final String queryString ) { } public String getParameter ( final String key ) { } public Map getParameterMap ( ) { <START_BUG> HashMap map = new HashMap ( parameters . size ( ) , 1 ) ; <END_BUG> Iterator it = parameters . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { String param = ( ( String ) ( it . next ( ) ) ) ; map . put ( param , getParameter ( param ) ) ; } return Collections . unmodifiableMap ( map ) ; } public String [ ] getParameters ( final String key ) { } public String toString ( ) { } }

Fix:
Map map = new HashMap ( parameters . size ( ) , 1 ) ;
Buggy code:
public class ValidateUserState extends AbstractValidationState { private static final String [ ] BAD_USER_NAMES = new String [ ] { "admin" , "administrator" , "root" } ; private static final char [ ] VALID_PUNCTUATION ; private static final String VALID_SYMBOLS ; private final StateValues stateValues ; private final ConsoleWrapper theConsole ; public ValidateUserState ( ConsoleWrapper theConsole , final StateValues stateValues ) { } @ Override protected Collection < State > getValidationStates ( ) { } @ Override protected State getSuccessState ( ) { } private State getRetryState ( ) { } private State getValidCharactersState ( ) { } private State getDuplicateCheckState ( ) { return new State ( ) { @ Override public State execute ( ) { if ( ( stateValues . isExistingDisabledUser ( ) ) || ( stateValues . isExistingEnabledUser ( ) ) ) { State duplicateContinuing = ( stateValues . isSilentOrNonInteractive ( ) ) ? null : new PromptNewUserState ( theConsole , stateValues ) ; stateValues . setExistingUser ( true ) ; if ( stateValues . isSilentOrNonInteractive ( ) ) { return ValidateUserState . this ; } else { final boolean existingDisabledUser = stateValues . isExistingDisabledUser ( ) ; if ( existingDisabledUser ) { theConsole . printf ( ROOT_LOGGER . aboutToUpdateDisabledUser ( stateValues . getUserName ( ) ) ) ; } else { theConsole . printf ( ROOT_LOGGER . aboutToUpdateEnabledUser ( stateValues . getUserName ( ) ) ) ; } theConsole . printf ( NEW_LINE ) ; String response = theConsole . readLine ( "(a):<seq2seq4repair_space>" ) ; if ( response == null ) { theConsole . printf ( NEW_LINE ) ; return null ; } ValidateUserState . Option option = convertResponse ( response , existingDisabledUser ) ; switch ( option ) { case NEW : return duplicateContinuing ; case UPDATE : break ; case ENABLE : stateValues . getOptions ( ) . setEnableDisableMode ( true ) ; stateValues . getOptions ( ) . setDisable ( false ) ; return new PreModificationState ( theConsole , stateValues ) ; case DISABLE : stateValues . getOptions ( ) . setEnableDisableMode ( true ) ; stateValues . getOptions ( ) . setDisable ( true ) ; return new PreModificationState ( theConsole , stateValues ) ; default : <START_BUG> return new ErrorState ( theConsole , ROOT_LOGGER . invalidChoiceUpdateUserResponse ( ) , this ) ; <END_BUG> } return ValidateUserState . this ; } } else { stateValues . setExistingUser ( false ) ; return ValidateUserState . this ; } } } ; } private State getCommonNamesCheckState ( ) { } private ValidateUserState . Option convertResponse ( final String response , final boolean existingDisabledUser ) { } private enum Option { UPDATE , DISABLE , ENABLE , NEW , INVALID ; } }

Fix:
return new ErrorState ( theConsole , ROOT_LOGGER . invalidChoiceUpdateUserResponse ( ) , this , stateValues ) ;
Buggy code:
public class AllPoints implements Serializable { private static final long serialVersionUID = - 6405416499845660178L ; private static transient volatile AllPoints instance ; private static HashMap < String , String > allPoints = new HashMap < String , String > ( ) ; private AllPoints ( ) { } public static AllPoints getInstance ( ) { if ( ( AllPoints . instance ) == null ) { synchronized ( AllPoints . class ) { if ( ( AllPoints . instance ) == null ) { AllPoints . instance = new AllPoints ( ) ; <START_BUG> LinkedList < String > temp = Serializer . allPointsLoad ( ) ; <END_BUG> if ( temp != null ) { for ( String point : temp ) { AllPoints . allPoints . put ( point . split ( "//" ) [ 1 ] , point ) ; } } } } } return AllPoints . instance ; } public void clearAllPoints ( ) { } public String getPointFullName ( String pointKey ) { } public IPoint getPoint ( String pointKey ) { } public boolean addPoint ( String pointFullName ) { } public ArrayList < String > addAllPoints ( ArrayList < String > multiPoints ) { } public ArrayList < String > addAllPoints ( String [ ] multiPoints ) { } public ArrayList < String > getAllPointsShortName ( ) { } public ArrayList < String > getAllPoints ( ) { } public ArrayList < String > getAllPointsFull ( ) { } public void save ( ) { } }

Fix:
ArrayList < String > temp = Serializer . allPointsLoad ( ) ;
Buggy code:
public class Controller { private Game game ; private Scanner in ; public Controller ( Game g , Scanner in ) { } public void run ( ) { int option = - 1 ; int col ; boolean exit = false ; boolean valid = false ; boolean undo ; String auxStr ; <START_BUG> Rules gameRules = Rules . CO ; <END_BUG> Move move = null ; do { option = Resources . menu ( game , in ) ; switch ( option ) { case 0 : System . out . print ( "Please<seq2seq4repair_space>provide<seq2seq4repair_space>the<seq2seq4repair_space>column<seq2seq4repair_space>number:<seq2seq4repair_space>" ) ; col = this . in . nextInt ( ) ; auxStr = this . in . nextLine ( ) ; if ( gameRules . equals ( C4 ) ) { move = new tp . pr2 . logic . MoveConnect4 ( col , game . getTurn ( ) ) ; } else if ( gameRules . equals ( CO ) ) { move = new tp . pr2 . logic . MoveComplica ( col , game . getTurn ( ) ) ; } valid = game . executeMove ( move ) ; if ( ! valid ) { System . out . println ( "Invalid<seq2seq4repair_space>move,<seq2seq4repair_space>please<seq2seq4repair_space>try<seq2seq4repair_space>again" ) ; } if ( game . isFinished ( ) ) { exit = true ; } break ; case 1 : undo = false ; undo = game . undo ( ) ; if ( ! undo ) { System . out . println ( "Nothing<seq2seq4repair_space>to<seq2seq4repair_space>undo,<seq2seq4repair_space>please<seq2seq4repair_space>try<seq2seq4repair_space>again" ) ; } break ; case 2 : game . reset ( gameRules . getRules ( ) ) ; System . out . println ( "Game<seq2seq4repair_space>restarted" ) ; break ; case 3 : exit = true ; break ; case 4 : gameRules = Rules . C4 ; game . reset ( new Connect4Rules ( ) ) ; break ; case 5 : gameRules = Rules . CO ; game . reset ( new ComplicaRules ( ) ) ; break ; } if ( game . isFinished ( ) ) { game . getBoard ( ) . printBoard ( ) ; in . close ( ) ; Counter counterWinner = game . getWinner ( ) ; exit = true ; System . out . print ( "Game<seq2seq4repair_space>over." ) ; if ( counterWinner != ( Counter . EMPTY ) ) { if ( counterWinner == ( Counter . WHITE ) ) { System . out . println ( "White<seq2seq4repair_space>wins" ) ; } if ( counterWinner == ( Counter . BLACK ) ) { System . out . println ( "Black<seq2seq4repair_space>wins" ) ; } } else { System . out . println ( "Tie<seq2seq4repair_space>game,<seq2seq4repair_space>no<seq2seq4repair_space>winner" ) ; } } } while ( ! exit ) ; System . out . println ( "Closing<seq2seq4repair_space>the<seq2seq4repair_space>game...<seq2seq4repair_space>" ) ; } }

Fix:
Rules gameRules = Rules . C4 ;
Buggy code:
@ WebServlet ( "//search" ) public class SearchServlet extends HttpServlet { private static final long serialVersionUID = 1L ; protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { ManageUser manageUser = new ManageUser ( ) ; manageUser . authenticationCookie ( request , response ) ; String query = request . getParameter ( "query" ) ; if ( ( query . length ( ) ) > 0 ) { ManageSearch manageSearch = new ManageSearch ( ) ; request . setAttribute ( "query" , query ) ; <START_BUG> if ( manageSearch . search ( query ) ) { <END_BUG> if ( ( ( request . getParameter ( "page" ) ) != null ) && ( Pattern . matches ( "[0-9]+" , request . getParameter ( "page" ) ) ) ) { request . setAttribute ( "pageCurrent" , request . getParameter ( "page" ) ) ; } else { request . setAttribute ( "pageCurrent" , "1" ) ; } request . setAttribute ( "pageMax" , ( ( int ) ( Math . ceil ( ( ( ( float ) ( manageSearch . getResults ( ) . size ( ) ) ) // 10 ) ) ) ) ) ; request . setAttribute ( "results" , manageSearch . getResults ( ) ) ; request . setAttribute ( "suggestions" , manageSearch . getSuggestions ( ) ) ; } } request . getRequestDispatcher ( "jsp//search.jsp" ) . forward ( request , response ) ; } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } }

Fix:
if ( manageSearch . search ( query . toLowerCase ( ) ) ) {
Buggy code:
public class Save implements Command { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String SAVE_ALL_AS = "save_all_as" ; public static final String SAVE_AS = "save_as" ; public static final String SAVE = "save" ; private String testPlanFile ; private static Set commands = new HashSet ( ) ; public Save ( ) { } public Set getActionNames ( ) { } public boolean hasTestPlanFile ( ) { } public void setTestPlanFile ( String f ) { } public void doAction ( ActionEvent e ) throws IllegalUserActionException { HashTree subTree = null ; if ( ! ( Save . commands . contains ( e . getActionCommand ( ) ) ) ) { throw new IllegalUserActionException ( ( "Invalid<seq2seq4repair_space>user<seq2seq4repair_space>command:" + ( e . getActionCommand ( ) ) ) ) ; } if ( e . getActionCommand ( ) . equals ( Save . SAVE_AS ) ) { subTree = GuiPackage . getInstance ( ) . getCurrentSubTree ( ) ; } else { subTree = GuiPackage . getInstance ( ) . getTreeModel ( ) . getTestPlan ( ) ; } String updateFile = testPlanFile ; if ( ( ! ( Save . SAVE . equals ( e . getActionCommand ( ) ) ) ) || ( ( testPlanFile ) == null ) ) { JFileChooser chooser = FileDialoger . promptToSaveFile ( ( ( GuiPackage . getInstance ( ) . getTreeListener ( ) . getCurrentNode ( ) . getName ( ) ) + ".jmx" ) ) ; if ( chooser == null ) { return ; } updateFile = chooser . getSelectedFile ( ) . getAbsolutePath ( ) ; if ( ! ( e . getActionCommand ( ) . equals ( Save . SAVE_AS ) ) ) { setTestPlanFile ( updateFile ) ; } } ActionRouter . getInstance ( ) . doActionNow ( new ActionEvent ( subTree , e . getID ( ) , CheckDirty . SUB_TREE_SAVED ) ) ; try { convertSubTree ( subTree ) ; } catch ( Exception err ) { } Writer writer = null ; FileOutputStream ostream = null ; try { <START_BUG> if ( JMeterUtils . getPropDefault ( "file_format" , "2.1" ) . equals ( "2.0" ) ) { <END_BUG> ostream = new FileOutputStream ( updateFile ) ; OldSaveService . saveSubTree ( subTree , ostream ) ; } else { writer = new FileWriter ( updateFile ) ; SaveService . saveTree ( subTree , writer ) ; } } catch ( Throwable ex ) { testPlanFile = null ; Save . log . error ( "" , ex ) ; throw new IllegalUserActionException ( ( "Couldn't<seq2seq4repair_space>save<seq2seq4repair_space>test<seq2seq4repair_space>plan<seq2seq4repair_space>to<seq2seq4repair_space>file:<seq2seq4repair_space>" + updateFile ) ) ; } finally { closeWriter ( writer ) ; closeStream ( ostream ) ; if ( ( testPlanFile ) != null ) { GuiPackage . getInstance ( ) . getMainFrame ( ) . setTitle ( JMeterUtils . getExtendedFrameTitle ( testPlanFile ) ) ; } GuiPackage . getInstance ( ) . getMainFrame ( ) . repaint ( ) ; } } private void convertSubTree ( HashTree tree ) { } private void closeWriter ( Writer writer ) { } private void closeStream ( FileOutputStream fos ) { } public static class Test extends TestCase { Save save ; public Test ( String name ) { } public void setUp ( ) { } public void testTreeConversion ( ) throws Exception { } } }

Fix:
if ( SaveService . isSaveTestPlanFormat20 ( ) ) {
Buggy code:
public final class SessionSerialiser { private static final ObjectMapper MAPPER = new ObjectMapper ( ) ; private SessionSerialiser ( ) { } public static void write ( final Path file , final SessionState state ) { } public static EnrichedSessionState read ( final Path file ) { } private static SessionState upgradeVersion ( final SessionState original ) { } private static SessionState upgradeVersion1And2 ( final SessionState original ) { } private static SessionWord upgradeVersion1And2 ( final SessionWord original ) { } private static int countWords ( final String identifier , final List < String > uses ) { } private static String identifier ( final String oldIdentifier , final List < String > uses ) { <START_BUG> return uses . stream ( ) . flatMap ( WordStreamTool :: words ) . filter ( ( w ) -> w . equalsIgnoreCase ( oldIdentifier ) ) . reduce ( WordStreamTool :: preferredForm ) . get ( ) ; <END_BUG> } }

Fix:
return uses . stream ( ) . flatMap ( WordStreamTool :: words ) . filter ( ( w ) -> w . equalsIgnoreCase ( oldIdentifier ) ) . reduce ( WordStreamTool :: preferredForm ) . orElse ( oldIdentifier ) ;
Buggy code:
public class RoomManager { private Context context ; public RoomManager ( Context c ) { } public void createRoom ( String roomName , ParseGeoPoint geoPoint ) { } public List < ParseRoom > getNearbyRooms ( double radius , ParseGeoPoint point ) { } public static boolean addUserToRoom ( String roomName ) { } public static ParseRoom getParseRoom ( String roomName ) { } public static void removeUserFromRoom ( String username ) { } public static void deleteRoom ( String roomName ) { } private static void deleteUsersFrom ( String roomName ) { } public static void addTrack ( LocalTrack track , String roomName ) { } public static boolean deleteTrack ( ParseTrack toDelete , String roomName , boolean testFlag ) { ParseRoom currRoom ; ParseMusicQueue currQueue ; RoomUser roomUser ; <START_BUG> ParseQuery < RoomUser > ruQuery = ParseQuery . getQuery ( "RoomUser" ) ; <END_BUG> ruQuery . whereEqualTo ( "username" , ParseUser . getCurrentUser ( ) . getUsername ( ) ) ; try { currRoom = RoomManager . getParseRoom ( roomName ) . fetchIfNeeded ( ) ; currQueue = currRoom . getParseMusicQueue ( ) . fetchIfNeeded ( ) ; List < RoomUser > ruList = ruQuery . find ( ) ; roomUser = ruList . get ( 0 ) ; } catch ( ParseException e ) { return false ; } if ( ( roomUser != null ) && ( ( roomUser . isAdmin ( ) ) || testFlag ) ) { currQueue . deleteTrack ( toDelete ) ; try { currQueue . save ( ) ; } catch ( ParseException e ) { return false ; } return true ; } else { if ( roomUser == null ) { Log . d ( "Delete<seq2seq4repair_space>track" , "roomUser<seq2seq4repair_space>was<seq2seq4repair_space>null" ) ; } else { Log . d ( "Delete<seq2seq4repair_space>track" , "was<seq2seq4repair_space>not<seq2seq4repair_space>an<seq2seq4repair_space>admin" ) ; } } return false ; } }

Fix:
ParseQuery < RoomUser > ruQuery = RoomUser . getQuery ( ) ;
Buggy code:
public class EJBAnnotationPropertyReplacement { public static PropertyReplacer propertyReplacer ( final DeploymentUnit deploymentUnit ) { <START_BUG> Boolean replacement = deploymentUnit . getAttachment ( EJB_ANNOTATION_PROPERTY_REPLACEMENT ) ; <END_BUG> if ( ( replacement == null ) || replacement ) { final PropertyResolver propertyResolver = deploymentUnit . getAttachment ( FINAL_PROPERTY_RESOLVER ) ; return PropertyReplacers . resolvingReplacer ( propertyResolver ) ; } else { return PropertyReplacers . noop ( ) ; } } private EJBAnnotationPropertyReplacement ( ) { } }

Fix:
Boolean replacement = deploymentUnit . getAttachment ( ANNOTATION_PROPERTY_REPLACEMENT ) ;
Buggy code:
public class HockeyApp extends CordovaPlugin { String appId ; public enum DefinedAction { register ; } @ Override public boolean execute ( String action , JSONArray args , CallbackContext callbackContext ) throws JSONException { try { HockeyApp . DefinedAction definedAction = HockeyApp . DefinedAction . valueOf ( action ) ; PluginResult result = null ; switch ( definedAction ) { <START_BUG> case init : <END_BUG> result = register ( args ) ; break ; } result . setKeepCallback ( false ) ; callbackContext . sendPluginResult ( result ) ; return true ; } catch ( Exception e ) { callbackContext . error ( e . getMessage ( ) ) ; return false ; } } private PluginResult register ( JSONArray args ) throws JSONException { } }

Fix:
case register :
Buggy code:
public class SubsystemStateTestCase { @ Test public void testProperties ( ) { } @ Test public void testModules ( ) { } @ Test public void testActivation ( ) { SubsystemState state = new SubsystemState ( ) ; final List < Observable > observables = new ArrayList < Observable > ( ) ; final List < Object > arguments = new ArrayList < Object > ( ) ; Observer o = new Observer ( ) { @ Override public void update ( Observable o , Object arg ) { observables . add ( o ) ; arguments . add ( arg ) ; } } ; state . addObserver ( o ) ; Assert . assertEquals ( "Default" , LAZY , state . getActivationPolicy ( ) ) ; Assert . assertEquals ( "Precondition" , 0 , arguments . size ( ) ) ; state . setActivation ( LAZY ) ; Assert . assertEquals ( 0 , arguments . size ( ) ) ; state . setActivation ( EAGER ) ; Assert . assertEquals ( 1 , arguments . size ( ) ) ; SubsystemState . ChangeEvent event = ( ( SubsystemState . ChangeEvent ) ( arguments . get ( 0 ) ) ) ; <START_BUG> assertEventEquals ( EAGER . toString ( ) , false , ACTIVATION , event ) ; <END_BUG> } private void assertEventEquals ( String id , boolean isRemoved , SubsystemState . ChangeType type , SubsystemState . ChangeEvent event ) { } }

Fix:
assertEventEquals ( EAGER . name ( ) , false , ACTIVATION , event ) ;
Buggy code:
@ Component public class TimestampAttributeGenerator extends AttributeGenerator { private static final String BEGINNING_OF_TIMES = "2000-01-01T00:00:00Z" ; private final DateTimeProvider dateTimeProvider ; @ Autowired TimestampAttributeGenerator ( final DateTimeProvider dateTimeProvider ) { } @ Override public RpslObject generateAttributes ( final RpslObject originalObject , final RpslObject updatedObject , final Update update , final UpdateContext updateContext ) { } private void cleanupTimestampAttributes ( final RpslObjectBuilder builder , final RpslObject updatedObject , final Update update , final UpdateContext updateContext , final boolean withWarnings ) { } private void generateTimestampAttributes ( final RpslObjectBuilder builder , final RpslObject originalObject , final RpslObject updatedObject , final Update update , final UpdateContext updateContext ) { final Action action = updateContext . getAction ( update ) ; Preconditions . checkArgument ( ( ( ( action == ( CREATE ) ) || ( action == ( MODIFY ) ) ) || ( action == ( DELETE ) ) ) ) ; final DateTime now = dateTimeProvider . getCurrentUtcTime ( ) ; final String nowString = now . toString ( ISODateTimeFormat . dateTimeNoMillis ( ) . withZone ( UTC ) ) ; if ( action == ( CREATE ) ) { builder . addAttributeSorted ( new net . ripe . db . whois . common . rpsl . RpslAttribute ( CREATED , nowString ) ) ; builder . addAttributeSorted ( new net . ripe . db . whois . common . rpsl . RpslAttribute ( LAST_MODIFIED , nowString ) ) ; } else if ( action == ( MODIFY ) ) { String createdString = TimestampAttributeGenerator . BEGINNING_OF_TIMES ; if ( originalObject . containsAttribute ( CREATED ) ) { createdString = originalObject . getValueForAttribute ( CREATED ) . toString ( ) ; } builder . addAttributeSorted ( new net . ripe . db . whois . common . rpsl . RpslAttribute ( CREATED , createdString ) ) ; builder . addAttributeSorted ( new net . ripe . db . whois . common . rpsl . RpslAttribute ( LAST_MODIFIED , nowString ) ) ; } else if ( action == ( DELETE ) ) { if ( originalObject . containsAttribute ( CREATED ) ) { String createdString = originalObject . getValueForAttribute ( CREATED ) . toString ( ) ; builder . addAttributeSorted ( new net . ripe . db . whois . common . rpsl . RpslAttribute ( CREATED , createdString ) ) ; } if ( originalObject . containsAttribute ( LAST_MODIFIED ) ) { <START_BUG> String lastModifiedString = originalObject . getValueForAttribute ( CREATED ) . toString ( ) ; <END_BUG> builder . addAttributeSorted ( new net . ripe . db . whois . common . rpsl . RpslAttribute ( LAST_MODIFIED , lastModifiedString ) ) ; } } } No newline ; at end ; of file ; }

Fix:
String lastModifiedString = originalObject . getValueForAttribute ( LAST_MODIFIED ) . toString ( ) ;
Buggy code:
public class VirtualFileResourceManager implements ResourceManager { private volatile VirtualFile base ; private final List < ResourceChangeListener > listeners = new ArrayList < ResourceChangeListener > ( ) ; private FileSystemWatcher fileSystemWatcher ; private final long transferMinSize ; public VirtualFileResourceManager ( final VirtualFile base , long transferMinSize ) { } public VirtualFile getBase ( ) { } public VirtualFileResourceManager setBase ( final VirtualFile base ) { } public Resource getResource ( final String p ) { } @ Override public boolean isResourceChangeListenerSupported ( ) { } @ Override public synchronized void registerResourceChangeListener ( ResourceChangeListener listener ) { listeners . add ( listener ) ; if ( ( fileSystemWatcher ) == null ) { fileSystemWatcher = Xnio . getInstance ( ) . createFileSystemWatcher ( ( "Watcher<seq2seq4repair_space>for<seq2seq4repair_space>" + ( base ) ) , EMPTY ) ; try { final File base = this . base . getPhysicalFile ( ) ; fileSystemWatcher . watchPath ( base , new FileChangeCallback ( ) { @ Override public void handleChanges ( Collection < FileChangeEvent > changes ) { synchronized ( VirtualFileResourceManager . this ) { String basePath = base . getAbsolutePath ( ) ; final List < ResourceChangeEvent > events = new ArrayList < ResourceChangeEvent > ( ) ; for ( FileChangeEvent change : changes ) { if ( change . getFile ( ) . getAbsolutePath ( ) . startsWith ( basePath ) ) { String path = change . getFile ( ) . getAbsolutePath ( ) . substring ( basePath . length ( ) ) ; <START_BUG> events . add ( new ResourceChangeEvent ( getResource ( path ) , Type . valueOf ( change . getType ( ) . name ( ) ) ) ) ; <END_BUG> } } for ( ResourceChangeListener listener : listeners ) { listener . handleChanges ( events ) ; } } } } ) ; } catch ( IOException e ) { } } } @ Override public synchronized void removeResourceChangeListener ( ResourceChangeListener listener ) { } public long getTransferMinSize ( ) { } @ Override public void close ( ) throws IOException { } }

Fix:
events . add ( new ResourceChangeEvent ( path , Type . valueOf ( change . getType ( ) . name ( ) ) ) ) ;
Buggy code:
public class CmsDatabaseImportFromHttp extends A_CmsImportFromHttp { public static final String DIALOG_URI = ( PATH_WORKPLACE ) + "admin//database//importhttp.jsp" ; public static final String PARAM_KEEPPERMISSIONS = "keepPermissions" ; private String m_keepPermissions ; public CmsDatabaseImportFromHttp ( CmsJspActionElement jsp ) { } public CmsDatabaseImportFromHttp ( PageContext context , HttpServletRequest req , HttpServletResponse res ) { } public void actionCommit ( ) throws IOException , ServletException { try { copyFileToServer ( OpenCms . getSystemInfo ( ) . getPackagesRfsPath ( ) ) ; } catch ( CmsException e ) { setException ( e ) ; return ; } Map params = new HashMap ( ) ; params . put ( PARAM_FILE , getParamImportfile ( ) ) ; <START_BUG> params . put ( CmsDatabaseImportFromHttp . PARAM_KEEPPERMISSIONS , getParamKeepPermissions ( ) ) ; <END_BUG> params . put ( PARAM_STYLE , STYLE_NEW ) ; params . put ( PARAM_CLOSELINK , CmsToolManager . linkForToolPath ( getJsp ( ) , "//database" ) ) ; getToolManager ( ) . jspForwardPage ( this , IMPORT_ACTION_REPORT , params ) ; } public String getDialogReturnUri ( ) { } public String getImportMessage ( ) { } public String getParamKeepPermissions ( ) { } public String getStarttext ( ) { } public void setParamKeepPermissions ( String keepPermissions ) { } protected void initMessages ( ) { } No newline ; at end ; of file ; }

Fix:
params . put ( CmsDatabaseImportFromHttp . PARAM_KEEPPERMISSIONS . toLowerCase ( ) , getParamKeepPermissions ( ) ) ;