idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
6,500 | public static boolean isClientAbortException ( IOException e ) { String exceptionClassName = e . getClass ( ) . getName ( ) ; return exceptionClassName . endsWith ( ".EofException" ) || exceptionClassName . endsWith ( ".ClientAbortException" ) ; } | Checks if the exception is a client abort exception |
6,501 | @ SuppressWarnings ( "unchecked" ) private void insertPair ( ReflectedHandle < K , V > handle1 , ReflectedHandle < K , V > handle2 ) { int c ; if ( comparator == null ) { c = ( ( Comparable < ? super K > ) handle1 . key ) . compareTo ( handle2 . key ) ; } else { c = comparator . compare ( handle1 . key , handle2 . key ... | Insert a pair of elements one in the min heap and one in the max heap . |
6,502 | private void delete ( ReflectedHandle < K , V > n ) { if ( n . inner == null && free != n ) { throw new IllegalArgumentException ( "Invalid handle!" ) ; } if ( free == n ) { free = null ; } else { AddressableHeap . Handle < K , HandleMap < K , V > > nInner = n . inner ; ReflectedHandle < K , V > nOuter = nInner . getVa... | Delete an element |
6,503 | @ SuppressWarnings ( "unchecked" ) private void decreaseKey ( ReflectedHandle < K , V > n , K newKey ) { if ( n . inner == null && free != n ) { throw new IllegalArgumentException ( "Invalid handle!" ) ; } int c ; if ( comparator == null ) { c = ( ( Comparable < ? super K > ) newKey ) . compareTo ( n . key ) ; } else {... | Decrease the key of an element . |
6,504 | public void send ( Context context , byte [ ] data , ResponseListener listener ) { setContext ( context ) ; super . send ( data , listener ) ; } | Send this resource request asynchronously with the given byte array as the request body . This method does not set any Content - Type header ; if such a header is required it must be set before calling this method . |
6,505 | public void upload ( Context context , final File file , final ProgressListener progressListener , ResponseListener responseListener ) { setContext ( context ) ; super . upload ( file , progressListener , responseListener ) ; } | Upload a file asynchronously . This method does not set any Content - Type header ; if such a header is required it must be set before calling this method . |
6,506 | protected String getImgSrcToRender ( ) throws JspException { BinaryResourcesHandler binaryRsHandler = ( BinaryResourcesHandler ) pageContext . getServletContext ( ) . getAttribute ( JawrConstant . BINARY_CONTEXT_ATTRIBUTE ) ; if ( null == binaryRsHandler ) throw new JspException ( "You are using a Jawr image tag while ... | Returns the image source to render |
6,507 | public static String rewriteGeneratedBinaryResourceDebugUrl ( String requestPath , String content , String binaryServletMapping ) { if ( binaryServletMapping == null ) { binaryServletMapping = "" ; } String relativeRootUrlPath = PathNormalizer . getRootRelativePath ( requestPath ) ; String replacementPattern = PathNorm... | Rewrites the generated binary resource URL for debug mode |
6,508 | private void performInitializations ( ) { try { BMSClient . getInstance ( ) . initialize ( getApplicationContext ( ) , backendURL , backendGUID , BMSClient . REGION_US_SOUTH ) ; } catch ( MalformedURLException e ) { e . printStackTrace ( ) ; } MCAAuthorizationManager mcaAuthorizationManager = MCAAuthorizationManager . ... | Initialize BMSClient and set the authorization manager |
6,509 | private void getNetworkInfo ( ) { NetworkConnectionListener listener = new NetworkConnectionListener ( ) { public void networkChanged ( NetworkConnectionType newConnection ) { Log . i ( "BMSCore" , "New network connection: " + newConnection . toString ( ) ) ; } } ; this . networkMonitor = new NetworkMonitor ( getApplic... | Exercise the NetworkMonitor API |
6,510 | private void sendSomeRequests ( ) { ResponseListener responseListener = new MyResponseListener ( ) ; sendCustomUrlRequest ( responseListener ) ; sendAutoRetryRequest ( responseListener ) ; downloadImage ( responseListener ) ; uploadData ( responseListener ) ; uploadFile ( responseListener ) ; uploadText ( responseListe... | Exercise the Request and Response APIs |
6,511 | public void startAuthorizationProcess ( final Context context , ResponseListener listener ) { authorizationQueue . add ( listener ) ; if ( authorizationQueue . size ( ) == 1 ) { try { if ( preferences . clientId . get ( ) == null ) { logger . info ( "starting registration process" ) ; invokeInstanceRegistrationRequest ... | Main method to start authorization process |
6,512 | private void invokeInstanceRegistrationRequest ( final Context context ) { AuthorizationRequestManager . RequestOptions options = new AuthorizationRequestManager . RequestOptions ( ) ; options . parameters = createRegistrationParams ( ) ; options . headers = createRegistrationHeaders ( ) ; options . requestMethod = Req... | Invoke request for registration the result of the request should contain ClientId . |
6,513 | private HashMap < String , String > createRegistrationParams ( ) { registrationKeyPair = KeyPairUtility . generateRandomKeyPair ( ) ; JSONObject csrJSON = new JSONObject ( ) ; HashMap < String , String > params ; try { DeviceIdentity deviceData = new BaseDeviceIdentity ( preferences . deviceIdentity . getAsMap ( ) ) ; ... | Generate the params that will be used during the registration phase |
6,514 | private HashMap < String , String > createRegistrationHeaders ( ) { HashMap < String , String > headers = new HashMap < > ( ) ; addSessionIdHeader ( headers ) ; return headers ; } | Generate the headers that will be used during the registration phase |
6,515 | private HashMap < String , String > createTokenRequestParams ( String grantCode ) { HashMap < String , String > params = new HashMap < > ( ) ; params . put ( "code" , grantCode ) ; params . put ( "client_id" , preferences . clientId . get ( ) ) ; params . put ( "grant_type" , "authorization_code" ) ; params . put ( "re... | Generate the params that will be used during the token request phase |
6,516 | private void saveCertificateFromResponse ( Response response ) { try { String responseBody = response . getResponseText ( ) ; JSONObject jsonResponse = new JSONObject ( responseBody ) ; String certificateString = jsonResponse . getString ( "certificate" ) ; X509Certificate certificate = CertificatesUtility . base64Stri... | Extract the certificate data from response and save it on local storage |
6,517 | private void invokeAuthorizationRequest ( Context context ) { AuthorizationRequestManager . RequestOptions options = new AuthorizationRequestManager . RequestOptions ( ) ; options . parameters = createAuthorizationParams ( ) ; options . headers = new HashMap < > ( 1 ) ; addSessionIdHeader ( options . headers ) ; option... | Invoke the authorization request the result of the request should be a grant code |
6,518 | private HashMap < String , String > createAuthorizationParams ( ) { HashMap < String , String > params = new HashMap < > ( 3 ) ; params . put ( "response_type" , "code" ) ; params . put ( "client_id" , preferences . clientId . get ( ) ) ; params . put ( "redirect_uri" , HTTP_LOCALHOST ) ; return params ; } | Generate the params that will be used during the authorization phase |
6,519 | private String extractGrantCode ( String urlString ) throws MalformedURLException { URL url = new URL ( urlString ) ; String code = Utils . getParameterValueFromQuery ( url . getQuery ( ) , "code" ) ; if ( code == null ) { throw new RuntimeException ( "Failed to extract grant code from url" ) ; } logger . debug ( "Gran... | Extract grant code from url string |
6,520 | private void invokeTokenRequest ( String grantCode ) { AuthorizationRequestManager . RequestOptions options = new AuthorizationRequestManager . RequestOptions ( ) ; options . parameters = createTokenRequestParams ( grantCode ) ; options . headers = createTokenRequestHeaders ( grantCode ) ; addSessionIdHeader ( options ... | Invoke request to get token the result of the response should be a valid token |
6,521 | private HashMap < String , String > createTokenRequestHeaders ( String grantCode ) { JSONObject payload = new JSONObject ( ) ; HashMap < String , String > headers ; try { payload . put ( "code" , grantCode ) ; KeyPair keyPair = certificateStore . getStoredKeyPair ( ) ; String jws = jsonSigner . sign ( keyPair , payload... | Generate the headers that will be used during the token request phase |
6,522 | private void saveTokenFromResponse ( Response response ) { try { JSONObject responseJSON = ( ( ResponseImpl ) response ) . getResponseJSON ( ) ; String accessToken = responseJSON . getString ( "access_token" ) ; String idToken = responseJSON . getString ( "id_token" ) ; preferences . accessToken . set ( accessToken ) ;... | Extract token from response and save it locally |
6,523 | private void authorizationRequestSend ( final Context context , String path , AuthorizationRequestManager . RequestOptions options , ResponseListener listener ) { try { AuthorizationRequestManager authorizationRequestManager = new AuthorizationRequestManager ( ) ; authorizationRequestManager . initialize ( context , li... | Use authorization request agent for sending the request |
6,524 | private void handleAuthorizationFailure ( Response response , Throwable t , JSONObject extendedInfo ) { logger . error ( "authorization process failed" ) ; if ( t != null ) { t . printStackTrace ( ) ; } Iterator < ResponseListener > iterator = authorizationQueue . iterator ( ) ; while ( iterator . hasNext ( ) ) { Respo... | Handle failure in the authorization process . All the response listeners will be updated with failure |
6,525 | private void handleAuthorizationSuccess ( Response response ) { Iterator < ResponseListener > iterator = authorizationQueue . iterator ( ) ; while ( iterator . hasNext ( ) ) { ResponseListener next = iterator . next ( ) ; next . onSuccess ( response ) ; iterator . remove ( ) ; } } | Handle success in the authorization process . All the response listeners will be updated with success |
6,526 | public void setProxy ( Proxy proxy ) { if ( proxy != null ) { java . net . Proxy p = new java . net . Proxy ( java . net . Proxy . Type . HTTP , new InetSocketAddress ( proxy . getHost ( ) , proxy . getPort ( ) ) ) ; client . setProxy ( p ) ; } else client . setProxy ( java . net . Proxy . NO_PROXY ) ; } | Set the proxy configuration to use for this client . |
6,527 | public void setKeepAliveConfiguration ( KeepAliveConfiguration keepAliveConfiguration ) { if ( keepAliveConfiguration != null ) client . setConnectionPool ( new ConnectionPool ( keepAliveConfiguration . getMaxIdleConnections ( ) , keepAliveConfiguration . getKeepAliveDurationMs ( ) ) ) ; } | Set the keep alive configuration to use for this client . |
6,528 | public void setLogger ( String logger ) { if ( logger != null && logger . trim ( ) . length ( ) > 0 ) this . logger = LoggerFactory . getLogger ( logger ) ; } | Set an alternate logger for this client to use for log statements . This can be used to direct client logs to different destinations . The default value is com . dottydingo . hyperion . client . HyperionClient |
6,529 | protected com . squareup . okhttp . Request buildHttpRequest ( Request request ) { RequestBody requestBody = null ; if ( request . getRequestMethod ( ) . isBodyRequest ( ) ) requestBody = RequestBody . create ( JSON , serializeBody ( request ) ) ; return new com . squareup . okhttp . Request . Builder ( ) . url ( build... | Build the actual http request |
6,530 | protected < T > T readResponse ( Response response , JavaType javaType ) { try { return objectMapper . readValue ( response . body ( ) . byteStream ( ) , javaType ) ; } catch ( IOException e ) { throw new ClientMarshallingException ( "Error reading results." , e ) ; } } | Read the response and unmarshall into the expected type |
6,531 | protected String serializeBody ( Request request ) { try { return objectMapper . writeValueAsString ( request . getRequestBody ( ) ) ; } catch ( JsonProcessingException e ) { throw new ClientMarshallingException ( "Error writing request." , e ) ; } } | Serialize the request body |
6,532 | protected HyperionException readException ( Response response ) throws IOException { ErrorResponse errorResponse = null ; try { errorResponse = objectMapper . readValue ( response . body ( ) . byteStream ( ) , ErrorResponse . class ) ; } catch ( Exception ignore ) { } HyperionException resolvedException = null ; if ( e... | Create the proper exception for the error response |
6,533 | protected String buildUrl ( Request request ) { StringBuilder sb = new StringBuilder ( 512 ) ; sb . append ( baseUrl ) . append ( request . getEntityName ( ) ) . append ( "/" ) ; if ( request . getPath ( ) != null ) sb . append ( request . getPath ( ) ) ; String queryString = buildQueryString ( request ) ; if ( querySt... | Build the URL for the specified request |
6,534 | protected String buildQueryString ( Request request ) { MultiMap resolvedParameters = null ; if ( parameterFactory != null ) { resolvedParameters = parameterFactory . getParameters ( ) ; } if ( hasEntries ( resolvedParameters ) ) resolvedParameters = resolvedParameters . merge ( request . getParameters ( ) ) ; else res... | Build the query string for the specified request |
6,535 | protected Headers getHeaders ( Request request ) { Headers . Builder headers = new Headers . Builder ( ) ; MultiMap resolvedHeaders = null ; if ( headerFactory != null ) resolvedHeaders = headerFactory . getHeaders ( ) ; if ( hasEntries ( resolvedHeaders ) ) resolvedHeaders = resolvedHeaders . merge ( request . getHead... | Return the headers for the supplied request |
6,536 | protected String encode ( String value ) { try { return URLEncoder . encode ( value , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new ClientException ( 500 , "Error encoding parameter." , e ) ; } } | Encode the supplied string |
6,537 | IntIterator keyIterator ( ) { return new IntIterator ( ) { final IntIterator setitr = set . keyIterator ( ) ; public boolean hasNext ( ) { return setitr . hasNext ( ) ; } public int next ( ) { return setitr . next ( ) ; } } ; } | Returns an iterator over the keys of this map . The keys are returned in no particular order . |
6,538 | public static String getContextPath ( ServletContext servletContext ) { String contextPath = DEFAULT_CONTEXT_PATH ; if ( servletContext != null ) { contextPath = servletContext . getContextPath ( ) ; if ( StringUtils . isEmpty ( contextPath ) ) { contextPath = DEFAULT_CONTEXT_PATH ; } } return contextPath ; } | Returns the context path associated to the servlet context |
6,539 | protected void processCollectionRequest ( HyperionContext hyperionContext ) { EndpointRequest request = hyperionContext . getEndpointRequest ( ) ; EndpointResponse response = hyperionContext . getEndpointResponse ( ) ; ApiVersionPlugin < ApiObject < Serializable > , PersistentObject < Serializable > , Serializable > ap... | Process a multi - item request |
6,540 | void store ( int A , int r , int B ) { getB ( A , r ) . add ( B ) ; getA ( B , r ) . add ( A ) ; } | Record A [ r . B |
6,541 | public void subtract ( R1 relationships ) { if ( null == base ) { throw new AssertionError ( "" ) ; } for ( int i = 0 ; i < base . length ; i ++ ) { if ( null == base [ i ] ) { continue ; } final IConceptSet set = data [ i ] = new SparseConceptHashSet ( ) ; set . addAll ( base [ i ] ) ; if ( null != relationships . dat... | This should only ever be called when the relationships wrap an initial state and no other methods have been called . |
6,542 | public Iterator < AddressableHeap . Handle < K , V > > handlesIterator ( ) { return new Iterator < AddressableHeap . Handle < K , V > > ( ) { private int pos = 1 ; public boolean hasNext ( ) { return pos <= size ; } public AddressableHeap . Handle < K , V > next ( ) { return array [ pos ++ ] ; } public void remove ( ) ... | Get an iterator for all handles currently in the heap . |
6,543 | public String getFullPath ( String path ) { if ( StringUtils . isEmpty ( pathPrefix ) ) { return path ; } return PathNormalizer . asPath ( pathPrefix + path ) ; } | Returns the full path for the specified resource |
6,544 | @ SuppressWarnings ( "unchecked" ) private void updateSuffixMin ( RootListNode < K , V > t ) { if ( comparator == null ) { while ( t != null ) { if ( t . next == null ) { t . suffixMin = t ; } else { RootListNode < K , V > nextSuffixMin = t . next . suffixMin ; if ( ( ( Comparable < ? super K > ) t . root . cKey ) . co... | Update all suffix minimum pointers for a node and all its predecessors in the root list . |
6,545 | private void delete ( RootListNode < K , V > n ) { RootListNode < K , V > nPrev = n . prev ; if ( nPrev != null ) { nPrev . next = n . next ; } else { rootList . head = n . next ; } if ( n . next != null ) { n . next . prev = nPrev ; } else { rootList . tail = nPrev ; } n . prev = null ; n . next = null ; } | Delete a node from the root list . |
6,546 | @ SuppressWarnings ( "unchecked" ) private void delete ( SoftHandle < K , V > n ) { if ( n . tree == null ) { throw new IllegalArgumentException ( "Invalid handle!" ) ; } TreeNode < K , V > tree = n . tree ; if ( tree . cHead != n ) { if ( n . next != null ) { n . next . prev = n . prev ; } n . prev . next = n . next ;... | Delete an element . |
6,547 | public QueryExpression eq ( String propertyName , String value ) { return new SimpleQueryExpression ( propertyName , ComparisonOperator . EQUAL , wrap ( value ) ) ; } | Create an equals expression |
6,548 | public QueryExpression ne ( String propertyName , String value ) { return new SimpleQueryExpression ( propertyName , ComparisonOperator . NOT_EQUAL , wrap ( value ) ) ; } | Create a not equals expression |
6,549 | public QueryExpression gt ( String propertyName , String value ) { return new SimpleQueryExpression ( propertyName , ComparisonOperator . GREATER_THAN , wrap ( value ) ) ; } | Create a greater than expression |
6,550 | public QueryExpression lt ( String propertyName , String value ) { return new SimpleQueryExpression ( propertyName , ComparisonOperator . LESS_THAN , wrap ( value ) ) ; } | Create a less than expression |
6,551 | public QueryExpression ge ( String propertyName , String value ) { return new SimpleQueryExpression ( propertyName , ComparisonOperator . GREATER_THAN_OR_EQUAL , wrap ( value ) ) ; } | Create a greater than or equals expression |
6,552 | public QueryExpression le ( String propertyName , String value ) { return new SimpleQueryExpression ( propertyName , ComparisonOperator . LESS_THAN_OR_EQUAL , wrap ( value ) ) ; } | Create a less than or equals expression |
6,553 | public QueryExpression in ( String propertyName , String ... values ) { return new MultiValueQueryExpression ( propertyName , ComparisonOperator . IN , wrap ( values ) ) ; } | Create an in expression |
6,554 | public QueryExpression notIn ( String propertyName , String ... values ) { return new MultiValueQueryExpression ( propertyName , ComparisonOperator . NOT_IN , wrap ( values ) ) ; } | Create a not in expression |
6,555 | @ SuppressWarnings ( "unchecked" ) private void decreaseKey ( Node < K , V > n , K newKey ) { int c ; if ( comparator == null ) { c = ( ( Comparable < ? super K > ) newKey ) . compareTo ( n . key ) ; } else { c = comparator . compare ( newKey , n . key ) ; } if ( c > 0 ) { throw new IllegalArgumentException ( "Keys can... | Decrease the key of a node . |
6,556 | private Node < K , V > cutChildren ( Node < K , V > n ) { Node < K , V > child = n . o_c ; n . o_c = null ; if ( child != null ) { child . o_s = null ; } return child ; } | Cut the children of a node and return the list . |
6,557 | protected Literal transformLiteralToModel ( AbstractLiteral al ) { if ( al instanceof BigIntegerLiteral ) { return new au . csiro . ontology . model . BigIntegerLiteral ( ( ( BigIntegerLiteral ) al ) . getValue ( ) ) ; } else if ( al instanceof DateLiteral ) { return new au . csiro . ontology . model . DateLiteral ( ( ... | Transforms literal from the internal representation to the canonical representation . |
6,558 | private IConceptSet filterEquivalents ( final IConceptSet concepts ) { int [ ] cArray = concepts . toArray ( ) ; boolean [ ] toExclude = new boolean [ cArray . length ] ; for ( int i = 0 ; i < cArray . length ; i ++ ) { if ( toExclude [ i ] ) continue ; final IConceptSet iAncestors = IConceptSet . FACTORY . createConce... | Identifies any equivalent concepts and retains only one of them . |
6,559 | private IConceptSet getLeaves ( final IConceptSet concepts ) { final IConceptSet filtered = filterEquivalents ( concepts ) ; final IConceptSet leafBs = IConceptSet . FACTORY . createConceptSet ( filtered ) ; final IConceptSet set = IConceptSet . FACTORY . createConceptSet ( leafBs ) ; for ( final IntIterator bItr = set... | Given a set of concepts computes the subset such that no member of the subset is subsumed by another member . |
6,560 | protected String printConcept ( int id ) { Object oid = factory . lookupConceptId ( id ) ; if ( factory . isVirtualConcept ( id ) ) { if ( oid instanceof AbstractConcept ) { return printAbstractConcept ( ( AbstractConcept ) oid ) ; } else { return oid . toString ( ) ; } } else { return ( String ) oid ; } } | Prints a concept given its internal id . Useful for debugging . |
6,561 | private String printAbstractConcept ( AbstractConcept ac ) { if ( ac instanceof au . csiro . snorocket . core . model . Concept ) { au . csiro . snorocket . core . model . Concept c = ( au . csiro . snorocket . core . model . Concept ) ac ; Object o = factory . lookupConceptId ( c . hashCode ( ) ) ; if ( o instanceof S... | Prints an abstract concept . Useful for debugging . |
6,562 | public static String getParameterValueFromQuery ( String query , String paramName ) { String [ ] components = query . split ( "&" ) ; for ( String keyValuePair : components ) { String [ ] pairComponents = keyValuePair . split ( "=" ) ; if ( pairComponents . length == 2 ) { try { String key = URLDecoder . decode ( pairC... | Obtains a parameter with specified name from from query string . The query should be in format param = value¶m = value ... |
6,563 | public static JSONObject extractSecureJson ( Response response ) { try { String responseText = response . getResponseText ( ) ; if ( ! responseText . startsWith ( SECURE_PATTERN_START ) || ! responseText . endsWith ( SECURE_PATTERN_END ) ) { return null ; } int startIndex = responseText . indexOf ( SECURE_PATTERN_START... | Extracts a JSON object from server response with secured string . |
6,564 | public static String buildRewriteDomain ( String backendRoute , String subzone ) throws MalformedURLException { if ( backendRoute == null || backendRoute . isEmpty ( ) ) { logger . error ( "Backend route can't be null." ) ; return null ; } String applicationRoute = backendRoute ; if ( ! applicationRoute . startsWith ( ... | Builds rewrite domain from backend route url . |
6,565 | public static String concatenateUrls ( String rootUrl , String path ) { if ( rootUrl == null || rootUrl . isEmpty ( ) ) { return path ; } if ( path == null || path . isEmpty ( ) ) { return rootUrl ; } String finalUrl ; if ( rootUrl . charAt ( rootUrl . length ( ) - 1 ) == '/' && path . charAt ( 0 ) == '/' ) { finalUrl ... | Concatenates two URLs . The function checks for trailing and preceding slashes in rootUrl and path . |
6,566 | private void init ( NormalisedOntology ont ) { parentTodo = ont . getTodo ( ) ; contextIndex = ont . getContextIndex ( ) ; ontologyNF1 = ont . getOntologyNF1 ( ) ; ontologyNF2 = ont . getOntologyNF2 ( ) ; ontologyNF3 = ont . getOntologyNF3 ( ) ; ontologyNF4 = ont . getOntologyNF4 ( ) ; ontologyNF5 = ont . getOntologyNF... | Initialises the shared variables . |
6,567 | public void primeQueuesIncremental ( MonotonicCollection < IConjunctionQueueEntry > conceptEntries , MonotonicCollection < IRoleQueueEntry > roleEntries , MonotonicCollection < IFeatureQueueEntry > featureEntries ) { if ( conceptEntries != null ) addToConceptQueue ( conceptEntries ) ; if ( roleEntries != null ) roleQue... | Adds queue entries for this concept based on the new axioms added in an incremental classification . |
6,568 | public void deactivate ( ) { active . set ( false ) ; if ( ! ( conceptQueue . isEmpty ( ) && roleQueue . isEmpty ( ) && featureQueue . isEmpty ( ) ) ) { if ( activate ( ) ) { parentTodo . add ( this ) ; } } } | Deactivates the context . Returns true if the context was active and was deactivated by this method call or false otherwise . |
6,569 | public int doEndTag ( ) throws JspException { try { BinaryResourcesHandler rsHandler = null ; if ( ( rsHandler = ( BinaryResourcesHandler ) pageContext . getServletContext ( ) . getAttribute ( JawrConstant . BINARY_CONTEXT_ATTRIBUTE ) ) == null ) throw new IllegalStateException ( "Binary ResourceBundlesHandler not pres... | Render the IMG tag . |
6,570 | protected boolean isBulkInsertionBufferFull ( ) { if ( insertionBufferSize >= insertionBuffer . length ) { return true ; } double sizeAsDouble = size + insertionBufferSize ; return Math . getExponent ( sizeAsDouble ) + 3 >= insertionBuffer . length ; } | Check if the bulk insertion buffer is full . |
6,571 | protected void initCommonGenerators ( ) { commonGenerators . put ( new PrefixedPathResolver ( MESSAGE_BUNDLE_PREFIX ) , ResourceBundleMessagesGenerator . class ) ; Class < ? > classPathGeneratorClass = null ; Class < ? > webJarsGeneratorClass = null ; boolean isWebJarsLocatorPresent = ClassLoaderResourceUtils . isClass... | Initialize the common generators |
6,572 | public static Map < Object , Object > getSupportedProperties ( Object ref ) { if ( null == supportedMIMETypes ) { synchronized ( MIMETypesSupport . class ) { if ( null == supportedMIMETypes ) { try ( InputStream is = ClassLoaderResourceUtils . getResourceAsStream ( MIME_PROPS_LOCATION , ref ) ) { supportedMIMETypes = n... | Returns a Map object containing all the supported media extensions paired to their MIME type . |
6,573 | public CreateSingleRequestBuilder < T , ID > create ( T item ) { return new CreateSingleRequestBuilder < > ( version , type , entityName , item ) ; } | Create a request builder for a create operation for a single item |
6,574 | public QueryRequestBuilder < T , ID > query ( QueryExpression query ) { return new QueryRequestBuilder < T , ID > ( version , type , entityName , query . build ( ) ) ; } | Create a request builder for a query operation using the specified query expression |
6,575 | public QueryRequestBuilder < T , ID > query ( ) { return new QueryRequestBuilder < T , ID > ( version , type , entityName ) ; } | Create a request builder for a query operation using the specified no query |
6,576 | public GetRequestBuilder < T , ID > find ( ID ... ids ) { return new GetRequestBuilder < T , ID > ( version , type , entityName , ids ) ; } | Create a request builder for a find operation using the specified IDs |
6,577 | public UpdateSingleRequestBuilder < T , ID > update ( T item ) { return new UpdateSingleRequestBuilder < > ( version , type , entityName , item ) ; } | Create a request builder for an update operation for a single item |
6,578 | private void initCompositeBundleMap ( List < JoinableResourceBundle > bundles ) { for ( JoinableResourceBundle bundle : bundles ) { if ( bundle . isComposite ( ) ) { List < JoinableResourceBundle > childBundles = ( ( CompositeResourceBundle ) bundle ) . getChildBundles ( ) ; for ( JoinableResourceBundle childBundle : c... | Initialize the composite bundle map |
6,579 | private List < JoinableResourceBundle > getBundlesToRebuild ( ) { List < JoinableResourceBundle > bundlesToRebuild = new ArrayList < > ( ) ; if ( config . getUseSmartBundling ( ) ) { for ( JoinableResourceBundle bundle : globalBundles ) { if ( bundle . isDirty ( ) ) { bundlesToRebuild . add ( bundle ) ; } } for ( Joina... | Returns the bundles which needs to be rebuild |
6,580 | private void initModulesArgs ( Map < String , String > resultBundlePathMapping , List < String > args , List < JoinableResourceBundle > bundles , Map < String , JoinableResourceBundle > bundleMap , String modules , List < String > depModulesArgs , List < String > globalBundleDependencies ) { args . add ( JS_ARG ) ; arg... | Initialize the modules arguments |
6,581 | public int [ ] getRoles ( ) { List < Integer > roles = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < data . length ; i ++ ) { if ( data [ i ] != null ) { roles . add ( i ) ; } } int [ ] res = new int [ roles . size ( ) ] ; for ( int i = 0 ; i < res . length ; i ++ ) { res [ i ] = roles . get ( i ) ; } return re... | Returns the roles stored in this data structure . |
6,582 | public long getContentLength ( ) { try { return getInternalResponse ( ) . body ( ) . contentLength ( ) ; } catch ( NullPointerException e ) { logger . error ( "Failed to get the response content length from " + getRequestURL ( ) + ". Error: " + e . getMessage ( ) ) ; return 0 ; } } | This method gets the Content - Length of the response body . |
6,583 | public Map < String , List < String > > getHeaders ( ) { if ( headers == null ) { return null ; } return headers . toMultimap ( ) ; } | Get the HTTP headers from the response . |
6,584 | public List < String > getHeader ( String name ) { if ( headers == null ) { return null ; } return headers . values ( name ) ; } | Get the header values for the given header name if it exists . There can be more than one value for a given header name . |
6,585 | public String getFirstHeader ( String name ) { List < String > headerValues = getHeader ( name ) ; if ( headerValues == null || headerValues . size ( ) == 0 ) { return null ; } return headerValues . get ( 0 ) ; } | Get the first header value for the given header name if it exists . |
6,586 | @ SuppressWarnings ( "unchecked" ) private void sift ( TreeNode < K > x ) { Deque < TreeNode < K > > stack = new ArrayDeque < TreeNode < K > > ( ) ; stack . push ( x ) ; while ( ! stack . isEmpty ( ) ) { x = stack . peek ( ) ; TreeNode < K > xLeft = x . left ; TreeNode < K > xRight = x . right ; if ( xLeft == null && x... | Sift elements from children nodes until the current node has enough elements in its list . |
6,587 | private TreeNode < K > combine ( TreeNode < K > x , TreeNode < K > y ) { TreeNode < K > z = new TreeNode < K > ( ) ; z . left = x ; z . right = y ; z . rank = x . rank + 1 ; sift ( z ) ; return z ; } | Combine two trees into a new tree . |
6,588 | protected int computeBucket ( K key , K minKey ) { return 1 + Math . min ( msd ( key , minKey ) , buckets . length - 2 ) ; } | Compute the bucket of a key based on a minimum key . |
6,589 | protected void delete ( Node < K , V > n ) { if ( n == root ) { deleteMin ( ) ; return ; } if ( n . y_s == null ) { throw new IllegalArgumentException ( "Invalid handle!" ) ; } Node < K , V > childTree = unlinkAndUnionChildren ( n ) ; Node < K , V > p = getParent ( n ) ; if ( childTree == null ) { if ( p . o_c == n ) {... | Delete a node from the heap . |
6,590 | protected Node < K , V > unlinkAndUnionChildren ( Node < K , V > n ) { Node < K , V > child1 = n . o_c ; if ( child1 == null ) { return null ; } n . o_c = null ; Node < K , V > child2 = child1 . y_s ; if ( child2 == n ) { child2 = null ; } else { child2 . y_s = null ; } child1 . y_s = null ; if ( comparator == null ) {... | Unlink the two children of a node and union them forming a new tree . |
6,591 | protected Node < K , V > unlinkRightChild ( Node < K , V > n ) { Node < K , V > left = n . o_c ; if ( left == null || left . y_s == n ) { return null ; } Node < K , V > right = left . y_s ; left . y_s = n ; right . y_s = null ; return right ; } | Unlink the right child of a node . |
6,592 | @ SuppressWarnings ( "unchecked" ) protected Node < K , V > union ( Node < K , V > root1 , Node < K , V > root2 ) { if ( root1 == null ) { return root2 ; } else if ( root2 == null ) { return root1 ; } Node < K , V > newRoot ; Node < K , V > cur ; int c = ( ( Comparable < ? super K > ) root1 . key ) . compareTo ( root2 ... | Top - down union of two skew heaps . |
6,593 | protected Node < K , V > unionWithComparator ( Node < K , V > root1 , Node < K , V > root2 ) { if ( root1 == null ) { return root2 ; } else if ( root2 == null ) { return root1 ; } Node < K , V > newRoot ; Node < K , V > cur ; int c = comparator . compare ( root1 . key , root2 . key ) ; if ( c <= 0 ) { newRoot = root1 ;... | Top - down union of two skew heaps with comparator . |
6,594 | public List < String > get ( String key ) { if ( key == null ) throw new IllegalArgumentException ( "Null keys not allowed." ) ; return map . get ( key ) ; } | Return the values stored for the supplied key |
6,595 | public String getFirst ( String key ) { if ( key == null ) throw new IllegalArgumentException ( "Null keys not allowed." ) ; List < String > vals = map . get ( key ) ; if ( vals == null || vals . size ( ) == 0 ) return null ; return vals . get ( 0 ) ; } | Return the first value stored for the supplied key |
6,596 | public void set ( String key , String value ) { if ( key == null ) throw new IllegalArgumentException ( "Null keys not allowed." ) ; if ( value == null ) throw new IllegalArgumentException ( "Null values not allowed." ) ; ArrayList < String > vals = new ArrayList < String > ( ) ; vals . add ( value ) ; map . put ( key ... | Set a value for the supplied key . This will overwrite any values that are currently stored for this key . |
6,597 | public void add ( String key , String value ) { if ( key == null ) throw new IllegalArgumentException ( "Null keys not allowed." ) ; if ( value == null ) throw new IllegalArgumentException ( "Null values not allowed." ) ; List < String > vals = map . get ( key ) ; if ( vals == null ) { vals = new ArrayList < String > (... | Add a value for the supplied key . This will add the value to any existing values stored for this key . |
6,598 | public MultiMap merge ( MultiMap multiMap ) { MultiMap result = new MultiMap ( ) ; result . map . putAll ( this . map ) ; result . map . putAll ( multiMap . map ) ; return result ; } | Merge the values in the specified map with the values in this map and return the results in a new map . |
6,599 | public RequestBuilder < T , ID > addParameter ( String name , String value ) { parameters . add ( name , value ) ; return this ; } | Add a parameter to the request . Adds this value to any existing values for this name . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.