signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class JobStreamsInner { /** * Retrieve the job stream identified by job stream id .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param jobId The job id .
* @ param jobStreamId The job stream id .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the JobStreamInner object */
public Observable < JobStreamInner > getAsync ( String resourceGroupName , String automationAccountName , String jobId , String jobStreamId ) { } } | return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , jobId , jobStreamId ) . map ( new Func1 < ServiceResponse < JobStreamInner > , JobStreamInner > ( ) { @ Override public JobStreamInner call ( ServiceResponse < JobStreamInner > response ) { return response . body ( ) ; } } ) ; |
public class ModuleCacheImpl { /** * / * ( non - Javadoc )
* @ see com . ibm . jaggr . service . module . IModuleCache # getBuild ( javax . servlet . http . HttpServletRequest , com . ibm . jaggr . service . module . IModule ) */
@ Override public Future < ModuleBuildReader > getBuild ( HttpServletRequest request , IModule module ) throws IOException { } } | IAggregator aggr = ( IAggregator ) request . getAttribute ( IAggregator . AGGREGATOR_REQATTRNAME ) ; @ SuppressWarnings ( "unchecked" ) Map < String , String > moduleCacheInfo = ( Map < String , String > ) request . getAttribute ( IModuleCache . MODULECACHEINFO_PROPNAME ) ; IResource resource = module . getResource ( aggr ) ; String cacheKey = module . getModuleId ( ) ; // Try to get the module from the module cache first
IModule cachedModule = null ; if ( ! resource . exists ( ) ) { // Source file doesn ' t exist .
// NotFound modules are not cached . If the module is in the cache ( because a
// source file has been deleted ) , then remove the cached module .
cachedModule = cacheMap . remove ( cacheKey ) ; if ( cachedModule != null ) { if ( moduleCacheInfo != null ) { moduleCacheInfo . put ( cacheKey , "remove" ) ; // $ NON - NLS - 1 $
} cachedModule . clearCached ( aggr . getCacheManager ( ) ) ; } throw new NotFoundException ( resource . getURI ( ) . toString ( ) ) ; } else { // add it to the module cache if not already there
if ( ! RequestUtil . isIgnoreCached ( request ) ) { cachedModule = cacheMap . putIfAbsent ( cacheKey , module ) ; if ( cachedModule != null && aggr . getOptions ( ) . isDevelopmentMode ( ) ) { // If the uri for the source resource has changed ( can happen with resource converters )
// discard the cached module and use the new one .
IResource cachedResource = cachedModule . getResource ( null ) ; if ( cachedResource != null && ! cachedResource . getURI ( ) . equals ( resource . getURI ( ) ) ) { cacheMap . replace ( cacheKey , module ) ; cachedModule = null ; } } } if ( moduleCacheInfo != null ) { moduleCacheInfo . put ( cacheKey , ( cachedModule != null ) ? "hit" : "add" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} module = cachedModule != null ? cachedModule : module ; } return module . getBuild ( request ) ; |
public class MethodSyncor { /** * Update method key . */
public void updateMethodKey ( ) { } } | Arrays . stream ( ParamType . values ( ) ) . forEach ( paramType -> this . syncMethodKey ( paramType ) ) ; this . validationDataRepository . flush ( ) ; this . validationStore . refresh ( ) ; log . info ( "[METHOD_KEY_SYNC] Complete" ) ; |
public class SamlProfileSamlNameIdBuilder { /** * Determine name id name id .
* @ param authnRequest the authn request
* @ param assertion the assertion
* @ param supportedNameFormats the supported name formats
* @ param service the service
* @ param adaptor the adaptor
* @ return the name id */
protected NameID determineNameId ( final RequestAbstractType authnRequest , final Object assertion , final List < String > supportedNameFormats , final SamlRegisteredService service , final SamlRegisteredServiceServiceProviderMetadataFacade adaptor ) { } } | for ( val nameFormat : supportedNameFormats ) { LOGGER . debug ( "Evaluating NameID format [{}]" , nameFormat ) ; val nameid = encodeNameIdBasedOnNameFormat ( authnRequest , assertion , nameFormat , service , adaptor ) ; if ( nameid != null ) { LOGGER . debug ( "Determined NameID based on format [{}] to be [{}]" , nameFormat , nameid . getValue ( ) ) ; return nameid ; } } LOGGER . warn ( "No NameID could be determined based on the supported formats [{}]" , supportedNameFormats ) ; return null ; |
public class PhotosetsInterface { /** * Modify the meta - data for a photoset .
* @ param photosetId
* The photoset ID
* @ param title
* A new title
* @ param description
* A new description ( can be null )
* @ throws FlickrException */
public void editMeta ( String photosetId , String title , String description ) throws FlickrException { } } | Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_EDIT_META ) ; parameters . put ( "photoset_id" , photosetId ) ; parameters . put ( "title" , title ) ; if ( description != null ) { parameters . put ( "description" , description ) ; } Response response = transportAPI . post ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } |
public class AbstractFMT { /** * execute .
* @ throws org . apache . maven . plugin . MojoExecutionException if any . */
public void execute ( ) throws MojoExecutionException , MojoFailureException { } } | if ( skip ) { getLog ( ) . info ( "Skipping format check" ) ; return ; } if ( "pom" . equals ( packaging ) ) { getLog ( ) . info ( "Skipping format check: project uses 'pom' packaging" ) ; return ; } if ( skipSortingImports ) { getLog ( ) . info ( "Skipping sorting imports" ) ; } List < File > directoriesToFormat = new ArrayList < File > ( ) ; if ( sourceDirectory . exists ( ) ) { directoriesToFormat . add ( sourceDirectory ) ; } else { handleMissingDirectory ( "Source" , sourceDirectory ) ; } if ( testSourceDirectory . exists ( ) ) { directoriesToFormat . add ( testSourceDirectory ) ; } else { handleMissingDirectory ( "Test source" , testSourceDirectory ) ; } for ( File additionalSourceDirectory : additionalSourceDirectories ) { if ( additionalSourceDirectory . exists ( ) ) { directoriesToFormat . add ( additionalSourceDirectory ) ; } else { handleMissingDirectory ( "Additional source" , additionalSourceDirectory ) ; } } Formatter formatter = getFormatter ( ) ; for ( File directoryToFormat : directoriesToFormat ) { formatSourceFilesInDirectory ( directoryToFormat , formatter ) ; } logNumberOfFilesProcessed ( ) ; postExecute ( this . filesProcessed , this . nonComplyingFiles ) ; |
public class AttachmentScribe { /** * Gets the value of the given " cid " URI .
* @ param uri the " cid " URI
* @ return the URI value or null if the given string is not a " cid " URI */
private static String getCidUriValue ( String uri ) { } } | int colon = uri . indexOf ( ':' ) ; if ( colon == 3 ) { String scheme = uri . substring ( 0 , colon ) ; return "cid" . equalsIgnoreCase ( scheme ) ? uri . substring ( colon + 1 ) : null ; } if ( uri . length ( ) > 0 && uri . charAt ( 0 ) == '<' && uri . charAt ( uri . length ( ) - 1 ) == '>' ) { return uri . substring ( 1 , uri . length ( ) - 1 ) ; } return null ; |
public class NumberUtils { /** * < p > Returns the minimum value in an array . < / p >
* @ param array an array , must not be null or empty
* @ return the minimum value in the array
* @ throws IllegalArgumentException if < code > array < / code > is < code > null < / code >
* @ throws IllegalArgumentException if < code > array < / code > is empty
* @ see IEEE754rUtils # min ( float [ ] ) IEEE754rUtils for a version of this method that handles NaN differently
* @ since 3.4 Changed signature from min ( float [ ] ) to min ( float . . . ) */
public static float min ( final float ... array ) { } } | // Validates input
validateArray ( array ) ; // Finds and returns min
float min = array [ 0 ] ; for ( int i = 1 ; i < array . length ; i ++ ) { if ( Float . isNaN ( array [ i ] ) ) { return Float . NaN ; } if ( array [ i ] < min ) { min = array [ i ] ; } } return min ; |
public class Bootstraps { /** * 引用一个服务
* @ param consumerConfig 服务消费者配置
* @ param < T > 接口类型
* @ return 引用启动类 */
public static < T > ConsumerBootstrap < T > from ( ConsumerConfig < T > consumerConfig ) { } } | String bootstrap = consumerConfig . getBootstrap ( ) ; ConsumerBootstrap consumerBootstrap ; if ( StringUtils . isNotEmpty ( bootstrap ) ) { consumerBootstrap = ExtensionLoaderFactory . getExtensionLoader ( ConsumerBootstrap . class ) . getExtension ( bootstrap , new Class [ ] { ConsumerConfig . class } , new Object [ ] { consumerConfig } ) ; } else { // default is same with protocol
bootstrap = consumerConfig . getProtocol ( ) ; ExtensionLoader extensionLoader = ExtensionLoaderFactory . getExtensionLoader ( ConsumerBootstrap . class ) ; ExtensionClass < ConsumerBootstrap > extensionClass = extensionLoader . getExtensionClass ( bootstrap ) ; if ( extensionClass == null ) { // if not exist , use default consumer bootstrap
bootstrap = RpcConfigs . getStringValue ( RpcOptions . DEFAULT_CONSUMER_BOOTSTRAP ) ; consumerConfig . setBootstrap ( bootstrap ) ; consumerBootstrap = ExtensionLoaderFactory . getExtensionLoader ( ConsumerBootstrap . class ) . getExtension ( bootstrap , new Class [ ] { ConsumerConfig . class } , new Object [ ] { consumerConfig } ) ; } else { consumerConfig . setBootstrap ( bootstrap ) ; consumerBootstrap = extensionClass . getExtInstance ( new Class [ ] { ConsumerConfig . class } , new Object [ ] { consumerConfig } ) ; } } return ( ConsumerBootstrap < T > ) consumerBootstrap ; |
public class CoreOAuthProviderSupport { /** * Inherited . */
public Map < String , String > parseParameters ( HttpServletRequest request ) { } } | Map < String , String > parameters = parseHeaderParameters ( request ) ; if ( parameters == null ) { // if there is no header authorization parameters , then the oauth parameters are the supported OAuth request parameters .
parameters = new HashMap < String , String > ( ) ; for ( String supportedOAuthParameter : getSupportedOAuthParameters ( ) ) { String param = request . getParameter ( supportedOAuthParameter ) ; if ( param != null ) { parameters . put ( supportedOAuthParameter , param ) ; } } } return parameters ; |
public class LicensesIncluderPostProcessor { /** * ( non - Javadoc )
* @ see net . jawr . web . resource . bundle . postprocess . impl .
* AbstractChainedResourceBundlePostProcessor
* # doPostProcessBundle ( net . jawr . web . resource . bundle . JoinableResourceBundle ,
* java . lang . StringBuffer ) */
@ Override protected StringBuffer doPostProcessBundle ( BundleProcessingStatus status , StringBuffer bundleData ) throws IOException { } } | JoinableResourceBundle bundle = status . getCurrentBundle ( ) ; Charset charset = status . getJawrConfig ( ) . getResourceCharset ( ) ; if ( bundle . getLicensesPathList ( ) . isEmpty ( ) ) return bundleData ; ByteArrayOutputStream baOs = new ByteArrayOutputStream ( ) ; WritableByteChannel wrChannel = Channels . newChannel ( baOs ) ; Writer writer = Channels . newWriter ( wrChannel , charset . name ( ) ) ; try ( BufferedWriter bwriter = new BufferedWriter ( writer ) ) { for ( Iterator < String > it = bundle . getLicensesPathList ( ) . iterator ( ) ; it . hasNext ( ) ; ) { String path = it . next ( ) ; if ( LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "Adding license file: " + path ) ; Reader rd = null ; try { rd = status . getRsReader ( ) . getResource ( bundle , path ) ; } catch ( ResourceNotFoundException e ) { throw new BundlingProcessException ( "Unexpected ResourceNotFoundException when reading a sorting file [" + path + "]" ) ; } try ( BufferedReader bRd = new BufferedReader ( rd ) ) { // Make a buffered reader , to read line by line .
String line = bRd . readLine ( ) ; // Write each line and the corresponding new line .
while ( line != null ) { bwriter . write ( line ) ; if ( ( ( line = bRd . readLine ( ) ) != null ) || it . hasNext ( ) ) bwriter . newLine ( ) ; } } } } return new StringBuffer ( baOs . toString ( charset . name ( ) ) ) . append ( bundleData ) ; |
public class MetadataProviderImpl { /** * Determine the indexed property from a list of method metadata .
* @ param methodMetadataOfType
* The list of method metadata .
* @ return The { @ link IndexedPropertyMethodMetadata } . */
private IndexedPropertyMethodMetadata < ? > getIndexedPropertyMethodMetadata ( Collection < MethodMetadata < ? , ? > > methodMetadataOfType ) { } } | for ( MethodMetadata methodMetadata : methodMetadataOfType ) { AnnotatedMethod annotatedMethod = methodMetadata . getAnnotatedMethod ( ) ; Annotation indexedAnnotation = annotatedMethod . getByMetaAnnotation ( IndexDefinition . class ) ; if ( indexedAnnotation != null ) { if ( ! ( methodMetadata instanceof PrimitivePropertyMethodMetadata ) ) { throw new XOException ( "Only primitive properties are allowed to be used for indexing." ) ; } return new IndexedPropertyMethodMetadata < > ( ( PropertyMethod ) annotatedMethod , ( PrimitivePropertyMethodMetadata ) methodMetadata , metadataFactory . createIndexedPropertyMetadata ( ( PropertyMethod ) annotatedMethod ) ) ; } } return null ; |
public class AmazonCloudDirectoryClient { /** * Lists all attributes that are associated with an object .
* @ param listObjectAttributesRequest
* @ return Result of the ListObjectAttributes operation returned by the service .
* @ throws InternalServiceException
* Indicates a problem that must be resolved by Amazon Web Services . This might be a transient error in
* which case you can retry your request until it succeeds . Otherwise , go to the < a
* href = " http : / / status . aws . amazon . com / " > AWS Service Health Dashboard < / a > site to see if there are any
* operational issues with the service .
* @ throws InvalidArnException
* Indicates that the provided ARN value is not valid .
* @ throws RetryableConflictException
* Occurs when a conflict with a previous successful write is detected . For example , if a write operation
* occurs on an object and then an attempt is made to read the object using “ SERIALIZABLE ” consistency , this
* exception may result . This generally occurs when the previous write did not have time to propagate to the
* host serving the current request . A retry ( with appropriate backoff logic ) is the recommended response to
* this exception .
* @ throws ValidationException
* Indicates that your request is malformed in some manner . See the exception message .
* @ throws LimitExceededException
* Indicates that limits are exceeded . See < a
* href = " https : / / docs . aws . amazon . com / clouddirectory / latest / developerguide / limits . html " > Limits < / a > for more
* information .
* @ throws AccessDeniedException
* Access denied . Check your permissions .
* @ throws DirectoryNotEnabledException
* Operations are only permitted on enabled directories .
* @ throws ResourceNotFoundException
* The specified resource could not be found .
* @ throws InvalidNextTokenException
* Indicates that the < code > NextToken < / code > value is not valid .
* @ throws FacetValidationException
* The < a > Facet < / a > that you provided was not well formed or could not be validated with the schema .
* @ sample AmazonCloudDirectory . ListObjectAttributes
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / clouddirectory - 2017-01-11 / ListObjectAttributes "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ListObjectAttributesResult listObjectAttributes ( ListObjectAttributesRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListObjectAttributes ( request ) ; |
public class ApplicationAnnotationValidator { public void validate ( ) throws ProcessorException { } } | if ( this . applicationElement instanceof TypeElement ) { TypeElement typeElement = ( TypeElement ) this . applicationElement ; // annotated element has to be a interface
if ( ! typeElement . getKind ( ) . isInterface ( ) ) { throw new ProcessorException ( "Nalu-Processor: @Application annotated must be used with an interface" ) ; } // check , that the typeElement implements IsApplication
if ( ! this . processorUtils . extendsClassOrInterface ( this . processingEnvironment . getTypeUtils ( ) , typeElement . asType ( ) , this . processingEnvironment . getElementUtils ( ) . getTypeElement ( IsApplication . class . getCanonicalName ( ) ) . asType ( ) ) ) { throw new ProcessorException ( "Nalu-Processor: " + typeElement . getSimpleName ( ) . toString ( ) + ": @Application must implement IsApplication interface" ) ; } // check if startRoute start with " / "
Application applicationAnnotation = applicationElement . getAnnotation ( Application . class ) ; if ( ! applicationAnnotation . startRoute ( ) . startsWith ( "/" ) ) { throw new ProcessorException ( "Nalu-Processor:" + "@Application - startRoute attribute muss begin with a '/'" ) ; } if ( ! applicationAnnotation . routeError ( ) . startsWith ( "/" ) ) { throw new ProcessorException ( "Nalu-Processor:" + "@Application - routeError attribute muss begin with a '/'" ) ; } } else { throw new ProcessorException ( "Nalu-Processor:" + "@Application can only be used on a type (interface)" ) ; } |
public class CommerceDiscountUtil { /** * Returns all the commerce discounts where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ return the matching commerce discounts */
public static List < CommerceDiscount > findByUuid_C ( String uuid , long companyId ) { } } | return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ; |
public class ManagedCustomerServiceError { /** * Gets the reason value for this ManagedCustomerServiceError .
* @ return reason */
public com . google . api . ads . adwords . axis . v201809 . mcm . ManagedCustomerServiceErrorReason getReason ( ) { } } | return reason ; |
public class HybridRunbookWorkerGroupsInner { /** * Update a hybrid runbook worker group .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param hybridRunbookWorkerGroupName The hybrid runbook worker group name
* @ param credential Sets the credential of a worker group .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < HybridRunbookWorkerGroupInner > updateAsync ( String resourceGroupName , String automationAccountName , String hybridRunbookWorkerGroupName , RunAsCredentialAssociationProperty credential , final ServiceCallback < HybridRunbookWorkerGroupInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , automationAccountName , hybridRunbookWorkerGroupName , credential ) , serviceCallback ) ; |
public class Scope { /** * Copies all symbols from source scope to dest scope . */
public static void joinScopes ( Scope source , Scope dest ) { } } | Map < String , Symbol > src = source . ensureSymbolTable ( ) ; Map < String , Symbol > dst = dest . ensureSymbolTable ( ) ; if ( ! Collections . disjoint ( src . keySet ( ) , dst . keySet ( ) ) ) { codeBug ( ) ; } for ( Map . Entry < String , Symbol > entry : src . entrySet ( ) ) { Symbol sym = entry . getValue ( ) ; sym . setContainingTable ( dest ) ; dst . put ( entry . getKey ( ) , sym ) ; } |
public class OrderedPhoneNumberMarshaller { /** * Marshall the given parameter object . */
public void marshall ( OrderedPhoneNumber orderedPhoneNumber , ProtocolMarshaller protocolMarshaller ) { } } | if ( orderedPhoneNumber == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( orderedPhoneNumber . getE164PhoneNumber ( ) , E164PHONENUMBER_BINDING ) ; protocolMarshaller . marshall ( orderedPhoneNumber . getStatus ( ) , STATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class StreamMetrics { /** * This method increments the Stream - specific counter of retention operations .
* @ param scope Scope .
* @ param streamName Name of the Stream . */
public static void reportRetentionEvent ( String scope , String streamName ) { } } | DYNAMIC_LOGGER . recordMeterEvents ( RETENTION_FREQUENCY , 1 , streamTags ( scope , streamName ) ) ; |
public class StringUtils { /** * Creates a new < tt > ArrayList < / tt > collection from the specified array of < tt > String < / tt > s .
* @ param array the array
* @ return newly created . */
public static ArrayList < String > toList ( String [ ] array ) { } } | if ( array == null ) { return new ArrayList < String > ( 0 ) ; } ArrayList < String > list = new ArrayList < String > ( array . length ) ; for ( String s : array ) { list . add ( s ) ; } return list ; |
public class WindowBuilder { /** * Build window based on type .
* @ return Window */
public Window buildWindow ( ) { } } | final Window window = new Window ( caption ) ; window . setContent ( content ) ; window . setSizeUndefined ( ) ; window . setModal ( true ) ; window . setResizable ( false ) ; decorateWindow ( window ) ; if ( SPUIDefinitions . CREATE_UPDATE_WINDOW . equals ( type ) ) { window . setClosable ( false ) ; } return window ; |
public class JQLChecker { /** * Analyze .
* @ param < L >
* the generic type
* @ param jqlContext
* the jql context
* @ param jql
* the jql
* @ param listener
* the listener */
public < L extends JqlBaseListener > void analyze ( final JQLContext jqlContext , final JQL jql , L listener ) { } } | analyzeInternal ( jqlContext , jql . value , listener ) ; |
public class Eval { /** * Eval locale from language string
* @ param language
* @ return new Locale constructed from the language */
public static Locale locale ( String language ) { } } | if ( language . contains ( "_" ) ) { String [ ] sa = language . split ( "_" ) ; if ( sa . length > 2 ) { return new Locale ( sa [ 0 ] , sa [ 1 ] , sa [ 2 ] ) ; } else if ( sa . length > 1 ) { return new Locale ( sa [ 0 ] , sa [ 1 ] ) ; } else { return new Locale ( sa [ 0 ] ) ; } } return new Locale ( language ) ; |
public class ComponentExposedTypeGenerator { /** * Process watchers from the Component Class .
* @ param createdMethodBuilder Builder for the created hook method */
private void processWatchers ( MethodSpec . Builder createdMethodBuilder ) { } } | createdMethodBuilder . addStatement ( "Proto p = __proto__" ) ; getMethodsWithAnnotation ( component , Watch . class ) . forEach ( method -> processWatcher ( createdMethodBuilder , method ) ) ; |
public class PartitionUtils { /** * This method returns the partition spec string of the partition .
* Example : datepartition = ' 2016-01-01-00 ' , size = ' 12345' */
public static String getPartitionSpecString ( Map < String , String > spec ) { } } | StringBuilder sb = new StringBuilder ( ) ; for ( Map . Entry < String , String > entry : spec . entrySet ( ) ) { if ( ! sb . toString ( ) . isEmpty ( ) ) { sb . append ( "," ) ; } sb . append ( entry . getKey ( ) ) ; sb . append ( "=" ) ; sb . append ( getQuotedString ( entry . getValue ( ) ) ) ; } return sb . toString ( ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcRectangleHollowProfileDef ( ) { } } | if ( ifcRectangleHollowProfileDefEClass == null ) { ifcRectangleHollowProfileDefEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 502 ) ; } return ifcRectangleHollowProfileDefEClass ; |
public class InvocationStatFactory { /** * 得到调用统计器
* @ param consumerConfig 接口信息
* @ param providerInfo 请求信息
* @ return 调用统计器 , 如果不符合统计条件则返回空 */
public static InvocationStat getInvocationStat ( ConsumerConfig consumerConfig , ProviderInfo providerInfo ) { } } | String appName = consumerConfig . getAppName ( ) ; if ( appName == null ) { return null ; } // 应用开启单机故障摘除功能
if ( FaultToleranceConfigManager . isRegulationEffective ( appName ) ) { return getInvocationStat ( new InvocationStatDimension ( providerInfo , consumerConfig ) ) ; } return null ; |
public class XsonASMSerializerFactory { private static void processfieldModel ( FieldModel fieldModel , MethodVisitor mv , int lvIndex ) { } } | if ( fieldModel . isBaseType ( ) ) { mv . visitVarInsn ( ALOAD , BYTEMODEL_INDEX ) ; mv . visitVarInsn ( ALOAD , lvIndex ) ; mv . visitMethodInsn ( INVOKEVIRTUAL , fieldModel . getOwnerDesc ( ) , fieldModel . getGetterName ( ) , fieldModel . getGetterDesc ( ) ) ; // mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL _ DESC , " append " , " ( [ B ) V " ) ;
Class < ? > fieldClass = fieldModel . getFieldClass ( ) ; if ( byte . class == fieldClass ) { mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL_DESC , "writeByte" , "(B)V" ) ; } else if ( short . class == fieldClass ) { mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL_DESC , "writeShort" , "(S)V" ) ; } else if ( int . class == fieldClass ) { mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL_DESC , "writeInt" , "(I)V" ) ; } else if ( long . class == fieldClass ) { mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL_DESC , "writeLong" , "(J)V" ) ; } else if ( float . class == fieldClass ) { mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL_DESC , "writeFloat" , "(F)V" ) ; } else if ( double . class == fieldClass ) { mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL_DESC , "writeDouble" , "(D)V" ) ; } else if ( boolean . class == fieldClass ) { mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL_DESC , "writeBoolean" , "(Z)V" ) ; } else if ( char . class == fieldClass ) { mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL_DESC , "writeChar" , "(C)V" ) ; } } else { mv . visitVarInsn ( ALOAD , BYTEMODEL_INDEX ) ; mv . visitVarInsn ( ALOAD , lvIndex ) ; mv . visitMethodInsn ( INVOKEVIRTUAL , fieldModel . getOwnerDesc ( ) , fieldModel . getGetterName ( ) , fieldModel . getGetterDesc ( ) ) ; mv . visitMethodInsn ( INVOKEVIRTUAL , BYTEMODEL_DESC , "writeObject" , "(Ljava/lang/Object;)V" ) ; } |
public class InternalXbaseLexer { /** * $ ANTLR start " T _ _ 17" */
public final void mT__17 ( ) throws RecognitionException { } } | try { int _type = T__17 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalXbase . g : 15:7 : ( ' - = ' )
// InternalXbase . g : 15:9 : ' - = '
{ match ( "-=" ) ; } state . type = _type ; state . channel = _channel ; } finally { } |
public class HtmlBuilder { /** * Write Simon property ( using Java Bean convention ) .
* @ param simon Simon
* @ param propertyName Property name */
public T simonProperty ( Simon simon , String propertyName ) throws IOException { } } | Getter getter = GetterFactory . getGetter ( simon . getClass ( ) , propertyName ) ; if ( getter != null ) { value ( getter . get ( simon ) , getter . getSubType ( ) ) ; } return ( T ) this ; |
public class DynamicRespondrSkinViewController { /** * Display Skin CSS include based on skin ' s configuration values from portlet preferences . < br >
* dynamic = false : load the pre - built css file from the skins directory and default skin name ;
* e . g . RELATIVE _ ROOT / { defaultSkin } . css dynamic = true : Process the default skin less file if
* needed at RELATIVE _ ROOT / { defaultSkin } . less to create a customized skin css file
* ( RELATIVE _ ROOT / skin - ID # . css to load . */
@ RenderMapping public ModelAndView displaySkinCssHeader ( RenderRequest request , RenderResponse response , Model model ) throws IOException { } } | // NOTE : RENDER _ HEADERS phase may be called before or at the same time as the
// RENDER _ MARKUP . The spec is
// silent on this issue and uPortal does not guarantee order or timing of render execution ,
// but does
// guarantee order of render output processing ( output of RENDER _ HEADERS phase is included
// before
// RENDER _ MARKUP phase ) . uPortal inserts the HTML markup returned from RENDER _ HEADERS
// execution into the HEAD
// section of the page .
if ( PortletRequest . RENDER_HEADERS . equals ( request . getAttribute ( PortletRequest . RENDER_PART ) ) ) { PortletPreferences prefs = request . getPreferences ( ) ; Boolean enabled = Boolean . valueOf ( prefs . getValue ( DynamicRespondrSkinConstants . PREF_DYNAMIC , "false" ) ) ; String skinName = prefs . getValue ( DynamicRespondrSkinConstants . PREF_SKIN_NAME , DynamicRespondrSkinConstants . DEFAULT_SKIN_NAME ) ; String cssUrl = enabled ? calculateDynamicSkinUrlPathToUse ( request , skinName ) : calculateDefaultSkinCssLocationInWebapp ( skinName ) ; model . addAttribute ( DynamicRespondrSkinConstants . SKIN_CSS_URL_MODEL_ATTRIBUTE_NAME , cssUrl ) ; return new ModelAndView ( "jsp/DynamicRespondrSkin/skinHeader" ) ; } else { // We need to know if this user can CONFIG this skin
boolean canAccessSkinConfig = false ; // Default
final HttpServletRequest httpr = portalRequestUtils . getCurrentPortalRequest ( ) ; final IPerson user = personManager . getPerson ( httpr ) ; final IAuthorizationPrincipal principal = AuthorizationPrincipalHelper . principalFromUser ( user ) ; final IPortletWindowId portletWindowId = portletWindowRegistry . getPortletWindowId ( httpr , request . getWindowID ( ) ) ; final IPortletWindow portletWindow = portletWindowRegistry . getPortletWindow ( httpr , portletWindowId ) ; final IPortletEntity portletEntity = portletWindow . getPortletEntity ( ) ; if ( principal . canConfigure ( portletEntity . getPortletDefinitionId ( ) . toString ( ) ) ) { canAccessSkinConfig = true ; } // RENDER _ MARKUP
return new ModelAndView ( "jsp/DynamicRespondrSkin/skinBody" , DynamicRespondrSkinConstants . CAN_ACCESS_SKIN_CONFIG_MODEL_NAME , canAccessSkinConfig ) ; } |
public class ClientAsyncResult { /** * This method allows clients to poll the Future object and only get results
* once the asynchronous method has finished ( ie . either with good results or an
* exception ) . */
public boolean isDone ( ) { } } | final boolean isTraceOn = svLogger . isLoggable ( Level . FINER ) ; if ( isTraceOn ) svLogger . entering ( CLASS_NAME , "isDone" , toString ( ) ) ; try { if ( ! ivDone ) { ivDone = ( ivServer != null ? ivServer . isDone ( ) : true ) ; } } catch ( RemoteException e ) { // Throw an EJBException to the client .
throw initCause ( new EJBException ( e ) ) ; } if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "isDone" , Boolean . valueOf ( ivDone ) ) ; return ivDone ; |
public class BytePictureUtils { /** * 流转换成byte数组
* @ param is
* @ return */
public static byte [ ] toByteArray ( InputStream is ) { } } | if ( null == is ) return null ; try { return IOUtils . toByteArray ( is ) ; } catch ( IOException e ) { logger . error ( "toByteArray error" , e ) ; } finally { try { is . close ( ) ; } catch ( IOException e ) { logger . error ( "close stream error" , e ) ; } } return null ; |
public class EnaValidator { /** * Validate file .
* @ param file
* the file
* @ param writer
* the writer
* @ return the list of ValidationPlanResult
* @ throws IOException
* @ throws ValidationEngineException */
private List < ValidationPlanResult > validateFile ( File file , Writer writer ) throws IOException { } } | List < ValidationPlanResult > messages = new ArrayList < ValidationPlanResult > ( ) ; ArrayList < Object > entryList = new ArrayList < Object > ( ) ; BufferedReader fileReader = null ; try { fileReader = new BufferedReader ( new FileReader ( file ) ) ; prepareReader ( fileReader , file . getName ( ) ) ; List < ValidationPlanResult > results = validateEntriesInReader ( writer , file , entryList ) ; ValidationPlanResult entrySetResult = validateEntry ( entryList ) ; if ( file != null ) { entrySetResult . setTargetOrigin ( file . getName ( ) ) ; } for ( ValidationPlanResult planResult : results ) { messages . add ( planResult ) ; } if ( ! entrySetResult . isValid ( ) ) { writeResultsToFile ( entrySetResult ) ; messages . add ( entrySetResult ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { if ( fileReader != null ) fileReader . close ( ) ; } return messages ; |
public class ShortList { /** * Returns whether any elements of this List match the provided predicate .
* @ param filter
* @ return */
public < E extends Exception > boolean anyMatch ( Try . ShortPredicate < E > filter ) throws E { } } | return anyMatch ( 0 , size ( ) , filter ) ; |
public class Types { /** * Determines whether the given array only contains unbounded type variables or Object . class .
* @ param types the given array of types
* @ return true if and only if the given array only contains unbounded type variables or Object . class */
public static boolean isArrayOfUnboundedTypeVariablesOrObjects ( Type [ ] types ) { } } | for ( Type type : types ) { if ( Object . class . equals ( type ) ) { continue ; } if ( type instanceof TypeVariable < ? > ) { Type [ ] bounds = ( ( TypeVariable < ? > ) type ) . getBounds ( ) ; if ( bounds == null || bounds . length == 0 || ( bounds . length == 1 && Object . class . equals ( bounds [ 0 ] ) ) ) { continue ; } } return false ; } return true ; |
public class ElementList { /** * Rename all nodes with a certain name and a certain attribute name - value pair
* @ param oldName
* @ param newName
* @ param attributeName
* @ param attributeValue */
public void renameNodesWithAttributeValue ( String oldName , String newName , String attributeName , String attributeValue ) { } } | List < Node > nodes = getNodesFromTreeByName ( oldName ) ; Iterator i = nodes . iterator ( ) ; while ( i . hasNext ( ) ) { Node n = ( Node ) i . next ( ) ; n . setName ( newName ) ; } |
public class ConstantsSummaryBuilder { /** * Build the list of packages .
* @ param node the XML element that specifies which components to document
* @ param contentTree the content tree to which the content list will be added */
public void buildContents ( XMLNode node , Content contentTree ) { } } | Content contentListTree = writer . getContentsHeader ( ) ; printedPackageHeaders = new HashSet < > ( ) ; for ( PackageDoc pkg : configuration . packages ) { if ( hasConstantField ( pkg ) && ! hasPrintedPackageIndex ( pkg . name ( ) ) ) { writer . addLinkToPackageContent ( pkg , parsePackageName ( pkg . name ( ) ) , printedPackageHeaders , contentListTree ) ; } } writer . addContentsList ( contentTree , contentListTree ) ; |
public class TaskAction { /** * Checked if the passed in RoleId is mapped to this TaskAction
* @ param pRoleId
* @ return boolean results */
public boolean isRoleMapped ( Long pRoleId ) { } } | if ( userRoles == null || userRoles . length == 0 ) { return false ; } for ( int i = 0 ; i < userRoles . length ; i ++ ) { if ( userRoles [ i ] . getId ( ) . longValue ( ) == pRoleId . longValue ( ) ) { return true ; } } return false ; |
public class HBaseClientTemplate { /** * Execute the put on HBase , invoking the putModifier before executing the put
* if putModifier is not null .
* Any PutModifers registered with registerPutModifier will be invoked after
* the putModifier passed to this method is invoked , and before the Put is
* executed .
* @ param putAction
* The PutAction to execute on HBase .
* @ param putActionModifier
* Invoked before the Put to give callers a chance to modify the Put
* before it is executed .
* @ return True if the put succeeded , False if the put failed due to update
* conflict */
public boolean put ( PutAction putAction , PutActionModifier putActionModifier ) { } } | if ( putActionModifier != null ) { putAction = putActionModifier . modifyPutAction ( putAction ) ; } return put ( putAction ) ; |
public class SemanticReverseAbstractInterpreter { /** * Given ' property in object ' , ensures that the object has the property in the informed scope by
* defining it as a qualified name if the object type lacks the property and it ' s not in the blind
* scope .
* @ param object The node of the right - side of the in .
* @ param propertyName The string of the left - side of the in . */
@ CheckReturnValue private FlowScope caseIn ( Node object , String propertyName , FlowScope blindScope ) { } } | JSType jsType = object . getJSType ( ) ; jsType = this . getRestrictedWithoutNull ( jsType ) ; jsType = this . getRestrictedWithoutUndefined ( jsType ) ; boolean hasProperty = false ; ObjectType objectType = ObjectType . cast ( jsType ) ; if ( objectType != null ) { hasProperty = objectType . hasProperty ( propertyName ) ; } if ( ! hasProperty ) { String qualifiedName = object . getQualifiedName ( ) ; if ( qualifiedName != null ) { String propertyQualifiedName = qualifiedName + "." + propertyName ; if ( blindScope . getSlot ( propertyQualifiedName ) == null ) { JSType unknownType = typeRegistry . getNativeType ( JSTypeNative . UNKNOWN_TYPE ) ; return blindScope . inferQualifiedSlot ( object , propertyQualifiedName , unknownType , unknownType , false ) ; } } } return blindScope ; |
public class TenantDefinition { /** * Parse an option UNode , which may be a value or a map . */
private Object parseOption ( UNode optionNode ) { } } | if ( optionNode . isValue ( ) ) { return optionNode . getValue ( ) ; } Map < String , Object > optValueMap = new HashMap < > ( ) ; for ( UNode suboptNode : optionNode . getMemberList ( ) ) { optValueMap . put ( suboptNode . getName ( ) , parseOption ( suboptNode ) ) ; } return optValueMap ; |
public class ManifestAccess { /** * Merge the contents of the given manifest into this one . */
public boolean merge ( final ManifestAccess other ) { } } | boolean _xblockexpression = false ; { String _path = this . getPath ( ) ; String _path_1 = other . getPath ( ) ; boolean _notEquals = ( ! Objects . equal ( _path , _path_1 ) ) ; if ( _notEquals ) { String _path_2 = this . getPath ( ) ; String _plus = ( "Merging manifest files with different paths: " + _path_2 ) ; String _plus_1 = ( _plus + ", " ) ; String _path_3 = other . getPath ( ) ; String _plus_2 = ( _plus_1 + _path_3 ) ; ManifestAccess . LOG . warn ( _plus_2 ) ; } boolean _notEquals_1 = ( ! Objects . equal ( this . bundleName , other . bundleName ) ) ; if ( _notEquals_1 ) { if ( ( this . bundleName == null ) ) { this . bundleName = other . bundleName ; } else { if ( ( other . bundleName != null ) ) { ManifestAccess . LOG . warn ( ( ( ( "Merging manifest files with different bundle names: " + this . bundleName ) + ", " ) + other . bundleName ) ) ; } } } boolean _notEquals_2 = ( ! Objects . equal ( this . symbolicName , other . symbolicName ) ) ; if ( _notEquals_2 ) { if ( ( this . symbolicName == null ) ) { this . symbolicName = other . symbolicName ; } else { if ( ( other . symbolicName != null ) ) { ManifestAccess . LOG . warn ( ( ( ( "Merging manifest files with different symbolic names: " + this . symbolicName ) + ", " ) + other . symbolicName ) ) ; } } } boolean _notEquals_3 = ( ! Objects . equal ( this . activator , other . activator ) ) ; if ( _notEquals_3 ) { if ( ( this . activator == null ) ) { this . activator = other . activator ; } else { if ( ( other . activator != null ) ) { ManifestAccess . LOG . warn ( ( ( ( "Merging manifest files with different activators: " + this . activator ) + ", " ) + other . activator ) ) ; } } } boolean _notEquals_4 = ( ! Objects . equal ( this . version , other . version ) ) ; if ( _notEquals_4 ) { ManifestAccess . LOG . warn ( ( ( ( "Merging manifest files with different versions: " + this . version ) + ", " ) + other . version ) ) ; } if ( ( this . merge != other . merge ) ) { ManifestAccess . LOG . warn ( "Merging manifest files with different merging settings." ) ; } this . exportedPackages . addAll ( other . exportedPackages ) ; this . requiredBundles . addAll ( other . requiredBundles ) ; if ( ( this . symbolicName != null ) ) { this . requiredBundles . remove ( this . getEffectiveSymbolicName ( ) ) ; } _xblockexpression = this . importedPackages . addAll ( other . importedPackages ) ; } return _xblockexpression ; |
public class CaptionSelectorMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CaptionSelector captionSelector , ProtocolMarshaller protocolMarshaller ) { } } | if ( captionSelector == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( captionSelector . getLanguageCode ( ) , LANGUAGECODE_BINDING ) ; protocolMarshaller . marshall ( captionSelector . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( captionSelector . getSelectorSettings ( ) , SELECTORSETTINGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SimpleBase { /** * Reshapes the matrix to the specified number of rows and columns . If the total number of elements
* is & le ; number of elements it had before the data is saved . Otherwise a new internal array is
* declared and the old data lost .
* This is equivalent to calling A . getMatrix ( ) . reshape ( numRows , numCols , false ) .
* @ see DMatrixRMaj # reshape ( int , int , boolean )
* @ param numRows The new number of rows in the matrix .
* @ param numCols The new number of columns in the matrix . */
public void reshape ( int numRows , int numCols ) { } } | if ( mat . getType ( ) . isFixed ( ) ) { throw new IllegalArgumentException ( "Can't reshape a fixed sized matrix" ) ; } else { ( ( ReshapeMatrix ) mat ) . reshape ( numRows , numCols ) ; } |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcNumericMeasure ( ) { } } | if ( ifcNumericMeasureEClass == null ) { ifcNumericMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 847 ) ; } return ifcNumericMeasureEClass ; |
public class CmafPackageCreateOrUpdateParameters { /** * A list of HLS manifest configurations
* @ param hlsManifests
* A list of HLS manifest configurations */
public void setHlsManifests ( java . util . Collection < HlsManifestCreateOrUpdateParameters > hlsManifests ) { } } | if ( hlsManifests == null ) { this . hlsManifests = null ; return ; } this . hlsManifests = new java . util . ArrayList < HlsManifestCreateOrUpdateParameters > ( hlsManifests ) ; |
public class AbstractDatabaseEngine { /** * Sets the schema for the current { @ link # conn connection } .
* @ throws DatabaseEngineException If schema doesn ' t exist , a database access error occurs or this method
* is called on a closed connection .
* @ since 2.1.13 */
protected void setSchema ( final String schema ) throws DatabaseEngineException { } } | try { this . conn . setSchema ( schema ) ; } catch ( final Exception e ) { throw new DatabaseEngineException ( String . format ( "Could not set current schema to '%s'" , schema ) , e ) ; } |
public class PortletContextLoader { /** * Initialize Spring ' s portlet application context for the given portlet context ,
* using the application context provided at construction time , or creating a new one
* according to the " { @ link # CONTEXT _ CLASS _ PARAM contextClass } " and
* " { @ link # CONFIG _ LOCATION _ PARAM contextConfigLocation } " context - params .
* @ param portletContext current portlet context
* @ return the new PortletApplicationContext
* @ see # CONTEXT _ CLASS _ PARAM
* @ see # CONFIG _ LOCATION _ PARAM
* @ see # CONTEXT _ CLASS _ PARAM
* @ see # CONFIG _ LOCATION _ PARAM */
public PortletApplicationContext initWebApplicationContext ( PortletContext portletContext ) { } } | if ( portletContext . getAttribute ( PortletApplicationContext . ROOT_PORTLET_APPLICATION_CONTEXT_ATTRIBUTE ) != null ) { throw new IllegalStateException ( "Cannot initialize context because there is already a root portlet application context present - " + "check whether you have multiple PortletContextLoader* definitions in your portlet.xml!" ) ; } Log logger = LogFactory . getLog ( PortletContextLoader . class ) ; portletContext . log ( "Initializing Spring root PortletApplicationContext" ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( "Root portlet PortletApplicationContext: initialization started" ) ; } long startTime = System . nanoTime ( ) ; try { // Store context in local instance variable , to guarantee that
// it is available on PortletContext shutdown .
if ( this . context == null ) { this . context = createPortletApplicationContext ( portletContext ) ; } if ( this . context instanceof ConfigurablePortletApplicationContext ) { configureAndRefreshPortletApplicationContext ( ( ConfigurablePortletApplicationContext ) this . context , portletContext ) ; } portletContext . setAttribute ( PortletApplicationContext . ROOT_PORTLET_APPLICATION_CONTEXT_ATTRIBUTE , this . context ) ; ClassLoader ccl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( ccl == PortletContextLoader . class . getClassLoader ( ) ) { currentContext = this . context ; } else if ( ccl != null ) { currentContextPerThread . put ( ccl , this . context ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Published root PortletApplicationContext as PortletContext attribute with name [" + PortletApplicationContext . ROOT_PORTLET_APPLICATION_CONTEXT_ATTRIBUTE + "]" ) ; } if ( logger . isInfoEnabled ( ) ) { long elapsedTime = TimeUnit . NANOSECONDS . toMillis ( System . nanoTime ( ) - startTime ) ; logger . info ( "Root PortletApplicationContext: initialization completed in " + elapsedTime + " ms" ) ; } return this . context ; } catch ( RuntimeException ex ) { logger . error ( "Portlet context initialization failed" , ex ) ; portletContext . setAttribute ( PortletApplicationContext . ROOT_PORTLET_APPLICATION_CONTEXT_ATTRIBUTE , ex ) ; throw ex ; } catch ( Error err ) { logger . error ( "Portlet context initialization failed" , err ) ; portletContext . setAttribute ( PortletApplicationContext . ROOT_PORTLET_APPLICATION_CONTEXT_ATTRIBUTE , err ) ; throw err ; } |
public class CompoundReentrantTypeResolver { /** * / * @ Nullable */
@ Override public LightweightTypeReference getActualType ( XExpression expression ) { } } | IResolvedTypes delegate = getDelegate ( expression ) ; return delegate . getActualType ( expression ) ; |
public class NonLockingContainer { /** * This method MUST NOT THROW */
@ Override protected void outputPass ( ) { } } | if ( ! prototype . isOutputSupported ( ) ) return ; // take a snapshot of the current container state .
final LinkedList < Object > toOutput = new LinkedList < Object > ( instances . keySet ( ) ) ; Executor executorService = null ; Semaphore taskLock = null ; executorService = super . getOutputExecutorService ( ) ; if ( executorService != null ) taskLock = new Semaphore ( outputConcurrency ) ; // This keeps track of the number of concurrently running
// output tasks so that this method can wait until they ' re
// all done to return .
// It ' s also used as a condition variable signaling on its
// own state changes .
final AtomicLong numExecutingOutputs = new AtomicLong ( 0 ) ; // keep going until all of the outputs have been invoked
while ( toOutput . size ( ) > 0 && isRunning . get ( ) ) { for ( final Iterator < Object > iter = toOutput . iterator ( ) ; iter . hasNext ( ) ; ) { final Object key = iter . next ( ) ; final WorkingPlaceholder wp = new WorkingPlaceholder ( ) ; // we ' re going to hold up all incomming message to this mp
wp . mailbox . getAndSet ( null ) ; // this blocks other threads from
// dropping messages in the mailbox
final WorkingPlaceholder alreadyThere = working . putIfAbsent ( key , wp ) ; // try to get a lock
if ( alreadyThere == null ) { // we got it the lock
final Object instance = instances . get ( key ) ; if ( instance != null ) { final Semaphore taskSepaphore = taskLock ; // This task will release the wrapper ' s lock .
final Runnable task = new Runnable ( ) { @ Override public void run ( ) { final List < KeyedMessageWithType > response ; try { if ( isRunning . get ( ) ) response = invokeOperation ( instance , Operation . output , null ) ; else response = null ; } finally { working . remove ( key ) ; // releases this back to the world
// this signals that we ' re done .
synchronized ( numExecutingOutputs ) { numExecutingOutputs . decrementAndGet ( ) ; numExecutingOutputs . notifyAll ( ) ; } if ( taskSepaphore != null ) taskSepaphore . release ( ) ; } if ( response != null ) { try { dispatcher . dispatch ( response ) ; } catch ( final Exception de ) { if ( isRunning . get ( ) ) LOGGER . warn ( "Failed on subsequent dispatch of " + response + ": " + de . getLocalizedMessage ( ) ) ; } } } } ; synchronized ( numExecutingOutputs ) { numExecutingOutputs . incrementAndGet ( ) ; } if ( executorService != null ) { try { taskSepaphore . acquire ( ) ; executorService . execute ( task ) ; } catch ( final RejectedExecutionException e ) { working . remove ( key ) ; // we never got into the run so we need to release the lock
// this may happen because of a race condition between the
taskSepaphore . release ( ) ; } catch ( final InterruptedException e ) { // this can happen while blocked in the semaphore . acquire .
// if we ' re no longer running we should just get out
// of here .
// Not releasing the taskSepaphore assumes the acquire never executed .
// if ( since ) the acquire never executed we also need to release the
// wrapper lock or that Mp will never be usable again .
working . remove ( key ) ; // we never got into the run so we need to release the lock
} } else task . run ( ) ; iter . remove ( ) ; } else { working . remove ( key ) ; LOGGER . warn ( "There was an attempt to evict a non-existent Mp for key " + SafeString . objectDescription ( key ) ) ; } } // didn ' t get the lock
} // loop over every mp
} // end while there are still Mps that haven ' t had output invoked .
// now make sure all of the running tasks have completed
synchronized ( numExecutingOutputs ) { while ( numExecutingOutputs . get ( ) > 0 ) { try { numExecutingOutputs . wait ( ) ; } catch ( final InterruptedException e ) { // if we were interupted for a shutdown then just stop
// waiting for all of the threads to finish
if ( ! isRunning . get ( ) ) break ; // otherwise continue checking .
} } } |
public class OIDMap { /** * Return Object identifier for user friendly name .
* @ param name the user friendly name .
* @ return the Object Identifier or null if no oid
* is registered for this name . */
public static ObjectIdentifier getOID ( String name ) { } } | OIDInfo info = nameMap . get ( name ) ; return ( info == null ) ? null : info . oid ; |
public class SARLReentrantTypeResolver { /** * Create the extension provider dedicated to the access to the used capacity functions .
* @ param thisFeature the current object .
* @ param field the extension field .
* @ return the SARL capacity extension provider , or { @ code null } . */
protected XAbstractFeatureCall createSarlCapacityExtensionProvider ( JvmIdentifiableElement thisFeature , JvmField field ) { } } | // For capacity call redirection
if ( thisFeature instanceof JvmDeclaredType ) { final JvmAnnotationReference capacityAnnotation = this . annotationLookup . findAnnotation ( field , ImportedCapacityFeature . class ) ; if ( capacityAnnotation != null ) { final String methodName = Utils . createNameForHiddenCapacityImplementationCallingMethodFromFieldName ( field . getSimpleName ( ) ) ; final JvmOperation callerOperation = findOperation ( ( JvmDeclaredType ) thisFeature , methodName ) ; if ( callerOperation != null ) { final XbaseFactory baseFactory = getXbaseFactory ( ) ; final XMemberFeatureCall extensionProvider = baseFactory . createXMemberFeatureCall ( ) ; extensionProvider . setFeature ( callerOperation ) ; final XFeatureCall thisAccess = baseFactory . createXFeatureCall ( ) ; thisAccess . setFeature ( thisFeature ) ; extensionProvider . setMemberCallTarget ( thisAccess ) ; return extensionProvider ; } } } return null ; |
public class BaseKeyPairGenerator { /** * @ see KeyPairGenerator # generateKeyPair ( String , String , OutputStream , OutputStream )
* @ param userId
* the user id for the PGP key pair
* @ param password
* the password used to secure the secret ( private ) key
* @ param publicKey
* the target stream for the public key
* @ param secrectKey
* the target stream for the secret ( private ) key
* @ return */
public boolean generateKeyPair ( String userId , String password , OutputStream publicKey , OutputStream secrectKey ) { } } | LOGGER . trace ( "generateKeyPair(String, String, OutputStream, OutputStream)" ) ; LOGGER . trace ( "User ID: {}, Password: ********, Public Key: {}, Secret Key: {}" , userId , publicKey == null ? "not set" : "set" , secrectKey == null ? "not set" : "set" ) ; return generateKeyPair ( userId , password , DEFAULT_KEY_SIZE , publicKey , secrectKey ) ; |
public class MesosFramework { /** * Launch tasks
* @ param tasks list of LaunchableTask */
protected void launchTasks ( List < LaunchableTask > tasks ) { } } | // Group the tasks by offer
Map < Protos . Offer , List < LaunchableTask > > tasksGroupByOffer = new HashMap < > ( ) ; for ( LaunchableTask task : tasks ) { List < LaunchableTask > subTasks = tasksGroupByOffer . get ( task . offer ) ; if ( subTasks == null ) { subTasks = new LinkedList < > ( ) ; } subTasks . add ( task ) ; tasksGroupByOffer . put ( task . offer , subTasks ) ; } // Construct the Mesos TaskInfo to launch
for ( Map . Entry < Protos . Offer , List < LaunchableTask > > kv : tasksGroupByOffer . entrySet ( ) ) { // We would launch taks for the same offer at one shot
Protos . Offer offer = kv . getKey ( ) ; List < LaunchableTask > subTasks = kv . getValue ( ) ; List < Protos . TaskInfo > mesosTasks = new LinkedList < > ( ) ; for ( LaunchableTask task : subTasks ) { Protos . TaskInfo pTask = task . constructMesosTaskInfo ( heronConfig , heronRuntime ) ; mesosTasks . add ( pTask ) ; } LOG . info ( "Launching tasks from offer: " + offer + " with tasks: " + mesosTasks ) ; // Launch the tasks for the same offer
Protos . Status status = driver . launchTasks ( Arrays . asList ( new Protos . OfferID [ ] { offer . getId ( ) } ) , mesosTasks ) ; if ( status == Protos . Status . DRIVER_RUNNING ) { LOG . info ( String . format ( "Tasks launched, status: '%s'" , status ) ) ; } else { LOG . severe ( "Other status returned: " + status ) ; // Handled failed tasks
for ( LaunchableTask task : tasks ) { handleMesosFailure ( task . taskId ) ; // No need to decline the offers ; mesos master already reclaim them
} } } |
public class Label { /** * Puts a reference to this label in the bytecode of a method . If the
* position of the label is known , the offset is computed and written
* directly . Otherwise , a null offset is written and a new forward reference
* is declared for this label .
* @ param owner the code writer that calls this method .
* @ param out the bytecode of the method .
* @ param source the position of first byte of the bytecode instruction that
* contains this label .
* @ param wideOffset < tt > true < / tt > if the reference must be stored in 4
* bytes , or < tt > false < / tt > if it must be stored with 2 bytes .
* @ throws IllegalArgumentException if this label has not been created by
* the given code writer . */
void put ( final MethodWriter owner , final ByteVector out , final int source , final boolean wideOffset ) { } } | if ( ( status & RESOLVED ) == 0 ) { if ( wideOffset ) { addReference ( - 1 - source , out . length ) ; out . putInt ( - 1 ) ; } else { addReference ( source , out . length ) ; out . putShort ( - 1 ) ; } } else { if ( wideOffset ) { out . putInt ( position - source ) ; } else { out . putShort ( position - source ) ; } } |
public class BaseLexicon { /** * Ensure longest lemma .
* @ param lemma the lemma */
protected void ensureLongestLemma ( String lemma ) { } } | this . longestLemma = Math . max ( this . longestLemma , lemma . split ( "\\s+" ) . length ) ; |
public class EurekaBootStrap { /** * Initializes Eureka , including syncing up with other Eureka peers and publishing the registry .
* @ see
* javax . servlet . ServletContextListener # contextInitialized ( javax . servlet . ServletContextEvent ) */
@ Override public void contextInitialized ( ServletContextEvent event ) { } } | try { initEurekaEnvironment ( ) ; initEurekaServerContext ( ) ; ServletContext sc = event . getServletContext ( ) ; sc . setAttribute ( EurekaServerContext . class . getName ( ) , serverContext ) ; } catch ( Throwable e ) { logger . error ( "Cannot bootstrap eureka server :" , e ) ; throw new RuntimeException ( "Cannot bootstrap eureka server :" , e ) ; } |
public class Matrix3d { /** * Apply a model transformation to this matrix for a right - handed coordinate system ,
* that aligns the local < code > + Z < / code > axis with < code > direction < / code > .
* If < code > M < / code > is < code > this < / code > matrix and < code > L < / code > the lookat matrix ,
* then the new matrix will be < code > M * L < / code > . So when transforming a
* vector < code > v < / code > with the new matrix by using < code > M * L * v < / code > ,
* the lookat transformation will be applied first !
* In order to set the matrix to a rotation transformation without post - multiplying it ,
* use { @ link # rotationTowards ( double , double , double , double , double , double ) rotationTowards ( ) } .
* This method is equivalent to calling : < code > mul ( new Matrix3d ( ) . lookAlong ( - dirX , - dirY , - dirZ , upX , upY , upZ ) . invert ( ) ) < / code >
* @ see # rotateTowards ( Vector3dc , Vector3dc )
* @ see # rotationTowards ( double , double , double , double , double , double )
* @ param dirX
* the x - coordinate of the direction to rotate towards
* @ param dirY
* the y - coordinate of the direction to rotate towards
* @ param dirZ
* the z - coordinate of the direction to rotate towards
* @ param upX
* the x - coordinate of the up vector
* @ param upY
* the y - coordinate of the up vector
* @ param upZ
* the z - coordinate of the up vector
* @ return this */
public Matrix3d rotateTowards ( double dirX , double dirY , double dirZ , double upX , double upY , double upZ ) { } } | return rotateTowards ( dirX , dirY , dirZ , upX , upY , upZ , this ) ; |
public class TCPChannel { /** * @ see com . ibm . wsspi . channelfw . Channel # destroy ( ) */
@ Override public void destroy ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Destroy " + getExternalName ( ) ) ; } // Destroy the server socket
if ( this . endPoint != null ) { this . endPoint . destroyServerSocket ( ) ; } // disconnect from the factory
if ( null != this . channelFactory ) { this . channelFactory . removeChannel ( this . channelName ) ; } |
public class ContainerGroupsInner { /** * Restarts all containers in a container group .
* Restarts all containers in a container group in place . If container image has updates , new image will be downloaded .
* @ param resourceGroupName The name of the resource group .
* @ param containerGroupName The name of the container group .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < Void > beginRestartAsync ( String resourceGroupName , String containerGroupName , final ServiceCallback < Void > serviceCallback ) { } } | return ServiceFuture . fromResponse ( beginRestartWithServiceResponseAsync ( resourceGroupName , containerGroupName ) , serviceCallback ) ; |
public class IdentityPatchRunner { /** * Create the patching task based on the definition .
* @ param definition the task description
* @ param provider the content provider
* @ param context the task context
* @ return the created task */
static PatchingTask createTask ( final PatchingTasks . ContentTaskDefinition definition , final PatchContentProvider provider , final IdentityPatchContext . PatchEntry context ) { } } | final PatchContentLoader contentLoader = provider . getLoader ( definition . getTarget ( ) . getPatchId ( ) ) ; final PatchingTaskDescription description = PatchingTaskDescription . create ( definition , contentLoader ) ; return PatchingTask . Factory . create ( description , context ) ; |
public class WireFeedInput { /** * Builds an WireFeed ( RSS or Atom ) from an W3C DOM document .
* NOTE : This method delages to the ' AsbtractFeed WireFeedInput # build ( org . jdom2 . Document ) ' .
* @ param document W3C DOM document to read to create the WireFeed .
* @ return the WireFeed read from the W3C DOM document .
* @ throws IllegalArgumentException thrown if feed type could not be understood by any of the
* underlying parsers .
* @ throws FeedException if the feed could not be parsed */
public WireFeed build ( final org . w3c . dom . Document document ) throws IllegalArgumentException , FeedException { } } | final DOMBuilder domBuilder = new DOMBuilder ( ) ; try { final Document jdomDoc = domBuilder . build ( document ) ; return this . build ( jdomDoc ) ; } catch ( final IllegalArgumentException ex ) { throw ex ; } catch ( final Exception ex ) { throw new ParsingFeedException ( "Invalid XML" , ex ) ; } |
public class Configs { /** * Extract the configuration metadata nodes from the given metadata .
* @ param modulesMetadata the metadata of the bootique modules .
* @ return the configuration metadata nodes . */
public static List < ConfigMetadataNode > extractConfigs ( ModulesMetadata modulesMetadata ) { } } | final List < ModuleMetadata > modules = modulesMetadata . getModules ( ) . stream ( ) . collect ( Collectors . toList ( ) ) ; return modules . stream ( ) . map ( ModuleMetadata :: getConfigs ) . flatMap ( Collection :: stream ) . sorted ( Comparator . comparing ( MetadataNode :: getName ) ) . collect ( Collectors . toList ( ) ) ; |
public class BOCSU { /** * Integer division and modulo with negative numerators
* yields negative modulo results and quotients that are one more than
* what we need here .
* @ param number which operations are to be performed on
* @ param factor the factor to use for division
* @ return ( result of division ) < < 32 | modulo */
private static final long getNegDivMod ( int number , int factor ) { } } | int modulo = number % factor ; long result = number / factor ; if ( modulo < 0 ) { -- result ; modulo += factor ; } return ( result << 32 ) | modulo ; |
public class Stream { /** * Partitions { @ code Stream } into { @ code Map } entries according to the given classifier function .
* < p > This is a stateful intermediate operation .
* < p > Example :
* < pre >
* classifier : ( str ) - & gt ; str . length ( )
* stream : [ " a " , " bc " , " d " , " ef " , " ghij " ]
* result : [ { 1 : [ " a " , " d " ] } , { 2 : [ " bc " , " ef " ] } , { 4 : [ " ghij " ] } ]
* < / pre >
* @ param < K > the type of the keys , which are result of the classifier function
* @ param classifier the classifier function
* @ return the new stream */
@ NotNull public < K > Stream < Map . Entry < K , List < T > > > groupBy ( @ NotNull final Function < ? super T , ? extends K > classifier ) { } } | Map < K , List < T > > map = collect ( Collectors . < T , K > groupingBy ( classifier ) ) ; return new Stream < Map . Entry < K , List < T > > > ( params , map . entrySet ( ) ) ; |
public class StandaloneCommandBuilder { /** * Adds the array of JVM arguments to the command .
* @ param javaOpts the array of JVM arguments to add , { @ code null } arguments are ignored
* @ return the builder */
public StandaloneCommandBuilder addJavaOptions ( final String ... javaOpts ) { } } | if ( javaOpts != null ) { for ( String javaOpt : javaOpts ) { addJavaOption ( javaOpt ) ; } } return this ; |
public class Aggregators { /** * Returns the aggregator corresponding to the given name .
* @ param name The name of the aggregator to get .
* @ throws NoSuchElementException if the given name doesn ' t exist .
* @ see # set */
public static Aggregator get ( final String name ) { } } | final Aggregator agg = aggregators . get ( name ) ; if ( agg != null ) { return agg ; } throw new NoSuchElementException ( "No such aggregator: " + name ) ; |
public class TypeParser { /** * [ 0 . . 9a . . bA . . B - + . _ & ] */
private static boolean isIdentifierChar ( int c ) { } } | return ( c >= '0' && c <= '9' ) || ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || c == '-' || c == '+' || c == '.' || c == '_' || c == '&' ; |
public class SquaresIntoClusters { /** * Put sets of nodes into the same list if they are some how connected */
protected void findClusters ( ) { } } | for ( int i = 0 ; i < nodes . size ( ) ; i ++ ) { SquareNode n = nodes . get ( i ) ; if ( n . graph < 0 ) { n . graph = clusters . size ( ) ; List < SquareNode > graph = clusters . grow ( ) ; graph . add ( n ) ; addToCluster ( n , graph ) ; } } |
public class ProcessExecutor { public String getSynchronousProcessResponse ( Long procInstId , String varname ) throws DataAccessException { } } | TransactionWrapper transaction = null ; try { transaction = startTransaction ( ) ; return engineImpl . getServiceProcessResponse ( procInstId , varname ) ; } catch ( Exception e ) { if ( canRetryTransaction ( e ) ) { transaction = ( TransactionWrapper ) initTransactionRetry ( transaction ) ; return ( ( ProcessExecutor ) getTransactionRetrier ( ) ) . getSynchronousProcessResponse ( procInstId , varname ) ; } else throw new DataAccessException ( 0 , "Failed to get value for variable " + varname , e ) ; } finally { stopTransaction ( transaction ) ; } |
public class SipCall { /** * @ see org . cafesip . sipunit . SipActionObject # format ( ) */
public String format ( ) { } } | if ( SipSession . isInternal ( returnCode ) == true ) { return SipSession . statusCodeDescription . get ( new Integer ( returnCode ) ) + ( errorMessage . length ( ) > 0 ? ( ": " + errorMessage ) : "" ) ; } else { return "Status code received from network = " + returnCode + ", " + SipResponse . statusCodeDescription . get ( new Integer ( returnCode ) ) + ( errorMessage . length ( ) > 0 ? ( ": " + errorMessage ) : "" ) ; } |
public class CookieUtils { /** * https : / / code . google . com / p / util - java / source / browse / trunk / src / utils /
* CookieUtils . java ? r = 6
* @ param response
* @ param name
* @ param value
* @ param domain
* @ param maxAge */
public static void setCookie ( HttpServletResponse response , String name , String value , String domain , int maxAge ) { } } | if ( value == null ) { value = "" ; } Cookie cookie = new Cookie ( name , value ) ; cookie . setMaxAge ( maxAge ) ; if ( domain != null && ! "" . equals ( domain ) ) { cookie . setDomain ( domain ) ; } cookie . setPath ( "/" ) ; response . addCookie ( cookie ) ; |
public class systemparameter { /** * Use this API to fetch all the systemparameter resources that are configured on netscaler . */
public static systemparameter get ( nitro_service service ) throws Exception { } } | systemparameter obj = new systemparameter ( ) ; systemparameter [ ] response = ( systemparameter [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; |
public class ApiOvhEmailexchange { /** * Get active licenses for specific period of time
* REST : GET / email / exchange / { organizationName } / service / { exchangeService } / license
* @ param license [ required ] License type
* @ param fromDate [ required ] Get active licenses since date
* @ param toDate [ required ] Get active licenses until date
* @ param organizationName [ required ] The internal name of your exchange organization
* @ param exchangeService [ required ] The internal name of your exchange service */
public ArrayList < OvhDailyLicense > organizationName_service_exchangeService_license_GET ( String organizationName , String exchangeService , Date fromDate , OvhOvhLicenceEnum license , Date toDate ) throws IOException { } } | String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/license" ; StringBuilder sb = path ( qPath , organizationName , exchangeService ) ; query ( sb , "fromDate" , fromDate ) ; query ( sb , "license" , license ) ; query ( sb , "toDate" , toDate ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t5 ) ; |
public class DateTimeUtil { /** * 获取日期所在周的开始时间 ( 约定为周日 )
* @ param date 时间 ( { @ link Date } )
* @ return 时间 ( { @ link java . util . Date } ) */
public static Date getStartOfWeek ( Date date ) { } } | if ( date == null ) return null ; Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( date ) ; calendar . setFirstDayOfWeek ( FIRST_DAY_OF_WEEK ) ; calendar . set ( Calendar . DAY_OF_WEEK , Calendar . SUNDAY ) ; return calendar . getTime ( ) ; |
public class Connection { /** * Initializes a connection object with a socket and related info .
* @ param cmgr The connection manager with which this connection is associated .
* @ param channel The socket channel from which we ' ll be reading messages .
* @ param createStamp The time at which this connection was created . */
public void init ( ConnectionManager cmgr , SocketChannel channel , long createStamp ) throws IOException { } } | _cmgr = cmgr ; _channel = channel ; _lastEvent = createStamp ; _connectionId = ++ _lastConnectionId ; |
public class Cluster { /** * Get all the used ports of this supervisor . */
public Set < Integer > getUsedPorts ( SupervisorDetails supervisor ) { } } | Map < String , SchedulerAssignment > assignments = this . getAssignments ( ) ; Set < Integer > usedPorts = new HashSet < > ( ) ; for ( SchedulerAssignment assignment : assignments . values ( ) ) { for ( WorkerSlot slot : assignment . getExecutorToSlot ( ) . values ( ) ) { if ( slot . getNodeId ( ) . equals ( supervisor . getId ( ) ) ) { usedPorts . add ( slot . getPort ( ) ) ; } } } return usedPorts ; |
public class CompilerUtil { /** * Finds and returns the setter method in the { @ link CompilerOptions } class that matches the
* specified name and argument types . If no matching method can be found , then returns null .
* An input argument type of string will match an Enum argument type if the Enum contains a
* constant who ' s name matches the string . In this case , the string value will be replaced with
* the Enum constant in the input < code > args < / code > list .
* @ param methodName
* the setter method name to match
* @ param args
* ( input / output ) the list of arguments . On input , the list of the arguments provided
* in the config . On output , the possibly converted list of arguments that may be
* passed to the setter method . See { @ link # marshalArg ( Class , Object ) } for conversion
* rules .
* @ return the matching method , or null if no match can be found */
private static Method findSetterMethod ( String methodName , List < Object > args ) { } } | final String sourceMethod = "findSetterMethod" ; // $ NON - NLS - 1 $
final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { methodName , args } ) ; } Method [ ] methods = CompilerOptions . class . getMethods ( ) ; Method result = null ; for ( Method method : methods ) { if ( method . getName ( ) . equals ( methodName ) && method . getParameterTypes ( ) . length == args . size ( ) ) { List < Object > marshalledArgs = new ArrayList < Object > ( args . size ( ) ) ; for ( int i = 0 ; i < args . size ( ) ; i ++ ) { Object arg = marshalArg ( method . getParameterTypes ( ) [ i ] , args . get ( i ) ) ; if ( arg != null ) { marshalledArgs . add ( arg ) ; } else { break ; } } if ( marshalledArgs . size ( ) == args . size ( ) ) { result = method ; args . clear ( ) ; args . addAll ( marshalledArgs ) ; break ; } } } if ( isTraceLogging ) { log . exiting ( sourceMethod , sourceMethod , result ) ; } return result ; |
public class AmazonEC2Client { /** * Describes one or more of your network interfaces .
* @ param describeNetworkInterfacesRequest
* Contains the parameters for DescribeNetworkInterfaces .
* @ return Result of the DescribeNetworkInterfaces operation returned by the service .
* @ sample AmazonEC2 . DescribeNetworkInterfaces
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DescribeNetworkInterfaces " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DescribeNetworkInterfacesResult describeNetworkInterfaces ( DescribeNetworkInterfacesRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeNetworkInterfaces ( request ) ; |
public class DefaultXPathBinder { /** * Evaluates the XPath as a boolean value . This method is just a shortcut for as ( Boolean . TYPE ) ;
* @ return true when the selected value equals ( ignoring case ) ' true ' */
@ Override public CloseableValue < Boolean > asBoolean ( ) { } } | final Class < ? > callerClass = ReflectionHelper . getDirectCallerClass ( ) ; return bindSingeValue ( Boolean . TYPE , callerClass ) ; |
public class OtpMbox { /** * Send a message to a remote { @ link OtpErlangPid pid } , representing either
* another { @ link OtpMbox mailbox } or an Erlang process .
* @ param to
* the { @ link OtpErlangPid pid } identifying the intended
* recipient of the message .
* @ param msg
* the body of the message to send . */
public void send ( final OtpErlangPid to , final OtpErlangObject msg ) { } } | try { final String node = to . node ( ) ; if ( node . equals ( home . node ( ) ) ) { home . deliver ( new OtpMsg ( to , ( OtpErlangObject ) msg . clone ( ) ) ) ; } else { final OtpCookedConnection conn = home . getConnection ( node ) ; if ( conn == null ) { return ; } conn . send ( self , to , msg ) ; } } catch ( final Exception e ) { } |
public class JcrPropertyDefinition { /** * Returns < code > true < / code > if < code > value < / code > can be cast to < code > property . getRequiredType ( ) < / code > per the type
* conversion rules in section 3.6.4 of the JCR 2.0 specification AND < code > value < / code > satisfies the constraints ( if any )
* for the property definition . If the property definition has a required type of { @ link PropertyType # UNDEFINED } , the cast
* will be considered to have succeeded and the value constraints ( if any ) will be interpreted using the semantics for the
* type specified in < code > value . getType ( ) < / code > .
* @ param values the values to be validated
* @ param session the session in which the constraints are to be checked ; may not be null
* @ return < code > true < / code > if the value can be cast to the required type for the property definition ( if it exists ) and
* satisfies the constraints for the property ( if any exist ) .
* @ see PropertyDefinition # getValueConstraints ( )
* @ see # satisfiesConstraints ( Value , JcrSession ) */
boolean canCastToTypeAndSatisfyConstraints ( Value [ ] values , JcrSession session ) { } } | for ( Value value : values ) { if ( ! canCastToTypeAndSatisfyConstraints ( value , session ) ) return false ; } return true ; |
public class TemporalProposition { /** * Returns the earliest valid time of this proposition as a short string .
* @ return a < code > String < / code > . */
public final String getStartFormattedShort ( ) { } } | Granularity startGran = this . interval . getStartGranularity ( ) ; return formatStart ( startGran != null ? startGran . getShortFormat ( ) : null ) ; |
public class PluginParser { /** * Migrate from deprecated plugin format to new format */
private Element migrate ( Element root ) { } } | if ( root . getAttributeNode ( PLUGIN_VERSION_ATTR ) == null ) { final List < Element > features = toList ( root . getElementsByTagName ( FEATURE_ELEM ) ) ; final String version = features . stream ( ) . filter ( elem -> elem . getAttribute ( FEATURE_ID_ATTR ) . equals ( "package.version" ) ) . findFirst ( ) . map ( elem -> elem . getAttribute ( FEATURE_VALUE_ATTR ) ) . orElse ( "0.0.0" ) ; root . setAttribute ( PLUGIN_VERSION_ATTR , version ) ; } return root ; |
public class HttpRequest { /** * 获取请求URL分段中含prefix段的double值 < br >
* 例如请求URL / pipes / record / query / point : 40.0 < br >
* 获取time参数 : double point = request . getRequstURIPath ( " point : " , 0.0 ) ;
* @ param prefix prefix段前缀
* @ param defvalue 默认double值
* @ return double值 */
public double getRequstURIPath ( String prefix , double defvalue ) { } } | String val = getRequstURIPath ( prefix , null ) ; try { return val == null ? defvalue : Double . parseDouble ( val ) ; } catch ( NumberFormatException e ) { return defvalue ; } |
public class AccountsInner { /** * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account .
* @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account .
* @ param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details .
* @ param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the DataLakeStoreAccountInfoInner object */
public Observable < ServiceResponse < DataLakeStoreAccountInfoInner > > getDataLakeStoreAccountWithServiceResponseAsync ( String resourceGroupName , String accountName , String dataLakeStoreAccountName ) { } } | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( dataLakeStoreAccountName == null ) { throw new IllegalArgumentException ( "Parameter dataLakeStoreAccountName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . getDataLakeStoreAccount ( resourceGroupName , accountName , dataLakeStoreAccountName , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < DataLakeStoreAccountInfoInner > > > ( ) { @ Override public Observable < ServiceResponse < DataLakeStoreAccountInfoInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < DataLakeStoreAccountInfoInner > clientResponse = getDataLakeStoreAccountDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class FessMessages { /** * Add the created action message for the key ' errors . design _ jsp _ file _ does _ not _ exist ' with parameters .
* < pre >
* message : JSP file does not exist .
* < / pre >
* @ param property The property name for the message . ( NotNull )
* @ return this . ( NotNull ) */
public FessMessages addErrorsDesignJspFileDoesNotExist ( String property ) { } } | assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_design_jsp_file_does_not_exist ) ) ; return this ; |
public class AccountReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return Account ResourceSet */
@ Override public ResourceSet < Account > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class AmazonTranscribeClient { /** * Deletes a vocabulary from Amazon Transcribe .
* @ param deleteVocabularyRequest
* @ return Result of the DeleteVocabulary operation returned by the service .
* @ throws NotFoundException
* We can ' t find the requested resource . Check the name and try your request again .
* @ throws LimitExceededException
* Either you have sent too many requests or your input file is too long . Wait before you resend your
* request , or use a smaller file and resend the request .
* @ throws BadRequestException
* Your request didn ' t pass one or more validation tests . For example , if the transcription you ' re trying to
* delete doesn ' t exist or if it is in a non - terminal state ( for example , it ' s " in progress " ) . See the
* exception < code > Message < / code > field for more information .
* @ throws InternalFailureException
* There was an internal error . Check the error message and try your request again .
* @ sample AmazonTranscribe . DeleteVocabulary
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / transcribe - 2017-10-26 / DeleteVocabulary " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DeleteVocabularyResult deleteVocabulary ( DeleteVocabularyRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDeleteVocabulary ( request ) ; |
public class ConvertDMatrixStruct { /** * Converts { @ link DMatrixRMaj } into { @ link DMatrixRBlock }
* Can ' t handle null output matrix since block size needs to be specified .
* @ param src Input matrix .
* @ param dst Output matrix . */
public static void convert ( DMatrixRMaj src , DMatrixRBlock dst ) { } } | if ( src . numRows != dst . numRows || src . numCols != dst . numCols ) throw new IllegalArgumentException ( "Must be the same size." ) ; for ( int i = 0 ; i < dst . numRows ; i += dst . blockLength ) { int blockHeight = Math . min ( dst . blockLength , dst . numRows - i ) ; for ( int j = 0 ; j < dst . numCols ; j += dst . blockLength ) { int blockWidth = Math . min ( dst . blockLength , dst . numCols - j ) ; int indexDst = i * dst . numCols + blockHeight * j ; int indexSrcRow = i * dst . numCols + j ; for ( int k = 0 ; k < blockHeight ; k ++ ) { System . arraycopy ( src . data , indexSrcRow , dst . data , indexDst , blockWidth ) ; indexDst += blockWidth ; indexSrcRow += dst . numCols ; } } } |
public class CEDescrBuilderImpl { /** * { @ inheritDoc } */
public NamedConsequenceDescrBuilder < CEDescrBuilder < P , T > > namedConsequence ( ) { } } | NamedConsequenceDescrBuilder < CEDescrBuilder < P , T > > namedConsequence = new NamedConsequenceDescrBuilderImpl < CEDescrBuilder < P , T > > ( this ) ; ( ( ConditionalElementDescr ) descr ) . addDescr ( namedConsequence . getDescr ( ) ) ; return namedConsequence ; |
public class CloudBridge { /** * < code >
* If using the semantic layer , this tells the semantic layer to not cache the response .
* By default caching is on when using the semantic layer .
* Currently this is undocumented until the semantic layer is globally enabled .
* @ param cachingEnabled
* Turn off caching by setting this to false .
* @ internal */
public synchronized void setCachingEnabled ( boolean cachingEnabled ) { } } | if ( containsHeader ( getHeaders ( ) , SKIP_CACHING_HEADER_KEY ) ) { if ( cachingEnabled ) { removeHeader ( getHeaders ( ) , SKIP_CACHING_HEADER_KEY ) ; } } else { if ( ! cachingEnabled ) { addHeader ( getHeaders ( ) , SKIP_CACHING_HEADER_KEY , "true" ) ; } } |
public class StringHelper { /** * Take a concatenated String and return a sorted { @ link CommonsTreeSet } of all
* elements in the passed string , using specified separator string .
* @ param sSep
* The separator to use . May not be < code > null < / code > .
* @ param sElements
* The concatenated String to convert . May be < code > null < / code > or empty .
* @ return The sorted { @ link Set } represented by the passed string . Never
* < code > null < / code > . If the passed input string is < code > null < / code > or
* " " an empty list is returned . */
@ Nonnull @ ReturnsMutableCopy public static CommonsTreeSet < String > getExplodedToSortedSet ( @ Nonnull final String sSep , @ Nullable final String sElements ) { } } | return getExploded ( sSep , sElements , - 1 , new CommonsTreeSet < > ( ) ) ; |
public class BitInputStream { /** * read UTF long .
* on return , if * val = = 0xfffff then the utf - 8 sequence was
* invalid , but the return value will be true
* @ param raw The raw bytes read ( output ) . If null , no bytes are returned
* @ return The long read
* @ throws IOException Thrown if error reading input stream */
public long readUTF8Long ( ByteData raw ) throws IOException { } } | long v = 0 ; int x ; int i ; long val ; x = readRawUInt ( 8 ) ; if ( raw != null ) raw . append ( ( byte ) x ) ; if ( ( ( x & 0x80 ) == 0 ) ) { // 0xxxxx
v = x ; i = 0 ; } else if ( ( ( x & 0xC0 ) != 0 ) && ( ( x & 0x20 ) == 0 ) ) { // 110xxxxx
v = x & 0x1F ; i = 1 ; } else if ( ( ( x & 0xE0 ) != 0 ) && ( ( x & 0x10 ) == 0 ) ) { // 1110xxxx
v = x & 0x0F ; i = 2 ; } else if ( ( ( x & 0xF0 ) != 0 ) && ( ( x & 0x08 ) == 0 ) ) { // 11110xxx
v = x & 0x07 ; i = 3 ; } else if ( ( ( x & 0xF8 ) != 0 ) && ( ( x & 0x04 ) == 0 ) ) { // 111110xx
v = x & 0x03 ; i = 4 ; } else if ( ( ( x & 0xFC ) != 0 ) && ( ( x & 0x02 ) == 0 ) ) { // 111110x
v = x & 0x01 ; i = 5 ; } else if ( ( ( x & 0xFE ) != 0 ) && ( ( x & 0x01 ) == 0 ) ) { // 111110
v = 0 ; i = 6 ; } else { val = 0xffffffffffffffffL ; return val ; } for ( ; i > 0 ; i -- ) { x = peekRawUInt ( 8 ) ; if ( ( ( x & 0x80 ) == 0 ) || ( ( x & 0x40 ) != 0 ) ) { // 10xxxxx
val = 0xffffffffffffffffL ; return val ; } x = readRawUInt ( 8 ) ; if ( raw != null ) raw . append ( ( byte ) x ) ; v <<= 6 ; v |= ( x & 0x3F ) ; } val = v ; return val ; |
public class MemcacheClientHandler { /** * Transforms basic string requests to binary memcache requests */
@ Override public void write ( ChannelHandlerContext ctx , Object msg , ChannelPromise promise ) { } } | String command = ( String ) msg ; if ( command . startsWith ( "get " ) ) { String keyString = command . substring ( "get " . length ( ) ) ; ByteBuf key = Unpooled . wrappedBuffer ( keyString . getBytes ( CharsetUtil . UTF_8 ) ) ; BinaryMemcacheRequest req = new DefaultBinaryMemcacheRequest ( key ) ; req . setOpcode ( BinaryMemcacheOpcodes . GET ) ; ctx . write ( req , promise ) ; } else if ( command . startsWith ( "set " ) ) { String [ ] parts = command . split ( " " , 3 ) ; if ( parts . length < 3 ) { throw new IllegalArgumentException ( "Malformed Command: " + command ) ; } String keyString = parts [ 1 ] ; String value = parts [ 2 ] ; ByteBuf key = Unpooled . wrappedBuffer ( keyString . getBytes ( CharsetUtil . UTF_8 ) ) ; ByteBuf content = Unpooled . wrappedBuffer ( value . getBytes ( CharsetUtil . UTF_8 ) ) ; ByteBuf extras = ctx . alloc ( ) . buffer ( 8 ) ; extras . writeZero ( 8 ) ; BinaryMemcacheRequest req = new DefaultFullBinaryMemcacheRequest ( key , extras , content ) ; req . setOpcode ( BinaryMemcacheOpcodes . SET ) ; ctx . write ( req , promise ) ; } else { throw new IllegalStateException ( "Unknown Message: " + msg ) ; } |
public class OCDImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . OCD__OBJ_CDAT : return getObjCdat ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class DataMerge { /** * main .
* @ param args String [ ]
* @ throws IOException e */
public static void main ( final String [ ] args ) throws IOException { } } | if ( args == null || args . length != 2 ) { throw new IllegalArgumentException ( "Please give the javamelody storage directory and the merging directory as arguments" ) ; } final File storageDirectory = new File ( args [ 0 ] ) ; final File mergingDirectory = new File ( args [ 1 ] ) ; final DataMerge dataMerge = new DataMerge ( storageDirectory , mergingDirectory ) ; dataMerge . mergeData ( ) ; |
public class AWSSecretsManagerClient { /** * Stores a new encrypted secret value in the specified secret . To do this , the operation creates a new version and
* attaches it to the secret . The version can contain a new < code > SecretString < / code > value or a new
* < code > SecretBinary < / code > value . You can also specify the staging labels that are initially attached to the new
* version .
* < note >
* The Secrets Manager console uses only the < code > SecretString < / code > field . To add binary data to a secret with
* the < code > SecretBinary < / code > field you must use the AWS CLI or one of the AWS SDKs .
* < / note >
* < ul >
* < li >
* If this operation creates the first version for the secret then Secrets Manager automatically attaches the
* staging label < code > AWSCURRENT < / code > to the new version .
* < / li >
* < li >
* If another version of this secret already exists , then this operation does not automatically move any staging
* labels other than those that you explicitly specify in the < code > VersionStages < / code > parameter .
* < / li >
* < li >
* If this operation moves the staging label < code > AWSCURRENT < / code > from another version to this version ( because
* you included it in the < code > StagingLabels < / code > parameter ) then Secrets Manager also automatically moves the
* staging label < code > AWSPREVIOUS < / code > to the version that < code > AWSCURRENT < / code > was removed from .
* < / li >
* < li >
* This operation is idempotent . If a version with a < code > VersionId < / code > with the same value as the
* < code > ClientRequestToken < / code > parameter already exists and you specify the same secret data , the operation
* succeeds but does nothing . However , if the secret data is different , then the operation fails because you cannot
* modify an existing version ; you can only create new ones .
* < / li >
* < / ul >
* < note >
* < ul >
* < li >
* If you call an operation that needs to encrypt or decrypt the < code > SecretString < / code > or
* < code > SecretBinary < / code > for a secret in the same account as the calling user and that secret doesn ' t specify a
* AWS KMS encryption key , Secrets Manager uses the account ' s default AWS managed customer master key ( CMK ) with the
* alias < code > aws / secretsmanager < / code > . If this key doesn ' t already exist in your account then Secrets Manager
* creates it for you automatically . All users and roles in the same AWS account automatically have access to use
* the default CMK . Note that if an Secrets Manager API call results in AWS having to create the account ' s
* AWS - managed CMK , it can result in a one - time significant delay in returning the result .
* < / li >
* < li >
* If the secret is in a different AWS account from the credentials calling an API that requires encryption or
* decryption of the secret value then you must create and use a custom AWS KMS CMK because you can ' t access the
* default CMK for the account using credentials from a different AWS account . Store the ARN of the CMK in the
* secret when you create the secret or when you update it by including it in the < code > KMSKeyId < / code > . If you call
* an API that must encrypt or decrypt < code > SecretString < / code > or < code > SecretBinary < / code > using credentials from
* a different account then the AWS KMS key policy must grant cross - account access to that other account ' s user or
* role for both the kms : GenerateDataKey and kms : Decrypt operations .
* < / li >
* < / ul >
* < / note >
* < b > Minimum permissions < / b >
* To run this command , you must have the following permissions :
* < ul >
* < li >
* secretsmanager : PutSecretValue
* < / li >
* < li >
* kms : GenerateDataKey - needed only if you use a customer - managed AWS KMS key to encrypt the secret . You do not
* need this permission to use the account ' s default AWS managed CMK for Secrets Manager .
* < / li >
* < / ul >
* < b > Related operations < / b >
* < ul >
* < li >
* To retrieve the encrypted value you store in the version of a secret , use < a > GetSecretValue < / a > .
* < / li >
* < li >
* To create a secret , use < a > CreateSecret < / a > .
* < / li >
* < li >
* To get the details for a secret , use < a > DescribeSecret < / a > .
* < / li >
* < li >
* To list the versions attached to a secret , use < a > ListSecretVersionIds < / a > .
* < / li >
* < / ul >
* @ param putSecretValueRequest
* @ return Result of the PutSecretValue operation returned by the service .
* @ throws InvalidParameterException
* You provided an invalid value for a parameter .
* @ throws InvalidRequestException
* You provided a parameter value that is not valid for the current state of the resource . < / p >
* Possible causes :
* < ul >
* < li >
* You tried to perform the operation on a secret that ' s currently marked deleted .
* < / li >
* < li >
* You tried to enable rotation on a secret that doesn ' t already have a Lambda function ARN configured and
* you didn ' t include such an ARN as a parameter in this call .
* < / li >
* @ throws LimitExceededException
* The request failed because it would exceed one of the Secrets Manager internal limits .
* @ throws EncryptionFailureException
* Secrets Manager can ' t encrypt the protected secret text using the provided KMS key . Check that the
* customer master key ( CMK ) is available , enabled , and not in an invalid state . For more information , see
* < a href = " http : / / docs . aws . amazon . com / kms / latest / developerguide / key - state . html " > How Key State Affects Use
* of a Customer Master Key < / a > .
* @ throws ResourceExistsException
* A resource with the ID you requested already exists .
* @ throws ResourceNotFoundException
* We can ' t find the resource that you asked for .
* @ throws InternalServiceErrorException
* An error occurred on the server side .
* @ sample AWSSecretsManager . PutSecretValue
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / secretsmanager - 2017-10-17 / PutSecretValue " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public PutSecretValueResult putSecretValue ( PutSecretValueRequest request ) { } } | request = beforeClientExecution ( request ) ; return executePutSecretValue ( request ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.