signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DeleteJobRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteJobRequest deleteJobRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteJobRequest . getJobName ( ) , JOBNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class MsgPhrase { /** * Returns for given parameter < i > _ name < / i > the instance of class
* { @ link MsgPhrase } .
* @ param _ name name of the system configuration
* @ return instance of class { @ link MsgPhrase }
* @ throws EFapsException on error */
public static MsgPhrase get ( final String _name ) throws EFapsException { } } | final Cache < String , MsgPhrase > cache = InfinispanCache . get ( ) . < String , MsgPhrase > getCache ( MsgPhrase . NAMECACHE ) ; if ( ! cache . containsKey ( _name ) ) { MsgPhrase . loadMsgPhrase ( _name ) ; } return cache . get ( _name ) ; |
public class SMBFileShareInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SMBFileShareInfo sMBFileShareInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( sMBFileShareInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sMBFileShareInfo . getFileShareARN ( ) , FILESHAREARN_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getFileShareId ( ) , FILESHAREID_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getFileShareStatus ( ) , FILESHARESTATUS_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getGatewayARN ( ) , GATEWAYARN_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getKMSEncrypted ( ) , KMSENCRYPTED_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getKMSKey ( ) , KMSKEY_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getPath ( ) , PATH_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getRole ( ) , ROLE_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getLocationARN ( ) , LOCATIONARN_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getDefaultStorageClass ( ) , DEFAULTSTORAGECLASS_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getObjectACL ( ) , OBJECTACL_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getReadOnly ( ) , READONLY_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getGuessMIMETypeEnabled ( ) , GUESSMIMETYPEENABLED_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getRequesterPays ( ) , REQUESTERPAYS_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getSMBACLEnabled ( ) , SMBACLENABLED_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getValidUserList ( ) , VALIDUSERLIST_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getInvalidUserList ( ) , INVALIDUSERLIST_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getAuthentication ( ) , AUTHENTICATION_BINDING ) ; protocolMarshaller . marshall ( sMBFileShareInfo . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ExcelTools { /** * 将StringTokenizer类型数据转化生成字符串数 � ?
* @ param sourceStr 解析 " , " 间隔的字符串 , 变成字符串数组
* @ param strDot */
private String [ ] Tokenizer2StringArray ( String sourceStr , String strDot ) { } } | StringTokenizer st = new StringTokenizer ( sourceStr , strDot ) ; int size = st . countTokens ( ) ; String [ ] strArray = new String [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { strArray [ i ] = st . nextToken ( ) ; } return strArray ; |
public class AbstractRestClient { /** * Build a keystore with certificates loaded from resource
* Certificates can be in binary or base64 DER / . crt format .
* @ param certResourcesthe resource names
* @ returnthe key store
* @ throws KeyStoreExceptionif the key store couldn ' t be created
* @ throws CertificateExceptionif the certificate couldn ' t be loaded
* @ throws NoSuchAlgorithmExceptionif the algorithm required does not exist
* @ throws IOExceptionif the key store cannot be initialized */
protected KeyStore buildKeyStoreFromResources ( String ... certResources ) throws KeyStoreException , CertificateException , NoSuchAlgorithmException , IOException { } } | KeyStore keyStore = KeyStore . getInstance ( KeyStore . getDefaultType ( ) ) ; keyStore . load ( null ) ; for ( String res : certResources ) { X509Certificate cert = loadX509CertificateFromResource ( res ) ; String alias = cert . getSubjectX500Principal ( ) . getName ( ) ; keyStore . setCertificateEntry ( alias , cert ) ; } return keyStore ; |
public class FluxBuilder { /** * Given a topology definition , resolve and instantiate all components found and return a map
* keyed by the component id . */
private static void buildComponents ( ExecutionContext context ) throws ClassNotFoundException , NoSuchMethodException , IllegalAccessException , InvocationTargetException , InstantiationException { } } | Collection < BeanDef > cDefs = context . getTopologyDef ( ) . getComponents ( ) ; if ( cDefs != null ) { for ( BeanDef bean : cDefs ) { Object obj = buildObject ( bean , context ) ; context . addComponent ( bean . getId ( ) , obj ) ; } } |
public class SelectContext { /** * Selects an option by its value .
* @ param value The value of the option that shall be selected .
* @ return A { @ link de . codecentric . zucchini . web . steps . SelectStep } that selects an option by its value . */
public SelectStep value ( String value ) { } } | return new SelectStep ( element , value , SelectStep . OptionSelectorType . VALUE ) ; |
public class CollectionUtils { /** * As multi value map .
* @ param innerMap the inner map
* @ return the multi value map */
public static MultiValueMap asMultiValueMap ( final Map innerMap ) { } } | return org . springframework . util . CollectionUtils . toMultiValueMap ( innerMap ) ; |
public class ElementBase { /** * Locates and returns a child that is an instance of the specified class . If none is found ,
* returns null .
* @ param < T > The type of child being sought .
* @ param clazz Class of the child being sought .
* @ param last If specified , the search begins after this child . If null , the search begins with
* the first child .
* @ return The requested child or null if none found . */
@ SuppressWarnings ( "unchecked" ) public < T extends ElementBase > T getChild ( Class < T > clazz , ElementBase last ) { } } | int i = last == null ? - 1 : children . indexOf ( last ) ; for ( i ++ ; i < children . size ( ) ; i ++ ) { if ( clazz . isInstance ( children . get ( i ) ) ) { return ( T ) children . get ( i ) ; } } return null ; |
public class ChineseTrans { /** * 将全角传闻半角 、 繁体转为简体
* @ param input
* @ return */
public String normalize ( String input ) { } } | char [ ] c = input . toCharArray ( ) ; normalise ( c ) ; return new String ( c ) ; |
public class WeldConfiguration { /** * Iterate through the { @ link ConfigurationKey # values ( ) } and try to get a system property for every key . The value is automatically converted - a runtime
* exception may be thrown during conversion .
* @ return all the properties set as system properties */
private Map < ConfigurationKey , Object > getSystemProperties ( ) { } } | Map < ConfigurationKey , Object > found = new EnumMap < ConfigurationKey , Object > ( ConfigurationKey . class ) ; for ( ConfigurationKey key : ConfigurationKey . values ( ) ) { String property = getSystemProperty ( key . get ( ) ) ; if ( property != null ) { processKeyValue ( found , key , property ) ; } } return found ; |
public class GeometryType { /** * Returns the value SRID parameter .
* @ return the SRID or < code > null < / code > if not present . */
public Integer getSRID ( ) { } } | Integer srid = null ; if ( getParameters ( ) . length > 1 && getParameters ( ) [ 1 ] != null ) { srid = Integer . valueOf ( getParameters ( ) [ 1 ] . toString ( ) ) ; } return srid ; |
public class TaskStatistics { /** * Get key of type String */
public String getStringValue ( Enum key ) { } } | if ( this . _task . get ( key ) == null ) { return "" ; } else { return this . _task . get ( key ) ; } |
public class JasperUtil { /** * Images are in the master file */
public static Report restoreImagesName ( Report report ) { } } | JasperContent reportContent = ( JasperContent ) report . getContent ( ) ; JcrFile masterFile = reportContent . getMaster ( ) ; try { String masterContent = new String ( masterFile . getDataProvider ( ) . getBytes ( ) , "UTF-8" ) ; if ( reportContent . getImageFiles ( ) != null ) { for ( JcrFile imageFile : reportContent . getImageFiles ( ) ) { String oldName = imageFile . getName ( ) ; int startIndex = oldName . indexOf ( ReportUtil . IMAGE_DELIM ) ; int extIndex = oldName . lastIndexOf ( ReportUtil . EXTENSION_SEPARATOR ) ; String newName = oldName . substring ( 0 , startIndex ) + oldName . substring ( extIndex ) ; masterContent = masterContent . replaceAll ( oldName , newName ) ; imageFile . setName ( newName ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Image " + ": " + oldName + " > " + newName ) ; // LOG . debug ( " master = " + master ) ;
} } } masterFile . setDataProvider ( new JcrDataProviderImpl ( masterContent . getBytes ( "UTF-8" ) ) ) ; } catch ( UnsupportedEncodingException e ) { LOG . error ( "Error inside JasperUtil.restoreImagesName: " + e . getMessage ( ) , e ) ; e . printStackTrace ( ) ; } return report ; |
public class CmsImportHelper { /** * Returns a stream for the content of the file . < p >
* @ param fileName the name of the file to stream , relative to the folder or zip file
* @ return an input stream for the content of the file , remember to close it after using
* @ throws CmsImportExportException if something goes wrong */
public InputStream getFileStream ( String fileName ) throws CmsImportExportException { } } | try { InputStream stream = null ; // is this a zip - file ?
if ( getZipFile ( ) != null ) { // yes
ZipEntry entry = getZipFile ( ) . getEntry ( fileName ) ; // path to file might be relative , too
if ( ( entry == null ) && fileName . startsWith ( "/" ) ) { entry = getZipFile ( ) . getEntry ( fileName . substring ( 1 ) ) ; } if ( entry == null ) { throw new ZipException ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IMPORTEXPORT_FILE_NOT_FOUND_IN_ZIP_1 , fileName ) ) ; } stream = getZipFile ( ) . getInputStream ( entry ) ; } else { // no - use directory
File file = new File ( getFolder ( ) , CmsImportExportManager . EXPORT_MANIFEST ) ; stream = new FileInputStream ( file ) ; } return stream ; } catch ( Exception ioe ) { CmsMessageContainer msg = Messages . get ( ) . container ( Messages . ERR_IMPORTEXPORT_ERROR_READING_FILE_1 , fileName ) ; if ( LOG . isErrorEnabled ( ) ) { LOG . error ( msg . key ( ) , ioe ) ; } throw new CmsImportExportException ( msg , ioe ) ; } |
public class JMXetricXmlConfigurationService { /** * Gets a list of MBeanAttributes for a single < mbean > , they correspond to
* the < attribute > tags in the XML file .
* @ param mBean
* the < mbean > node
* @ param sampleDMax
* value of dmax passed down from < sample >
* @ return a list of attributes associated to the mbean
* @ throws Exception */
List < MBeanAttribute > getAttributesForMBean ( Node mBean , String sampleDMax ) throws Exception { } } | String mBeanName = selectParameterFromNode ( mBean , "name" , null ) ; String mBeanPublishName = selectParameterFromNode ( mBean , "pname" , "" ) ; String mBeanDMax = selectParameterFromNode ( mBean , "dmax" , sampleDMax ) ; log . finer ( "Mbean is " + mBeanName ) ; NodeList attrs = getXmlNodeSet ( "attribute" , mBean ) ; List < MBeanAttribute > attributes = new Vector < MBeanAttribute > ( ) ; for ( int i = 0 ; i < attrs . getLength ( ) ; i ++ ) { Node attr = attrs . item ( i ) ; if ( isComposite ( attr ) ) { attributes . addAll ( makeCompositeAttributes ( attr , mBeanName , mBeanPublishName , mBeanDMax ) ) ; } else { attributes . add ( makeSimpleAttribute ( attr , mBeanName , mBeanPublishName , mBeanDMax ) ) ; } } return attributes ; |
public class Expression { /** * Add field : value */
public Expression add ( String field , boolean value ) { } } | return add ( field , JsonNodeFactory . instance . booleanNode ( value ) ) ; |
public class ObjectInputStream { /** * Reads the fields of the specified { @ link Streamable } instance from the input stream using
* the default object streaming mechanisms ( a call is not made to < code > readObject ( ) < / code > ,
* even if such a method exists ) . */
public void defaultReadObject ( ) throws IOException , ClassNotFoundException { } } | // sanity check
if ( _current == null ) { throw new RuntimeException ( "defaultReadObject() called illegally." ) ; } // read the instance data
_streamer . readObject ( _current , this , false ) ; |
public class CacheEntry { /** * Delete the cached build after the specified delay in minues
* @ param mgr
* The cache manager . May be null if persist hasn ' t yet been
* called , in which case , persist will have no effect when it
* is called . */
public synchronized void delete ( final ICacheManager mgr ) { } } | delete = true ; if ( filename != null ) { mgr . deleteFileDelayed ( filename ) ; } |
public class ForkChannel { /** * Removes the fork - channel from the fork - stack ' s hashmap and resets its state . Does < em > not < / em > affect the
* main - channel */
@ Override public ForkChannel disconnect ( ) { } } | if ( state != State . CONNECTED ) return this ; prot_stack . down ( new Event ( Event . DISCONNECT , local_addr ) ) ; // will be discarded by ForkProtocol
prot_stack . stopStack ( cluster_name ) ; ( ( ForkProtocolStack ) prot_stack ) . remove ( fork_channel_id ) ; nullFields ( ) ; state = State . OPEN ; notifyChannelDisconnected ( this ) ; return this ; |
public class ApiOvhRouter { /** * Get this object properties
* REST : GET / router / { serviceName } / privateLink / { peerServiceName }
* @ param serviceName [ required ] The internal name of your Router offer
* @ param peerServiceName [ required ] Service name of the other side of this link */
public OvhPrivateLink serviceName_privateLink_peerServiceName_GET ( String serviceName , String peerServiceName ) throws IOException { } } | String qPath = "/router/{serviceName}/privateLink/{peerServiceName}" ; StringBuilder sb = path ( qPath , serviceName , peerServiceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhPrivateLink . class ) ; |
public class AbstractProviderResolver { /** * Close a given config , if it ' s a WebSphereConfig */
private void closeConfig ( Config config ) { } } | if ( config instanceof WebSphereConfig ) { try { ( ( WebSphereConfig ) config ) . close ( ) ; } catch ( IOException e ) { throw new ConfigException ( Tr . formatMessage ( tc , "could.not.close.CWMCG0004E" , e ) ) ; } } |
public class PhotosApi { /** * Returns all visible sets and pools the photo belongs to .
* < br >
* This method does not require authentication .
* @ param photoId photo id to find contexts for .
* @ return object with a list of all sets and pools the photo is in .
* @ throws JinxException if the photo id is null or empty , or if there are any errors .
* @ see < a href = " https : / / www . flickr . com / services / api / flickr . photos . getAllContexts . html " > flickr . photos . getAllContexts < / a > */
public AllContexts getAllContexts ( String photoId ) throws JinxException { } } | JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.getAllContexts" ) ; params . put ( "photo_id" , photoId ) ; return jinx . flickrGet ( params , AllContexts . class ) ; |
public class Registry { /** * Get the value nodes in this name / value chain .
* @ param header The message header that contains the name / value tree .
* @ oaram bAddIfNotFound Add the value if it is not found .
* @ return The node at the end of the name / value tree . */
public NameValue [ ] getNameValueArray ( BaseMessageHeader header ) { } } | Object [ ] [ ] mxString = header . getNameValueTree ( ) ; NameValue [ ] rgNodes = new NameValue [ 10 ] ; rgNodes [ 0 ] = this ; int i = 0 ; if ( mxString != null ) { for ( ; i < mxString . length ; i ++ ) { rgNodes [ i + 1 ] = rgNodes [ i ] . getNameValueNode ( ( String ) mxString [ i ] [ MessageConstants . NAME ] , mxString [ i ] [ MessageConstants . VALUE ] , false ) ; if ( rgNodes [ i + 1 ] == null ) break ; } } NameValue [ ] rgNodesNew = new NameValue [ i + 1 ] ; for ( int j = 0 ; j <= i ; j ++ ) { rgNodesNew [ j ] = rgNodes [ j ] ; } return rgNodesNew ; |
public class RemoveUnusedCode { /** * Traverses everything in the current scope and marks variables that
* are referenced .
* During traversal , we identify subtrees that will only be
* referenced if their enclosing variables are referenced . Instead of
* traversing those subtrees , we create a continuation for them ,
* and traverse them lazily . */
private void traverseNode ( Node n , Scope scope ) { } } | Node parent = n . getParent ( ) ; Token type = n . getToken ( ) ; switch ( type ) { case CATCH : traverseCatch ( n , scope ) ; break ; case FUNCTION : { VarInfo varInfo = null ; // If this function is a removable var , then create a continuation
// for it instead of traversing immediately .
if ( NodeUtil . isFunctionDeclaration ( n ) ) { varInfo = traverseNameNode ( n . getFirstChild ( ) , scope ) ; FunctionDeclaration functionDeclaration = new RemovableBuilder ( ) . addContinuation ( new Continuation ( n , scope ) ) . buildFunctionDeclaration ( n ) ; varInfo . addRemovable ( functionDeclaration ) ; if ( parent . isExport ( ) ) { varInfo . markAsReferenced ( ) ; } } else { traverseFunction ( n , scope ) ; } } break ; case ASSIGN : traverseAssign ( n , scope ) ; break ; case ASSIGN_BITOR : case ASSIGN_BITXOR : case ASSIGN_BITAND : case ASSIGN_LSH : case ASSIGN_RSH : case ASSIGN_URSH : case ASSIGN_ADD : case ASSIGN_SUB : case ASSIGN_MUL : case ASSIGN_EXPONENT : case ASSIGN_DIV : case ASSIGN_MOD : traverseCompoundAssign ( n , scope ) ; break ; case INC : case DEC : traverseIncrementOrDecrementOp ( n , scope ) ; break ; case CALL : traverseCall ( n , scope ) ; break ; case SWITCH : case BLOCK : // This case if for if there are let and const variables in block scopes .
// Otherwise other variables will be hoisted up into the global scope and already be
// handled .
traverseChildren ( n , NodeUtil . createsBlockScope ( n ) ? scopeCreator . createScope ( n , scope ) : scope ) ; break ; case MODULE_BODY : traverseChildren ( n , scopeCreator . createScope ( n , scope ) ) ; break ; case CLASS : traverseClass ( n , scope ) ; break ; case CLASS_MEMBERS : traverseClassMembers ( n , scope ) ; break ; case DEFAULT_VALUE : traverseDefaultValue ( n , scope ) ; break ; case REST : traverseRest ( n , scope ) ; break ; case ARRAY_PATTERN : traverseArrayPattern ( n , scope ) ; break ; case OBJECT_PATTERN : traverseObjectPattern ( n , scope ) ; break ; case OBJECTLIT : traverseObjectLiteral ( n , scope ) ; break ; case FOR : traverseVanillaFor ( n , scope ) ; break ; case FOR_IN : case FOR_OF : case FOR_AWAIT_OF : traverseEnhancedFor ( n , scope ) ; break ; case LET : case CONST : case VAR : // for - loop cases are handled by custom traversal methods .
checkState ( NodeUtil . isStatement ( n ) ) ; traverseDeclarationStatement ( n , scope ) ; break ; case INSTANCEOF : traverseInstanceof ( n , scope ) ; break ; case NAME : // The only cases that should reach this point are parameter declarations and references
// to names . The name node does not have children in these cases .
checkState ( ! n . hasChildren ( ) ) ; // the parameter declaration is not a read of the name
if ( ! parent . isParamList ( ) ) { // var | let | const name ;
// are handled at a higher level .
checkState ( ! NodeUtil . isNameDeclaration ( parent ) ) ; // function name ( ) { }
// class name ( ) { }
// handled at a higher level
checkState ( ! ( ( parent . isFunction ( ) || parent . isClass ( ) ) && parent . getFirstChild ( ) == n ) ) ; traverseNameNode ( n , scope ) . markAsReferenced ( ) ; } break ; case GETPROP : traverseGetProp ( n , scope ) ; break ; default : traverseChildren ( n , scope ) ; break ; } |
public class GlobalMetadata { /** * Set an arbitrary file - level metadata key */
public void setFileMetadata ( String file , String key , Object val ) { } } | throwIfImmutable ( ) ; Map < String , Object > fileKeys = fileLevel . get ( file ) ; if ( fileKeys == null ) { fileKeys = new ConcurrentHashMap < > ( ) ; fileLevel . put ( file , fileKeys ) ; } fileKeys . put ( key , val ) ; cachedId = null ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link EllipsoidType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link EllipsoidType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "Ellipsoid" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "Definition" ) public JAXBElement < EllipsoidType > createEllipsoid ( EllipsoidType value ) { } } | return new JAXBElement < EllipsoidType > ( _Ellipsoid_QNAME , EllipsoidType . class , null , value ) ; |
public class AndroidGraphics { /** * Registers a font with the graphics system .
* @ param path the path to the font resource ( relative to the asset manager ' s path prefix ) .
* @ param name the name under which to register the font .
* @ param style the style variant of the specified name provided by the font file . For example
* one might { @ code registerFont ( " myfont . ttf " , " My Font " , Font . Style . PLAIN ) } and
* { @ code registerFont ( " myfontb . ttf " , " My Font " , Font . Style . BOLD ) } to provide both the plain and
* bold variants of a particular font .
* @ param ligatureGlyphs any known text sequences that are converted into a single ligature
* character in this font . This works around an Android bug where measuring text for wrapping
* that contains character sequences that are converted into ligatures ( e . g . " fi " or " ae " )
* incorrectly reports the number of characters " consumed " from the to - be - wrapped string . */
public void registerFont ( String path , String name , Font . Style style , String ... ligatureGlyphs ) { } } | try { registerFont ( platform . assets ( ) . getTypeface ( path ) , name , style , ligatureGlyphs ) ; } catch ( Exception e ) { platform . reportError ( "Failed to load font [name=" + name + ", path=" + path + "]" , e ) ; } |
public class X509CertImpl { /** * Gets the extension identified by the given ObjectIdentifier
* @ param oid the Object Identifier value for the extension .
* @ return Extension or null if certificate does not contain this
* extension */
public Extension getExtension ( ObjectIdentifier oid ) { } } | if ( info == null ) { return null ; } try { CertificateExtensions extensions ; try { extensions = ( CertificateExtensions ) info . get ( CertificateExtensions . NAME ) ; } catch ( CertificateException ce ) { return null ; } if ( extensions == null ) { return null ; } else { Extension ex = extensions . getExtension ( oid . toString ( ) ) ; if ( ex != null ) { return ex ; } for ( Extension ex2 : extensions . getAllExtensions ( ) ) { if ( ex2 . getExtensionId ( ) . equals ( ( Object ) oid ) ) { // XXXX May want to consider cloning this
return ex2 ; } } /* no such extension in this certificate */
return null ; } } catch ( IOException ioe ) { return null ; } |
public class EntityCacheHelper { /** * 查询并缓存结果 ( 默认缓存一天 )
* @ param entityClass 实体类class ( 用户组装实际的缓存key )
* @ param key 缓存的key ( 和entityClass一起组成真实的缓存key 。 < br > 如entityClass = UserEntity . class , key = findlist , 实际的key为 : UserEntity . findlist )
* @ param dataCaller 缓存不存在数据加载源
* @ return */
public static < T > T queryTryCache ( Class < ? extends BaseEntity > entityClass , String key , Callable < T > dataCaller ) { } } | return queryTryCache ( entityClass , key , CacheHandler . defaultCacheExpire , dataCaller ) ; |
public class Resolver { /** * Resolves a BelTerm , as a { @ link String } , to an equivalent
* { @ link KamNode } in the { @ link Kam } .
* @ param kam { @ link Kam } , the KAM to resolve against
* @ param kAMStore { @ link KAMStore } , the KAM store to use in resolving the
* bel term expression
* @ param belTerm { @ link String } , the BelTerm string , which cannot be null
* or the empty string
* @ return the resolved { @ link KamNode } for the BelTerm , or null if one
* could not be found
* @ throws InvalidArgument Thrown when a parameter is { @ code null }
* @ throws ResolverException Thrown if an error occurred resolving the
* BelTerm ; exceptions will be wrapped */
public KamNode resolve ( final Kam kam , final KAMStore kAMStore , final String belTerm , Map < String , String > nsmap , Equivalencer equivalencer ) throws ResolverException { } } | if ( nulls ( kam , kAMStore , belTerm , nsmap , equivalencer ) ) { throw new InvalidArgument ( "null parameter(s) provided to resolve API." ) ; } try { // algorithm :
// - parse the bel term
// - get all parameters ; remap to kam namespace by prefix
// - convert bel term to string replacing each parameter with ' # '
// - get uuid for each parameter ; ordered by sequence ( l to r )
// - ( x ) if no match , attempt non - equivalence query
// - find kam node by term signature / uuids
// parse the bel term
Term term = null ; try { term = BELParser . parseTerm ( belTerm ) ; if ( term == null ) return null ; } catch ( Exception e ) { // unrecognized BEL structure
return null ; } // get all parameters ; remap to kam namespace by prefix
List < Parameter > params = term . getAllParametersLeftToRight ( ) ; remapNamespace ( params , nsmap ) ; // convert bel term to signature
String termSignature = term . toTermSignature ( ) ; // find uuids for all parameters ; bucket both the mapped and
// unmapped namespace values
SkinnyUUID [ ] uuids = new SkinnyUUID [ params . size ( ) ] ; Parameter [ ] parray = params . toArray ( new Parameter [ params . size ( ) ] ) ; boolean missing = false ; for ( int i = 0 ; i < parray . length ; i ++ ) { Parameter param = parray [ i ] ; Namespace ns = param . getNamespace ( ) ; if ( ns == null ) { missing = true ; break ; } String value = clean ( param . getValue ( ) ) ; SkinnyUUID uuid = null ; try { uuid = equivalencer . getUUID ( ns , value ) ; } catch ( EquivalencerException e ) { throw new ResolverException ( e ) ; } if ( uuid != null && ! kAMStore . getKamNodes ( kam , uuid ) . isEmpty ( ) ) { uuids [ i ] = uuid ; } else { missing = true ; break ; } } // TODO Handle terms that may not have UUID parameters !
if ( missing ) { KamNode kamNode = kAMStore . getKamNode ( kam , belTerm ) ; return kamNode ; } // find kam node by term signature / uuids
return kAMStore . getKamNodeForTerm ( kam , termSignature , term . getFunctionEnum ( ) , uuids ) ; } catch ( KAMStoreException e ) { throw new ResolverException ( e ) ; } |
public class SearchSkillGroupsResult { /** * The skill groups that meet the filter criteria , in sort order .
* @ param skillGroups
* The skill groups that meet the filter criteria , in sort order . */
public void setSkillGroups ( java . util . Collection < SkillGroupData > skillGroups ) { } } | if ( skillGroups == null ) { this . skillGroups = null ; return ; } this . skillGroups = new java . util . ArrayList < SkillGroupData > ( skillGroups ) ; |
public class BootstrapConfig { /** * Add properties from source to target if the target map does not
* already contain a property with that value . When a new attribute
* is discovered , System properties are checked to see if an override
* has been specified . If the property is present as a System property
* ( from the command line or jvm . options ) , that value is used instead
* of bootstrap . properties .
* @ param source The source properties file ( bootstrap . properties or include )
* @ param target The target map */
protected void addMissingProperties ( Properties source , Map < String , String > target ) { } } | if ( source == null || source . isEmpty ( ) || target == null ) return ; // only add " new " properties ( first value wins )
for ( String key : source . stringPropertyNames ( ) ) { if ( ! target . containsKey ( key ) && key . length ( ) > 0 ) { // Check for a System property override first .
String value = System . getProperty ( key ) ; if ( value == null ) { value = source . getProperty ( key ) ; } // store the value in the target map
target . put ( key , value ) ; } } |
public class KeyValuePairTokenizer { /** * decoding part */
public void initToken ( String token ) { } } | values . clear ( ) ; if ( token == null ) return ; String [ ] parts = token . split ( "&" ) ; for ( int i = 0 ; i < parts . length ; i ++ ) { String [ ] sub = parts [ i ] . split ( "=" ) ; if ( sub . length < 1 ) continue ; String name = sub [ 0 ] ; String value = "" ; if ( sub . length >= 2 ) value = sub [ 1 ] ; values . put ( name , value ) ; } String chksum = values . get ( "z" ) ; if ( ! chksum . equals ( chk ( ) ) ) { Window . alert ( "Invalid link checksum " + chksum + " / " + chk ( ) ) ; values . clear ( ) ; } |
public class Modification { /** * Writes this modification to the { @ link ByteBuf } .
* @ param byteBuf the { @ link ByteBuf } to write to .
* @ param codec the { @ link Codec } to use . */
public void writeTo ( ByteBuf byteBuf , Codec codec ) { } } | writeArray ( byteBuf , key ) ; byteBuf . writeByte ( control ) ; if ( ! ControlByte . NON_EXISTING . hasFlag ( control ) && ! ControlByte . NOT_READ . hasFlag ( control ) ) { byteBuf . writeLong ( versionRead ) ; } if ( ControlByte . REMOVE_OP . hasFlag ( control ) ) { return ; } codec . writeExpirationParams ( byteBuf , lifespan , lifespanTimeUnit , maxIdle , maxIdleTimeUnit ) ; writeArray ( byteBuf , value ) ; |
public class DestinationUrl { /** * Creates an instance of an connection URL based on an destination string . In case that the destination string does
* not match the form HOST ? QUEUE | | TOPIC an IllegalArgumentException is thrown . */
public static DestinationUrl createDestinationUrl ( String destination ) { } } | String [ ] split = splitDestination ( destination ) ; String host = split [ 0 ] . trim ( ) ; String jmsDestination = split [ 1 ] . trim ( ) ; return new DestinationUrl ( host , jmsDestination ) ; |
public class PublicIPAddressesInner { /** * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set .
* @ param resourceGroupName The name of the resource group .
* @ param virtualMachineScaleSetName The name of the virtual machine scale set .
* @ param virtualmachineIndex The virtual machine index .
* @ param networkInterfaceName The network interface name .
* @ param ipConfigurationName The IP configuration name .
* @ 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 < List < PublicIPAddressInner > > listVirtualMachineScaleSetVMPublicIPAddressesAsync ( final String resourceGroupName , final String virtualMachineScaleSetName , final String virtualmachineIndex , final String networkInterfaceName , final String ipConfigurationName , final ListOperationCallback < PublicIPAddressInner > serviceCallback ) { } } | return AzureServiceFuture . fromPageResponse ( listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync ( resourceGroupName , virtualMachineScaleSetName , virtualmachineIndex , networkInterfaceName , ipConfigurationName ) , new Func1 < String , Observable < ServiceResponse < Page < PublicIPAddressInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < PublicIPAddressInner > > > call ( String nextPageLink ) { return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ; |
public class AbstractCLA { /** * { @ inheritDoc } */
@ Override public Enum < ? > [ ] asEnumArray ( final String _name , final Object [ ] _possibleConstants ) throws ParseException { } } | // should not be called .
throw new ParseException ( "invalid to store " + this . toString ( ) + " in an Enum[]" , 0 ) ; |
public class JsAdminServiceImpl { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . admin . JsAdminService # getMessagingEngine ( java . lang . String , java . lang . String ) */
public JsMessagingEngine getMessagingEngine ( String busName , String engine ) { } } | if ( ! isInitialized ( ) ) { return null ; } return _jsmain . getMessagingEngine ( busName , engine ) ; |
public class TiffReader { /** * Read the IFDs contained in the Tiff file . */
private void readIFDs ( ) { } } | int offset0 = 0 ; try { // The pointer to the first IFD is located in bytes 4-7
offset0 = data . readLong ( 4 ) . toInt ( ) ; tiffModel . setFirstIFDOffset ( offset0 ) ; if ( offset0 == 0 ) validation . addErrorLoc ( "There is no first IFD" , "Header" ) ; else if ( offset0 > data . size ( ) ) validation . addErrorLoc ( "Incorrect offset" , "Header" ) ; } catch ( Exception ex ) { validation . addErrorLoc ( "IO exception" , "Header" ) ; } if ( validation . isCorrect ( ) ) { int nifd = 1 ; try { IfdReader ifd0 = readIFD ( offset0 , true , 0 ) ; HashSet < Integer > usedOffsets = new HashSet < Integer > ( ) ; usedOffsets . add ( offset0 ) ; if ( ifd0 . getIfd ( ) == null ) { validation . addErrorLoc ( "Parsing error in first IFD" , "IFD" + 0 ) ; } else { IFD iifd = ifd0 . getIfd ( ) ; iifd . setNextOffset ( ifd0 . getNextIfdOffset ( ) ) ; tiffModel . addIfd0 ( iifd ) ; IfdReader current_ifd = ifd0 ; // Read next IFDs
boolean stop = false ; while ( current_ifd . getNextIfdOffset ( ) > 0 && ! stop ) { if ( usedOffsets . contains ( current_ifd . getNextIfdOffset ( ) ) ) { // Circular reference
validation . addErrorLoc ( "IFD offset already used" , "IFD" + nifd ) ; stop = true ; } else if ( current_ifd . getNextIfdOffset ( ) > data . size ( ) ) { validation . addErrorLoc ( "Incorrect offset" , "IFD" + nifd ) ; stop = true ; } else { usedOffsets . add ( current_ifd . getNextIfdOffset ( ) ) ; IfdReader next_ifd = readIFD ( current_ifd . getNextIfdOffset ( ) , true , nifd ) ; if ( next_ifd == null ) { validation . addErrorLoc ( "Parsing error in IFD " + nifd , "IFD" + nifd ) ; stop = true ; } else { iifd = next_ifd . getIfd ( ) ; iifd . setNextOffset ( next_ifd . getNextIfdOffset ( ) ) ; current_ifd . getIfd ( ) . setNextIFD ( iifd ) ; current_ifd = next_ifd ; } nifd ++ ; } } } } catch ( Exception ex ) { validation . addErrorLoc ( "IFD parsing error" , "IFD" + nifd ) ; } try { tiffModel . createMetadataDictionary ( ) ; } catch ( Exception ex ) { } } |
public class GenerateCryptoKeysCommand { /** * Generate key .
* @ param keySize the key size */
@ ShellMethod ( key = "generate-key" , value = "Generate signing/encryption crypto keys for CAS settings" ) public void generateKey ( @ ShellOption ( value = { } } | "key-size" } , defaultValue = "256" , help = "Key size" ) final int keySize ) { LOGGER . info ( EncodingUtils . generateJsonWebKey ( keySize ) ) ; |
public class ListDevicePoolsResult { /** * Information about the device pools .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setDevicePools ( java . util . Collection ) } or { @ link # withDevicePools ( java . util . Collection ) } if you want to
* override the existing values .
* @ param devicePools
* Information about the device pools .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListDevicePoolsResult withDevicePools ( DevicePool ... devicePools ) { } } | if ( this . devicePools == null ) { setDevicePools ( new java . util . ArrayList < DevicePool > ( devicePools . length ) ) ; } for ( DevicePool ele : devicePools ) { this . devicePools . add ( ele ) ; } return this ; |
public class RandomVariableDifferentiableAD { /** * Binary operators : checking for return type priority . */
@ Override public RandomVariable add ( RandomVariable randomVariable ) { } } | if ( randomVariable . getTypePriority ( ) > this . getTypePriority ( ) ) { // Check type priority
return randomVariable . add ( this ) ; } return new RandomVariableDifferentiableAD ( getValues ( ) . add ( randomVariable . getValues ( ) ) , Arrays . asList ( this , randomVariable ) , OperatorType . ADD ) ; |
public class OpenTSDBMain { /** * Reads the pid from the specified pid file
* @ param pidFile The pid file to read from
* @ return The read pid or possibly null / blank if failed to read */
private static Long getPid ( File pidFile ) { } } | FileReader reader = null ; BufferedReader lineReader = null ; String pidLine = null ; try { reader = new FileReader ( pidFile ) ; lineReader = new BufferedReader ( reader ) ; pidLine = lineReader . readLine ( ) ; if ( pidLine != null ) { pidLine = pidLine . trim ( ) ; } } catch ( Exception ex ) { log . error ( "Failed to read PID from file [" + pidFile . getAbsolutePath ( ) + "]" , ex ) ; } finally { if ( reader != null ) try { reader . close ( ) ; } catch ( Exception ex ) { /* No Op */
} } try { return Long . parseLong ( pidLine ) ; } catch ( Exception ex ) { return null ; } |
public class CellMaskedMatrix { /** * { @ inheritDoc } */
public double get ( int row , int col ) { } } | row = getIndexFromMap ( rowMaskMap , row ) ; col = getIndexFromMap ( colMaskMap , col ) ; return matrix . get ( row , col ) ; |
public class CSSPageRuleImpl { /** * { @ inheritDoc } */
@ Override public String getCssText ( ) { } } | final StringBuilder sb = new StringBuilder ( ) ; final String sel = getSelectorText ( ) ; sb . append ( "@page " ) . append ( sel ) ; if ( sel . length ( ) > 0 ) { sb . append ( " " ) ; } sb . append ( "{" ) ; final CSSStyleDeclarationImpl style = getStyle ( ) ; if ( null != style ) { sb . append ( style . getCssText ( ) ) ; } sb . append ( "}" ) ; return sb . toString ( ) ; |
public class MetricsCacheManager { /** * Construct all required command line options */
private static Options constructOptions ( ) { } } | Options options = new Options ( ) ; Option cluster = Option . builder ( "c" ) . desc ( "Cluster name in which the topology needs to run on" ) . longOpt ( "cluster" ) . hasArgs ( ) . argName ( "cluster" ) . required ( ) . build ( ) ; Option role = Option . builder ( "r" ) . desc ( "Role under which the topology needs to run" ) . longOpt ( "role" ) . hasArgs ( ) . argName ( "role" ) . required ( ) . build ( ) ; Option environment = Option . builder ( "e" ) . desc ( "Environment under which the topology needs to run" ) . longOpt ( "environment" ) . hasArgs ( ) . argName ( "environment" ) . required ( ) . build ( ) ; Option masterPort = Option . builder ( "m" ) . desc ( "Master port to accept the metric/exception messages from sinks" ) . longOpt ( "master_port" ) . hasArgs ( ) . argName ( "master port" ) . required ( ) . build ( ) ; Option statsPort = Option . builder ( "s" ) . desc ( "Stats port to respond the queries on metrics/exceptions" ) . longOpt ( "stats_port" ) . hasArgs ( ) . argName ( "stats port" ) . required ( ) . build ( ) ; Option systemConfig = Option . builder ( "y" ) . desc ( "System configuration file path" ) . longOpt ( "system_config_file" ) . hasArgs ( ) . argName ( "system config file" ) . build ( ) ; Option overrideConfig = Option . builder ( "o" ) . desc ( "Override configuration file path" ) . longOpt ( "override_config_file" ) . hasArgs ( ) . argName ( "override config file" ) . build ( ) ; Option sinkConfig = Option . builder ( "i" ) . desc ( "Sink configuration file path" ) . longOpt ( "sink_config_file" ) . hasArgs ( ) . argName ( "sink config file" ) . build ( ) ; Option topologyName = Option . builder ( "n" ) . desc ( "The topology name" ) . longOpt ( "topology_name" ) . hasArgs ( ) . argName ( "topology name" ) . required ( ) . build ( ) ; Option topologyId = Option . builder ( "t" ) . desc ( "The topology id" ) . longOpt ( "topology_id" ) . hasArgs ( ) . argName ( "topology id" ) . required ( ) . build ( ) ; Option metricsCacheId = Option . builder ( "r" ) . desc ( "The MetricsCache id" ) . longOpt ( "metricscache_id" ) . hasArgs ( ) . argName ( "metricscache id" ) . required ( ) . build ( ) ; Option verbose = Option . builder ( "v" ) . desc ( "Enable debug logs" ) . longOpt ( "verbose" ) . build ( ) ; options . addOption ( cluster ) ; options . addOption ( role ) ; options . addOption ( environment ) ; options . addOption ( masterPort ) ; options . addOption ( statsPort ) ; options . addOption ( systemConfig ) ; options . addOption ( overrideConfig ) ; options . addOption ( sinkConfig ) ; options . addOption ( topologyName ) ; options . addOption ( topologyId ) ; options . addOption ( metricsCacheId ) ; options . addOption ( verbose ) ; return options ; |
public class CreatePhoneCountryConstantsClass { /** * Instantiates a class via deferred binding .
* @ return the new instance , which must be cast to the requested class */
public static PhoneCountrySharedConstants create ( final Locale plocale ) { } } | if ( phoneCountryConstants == null ) { // NOPMD it ' s thread save !
synchronized ( PhoneCountryConstantsImpl . class ) { if ( phoneCountryConstants == null ) { phoneCountryConstants = createPhoneCountryConstants ( plocale ) ; } } } return phoneCountryConstants ; |
public class CmsContainerPageElementPanel { /** * Hides list collector direct edit buttons , if present . < p > */
public void hideEditableListButtons ( ) { } } | if ( m_editables != null ) { for ( CmsListCollectorEditor editor : m_editables . values ( ) ) { editor . getElement ( ) . getStyle ( ) . setDisplay ( Display . NONE ) ; } } |
public class CLI { /** * Execute a CLI command . This can be any command that you might execute on
* the CLI command line , including both server - side operations and local
* commands such as ' cd ' or ' cn ' .
* @ param cliCommand A CLI command .
* @ return A result object that provides all information about the execution
* of the command . */
public Result cmd ( String cliCommand ) { } } | try { // The intent here is to return a Response when this is doable .
if ( ctx . isWorkflowMode ( ) || ctx . isBatchMode ( ) ) { ctx . handle ( cliCommand ) ; return new Result ( cliCommand , ctx . getExitCode ( ) ) ; } handler . parse ( ctx . getCurrentNodePath ( ) , cliCommand , ctx ) ; if ( handler . getFormat ( ) == OperationFormat . INSTANCE ) { ModelNode request = ctx . buildRequest ( cliCommand ) ; ModelNode response = ctx . execute ( request , cliCommand ) ; return new Result ( cliCommand , request , response ) ; } else { ctx . handle ( cliCommand ) ; return new Result ( cliCommand , ctx . getExitCode ( ) ) ; } } catch ( CommandLineException cfe ) { throw new IllegalArgumentException ( "Error handling command: " + cliCommand , cfe ) ; } catch ( IOException ioe ) { throw new IllegalStateException ( "Unable to send command " + cliCommand + " to server." , ioe ) ; } |
public class EditText { /** * @ return the vertical offset of the shadow layer
* @ see # setShadowLayer ( float , float , float , int )
* @ attr ref android . R . styleable # TextView _ shadowDy */
@ TargetApi ( Build . VERSION_CODES . JELLY_BEAN ) public float getShadowDy ( ) { } } | if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) return mInputView . getShadowDy ( ) ; return 0 ; |
public class ArgumentDescriptor { /** * @ see XmlCapable # toXML ( ) */
public String toXML ( ) { } } | String eol = System . getProperty ( "line.separator" ) ; RepositoryTags tags = RepositoryTags . getInstance ( ) ; // The result
String result = " " ; switch ( this . fieldSource ) { case SOURCE_FIELD : result += " " + tags . getOpeningTagNonClosingById ( RUNTIME_ARGUMENT ) ; result += " " + tags . getAttribute ( FIELD_REF , this . fieldRefName ) ; result += " " + tags . getAttribute ( RETURN , String . valueOf ( this . returnedByProcedure ) ) ; result += "/>" ; break ; case SOURCE_VALUE : result += " " + tags . getOpeningTagNonClosingById ( CONSTANT_ARGUMENT ) ; result += " " + tags . getAttribute ( VALUE , this . constantValue ) ; result += "/>" ; break ; case SOURCE_NULL : result += " " + tags . getOpeningTagNonClosingById ( RUNTIME_ARGUMENT ) ; result += "/>" ; break ; default : break ; } // Return the result .
return ( result + eol ) ; |
public class StringUtils { /** * Extracts letters from the String value .
* @ param value the String value from which to extract letters .
* @ return only letters from the String value .
* @ throws NullPointerException if the String value is null .
* @ see java . lang . Character # isLetter ( char ) */
public static String getLetters ( String value ) { } } | StringBuilder letters = new StringBuilder ( value . length ( ) ) ; for ( char chr : value . toCharArray ( ) ) { if ( Character . isLetter ( chr ) ) { letters . append ( chr ) ; } } return letters . toString ( ) ; |
public class CaptionFormatMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CaptionFormat captionFormat , ProtocolMarshaller protocolMarshaller ) { } } | if ( captionFormat == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( captionFormat . getFormat ( ) , FORMAT_BINDING ) ; protocolMarshaller . marshall ( captionFormat . getPattern ( ) , PATTERN_BINDING ) ; protocolMarshaller . marshall ( captionFormat . getEncryption ( ) , ENCRYPTION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CNExpression { /** * 将数字转换为中文表示
* @ param num 数字
* @ return 数字的中文表示 */
public String num2Chn ( int num ) { } } | char s [ ] = new char [ 32 ] , ch ; int counter1 , counter2 ; int chr , preChr = - 1 ; int len = 0 ; boolean suffixZero = true ; counter1 = 0 ; counter2 = 0 ; while ( num > 0 ) { chr = num % 10 ; if ( chr != 0 ) { suffixZero = false ; if ( counter1 > 0 ) { s [ len ] = this . strUnit . charAt ( counter1 ) ; len ++ ; } if ( num / 10 != 0 || counter1 != 1 || chr != 1 ) { s [ len ] = this . strDigitOut . charAt ( chr ) ; len ++ ; } } else { if ( ! suffixZero ) if ( preChr != 0 ) { s [ len ] = this . strDigitOut . charAt ( chr ) ; len ++ ; } } num = num / 10 ; preChr = chr ; counter1 ++ ; if ( counter1 == 4 ) { counter1 = 0 ; counter2 ++ ; suffixZero = true ; if ( num % 10000 > 0 ) { s [ len ] = this . strUnit . charAt ( 3 + counter2 ) ; len ++ ; } } } for ( int i = 0 ; i < len / 2 ; i ++ ) { ch = s [ i ] ; s [ i ] = s [ len - i - 1 ] ; s [ len - i - 1 ] = ch ; } if ( len == 0 ) { s [ len ] = this . strDigitOut . charAt ( 0 ) ; len ++ ; } return new String ( s , 0 , len ) ; |
public class TableBucketReader { /** * Creates a new instance of the { @ link TableBucketReader } class that can read { @ link TableKey } instances .
* @ param segment A { @ link DirectSegmentAccess } that can be used to read from the Segment .
* @ param getBackpointer A Function that , when invoked with a { @ link DirectSegmentAccess } and an offset , will return
* a Backpointer originating at that offset , or - 1 if no such backpointer exists .
* @ param executor An Executor for async operations .
* @ return A new instance of the { @ link TableBucketReader } class . */
static TableBucketReader < TableKey > key ( @ NonNull DirectSegmentAccess segment , @ NonNull GetBackpointer getBackpointer , @ NonNull Executor executor ) { } } | return new TableBucketReader . Key ( segment , getBackpointer , executor ) ; |
public class SingleThreadEventExecutor { /** * Returns the { @ link ThreadProperties } of the { @ link Thread } that powers the { @ link SingleThreadEventExecutor } .
* If the { @ link SingleThreadEventExecutor } is not started yet , this operation will start it and block until
* it is fully started . */
public final ThreadProperties threadProperties ( ) { } } | ThreadProperties threadProperties = this . threadProperties ; if ( threadProperties == null ) { Thread thread = this . thread ; if ( thread == null ) { assert ! inEventLoop ( ) ; submit ( NOOP_TASK ) . syncUninterruptibly ( ) ; thread = this . thread ; assert thread != null ; } threadProperties = new DefaultThreadProperties ( thread ) ; if ( ! PROPERTIES_UPDATER . compareAndSet ( this , null , threadProperties ) ) { threadProperties = this . threadProperties ; } } return threadProperties ; |
public class SARLProjectConfigurator { /** * Read the configuration for the Compilation mojo .
* @ param request the request .
* @ param mojo the mojo execution .
* @ param monitor the monitor .
* @ return the configuration .
* @ throws CoreException error in the eCore configuration . */
private SARLConfiguration readCompileConfiguration ( ProjectConfigurationRequest request , MojoExecution mojo , IProgressMonitor monitor ) throws CoreException { } } | final SARLConfiguration config = new SARLConfiguration ( ) ; final MavenProject project = request . getMavenProject ( ) ; final File input = getParameterValue ( project , "input" , File . class , mojo , monitor ) ; // $ NON - NLS - 1 $
final File output = getParameterValue ( project , "output" , File . class , mojo , monitor ) ; // $ NON - NLS - 1 $
final File binOutput = getParameterValue ( project , "binOutput" , File . class , mojo , monitor ) ; // $ NON - NLS - 1 $
final File testInput = getParameterValue ( project , "testInput" , File . class , mojo , monitor ) ; // $ NON - NLS - 1 $
final File testOutput = getParameterValue ( project , "testOutput" , File . class , mojo , monitor ) ; // $ NON - NLS - 1 $
final File testBinOutput = getParameterValue ( project , "testBinOutput" , File . class , mojo , monitor ) ; // $ NON - NLS - 1 $
config . setInput ( input ) ; config . setOutput ( output ) ; config . setBinOutput ( binOutput ) ; config . setTestInput ( testInput ) ; config . setTestOutput ( testOutput ) ; config . setTestBinOutput ( testBinOutput ) ; final String inputCompliance = getParameterValue ( project , "source" , String . class , mojo , monitor ) ; // $ NON - NLS - 1 $
final String outputCompliance = getParameterValue ( project , "target" , String . class , mojo , monitor ) ; // $ NON - NLS - 1 $
config . setInputCompliance ( inputCompliance ) ; config . setOutputCompliance ( outputCompliance ) ; final String encoding = getParameterValue ( project , "encoding" , String . class , mojo , monitor ) ; // $ NON - NLS - 1 $
config . setEncoding ( encoding ) ; return config ; |
public class PanButtonCollection { /** * Apply the correct positions on all panning buttons , and render them . */
public void accept ( PainterVisitor visitor , Object group , Bbox bounds , boolean recursive ) { } } | // Apply position on all pan buttons :
applyPosition ( ) ; // Then render them :
map . getVectorContext ( ) . drawGroup ( group , this ) ; map . getVectorContext ( ) . drawImage ( this , background . getId ( ) , background . getHref ( ) , background . getBounds ( ) , ( PictureStyle ) background . getStyle ( ) ) ; north . accept ( visitor , group , bounds , recursive ) ; east . accept ( visitor , group , bounds , recursive ) ; south . accept ( visitor , group , bounds , recursive ) ; west . accept ( visitor , group , bounds , recursive ) ; |
public class HelloSignClient { /** * Retrieves the current user ' s signature requests . The resulting object
* represents a paged query result . The page information can be retrieved on
* from the ListInfo object on the SignatureRequestList .
* @ return SignatureRequestList
* @ throws HelloSignException thrown if there ' s a problem processing the
* HTTP request or the JSON response . */
public SignatureRequestList getSignatureRequests ( ) throws HelloSignException { } } | return new SignatureRequestList ( httpClient . withAuth ( auth ) . get ( BASE_URI + SIGNATURE_REQUEST_LIST_URI ) . asJson ( ) ) ; |
public class DRL6Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 747:1 : extends _ key : { . . . } ? = > id = ID ; */
public final void extends_key ( ) throws RecognitionException { } } | Token id = null ; try { // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 748:5 : ( { . . . } ? = > id = ID )
// src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 748:12 : { . . . } ? = > id = ID
{ if ( ! ( ( ( helper . validateIdentifierKey ( DroolsSoftKeywords . EXTENDS ) ) ) ) ) { if ( state . backtracking > 0 ) { state . failed = true ; return ; } throw new FailedPredicateException ( input , "extends_key" , "(helper.validateIdentifierKey(DroolsSoftKeywords.EXTENDS))" ) ; } id = ( Token ) match ( input , ID , FOLLOW_ID_in_extends_key4737 ) ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { helper . emit ( id , DroolsEditorType . KEYWORD ) ; } } } catch ( RecognitionException re ) { throw re ; } finally { // do for sure before leaving
} |
public class JsScopeUiDatePickerOnChangeEvent { /** * Creates a default { @ link JsScopeUiDatePickerOnChangeEvent } to execute the given
* statement .
* @ param jsStatement
* the JavaScript statement to execute with the scope .
* @ return the created { @ link JsScopeUiDatePickerOnChangeEvent } . */
public static JsScopeUiDatePickerOnChangeEvent quickScope ( final JsStatement jsStatement ) { } } | return new JsScopeUiDatePickerOnChangeEvent ( ) { private static final long serialVersionUID = 1L ; @ Override protected void execute ( JsScopeContext scopeContext ) { scopeContext . append ( jsStatement == null ? "" : jsStatement . render ( ) ) ; } } ; |
public class ModuleExtensionListProcessor { /** * { @ inheritDoc } */
public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } } | final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( Attachments . MODULE_SPECIFICATION ) ; final ModuleLoader moduleLoader = deploymentUnit . getAttachment ( Attachments . SERVICE_MODULE_LOADER ) ; final ServiceController < ? > controller = phaseContext . getServiceRegistry ( ) . getRequiredService ( Services . JBOSS_DEPLOYMENT_EXTENSION_INDEX ) ; final ExtensionIndex index = ( ExtensionIndex ) controller . getValue ( ) ; final List < ResourceRoot > allResourceRoots = DeploymentUtils . allResourceRoots ( deploymentUnit ) ; final Set < ServiceName > nextPhaseDeps = new HashSet < ServiceName > ( ) ; final Set < ModuleIdentifier > allExtensionListEntries = new LinkedHashSet < > ( ) ; for ( ResourceRoot resourceRoot : allResourceRoots ) { final AttachmentList < ExtensionListEntry > entries = resourceRoot . getAttachment ( Attachments . EXTENSION_LIST_ENTRIES ) ; if ( entries != null ) { for ( ExtensionListEntry entry : entries ) { final ModuleIdentifier extension = index . findExtension ( entry . getName ( ) , entry . getSpecificationVersion ( ) , entry . getImplementationVersion ( ) , entry . getImplementationVendorId ( ) ) ; if ( extension != null ) { allExtensionListEntries . add ( extension ) ; } else { ServerLogger . DEPLOYMENT_LOGGER . cannotFindExtensionListEntry ( entry , resourceRoot ) ; } } } } if ( deploymentUnit . getParent ( ) != null ) { // we also need to get all our parents extension list entries
for ( ResourceRoot resourceRoot : DeploymentUtils . allResourceRoots ( deploymentUnit . getParent ( ) ) ) { final AttachmentList < ExtensionListEntry > entries = resourceRoot . getAttachment ( Attachments . EXTENSION_LIST_ENTRIES ) ; if ( entries != null ) { for ( ExtensionListEntry entry : entries ) { final ModuleIdentifier extension = index . findExtension ( entry . getName ( ) , entry . getSpecificationVersion ( ) , entry . getImplementationVersion ( ) , entry . getImplementationVendorId ( ) ) ; if ( extension != null ) { allExtensionListEntries . add ( extension ) ; } // we don ' t log not found to prevent multiple messages
} } } } for ( ModuleIdentifier extension : allExtensionListEntries ) { ModuleDependency dependency = new ModuleDependency ( moduleLoader , extension , false , false , true , true ) ; dependency . addImportFilter ( PathFilters . getMetaInfSubdirectoriesFilter ( ) , true ) ; dependency . addImportFilter ( PathFilters . getMetaInfFilter ( ) , true ) ; moduleSpecification . addLocalDependency ( dependency ) ; nextPhaseDeps . add ( ServiceModuleLoader . moduleSpecServiceName ( extension ) ) ; } final List < AdditionalModuleSpecification > additionalModules = deploymentUnit . getAttachment ( Attachments . ADDITIONAL_MODULES ) ; if ( additionalModules != null ) { for ( AdditionalModuleSpecification additionalModule : additionalModules ) { for ( ResourceRoot resourceRoot : additionalModule . getResourceRoots ( ) ) { final AttachmentList < ExtensionListEntry > entries = resourceRoot . getAttachment ( Attachments . EXTENSION_LIST_ENTRIES ) ; if ( entries != null ) { for ( ExtensionListEntry entry : entries ) { final ModuleIdentifier extension = index . findExtension ( entry . getName ( ) , entry . getSpecificationVersion ( ) , entry . getImplementationVersion ( ) , entry . getImplementationVendorId ( ) ) ; if ( extension != null ) { moduleSpecification . addLocalDependency ( new ModuleDependency ( moduleLoader , extension , false , false , true , false ) ) ; nextPhaseDeps . add ( ServiceModuleLoader . moduleSpecServiceName ( extension ) ) ; } else { ServerLogger . DEPLOYMENT_LOGGER . cannotFindExtensionListEntry ( entry , resourceRoot ) ; } } } } } } for ( ServiceName dep : nextPhaseDeps ) { phaseContext . addToAttachmentList ( Attachments . NEXT_PHASE_DEPS , dep ) ; } |
public class LooseArtifactNotifier { /** * { @ inheritDoc } */
@ Override public synchronized boolean setNotificationOptions ( long interval , boolean useMBean ) { } } | for ( LooseArtifactNotifier childNotification : children . values ( ) ) { childNotification . setNotificationOptions ( interval , useMBean ) ; } Long compareInterval = Long . valueOf ( interval ) ; if ( compareInterval . equals ( this . interval ) && ( ( useMBean && FileMonitor . MONITOR_TYPE_EXTERNAL . equals ( this . notificationType ) ) || ( ! useMBean && FileMonitor . MONITOR_TYPE_TIMED . equals ( this . notificationType ) ) ) ) { return true ; } this . interval = compareInterval ; this . notificationType = useMBean ? FileMonitor . MONITOR_TYPE_EXTERNAL : FileMonitor . MONITOR_TYPE_TIMED ; // only issue the update if we have a service registered .
if ( this . service != null || this . nonRecurseService != null ) { updateFileMonitorService ( ) ; } return true ; |
public class CommerceDiscountPersistenceImpl { /** * Removes all the commerce discounts where expirationDate & lt ; & # 63 ; and status = & # 63 ; from the database .
* @ param expirationDate the expiration date
* @ param status the status */
@ Override public void removeByLtE_S ( Date expirationDate , int status ) { } } | for ( CommerceDiscount commerceDiscount : findByLtE_S ( expirationDate , status , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceDiscount ) ; } |
public class AWSIotClient { /** * Lists logging levels .
* @ param listV2LoggingLevelsRequest
* @ return Result of the ListV2LoggingLevels operation returned by the service .
* @ throws InternalException
* An unexpected error has occurred .
* @ throws NotConfiguredException
* The resource is not configured .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws ServiceUnavailableException
* The service is temporarily unavailable .
* @ sample AWSIot . ListV2LoggingLevels */
@ Override public ListV2LoggingLevelsResult listV2LoggingLevels ( ListV2LoggingLevelsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListV2LoggingLevels ( request ) ; |
public class ScriptRunner { /** * Invokes the specified < code > Task < / code > with the specified
* < code > TaskRequest < / code > and < code > TaskResponse < / code > and returns the
* < code > RETURN _ VALUE < / code > . Use this
* overload of the < code > evaluate < / code > method when you may need to
* pre - load information into both the < code > TaskRequest < / code > and
* the < code > TaskResponse < / code > .
* @ param k A fully - bootstrapped < code > Task < / code > object .
* @ param req A < code > TaskRequest < / code > prepared externally .
* @ param req A < code > TaskResponse < / code > prepared externally .
* @ return The < code > TaskResponse < / code > that results from invoking the
* specified task . */
public Object evaluate ( Task k , TaskRequest req , TaskResponse res ) { } } | ReturnValueImpl rslt = new ReturnValueImpl ( ) ; RuntimeRequestResponse tr = new RuntimeRequestResponse ( ) ; tr . enclose ( req ) ; tr . setAttribute ( Attributes . RETURN_VALUE , rslt ) ; run ( k , tr , res ) ; return rslt . getValue ( ) ; |
public class DomainService { /** * Checks if the charging station exists in the repository and if it has been registered and configured . If not a
* IllegalStateException will be thrown .
* @ param chargingStationId charging station identifier .
* @ return ChargingStation if the charging station exists and is registered and configured .
* @ throws IllegalStateException if the charging station does not exist in the repository , or it has not been
* registered and configured . */
private ChargingStation checkChargingStationExistsAndIsRegisteredAndConfigured ( ChargingStationId chargingStationId ) { } } | ChargingStation chargingStation = chargingStationRepository . findOne ( chargingStationId . getId ( ) ) ; if ( chargingStation == null ) { throw new IllegalStateException ( "Unknown charging station." ) ; } if ( ! chargingStation . isRegisteredAndConfigured ( ) ) { throw new IllegalStateException ( "Charging station has not been registered/configured." ) ; } return chargingStation ; |
public class EnhancerHelper { /** * Creates a new enhancer for the given class . If the class already implements
* { @ link JDBCPersistable } , then a special " no - op " enhancer will be returned that
* doesn ' t do any special enhancement . Otherwise , a byte - code enhancer is returned .
* @ param baseClass class for which to create an enhancer
* @ return new enhancer */
@ SuppressWarnings ( { } } | "unchecked" } ) public static < T > Enhancer < T > getJDBCPersistableEnhancer ( Class < T > baseClass ) { Enhancer < T > enhancer = ( Enhancer < T > ) jdbcPersistableEnhancers . get ( baseClass ) ; if ( enhancer == null ) { if ( JDBCPersistable . class . isAssignableFrom ( baseClass ) ) { enhancer = new NoOpEnhancer < T > ( baseClass ) ; } else { enhancer = new EntityVelocityEnhancer < T > ( baseClass ) { // Implementation - Enhancer
@ Override public boolean needsEnhancement ( Object object ) { return object != null && ! ( object instanceof JDBCPersistable ) ; } // Implementation - VelocityEnhancer
@ Override protected String getTemplateLocation ( ) { return "org/iternine/jeppetto/dao/jdbc/enhance/jdbcPersistable.vm" ; } } ; } jdbcPersistableEnhancers . put ( baseClass , enhancer ) ; } return enhancer ; |
public class ImageHolder { /** * decides which icon to apply or hide this view
* @ param imageHolder
* @ param imageView
* @ param iconColor
* @ param tint */
public static void applyDecidedIconOrSetGone ( ImageHolder imageHolder , ImageView imageView , int iconColor , boolean tint ) { } } | if ( imageHolder != null && imageView != null ) { Drawable drawable = ImageHolder . decideIcon ( imageHolder , imageView . getContext ( ) , iconColor , tint ) ; if ( drawable != null ) { imageView . setImageDrawable ( drawable ) ; imageView . setVisibility ( View . VISIBLE ) ; } else if ( imageHolder . getBitmap ( ) != null ) { imageView . setImageBitmap ( imageHolder . getBitmap ( ) ) ; imageView . setVisibility ( View . VISIBLE ) ; } else { imageView . setVisibility ( View . GONE ) ; } } else if ( imageView != null ) { imageView . setVisibility ( View . GONE ) ; } |
public class UpdateGameInfoApi { /** * 对外接口上传设备信息
* @ param gameInfo 设备信息 */
public long updateGameInfo ( GameInfo gameInfo ) { } } | HMSAgentLog . i ( "updateGameInfo:gameInfo=" + StrUtils . objDesc ( gameInfo ) ) ; HuaweiApiClient client = ApiClientMgr . INST . getApiClient ( ) ; if ( client == null || ! ApiClientMgr . INST . isConnect ( client ) ) { HMSAgentLog . e ( "client not connted" ) ; return CommonCode . ErrorCode . CLIENT_API_INVALID ; } return HuaweiGame . HuaweiGameApi . updateGameInfo ( client , gameInfo ) ; |
public class LocalDataCenterEndPointProvider { /** * Returns the current list of endPoints . Unlike { @ link # getEndPoints ( ) } the host discovery is queried and a new
* list of endPoints is generated on every call . */
private ImmutableList < EndPoint > getEndPointsFromHostDiscovery ( ) { } } | Iterable < ServiceEndPoint > hosts = _hostDiscovery . getHosts ( ) ; ImmutableList . Builder < EndPoint > endPoints = ImmutableList . builder ( ) ; for ( final ServiceEndPoint host : hosts ) { if ( host . equals ( _self ) ) { continue ; } endPoints . add ( new EndPoint ( ) { @ Override public String getAddress ( ) { return _endPointAdapter . toEndPointAddress ( host ) ; } @ Override public boolean isValid ( ) { return Iterables . contains ( _hostDiscovery . getHosts ( ) , host ) ; } } ) ; } return endPoints . build ( ) ; |
public class SnorocketOWLReasoner { /** * A convenience method that determines if the specified class expression is
* satisfiable with respect to the reasoner axioms .
* @ param classExpression
* The class expression
* @ return < code > true < / code > if classExpression is satisfiable with respect
* to the set of axioms , or < code > false < / code > if classExpression is
* unsatisfiable with respect to the axioms .
* @ throws InconsistentOntologyException
* if the set of reasoner axioms is inconsistent
* @ throws ClassExpressionNotInProfileException
* if < code > classExpression < / code > is not within the profile
* that is supported by this reasoner .
* @ throws FreshEntitiesException
* if the signature of the classExpression is not contained
* within the signature of the set of reasoner axioms .
* @ throws ReasonerInterruptedException
* if the reasoning process was interrupted for any particular
* reason ( for example if reasoning was cancelled by a client
* process )
* @ throws TimeOutException
* if the reasoner timed out during a basic reasoning operation .
* See { @ link # getTimeOut ( ) } . */
@ Override public boolean isSatisfiable ( OWLClassExpression classExpression ) throws ReasonerInterruptedException , TimeOutException , ClassExpressionNotInProfileException , FreshEntitiesException , InconsistentOntologyException { } } | if ( classExpression . isAnonymous ( ) ) { return false ; } else { // If the node that contains OWLNothing contains this OWLClass then
// it is not satisfiable
Object id = getId ( classExpression . asOWLClass ( ) ) ; au . csiro . ontology . Node bottom = getTaxonomy ( ) . getBottomNode ( ) ; return ! bottom . getEquivalentConcepts ( ) . contains ( id ) ; } |
public class EnvironmentCheck { /** * Report version info from DOM interfaces .
* Currently distinguishes between pre - DOM level 2 , the DOM
* level 2 working draft , the DOM level 2 final draft ,
* and not found .
* @ param h Hashtable to put information in */
protected void checkDOMVersion ( Hashtable h ) { } } | if ( null == h ) h = new Hashtable ( ) ; final String DOM_LEVEL2_CLASS = "org.w3c.dom.Document" ; final String DOM_LEVEL2_METHOD = "createElementNS" ; // String , String
final String DOM_LEVEL2WD_CLASS = "org.w3c.dom.Node" ; final String DOM_LEVEL2WD_METHOD = "supported" ; // String , String
final String DOM_LEVEL2FD_CLASS = "org.w3c.dom.Node" ; final String DOM_LEVEL2FD_METHOD = "isSupported" ; // String , String
final Class twoStringArgs [ ] = { java . lang . String . class , java . lang . String . class } ; try { Class clazz = ObjectFactory . findProviderClass ( DOM_LEVEL2_CLASS , ObjectFactory . findClassLoader ( ) , true ) ; Method method = clazz . getMethod ( DOM_LEVEL2_METHOD , twoStringArgs ) ; // If we succeeded , we have loaded interfaces from a
// level 2 DOM somewhere
h . put ( VERSION + "DOM" , "2.0" ) ; try { // Check for the working draft version , which is
// commonly found , but won ' t work anymore
clazz = ObjectFactory . findProviderClass ( DOM_LEVEL2WD_CLASS , ObjectFactory . findClassLoader ( ) , true ) ; method = clazz . getMethod ( DOM_LEVEL2WD_METHOD , twoStringArgs ) ; h . put ( ERROR + VERSION + "DOM.draftlevel" , "2.0wd" ) ; h . put ( ERROR , ERROR_FOUND ) ; } catch ( Exception e2 ) { try { // Check for the final draft version as well
clazz = ObjectFactory . findProviderClass ( DOM_LEVEL2FD_CLASS , ObjectFactory . findClassLoader ( ) , true ) ; method = clazz . getMethod ( DOM_LEVEL2FD_METHOD , twoStringArgs ) ; h . put ( VERSION + "DOM.draftlevel" , "2.0fd" ) ; } catch ( Exception e3 ) { h . put ( ERROR + VERSION + "DOM.draftlevel" , "2.0unknown" ) ; h . put ( ERROR , ERROR_FOUND ) ; } } } catch ( Exception e ) { h . put ( ERROR + VERSION + "DOM" , "ERROR attempting to load DOM level 2 class: " + e . toString ( ) ) ; h . put ( ERROR , ERROR_FOUND ) ; } // @ todo load an actual DOM implmementation and query it as well
// @ todo load an actual DOM implmementation and check if
// isNamespaceAware ( ) = = true , which is needed to parse
// xsl stylesheet files into a DOM |
public class ConstraintSolver { /** * Get option value for this { @ link ConstraintSolver } .
* @ param op The option to get ( see { @ link OPTIONS } ) .
* @ return < code > true < / code > iff the given option is set . */
public boolean getOption ( OPTIONS op ) { } } | if ( op . equals ( OPTIONS . AUTO_PROPAGATE ) ) return autoprop ; else if ( op . equals ( OPTIONS . NO_PROP_ON_VAR_CREATION ) ) return noPropOnVarCreation ; else if ( op . equals ( OPTIONS . MANUAL_PROPAGATE ) ) return ! autoprop ; else if ( op . equals ( OPTIONS . DOMAINS_AUTO_INSTANTIATED ) ) return domainsAutoInstantiated ; else if ( op . equals ( OPTIONS . DOMAINS_MANUALLY_INSTANTIATED ) ) return ! domainsAutoInstantiated ; return false ; |
public class DecimalFormat { /** * Appends an affix pattern to the given StringBuffer , quoting special
* characters as needed . Uses the internal affix pattern , if that exists ,
* or the literal affix , if the internal affix pattern is null . The
* appended string will generate the same affix pattern ( or literal affix )
* when passed to toPattern ( ) .
* @ param buffer the affix string is appended to this
* @ param affixPattern a pattern such as posPrefixPattern ; may be null
* @ param expAffix a corresponding expanded affix , such as positivePrefix .
* Ignored unless affixPattern is null . If affixPattern is null , then
* expAffix is appended as a literal affix .
* @ param localized true if the appended pattern should contain localized
* pattern characters ; otherwise , non - localized pattern chars are appended */
private void appendAffix ( StringBuffer buffer , String affixPattern , String expAffix , boolean localized ) { } } | if ( affixPattern == null ) { appendAffix ( buffer , expAffix , localized ) ; } else { int i ; for ( int pos = 0 ; pos < affixPattern . length ( ) ; pos = i ) { i = affixPattern . indexOf ( QUOTE , pos ) ; if ( i < 0 ) { appendAffix ( buffer , affixPattern . substring ( pos ) , localized ) ; break ; } if ( i > pos ) { appendAffix ( buffer , affixPattern . substring ( pos , i ) , localized ) ; } char c = affixPattern . charAt ( ++ i ) ; ++ i ; if ( c == QUOTE ) { buffer . append ( c ) ; // Fall through and append another QUOTE below
} else if ( c == CURRENCY_SIGN && i < affixPattern . length ( ) && affixPattern . charAt ( i ) == CURRENCY_SIGN ) { ++ i ; buffer . append ( c ) ; // Fall through and append another CURRENCY _ SIGN below
} else if ( localized ) { switch ( c ) { case PATTERN_PERCENT : c = symbols . getPercent ( ) ; break ; case PATTERN_PER_MILLE : c = symbols . getPerMill ( ) ; break ; case PATTERN_MINUS : c = symbols . getMinusSign ( ) ; break ; } } buffer . append ( c ) ; } } |
public class SocketBindingJBossASClient { /** * Sets the port number for the named socket binding found in the named socket binding group .
* @ param socketBindingGroupName the name of the socket binding group that has the named socket binding
* @ param socketBindingName the name of the socket binding whose port is to be set
* @ param port the new port number
* @ throws Exception any error */
public void setSocketBindingPort ( String socketBindingGroupName , String socketBindingName , int port ) throws Exception { } } | setSocketBindingPortExpression ( socketBindingGroupName , socketBindingName , null , port ) ; |
public class GetTraceGraphRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetTraceGraphRequest getTraceGraphRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getTraceGraphRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getTraceGraphRequest . getTraceIds ( ) , TRACEIDS_BINDING ) ; protocolMarshaller . marshall ( getTraceGraphRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CalendarFormatterBase { /** * Format the quarter based on the month . */
void formatQuarter ( StringBuilder b , ZonedDateTime d , int width , FieldVariants quarters ) { } } | int quarter = ( d . getMonth ( ) . getValue ( ) - 1 ) / 3 ; switch ( width ) { case 5 : b . append ( quarters . narrow [ quarter ] ) ; break ; case 4 : b . append ( quarters . wide [ quarter ] ) ; break ; case 3 : b . append ( quarters . abbreviated [ quarter ] ) ; break ; case 2 : b . append ( '0' ) ; // fall through
case 1 : b . append ( quarter + 1 ) ; break ; } |
public class DnsTextEndpointGroupBuilder { /** * Returns a newly created { @ link DnsTextEndpointGroup } . */
public DnsTextEndpointGroup build ( ) { } } | return new DnsTextEndpointGroup ( eventLoop ( ) , minTtl ( ) , maxTtl ( ) , serverAddressStreamProvider ( ) , backoff ( ) , hostname ( ) , mapping ) ; |
public class AbstractInstance { /** * Creates or returns the RPC stub object for the instance ' s task manager .
* @ return the RPC stub object for the instance ' s task manager
* @ throws IOException
* thrown if the RPC stub object for the task manager cannot be created */
private TaskOperationProtocol getTaskManagerProxy ( ) throws IOException { } } | if ( this . taskManager == null ) { this . taskManager = RPC . getProxy ( TaskOperationProtocol . class , new InetSocketAddress ( getInstanceConnectionInfo ( ) . address ( ) , getInstanceConnectionInfo ( ) . ipcPort ( ) ) , NetUtils . getSocketFactory ( ) ) ; } return this . taskManager ; |
public class CPFriendlyURLEntryUtil { /** * Returns the first cp friendly url entry in the ordered set where groupId = & # 63 ; and classNameId = & # 63 ; and urlTitle = & # 63 ; .
* @ param groupId the group ID
* @ param classNameId the class name ID
* @ param urlTitle the url title
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching cp friendly url entry
* @ throws NoSuchCPFriendlyURLEntryException if a matching cp friendly url entry could not be found */
public static CPFriendlyURLEntry findByG_C_U_First ( long groupId , long classNameId , String urlTitle , OrderByComparator < CPFriendlyURLEntry > orderByComparator ) throws com . liferay . commerce . product . exception . NoSuchCPFriendlyURLEntryException { } } | return getPersistence ( ) . findByG_C_U_First ( groupId , classNameId , urlTitle , orderByComparator ) ; |
public class HeaderConverter { /** * { @ inheritDoc } */
@ Override public Header convert ( XBELHeader source ) { } } | if ( source == null ) return null ; String name = source . getName ( ) ; String description = source . getDescription ( ) ; String version = source . getVersion ( ) ; // Destination type
Header dest = new Header ( name , description , version ) ; if ( source . isSetAuthorGroup ( ) ) { List < String > author = source . getAuthorGroup ( ) . getAuthor ( ) ; dest . setAuthors ( author ) ; } if ( source . isSetLicenseGroup ( ) ) { List < String > license = source . getLicenseGroup ( ) . getLicense ( ) ; dest . setLicenses ( license ) ; } String copyright = source . getCopyright ( ) ; dest . setCopyright ( copyright ) ; String disclaimer = source . getDisclaimer ( ) ; dest . setDisclaimer ( disclaimer ) ; String contactInfo = source . getContactInfo ( ) ; dest . setContactInfo ( contactInfo ) ; return dest ; |
public class AesUtils { /** * AES / CBC / PKCS5Padding Decryption
* @ param inputStream input stream to be decrypted
* @ param key valid AES key sizes are 128 , 192 , or 256 bits ( 16 , 24 , or 32 bytes ) .
* @ param iv AES initialization vector . Must be the same size as the key .
* @ return decrypted input stream */
public static InputStream decrypt ( InputStream inputStream , byte [ ] key , byte [ ] iv ) { } } | checkNotNull ( inputStream ) ; checkNotNull ( key ) ; checkNotNull ( iv ) ; checkArgument ( key . length == iv . length ) ; AESFastEngine aesEngine = new AESFastEngine ( ) ; PaddedBufferedBlockCipher cipher = new PaddedBufferedBlockCipher ( new CBCBlockCipher ( aesEngine ) , new PKCS7Padding ( ) ) ; cipher . init ( false , new ParametersWithIV ( new KeyParameter ( key ) , iv ) ) ; return new CipherInputStream ( inputStream , cipher ) ; |
public class DataSourceMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DataSource dataSource , ProtocolMarshaller protocolMarshaller ) { } } | if ( dataSource == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( dataSource . getS3DataSource ( ) , S3DATASOURCE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class GBIMGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . GBIMG__XPOS : setXPOS ( ( Integer ) newValue ) ; return ; case AfplibPackage . GBIMG__YPOS : setYPOS ( ( Integer ) newValue ) ; return ; case AfplibPackage . GBIMG__FORMAT : setFORMAT ( ( Integer ) newValue ) ; return ; case AfplibPackage . GBIMG__RES : setRES ( ( Integer ) newValue ) ; return ; case AfplibPackage . GBIMG__WIDTH : setWIDTH ( ( Integer ) newValue ) ; return ; case AfplibPackage . GBIMG__HEIGHT : setHEIGHT ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class MediatingAdditionalDescriptors { /** * / * ( non - Javadoc )
* @ see org . jasig . services . persondir . support . IAdditionalDescriptors # setAttributes ( java . util . Map ) */
@ Override public void setAttributes ( final Map < String , List < Object > > attributes ) { } } | for ( final IAdditionalDescriptors additionalDescriptors : delegateDescriptors ) { additionalDescriptors . setAttributes ( attributes ) ; } |
public class ApiOvhIp { /** * Get statistics about the email traffic
* REST : GET / ip / { ip } / spam / { ipSpamming } / stats
* @ param from [ required ] Start date
* @ param to [ required ] End date
* @ param ip [ required ]
* @ param ipSpamming [ required ] IP address which is sending spam */
public ArrayList < OvhSpamStats > ip_spam_ipSpamming_stats_GET ( String ip , String ipSpamming , Date from , Date to ) throws IOException { } } | String qPath = "/ip/{ip}/spam/{ipSpamming}/stats" ; StringBuilder sb = path ( qPath , ip , ipSpamming ) ; query ( sb , "from" , from ) ; query ( sb , "to" , to ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; |
public class Service { /** * The current state of deployments for the service .
* @ return The current state of deployments for the service . */
public java . util . List < Deployment > getDeployments ( ) { } } | if ( deployments == null ) { deployments = new com . amazonaws . internal . SdkInternalList < Deployment > ( ) ; } return deployments ; |
public class MultiColumnText { /** * Add a simple rectangular column with specified left
* and right x position boundaries .
* @ param left left boundary
* @ param right right boundary */
public void addSimpleColumn ( float left , float right ) { } } | ColumnDef newCol = new ColumnDef ( left , right ) ; columnDefs . add ( newCol ) ; |
public class FacesBackingBean { /** * Store this object in the user session , in the appropriate place . Used by the framework ; normally should not be
* called directly . */
public void persistInSession ( HttpServletRequest request , HttpServletResponse response ) { } } | StorageHandler sh = Handlers . get ( getServletContext ( ) ) . getStorageHandler ( ) ; HttpServletRequest unwrappedRequest = PageFlowUtils . unwrapMultipart ( request ) ; RequestContext rc = new RequestContext ( unwrappedRequest , null ) ; String attrName = ScopedServletUtils . getScopedSessionAttrName ( InternalConstants . FACES_BACKING_ATTR , unwrappedRequest ) ; sh . setAttribute ( rc , attrName , this ) ; |
public class CellValue { /** * Converts a value to a CellValue
* @ param type a hint
* @ param o the value
* @ return the CellValue */
public static CellValue fromTypeAndObject ( final TableCell . Type type , final Object o ) { } } | // TODO : use the type hint , with a switch . . .
return CellValue . fromObject ( o ) ; |
public class SnowflakeChunkDownloader { /** * Create a pool of downloader threads .
* @ param threadNamePrefix name of threads in pool
* @ param parallel number of thread in pool
* @ return new thread pool */
private static ThreadPoolExecutor createChunkDownloaderExecutorService ( final String threadNamePrefix , final int parallel ) { } } | ThreadFactory threadFactory = new ThreadFactory ( ) { private int threadCount = 1 ; public Thread newThread ( final Runnable r ) { final Thread thread = new Thread ( r ) ; thread . setName ( threadNamePrefix + threadCount ++ ) ; thread . setUncaughtExceptionHandler ( new Thread . UncaughtExceptionHandler ( ) { public void uncaughtException ( Thread t , Throwable e ) { logger . error ( "uncaughtException in thread: " + t + " {}" , e ) ; } } ) ; thread . setDaemon ( true ) ; return thread ; } } ; return ( ThreadPoolExecutor ) Executors . newFixedThreadPool ( parallel , threadFactory ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CnType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "cn" ) public JAXBElement < CnType > createCn ( CnType value ) { } } | return new JAXBElement < CnType > ( _Cn_QNAME , CnType . class , null , value ) ; |
public class EmptyMemoryRecord { /** * Set up the screen input fields . */
public void setupFields ( ) { } } | FieldInfo field = null ; field = new FieldInfo ( this , ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Integer . class ) ; |
public class XARMojo { /** * Adds the contents of a specific directory to a queue of files .
* @ param fileQueue the queue of files
* @ param sourceDir the directory to be scanned */
private static void addContentsToQueue ( Queue < File > fileQueue , File sourceDir ) throws MojoExecutionException { } } | File [ ] files = sourceDir . listFiles ( ) ; if ( files != null ) { for ( File currentFile : files ) { fileQueue . add ( currentFile ) ; } } else { throw new MojoExecutionException ( String . format ( "Couldn't get list of files in source dir [%s]" , sourceDir ) ) ; } |
public class Service { public static void main ( String [ ] arg ) { } } | String opt ; opt = System . getProperty ( "SERVICE_OUT" ) ; if ( opt != null ) { try { PrintStream stdout = new PrintStream ( new FileOutputStream ( opt ) ) ; System . setOut ( stdout ) ; } catch ( Exception e ) { log . warn ( LogSupport . EXCEPTION , e ) ; } } opt = System . getProperty ( "SERVICE_ERR" ) ; if ( opt != null ) { try { PrintStream stderr = new PrintStream ( new FileOutputStream ( opt ) ) ; System . setErr ( stderr ) ; } catch ( Exception e ) { log . warn ( LogSupport . EXCEPTION , e ) ; } } if ( arg . length == 0 ) arg = new String [ ] { "etc/jetty.xml" } ; try { _configs = new Vector ( ) ; for ( int i = 0 ; i < arg . length ; i ++ ) _configs . add ( arg [ i ] ) ; createAll ( ) ; startAll ( ) ; } catch ( Exception e ) { log . warn ( LogSupport . EXCEPTION , e ) ; } |
public class SdkClientBuilder { /** * Specify proxy credentials .
* @ param user user
* @ param password password
* @ return current client builder */
public SdkClientBuilder proxyCredentials ( String user , String password ) { } } | this . proxyCredentials = new UsernamePasswordCredentials ( user , password ) ; return this ; |
public class ExpressionUtil { /** * Undo the effects of the combine ( List < AbstractExpression > exps ) method to reconstruct the list
* of expressions in its original order , basically right - to - left in the given expression tree .
* NOTE : This implementation is tuned to the odd shape of the trees produced by combine ,
* namely leaf - nodes - on - the - right " ( ( ( D and C ) and B ) and A ) " from " [ A , B , C , D ] " .
* Any change there should have a corresponding change here .
* @ param expr
* @ return */
public static List < AbstractExpression > uncombinePredicate ( AbstractExpression expr ) { } } | if ( expr == null ) { return new ArrayList < AbstractExpression > ( ) ; } if ( expr instanceof ConjunctionExpression ) { ConjunctionExpression conj = ( ConjunctionExpression ) expr ; if ( conj . getExpressionType ( ) == ExpressionType . CONJUNCTION_AND ) { // Calculate the list for the tree or leaf on the left .
List < AbstractExpression > branch = uncombinePredicate ( conj . getLeft ( ) ) ; // Insert the leaf on the right at the head of that list
branch . add ( 0 , conj . getRight ( ) ) ; return branch ; } // Any other kind of conjunction must have been a leaf . Fall through .
} // At the left - most leaf , start a new list .
List < AbstractExpression > leaf = new ArrayList < AbstractExpression > ( ) ; leaf . add ( expr ) ; return leaf ; |
public class FunctionMap { /** * loadFunctionMap loads an initial function map .
* @ return the constructor of FunctionMap . */
public static FunctionMap loadFunctionMap ( ) { } } | FunctionMap fm = new FunctionMap ( ) ; fm . fm = new HashMap < > ( ) ; fm . addFunction ( "keyMatch" , new KeyMatchFunc ( ) ) ; fm . addFunction ( "keyMatch2" , new KeyMatch2Func ( ) ) ; fm . addFunction ( "regexMatch" , new RegexMatchFunc ( ) ) ; fm . addFunction ( "ipMatch" , new IPMatchFunc ( ) ) ; return fm ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.