signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class NodeTypes { /** * Determine if the named primary node type or mixin types has at least one mandatory property definitions declared on it or
* any of its supertypes .
* @ param primaryType the primary type name ; may not be null
* @ param mixinTypes the mixin type names ; may not be null but may be em... | if ( mandatoryPropertiesNodeTypes . containsKey ( primaryType ) ) return true ; for ( Name mixinType : mixinTypes ) { if ( mandatoryPropertiesNodeTypes . containsKey ( mixinType ) ) return true ; } return false ; |
public class XsdGeneratorHelper { /** * Acquires a map relating generated schema filename to its SimpleNamespaceResolver .
* @ param outputDirectory The output directory of the generated schema files .
* @ return a map relating generated schema filename to an initialized SimpleNamespaceResolver .
* @ throws MojoE... | final Map < String , SimpleNamespaceResolver > toReturn = new TreeMap < String , SimpleNamespaceResolver > ( ) ; // Each generated schema file should be written to the output directory .
// Each generated schema file should have a unique targetNamespace .
File [ ] generatedSchemaFiles = outputDirectory . listFiles ( ne... |
public class BDBIndex { /** * ( non - Javadoc )
* @ see org . archive . wayback . resourceindex . SearchResultSource # getPrefixReverseIterator ( java . lang . String ) */
public CloseableIterator < CaptureSearchResult > getPrefixReverseIterator ( String prefix ) throws ResourceIndexNotAvailableException { } } | try { return adaptIterator ( recordIterator ( prefix , false ) ) ; } catch ( DatabaseException e ) { throw new ResourceIndexNotAvailableException ( e . getMessage ( ) ) ; } |
public class AbstractHtmlTableCell { /** * Sets the horizontal alignment of the HTML table cell .
* @ param align the alignment
* @ jsptagref . attributedescription The horizontal alignment of the HTML table cell .
* @ jsptagref . attributesyntaxvalue < i > string _ cellAlign < / i >
* @ netui : attribute requi... | /* todo : should this enforce left | center | right | justify | char as in the spec */
_cellState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . ALIGN , align ) ; |
public class MessageDrivenBeanO { /** * Chanced EnterpriseBean to Object . d366807.1 */
@ Override public final Object preInvoke ( EJSDeployedSupport s , ContainerTx tx ) // d139352-2
throws RemoteException { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "preInvoke" ) ; setState ( POOLED , IN_METHOD ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "preInvoke" ) ; return ivEjbInstance ; |
public class FileUtils { /** * Set fragment
* @ param path path
* @ param fragment new fragment , may be { @ code null }
* @ return path with new fragment */
@ Deprecated public static String setFragment ( final String path , final String fragment ) { } } | final int i = path . indexOf ( SHARP ) ; final String p = i != - 1 ? path . substring ( 0 , i ) : path ; return p + ( fragment != null ? ( SHARP + fragment ) : "" ) ; |
public class AESUtils { /** * Encrypt data using AES with { @ link # DEFAULT _ CIPHER _ TRANSFORMATION } .
* @ param key
* @ param iv
* initial vector . If { @ code null } or empty , { @ link # DEFAULT _ IV }
* will be used .
* @ param data
* @ return
* @ throws NoSuchAlgorithmException
* @ throws NoSuc... | return encrypt ( key , iv , data , DEFAULT_CIPHER_TRANSFORMATION ) ; |
public class Arc { /** * Sets the location , size , angular extents , and closure type of this arc to the same values as
* the supplied arc . */
public void setArc ( IArc arc ) { } } | setArc ( arc . x ( ) , arc . y ( ) , arc . width ( ) , arc . height ( ) , arc . angleStart ( ) , arc . angleExtent ( ) , arc . arcType ( ) ) ; |
public class LicensesDialogFragment { private static LicensesDialogFragment newInstance ( final Notices notices , final boolean showFullLicenseText , final boolean includeOwnLicense , final String noticeStyle , final int themeResourceId , final int dividerColor ) { } } | final LicensesDialogFragment licensesDialogFragment = new LicensesDialogFragment ( ) ; final Bundle args = new Bundle ( ) ; args . putParcelable ( ARGUMENT_NOTICES , notices ) ; args . putBoolean ( ARGUMENT_FULL_LICENSE_TEXT , showFullLicenseText ) ; args . putBoolean ( ARGUMENT_INCLUDE_OWN_LICENSE , includeOwnLicense ... |
public class PortablePreconditions { /** * Assert that this parameter is not empty . It will test for null and also the size of this array .
* @ param name of parameter
* @ param parameter itself */
public static < T extends Collection < ? > > T checkNotEmpty ( final String name , final T parameter ) { } } | if ( parameter == null || parameter . size ( ) == 0 ) { throw new IllegalArgumentException ( "Parameter named '" + name + "' should be filled!" ) ; } return parameter ; |
public class LayerImpl { /** * Sets the response data in the response object and calls
* { @ link # setResponseHeaders ( HttpServletRequest , HttpServletResponse , int ) } to set the headers .
* @ param request
* The servlet request object
* @ param response
* The servlet response object
* @ param entry
*... | InputStream result ; MutableObject < byte [ ] > sourceMap = RequestUtil . isSourceMapRequest ( request ) ? new MutableObject < byte [ ] > ( ) : null ; result = entry . getInputStream ( request , sourceMap ) ; if ( sourceMap != null && sourceMap . getValue ( ) != null ) { byte [ ] sm = sourceMap . getValue ( ) ; result ... |
public class AESUtils { /** * 解密
* 解密过程 :
* 1 . 同加密1-4步
* 2 . 将加密后的字符串反纺成byte [ ] 数组
* 3 . 将加密内容解密 */
public static String decode ( String content , String secret ) { } } | try { // 1 . 构造密钥生成器 , 指定为AES算法 , 不区分大小写
KeyGenerator keygen = KeyGenerator . getInstance ( "AES" ) ; // 2 . 根据encodeRules规则初始化密钥生成器
// 生成一个256位的随机源 , 根据传入的字节数组
keygen . init ( 256 , new SecureRandom ( secret . getBytes ( ) ) ) ; // 3 . 产生原始对称密钥
SecretKey original_key = keygen . generateKey ( ) ; // 4 . 获得原始对称密钥的字节数组
b... |
public class FontLoader { /** * Apply a typeface to a textview
* @ see Face
* @ param textView the text view you wish to apply to
* @ param type the typeface to apply */
public static void apply ( TextView textView , Face type ) { } } | // First check for existing typefaces
Typeface typeface = getTypeface ( textView . getContext ( ) , type ) ; if ( typeface != null ) textView . setTypeface ( typeface ) ; |
public class ListBonusPaymentsResult { /** * A successful request to the ListBonusPayments operation returns a list of BonusPayment objects .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setBonusPayments ( java . util . Collection ) } or { @ link # withBon... | if ( this . bonusPayments == null ) { setBonusPayments ( new java . util . ArrayList < BonusPayment > ( bonusPayments . length ) ) ; } for ( BonusPayment ele : bonusPayments ) { this . bonusPayments . add ( ele ) ; } return this ; |
public class OgmLoader { /** * Hydrate the state an object from the SQL < tt > ResultSet < / tt > , into
* an array or " hydrated " values ( do not resolve associations yet ) ,
* and pass the hydrates state to the session .
* Copied from Loader # loadFromResultSet */
private void loadFromResultSet ( final Tuple r... | final Serializable id = key . getIdentifier ( ) ; // Get the persister for the _ subclass _
final OgmEntityPersister persister = ( OgmEntityPersister ) getFactory ( ) . getMetamodel ( ) . entityPersister ( instanceEntityName ) ; if ( log . isTraceEnabled ( ) ) { log . trace ( "Initializing object from ResultSet: " + Me... |
public class ExpressRouteCrossConnectionsInner { /** * Gets details about the specified ExpressRouteCrossConnection .
* @ param resourceGroupName The name of the resource group ( peering location of the circuit ) .
* @ param crossConnectionName The name of the ExpressRouteCrossConnection ( service key of the circui... | return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , crossConnectionName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class VectorizedRleValuesReader { /** * Initializes the internal state for decoding ints of ` bitWidth ` . */
private void init ( int bitWidth ) { } } | Preconditions . checkArgument ( bitWidth >= 0 && bitWidth <= 32 , "bitWidth must be >= 0 and <= 32" ) ; this . bitWidth = bitWidth ; this . bytesWidth = BytesUtils . paddedByteCountFromBits ( bitWidth ) ; this . packer = Packer . LITTLE_ENDIAN . newBytePacker ( bitWidth ) ; |
public class CatalogueClient { /** * generic internal methods */
< CE extends CatalogueEntity > CE invoke ( final DigesterLoader digesterLoader , String uri , Parameter ... parameters ) { } } | uri = checkNotNull ( uri , "Input URI cannot be null" ) ; try { return invoke ( digesterLoader , new URI ( uri ) , parameters ) ; } catch ( URISyntaxException e ) { throw new RuntimeException ( uri + " is not a valid URI" , e ) ; } |
public class AbstractParamContainerPanel { /** * This method initializes jScrollPane1
* @ return javax . swing . JScrollPane */
private JScrollPane getJScrollPane1 ( ) { } } | if ( jScrollPane1 == null ) { jScrollPane1 = new JScrollPane ( ) ; jScrollPane1 . setName ( "jScrollPane1" ) ; jScrollPane1 . setViewportView ( getJPanel ( ) ) ; jScrollPane1 . setHorizontalScrollBarPolicy ( javax . swing . JScrollPane . HORIZONTAL_SCROLLBAR_NEVER ) ; jScrollPane1 . setVerticalScrollBarPolicy ( javax .... |
public class BasicAtomGenerator { /** * Checks an atom to see if it is an ' invisible carbon ' - that is , it is :
* a ) a carbon atom and b ) this carbon should not be shown .
* @ param atom the atom to check
* @ param atomContainer the atom container the atom is part of
* @ param model the renderer model
* ... | return isCarbon ( atom ) && ! showCarbon ( atom , atomContainer , model ) ; |
public class Distributor { /** * Determines whether the front is small . The front size ( in IPs ) is obtained by adding the size of the { @ link Frontier # todo } list and
* the number of nonbroken workbench entries ( i . e . , IPs that are in the workbench having at least one nonbroken { @ link VisitState } in them... | return frontier . todo . size ( ) + frontier . workbench . approximatedSize ( ) - frontier . workbench . broken . get ( ) <= frontier . requiredFrontSize . get ( ) ; |
public class RegionAutoscalerClient { /** * Creates an autoscaler in the specified project using the data included in the request .
* < p > Sample code :
* < pre > < code >
* try ( RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient . create ( ) ) {
* ProjectRegionName region = ProjectRegionN... | InsertRegionAutoscalerHttpRequest request = InsertRegionAutoscalerHttpRequest . newBuilder ( ) . setRegion ( region == null ? null : region . toString ( ) ) . setAutoscalerResource ( autoscalerResource ) . build ( ) ; return insertRegionAutoscaler ( request ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public TextFidelityStpTxtEx createTextFidelityStpTxtExFromString ( EDataType eDataType , String initialValue ) { } } | TextFidelityStpTxtEx result = TextFidelityStpTxtEx . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class NodeImpl { /** * { @ inheritDoc } */
public Lock lock ( boolean isDeep , boolean isSessionScoped ) throws UnsupportedRepositoryOperationException , LockException , AccessDeniedException , RepositoryException { } } | checkValid ( ) ; if ( ! isNodeType ( Constants . MIX_LOCKABLE ) ) { throw new LockException ( "Node is not lockable " + getPath ( ) ) ; } // session . checkPermission ( getPath ( ) , PermissionType . SET _ PROPERTY ) is not used because RepositoryException
// is wrapped into AccessControlException
if ( ! session . getA... |
public class Zendesk { private byte [ ] json ( Object object ) { } } | try { return mapper . writeValueAsBytes ( object ) ; } catch ( JsonProcessingException e ) { throw new ZendeskException ( e . getMessage ( ) , e ) ; } |
public class Slider { /** * Set the randge of selectable value .
* @ param min The minimum selectable value .
* @ param max The maximum selectable value .
* @ param animation Indicate that should show animation when thumb ' s current position changed . */
public void setValueRange ( int min , int max , boolean an... | if ( max < min || ( min == mMinValue && max == mMaxValue ) ) return ; float oldValue = getExactValue ( ) ; float oldPosition = getPosition ( ) ; mMinValue = min ; mMaxValue = max ; setValue ( oldValue , animation ) ; if ( mOnPositionChangeListener != null && oldPosition == getPosition ( ) && oldValue != getExactValue (... |
public class CommerceTaxFixedRateUtil { /** * Returns the commerce tax fixed rate where CPTaxCategoryId = & # 63 ; and commerceTaxMethodId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache .
* @ param CPTaxCategoryId the cp tax category ID
* @ param commerce... | return getPersistence ( ) . fetchByC_C ( CPTaxCategoryId , commerceTaxMethodId , retrieveFromCache ) ; |
public class CmsElementWithSubElementsParamConfigHelper { /** * Generates the XML configuration from the given configuration object . < p >
* @ param parent the parent element
* @ param config the configuration */
public void generateXml ( Element parent , I_CmsConfigurationParameterHandler config ) { } } | if ( config != null ) { Element elem = parent . addElement ( m_name ) ; for ( String subElemName : m_subElements ) { for ( String value : config . getConfiguration ( ) . getList ( subElemName ) ) { elem . addElement ( subElemName ) . addText ( value ) ; } } } |
public class NioGroovyMethods { /** * Create a new DataInputStream for this file and passes it into the closure .
* This method ensures the stream is closed after the closure returns .
* @ param self a Path
* @ param closure a closure
* @ return the value returned by the closure
* @ throws java . io . IOExcep... | return IOGroovyMethods . withStream ( newDataInputStream ( self ) , closure ) ; |
public class ObjectEnvelopeTable { /** * Replace the { @ link org . apache . ojb . broker . Identity }
* of a registered { @ link ObjectEnvelope } object .
* @ param newOid
* @ param oldOid
* @ return Returns < em > true < / em > if successful . */
boolean replaceRegisteredIdentity ( Identity newOid , Identity ... | /* TODO : Find a better solution */
boolean result = false ; Object oe = mhtObjectEnvelopes . remove ( oldOid ) ; if ( oe != null ) { mhtObjectEnvelopes . put ( newOid , oe ) ; int index = mvOrderOfIds . indexOf ( oldOid ) ; mvOrderOfIds . remove ( index ) ; mvOrderOfIds . add ( index , newOid ) ; result = true ; if ( ... |
public class StyleUtils { /** * Set the feature row style into the polyline options
* @ param polylineOptions polyline options
* @ param featureStyleExtension feature style extension
* @ param featureRow feature row
* @ param density display density : { @ link android . util . DisplayMetrics # density }
* @ r... | FeatureStyle featureStyle = featureStyleExtension . getFeatureStyle ( featureRow ) ; return setFeatureStyle ( polylineOptions , featureStyle , density ) ; |
public class xen_health_ftw { /** * Use this API to fetch filtered set of xen _ health _ ftw resources .
* filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */
public static xen_health_ftw [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | xen_health_ftw obj = new xen_health_ftw ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; xen_health_ftw [ ] response = ( xen_health_ftw [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class AbstractHandler { /** * Returns an active session for the given workspace name in the named repository .
* @ param request the servlet request ; may not be null or unauthenticated
* @ param rawRepositoryName the URL - encoded name of the repository in which the session is created
* @ param rawWorkspa... | assert request != null ; if ( ACTIVE_SESSION . get ( ) == null ) { Session session = getRepositoryManager ( ) . getSession ( request , repositoryNameFor ( rawRepositoryName ) , workspaceNameFor ( rawWorkspaceName ) ) ; ACTIVE_SESSION . set ( session ) ; } return ACTIVE_SESSION . get ( ) ; |
public class ServiceBackedDataModel { /** * Appends an item to an already loaded model . The model must have at least been asked to
* display its first page ( and hence have it ' s total count ) . */
public void appendItem ( T item ) { } } | // if we ' re on the last page and there are fewer than a full page of items , this new item
// will show up on this page so add it
if ( _pageItems . size ( ) < _pageCount ) { _pageItems . add ( item ) ; } _count ++ ; |
public class GroupDeviceElement { /** * read _ attribute _ reply _ i - access limited to package Group */
@ Override GroupReplyList write_attribute_reply_i ( final int rid , final int tmo , final boolean fwd ) throws DevFailed { } } | final Integer rid_obj = new Integer ( rid ) ; final GroupReplyList rl = new GroupReplyList ( ) ; final AsynchRequest ar = arp . get ( rid_obj ) ; if ( ar == null ) { final DevError [ ] errors = new DevError [ 1 ] ; errors [ 0 ] = new DevError ( ) ; errors [ 0 ] . severity = ErrSeverity . ERR ; errors [ 0 ] . reason = "... |
public class CmsUploaderDefault { /** * Creates a form to submit the upload files . < p >
* @ param uploadUri the upload URI
* @ param targetFolder the target folder
* @ param isRootPath if the target folder is given as a root path
* @ param filesToUpload the files to upload
* @ param filesToUnzip the files t... | // create a form using the POST method and multipart MIME encoding
FormPanel form = new FormPanel ( ) ; form . setAction ( uploadUri ) ; form . setEncoding ( FormPanel . ENCODING_MULTIPART ) ; form . setMethod ( FormPanel . METHOD_POST ) ; // create a panel that contains the file input fields and the target folder
Flow... |
public class StreamEx { /** * Returns a sequential { @ code StreamEx } which elements are elements of
* given list in descending order .
* The list elements are accessed using { @ link List # get ( int ) } , so the list
* should provide fast random access . The list is assumed to be unmodifiable
* during the st... | int size = list . size ( ) ; return IntStreamEx . ofIndices ( list ) . mapToObj ( idx -> list . get ( size - idx - 1 ) ) ; |
public class CATConsumer { /** * This method should be handled by the appropriate subclass
* @ param requestNumber
* @ param msgIds */
public void readSet ( int requestNumber , SIMessageHandle [ ] msgHandles ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readSet" , new Object [ ] { requestNumber , msgHandles } ) ; SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "PROTOCOL_ERROR_SICO2003" , null , null ) ) ; FFDCFilter . processException ( e , C... |
public class HiveAvroORCQueryGenerator { /** * Adapt Avro schema / types to Hive column types
* @ param schema Schema to adapt and generate Hive columns with corresponding types
* @ param hiveColumns Optional Map to populate with the generated hive columns for reference of caller
* @ param topLevel If this is fir... | if ( topLevel && ! schema . getType ( ) . equals ( Schema . Type . RECORD ) ) { throw new IllegalArgumentException ( String . format ( "Schema for table must be of type RECORD. Received type: %s for dataset %s" , schema . getType ( ) , datasetName ) ) ; } StringBuilder columns = new StringBuilder ( ) ; boolean isFirst ... |
public class SiteRoot { /** * Get page relative to site root .
* @ param relativePath Path relative to site root
* @ return Page instance or null if not found */
public Page getRelativePage ( String relativePath ) { } } | String path = getRootPath ( ) ; if ( path == null ) { return null ; } StringBuilder sb = new StringBuilder ( path ) ; if ( ! relativePath . startsWith ( "/" ) ) { sb . append ( "/" ) ; } sb . append ( relativePath ) ; return pageManager . getPage ( sb . toString ( ) ) ; |
public class ClientCookie { /** * load new instance of the class
* @ param name
* @ param pc
* @ param log
* @ return */
public static Client getInstance ( String name , PageContext pc , Log log ) { } } | if ( ! StringUtil . isEmpty ( name ) ) name = StringUtil . toUpperCase ( StringUtil . toVariableName ( name ) ) ; String cookieName = "CF_" + TYPE + "_" + name ; return new ClientCookie ( pc , cookieName , _loadData ( pc , cookieName , SCOPE_CLIENT , "client" , log ) ) ; |
public class Seconds { /** * Compares this amount to the specified { @ code Seconds } .
* The comparison is based on the total length of the amounts .
* It is " consistent with equals " , as defined by { @ link Comparable } .
* @ param otherAmount the other amount , not null
* @ return the comparator value , ne... | int thisValue = this . seconds ; int otherValue = otherAmount . seconds ; return Integer . compare ( thisValue , otherValue ) ; |
public class QueryWhere { /** * This method should be used for < ol >
* < li > Normal parameters < / li >
* < li > Regular expression parameters < / li >
* < / ol >
* This method should < b > not < / b > be used for < ol >
* < li > Range parameters < / li >
* < / ol >
* @ param listId
* @ param param
... | if ( param . length == 0 ) { return null ; } if ( QueryCriteriaType . REGEXP . equals ( this . type ) && ! ( param [ 0 ] instanceof String ) ) { throw new IllegalArgumentException ( "Only String parameters may be used in regular expressions." ) ; } QueryCriteria criteria = new QueryCriteria ( listId , this . union , th... |
public class ManagementUtil { /** * Get the MBeanServerId of Agent ID for the provided MBeanServer .
* @ param aMBeanServer MBeanServer whose Server ID / Agent ID is desired .
* @ return MBeanServerId / Agent ID of provided MBeanServer . */
public static String getMBeanServerId ( final MBeanServer aMBeanServer ) { ... | String serverId = null ; final String SERVER_DELEGATE = "JMImplementation:type=MBeanServerDelegate" ; final String MBEAN_SERVER_ID_KEY = "MBeanServerId" ; try { ObjectName delegateObjName = new ObjectName ( SERVER_DELEGATE ) ; serverId = ( String ) aMBeanServer . getAttribute ( delegateObjName , MBEAN_SERVER_ID_KEY ) ;... |
public class ClassLoaderUtils { /** * Load the Class denoted by the given string representation
* @ param className class string representation
* @ param < T > Class generic type
* @ return Class
* @ throws ClassNotFoundException in case of failure */
@ SuppressWarnings ( "unchecked" ) public static < T > Class... | return ( Class < T > ) getClassLoader ( ) . loadClass ( className ) ; |
public class BigtableTableAdminGrpcClient { /** * { @ inheritDoc }
* @ return */
@ Override public ListenableFuture < Empty > dropRowRangeAsync ( DropRowRangeRequest request ) { } } | return createUnaryListener ( request , dropRowRangeRpc , request . getName ( ) ) . getAsyncResult ( ) ; |
public class DateInterval { /** * / * [ deutsch ]
* < p > Interpretiert den angegebenen Text als Intervall mit Hilfe des angegebenen
* Intervallmusters . < / p >
* < p > Beginnend mit der Version v4.18 ist es auch m & ouml ; glich , eine Oder - Logik im Muster zu verwenden .
* Beispiel : < / p >
* < pre >
*... | return IntervalParser . parsePattern ( text , DateIntervalFactory . INSTANCE , parser , intervalPattern ) ; |
public class DoubleStreamEx { /** * Returns a stream consisting of all elements from this stream until the
* first element which does not match the given predicate is found
* ( including the first mismatching element ) .
* This is a < a href = " package - summary . html # StreamOps " > quasi - intermediate
* op... | Objects . requireNonNull ( predicate ) ; return delegate ( new TakeDrop . TDOfDouble ( spliterator ( ) , false , true , predicate ) ) ; |
public class SwingUtil { /** * sets intial focus in window to the specified component
* @ param window window on which focus has to be set
* @ param comp component which need to have initial focus */
public static void setInitialFocus ( Window window , final Component comp ) { } } | window . addWindowFocusListener ( new WindowAdapter ( ) { @ Override public void windowGainedFocus ( WindowEvent we ) { comp . requestFocusInWindow ( ) ; we . getWindow ( ) . removeWindowFocusListener ( this ) ; } } ) ; |
public class Utils { /** * Find a child node of a given type in a parent struct , or return null . */
public static Node < PluralType > findChild ( Struct < PluralType > parent , PluralType type ) { } } | for ( Node < PluralType > n : parent . nodes ( ) ) { if ( n . type ( ) == type ) { return n ; } } return null ; |
public class EmojiManager { /** * Returns the { @ link com . vdurmont . emoji . Emoji } for a given alias .
* @ param alias the alias
* @ return the associated { @ link com . vdurmont . emoji . Emoji } , null if the alias
* is unknown */
public static Emoji getForAlias ( String alias ) { } } | if ( alias == null ) { return null ; } return EMOJIS_BY_ALIAS . get ( trimAlias ( alias ) ) ; |
public class Instagram4j { /** * / * REAL - TIME SUBSCRIPTIONS */
@ Override public InstagramSingleObjectResponse createUserSubscription ( String clientId , String clientSecret , String callbackUrl ) throws InstagramError { } } | return instagramRealtime . createUserSubscription ( clientId , clientSecret , callbackUrl , InstagramSubscriptionObjectTypes . USER . getObject ( ) , SUBSCRIPTION_ASPECT ) ; |
public class PartialVisitContext { /** * an new id has been added . */
private void _idAdded ( String clientId ) { } } | // An id to visit has been added , update our other
// collections to reflect this .
// Update the ids collection
_ids . add ( _getIdFromClientId ( clientId ) ) ; // Update the unvisited ids collection
_unvisitedClientIds . add ( clientId ) ; // Update the subtree ids collection
_addSubtreeClientId ( clientId ) ; |
public class LoadBalancingHttpClient { /** * Construct an RxClient . ClientConfig from an IClientConfig
* @ param requestConfig
* @ return */
private RxClient . ClientConfig getRxClientConfig ( IClientConfig requestConfig ) { } } | if ( requestConfig == null ) { return DEFAULT_RX_CONFIG ; } int requestReadTimeout = getProperty ( IClientConfigKey . Keys . ReadTimeout , requestConfig , DefaultClientConfigImpl . DEFAULT_READ_TIMEOUT ) ; Boolean followRedirect = getProperty ( IClientConfigKey . Keys . FollowRedirects , requestConfig , null ) ; HttpCl... |
public class ProgressFragment { /** * Set the content view to an explicit view . If the content view was installed earlier ,
* the content will be replaced with a new view .
* @ param view The desired content to display . Value can ' t be null .
* @ see # setContentView ( int )
* @ see # getContentView ( ) */
p... | ensureContent ( ) ; if ( view == null ) { throw new IllegalArgumentException ( "Content view can't be null" ) ; } if ( mContentContainer instanceof ViewGroup ) { ViewGroup contentContainer = ( ViewGroup ) mContentContainer ; if ( mContentView == null ) { contentContainer . addView ( view ) ; } else { int index = conten... |
public class TypeAnnotationPosition { /** * Create a { @ code TypeAnnotationPosition } for a type cast .
* @ param location The type path .
* @ param onLambda The lambda for this variable .
* @ param type _ index The index into an intersection type .
* @ param pos The position from the associated tree node . */... | return new TypeAnnotationPosition ( TargetType . CAST , pos , Integer . MIN_VALUE , onLambda , type_index , Integer . MIN_VALUE , location ) ; |
public class PPORGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . PPORG__RG_LENGTH : setRGLength ( ( Integer ) newValue ) ; return ; case AfplibPackage . PPORG__OBJ_TYPE : setObjType ( ( Integer ) newValue ) ; return ; case AfplibPackage . PPORG__PROC_FLGS : setProcFlgs ( ( Integer ) newValue ) ; return ; case AfplibPackage . PPORG__XOCA_OS... |
public class ClassLoadingServiceImpl { /** * { @ inheritDoc } */
@ Override @ FFDCIgnore ( InterruptedException . class ) /* re - thrown as an IllegalStateException and FFDC ' d later */
public ThreadContextClassLoader createThreadContextClassLoader ( final ClassLoader applicationClassLoader ) { } } | final String methodName = "createThreadContextClassLoader(): " ; if ( applicationClassLoader == null ) { throw new IllegalArgumentException ( "ClassLoader argument is null" ) ; } final String key ; if ( applicationClassLoader instanceof AppClassLoader ) { key = ( ( AppClassLoader ) applicationClassLoader ) . getKey ( )... |
public class Util { /** * Call this if you have a byte array to convert to long , but your array might need
* to be left - padded with zeros ( if it is less than 8 bytes long ) . */
public static long bytesToLongPad ( byte [ ] bytes ) { } } | final int padZeros = Math . max ( 8 - bytes . length , 0 ) ; ByteBuffer bb = ByteBuffer . allocate ( 8 ) ; for ( int i = 0 ; i < padZeros ; i ++ ) { bb . put ( ( byte ) 0 ) ; } bb . put ( bytes , 0 , 8 - padZeros ) ; bb . flip ( ) ; return bb . getLong ( ) ; |
public class ExcelFunctions { /** * Capitalizes the first letter of every word in a text string */
public static String proper ( EvaluationContext ctx , Object text ) { } } | String _text = Conversions . toString ( text , ctx ) . toLowerCase ( ) ; if ( ! StringUtils . isEmpty ( _text ) ) { char [ ] buffer = _text . toCharArray ( ) ; boolean capitalizeNext = true ; for ( int i = 0 ; i < buffer . length ; ++ i ) { char ch = buffer [ i ] ; if ( ! Character . isAlphabetic ( ch ) ) { capitalizeN... |
public class Label { /** * If < code > Label < / code > represents an object , < code > Instances < / code > contains the bounding boxes for each instance
* of the detected object . Bounding boxes are returned for common object labels such as people , cars , furniture ,
* apparel or pets .
* @ param instances
*... | if ( instances == null ) { this . instances = null ; return ; } this . instances = new java . util . ArrayList < Instance > ( instances ) ; |
public class SelectionVisibility { /** * Determines if any bond in the list is selected
* @ param bonds list of bonds
* @ return at least bond bond is selected */
static boolean hasSelectedBond ( List < IBond > bonds , RendererModel model ) { } } | for ( IBond bond : bonds ) { if ( isSelected ( bond , model ) ) return true ; } return false ; |
public class JDBCStorageConnection { /** * { @ inheritDoc } */
public List < PropertyData > getChildPropertiesData ( NodeData parent , List < QPathEntryFilter > itemDataFilter ) throws RepositoryException , IllegalStateException { } } | // return all child properties by default
return getChildPropertiesData ( parent ) ; |
public class PacketDecoder { /** * fastest way to parse chars to int */
private long readLong ( ByteBuf chars , int length ) { } } | long result = 0 ; for ( int i = chars . readerIndex ( ) ; i < chars . readerIndex ( ) + length ; i ++ ) { int digit = ( ( int ) chars . getByte ( i ) & 0xF ) ; for ( int j = 0 ; j < chars . readerIndex ( ) + length - 1 - i ; j ++ ) { digit *= 10 ; } result += digit ; } chars . readerIndex ( chars . readerIndex ( ) + le... |
public class MsgPhrase { /** * load the phrase .
* @ throws EFapsException on error */
private void load ( ) throws EFapsException { } } | final QueryBuilder queryBldr = new QueryBuilder ( CIAdminCommon . MsgPhraseConfigAbstract ) ; queryBldr . addWhereAttrEqValue ( CIAdminCommon . MsgPhraseConfigAbstract . AbstractLink , getId ( ) ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addAttribute ( CIAdminCommon . MsgPhraseConfigAbstract .... |
public class ZooKeeperUtilityFactory { /** * Creates a { @ link ZooKeeperSharedCount } to store a shared count between multiple instances .
* @ param path to the shared count in ZooKeeper
* @ param seedCount for the shared count
* @ return a shared count */
public ZooKeeperSharedCount createSharedCount ( String p... | return new ZooKeeperSharedCount ( new SharedCount ( facade , path , seedCount ) ) ; |
public class CPDefinitionVirtualSettingPersistenceImpl { /** * Returns the cp definition virtual setting where classNameId = & # 63 ; and classPK = & # 63 ; or throws a { @ link NoSuchCPDefinitionVirtualSettingException } if it could not be found .
* @ param classNameId the class name ID
* @ param classPK the class... | CPDefinitionVirtualSetting cpDefinitionVirtualSetting = fetchByC_C ( classNameId , classPK ) ; if ( cpDefinitionVirtualSetting == null ) { StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "classNameId=" ) ; msg . append ( classNameId ) ; msg . append ( ", classPK=... |
public class JDBC4Connection { /** * Puts this connection in read - only mode as a hint to the driver to enable database optimizations . */
@ Override public void setReadOnly ( boolean readOnly ) throws SQLException { } } | checkClosed ( ) ; if ( ! Boolean . parseBoolean ( props . getProperty ( "enableSetReadOnly" , "false" ) ) ) { throw SQLError . noSupport ( ) ; } |
public class CommerceShippingFixedOptionRelPersistenceImpl { /** * Returns the commerce shipping fixed option rels before and after the current commerce shipping fixed option rel in the ordered set where commerceShippingMethodId = & # 63 ; .
* @ param commerceShippingFixedOptionRelId the primary key of the current co... | CommerceShippingFixedOptionRel commerceShippingFixedOptionRel = findByPrimaryKey ( commerceShippingFixedOptionRelId ) ; Session session = null ; try { session = openSession ( ) ; CommerceShippingFixedOptionRel [ ] array = new CommerceShippingFixedOptionRelImpl [ 3 ] ; array [ 0 ] = getByCommerceShippingMethodId_PrevAnd... |
public class RequestSigner { /** * Computes the signature for a request instance .
* @ param request Request to compute signature for .
* @ return HMAC - SHA2556 signature for the provided request . */
private byte [ ] computeSignature ( Request request ) { } } | String timestampAndQuery = request . getTimestamp ( ) + '\n' + request . getSortedQueryParameters ( ) + '\n' ; byte [ ] timestampAndQueryBytes = timestampAndQuery . getBytes ( CHARSET_UTF8 ) ; byte [ ] bodyHashBytes = getSha256Hash ( request . getData ( ) ) ; return getHmacSha256Signature ( appendArrays ( timestampAndQ... |
public class BaseRTMPHandler { /** * Stream bytes read event handler .
* @ param conn
* Connection
* @ param channel
* Channel
* @ param source
* Header
* @ param streamBytesRead
* Bytes read event context */
protected void onStreamBytesRead ( RTMPConnection conn , Channel channel , Header source , Byte... | conn . receivedBytesRead ( streamBytesRead . getBytesRead ( ) ) ; |
public class ByteUtilities { /** * Encodes an integer into up to 4 bytes in network byte order in the
* supplied buffer starting at < code > start < / code > offset and writing
* < code > count < / code > bytes .
* @ param num the int to convert to a byte array
* @ param buf the buffer to write the bytes to
*... | if ( count > 4 ) { throw new IllegalArgumentException ( "Cannot handle more than 4 bytes" ) ; } for ( int i = count - 1 ; i >= 0 ; i -- ) { buf [ start + i ] = ( byte ) ( num & 0xff ) ; num >>>= 8 ; } |
public class mps_ssl_certkey { /** * < pre >
* Use this operation to install certificate on Management Service .
* < / pre > */
public static mps_ssl_certkey add ( nitro_service client , mps_ssl_certkey resource ) throws Exception { } } | resource . validate ( "add" ) ; return ( ( mps_ssl_certkey [ ] ) resource . perform_operation ( client , "add" ) ) [ 0 ] ; |
public class MultipleAlignmentJmolDisplay { /** * Creates a new Frame with the String output representation of the
* { @ link MultipleAlignment } .
* @ param multAln
* @ param result String output */
public static void showAlignmentImage ( MultipleAlignment multAln , String result ) { } } | JFrame frame = new JFrame ( ) ; String title = multAln . getEnsemble ( ) . getAlgorithmName ( ) + " V." + multAln . getEnsemble ( ) . getVersion ( ) ; frame . setTitle ( title ) ; frame . setDefaultCloseOperation ( JFrame . DISPOSE_ON_CLOSE ) ; AlignmentTextPanel txtPanel = new AlignmentTextPanel ( ) ; txtPanel . setTe... |
public class Imports { /** * Pass in a possible Theme . If it is " " or null , it will resolve to default Theme set in Imports
* @ param theTheme
* @ return */
@ Override public String themeResolve ( String theTheme ) { } } | return ( theTheme == null || theTheme . length ( ) == 0 ) ? theme : theTheme ; |
public class RssServlet { /** * Finds the page , returns { @ code null } when not able to find the page . */
private static Page findPage ( ServletContext servletContext , HttpServletRequest req , HttpServletResponse resp , SemanticCMS semanticCMS ) throws ServletException , IOException { } } | // Path extra info not allowed
if ( req . getPathInfo ( ) != null ) { return null ; } // Query string not allowed
if ( req . getQueryString ( ) != null ) { return null ; } String basePath ; { String servletPath = req . getServletPath ( ) ; // Must end in expected extension
if ( ! servletPath . endsWith ( RssUtils . EXT... |
public class SqlStatementResultMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SqlStatementResult sqlStatementResult , ProtocolMarshaller protocolMarshaller ) { } } | if ( sqlStatementResult == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sqlStatementResult . getNumberOfRecordsUpdated ( ) , NUMBEROFRECORDSUPDATED_BINDING ) ; protocolMarshaller . marshall ( sqlStatementResult . getResultFrame ( ) , RESU... |
public class SimpleAuthenticator { /** * Registers a PasswordAuthentication with a given net address . */
public PasswordAuthentication registerPasswordAuthentication ( InetAddress pAddress , int pPort , String pProtocol , String pPrompt , String pScheme , PasswordAuthentication pPA ) { } } | /* System . err . println ( " registerPasswordAuthentication " ) ;
System . err . println ( pAddress ) ;
System . err . println ( pPort ) ;
System . err . println ( pProtocol ) ;
System . err . println ( pPrompt ) ;
System . err . println ( pScheme ) ; */
return passwordAuthentications . put ( new AuthKey ( p... |
public class DateTimeApiParameterMapper { /** * 時間への変換
* @ param temporalAccessor 時間的オブジェクト
* @ return カレンダー時間のミリ秒 */
private long toTime ( final TemporalAccessor temporalAccessor ) { } } | Calendar calendar = Calendar . getInstance ( ) ; setField ( calendar , Calendar . YEAR , temporalAccessor , ChronoField . YEAR , 0 , 1970 ) ; setField ( calendar , Calendar . MONTH , temporalAccessor , ChronoField . MONTH_OF_YEAR , - 1 , 0 ) ; setField ( calendar , Calendar . DATE , temporalAccessor , ChronoField . DAY... |
public class InstanceValidator { /** * note that we don ' t check the type here ; it could be string , uri or code . */
private void checkPrimitiveBinding ( List < ValidationMessage > errors , String path , String type , ElementDefinition elementContext , Element element , StructureDefinition profile ) { } } | if ( ! element . hasPrimitiveValue ( ) ) return ; String value = element . primitiveValue ( ) ; // System . out . println ( " check " + value + " in " + path ) ;
// firstly , resolve the value set
ElementDefinitionBindingComponent binding = elementContext . getBinding ( ) ; if ( binding . hasValueSet ( ) && binding . g... |
public class UnderFileSystemBlockReader { /** * This interface is supposed to be used for sequence block reads .
* @ param buf the byte buffer
* @ return the number of bytes read , - 1 if it reaches EOF and none was read */
@ Override public int transferTo ( ByteBuf buf ) throws IOException { } } | Preconditions . checkState ( ! mClosed ) ; if ( mUnderFileSystemInputStream == null ) { return - 1 ; } if ( mBlockMeta . getBlockSize ( ) <= mInStreamPos ) { return - 1 ; } // Make a copy of the state to keep track of what we have read in this transferTo call .
ByteBuf bufCopy = null ; if ( mBlockWriter != null ) { buf... |
public class FeatureTableCoreIndex { /** * Query for Geometry Index count within the bounding box , projected
* correctly
* @ param boundingBox
* bounding box
* @ return count */
public long count ( BoundingBox boundingBox ) { } } | GeometryEnvelope envelope = boundingBox . buildEnvelope ( ) ; long count = count ( envelope ) ; return count ; |
public class HTMLReport { /** * Write toc - mc . html for managed connections
* @ param events The events
* @ param fw The file writer
* @ exception Exception If an error occurs */
private static void generateToCManagedConnection ( Map < String , TraceEvent > events , FileWriter fw ) throws Exception { } } | writeString ( fw , "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"" ) ; writeEOL ( fw ) ; writeString ( fw , " \"http://www.w3.org/TR/html4/loose.dtd\">" ) ; writeEOL ( fw ) ; writeString ( fw , "<html>" ) ; writeEOL ( fw ) ; writeString ( fw , "<head>" ) ; writeEOL ( fw ) ; write... |
public class Row { /** * Serialize the row ' s metadata to enable upgrade . */
private void toData ( ByteArrayOutputStream bos ) throws IOException { } } | writeString ( bos , _name ) ; BitsUtil . writeInt16 ( bos , keyColumnStart ( ) ) ; BitsUtil . writeInt16 ( bos , keyColumnEnd ( ) ) ; BitsUtil . writeInt16 ( bos , _columns . length ) ; for ( Column column : _columns ) { column . toData ( bos ) ; } BitsUtil . writeInt16 ( bos , _blobs . length ) ; for ( Column column :... |
public class SendBonusRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SendBonusRequest sendBonusRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( sendBonusRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sendBonusRequest . getWorkerId ( ) , WORKERID_BINDING ) ; protocolMarshaller . marshall ( sendBonusRequest . getBonusAmount ( ) , BONUSAMOUNT_BINDING ) ; protocolMarsha... |
public class RDBMetadataExtractionTools { /** * Retrieves the foreign keys for the table */
private static void getForeignKeys ( DatabaseMetaData md , DatabaseRelationDefinition relation , DBMetadata metadata ) throws SQLException { } } | QuotedIDFactory idfac = metadata . getQuotedIDFactory ( ) ; RelationID relationId = relation . getID ( ) ; try ( ResultSet rs = md . getImportedKeys ( null , relationId . getSchemaName ( ) , relationId . getTableName ( ) ) ) { extractForeignKeys ( relation , metadata , idfac , rs ) ; } catch ( Exception ex ) { try ( Re... |
public class PeerAwareInstanceRegistryImpl { /** * Updates the < em > renewal threshold < / em > based on the current number of
* renewals . The threshold is a percentage as specified in
* { @ link EurekaServerConfig # getRenewalPercentThreshold ( ) } of renewals
* received per minute { @ link # getNumOfRenewsInL... | try { Applications apps = eurekaClient . getApplications ( ) ; int count = 0 ; for ( Application app : apps . getRegisteredApplications ( ) ) { for ( InstanceInfo instance : app . getInstances ( ) ) { if ( this . isRegisterable ( instance ) ) { ++ count ; } } } synchronized ( lock ) { // Update threshold only if the th... |
public class ProxyBuilder { /** * Generate a proxy class . Note that new instances of this class will not automatically have an
* an invocation handler , even if { @ link # handler ( InvocationHandler ) } was called . The handler
* must be set on each instance after it is created , using
* { @ link # setInvocatio... | ClassLoader requestedClassloader ; if ( sharedClassLoader ) { requestedClassloader = baseClass . getClassLoader ( ) ; } else { requestedClassloader = parentClassLoader ; } // try the cache to see if we ' ve generated this one before
// we only populate the map with matching types
ProxiedClass < T > cacheKey = new Proxi... |
public class CFSA2 { /** * Read a v - int . */
static int readVInt ( byte [ ] array , int offset ) { } } | byte b = array [ offset ] ; int value = b & 0x7F ; for ( int shift = 7 ; b < 0 ; shift += 7 ) { b = array [ ++ offset ] ; value |= ( b & 0x7F ) << shift ; } return value ; |
public class ListManagementImageListsImpl { /** * Updates an image list with list Id equal to list Id passed .
* @ param listId List Id of the image list .
* @ param contentType The content type .
* @ param bodyParameter Schema of the body .
* @ throws IllegalArgumentException thrown if parameters fail the vali... | return updateWithServiceResponseAsync ( listId , contentType , bodyParameter ) . map ( new Func1 < ServiceResponse < ImageList > , ImageList > ( ) { @ Override public ImageList call ( ServiceResponse < ImageList > response ) { return response . body ( ) ; } } ) ; |
public class EnvironmentUtils { /** * Get a set of all classpath entries EXCEPT of those under excludeEnv directories .
* Every excludeEnv entry is an environment variable name .
* @ param excludeEnv A set of environments to be excluded .
* @ return A set of classpath entries as strings . */
public static Set < S... | final Set < String > jars = new HashSet < > ( ) ; final Set < Path > excludePaths = new HashSet < > ( ) ; for ( final String env : excludeEnv ) { final String path = System . getenv ( env ) ; if ( null != path ) { final File file = new File ( path ) ; if ( file . exists ( ) ) { excludePaths . add ( file . toPath ( ) ) ... |
public class AvatarZooKeeperClient { /** * Gets the { @ link Stat } of the node . Will create and destroy connection if
* the AvatarZooKeeperClient is not configured to set watchers
* @ param node
* the path of zNode to get { @ link Stat } for
* @ return { @ link Stat } of the node
* @ throws IOException
* ... | int failures = 0 ; boolean gotStats = false ; Stat res = null ; while ( ! gotStats ) { initZK ( ) ; try { res = zk . exists ( node , watch ) ; // Since stats can be null we have to control the execution with a flag
gotStats = true ; } catch ( KeeperException kex ) { if ( KeeperException . Code . CONNECTIONLOSS == kex .... |
public class JsonMarshallerContext { /** * Convenience method to marshall a nested object ( may be simple or structured ) at the given location .
* @ param marshallLocation Current { @ link MarshallLocation }
* @ param val Value to marshall .
* @ param paramName Name of parameter to marshall . */
public void mars... | marshallerRegistry ( ) . getMarshaller ( marshallLocation , val ) . marshall ( val , this , paramName ) ; |
public class AbstractWComponent { /** * Retrieves the children of this component .
* @ return a list containing the children of this component , or an empty list . */
List < WComponent > getChildren ( ) { } } | List < WComponent > children = getComponentModel ( ) . getChildren ( ) ; return children != null && ! children . isEmpty ( ) ? Collections . unmodifiableList ( children ) : Collections . < WComponent > emptyList ( ) ; |
public class Utils4J { /** * Verifies if the cause of an exception is of a given type .
* @ param actualException
* Actual exception that was caused by something else - Cannot be < code > null < / code > .
* @ param expectedExceptions
* Expected exceptions - May be < code > null < / code > if any cause is expec... | checkNotNull ( "actualException" , actualException ) ; if ( expectedExceptions == null || expectedExceptions . size ( ) == 0 ) { // All exceptions are expected
return true ; } final Throwable cause = actualException . getCause ( ) ; if ( ! ( cause instanceof Exception ) ) { // We ' re only interested in exceptions
retu... |
public class BatchingLocalHeapWriteBehindQueue { /** * Gets the best estimate for items in the queue still awaiting processing .
* Since the value returned is a rough estimate , it can sometimes be more than
* the number of items actually in the queue but not less .
* @ return the amount of elements still awaitin... | Batch snapshot = openBatch ; return executorQueue . size ( ) * batchSize + ( snapshot == null ? 0 : snapshot . size ( ) ) ; |
public class AssemblyFiles { /** * Add a entry to the list of assembly files which possible should be monitored
* @ param srcFile source file to monitor . The source file must exist .
* @ param destFile the destination to which it is eventually copied . The destination file must be relative . */
public void addEntr... | entries . add ( new Entry ( srcFile , destFile ) ) ; |
public class AOL { /** * Returns an AOL key ( arch . os . linker ) to search in the properties files .
* @ return dot separated AOL */
public final String getKey ( ) { } } | String tempLinkerName = null ; if ( this . linkerName == null ) { tempLinkerName = "" ; } else if ( this . linkerName . equals ( "g++" ) ) { tempLinkerName = ".gpp" ; } else { tempLinkerName = "." + this . linkerName ; } return this . architecture + ( this . os == null ? "" : "." + this . os + tempLinkerName ) ; |
public class Misc { /** * Obtain string for SQL argument list from array .
* @ param < T > Type of data .
* @ param values Array of values .
* @ return CSV string */
@ SafeVarargs static < T > String sqlArgumentList ( T ... values ) { } } | StringBuilder sb = new StringBuilder ( ) ; if ( values . length != 0 ) { sb . append ( values [ 0 ] ) ; for ( int i = 1 ; i < values . length ; i ++ ) { sb . append ( ',' ) . append ( ' ' ) . append ( values [ i ] ) ; } } return sb . toString ( ) ; |
public class MethodPool { /** * Returns a method identified by an method identifier .
* @ param identifier The method identifier
* @ return The found method or a default handler */
public Method get ( final MethodIdentifier identifier ) { } } | // search for available methods
readWriteLock . readLock ( ) . lock ( ) ; try { final Optional < ? extends IdentifiableMethod > method = availableMethods . stream ( ) . filter ( m -> m . matches ( identifier ) ) . findAny ( ) ; if ( method . isPresent ( ) ) return method . get ( ) ; } finally { readWriteLock . readLock... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.