signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Shape { /** * Returns true if the given array * is meant for the whole dimension * @ param arr the array to test * @ return true if arr . length = = 1 & & arr [ 0 ] is Integer . MAX _ VALUE */ public static boolean wholeArrayDimension ( int ... arr ) { } }
return arr == null || arr . length == 0 || ( arr . length == 1 && arr [ 0 ] == Integer . MAX_VALUE ) ;
public class CharSkippingBufferedString { /** * Converts the current window into byte buffer to a { @ link BufferedString } . The resulting new instance of { @ link BufferedString } * is backed by a newly allocated byte [ ] buffer sized exactly to fit the desired string represented by current buffer window , * excluding the skipped characters . * @ return An instance of { @ link BufferedString } containing only bytes from the original window , without skipped bytes . */ public BufferedString toBufferedString ( ) { } }
if ( _skipped . length == 0 ) return _bufferedString ; byte [ ] buf = MemoryManager . malloc1 ( _bufferedString . _len - _skipped . length ) ; // Length of the buffer window minus skipped chars int copyStart = _bufferedString . _off ; int target = 0 ; for ( int skippedIndex : _skipped ) { for ( int i = copyStart ; i < skippedIndex ; i ++ ) { buf [ target ++ ] = _bufferedString . _buf [ i ] ; } copyStart = skippedIndex + 1 ; } int windowEnd = _bufferedString . _off + _bufferedString . _len ; for ( int i = copyStart ; i < windowEnd ; i ++ ) { buf [ target ++ ] = _bufferedString . _buf [ i ] ; } assert target == buf . length ; return new BufferedString ( buf , 0 , buf . length ) ;
public class QueryUtil { /** * Crafts a regular expression for scanning over data table rows and filtering * time series that the user doesn ' t want . At least one of the parameters * must be set and have values . * NOTE : This method will sort the group bys . * @ param group _ bys An optional list of tag keys that we want to group on . May * be null . * @ param row _ key _ literals An optional list of key value pairs to filter on . * May be null . * @ return A regular expression string to pass to the storage layer . */ public static String getRowKeyUIDRegex ( final List < byte [ ] > group_bys , final ByteMap < byte [ ] [ ] > row_key_literals ) { } }
return getRowKeyUIDRegex ( group_bys , row_key_literals , false , null , null ) ;
public class MongoDBDataAccess { /** * queries with the given string , sorts the result and returns the first element . < code > null < / code > is returned if no element is found . * @ param query the query string * @ param sort the sort string * @ param params the parameters to replace # symbols * @ return the first element found or < code > null < / code > if none is found */ public final Optional < T > findFirstByQuery ( String query , String sort , Object ... params ) { } }
Find find = this . collection . find ( query , params ) ; if ( ( sort != null ) && ! sort . isEmpty ( ) ) { find . sort ( sort ) ; } Iterable < T > as = find . limit ( 1 ) . as ( this . entityClass ) ; Iterator < T > iterator = as . iterator ( ) ; if ( iterator . hasNext ( ) ) { return Optional . of ( iterator . next ( ) ) ; } return Optional . empty ( ) ;
public class ComputerVisionImpl { /** * This operation recognizes content within an image by applying a domain - specific model . The list of domain - specific models that are supported by the Computer Vision API can be retrieved using the / models GET request . Currently , the API only provides a single domain - specific model : celebrities . Two input methods are supported - - ( 1 ) Uploading an image or ( 2 ) specifying an image URL . A successful response will be returned in JSON . If the request failed , the response will contain an error code and a message to help understand what went wrong . * @ param model The domain - specific content to recognize . * @ param url Publicly reachable URL of an image * @ param analyzeImageByDomainOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ComputerVisionErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the DomainModelResults object if successful . */ public DomainModelResults analyzeImageByDomain ( String model , String url , AnalyzeImageByDomainOptionalParameter analyzeImageByDomainOptionalParameter ) { } }
return analyzeImageByDomainWithServiceResponseAsync ( model , url , analyzeImageByDomainOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class PostNameBuilder { /** * { @ inheritDoc } */ @ Override public PostName buildObject ( String namespaceURI , String localName , String namespacePrefix ) { } }
return new PostNameImpl ( namespaceURI , localName , namespacePrefix ) ;
public class UaaAuthorizationEndpoint { /** * This method handles / oauth / authorize calls when user is not logged in and the prompt = none param is used */ @ Override public void commence ( HttpServletRequest request , HttpServletResponse response , AuthenticationException authException ) throws IOException , ServletException { } }
String clientId = request . getParameter ( OAuth2Utils . CLIENT_ID ) ; String redirectUri = request . getParameter ( OAuth2Utils . REDIRECT_URI ) ; String [ ] responseTypes = ofNullable ( request . getParameter ( OAuth2Utils . RESPONSE_TYPE ) ) . map ( rt -> rt . split ( " " ) ) . orElse ( new String [ 0 ] ) ; ClientDetails client ; try { client = getClientServiceExtention ( ) . loadClientByClientId ( clientId , IdentityZoneHolder . get ( ) . getId ( ) ) ; } catch ( ClientRegistrationException e ) { logger . debug ( "[prompt=none] Unable to look up client for client_id=" + clientId , e ) ; response . setStatus ( HttpStatus . BAD_REQUEST . value ( ) ) ; return ; } Set < String > redirectUris = ofNullable ( client . getRegisteredRedirectUri ( ) ) . orElse ( EMPTY_SET ) ; // if the client doesn ' t have a redirect uri set , the parameter is required . if ( redirectUris . size ( ) == 0 && ! hasText ( redirectUri ) ) { logger . debug ( "[prompt=none] Missing redirect_uri" ) ; response . setStatus ( HttpStatus . BAD_REQUEST . value ( ) ) ; return ; } String resolvedRedirect ; try { resolvedRedirect = redirectResolver . resolveRedirect ( redirectUri , client ) ; } catch ( RedirectMismatchException rme ) { logger . debug ( "[prompt=none] Invalid redirect " + redirectUri + " did not match one of the registered values" ) ; response . setStatus ( HttpStatus . BAD_REQUEST . value ( ) ) ; return ; } HttpHost httpHost = URIUtils . extractHost ( URI . create ( resolvedRedirect ) ) ; String sessionState = openIdSessionStateCalculator . calculate ( "" , clientId , httpHost . toURI ( ) ) ; boolean implicit = stream ( responseTypes ) . noneMatch ( "code" :: equalsIgnoreCase ) ; String redirectLocation ; String errorCode = authException instanceof InteractionRequiredException ? "interaction_required" : "login_required" ; if ( implicit ) { redirectLocation = addFragmentComponent ( resolvedRedirect , "error=" + errorCode ) ; redirectLocation = addFragmentComponent ( redirectLocation , "session_state=" + sessionState ) ; } else { redirectLocation = addQueryParameter ( resolvedRedirect , "error" , errorCode ) ; redirectLocation = addQueryParameter ( redirectLocation , "session_state" , sessionState ) ; } response . sendRedirect ( redirectLocation ) ;
public class RubberLoaderView { /** * Sets loader prime and extra color . * @ param primeId Prime color resId * @ param extraId Extra color resId */ public void setPaletteRes ( @ ColorRes int primeId , @ ColorRes int extraId ) { } }
this . primeColor = ContextCompat . getColor ( getContext ( ) , primeId ) ; this . extraColor = ContextCompat . getColor ( getContext ( ) , extraId ) ; pathPaint . setColor ( primeColor ) ; gradient = null ;
public class MtasSolrComponentList { /** * ( non - Javadoc ) * @ see * mtas . solr . handler . component . util . MtasSolrComponent # modifyRequest ( org . apache * . solr . handler . component . ResponseBuilder , * org . apache . solr . handler . component . SearchComponent , * org . apache . solr . handler . component . ShardRequest ) */ public void modifyRequest ( ResponseBuilder rb , SearchComponent who , ShardRequest sreq ) { } }
if ( sreq . params . getBool ( MtasSolrSearchComponent . PARAM_MTAS , false ) && sreq . params . getBool ( PARAM_MTAS_LIST , false ) ) { // compute keys Set < String > keys = MtasSolrResultUtil . getIdsFromParameters ( rb . req . getParams ( ) , PARAM_MTAS_LIST ) ; if ( ( sreq . purpose & ShardRequest . PURPOSE_GET_TOP_IDS ) != 0 ) { for ( String key : keys ) { sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_PREFIX ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_START ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_NUMBER ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_LEFT ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_RIGHT ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_OUTPUT ) ; // don ' t get data sreq . params . add ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_NUMBER , "0" ) ; } } else { sreq . params . remove ( PARAM_MTAS_LIST ) ; for ( String key : keys ) { sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_FIELD ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_QUERY_VALUE ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_QUERY_TYPE ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_QUERY_PREFIX ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_QUERY_IGNORE ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_QUERY_MAXIMUM_IGNORE_LENGTH ) ; Set < String > subKeys = MtasSolrResultUtil . getIdsFromParameters ( rb . req . getParams ( ) , PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_QUERY_VARIABLE ) ; for ( String subKey : subKeys ) { sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_QUERY_VARIABLE + "." + subKey + "." + SUBNAME_MTAS_LIST_QUERY_VARIABLE_NAME ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_QUERY_VARIABLE + "." + subKey + "." + SUBNAME_MTAS_LIST_QUERY_VARIABLE_VALUE ) ; } sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_KEY ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_PREFIX ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_START ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_NUMBER ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_LEFT ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_RIGHT ) ; sreq . params . remove ( PARAM_MTAS_LIST + "." + key + "." + NAME_MTAS_LIST_OUTPUT ) ; } } }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ResourcesType } { @ code > } } */ @ XmlElementDecl ( namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os" , name = "Resources" ) public JAXBElement < ResourcesType > createResources ( ResourcesType value ) { } }
return new JAXBElement < ResourcesType > ( _Resources_QNAME , ResourcesType . class , null , value ) ;
public class AttributeMappingRepositoryImpl { /** * Returns attributes for the source attribute names in the given entity . Ignores attribute names * for which no attribute exists in the source entity type due to ( see * https : / / github . com / molgenis / molgenis / issues / 8051 ) . * < p > package - private for testability */ List < Attribute > getAlgorithmSourceAttributes ( Entity attributeMappingEntity , EntityType sourceEntityType ) { } }
List < Attribute > attributes ; String sourceAttributesString = attributeMappingEntity . getString ( SOURCE_ATTRIBUTES ) ; if ( sourceAttributesString != null ) { attributes = new ArrayList < > ( ) ; for ( String sourceAttributeStr : sourceAttributesString . split ( "," ) ) { Attribute sourceAttribute = sourceEntityType . getAttribute ( sourceAttributeStr ) ; if ( sourceAttribute != null ) { attributes . add ( sourceAttribute ) ; } } } else { attributes = emptyList ( ) ; } return attributes ;
public class AttributeDataset { /** * Returns a dataset with selected columns . */ public AttributeDataset columns ( String ... cols ) { } }
Attribute [ ] attrs = new Attribute [ cols . length ] ; int [ ] index = new int [ cols . length ] ; for ( int k = 0 ; k < cols . length ; k ++ ) { for ( int j = 0 ; j < attributes . length ; j ++ ) { if ( attributes [ j ] . getName ( ) . equals ( cols [ k ] ) ) { index [ k ] = j ; attrs [ k ] = attributes [ j ] ; break ; } } if ( attrs [ k ] == null ) { throw new IllegalArgumentException ( "Unknown column: " + cols [ k ] ) ; } } AttributeDataset sub = new AttributeDataset ( name , attrs , response ) ; for ( Datum < double [ ] > datum : data ) { double [ ] x = new double [ index . length ] ; for ( int i = 0 ; i < x . length ; i ++ ) { x [ i ] = datum . x [ index [ i ] ] ; } Row row = response == null ? sub . add ( x ) : sub . add ( x , datum . y ) ; row . name = datum . name ; row . weight = datum . weight ; row . description = datum . description ; row . timestamp = datum . timestamp ; } return sub ;
public class FrameManager { /** * Initializes this frame manager and prepares it for operation . */ protected void init ( ManagedRoot root , MediaTimer timer ) { } }
_window = root . getWindow ( ) ; _root = root ; _root . init ( this ) ; _timer = timer ; // set up our custom repaint manager _repainter = new ActiveRepaintManager ( ( _root instanceof Component ) ? ( Component ) _root : _window ) ; RepaintManager . setCurrentManager ( _repainter ) ; // turn off double buffering for the whole business because we handle repaints _repainter . setDoubleBufferingEnabled ( false ) ;
public class CmsImportVersion5 { /** * Reads all file nodes plus their meta - information ( properties , ACL ) * from the < code > manifest . xml < / code > and imports them as Cms resources to the VFS . < p > * @ throws CmsImportExportException if something goes wrong */ @ SuppressWarnings ( "unchecked" ) protected void readResourcesFromManifest ( ) throws CmsImportExportException { } }
String source = null , destination = null , uuidstructure = null , uuidresource = null , userlastmodified = null , usercreated = null , flags = null , timestamp = null ; long datelastmodified = 0 , datecreated = 0 , datereleased = 0 , dateexpired = 0 ; List < Node > fileNodes = null , acentryNodes = null ; Element currentElement = null , currentEntry = null ; List < CmsProperty > properties = null ; // get list of immutable resources List < String > immutableResources = OpenCms . getImportExportManager ( ) . getImmutableResources ( ) ; if ( immutableResources == null ) { immutableResources = Collections . emptyList ( ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IMPORTEXPORT_IMMUTABLE_RESOURCES_SIZE_1 , Integer . toString ( immutableResources . size ( ) ) ) ) ; } // get list of ignored properties List < String > ignoredProperties = OpenCms . getImportExportManager ( ) . getIgnoredProperties ( ) ; if ( ignoredProperties == null ) { ignoredProperties = Collections . emptyList ( ) ; } // get the desired page type for imported pages m_convertToXmlPage = OpenCms . getImportExportManager ( ) . convertToXmlPage ( ) ; try { // get all file - nodes fileNodes = m_docXml . selectNodes ( "//" + A_CmsImport . N_FILE ) ; int importSize = fileNodes . size ( ) ; // walk through all files in manifest for ( int i = 0 ; i < fileNodes . size ( ) ; i ++ ) { m_report . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_SUCCESSION_2 , String . valueOf ( i + 1 ) , String . valueOf ( importSize ) ) , I_CmsReport . FORMAT_NOTE ) ; currentElement = ( Element ) fileNodes . get ( i ) ; // < source > source = getChildElementTextValue ( currentElement , A_CmsImport . N_SOURCE ) ; // < destination > destination = getChildElementTextValue ( currentElement , A_CmsImport . N_DESTINATION ) ; // < type > String typeName = getChildElementTextValue ( currentElement , A_CmsImport . N_TYPE ) ; I_CmsResourceType type ; try { type = OpenCms . getResourceManager ( ) . getResourceType ( typeName ) ; } catch ( CmsLoaderException e ) { int plainId ; try { plainId = OpenCms . getResourceManager ( ) . getResourceType ( CmsResourceTypePlain . getStaticTypeName ( ) ) . getTypeId ( ) ; } catch ( CmsLoaderException e1 ) { // this should really never happen plainId = CmsResourceTypePlain . getStaticTypeId ( ) ; } type = OpenCms . getResourceManager ( ) . getResourceType ( plainId ) ; } // < uuidstructure > uuidstructure = getChildElementTextValue ( currentElement , A_CmsImport . N_UUIDSTRUCTURE ) ; // < uuidresource > if ( ! type . isFolder ( ) ) { uuidresource = getChildElementTextValue ( currentElement , A_CmsImport . N_UUIDRESOURCE ) ; } else { uuidresource = null ; } // < datelastmodified > timestamp = getChildElementTextValue ( currentElement , A_CmsImport . N_DATELASTMODIFIED ) ; if ( timestamp != null ) { datelastmodified = convertTimestamp ( timestamp ) ; } else { datelastmodified = System . currentTimeMillis ( ) ; } // < userlastmodified > userlastmodified = getChildElementTextValue ( currentElement , A_CmsImport . N_USERLASTMODIFIED ) ; userlastmodified = OpenCms . getImportExportManager ( ) . translateUser ( userlastmodified ) ; // < datecreated > timestamp = getChildElementTextValue ( currentElement , A_CmsImport . N_DATECREATED ) ; if ( timestamp != null ) { datecreated = convertTimestamp ( timestamp ) ; } else { datecreated = System . currentTimeMillis ( ) ; } // < usercreated > usercreated = getChildElementTextValue ( currentElement , A_CmsImport . N_USERCREATED ) ; usercreated = OpenCms . getImportExportManager ( ) . translateUser ( usercreated ) ; // < datereleased > timestamp = getChildElementTextValue ( currentElement , A_CmsImport . N_DATERELEASED ) ; if ( timestamp != null ) { datereleased = convertTimestamp ( timestamp ) ; } else { datereleased = CmsResource . DATE_RELEASED_DEFAULT ; } // < dateexpired > timestamp = getChildElementTextValue ( currentElement , A_CmsImport . N_DATEEXPIRED ) ; if ( timestamp != null ) { dateexpired = convertTimestamp ( timestamp ) ; } else { dateexpired = CmsResource . DATE_EXPIRED_DEFAULT ; } // < flags > flags = getChildElementTextValue ( currentElement , A_CmsImport . N_FLAGS ) ; // apply name translation and import path String translatedName = m_cms . getRequestContext ( ) . addSiteRoot ( m_importPath + destination ) ; if ( type . isFolder ( ) ) { // ensure folders end with a " / " if ( ! CmsResource . isFolder ( translatedName ) ) { translatedName += "/" ; } } // check if this resource is immutable boolean resourceNotImmutable = checkImmutable ( translatedName , immutableResources ) ; translatedName = m_cms . getRequestContext ( ) . removeSiteRoot ( translatedName ) ; // if the resource is not immutable and not on the exclude list , import it if ( resourceNotImmutable ) { // print out the information to the report m_report . print ( Messages . get ( ) . container ( Messages . RPT_IMPORTING_0 ) , I_CmsReport . FORMAT_NOTE ) ; m_report . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_ARGUMENT_1 , translatedName ) ) ; m_report . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_DOTS_0 ) ) ; // get all properties properties = readPropertiesFromManifest ( currentElement , ignoredProperties ) ; boolean exists = m_cms . existsResource ( translatedName , CmsResourceFilter . ALL ) ; // import the resource CmsResource res = importResource ( source , translatedName , type , uuidstructure , uuidresource , datelastmodified , userlastmodified , datecreated , usercreated , datereleased , dateexpired , flags , properties ) ; if ( res != null ) { // only set permissions if the resource did not exists or if the keep permissions flag is not set if ( ! exists || ! m_keepPermissions ) { // if the resource was imported add the access control entries if available List < CmsAccessControlEntry > aceList = new ArrayList < CmsAccessControlEntry > ( ) ; // write all imported access control entries for this file acentryNodes = currentElement . selectNodes ( "*/" + A_CmsImport . N_ACCESSCONTROL_ENTRY ) ; // collect all access control entries for ( int j = 0 ; j < acentryNodes . size ( ) ; j ++ ) { currentEntry = ( Element ) acentryNodes . get ( j ) ; // get the data of the access control entry String id = getChildElementTextValue ( currentEntry , A_CmsImport . N_ACCESSCONTROL_PRINCIPAL ) ; String principalId = new CmsUUID ( ) . toString ( ) ; String principal = id . substring ( id . indexOf ( '.' ) + 1 , id . length ( ) ) ; try { if ( id . startsWith ( I_CmsPrincipal . PRINCIPAL_GROUP ) ) { principal = OpenCms . getImportExportManager ( ) . translateGroup ( principal ) ; principalId = m_cms . readGroup ( principal ) . getId ( ) . toString ( ) ; } else if ( id . startsWith ( I_CmsPrincipal . PRINCIPAL_USER ) ) { principal = OpenCms . getImportExportManager ( ) . translateUser ( principal ) ; principalId = m_cms . readUser ( principal ) . getId ( ) . toString ( ) ; } else if ( id . startsWith ( CmsRole . PRINCIPAL_ROLE ) ) { principalId = CmsRole . valueOfRoleName ( principal ) . getId ( ) . toString ( ) ; } else if ( id . equalsIgnoreCase ( CmsAccessControlEntry . PRINCIPAL_ALL_OTHERS_NAME ) ) { principalId = CmsAccessControlEntry . PRINCIPAL_ALL_OTHERS_ID . toString ( ) ; } else if ( id . equalsIgnoreCase ( CmsAccessControlEntry . PRINCIPAL_OVERWRITE_ALL_NAME ) ) { principalId = CmsAccessControlEntry . PRINCIPAL_OVERWRITE_ALL_ID . toString ( ) ; } else { if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IMPORTEXPORT_ERROR_IMPORTING_ACE_1 , id ) ) ; } } String acflags = getChildElementTextValue ( currentEntry , A_CmsImport . N_FLAGS ) ; String allowed = ( ( Element ) currentEntry . selectNodes ( "./" + A_CmsImport . N_ACCESSCONTROL_PERMISSIONSET + "/" + A_CmsImport . N_ACCESSCONTROL_ALLOWEDPERMISSIONS ) . get ( 0 ) ) . getTextTrim ( ) ; String denied = ( ( Element ) currentEntry . selectNodes ( "./" + A_CmsImport . N_ACCESSCONTROL_PERMISSIONSET + "/" + A_CmsImport . N_ACCESSCONTROL_DENIEDPERMISSIONS ) . get ( 0 ) ) . getTextTrim ( ) ; // add the entry to the list aceList . add ( getImportAccessControlEntry ( res , principalId , allowed , denied , acflags ) ) ; } catch ( CmsException e ) { // user or group of ACE might not exist in target system , ignore ACE if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IMPORTEXPORT_ERROR_IMPORTING_ACE_1 , translatedName ) , e ) ; } m_report . println ( e ) ; m_report . addError ( e ) ; } } importAccessControlEntries ( res , aceList ) ; } // Add the relations for the resource importRelations ( res , currentElement ) ; if ( OpenCms . getResourceManager ( ) . getResourceType ( res . getTypeId ( ) ) instanceof I_CmsLinkParseable ) { // store for later use m_parseables . add ( res ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IMPORTING_4 , new Object [ ] { String . valueOf ( i + 1 ) , String . valueOf ( importSize ) , translatedName , destination } ) ) ; } } else { // resource import failed , since no CmsResource was created m_report . print ( Messages . get ( ) . container ( Messages . RPT_SKIPPING_0 ) , I_CmsReport . FORMAT_NOTE ) ; m_report . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_ARGUMENT_1 , translatedName ) ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SKIPPING_3 , String . valueOf ( i + 1 ) , String . valueOf ( importSize ) , translatedName ) ) ; } } } else { // skip the file import , just print out the information to the report m_report . print ( Messages . get ( ) . container ( Messages . RPT_SKIPPING_0 ) , I_CmsReport . FORMAT_NOTE ) ; m_report . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_ARGUMENT_1 , translatedName ) ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SKIPPING_3 , String . valueOf ( i + 1 ) , String . valueOf ( importSize ) , translatedName ) ) ; } } } } catch ( Exception e ) { m_report . println ( e ) ; m_report . addError ( e ) ; CmsMessageContainer message = Messages . get ( ) . container ( Messages . ERR_IMPORTEXPORT_ERROR_IMPORTING_RESOURCES_0 ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( message . key ( ) , e ) ; } throw new CmsImportExportException ( message , e ) ; }
public class GenJsCodeVisitor { /** * Implementations for specific nodes . */ @ Override protected void visitSoyFileSetNode ( SoyFileSetNode node ) { } }
for ( SoyFileNode soyFile : node . getChildren ( ) ) { visit ( soyFile ) ; }
public class LineSegmentPath { /** * Computes the velocity at which the pathable will need to travel along this path such that * it will arrive at the destination in approximately the specified number of milliseconds . * Efforts are taken to get the pathable there as close to the desired time as possible , but * framerate variation may prevent it from arriving exactly on time . */ public void setDuration ( long millis ) { } }
// if we have only zero or one nodes , we don ' t have enough // information to compute our velocity int ncount = _nodes . size ( ) ; if ( ncount < 2 ) { log . warning ( "Requested to set duration of bogus path" , "path" , this , "duration" , millis ) ; return ; } // compute the total distance along our path float distance = 0 ; PathNode start = _nodes . get ( 0 ) ; for ( int ii = 1 ; ii < ncount ; ii ++ ) { PathNode end = _nodes . get ( ii ) ; distance += MathUtil . distance ( start . loc . x , start . loc . y , end . loc . x , end . loc . y ) ; start = end ; } // set the velocity accordingly setVelocity ( distance / millis ) ;
public class UserAPI { /** * 批量获取用户基本信息 * @ param access _ token access _ token * @ param langzh - CN * @ param openids 最多支持一次拉取100条 * @ return UserInfoList */ public static UserInfoList userInfoBatchget ( String access_token , String lang , List < String > openids ) { } }
return userInfoBatchget ( access_token , lang , openids , 0 ) ;
public class AbstractMessage { /** * / * ( non - Javadoc ) * @ see javax . jms . Message # setFloatProperty ( java . lang . String , float ) */ @ Override public final void setFloatProperty ( String name , float value ) throws JMSException { } }
setProperty ( name , new Float ( value ) ) ;
public class UUIDUtils { /** * Convert byte array into UUID . Byte array is a compact form of bits in UUID * @ param bytes Byte array to convert from * @ return UUID result */ public static UUID fromBytes ( byte [ ] bytes ) { } }
long mostBits = ByteUtils . readLong ( bytes , 0 ) ; long leastBits = 0 ; if ( bytes . length > 8 ) { leastBits = ByteUtils . readLong ( bytes , 8 ) ; } return new UUID ( mostBits , leastBits ) ;
public class ChatApi { /** * Send notification that the agent stopped typing * Send notification that the agent stopped typing to the other participants in the specified chat . * @ param id The ID of the chat interaction . ( required ) * @ param acceptData Request parameters . ( optional ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < ApiSuccessResponse > sendTypingStoppedWithHttpInfo ( String id , AcceptData4 acceptData ) throws ApiException { } }
com . squareup . okhttp . Call call = sendTypingStoppedValidateBeforeCall ( id , acceptData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class CPDefinitionOptionValueRelUtil { /** * Returns the first cp definition option value rel in the ordered set where CPDefinitionOptionRelId = & # 63 ; . * @ param CPDefinitionOptionRelId the cp definition option rel ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp definition option value rel * @ throws NoSuchCPDefinitionOptionValueRelException if a matching cp definition option value rel could not be found */ public static CPDefinitionOptionValueRel findByCPDefinitionOptionRelId_First ( long CPDefinitionOptionRelId , OrderByComparator < CPDefinitionOptionValueRel > orderByComparator ) throws com . liferay . commerce . product . exception . NoSuchCPDefinitionOptionValueRelException { } }
return getPersistence ( ) . findByCPDefinitionOptionRelId_First ( CPDefinitionOptionRelId , orderByComparator ) ;
public class MolecularFormulaGenerator { /** * Decides wheter to use the round robin algorithm or full enumeration algorithm . * The round robin implementation here is optimized for chemical elements in organic compounds . It gets slow * if * - the mass of the smallest element is very large ( i . e . hydrogen is not allowed ) * - the maximal mass to decompose is too large ( round robin always decomposes integers . Therefore , the mass have * to be small enough to be represented as 32 bit integer ) * - the number of elements in the set is extremely small ( in this case , however , the problem becomes trivial anyways ) * In theory we could handle these problems by optimizing the way DECOMP discretizes the masses . However , it ' s easier * to just fall back to the full enumeration method if a problem occurs ( especially , because most of the problems * lead to trivial cases that are fast to compute ) . * @ return true if the problem is ill - posed ( i . e . should be calculated by full enumeration method ) */ private static boolean isIllPosed ( double minMass , double maxMass , MolecularFormulaRange mfRange ) { } }
// when the number of integers to decompose is incredible large // we have to adjust the internal settings ( e . g . precision ! ) // instead we simply fallback to the full enumeration method if ( maxMass - minMass >= 1 ) return true ; if ( maxMass > 400000 ) return true ; // if the number of elements to decompose is very small // we fall back to the full enumeration methods as the // minimal decomposable mass of a certain residue class might // exceed the 32 bit integer space if ( mfRange . getIsotopeCount ( ) <= 2 ) return true ; // if the mass of the smallest element in alphabet is large // it is more efficient to use the full enumeration method double smallestMass = Double . POSITIVE_INFINITY ; for ( IIsotope i : mfRange . isotopes ( ) ) { smallestMass = Math . min ( smallestMass , i . getExactMass ( ) ) ; } return smallestMass > 5 ;
public class Activator { /** * Track JSPs . * @ param bundleContext the BundleContext associated with this bundle */ private void trackJspMappings ( final BundleContext bundleContext ) { } }
final ServiceTracker < JspMapping , JspWebElement > jspMappingTracker = JspMappingTracker . createTracker ( extenderContext , bundleContext ) ; jspMappingTracker . open ( ) ; trackers . add ( 0 , jspMappingTracker ) ;
public class BucketImpl { /** * Return the index of the element with the specified key */ private int findIndexByKey ( Object key ) { } }
// Traverse the vector from the back . Given proper locking done at // a higher level , this will ensure that the cache gets to the same // element in the presence of duplicates . // Traversing the vector from the first element causes a problem since // elements are inserted at the end of the vector ( for efficiency ) . // Consequently after inserting duplicate element 1.2 , if another // operation is performed on the same key 1 , we will get to 1.1 instead // of 1.2 for ( int i = ( size ( ) - 1 ) ; i >= 0 ; -- i ) { Element element = ( Element ) get ( i ) ; if ( element . key . equals ( key ) ) { return i ; } } return - 1 ;
public class Spies { /** * Monitors calls to a predicate . * @ param < T > the predicate parameter type * @ param predicate the predicate that will be monitored * @ param calls a value holder accumulating calls * @ return the proxied predicate */ public static < T > Predicate < T > monitor ( Predicate < T > predicate , AtomicLong calls ) { } }
return new MonitoringPredicate < T > ( predicate , calls ) ;
public class JaasCallbackHandler { /** * CallbackHandler Method */ public void handle ( Callback [ ] callbacks ) throws IOException , UnsupportedCallbackException { } }
if ( callbacks . length == 1 && callbacks [ 0 ] instanceof AuthorizeCallback ) { AuthorizeCallback acb = ( AuthorizeCallback ) callbacks [ 0 ] ; boolean authorized = acb . getAuthenticationID ( ) . equals ( acb . getAuthorizationID ( ) ) ; if ( authorized == false ) { SECURITY_LOGGER . tracef ( "Checking 'AuthorizeCallback', authorized=false, authenticationID=%s, authorizationID=%s." , acb . getAuthenticationID ( ) , acb . getAuthorizationID ( ) ) ; } acb . setAuthorized ( authorized ) ; return ; } NameCallback nameCallBack = null ; EvidenceVerifyCallback evidenceVerifyCallback = null ; SubjectCallback subjectCallback = null ; for ( Callback current : callbacks ) { if ( current instanceof NameCallback ) { nameCallBack = ( NameCallback ) current ; } else if ( current instanceof RealmCallback ) { } else if ( current instanceof EvidenceVerifyCallback ) { evidenceVerifyCallback = ( EvidenceVerifyCallback ) current ; } else if ( current instanceof SubjectCallback ) { subjectCallback = ( SubjectCallback ) current ; } else { throw new UnsupportedCallbackException ( current ) ; } } if ( nameCallBack == null ) { SECURITY_LOGGER . trace ( "No username supplied in Callbacks." ) ; throw DomainManagementLogger . ROOT_LOGGER . noUsername ( ) ; } final String userName = nameCallBack . getDefaultName ( ) ; if ( userName == null || userName . length ( ) == 0 ) { SECURITY_LOGGER . trace ( "NameCallback either has no username or is 0 length." ) ; throw DomainManagementLogger . ROOT_LOGGER . noUsername ( ) ; } if ( evidenceVerifyCallback == null || evidenceVerifyCallback . getEvidence ( ) == null ) { SECURITY_LOGGER . trace ( "No password to verify." ) ; throw DomainManagementLogger . ROOT_LOGGER . noPassword ( ) ; } final char [ ] password ; if ( evidenceVerifyCallback . getEvidence ( ) instanceof PasswordGuessEvidence ) { password = ( ( PasswordGuessEvidence ) evidenceVerifyCallback . getEvidence ( ) ) . getGuess ( ) ; } else { SECURITY_LOGGER . trace ( "No password to verify." ) ; throw DomainManagementLogger . ROOT_LOGGER . noPassword ( ) ; } Subject subject = subjectCallback != null && subjectCallback . getSubject ( ) != null ? subjectCallback . getSubject ( ) : new Subject ( ) ; evidenceVerifyCallback . setVerified ( verify ( userName , password , subject , subjectCallback != null ? subjectCallback :: setSubject : null ) ) ;
public class AndPermission { /** * Some privileges permanently disabled , may need to set up in the execute . * @ param fragment { @ link Fragment } . * @ param deniedPermissions one or more permissions . * @ return true , other wise is false . */ public static boolean hasAlwaysDeniedPermission ( Fragment fragment , List < String > deniedPermissions ) { } }
return hasAlwaysDeniedPermission ( new XFragmentSource ( fragment ) , deniedPermissions ) ;
public class DTMDocumentImpl { /** * Get the depth level of this node in the tree ( equals 1 for * a parentless node ) . * @ param nodeHandle The node id . * @ return the number of ancestors , plus one * @ xsl . usage internal */ public short getLevel ( int nodeHandle ) { } }
short count = 0 ; while ( nodeHandle != 0 ) { count ++ ; nodeHandle = nodes . readEntry ( nodeHandle , 1 ) ; } return count ;
public class SessionStateEventDispatcher { /** * Method sessionUserNameSet * @ see com . ibm . wsspi . session . ISessionStateObserver # sessionUserNameSet ( com . ibm . wsspi . session . ISession , java . lang . String , java . lang . String ) */ public void sessionUserNameSet ( ISession session , String oldUserName , String newUserName ) { } }
// ArrayList sessionStateObservers = null ; /* * Check to see if there is a non - empty list of sessionStateObservers . */ if ( _sessionStateObservers == null || _sessionStateObservers . size ( ) < 1 ) { return ; } // synchronized ( _ sessionStateObservers ) { // sessionStateObservers = ( ArrayList ) _ sessionStateObservers . clone ( ) ; ISessionStateObserver sessionStateObserver = null ; for ( int i = 0 ; i < _sessionStateObservers . size ( ) ; i ++ ) { sessionStateObserver = ( ISessionStateObserver ) _sessionStateObservers . get ( i ) ; sessionStateObserver . sessionUserNameSet ( session , oldUserName , newUserName ) ; }
public class SuggestedFix { /** * { @ link Builder # replace ( Tree , String ) } */ public static SuggestedFix replace ( Tree tree , String replaceWith ) { } }
return builder ( ) . replace ( tree , replaceWith ) . build ( ) ;
public class Meter { /** * Gets the mean throughput . * @ return the mean throughput */ public double getMeanThp ( ) { } }
if ( getCount ( ) == 0 ) { return 0.0 ; } else { final double elapsed = getTick ( ) - startTime ; return getCount ( ) / elapsed * TimeUnit . SECONDS . toNanos ( 1 ) ; }
public class TextElement { /** * Only sends the given keystroke * @ param key the Keys to put into the text area */ public void pressKey ( final String key ) { } }
if ( key == null ) return ; runWithRetries ( ( ) -> { elementImpl . locateElement ( ) . sendKeys ( key ) ; } ) ;
public class SipServerService { /** * { @ inheritDoc } */ public synchronized void start ( StartContext context ) throws StartException { } }
// FIXME : kakonyii // if ( org . apache . tomcat . util . Constants . ENABLE _ MODELER ) { // Set the MBeanServer final MBeanServer mbeanServer = this . mbeanServer . getOptionalValue ( ) ; if ( mbeanServer != null ) { // Registry . getRegistry ( null , null ) . setMBeanServer ( mbeanServer ) ; } System . setProperty ( "catalina.home" , pathManagerInjector . getValue ( ) . getPathEntry ( TEMP_DIR ) . resolvePath ( ) ) ; // FIXME : kakonyii // server = new StandardServer ( ) ; // final StandardService service = new StandardService ( ) ; // service . setName ( JBOSS _ SIP ) ; // service . setServer ( server ) ; // server . addService ( service ) ; // final Engine engine = new StandardEngine ( ) ; // engine . setName ( JBOSS _ SIP ) ; // engine . setService ( service ) ; // engine . setDefaultHost ( defaultHost ) ; // if ( instanceId ! = null ) { // engine . setJvmRoute ( instanceId ) ; // service . setContainer ( engine ) ; // if ( useNative ) { // final AprLifecycleListener apr = new AprLifecycleListener ( ) ; // apr . setSSLEngine ( " on " ) ; // server . addLifecycleListener ( apr ) ; // server . addLifecycleListener ( new JasperListener ( ) ) ; sipService = new SipStandardService ( ) ; // https : / / code . google . com / p / sipservlets / issues / detail ? id = 277 // Add the Service and sip app dispatched right away so apps can get the needed objects // when they deploy fast // FIXME : kakonyii // server . addService ( sipService ) ; if ( sipAppDispatcherClass != null ) { sipService . setSipApplicationDispatcherClassName ( sipAppDispatcherClass ) ; } else { sipService . setSipApplicationDispatcherClassName ( SipApplicationDispatcherImpl . class . getName ( ) ) ; } final String baseDir = System . getProperty ( "jboss.server.base.dir" ) ; if ( sipAppRouterFile != null ) { if ( ! sipAppRouterFile . startsWith ( FILE_PREFIX_PATH ) ) { sipAppRouterFile = FILE_PREFIX_PATH . concat ( baseDir ) . concat ( "/" ) . concat ( sipAppRouterFile ) ; } System . setProperty ( "javax.servlet.sip.dar" , sipAppRouterFile ) ; } sipService . setSipPathName ( sipPathName ) ; if ( sipStackPropertiesFile != null ) { if ( ! sipStackPropertiesFile . startsWith ( FILE_PREFIX_PATH ) ) { sipStackPropertiesFile = FILE_PREFIX_PATH . concat ( baseDir ) . concat ( "/" ) . concat ( sipStackPropertiesFile ) ; } } sipService . setSipStackPropertiesFile ( sipStackPropertiesFile ) ; if ( sipConcurrencyControlMode != null ) { sipService . setConcurrencyControlMode ( sipConcurrencyControlMode ) ; } else { sipService . setConcurrencyControlMode ( "None" ) ; } sipService . setProxyTimerServiceImplementationType ( proxyTimerServiceImplementationType ) ; sipService . setSasTimerServiceImplementationType ( sasTimerServiceImplementationType ) ; sipService . setGatherStatistics ( gatherStatistics ) ; sipService . setCongestionControlCheckingInterval ( sipCongestionControlInterval ) ; sipService . setUsePrettyEncoding ( usePrettyEncoding ) ; sipService . setBaseTimerInterval ( baseTimerInterval ) ; sipService . setT2Interval ( t2Interval ) ; sipService . setT4Interval ( t4Interval ) ; sipService . setTimerDInterval ( timerDInterval ) ; if ( additionalParameterableHeaders != null ) { sipService . setAdditionalParameterableHeaders ( additionalParameterableHeaders ) ; } sipService . setDialogPendingRequestChecking ( dialogPendingRequestChecking ) ; sipService . setDnsServerLocatorClass ( dnsServerLocatorClass ) ; sipService . setDnsTimeout ( dnsTimeout ) ; sipService . setDnsResolverClass ( dnsResolverClass ) ; sipService . setCallIdMaxLength ( callIdMaxLength ) ; sipService . setTagHashMaxLength ( tagHashMaxLength ) ; sipService . setCanceledTimerTasksPurgePeriod ( canceledTimerTasksPurgePeriod ) ; sipService . setMemoryThreshold ( memoryThreshold ) ; sipService . setBackToNormalMemoryThreshold ( backToNormalMemoryThreshold ) ; sipService . setCongestionControlPolicy ( congestionControlPolicy ) ; sipService . setOutboundProxy ( outboundProxy ) ; sipService . setName ( JBOSS_SIP ) ; sipService . setGracefulInterval ( gracefulInterval ) ; // FIXME : kakonyii // sipService . setServer ( server ) ; // sipEngine = new SipStandardEngine ( ) ; // sipEngine . setName ( JBOSS _ SIP ) ; // sipEngine . setService ( sipService ) ; // sipEngine . setDefaultHost ( defaultHost ) ; if ( instanceId != null ) { // sipEngine . setJvmRoute ( instanceId ) ; } // sipService . setContainer ( sipEngine ) ; try { sipService . initialize ( ) ; sipService . start ( ) ; // FIXME : kakonyii // server . init ( ) ; // server . start ( ) ; } catch ( Exception e ) { throw new StartException ( MESSAGES . errorStartingSip ( ) , e ) ; }
public class PreferencesHelper { /** * Retrieves strings array stored as single string . * Uses { @ link # DEFAULT _ DELIMITER } as delimiter . */ @ Nullable public static String [ ] getStringArray ( @ NonNull SharedPreferences prefs , @ NonNull String key ) { } }
return getStringArray ( prefs , key , DEFAULT_DELIMITER ) ;
public class DoubleStreamEx { /** * Returns a stream consisting of the elements of this stream sorted * according to the given comparator . Stream elements are boxed before * passing to the comparator . * For ordered streams , the sort is stable . For unordered streams , no * stability guarantees are made . * This is a < a href = " package - summary . html # StreamOps " > stateful intermediate * operation < / a > . * @ param comparator a * < a href = " package - summary . html # NonInterference " > non - interfering * < / a > , < a href = " package - summary . html # Statelessness " > stateless < / a > * { @ code Comparator } to be used to compare stream elements * @ return the new stream */ public DoubleStreamEx sorted ( Comparator < Double > comparator ) { } }
return new DoubleStreamEx ( stream ( ) . boxed ( ) . sorted ( comparator ) . mapToDouble ( Double :: doubleValue ) , context ) ;
public class AWSRoboMakerClient { /** * Returns a list of deployment jobs for a fleet . You can optionally provide filters to retrieve specific deployment * jobs . * < note > * < / note > * @ param listDeploymentJobsRequest * @ return Result of the ListDeploymentJobs operation returned by the service . * @ throws ResourceNotFoundException * The specified resource does not exist . * @ throws InvalidParameterException * A parameter specified in a request is not valid , is unsupported , or cannot be used . The returned message * provides an explanation of the error value . * @ throws InternalServerException * AWS RoboMaker experienced a service issue . Try your call again . * @ throws ThrottlingException * AWS RoboMaker is temporarily unable to process the request . Try your call again . * @ sample AWSRoboMaker . ListDeploymentJobs * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / robomaker - 2018-06-29 / ListDeploymentJobs " target = " _ top " > AWS * API Documentation < / a > */ @ Override public ListDeploymentJobsResult listDeploymentJobs ( ListDeploymentJobsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListDeploymentJobs ( request ) ;
public class Try { /** * Static factory method for creating a failure value . * @ param t the wrapped { @ link Throwable } * @ param < T > the failure parameter type * @ param < A > the success parameter type * @ return a failure value of t */ public static < T extends Throwable , A > Try < T , A > failure ( T t ) { } }
return new Failure < > ( t ) ;
public class Request { /** * Sets a header per - request * @ param key Header key * @ param value Header value * @ return The request itself */ public Request header ( String key , String value ) { } }
this . headers . put ( key , value ) ; return this ;
public class AbstractDraweeControllerBuilder { /** * Creates a data source supplier for the given image request . */ protected Supplier < DataSource < IMAGE > > getDataSourceSupplierForRequest ( final DraweeController controller , final String controllerId , final REQUEST imageRequest , final CacheLevel cacheLevel ) { } }
final Object callerContext = getCallerContext ( ) ; return new Supplier < DataSource < IMAGE > > ( ) { @ Override public DataSource < IMAGE > get ( ) { return getDataSourceForRequest ( controller , controllerId , imageRequest , callerContext , cacheLevel ) ; } @ Override public String toString ( ) { return Objects . toStringHelper ( this ) . add ( "request" , imageRequest . toString ( ) ) . toString ( ) ; } } ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getRenderingIntentOCRI ( ) { } }
if ( renderingIntentOCRIEEnum == null ) { renderingIntentOCRIEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 182 ) ; } return renderingIntentOCRIEEnum ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/building/1.0" , name = "_GenericApplicationPropertyOfBuildingInstallation" ) public JAXBElement < Object > create_GenericApplicationPropertyOfBuildingInstallation ( Object value ) { } }
return new JAXBElement < Object > ( __GenericApplicationPropertyOfBuildingInstallation_QNAME , Object . class , null , value ) ;
public class StringTools { /** * Adds spaces before words that are not punctuation . * @ param word Word to add the preceding space . * @ param language * Language of the word ( to check typography conventions ) . Currently * French convention of not adding spaces only before ' . ' and ' , ' is * implemented ; other languages assume that before , . ; : ! ? no spaces * should be added . * @ return String containing a space or an empty string . */ public static String addSpace ( String word , Language language ) { } }
String space = " " ; if ( word . length ( ) == 1 ) { char c = word . charAt ( 0 ) ; if ( "fr" . equals ( language . getShortCode ( ) ) ) { if ( c == '.' || c == ',' ) { space = "" ; } } else { if ( c == '.' || c == ',' || c == ';' || c == ':' || c == '?' || c == '!' ) { space = "" ; } } } return space ;
public class JsonWebKey { /** * Get the y value . * @ return the y value */ @ JsonProperty ( "y" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] y ( ) { } }
return ByteExtensions . clone ( this . y ) ;
public class DateTimeUtil { /** * Get Date from " yyyyMMddThhmmssZ " * @ param val String " yyyyMMddThhmmssZ " * @ return Date * @ throws BadDateException on format error */ public static Date fromISODateTimeUTC ( final String val ) throws BadDateException { } }
try { synchronized ( isoDateTimeUTCFormat ) { return isoDateTimeUTCFormat . parse ( val ) ; } } catch ( Throwable t ) { throw new BadDateException ( ) ; }
public class ExtensionFeedItem { /** * Sets the geoTargeting value for this ExtensionFeedItem . * @ param geoTargeting * Geo targeting specifies what locations this extension can serve * with . * On update , if the field is left unspecified , the previous * geo targeting state will not * be changed . * On update , if the field is set with a null value for * criterionId , the geo targeting will be * cleared . */ public void setGeoTargeting ( com . google . api . ads . adwords . axis . v201809 . cm . Location geoTargeting ) { } }
this . geoTargeting = geoTargeting ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getObjectCount ( ) { } }
if ( objectCountEClass == null ) { objectCountEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 513 ) ; } return objectCountEClass ;
public class CmsXmlContentEditor { /** * Performs the change element language action of the editor . < p > */ public void actionChangeElementLanguage ( ) { } }
// save eventually changed content of the editor Locale oldLocale = CmsLocaleManager . getLocale ( getParamOldelementlanguage ( ) ) ; Locale newLocale = getElementLocale ( ) ; try { setEditorValues ( oldLocale ) ; if ( ! m_content . validate ( getCms ( ) ) . hasErrors ( oldLocale ) ) { // no errors found in content if ( ! m_content . hasLocale ( newLocale ) ) { // check if we should copy the content from a default locale boolean addNew = true ; List < Locale > locales = OpenCms . getLocaleManager ( ) . getDefaultLocales ( getCms ( ) , getParamResource ( ) ) ; if ( locales . size ( ) > 1 ) { // default locales have been set , try to find a match try { m_content . copyLocale ( locales , newLocale ) ; addNew = false ; } catch ( CmsXmlException e ) { // no matching default locale was available , we will create a new one later } } if ( addNew ) { // create new element if selected language element is not present try { m_content . addLocale ( getCms ( ) , newLocale ) ; } catch ( CmsXmlException e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } } } // save to temporary file writeContent ( ) ; // set default action to suppress error messages setAction ( ACTION_DEFAULT ) ; } else { // errors found , switch back to old language to show errors setParamElementlanguage ( getParamOldelementlanguage ( ) ) ; // set stored locale to null to reinitialize it m_elementLocale = null ; } } catch ( Exception e ) { // should usually never happen if ( LOG . isInfoEnabled ( ) ) { LOG . info ( e . getLocalizedMessage ( ) , e ) ; } }
public class UpdateFlowSourceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateFlowSourceRequest updateFlowSourceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateFlowSourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateFlowSourceRequest . getDecryption ( ) , DECRYPTION_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getEntitlementArn ( ) , ENTITLEMENTARN_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getFlowArn ( ) , FLOWARN_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getIngestPort ( ) , INGESTPORT_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getMaxBitrate ( ) , MAXBITRATE_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getMaxLatency ( ) , MAXLATENCY_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getProtocol ( ) , PROTOCOL_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getSourceArn ( ) , SOURCEARN_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getStreamId ( ) , STREAMID_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getWhitelistCidr ( ) , WHITELISTCIDR_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class StaticTypeCheckingVisitor { /** * / it seems attractive to want to do this for more cases but perhaps not all cases */ private ClassNode checkForTargetType ( final Expression expr , final ClassNode type ) { } }
BinaryExpression enclosingBinaryExpression = typeCheckingContext . getEnclosingBinaryExpression ( ) ; if ( enclosingBinaryExpression instanceof DeclarationExpression && isEmptyCollection ( expr ) && isAssignment ( enclosingBinaryExpression . getOperation ( ) . getType ( ) ) ) { VariableExpression target = ( VariableExpression ) enclosingBinaryExpression . getLeftExpression ( ) ; return adjustForTargetType ( target . getType ( ) , type ) ; } if ( currentField != null ) { return adjustForTargetType ( currentField . getType ( ) , type ) ; } if ( currentProperty != null ) { return adjustForTargetType ( currentProperty . getType ( ) , type ) ; } MethodNode enclosingMethod = typeCheckingContext . getEnclosingMethod ( ) ; if ( enclosingMethod != null ) { return adjustForTargetType ( enclosingMethod . getReturnType ( ) , type ) ; } return type ;
public class ModelAdapter { /** * allows you to define your own Filter implementation instead of the default ` ItemFilter ` * @ param itemFilter the filter to use * @ return this */ public ModelAdapter < Model , Item > withItemFilter ( ItemFilter < Model , Item > itemFilter ) { } }
this . mItemFilter = itemFilter ; return this ;
public class CaptchaWriterInterceptor { /** * { @ inheritDoc } */ @ Override public void aroundWriteTo ( WriterInterceptorContext context ) throws IOException , WebApplicationException { } }
Object entity = context . getEntity ( ) ; if ( entity instanceof Images . Captcha || entity instanceof Captcha ) { context . setMediaType ( IMG_TYPE ) ; context . getHeaders ( ) . putSingle ( HttpHeaders . CONTENT_TYPE , IMG_TYPE ) ; if ( entity instanceof Captcha ) { Captcha captcha = ( Captcha ) entity ; context . setType ( BufferedImage . class ) ; context . setEntity ( captcha . getImage ( ) ) ; } } context . proceed ( ) ;
public class ValueFileIOHelper { /** * Copy input to output data using NIO . * @ param in * InputStream * @ param out * OutputStream * @ return The number of bytes , possibly zero , that were actually copied * @ throws IOException * if error occurs */ protected long copy ( InputStream in , OutputStream out ) throws IOException { } }
// compare classes as in Java6 Channels . newChannel ( ) , Java5 has a bug in newChannel ( ) . boolean inFile = in instanceof FileInputStream && FileInputStream . class . equals ( in . getClass ( ) ) ; boolean outFile = out instanceof FileOutputStream && FileOutputStream . class . equals ( out . getClass ( ) ) ; if ( inFile && outFile ) { // it ' s user file FileChannel infch = ( ( FileInputStream ) in ) . getChannel ( ) ; FileChannel outfch = ( ( FileOutputStream ) out ) . getChannel ( ) ; long size = 0 ; long r = 0 ; do { r = outfch . transferFrom ( infch , r , infch . size ( ) ) ; size += r ; } while ( r < infch . size ( ) ) ; return size ; } else { // it ' s user stream ( not a file ) ReadableByteChannel inch = inFile ? ( ( FileInputStream ) in ) . getChannel ( ) : Channels . newChannel ( in ) ; WritableByteChannel outch = outFile ? ( ( FileOutputStream ) out ) . getChannel ( ) : Channels . newChannel ( out ) ; long size = 0 ; int r = 0 ; ByteBuffer buff = ByteBuffer . allocate ( IOBUFFER_SIZE ) ; buff . clear ( ) ; while ( ( r = inch . read ( buff ) ) >= 0 ) { buff . flip ( ) ; // copy all do { outch . write ( buff ) ; } while ( buff . hasRemaining ( ) ) ; buff . clear ( ) ; size += r ; } if ( outFile ) ( ( FileChannel ) outch ) . force ( true ) ; // force all data to FS return size ; }
public class AdaptiveGrid { /** * Decreases the number of solutions into a specific hypercube . * @ param location Number of hypercube . */ public void removeSolution ( int location ) { } }
// Decrease the solutions in the location specified . hypercubes [ location ] -- ; // Update the most populated hypercube if ( location == mostPopulatedHypercube ) { for ( int i = 0 ; i < hypercubes . length ; i ++ ) { if ( hypercubes [ i ] > hypercubes [ mostPopulatedHypercube ] ) { mostPopulatedHypercube = i ; } } } // If hypercubes [ location ] now becomes to zero , then update ocuppied hypercubes if ( hypercubes [ location ] == 0 ) { this . calculateOccupied ( ) ; }
public class FallbackContextStore { /** * DS method to activate this component . * @ param compcontext */ protected void activate ( ComponentContext compcontext ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Activating " + this . getClass ( ) . getName ( ) ) ; } this . unauthenticatedSubjectServiceRef . activate ( compcontext ) ;
public class BundleUtils { /** * Returns a optional char array value . In other words , returns the value mapped by key if it exists and is a char array . * The bundle argument is allowed to be { @ code null } . If the bundle is null , this method returns null . * @ param bundle a bundle . If the bundle is null , this method will return null . * @ param key a key for the value . * @ param fallback fallback value . * @ return a char value if exists , null otherwise . * @ see android . os . Bundle # getCharArray ( String ) */ @ Nullable public static char [ ] optCharArray ( @ Nullable Bundle bundle , @ Nullable String key , @ Nullable char [ ] fallback ) { } }
if ( bundle == null ) { return fallback ; } return bundle . getCharArray ( key ) ;
public class Rythm { /** * Prepare the render operation environment settings * @ param codeType * @ param locale * @ param usrCtx * @ return the engine instance itself */ public final RythmEngine prepare ( ICodeType codeType , Locale locale , Map < String , Object > usrCtx ) { } }
return engine ( ) . prepare ( codeType , locale , usrCtx ) ;
public class CharOperation { /** * Answers the first index in the array for which the toBeFound array is a matching subarray following the case rule * starting at the index start . Answers - 1 if no match is found . < br > * < br > * For example : * < ol > * < li > * < pre > * toBeFound = { ' c ' } * array = { ' a ' , ' b ' , ' c ' , ' d ' } * result = & gt ; 2 * < / pre > * < / li > * < li > * < pre > * toBeFound = { ' e ' } * array = { ' a ' , ' b ' , ' c ' , ' d ' } * result = & gt ; - 1 * < / pre > * < / li > * < / ol > * @ param toBeFound * the subarray to search * @ param array * the array to be searched * @ param isCaseSensitive * flag to know if the matching should be case sensitive * @ param start * the starting index * @ return the first index in the array for which the toBeFound array is a matching subarray following the case rule * starting at the index start , - 1 otherwise * @ throws NullPointerException * if array is null or toBeFound is null */ public static final int indexOf ( final char [ ] toBeFound , final char [ ] array , final boolean isCaseSensitive , final int start ) { } }
return indexOf ( toBeFound , array , isCaseSensitive , start , array . length ) ;
public class ESHttpMarshaller { /** * Creates a single " application / vnd . eventstore . events ( + json / + xml ) " entry surrounded by " [ ] " ( JSON ) or * " & lt ; Events & gt ; & lt ; / Events & gt ; " ( XML ) . * @ param registry * Registry with known serializers . * @ param commonEvent * Event to marshal . * @ return Single event body . */ @ NotNull public final String marshal ( @ NotNull final SerializerRegistry registry , @ NotNull final CommonEvent commonEvent ) { } }
Contract . requireArgNotNull ( "registry" , registry ) ; Contract . requireArgNotNull ( "commonEvent" , commonEvent ) ; final Serializer serializer = registry . getSerializer ( EscEvent . SER_TYPE ) ; final EscEvent event = createEscEvent ( registry , serializer . getMimeType ( ) , commonEvent ) ; final byte [ ] data = serializer . marshal ( event , EscEvent . SER_TYPE ) ; return new String ( data , serializer . getMimeType ( ) . getEncoding ( ) ) ;
public class PendingMerge { /** * Seals this PendingMerge instance and returns a list of all the registered FutureReadResultEntries associated with it . * After this method returns , all calls to register ( ) will return false . * @ return A List of all the registered FutureReadResultEntries recorded . */ synchronized List < FutureReadResultEntry > seal ( ) { } }
this . sealed = true ; List < FutureReadResultEntry > result = new ArrayList < > ( this . reads ) ; this . reads . clear ( ) ; return result ;
public class Items { /** * Returns all the registered { @ link TopLevelItemDescriptor } s that the specified security principal is allowed to * create within the specified item group . * @ since 1.607 */ public static List < TopLevelItemDescriptor > all ( Authentication a , ItemGroup c ) { } }
List < TopLevelItemDescriptor > result = new ArrayList < > ( ) ; ACL acl ; if ( c instanceof AccessControlled ) { acl = ( ( AccessControlled ) c ) . getACL ( ) ; } else { // fall back to root acl = Jenkins . getInstance ( ) . getACL ( ) ; } for ( TopLevelItemDescriptor d : all ( ) ) { if ( acl . hasCreatePermission ( a , c , d ) && d . isApplicableIn ( c ) ) { result . add ( d ) ; } } return result ;
public class SearchResult { /** * The requested field statistics information . * @ param stats * The requested field statistics information . * @ return Returns a reference to this object so that method calls can be chained together . */ public SearchResult withStats ( java . util . Map < String , FieldStats > stats ) { } }
setStats ( stats ) ; return this ;
public class CatalogDiffEngine { /** * Check if there is a unique index that exists in the old catalog * that is covered by the new index . That would mean adding this index * can ' t fail with a duplicate key . * @ param newIndex The new index to check . * @ return True if the index can be created without a chance of failing . */ private boolean checkNewUniqueIndex ( Index newIndex ) { } }
Table table = ( Table ) newIndex . getParent ( ) ; CatalogMap < Index > existingIndexes = m_originalIndexesByTable . get ( table . getTypeName ( ) ) ; for ( Index existingIndex : existingIndexes ) { if ( indexCovers ( newIndex , existingIndex ) ) { return true ; } } return false ;
public class StartDocumentAnalysisRequest { /** * A list of the types of analysis to perform . Add TABLES to the list to return information about the tables that * are detected in the input document . Add FORMS to return detected fields and the associated text . To perform both * types of analysis , add TABLES and FORMS to < code > FeatureTypes < / code > . All selectable elements ( * < code > SELECTION _ ELEMENT < / code > ) that are detected are returned , whatever the value of < code > FeatureTypes < / code > . * @ param featureTypes * A list of the types of analysis to perform . Add TABLES to the list to return information about the tables * that are detected in the input document . Add FORMS to return detected fields and the associated text . To * perform both types of analysis , add TABLES and FORMS to < code > FeatureTypes < / code > . All selectable elements * ( < code > SELECTION _ ELEMENT < / code > ) that are detected are returned , whatever the value of * < code > FeatureTypes < / code > . * @ return Returns a reference to this object so that method calls can be chained together . * @ see FeatureType */ public StartDocumentAnalysisRequest withFeatureTypes ( FeatureType ... featureTypes ) { } }
java . util . ArrayList < String > featureTypesCopy = new java . util . ArrayList < String > ( featureTypes . length ) ; for ( FeatureType value : featureTypes ) { featureTypesCopy . add ( value . toString ( ) ) ; } if ( getFeatureTypes ( ) == null ) { setFeatureTypes ( featureTypesCopy ) ; } else { getFeatureTypes ( ) . addAll ( featureTypesCopy ) ; } return this ;
public class IndexCommitBuilder { /** * Marks the given object for insertion in the commit . * @ param object a OpenEngSBModel instance * @ return this for chaining */ public IndexCommitBuilder insert ( Object object ) { } }
updateModelClassSet ( object ) ; getInsertList ( object . getClass ( ) ) . add ( ( OpenEngSBModel ) object ) ; return this ;
public class StringDimensionHandler { /** * Value for absent column , i . e . { @ link NilColumnValueSelector } , should be equivalent to [ null ] during index merging . * During index merging , if one of the merged indexes has absent columns , { @ link StringDimensionMergerV9 } ensures * that null value is present , and it has index = 0 after sorting , because sorting puts null first . See { @ link * StringDimensionMergerV9 # hasNull } and the place where it is assigned . */ private static IndexedInts getRow ( ColumnValueSelector s ) { } }
if ( s instanceof DimensionSelector ) { return ( ( DimensionSelector ) s ) . getRow ( ) ; } else if ( s instanceof NilColumnValueSelector ) { return ZeroIndexedInts . instance ( ) ; } else { throw new ISE ( "ColumnValueSelector[%s], only DimensionSelector or NilColumnValueSelector is supported" , s . getClass ( ) ) ; }
public class IndexQueryBuilder { public IndexQueryBuilder setIndex ( String indexName ) { } }
Preconditions . checkArgument ( StringUtils . isNotBlank ( indexName ) ) ; this . indexName = indexName ; return this ;
public class SignalUtil { /** * Implements the same semantics as { @ link CompletionService # take ( ) } , except that the wait will * periodically time out within this method to log a warning message that the thread appears * stuck . This cycle will be repeated until a { @ link Future } is obtained . If the thread has * waited for an extended period , then wait logging is quiesced to avoid overwhelming the logs . * If and when a thread that has been reported as being stuck finally does obtain a * { @ link Future } , then a warning level message is logged to indicate that the thread is * resuming . * @ param < T > * Generic type of the Future result * @ param cs * the CompletionService to wait on * @ param callerClass * the caller class * @ param callerMethod * the caller method * @ param args * extra arguments to be appended to the log message * @ return the Future < T > obtained from the CompletionService * @ throws InterruptedException */ public static < T > Future < T > take ( CompletionService < T > cs , String callerClass , String callerMethod , Object ... args ) throws InterruptedException { } }
final String sourceMethod = "take" ; // $ NON - NLS - 1 $ final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { Thread . currentThread ( ) , cs , callerClass , callerMethod , args } ) ; } long start = System . currentTimeMillis ( ) ; boolean quiesced = false , logged = false ; Future < T > future = null ; while ( ( future = cs . poll ( SIGNAL_LOG_INTERVAL_SECONDS , TimeUnit . SECONDS ) ) == null ) { if ( ! quiesced ) { quiesced = logWaiting ( callerClass , callerMethod , cs , start , args ) ; logged = true ; } } if ( logged ) { logResuming ( callerClass , callerMethod , cs , start ) ; } if ( isTraceLogging ) { log . exiting ( sourceClass , sourceMethod , Arrays . asList ( Thread . currentThread ( ) , cs , callerClass , callerMethod , future ) ) ; } return future ;
public class ObserverQueue { /** * ( non - Javadoc ) * @ see java . lang . Runnable # run ( ) */ public void run ( ) { } }
while ( true ) { Object obj ; try { obj = messages . take ( ) ; notifySubscribers ( obj ) ; } catch ( InterruptedException e ) { // restore interrupted status Thread . currentThread ( ) . interrupt ( ) ; } }
public class LDAPQuery { /** * Sets the names of the attributes to extract for each returned entity . * @ param attributes * the names of the attributes to extract for each returned entity . * @ return * the object itself , for method chaining . */ public LDAPQuery setAttributes ( String ... attributes ) { } }
if ( attributes != null && attributes . length > 0 ) { this . attributes = attributes ; } else { this . attributes = ALL_ATTRIBUTES ; } return this ;
public class CommandLine { /** * Retrieve any left - over non - recognized options and arguments * @ return remaining items passed in but not parsed as an array */ public String [ ] getArgs ( ) { } }
String [ ] answer = new String [ args . size ( ) ] ; args . toArray ( answer ) ; return answer ;
public class JZUtils { /** * Get AppCompatActivity from context * @ param context context * @ return AppCompatActivity if it ' s not null */ public static AppCompatActivity getAppCompActivity ( Context context ) { } }
if ( context == null ) return null ; if ( context instanceof AppCompatActivity ) { return ( AppCompatActivity ) context ; } else if ( context instanceof ContextThemeWrapper ) { return getAppCompActivity ( ( ( ContextThemeWrapper ) context ) . getBaseContext ( ) ) ; } return null ;
public class OWLObjectPropertyRangeAxiomImpl_CustomFieldSerializer { /** * Serializes the content of the object into the * { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } . * @ param streamWriter the { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } to write the * object ' s content to * @ param instance the object instance to serialize * @ throws com . google . gwt . user . client . rpc . SerializationException * if the serialization operation is not * successful */ @ Override public void serializeInstance ( SerializationStreamWriter streamWriter , OWLObjectPropertyRangeAxiomImpl instance ) throws SerializationException { } }
serialize ( streamWriter , instance ) ;
public class JDBCUtils { /** * Opens a JDBC connection with the given parameters . */ public static Statement open ( String driverklass , String jdbcuri , Properties props ) { } }
try { Driver driver = ( Driver ) ObjectUtils . instantiate ( driverklass ) ; Connection conn = driver . connect ( jdbcuri , props ) ; if ( conn == null ) throw new DukeException ( "Couldn't connect to database at " + jdbcuri ) ; return conn . createStatement ( ) ; } catch ( SQLException e ) { throw new DukeException ( e ) ; }
public class PreciseDurationDateTimeField { /** * This method assumes that this field is properly rounded on * 1970-01-01T00:00:00 . If the rounding alignment differs , override this * method as follows : * < pre > * return super . roundFloor ( instant + ALIGNMENT _ MILLIS ) - ALIGNMENT _ MILLIS ; * < / pre > */ public long roundFloor ( long instant ) { } }
if ( instant >= 0 ) { return instant - instant % iUnitMillis ; } else { instant += 1 ; return instant - instant % iUnitMillis - iUnitMillis ; }
public class AbstractTaskStateTracker { /** * Schedule a { @ link TaskMetricsUpdater } . * @ param taskMetricsUpdater the { @ link TaskMetricsUpdater } to schedule * @ param task the { @ link Task } that the { @ link TaskMetricsUpdater } is associated to * @ return a { @ link java . util . concurrent . ScheduledFuture } corresponding to the scheduled { @ link TaskMetricsUpdater } */ protected ScheduledFuture < ? > scheduleTaskMetricsUpdater ( Runnable taskMetricsUpdater , Task task ) { } }
return this . taskMetricsUpdaterExecutor . scheduleAtFixedRate ( taskMetricsUpdater , task . getTaskContext ( ) . getStatusReportingInterval ( ) , task . getTaskContext ( ) . getStatusReportingInterval ( ) , TimeUnit . MILLISECONDS ) ;
public class JCusparse { /** * Description : Gather of non - zero elements from dense vector y into * sparse vector x . */ public static int cusparseSgthr ( cusparseHandle handle , int nnz , Pointer y , Pointer xVal , Pointer xInd , int idxBase ) { } }
return checkResult ( cusparseSgthrNative ( handle , nnz , y , xVal , xInd , idxBase ) ) ;
public class TSSubQuery { /** * Make sure the parameters for histogram query are valid . * < ul > * < li > aggregation function : only NONE and SUM supported < / li > * < li > aggregation function in downsampling : only SUM supported < / li > * < li > percentile : only in rage ( 0,100 ) < / li > * < / ul > */ private void checkHistogramQuery ( ) { } }
if ( ! isHistogramQuery ( ) ) { return ; } // only support NONE and SUM if ( agg != null && agg != Aggregators . NONE && agg != Aggregators . SUM ) { throw new IllegalArgumentException ( "Only NONE or SUM aggregation function supported for histogram query" ) ; } // only support SUM in downsampling if ( DownsamplingSpecification . NO_DOWNSAMPLER != downsample_specifier && downsample_specifier . getHistogramAggregation ( ) != HistogramAggregation . SUM ) { throw new IllegalArgumentException ( "Only SUM downsampling aggregation supported for histogram query" ) ; } if ( null != percentiles && percentiles . size ( ) > 0 ) { for ( Float parameter : percentiles ) { if ( parameter < 0 || parameter > 100 ) { throw new IllegalArgumentException ( "Invalid percentile parameters: " + parameter ) ; } } }
public class MonetaryFormat { /** * Set character to use as the decimal mark . If the formatted value does not have any decimals , no decimal mark is * used either . */ public MonetaryFormat decimalMark ( char decimalMark ) { } }
checkArgument ( ! Character . isDigit ( decimalMark ) ) ; checkArgument ( decimalMark > 0 ) ; if ( decimalMark == this . decimalMark ) return this ; else return new MonetaryFormat ( negativeSign , positiveSign , zeroDigit , decimalMark , minDecimals , decimalGroups , shift , roundingMode , codes , codeSeparator , codePrefixed ) ;
public class Line { /** * Checks for a valid HTML block . Sets < code > xmlEndLine < / code > . * @ return < code > true < / code > if it is a valid block . */ private boolean checkHTML ( ) { } }
final LinkedList < String > tags = new LinkedList < String > ( ) ; final StringBuilder temp = new StringBuilder ( ) ; int pos = this . leading ; if ( this . value . charAt ( this . leading + 1 ) == '!' ) { if ( this . readXMLComment ( this , this . leading ) > 0 ) { return true ; } } pos = Utils . readXML ( temp , this . value , this . leading , false ) ; String element , tag ; if ( pos > - 1 ) { element = temp . toString ( ) ; temp . setLength ( 0 ) ; Utils . getXMLTag ( temp , element ) ; tag = temp . toString ( ) . toLowerCase ( ) ; if ( ! HTML . isHtmlBlockElement ( tag ) ) { return false ; } if ( tag . equals ( "hr" ) || element . endsWith ( "/>" ) ) { this . xmlEndLine = this ; return true ; } tags . add ( tag ) ; Line line = this ; while ( line != null ) { while ( pos < line . value . length ( ) && line . value . charAt ( pos ) != '<' ) { pos ++ ; } if ( pos >= line . value . length ( ) ) { line = line . next ; pos = 0 ; } else { temp . setLength ( 0 ) ; final int newPos = Utils . readXML ( temp , line . value , pos , false ) ; if ( newPos > 0 ) { element = temp . toString ( ) ; temp . setLength ( 0 ) ; Utils . getXMLTag ( temp , element ) ; tag = temp . toString ( ) . toLowerCase ( ) ; if ( HTML . isHtmlBlockElement ( tag ) && ! tag . equals ( "hr" ) && ! element . endsWith ( "/>" ) ) { if ( element . charAt ( 1 ) == '/' ) { if ( ! tags . getLast ( ) . equals ( tag ) ) { return false ; } tags . removeLast ( ) ; } else { tags . addLast ( tag ) ; } } if ( tags . size ( ) == 0 ) { this . xmlEndLine = line ; break ; } pos = newPos ; } else { pos ++ ; } } } return tags . size ( ) == 0 ; } return false ;
public class PlanAssembler { /** * Push the given aggregate if the plan is distributed , then add the * coordinator node on top of the send / receive pair . If the plan * is not distributed , or coordNode is not provided , the distNode * is added at the top of the plan . * Note : this works in part because the push - down node is also an acceptable * top level node if the plan is not distributed . This wouldn ' t be true * if we started pushing down something like ( sum , count ) to calculate * a distributed average . ( We already do something like this for * APPROX _ COUNT _ DISTINCT , which must be split into two different functions * for the pushed - down case . ) * @ param root * The root node * @ param distNode * The node to push down * @ param coordNode [ may be null ] * The top node to put on top of the send / receive pair after * push - down . If this is null , no push - down will be performed . * @ return The new root node . */ private static AbstractPlanNode pushDownAggregate ( AbstractPlanNode root , AggregatePlanNode distNode , AggregatePlanNode coordNode , ParsedSelectStmt selectStmt ) { } }
AggregatePlanNode rootAggNode ; // remember that coordinating aggregation has a pushed - down // counterpart deeper in the plan . this allows other operators // to be pushed down past the receive as well . if ( coordNode != null ) { coordNode . m_isCoordinatingAggregator = true ; } /* * Push this node down to partition if it ' s distributed . First remove * the send / receive pair , add the node , then put the send / receive pair * back on top of the node , followed by another top node at the * coordinator . */ if ( coordNode != null && root instanceof ReceivePlanNode ) { AbstractPlanNode accessPlanTemp = root ; root = accessPlanTemp . getChild ( 0 ) . getChild ( 0 ) ; root . clearParents ( ) ; accessPlanTemp . getChild ( 0 ) . clearChildren ( ) ; distNode . addAndLinkChild ( root ) ; if ( selectStmt . hasPartitionColumnInGroupby ( ) ) { // Set post predicate for final distributed Aggregation node distNode . setPostPredicate ( selectStmt . getHavingPredicate ( ) ) ; // Edge case : GROUP BY clause contains the partition column // No related GROUP BY or even Re - agg will apply on coordinator // Projection plan node can just be pushed down also except for // a very edge ORDER BY case . if ( selectStmt . isComplexOrderBy ( ) ) { // Put the send / receive pair back into place accessPlanTemp . getChild ( 0 ) . addAndLinkChild ( distNode ) ; root = processComplexAggProjectionNode ( selectStmt , accessPlanTemp ) ; return root ; } root = processComplexAggProjectionNode ( selectStmt , distNode ) ; // Put the send / receive pair back into place accessPlanTemp . getChild ( 0 ) . addAndLinkChild ( root ) ; return accessPlanTemp ; } // Without including partition column in GROUP BY clause , // there has to be a top GROUP BY plan node on coordinator . // Now that we ' re certain the aggregate will be pushed down // ( no turning back now ! ) , fix any APPROX _ COUNT _ DISTINCT aggregates . fixDistributedApproxCountDistinct ( distNode , coordNode ) ; // Put the send / receive pair back into place accessPlanTemp . getChild ( 0 ) . addAndLinkChild ( distNode ) ; // Add the top node coordNode . addAndLinkChild ( accessPlanTemp ) ; rootAggNode = coordNode ; } else { distNode . addAndLinkChild ( root ) ; rootAggNode = distNode ; } // Set post predicate for final Aggregation node . rootAggNode . setPostPredicate ( selectStmt . getHavingPredicate ( ) ) ; root = processComplexAggProjectionNode ( selectStmt , rootAggNode ) ; return root ;
public class MessageItem { /** * Set the maximum storage strategy permitted */ public void setMaxStorageStrategy ( int requestedMaxStrategy ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setMaxStorageStrategy" , Integer . valueOf ( requestedMaxStrategy ) ) ; maxStorageStrategy = requestedMaxStrategy ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setMaxStorageStrategy" ) ;
public class ClientBehaviorContext { /** * < p class = " changed _ added _ 2_0 " > Creates a ClientBehaviorContext instance . < / p > * @ param context the < code > FacesContext < / code > for the current request . * @ param component the component instance to which the * < code > ClientBehavior < / code > is attached . * @ param eventName the name of the behavior event to which the * < code > ClientBehavior < / code > is attached . * @ param sourceId the id to use as the ClientBehavior ' s " source " . * @ param parameters the collection of parameters for submitting * ClientBehaviors to include in the request . * @ return a < code > ClientBehaviorContext < / code > instance configured with the * provided values . * @ throws NullPointerException if < code > context < / code > , * < code > component < / code > or < code > eventName < / code > * is < code > null < / code > * @ since 2.0 */ public static ClientBehaviorContext createClientBehaviorContext ( FacesContext context , UIComponent component , String eventName , String sourceId , Collection < ClientBehaviorContext . Parameter > parameters ) { } }
return new ClientBehaviorContextImpl ( context , component , eventName , sourceId , parameters ) ;
public class SerializerIntrinsics { /** * Round Scalar DP - FP Values ( SSE4.1 ) . */ public final void roundsd ( XMMRegister dst , XMMRegister src , Immediate imm8 ) { } }
emitX86 ( INST_ROUNDSD , dst , src , imm8 ) ;
public class RandomUtil { /** * Creates a random string consisting of lowercase letters . * @ param minLength minimum length of String to create . * @ param maxLength maximum length ( non inclusive ) of String to create . * @ return lowercase letters . */ public String randomLowerMaxLength ( int minLength , int maxLength ) { } }
int range = maxLength - minLength ; int randomLength = 0 ; if ( range > 0 ) { randomLength = random ( range ) ; } return randomLower ( minLength + randomLength ) ;
public class BatchDeleteConnectionRequest { /** * A list of names of the connections to delete . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setConnectionNameList ( java . util . Collection ) } or { @ link # withConnectionNameList ( java . util . Collection ) } if * you want to override the existing values . * @ param connectionNameList * A list of names of the connections to delete . * @ return Returns a reference to this object so that method calls can be chained together . */ public BatchDeleteConnectionRequest withConnectionNameList ( String ... connectionNameList ) { } }
if ( this . connectionNameList == null ) { setConnectionNameList ( new java . util . ArrayList < String > ( connectionNameList . length ) ) ; } for ( String ele : connectionNameList ) { this . connectionNameList . add ( ele ) ; } return this ;
public class SipSessionImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . SipSession # setAttribute ( java . lang . String , java . lang . Object ) */ public void setAttribute ( String key , Object attribute ) { } }
if ( ! isValid ( ) ) { throw new IllegalStateException ( "Can not bind object to session that has been invalidated!!" ) ; } if ( key == null ) { throw new NullPointerException ( "Name of attribute to bind cant be null!!!" ) ; } if ( attribute == null ) { throw new NullPointerException ( "Attribute that is to be bound cant be null!!!" ) ; } // Construct an event with the new value SipSessionBindingEvent event = null ; // Call the valueBound ( ) method if necessary if ( attribute instanceof SipSessionBindingListener ) { // Don ' t call any notification if replacing with the same value Object oldValue = getAttributeMap ( ) . get ( key ) ; if ( attribute != oldValue ) { event = new SipSessionBindingEvent ( this , key ) ; try { ( ( SipSessionBindingListener ) attribute ) . valueBound ( event ) ; } catch ( Throwable t ) { logger . error ( "SipSessionBindingListener threw exception" , t ) ; } } } Object previousValue = this . getAttributeMap ( ) . put ( key , attribute ) ; if ( previousValue != null && previousValue != attribute && previousValue instanceof SipSessionBindingListener ) { try { ( ( SipSessionBindingListener ) previousValue ) . valueUnbound ( new SipSessionBindingEvent ( this , key ) ) ; } catch ( Throwable t ) { logger . error ( "SipSessionBindingListener threw exception" , t ) ; } } // Notifying Listeners of attribute addition or modification SipListeners sipListenersHolder = this . getSipApplicationSession ( ) . getSipContext ( ) . getListeners ( ) ; List < SipSessionAttributeListener > listenersList = sipListenersHolder . getSipSessionAttributeListeners ( ) ; if ( listenersList . size ( ) > 0 ) { if ( event == null ) { event = new SipSessionBindingEvent ( this , key ) ; } if ( previousValue == null ) { // This is initial , we need to send value bound event for ( SipSessionAttributeListener listener : listenersList ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "notifying SipSessionAttributeListener " + listener . getClass ( ) . getCanonicalName ( ) + " of attribute added on key " + key ) ; } try { listener . attributeAdded ( event ) ; } catch ( Throwable t ) { logger . error ( "SipSessionAttributeListener threw exception" , t ) ; } } } else { for ( SipSessionAttributeListener listener : listenersList ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "notifying SipSessionAttributeListener " + listener . getClass ( ) . getCanonicalName ( ) + " of attribute replaced on key " + key ) ; } try { listener . attributeReplaced ( event ) ; } catch ( Throwable t ) { logger . error ( "SipSessionAttributeListener threw exception" , t ) ; } } } }
public class Period { /** * Returns a new period with the specified number of days . * This period instance is immutable and unaffected by this method call . * @ param days the amount of days to add , may be negative * @ return the new period with the increased days * @ throws UnsupportedOperationException if the field is not supported */ public Period withDays ( int days ) { } }
int [ ] values = getValues ( ) ; // cloned getPeriodType ( ) . setIndexedField ( this , PeriodType . DAY_INDEX , values , days ) ; return new Period ( values , getPeriodType ( ) ) ;
public class AbstractBundleLinkRenderer { /** * Adds an HTML comment to the output stream . * @ param commentText * the comment * @ param out * Writer * @ throws IOException * if an IO exception occurs */ protected void addComment ( String commentText , Writer out ) throws IOException { } }
StringBuilder sb = new StringBuilder ( "<script type=\"text/javascript\">/* " ) ; sb . append ( commentText ) . append ( " */</script>" ) . append ( "\n" ) ; out . write ( sb . toString ( ) ) ;
public class Combinations { /** * Initialize with a new list and bucket size * @ param list List which is to be symbols * @ param bucketSize Size of the bucket */ public void init ( List < T > list , int bucketSize ) { } }
if ( list . size ( ) < bucketSize ) { throw new RuntimeException ( "There needs to be more than or equal to elements in the 'list' that there are in the bucket" ) ; } this . k = bucketSize ; this . c = bucketSize - 1 ; N = list . size ( ) ; bins = new int [ bucketSize ] ; for ( int i = 0 ; i < bins . length ; i ++ ) { bins [ i ] = i ; } this . a = list ; state = 1 ;
public class TypeCache { /** * Finds an existing type or inserts a new one if the previous type was not found . * @ param classLoader The class loader for which this type is stored . * @ param key The key for the type in question . * @ param lazy A lazy creator for the type to insert of no previous type was stored in the cache . * @ return The lazily created type or a previously submitted type for the same class loader and key combination . */ public Class < ? > findOrInsert ( ClassLoader classLoader , T key , Callable < Class < ? > > lazy ) { } }
Class < ? > type = find ( classLoader , key ) ; if ( type != null ) { return type ; } else { try { return insert ( classLoader , key , lazy . call ( ) ) ; } catch ( Throwable throwable ) { throw new IllegalArgumentException ( "Could not create type" , throwable ) ; } }
public class CreateSnapshotTaskRunner { /** * Constructs the contents of a properties file given a set of * key / value pairs * @ param props snapshot properties * @ return Properties - file formatted key / value pairs */ protected String buildSnapshotProps ( Map < String , String > props ) { } }
Properties snapshotProperties = new Properties ( ) ; for ( String key : props . keySet ( ) ) { snapshotProperties . setProperty ( key , props . get ( key ) ) ; } StringWriter writer = new StringWriter ( ) ; try { snapshotProperties . store ( writer , null ) ; } catch ( IOException e ) { throw new TaskException ( "Could not write snapshot properties: " + e . getMessage ( ) , e ) ; } writer . flush ( ) ; return writer . toString ( ) ;
public class HttpResponse { /** * 将对象数组用Map的形式以JSON格式输出 < br > * 例如 : finishMap ( " a " , 2 , " b " , 3 ) 输出结果为 { " a " : 2 , " b " : 3} * @ param convert 指定的JsonConvert * @ param objs 输出对象 */ public void finishMapJson ( final JsonConvert convert , final Object ... objs ) { } }
this . contentType = this . jsonContentType ; if ( this . recycleListener != null ) this . output = objs ; finish ( convert . convertMapTo ( getBodyBufferSupplier ( ) , objs ) ) ;
public class ViewDragHelper { /** * Check if any of the edges specified were initially touched in the currently active gesture . * If there is no currently active gesture this method will return false . * @ param edges Edges to check for an initial edge touch . See { @ link # EDGE _ LEFT } , * { @ link # EDGE _ TOP } , { @ link # EDGE _ RIGHT } , { @ link # EDGE _ BOTTOM } and * { @ link # EDGE _ ALL } * @ return true if any of the edges specified were initially touched in the current gesture */ public boolean isEdgeTouched ( int edges ) { } }
final int count = mInitialEdgesTouched . length ; for ( int i = 0 ; i < count ; i ++ ) { if ( isEdgeTouched ( edges , i ) ) { return true ; } } return false ;
public class Component { /** * Convenience method for retrieving a list of named properties . * @ param name name of properties to retrieve * @ return a property list containing only properties with the specified name */ public final < C extends Property > PropertyList < C > getProperties ( final String name ) { } }
return getProperties ( ) . getProperties ( name ) ;
public class ScaleRoundedOperator { /** * Creates the rounded Operator from scale and roundingMode * @ param scale the scale to be used * @ param roundingMode the rounding mode to be used * @ return the { @ link MonetaryOperator } using the scale and { @ link RoundingMode } used in parameter * @ throws NullPointerException when the { @ link MathContext } is null * @ see RoundingMode */ public static ScaleRoundedOperator of ( int scale , RoundingMode roundingMode ) { } }
Objects . requireNonNull ( roundingMode ) ; if ( RoundingMode . UNNECESSARY . equals ( roundingMode ) ) { throw new IllegalStateException ( "To create the ScaleRoundedOperator you cannot use the RoundingMode.UNNECESSARY" ) ; } return new ScaleRoundedOperator ( scale , roundingMode ) ;
public class CloudStorageFileSystemProvider { /** * Convenience method : replaces spaces with " % 20 " , builds a URI , and calls getPath ( uri ) . */ public CloudStoragePath getPath ( String uriInStringForm ) { } }
String escaped = UrlEscapers . urlFragmentEscaper ( ) . escape ( uriInStringForm ) ; return getPath ( URI . create ( escaped ) ) ;
public class JsonActionInvocation { /** * Uses getResult to get the final Result and executes it * @ throws ConfigurationException * If not result can be found with the returned code */ private void executeResult ( ) throws Exception { } }
result = createResult ( ) ; String timerKey = "executeResult: " + getResultCode ( ) ; try { UtilTimerStack . push ( timerKey ) ; if ( result != null ) { result . execute ( this ) ; } else if ( resultCode != null && ! Action . NONE . equals ( resultCode ) ) { throw new ConfigurationException ( "No result defined for action " + getAction ( ) . getClass ( ) . getName ( ) + " and result " + getResultCode ( ) , proxy . getConfig ( ) ) ; } else { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "No result returned for action " + getAction ( ) . getClass ( ) . getName ( ) + " at " + proxy . getConfig ( ) . getLocation ( ) ) ; } } } finally { UtilTimerStack . pop ( timerKey ) ; }
public class Sheet { /** * Convert to PF SortOrder enum since we are leveraging PF sorting code . * @ return */ protected SortOrder convertSortOrder ( ) { } }
final String sortOrder = getSortOrder ( ) ; if ( sortOrder == null ) { return SortOrder . UNSORTED ; } else { final SortOrder result = SortOrder . valueOf ( sortOrder . toUpperCase ( Locale . ENGLISH ) ) ; return result ; }
public class Whitelist { /** * Remove a list of allowed attributes from a tag . ( If an attribute is not allowed on an element , it will be removed . ) * E . g . : < code > removeAttributes ( " a " , " href " , " class " ) < / code > disallows < code > href < / code > and < code > class < / code > * attributes on < code > a < / code > tags . * To make an attribute invalid for < b > all tags < / b > , use the pseudo tag < code > : all < / code > , e . g . * < code > removeAttributes ( " : all " , " class " ) < / code > . * @ param tag The tag the attributes are for . * @ param attributes List of invalid attributes for the tag * @ return this ( for chaining ) */ public Whitelist removeAttributes ( String tag , String ... attributes ) { } }
Validate . notEmpty ( tag ) ; Validate . notNull ( attributes ) ; Validate . isTrue ( attributes . length > 0 , "No attribute names supplied." ) ; TagName tagName = TagName . valueOf ( tag ) ; Set < AttributeKey > attributeSet = new HashSet < > ( ) ; for ( String key : attributes ) { Validate . notEmpty ( key ) ; attributeSet . add ( AttributeKey . valueOf ( key ) ) ; } if ( tagNames . contains ( tagName ) && this . attributes . containsKey ( tagName ) ) { // Only look in sub - maps if tag was allowed Set < AttributeKey > currentSet = this . attributes . get ( tagName ) ; currentSet . removeAll ( attributeSet ) ; if ( currentSet . isEmpty ( ) ) // Remove tag from attribute map if no attributes are allowed for tag this . attributes . remove ( tagName ) ; } if ( tag . equals ( ":all" ) ) // Attribute needs to be removed from all individually set tags for ( TagName name : this . attributes . keySet ( ) ) { Set < AttributeKey > currentSet = this . attributes . get ( name ) ; currentSet . removeAll ( attributeSet ) ; if ( currentSet . isEmpty ( ) ) // Remove tag from attribute map if no attributes are allowed for tag this . attributes . remove ( name ) ; } return this ;
public class CachedXPathAPI { /** * Use an XPath string to select a single node . XPath namespace * prefixes are resolved from the context node , which may not * be what you want ( see the next method ) . * @ param contextNode The node to start searching from . * @ param str A valid XPath string . * @ return The first node found that matches the XPath , or null . * @ throws TransformerException */ public Node selectSingleNode ( Node contextNode , String str ) throws TransformerException { } }
return selectSingleNode ( contextNode , str , contextNode ) ;