idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
10,800 | public Iterable < DConnection > queryByExpireTime ( java . util . Date expireTime ) { return queryByField ( null , DConnectionMapper . Field . EXPIRETIME . getFieldName ( ) , expireTime ) ; } | query - by method for field expireTime | 52 | 8 |
10,801 | public Iterable < DConnection > queryByImageUrl ( java . lang . String imageUrl ) { return queryByField ( null , DConnectionMapper . Field . IMAGEURL . getFieldName ( ) , imageUrl ) ; } | query - by method for field imageUrl | 50 | 8 |
10,802 | public Iterable < DConnection > queryByProfileUrl ( java . lang . String profileUrl ) { return queryByField ( null , DConnectionMapper . Field . PROFILEURL . getFieldName ( ) , profileUrl ) ; } | query - by method for field profileUrl | 50 | 8 |
10,803 | public Iterable < DConnection > queryByProviderId ( java . lang . String providerId ) { return queryByField ( null , DConnectionMapper . Field . PROVIDERID . getFieldName ( ) , providerId ) ; } | query - by method for field providerId | 50 | 8 |
10,804 | public Iterable < DConnection > queryByProviderUserId ( java . lang . String providerUserId ) { return queryByField ( null , DConnectionMapper . Field . PROVIDERUSERID . getFieldName ( ) , providerUserId ) ; } | query - by method for field providerUserId | 54 | 9 |
10,805 | public DConnection findByRefreshToken ( java . lang . String refreshToken ) { return queryUniqueByField ( null , DConnectionMapper . Field . REFRESHTOKEN . getFieldName ( ) , refreshToken ) ; } | find - by method for unique field refreshToken | 51 | 9 |
10,806 | public Iterable < DConnection > queryBySecret ( java . lang . String secret ) { return queryByField ( null , DConnectionMapper . Field . SECRET . getFieldName ( ) , secret ) ; } | query - by method for field secret | 46 | 7 |
10,807 | public Iterable < DConnection > queryByUserId ( java . lang . Long userId ) { return queryByField ( null , DConnectionMapper . Field . USERID . getFieldName ( ) , userId ) ; } | query - by method for field userId | 50 | 8 |
10,808 | public Iterable < DConnection > queryByUserRoles ( java . lang . String userRoles ) { return queryByField ( null , DConnectionMapper . Field . USERROLES . getFieldName ( ) , userRoles ) ; } | query - by method for field userRoles | 55 | 9 |
10,809 | public void add ( Collection < Label > labels ) { for ( Label label : labels ) this . labels . put ( label . getKey ( ) , label ) ; } | Adds the label list to the labels for the account . | 35 | 11 |
10,810 | public final void sendGlobal ( String handler , String data ) { try { connection . sendMessage ( "{\"id\":-1,\"type\":\"global\",\"handler\":" + Json . escapeString ( handler ) + ",\"data\":" + data + "}" ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } | This function is mainly made for plug - in use it sends data to global user handler for example to perform some tasks that aren t related directly to widgets . Global handler is a javascript function in array named global under key that is passed to this function as handler parameter . As first argument the javascript ... | 78 | 69 |
10,811 | public void replaceWith ( final ThriftEnvelope thriftEnvelope ) { this . typeName = thriftEnvelope . typeName ; this . name = thriftEnvelope . name ; this . payload . clear ( ) ; this . payload . addAll ( thriftEnvelope . payload ) ; } | hack method to allow hadoop to re - use this object | 69 | 12 |
10,812 | protected void addFrameWarning ( Content contentTree ) { Content noframes = new HtmlTree ( HtmlTag . NOFRAMES ) ; Content noScript = HtmlTree . NOSCRIPT ( HtmlTree . DIV ( getResource ( "doclet.No_Script_Message" ) ) ) ; noframes . addContent ( noScript ) ; Content noframesHead = HtmlTree . HEADING ( HtmlConstants . CO... | Add the code for issueing the warning for a non - frame capable web client . Also provide links to the non - frame version documentation . | 196 | 28 |
10,813 | private void addAllPackagesFrameTag ( Content contentTree ) { HtmlTree frame = HtmlTree . FRAME ( DocPaths . OVERVIEW_FRAME . getPath ( ) , "packageListFrame" , configuration . getText ( "doclet.All_Packages" ) ) ; contentTree . addContent ( frame ) ; } | Add the FRAME tag for the frame that lists all packages . | 74 | 13 |
10,814 | private void addAllClassesFrameTag ( Content contentTree ) { HtmlTree frame = HtmlTree . FRAME ( DocPaths . ALLCLASSES_FRAME . getPath ( ) , "packageFrame" , configuration . getText ( "doclet.All_classes_and_interfaces" ) ) ; contentTree . addContent ( frame ) ; } | Add the FRAME tag for the frame that lists all classes . | 78 | 13 |
10,815 | private void addClassFrameTag ( Content contentTree ) { HtmlTree frame = HtmlTree . FRAME ( configuration . topFile . getPath ( ) , "classFrame" , configuration . getText ( "doclet.Package_class_and_interface_descriptions" ) , SCROLL_YES ) ; contentTree . addContent ( frame ) ; } | Add the FRAME tag for the frame that describes the class in detail . | 79 | 15 |
10,816 | public static JCTree declarationFor ( final Symbol sym , final JCTree tree ) { class DeclScanner extends TreeScanner { JCTree result = null ; public void scan ( JCTree tree ) { if ( tree != null && result == null ) tree . accept ( this ) ; } public void visitTopLevel ( JCCompilationUnit that ) { if ( that . packge == s... | Find the declaration for a symbol where that symbol is defined somewhere in the given tree . | 277 | 17 |
10,817 | public static List < Type > types ( List < ? extends JCTree > trees ) { ListBuffer < Type > ts = new ListBuffer < Type > ( ) ; for ( List < ? extends JCTree > l = trees ; l . nonEmpty ( ) ; l = l . tail ) ts . append ( l . head . type ) ; return ts . toList ( ) ; } | Return the types of a list of trees . | 82 | 9 |
10,818 | protected void configure ( Properties properties ) { _properties = properties ; _recipients = properties . getProperty ( "mail.smtp.to" ) . split ( " *[,;] *" ) ; _authenticator = new Authenticator ( ) { protected PasswordAuthentication getPasswordAuthentication ( ) { return new PasswordAuthentication ( _properties . g... | Configures the EmailChannel with given properties . | 109 | 9 |
10,819 | private void initStandardTagsLowercase ( ) { Iterator < String > it = standardTags . iterator ( ) ; while ( it . hasNext ( ) ) { standardTagsLowercase . add ( StringUtils . toLowerCase ( it . next ( ) ) ) ; } } | Initialize lowercase version of standard Javadoc tags . | 59 | 12 |
10,820 | public static ApruveResponse < Subscription > get ( String suscriptionId ) { return ApruveClient . getInstance ( ) . get ( getSubscriptionsPath ( ) + suscriptionId , Subscription . class ) ; } | Get the Subscription with the given ID | 50 | 8 |
10,821 | public static ApruveResponse < SubscriptionCancelResponse > cancel ( String subscriptionId ) { return ApruveClient . getInstance ( ) . post ( getCancelPath ( subscriptionId ) , "" , SubscriptionCancelResponse . class ) ; } | Cancels the Subscription with the given ID . This cannot be undone once completed so use with care! | 54 | 22 |
10,822 | public boolean handleNextTask ( ) { Runnable task = this . getNextTask ( ) ; if ( task != null ) { synchronized ( this . tasksReachesZero ) { this . runningTasks ++ ; } try { task . run ( ) ; } catch ( Throwable t ) { t . printStackTrace ( ) ; } synchronized ( this . tasksReachesZero ) { this . runningTasks -- ; if ( t... | Process the next pending Task synchronously . | 135 | 8 |
10,823 | public < T extends Runnable > T executeSync ( T runnable ) { synchronized ( runnable ) { this . executeAsync ( runnable ) ; try { runnable . wait ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } return runnable ; } | Add a Task to the queue and wait until it s run . It is guaranteed that the Runnable will be processed when this method returns . | 71 | 29 |
10,824 | public < T extends Runnable > T executeSyncTimed ( T runnable , long inMs ) { try { Thread . sleep ( inMs ) ; this . executeSync ( runnable ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } return runnable ; } | Add a Task to the queue and wait until it s run . The Task will be executed after inMs milliseconds . It is guaranteed that the Runnable will be processed when this method returns . | 69 | 39 |
10,825 | public < T extends Runnable > T executeAsyncTimed ( T runnable , long inMs ) { final Runnable theRunnable = runnable ; // This implementation is not really suitable for now as the timer uses its own thread // The TaskQueue itself should be able in the future to handle this without using a new thread Timer timer = new T... | Add a Task to the queue . The Task will be executed after inMs milliseconds . | 129 | 17 |
10,826 | protected boolean waitForTasks ( ) { synchronized ( this . tasks ) { while ( ! this . closed && ! this . hasTaskPending ( ) ) { try { this . tasks . wait ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } } return ! this . closed ; } | Wait until the TaskQueue has a Task ready to process . If the TaskQueue is closed this method will also return but giving the value false . | 72 | 29 |
10,827 | public void waitAllTasks ( ) { synchronized ( this . tasks ) { while ( this . hasTaskPending ( ) ) { try { this . tasks . wait ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } synchronized ( this . tasksReachesZero ) { if ( this . runningTasks > 0 ) { try { this . tasksReachesZero . wait ( ) ; }... | Wait that every pending task are processed . This method will return once it has no pending task or once it has been closed | 115 | 24 |
10,828 | protected List < SchemaDescriptor > scanConnection ( String url , String user , String password , String infoLevelName , String bundledDriverName , Properties properties , Store store ) throws IOException { LOGGER . info ( "Scanning schema '{}'" , url ) ; Catalog catalog = getCatalog ( url , user , password , infoLevel... | Scans the connection identified by the given parameters . | 92 | 10 |
10,829 | protected Catalog getCatalog ( String url , String user , String password , String infoLevelName , String bundledDriverName , Properties properties ) throws IOException { // Determine info level InfoLevel level = InfoLevel . valueOf ( infoLevelName . toLowerCase ( ) ) ; SchemaInfoLevel schemaInfoLevel = level . getSche... | Retrieves the catalog metadata using schema crawler . | 358 | 11 |
10,830 | private SchemaCrawlerOptions getOptions ( String bundledDriverName , InfoLevel level ) throws IOException { for ( BundledDriver bundledDriver : BundledDriver . values ( ) ) { if ( bundledDriver . name ( ) . toLowerCase ( ) . equals ( bundledDriverName . toLowerCase ( ) ) ) { return bundledDriver . getOptions ( level ) ... | Loads the bundled driver options | 121 | 6 |
10,831 | private List < SchemaDescriptor > createSchemas ( Catalog catalog , Store store ) throws IOException { List < SchemaDescriptor > schemaDescriptors = new ArrayList <> ( ) ; Map < String , ColumnTypeDescriptor > columnTypes = new HashMap <> ( ) ; Map < Column , ColumnDescriptor > allColumns = new HashMap <> ( ) ; Set < F... | Stores the data . | 279 | 5 |
10,832 | private void createTables ( Catalog catalog , Schema schema , SchemaDescriptor schemaDescriptor , Map < String , ColumnTypeDescriptor > columnTypes , Map < Column , ColumnDescriptor > allColumns , Set < ForeignKey > allForeignKeys , Store store ) { for ( Table table : catalog . getTables ( schema ) ) { TableDescriptor ... | Create the table descriptors . | 732 | 6 |
10,833 | private < T extends BaseColumnDescriptor > T createColumnDescriptor ( BaseColumn column , Class < T > descriptorType , Map < String , ColumnTypeDescriptor > columnTypes , Store store ) { T columnDescriptor = store . create ( descriptorType ) ; columnDescriptor . setName ( column . getName ( ) ) ; columnDescriptor . set... | Create a column descriptor . | 198 | 5 |
10,834 | private void createForeignKeys ( Set < ForeignKey > allForeignKeys , Map < Column , ColumnDescriptor > allColumns , Store store ) { // Foreign keys for ( ForeignKey foreignKey : allForeignKeys ) { ForeignKeyDescriptor foreignKeyDescriptor = store . create ( ForeignKeyDescriptor . class ) ; foreignKeyDescriptor . setNam... | Create the foreign key descriptors . | 357 | 7 |
10,835 | private void createRoutines ( Collection < Routine > routines , SchemaDescriptor schemaDescriptor , Map < String , ColumnTypeDescriptor > columnTypes , Store store ) throws IOException { for ( Routine routine : routines ) { RoutineDescriptor routineDescriptor ; String returnType ; switch ( routine . getRoutineType ( ) ... | Create routines i . e . functions and procedures . | 576 | 10 |
10,836 | private void createSequences ( Collection < Sequence > sequences , SchemaDescriptor schemaDescriptor , Store store ) { for ( Sequence sequence : sequences ) { SequenceDesriptor sequenceDesriptor = store . create ( SequenceDesriptor . class ) ; sequenceDesriptor . setName ( sequence . getName ( ) ) ; sequenceDesriptor .... | Add the sequences of a schema to the schema descriptor . | 174 | 11 |
10,837 | private TableDescriptor getTableDescriptor ( Table table , SchemaDescriptor schemaDescriptor , Store store ) { TableDescriptor tableDescriptor ; if ( table instanceof View ) { View view = ( View ) table ; ViewDescriptor viewDescriptor = store . create ( ViewDescriptor . class ) ; viewDescriptor . setUpdatable ( view . ... | Create a table descriptor for the given table . | 226 | 9 |
10,838 | private < I extends IndexDescriptor > I storeIndex ( Index index , TableDescriptor tableDescriptor , Map < String , ColumnDescriptor > columns , Class < I > indexType , Class < ? extends OnColumnDescriptor > onColumnType , Store store ) { I indexDescriptor = store . create ( indexType ) ; indexDescriptor . setName ( in... | Stores index data . | 291 | 5 |
10,839 | private ColumnTypeDescriptor getColumnTypeDescriptor ( ColumnDataType columnDataType , Map < String , ColumnTypeDescriptor > columnTypes , Store store ) { String databaseSpecificTypeName = columnDataType . getDatabaseSpecificTypeName ( ) ; ColumnTypeDescriptor columnTypeDescriptor = columnTypes . get ( databaseSpecific... | Return the column type descriptor for the given data type . | 414 | 11 |
10,840 | public static ProfilePackageSummaryBuilder getInstance ( Context context , PackageDoc pkg , ProfilePackageSummaryWriter profilePackageWriter , Profile profile ) { return new ProfilePackageSummaryBuilder ( context , pkg , profilePackageWriter , profile ) ; } | Construct a new ProfilePackageSummaryBuilder . | 49 | 8 |
10,841 | public void addItem ( Point coordinates , Drawable item ) { assertEDT ( ) ; if ( coordinates == null || item == null ) { throw new IllegalArgumentException ( "Coordinates and added item cannot be null" ) ; } log . trace ( "[addItem] New item added @ {}" , coordinates ) ; getPanelAt ( coordinates ) . addModel ( item ) ;... | Adds an item to draw in a particular position | 95 | 9 |
10,842 | public void moveItem ( Point oldCoordinates , Point newCoordinates ) { assertEDT ( ) ; if ( oldCoordinates == null || newCoordinates == null ) { throw new IllegalArgumentException ( "Coordinates cannot be null" ) ; } if ( getPanelAt ( newCoordinates ) . hasModel ( ) ) { throw new IllegalStateException ( "New position c... | Changes the position of the item in the specified location | 198 | 10 |
10,843 | public void clear ( ) { assertEDT ( ) ; log . debug ( "[clear] Cleaning board" ) ; for ( int row = 0 ; row < SIZE ; row ++ ) { for ( int col = 0 ; col < SIZE ; col ++ ) { removeItem ( new Point ( col , row ) ) ; } } } | Removes all the drawn elements | 72 | 6 |
10,844 | public void refresh ( Point coordinates ) { assertEDT ( ) ; if ( coordinates == null ) { throw new IllegalArgumentException ( "Coordinates cannot be null" ) ; } getPanelAt ( coordinates ) . repaint ( ) ; } | Repaints the item specified | 52 | 5 |
10,845 | public TablePanel removeAll ( ) { for ( int i = 0 ; i < content . length ; ++ i ) for ( int j = 0 ; j < content [ i ] . length ; ++ j ) content [ i ] [ j ] = null ; this . sendElement ( ) ; return this ; } | Removes all elements stored in this container | 64 | 8 |
10,846 | public TablePanel remove ( Widget widget ) { for ( int i = 0 ; i < content . length ; ++ i ) for ( int j = 0 ; j < content [ i ] . length ; ++ j ) if ( content [ i ] [ j ] == widget ) content [ i ] [ j ] = null ; this . sendElement ( ) ; return this ; } | Removes all elements that are instance of specified element | 78 | 10 |
10,847 | public TablePanel put ( Widget widget , int x , int y ) { if ( x < 0 || y < 0 || x >= content . length || y >= content [ x ] . length ) throw new IndexOutOfBoundsException ( ) ; attach ( widget ) ; content [ x ] [ y ] = widget ; this . sendElement ( ) ; return this ; } | Set widget to certain cell in table | 78 | 7 |
10,848 | private Map < String , String > loadProperties ( ServiceReference reference ) { log . trace ( "loadProperties" ) ; Map < String , String > properties = new HashMap < String , String > ( ) ; properties . put ( "id" , OsgiUtil . toString ( reference . getProperty ( Constants . SERVICE_ID ) , "" ) ) ; properties . put ( "... | Loads the properties from the specified Service Reference into a map . | 349 | 13 |
10,849 | private void renderBlock ( HttpServletResponse res , String templateName , Map < String , String > properties ) throws IOException { InputStream is = null ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; String template = null ; try { is = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( template... | Loads the template with the specified name from the classloader and uses it to templatize the properties using Apache Commons Lang s StrSubstitutor and writes it to the response . | 195 | 39 |
10,850 | private void unmarshall ( ) { sheetData = sheet . getJaxbElement ( ) . getSheetData ( ) ; rows = sheetData . getRow ( ) ; if ( rows != null && rows . size ( ) > 0 ) { Row r = ( Row ) rows . get ( 0 ) ; numColumns = r . getC ( ) . size ( ) ; } } | Unmarshall the data in this worksheet . | 83 | 11 |
10,851 | public int getRows ( ) { if ( sheetData == null ) unmarshall ( ) ; int ret = 0 ; if ( rows != null ) ret = rows . size ( ) ; return ret ; } | Returns the number of rows in this worksheet . | 44 | 10 |
10,852 | public static ManifestVersion get ( final Class < ? > clazz ) { final String manifestUrl = ClassExtensions . getManifestUrl ( clazz ) ; try { return of ( manifestUrl != null ? new URL ( manifestUrl ) : null ) ; } catch ( final MalformedURLException ignore ) { return of ( null ) ; } } | Returns a ManifestVersion object by reading the manifest file from the JAR WAR or EAR file that contains the given class . | 74 | 24 |
10,853 | @ Override public Object processTask ( String taskName , Map < String , String [ ] > parameterMap ) { if ( "createAdmin" . equalsIgnoreCase ( taskName ) ) { return userService . createDefaultAdmin ( ) ; } return null ; } | Create a default admin in the datastore . | 56 | 10 |
10,854 | public ValueType get ( final KeyType ... keys ) { if ( ArrayUtils . isEmpty ( keys ) ) { return null ; } int keysLength = keys . length ; if ( keysLength == 1 ) { return get ( keys [ 0 ] ) ; } else { StorageComponent < KeyType , ValueType > storageComponent = this ; int lastKeyIndex = keysLength - 1 ; for ( int i = 0 ;... | Returns value of keys reference . | 141 | 6 |
10,855 | public void put ( final ValueType value , final KeyType ... keys ) { if ( ArrayUtils . isEmpty ( keys ) ) { return ; } int keysLength = keys . length ; if ( keysLength == 1 ) { put ( value , keys [ 0 ] ) ; } else { StorageComponent < KeyType , ValueType > childStorageComponent = getStorageComponent ( keys [ 0 ] ) ; int... | Storages the value by keys . | 148 | 8 |
10,856 | public StorageComponent < KeyType , ValueType > getStorageComponent ( final KeyType key ) { KeyToStorageComponent < KeyType , ValueType > storage = getkeyToStorage ( ) ; StorageComponent < KeyType , ValueType > storageComponent = storage . get ( key ) ; if ( storageComponent == null ) { storageComponent = new StorageCo... | Returns child StorageComponent by given key . | 99 | 8 |
10,857 | public boolean add ( T element , Class < ? > accessibleClass ) { boolean added = false ; while ( accessibleClass != null && accessibleClass != this . baseClass ) { added |= this . addSingle ( element , accessibleClass ) ; for ( Class < ? > interf : accessibleClass . getInterfaces ( ) ) { this . addSingle ( element , in... | Associate the element with accessibleClass and any of the the superclass and interfaces of the accessibleClass until baseClass | 96 | 23 |
10,858 | public void remove ( T element , Class < ? > accessibleClass ) { while ( accessibleClass != null && accessibleClass != this . baseClass ) { this . removeSingle ( element , accessibleClass ) ; for ( Class < ? > interf : accessibleClass . getInterfaces ( ) ) { this . removeSingle ( element , interf ) ; } accessibleClass ... | Remove the element from accessible class and any of the superclass and interfaces of the accessibleClass until baseClass | 85 | 21 |
10,859 | private static void _readIBANDataFromXML ( ) { final IMicroDocument aDoc = MicroReader . readMicroXML ( new ClassPathResource ( "codelists/iban-country-data.xml" ) ) ; if ( aDoc == null ) throw new InitializationException ( "Failed to read IBAN country data [1]" ) ; if ( aDoc . getDocumentElement ( ) == null ) throw ne... | Read all IBAN country data from a file . | 637 | 10 |
10,860 | @ Nullable public static IBANCountryData getCountryData ( @ Nonnull final String sCountryCode ) { ValueEnforcer . notNull ( sCountryCode , "CountryCode" ) ; return s_aIBANData . get ( sCountryCode . toUpperCase ( Locale . US ) ) ; } | Get the country data for the given country code . | 67 | 10 |
10,861 | @ Nullable public static String unifyIBAN ( @ Nullable final String sIBAN ) { if ( sIBAN == null ) return null ; // to uppercase String sRealIBAN = sIBAN . toUpperCase ( Locale . US ) ; // kick all non-IBAN chars sRealIBAN = RegExHelper . stringReplacePattern ( "[^0-9A-Z]" , sRealIBAN , "" ) ; if ( sRealIBAN . length (... | Make an IBAN that can be parsed . It is converted to upper case and all non - alphanumeric characters are removed . | 121 | 26 |
10,862 | public static boolean isValidIBAN ( @ Nullable final String sIBAN , final boolean bReturnCodeIfNoCountryData ) { // kick all non-IBAN chars final String sRealIBAN = unifyIBAN ( sIBAN ) ; if ( sRealIBAN == null ) return false ; // is the country supported? final IBANCountryData aData = s_aIBANData . get ( sRealIBAN . su... | Check if the passed IBAN is valid and the country is supported! | 260 | 14 |
10,863 | public void buildContent ( XMLNode node , Content contentTree ) { Content packageContentTree = packageWriter . getContentHeader ( ) ; buildChildren ( node , packageContentTree ) ; contentTree . addContent ( packageContentTree ) ; } | Build the content for the package doc . | 50 | 8 |
10,864 | public JavaFileObject asJavaFileObject ( File file ) { JavacFileManager fm = ( JavacFileManager ) context . get ( JavaFileManager . class ) ; return fm . getRegularFile ( file ) ; } | Construct a JavaFileObject from the given file . | 49 | 10 |
10,865 | public Iterable < ? extends CompilationUnitTree > parse ( ) throws IOException { try { prepareCompiler ( ) ; List < JCCompilationUnit > units = compiler . parseFiles ( fileObjects ) ; for ( JCCompilationUnit unit : units ) { JavaFileObject file = unit . getSourceFile ( ) ; if ( notYetEntered . containsKey ( file ) ) no... | Parse the specified files returning a list of abstract syntax trees . | 128 | 13 |
10,866 | public static ClassLoader findMostCompleteClassLoader ( Class < ? > target ) { // Try the most complete class loader we can get ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; // Then fallback to the class loader from a specific class given if ( classLoader == null && target != null )... | Find the most complete class loader by trying the current thread context class loader then the classloader of the given class if any then the class loader that loaded SEED core then the system class loader . | 192 | 39 |
10,867 | @ Override public void emit ( Level level , String message , long sequence ) { if ( _broadcaster != null ) _broadcaster . sendNotification ( new Notification ( level . toString ( ) , _name != null ? _name : this , sequence , message ) ) ; } | Emits a notification through this manageable . | 60 | 8 |
10,868 | @ Override public < T extends Throwable > T emit ( T throwable , String message , long sequence ) { if ( _broadcaster != null ) _broadcaster . sendNotification ( new Notification ( Level . WARNING . toString ( ) , _name != null ? _name : this , sequence , message == null ? Throwables . getFullMessage ( throwable ) : me... | Emits an alert for a caught Throwable through this manageable . | 103 | 13 |
10,869 | @ Override public void emit ( Level level , String message , long sequence , Logger logger ) { emit ( level , message , sequence ) ; logger . log ( level , message ) ; } | Emits a notification through this manageable entering the notification into a logger along the way . | 40 | 17 |
10,870 | @ Override public < T extends Throwable > T emit ( T throwable , String message , long sequence , Logger logger ) { message = message == null ? Throwables . getFullMessage ( throwable ) : message + ": " + Throwables . getFullMessage ( throwable ) ; emit ( Level . WARNING , message , sequence , logger ) ; return throwab... | Emits an alert for a caught Throwable through this manageable entering the alert into a logger along the way . | 80 | 22 |
10,871 | public ArrayList < SchemaField > getSchema ( ) { final ArrayList < SchemaField > items = new ArrayList < SchemaField > ( schemaFields . values ( ) ) ; Collections . sort ( items , new Comparator < SchemaField > ( ) { @ Override public int compare ( final SchemaField left , final SchemaField right ) { return left . getI... | Get the schema as a collection of fields . We guarantee the ordering by field id . | 102 | 17 |
10,872 | PlatformControl bind ( ServicePlatform p , XmlWebApplicationContext c , ClassLoader l ) { _platform = p ; _root = c ; _cloader = l ; return this ; } | To be called by ServicePlatform when detected in the top - level application context . | 41 | 16 |
10,873 | public static boolean isSafeMediaType ( final String mediaType ) { return mediaType != null && VALID_MIME_TYPE . matcher ( mediaType ) . matches ( ) && ! DANGEROUS_MEDIA_TYPES . contains ( mediaType ) ; } | Returns true if the given string is a valid media type | 59 | 11 |
10,874 | public WriteStream writeStream ( ) { detachReader ( ) ; if ( writer == null ) { writer = new BytesWriteStream ( bytes , maxCapacity ) ; } return writer ; } | Attaches a writer to the object . If there is already an attached writer the existing writer is returned . If a reader is attached to the object when this method is called the reader is closed and immediately detached before a writer is created . | 40 | 47 |
10,875 | public ReadStream readStream ( ) { detachWriter ( ) ; if ( reader == null ) { reader = new BytesReadStream ( bytes , 0 , length ) ; } return reader ; } | Attaches a reader to the object . If there is already any attached reader the existing reader is returned . If a writer is attached to the object when this method is called the writer is closed and immediately detached before the reader is created . | 40 | 47 |
10,876 | public void add ( Collection < Entity > entities ) { for ( Entity entity : entities ) this . entities . put ( entity . getId ( ) , entity ) ; } | Adds the entity list to the entities for the account . | 35 | 11 |
10,877 | @ Override public Class < ? > loadClass ( String classname ) throws ClassNotFoundException { return getClass ( ) . getClassLoader ( ) . loadClass ( classname ) ; } | Get the class loader of the mock rather than that of the bundle . | 41 | 14 |
10,878 | @ Override public ResourceSchema getSchema ( final String location , final Job job ) throws IOException { final List < Schema . FieldSchema > schemaList = new ArrayList < Schema . FieldSchema > ( ) ; for ( final GoodwillSchemaField field : schema . getSchema ( ) ) { schemaList . add ( new Schema . FieldSchema ( field .... | Get a schema for the data to be loaded . | 121 | 10 |
10,879 | public static String getUserApplicationConfigurationFilePath ( @ NonNull final String applicationName , @ NonNull final String configFileName ) { return System . getProperty ( USER_HOME_PROPERTY_KEY ) + File . separator + applicationName + File . separator + configFileName ; } | Gets the user application configuration file path . | 64 | 9 |
10,880 | public static String getTemporaryApplicationConfigurationFilePath ( @ NonNull final String applicationName , @ NonNull final String fileName ) { return System . getProperty ( JAVA_IO_TPMDIR_PROPERTY_KEY ) + File . separator + applicationName + File . separator + fileName ; } | Gets the specific temporary directory path for from the given arguments . It is indeded for any application temporary files | 68 | 22 |
10,881 | public static < T > T instantiateClass ( final Class < T > clazz ) throws IllegalArgumentException , BeanInstantiationException { return instantiateClass ( clazz , MethodUtils . EMPTY_PARAMETER_CLASSTYPES , MethodUtils . EMPTY_PARAMETER_VALUES ) ; } | Create and initialize a new instance of the given class by default constructor . | 72 | 14 |
10,882 | public static < T > T instantiateClass ( final Class < T > clazz , final Class < ? > [ ] parameterTypes , final Object [ ] parameterValues ) throws BeanInstantiationException { if ( clazz . isInterface ( ) ) { throw new BeanInstantiationException ( clazz , CLASS_IS_INTERFACE ) ; } try { Constructor < T > constructor = ... | Create and initialize a new instance of the given class by given parameterTypes and parameterValues . | 142 | 18 |
10,883 | public static boolean isDataObject ( final Object object ) { if ( object == null ) { return true ; } Class < ? > clazz = object . getClass ( ) ; return isDataClass ( clazz ) ; } | Returns true if the given object class is 8 primitive class or their wrapper class or String class or null . | 47 | 21 |
10,884 | public static boolean isDataClass ( final Class < ? > clazz ) { if ( clazz == null || clazz . isPrimitive ( ) ) { return true ; } boolean isWrapperClass = contains ( WRAPPER_CLASSES , clazz ) ; if ( isWrapperClass ) { return true ; } boolean isDataClass = contains ( DATA_PRIMITIVE_CLASS , clazz ) ; if ( isDataClass ) {... | Returns true if the given class is 8 primitive class or their wrapper class or String class or null . | 103 | 20 |
10,885 | public static String stringFor ( int m ) { switch ( m ) { case CUFFT_R2C : return "CUFFT_R2C" ; case CUFFT_C2R : return "CUFFT_C2R" ; case CUFFT_C2C : return "CUFFT_C2C" ; case CUFFT_D2Z : return "CUFFT_D2Z" ; case CUFFT_Z2D : return "CUFFT_Z2D" ; case CUFFT_Z2Z : return "CUFFT_Z2Z" ; } return "INVALID cufftType: " + m... | Returns the String identifying the given cufftType | 150 | 9 |
10,886 | @ Override public void setContract ( Contract c ) { super . setContract ( c ) ; for ( Field f : fields . values ( ) ) { f . setContract ( c ) ; } } | Sets the Contract associated with this Struct . Propagates to Fields . | 42 | 15 |
10,887 | public Map < String , Field > getFieldsPlusParents ( ) { Map < String , Field > tmp = new HashMap < String , Field > ( ) ; tmp . putAll ( fields ) ; if ( extend != null && ! extend . equals ( "" ) ) { Struct parent = contract . getStructs ( ) . get ( extend ) ; tmp . putAll ( parent . getFieldsPlusParents ( ) ) ; } ret... | Returns a Map of the Fields belonging to this Struct and all its ancestors . Keys are the Field names . | 94 | 21 |
10,888 | public List < String > getFieldNamesPlusParents ( ) { List < String > tmp = new ArrayList < String > ( ) ; tmp . addAll ( getFieldNames ( ) ) ; if ( extend != null && ! extend . equals ( "" ) ) { Struct parent = contract . getStructs ( ) . get ( extend ) ; tmp . addAll ( parent . getFieldNamesPlusParents ( ) ) ; } retu... | Returns a List of the Field names belonging to this Struct and all its ancestors . | 92 | 16 |
10,889 | public void add ( Collection < MobileApplication > mobileApplications ) { for ( MobileApplication mobileApplication : mobileApplications ) this . mobileApplications . put ( mobileApplication . getId ( ) , mobileApplication ) ; } | Adds the mobile application list to the mobile applications for the account . | 43 | 13 |
10,890 | private FileSystem getFileSystemSafe ( ) throws IOException { try { fs . getFileStatus ( new Path ( "/" ) ) ; return fs ; } catch ( NullPointerException e ) { throw new IOException ( "file system not initialized" ) ; } } | throws an IOException if the current FileSystem isn t working | 57 | 13 |
10,891 | @ Nonnull public ETriState isValidPostalCode ( @ Nullable final Locale aCountry , @ Nullable final String sPostalCode ) { final IPostalCodeCountry aPostalCountry = getPostalCountryOfCountry ( aCountry ) ; if ( aPostalCountry == null ) return ETriState . UNDEFINED ; return ETriState . valueOf ( aPostalCountry . isValidP... | Check if the passed postal code is valid for the passed country . | 101 | 13 |
10,892 | public boolean isValidPostalCodeDefaultYes ( @ Nullable final Locale aCountry , @ Nullable final String sPostalCode ) { return isValidPostalCode ( aCountry , sPostalCode ) . getAsBooleanValue ( true ) ; } | Check if the passed postal code is valid for the passed country . If no information for that specific country is defined the postal code is assumed valid! | 56 | 29 |
10,893 | public boolean isValidPostalCodeDefaultNo ( @ Nullable final Locale aCountry , @ Nullable final String sPostalCode ) { return isValidPostalCode ( aCountry , sPostalCode ) . getAsBooleanValue ( false ) ; } | Check if the passed postal code is valid for the passed country . If no information for that specific country is defined the postal code is assumed invalid! | 56 | 29 |
10,894 | @ Nullable @ ReturnsMutableCopy public ICommonsList < String > getPostalCodeExamples ( @ Nullable final Locale aCountry ) { final IPostalCodeCountry aPostalCountry = getPostalCountryOfCountry ( aCountry ) ; return aPostalCountry == null ? null : aPostalCountry . getAllExamples ( ) ; } | Get a list of possible postal code examples for the passed country . | 76 | 13 |
10,895 | @ Override public ServiceRegistration < ? > registerService ( String clazz , Object service , Dictionary < String , ? > properties ) { MockServiceReference < Object > serviceReference = new MockServiceReference < Object > ( getBundle ( ) , properties ) ; if ( serviceRegistrations . get ( clazz ) == null ) { serviceRegi... | Register a service with the bundle context . | 155 | 8 |
10,896 | @ Override public void addServiceListener ( ServiceListener listener , String filter ) throws InvalidSyntaxException { if ( null == filteredServiceListeners . get ( filter ) ) { filteredServiceListeners . put ( filter , new ArrayList < ServiceListener > ( 1 ) ) ; } filteredServiceListeners . get ( filter ) . add ( list... | Register a listener for a service using a filter expression . | 75 | 11 |
10,897 | @ Override public void removeServiceListener ( ServiceListener listener ) { // Note: if unfiltered service listeners are implemented // This method needs to look for, and remove, the listener there // as well // Go through all of the filters, and for each filter // remove the listener from the filter's list. for ( Entr... | Remove a listener object | 105 | 4 |
10,898 | @ Nonnull public String [ ] getLoggerList ( ) { try { Enumeration < Logger > currentLoggers = LogManager . getLoggerRepository ( ) . getCurrentLoggers ( ) ; List < String > loggerNames = new ArrayList < String > ( ) ; while ( currentLoggers . hasMoreElements ( ) ) { loggerNames . add ( currentLoggers . nextElement ( ) ... | Returns the list of active loggers . | 137 | 8 |
10,899 | private void checkHead ( Token token , Optional < Integer > optHead ) { if ( optHead . isPresent ( ) ) { int head = optHead . get ( ) ; Preconditions . checkArgument ( head >= 0 && head <= tokens . size ( ) , String . format ( "Head should refer to token or 0: %s" , token ) ) ; } } | Check that the head is connected . | 80 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.