idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
24,400 | @ SuppressWarnings ( "UnusedReturnValue" ) public static String webread ( URL url ) throws IOException { StringBuilder result = new StringBuilder ( ) ; HttpURLConnection conn = ( HttpURLConnection ) url . openConnection ( ) ; conn . setRequestMethod ( "GET" ) ; BufferedReader rd = new BufferedReader ( new InputStreamRe... | Sends a GET request to url and retrieves the server response |
24,401 | public static void openInDefaultBrowser ( URL url ) throws IOException { Runtime rt = Runtime . getRuntime ( ) ; if ( SystemUtils . IS_OS_WINDOWS ) { rt . exec ( "rundll32 url.dll,FileProtocolHandler " + url ) ; } else if ( SystemUtils . IS_OS_MAC ) { rt . exec ( "open" + url ) ; } else { String [ ] browsers = { "epiph... | OPens the specified url in the default browser . |
24,402 | public String format ( Object expression , Object objPattern ) { if ( objPattern instanceof String ) { final String pattern = filterPattern ( ( String ) objPattern ) ; if ( expression == null ) { return null ; } if ( expression instanceof LocalDate ) { return create ( ( LocalDate ) expression ) . toDisp ( pattern ) ; }... | Get formatted date string . |
24,403 | private NodeMetadata enrich ( NodeMetadata nodeMetadata , Template template ) { final NodeMetadataBuilder nodeMetadataBuilder = NodeMetadataBuilder . fromNodeMetadata ( nodeMetadata ) ; if ( nodeMetadata . getHardware ( ) == null ) { nodeMetadataBuilder . hardware ( template . getHardware ( ) ) ; } if ( nodeMetadata . ... | Enriches the spawned vm with information of the template if the spawned vm does not contain information about hardware image or location |
24,404 | protected org . jclouds . compute . options . TemplateOptions modifyTemplateOptions ( VirtualMachineTemplate originalVirtualMachineTemplate , org . jclouds . compute . options . TemplateOptions originalTemplateOptions ) { return originalTemplateOptions ; } | Extension point for the template options . Allows the subclass to replace the jclouds template options object with a new one before it is passed to the template builder . |
24,405 | public boolean verify ( ) { this . errors = new LinkedList < > ( ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( generator . generate ( spaceId , ManifestFormat . TSV ) ) ) ) { WriteOnlyStringSet snapshotManifest = ManifestFileHelper . loadManifestSetFromFile ( this . md5Manifest ) ; log ... | Performs the verification . |
24,406 | private static Identifiers handleIdentifiers ( String domainIdOrName , String projectIdOrName , String endpoint , String userId , String password ) { Set < Identifiers > possibleIdentifiers = new HashSet < Identifiers > ( ) { { add ( new Identifiers ( Identifier . byName ( domainIdOrName ) , Identifier . byName ( proje... | This method tries to determine if the authentication should happen by using the user provided information as domain ID or domain name resp . project ID or project name . |
24,407 | protected void configure ( ) { bind ( DiscoveryService . class ) . to ( BaseDiscoveryService . class ) ; bind ( OperatingSystemDetectionStrategy . class ) . to ( NameSubstringBasedOperatingSystemDetectionStrategy . class ) ; } | Can be extended to load own implementation of classes . |
24,408 | public static Update update ( String key , Object value ) { return new Update ( ) . set ( key , value ) ; } | Static factory method to create an Update using the provided key |
24,409 | public static void encryptFields ( Object object , CollectionMetaData cmd , ICipher cipher ) throws IllegalAccessException , IllegalArgumentException , InvocationTargetException { for ( String secretAnnotatedFieldName : cmd . getSecretAnnotatedFieldNames ( ) ) { Method getterMethod = cmd . getGetterMethodForFieldName (... | A utility method to encrypt the value of field marked by the |
24,410 | public static void decryptFields ( Object object , CollectionMetaData cmd , ICipher cipher ) throws IllegalAccessException , IllegalArgumentException , InvocationTargetException { for ( String secretAnnotatedFieldName : cmd . getSecretAnnotatedFieldNames ( ) ) { Method getterMethod = cmd . getGetterMethodForFieldName (... | A utility method to decrypt the value of field marked by the |
24,411 | public static String generate128BitKey ( String password , String salt ) throws NoSuchAlgorithmException , UnsupportedEncodingException , InvalidKeySpecException { SecretKeyFactory factory = SecretKeyFactory . getInstance ( "PBKDF2WithHmacSHA256" ) ; KeySpec spec = new PBEKeySpec ( password . toCharArray ( ) , salt . g... | Utility method to help generate a strong 128 bit Key to be used for the DefaultAESCBCCipher . |
24,412 | public static CollectionSchemaUpdate update ( String key , IOperation operation ) { return new CollectionSchemaUpdate ( ) . set ( key , operation ) ; } | Static factory method to create an CollectionUpdate for the specified key |
24,413 | public CollectionSchemaUpdate set ( String key , IOperation operation ) { collectionUpdateData . put ( key , operation ) ; return this ; } | A method to set a new Operation for a key . It may be of type ADD RENAME or DELETE . Only one operation per key can be specified . Attempt to add a second operation for a any key will override the first one . Attempt to add a ADD operation for a key which already exists will have no effect . Attempt to add a DELETE ope... |
24,414 | public Map < String , AddOperation > getAddOperations ( ) { Map < String , AddOperation > addOperations = new TreeMap < String , AddOperation > ( ) ; for ( Entry < String , IOperation > entry : collectionUpdateData . entrySet ( ) ) { String key = entry . getKey ( ) ; IOperation op = entry . getValue ( ) ; if ( op . get... | Returns a Map of ADD operations which have a non - null default value specified . |
24,415 | public Map < String , RenameOperation > getRenameOperations ( ) { Map < String , RenameOperation > renOperations = new TreeMap < String , RenameOperation > ( ) ; for ( Entry < String , IOperation > entry : collectionUpdateData . entrySet ( ) ) { String key = entry . getKey ( ) ; IOperation op = entry . getValue ( ) ; i... | Returns a Map of RENAME operations . |
24,416 | public Map < String , DeleteOperation > getDeleteOperations ( ) { Map < String , DeleteOperation > delOperations = new TreeMap < String , DeleteOperation > ( ) ; for ( Entry < String , IOperation > entry : collectionUpdateData . entrySet ( ) ) { String key = entry . getKey ( ) ; IOperation op = entry . getValue ( ) ; i... | Returns a Map of DELETE operations . |
24,417 | protected static Object getIdForEntity ( Object document , Method getterMethodForId ) { Object id = null ; if ( null != getterMethodForId ) { try { id = getterMethodForId . invoke ( document ) ; } catch ( IllegalAccessException e ) { logger . error ( "Failed to invoke getter method for a idAnnotated field due to permis... | A utility method to extract the value of field marked by the |
24,418 | protected static Object deepCopy ( Object fromBean ) { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; XMLEncoder out = new XMLEncoder ( bos ) ; out . writeObject ( fromBean ) ; out . close ( ) ; ByteArrayInputStream bis = new ByteArrayInputStream ( bos . toByteArray ( ) ) ; XMLDecoder in = new XMLDecoder (... | A utility method that creates a deep clone of the specified object . There is no other way of doing this reliably . |
24,419 | public static boolean stampVersion ( JsonDBConfig dbConfig , File f , String version ) { FileOutputStream fos = null ; OutputStreamWriter osr = null ; BufferedWriter writer = null ; try { fos = new FileOutputStream ( f ) ; osr = new OutputStreamWriter ( fos , dbConfig . getCharset ( ) ) ; writer = new BufferedWriter ( ... | Utility to stamp the version into a newly created . json File This method is expected to be invoked on a newly created . json file before it is usable . So no locking code required . |
24,420 | public String decrypt ( String cipherText ) { this . decryptionLock . lock ( ) ; try { String decryptedValue = null ; try { byte [ ] bytes = Base64 . getDecoder ( ) . decode ( cipherText ) ; decryptedValue = new String ( decryptCipher . doFinal ( bytes ) , charset ) ; } catch ( UnsupportedEncodingException | IllegalBlo... | A method to decrypt the provided cipher text . |
24,421 | public int compare ( String expected , String actual ) { String [ ] vals1 = expected . split ( "\\." ) ; String [ ] vals2 = actual . split ( "\\." ) ; int i = 0 ; while ( i < vals1 . length && i < vals2 . length && vals1 [ i ] . equals ( vals2 [ i ] ) ) { i ++ ; } if ( i < vals1 . length && i < vals2 . length ) { int d... | compare the expected version with the actual version . |
24,422 | public static Keyword keyword ( Object o ) { if ( o instanceof Keyword ) return ( Keyword ) o ; else if ( o instanceof String ) { String s = ( String ) o ; if ( s . charAt ( 0 ) == ':' ) return new KeywordImpl ( s . substring ( 1 ) ) ; else return new KeywordImpl ( s ) ; } else throw new IllegalArgumentException ( "Can... | Converts a string or keyword to a keyword |
24,423 | public static Symbol symbol ( Object o ) { if ( o instanceof Symbol ) return ( Symbol ) o ; else if ( o instanceof String ) { String s = ( String ) o ; if ( s . charAt ( 0 ) == ':' ) return new SymbolImpl ( s . substring ( 1 ) ) ; else return new SymbolImpl ( s ) ; } else throw new IllegalArgumentException ( "Cannot ma... | Converts a string or a symbol to a symbol |
24,424 | public static < T > TaggedValue < T > taggedValue ( String tag , T rep ) { return new TaggedValueImpl < T > ( tag , rep ) ; } | Creates a TaggedValue |
24,425 | private long readNumber ( int firstChar , boolean isNeg ) throws IOException { out . unsafeWrite ( firstChar ) ; long v = '0' - firstChar ; int i ; for ( i = 0 ; i < 17 ; i ++ ) { int ch = getChar ( ) ; switch ( ch ) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : ca... | Returns the long read ... only significant if valstate == LONG after this call . firstChar should be the first numeric digit read . |
24,426 | private int readFrac ( CharArr arr , int lim ) throws IOException { nstate = HAS_FRACTION ; while ( -- lim >= 0 ) { int ch = getChar ( ) ; if ( ch >= '0' && ch <= '9' ) { arr . write ( ch ) ; } else if ( ch == 'e' || ch == 'E' ) { arr . write ( ch ) ; return readExp ( arr , lim ) ; } else { if ( ch != - 1 ) start -- ; ... | read digits right of decimal point |
24,427 | private int readExp ( CharArr arr , int lim ) throws IOException { nstate |= HAS_EXPONENT ; int ch = getChar ( ) ; lim -- ; if ( ch == '+' || ch == '-' ) { arr . write ( ch ) ; ch = getChar ( ) ; lim -- ; } if ( ch < '0' || ch > '9' ) { throw err ( "missing exponent number" ) ; } arr . write ( ch ) ; return readExpDigi... | call after e or E has been seen to read the rest of the exponent |
24,428 | private int readExpDigits ( CharArr arr , int lim ) throws IOException { while ( -- lim >= 0 ) { int ch = getChar ( ) ; if ( ch >= '0' && ch <= '9' ) { arr . write ( ch ) ; } else { if ( ch != - 1 ) start -- ; return NUMBER ; } } return BIGNUMBER ; } | continuation of readExpStart |
24,429 | private char readEscapedChar ( ) throws IOException { int ch = getChar ( ) ; switch ( ch ) { case '"' : return '"' ; case '\'' : return '\'' ; case '\\' : return '\\' ; case '/' : return '/' ; case 'n' : return '\n' ; case 'r' : return '\r' ; case 't' : return '\t' ; case 'f' : return '\f' ; case 'b' : return '\b' ; ca... | backslash has already been read when this is called |
24,430 | private void readStringChars2 ( CharArr arr , int middle ) throws IOException { if ( stringTerm == 0 ) { readStringBare ( arr ) ; return ; } char terminator = ( char ) stringTerm ; for ( ; ; ) { if ( middle >= end ) { arr . write ( buf , start , middle - start ) ; start = middle ; getMore ( ) ; middle = start ; } int c... | this should be faster for strings with fewer escapes but probably slower for many escapes . |
24,431 | public void getNumberChars ( CharArr output ) throws IOException { int ev = 0 ; if ( valstate == 0 ) ev = nextEvent ( ) ; if ( valstate == LONG || valstate == NUMBER ) output . write ( this . out ) ; else if ( valstate == BIGNUMBER ) { continueNumber ( output ) ; } else { throw err ( "Unexpected " + ev ) ; } valstate =... | Reads a JSON numeric value into the output . |
24,432 | public long parseLong ( char [ ] arr , int start , int end ) { long x = 0 ; boolean negative = arr [ start ] == '-' ; for ( int i = negative ? start + 1 : start ; i < end ; i ++ ) { x = x * 10 + ( arr [ i ] - '0' ) ; } return negative ? - x : x ; } | belongs in number utils or charutil? |
24,433 | protected SocketFactory createSocketFactory ( InetAddress address , int port , InetAddress localAddr , int localPort , long timeout ) { SocketFactory factory ; factory = new PlainSocketFactory ( address , port , localAddr , localPort , timeout ) ; factory = new PooledSocketFactory ( factory ) ; factory = new LazySocket... | Create socket factories for newly resolved addresses . Default implementation returns a LazySocketFactory wrapping a PooledSocketFactory wrapping a PlainSocketFactory . |
24,434 | public String encodeIntArray ( int [ ] input ) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; int length = input . length ; dos . writeInt ( length ) ; for ( int i = 0 ; i < length ; i ++ ) { dos . writeInt ( input [ i ] ) ; } retur... | Encode the given integer array into Base64 format . |
24,435 | public int [ ] decodeIntArray ( String input ) throws IOException { int [ ] result = null ; ByteArrayInputStream bis = new ByteArrayInputStream ( Base64 . decodeBase64 ( input ) ) ; DataInputStream dis = new DataInputStream ( bis ) ; int length = dis . readInt ( ) ; result = new int [ length ] ; for ( int i = 0 ; i < l... | Decode the given Base64 encoded value into an integer array . |
24,436 | public String decodeHexToString ( String str ) throws DecoderException { String result = null ; byte [ ] bytes = Hex . decodeHex ( str . toCharArray ( ) ) ; if ( bytes != null && bytes . length > 0 ) { result = new String ( bytes ) ; } return result ; } | Decode the given hexidecimal formatted value into a string representing the bytes of the decoded value . |
24,437 | public String getName ( ) { FeatureDescriptor fd = getFeatureDescriptor ( ) ; if ( fd == null ) { return null ; } return fd . getName ( ) ; } | Returns the feature name |
24,438 | public String getDescription ( ) { FeatureDescriptor fd = getFeatureDescriptor ( ) ; if ( fd == null ) { return "" ; } return getTeaToolsUtils ( ) . getDescription ( fd ) ; } | Returns the shortDescription or if the shortDescription is the same as the displayName . |
24,439 | public String getQualifiedTypeNameForFile ( ) { String typeName = getTypeNameForFile ( ) ; String qualifiedTypeName = mDoc . qualifiedTypeName ( ) ; int packageLength = qualifiedTypeName . length ( ) - typeName . length ( ) ; if ( packageLength <= 0 ) { return typeName ; } String packagePath = qualifiedTypeName . subst... | Converts inner class names . |
24,440 | public MethodDoc getMatchingMethod ( MethodDoc method ) { MethodDoc [ ] methods = getMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { if ( method . getName ( ) . equals ( methods [ i ] . getName ( ) ) && method . getSignature ( ) . equals ( methods [ i ] . getSignature ( ) ) ) { return methods [ i ] ; } ... | Get a MethodDoc in this ClassDoc with a name and signature matching that of the specified MethodDoc |
24,441 | public MethodDoc getMatchingMethod ( MethodDoc method , MethodFinder mf ) { MethodDoc md = getMatchingMethod ( method ) ; if ( md != null ) { if ( mf . checkMethod ( md ) ) { return md ; } } return null ; } | Get a MethodDoc in this ClassDoc with a name and signature matching that of the specified MethodDoc and accepted by the specified MethodFinder |
24,442 | public MethodDoc findMatchingMethod ( MethodDoc method , MethodFinder mf ) { MethodDoc md = findMatchingInterfaceMethod ( method , mf ) ; if ( md != null ) { return md ; } ClassDoc superClass = getSuperclass ( ) ; if ( superClass != null ) { md = superClass . getMatchingMethod ( method , mf ) ; if ( md != null ) { retu... | Find a MethodDoc with a name and signature matching that of the specified MethodDoc and accepted by the specified MethodFinder . This method searches the interfaces and super class ancestry of the class represented by this ClassDoc for a matching method . |
24,443 | public String getTagValue ( String tagName ) { Tag [ ] tags = getTagMap ( ) . get ( tagName ) ; if ( tags == null || tags . length == 0 ) { return null ; } return tags [ tags . length - 1 ] . getText ( ) ; } | Gets the text value of the first tag in doc that matches tagName |
24,444 | public static Map < String , PropertyDescriptor > getAllProperties ( GenericType root ) throws IntrospectionException { Map < String , PropertyDescriptor > properties = cPropertiesCache . get ( root ) ; if ( properties == null ) { GenericType rootType = root . getRootType ( ) ; if ( rootType == null ) { rootType = root... | A function that returns a Map of all the available properties on a given class including write - only properties . The properties returned is mostly a superset of those returned from the standard JavaBeans Introspector except pure indexed properties are discarded . |
24,445 | public static String findTemplateName ( org . teatrove . tea . compiler . Scanner scanner ) { Token token ; String name = null ; try { while ( ( ( token = scanner . readToken ( ) ) . getID ( ) ) != Token . EOF ) { if ( token . getID ( ) == Token . TEMPLATE ) { token = scanner . readToken ( ) ; if ( token . getID ( ) ==... | Finds the name of the template using the specified tea scanner . |
24,446 | public Template parseTeaTemplate ( String templateName ) throws IOException { if ( templateName == null ) { return null ; } preserveParseTree ( templateName ) ; compile ( templateName ) ; CompilationUnit unit = getCompilationUnit ( templateName , null ) ; if ( unit == null ) { return null ; } return unit . getParseTree... | Perform Tea parsing . This method will compile the named template . |
24,447 | public boolean isValueKnown ( ) { Type type = getType ( ) ; if ( type != null ) { Class < ? > clazz = type . getObjectClass ( ) ; return Number . class . isAssignableFrom ( clazz ) || clazz . isAssignableFrom ( Number . class ) ; } else { return false ; } } | Value is known only if type is a number or can be assigned a number . |
24,448 | public Object [ ] cloneArray ( Object [ ] array ) { Class < ? > clazz = array . getClass ( ) . getComponentType ( ) ; Object newArray = Array . newInstance ( clazz , array . length ) ; System . arraycopy ( array , 0 , newArray , 0 , array . length ) ; return ( Object [ ] ) newArray ; } | Clone the given array into a new instance of the same type and dimensions . The values are directly copied by memory so this is not a deep clone operation . However manipulation of the contents of the array will not impact the given array . |
24,449 | public HttpClient setHeader ( String name , Object value ) { if ( mHeaders == null ) { mHeaders = new HttpHeaderMap ( ) ; } mHeaders . put ( name , value ) ; return this ; } | Set a header name - value pair to the request . |
24,450 | public HttpClient addHeader ( String name , Object value ) { if ( mHeaders == null ) { mHeaders = new HttpHeaderMap ( ) ; } mHeaders . add ( name , value ) ; return this ; } | Add a header name - value pair to the request in order for multiple values to be specified . |
24,451 | public Response getResponse ( PostData postData ) throws ConnectException , SocketException { CheckedSocket socket = mFactory . getSocket ( mSession ) ; try { CharToByteBuffer request = new FastCharToByteBuffer ( new DefaultByteBuffer ( ) , "8859_1" ) ; request = new InternedCharToByteBuffer ( request ) ; request . app... | Opens a connection passes on the current request settings and returns the server s response . The optional PostData parameter is used to supply post data to the server . The Content - Length header specifies how much data will be read from the PostData InputStream . If it is not specified data will be read from the Inp... |
24,452 | public void addRootLogListener ( LogListener listener ) { if ( mParent == null ) { addLogListener ( listener ) ; } else { mParent . addRootLogListener ( listener ) ; } } | adds a listener to the root log the log with a null parent |
24,453 | public void debug ( String s ) { if ( isEnabled ( ) && isDebugEnabled ( ) ) { dispatchLogMessage ( new LogEvent ( this , LogEvent . DEBUG_TYPE , s ) ) ; } } | Simple method for logging a single debugging message . |
24,454 | public void debug ( Throwable t ) { if ( isEnabled ( ) && isDebugEnabled ( ) ) { dispatchLogException ( new LogEvent ( this , LogEvent . DEBUG_TYPE , t ) ) ; } } | Simple method for logging a single debugging exception . |
24,455 | public void info ( String s ) { if ( isEnabled ( ) && isInfoEnabled ( ) ) { dispatchLogMessage ( new LogEvent ( this , LogEvent . INFO_TYPE , s ) ) ; } } | Simple method for logging a single information message . |
24,456 | public void info ( Throwable t ) { if ( isEnabled ( ) && isInfoEnabled ( ) ) { dispatchLogException ( new LogEvent ( this , LogEvent . INFO_TYPE , t ) ) ; } } | Simple method for logging a single information exception . |
24,457 | public void warn ( String s ) { if ( isEnabled ( ) && isWarnEnabled ( ) ) { dispatchLogMessage ( new LogEvent ( this , LogEvent . WARN_TYPE , s ) ) ; } } | Simple method for logging a single warning message . |
24,458 | public void warn ( Throwable t ) { if ( isEnabled ( ) && isWarnEnabled ( ) ) { dispatchLogException ( new LogEvent ( this , LogEvent . WARN_TYPE , t ) ) ; } } | Simple method for logging a single warning exception . |
24,459 | public void error ( String s ) { if ( isEnabled ( ) && isErrorEnabled ( ) ) { dispatchLogMessage ( new LogEvent ( this , LogEvent . ERROR_TYPE , s ) ) ; } } | Simple method for logging a single error message . |
24,460 | public void error ( Throwable t ) { if ( isEnabled ( ) && isErrorEnabled ( ) ) { dispatchLogException ( new LogEvent ( this , LogEvent . ERROR_TYPE , t ) ) ; } } | Simple method for logging a single error exception . |
24,461 | public Log [ ] getChildren ( ) { Collection copy ; synchronized ( mChildren ) { copy = new ArrayList ( mChildren . size ( ) ) ; Iterator it = mChildren . iterator ( ) ; while ( it . hasNext ( ) ) { Log child = ( Log ) ( ( WeakReference ) it . next ( ) ) . get ( ) ; if ( child == null ) { it . remove ( ) ; } else { copy... | Returns a copy of the children Logs . |
24,462 | public void setEnabled ( boolean enabled ) { setEnabled ( enabled , ENABLED_MASK ) ; if ( enabled ) { Log parent ; if ( ( parent = mParent ) != null ) { parent . setEnabled ( true ) ; } } } | When this Log is enabled all parent Logs are also enabled . When this Log is disabled parent Logs are unaffected . |
24,463 | public void applyProperties ( Map properties ) { if ( properties . containsKey ( "enabled" ) ) { setEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "enabled" ) ) ) ; } if ( properties . containsKey ( "debug" ) ) { setDebugEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "deb... | Understands and applies the following boolean properties . True is the default value if the value doesn t equal false ignoring case . |
24,464 | private static PropertyDescriptor [ ] [ ] getBeanProperties ( Class < ? > beanType ) { List < PropertyDescriptor > readProperties = new ArrayList < PropertyDescriptor > ( ) ; List < PropertyDescriptor > writeProperties = new ArrayList < PropertyDescriptor > ( ) ; try { Map < ? , ? > map = CompleteIntrospector . getAllP... | Returns two arrays of PropertyDescriptors . Array 0 has contains read PropertyDescriptors array 1 contains the write PropertyDescriptors . |
24,465 | static void writeShort ( OutputStream out , int i ) throws IOException { out . write ( ( byte ) i ) ; out . write ( ( byte ) ( i >> 8 ) ) ; } | Writes a short in Intel byte order . |
24,466 | void appendCompressed ( ByteData compressed , ByteData original ) throws IOException { mCompressedSegments ++ ; mBuffer . appendSurrogate ( new CompressedData ( compressed , original ) ) ; } | Called from DetachedResponseImpl . |
24,467 | public static int toDecimalDigits ( float v , char [ ] digits , int offset , int maxDigits , int maxFractDigits , int roundMode ) { int bits = Float . floatToIntBits ( v ) ; int f = bits & 0x7fffff ; int e = ( bits >> 23 ) & 0xff ; if ( e != 0 ) { return toDecimalDigits ( f + 0x800000 , e - 126 , 24 , digits , offset ,... | Produces decimal digits for non - zero finite floating point values . The sign of the value is discarded . Passing in Infinity or NaN produces invalid digits . The maximum number of decimal digits that this function will likely produce is 9 . |
24,468 | public static int toDecimalDigits ( double v , char [ ] digits , int offset , int maxDigits , int maxFractDigits , int roundMode ) { long bits = Double . doubleToLongBits ( v ) ; long f = bits & 0xfffffffffffffL ; int e = ( int ) ( ( bits >> 52 ) & 0x7ff ) ; if ( e != 0 ) { return toDecimalDigits ( f + 0x10000000000000... | Produces decimal digits for non - zero finite floating point values . The sign of the value is discarded . Passing in Infinity or NaN produces invalid digits . The maximum number of decimal digits that this function will likely produce is 18 . |
24,469 | public TransactionQueueData add ( TransactionQueueData data ) { return new TransactionQueueData ( null , Math . min ( mSnapshotStart , data . mSnapshotStart ) , Math . max ( mSnapshotEnd , data . mSnapshotEnd ) , mQueueSize + data . mQueueSize , mThreadCount + data . mThreadCount , mServicingCount + data . mServicingCo... | Adds TransactionQueueData to another . |
24,470 | public Object get ( Object key ) { Object value = mCacheMap . get ( key ) ; if ( value != null || mCacheMap . containsKey ( key ) ) { return value ; } value = mBackingMap . get ( key ) ; if ( value != null || mBackingMap . containsKey ( key ) ) { mCacheMap . put ( key , value ) ; } return value ; } | Returns the value from the cache or if not found the backing map . If the backing map is accessed the value is saved in the cache for future gets . |
24,471 | public Object put ( Object key , Object value ) { mCacheMap . put ( key , value ) ; return mBackingMap . put ( key , value ) ; } | Puts the entry into both the cache and backing map . The old value in the backing map is returned . |
24,472 | public Object remove ( Object key ) { mCacheMap . remove ( key ) ; return mBackingMap . remove ( key ) ; } | Removes the key from both the cache and backing map . The old value in the backing map is returned . |
24,473 | public Plugin getPlugin ( String name ) { if ( mPluginContext != null ) { return mPluginContext . getPlugin ( name ) ; } return null ; } | Returns a Plugin by name . |
24,474 | public Plugin [ ] getPlugins ( ) { if ( mPluginContext != null ) { Collection c = mPluginContext . getPlugins ( ) . values ( ) ; if ( c != null ) { return ( Plugin [ ] ) c . toArray ( new Plugin [ c . size ( ) ] ) ; } } return new Plugin [ 0 ] ; } | Returns an array of all of the Plugins . |
24,475 | public boolean isOwnedBy ( String possibleOwner ) { boolean retval = false ; if ( this . owner != null ) { retval = ( this . owner . compareTo ( possibleOwner ) == 0 ) ; } return retval ; } | Convenience function for comparing possibleOwner against this . owner |
24,476 | public void deleteAtManagementGroup ( String policySetDefinitionName , String managementGroupId ) { deleteAtManagementGroupWithServiceResponseAsync ( policySetDefinitionName , managementGroupId ) . toBlocking ( ) . single ( ) . body ( ) ; } | Deletes a policy set definition . This operation deletes the policy set definition in the given management group with the given name . |
24,477 | public void delete ( String resourceGroupName , String workflowName ) { deleteWithServiceResponseAsync ( resourceGroupName , workflowName ) . toBlocking ( ) . single ( ) . body ( ) ; } | Deletes a workflow . |
24,478 | public Observable < Page < WorkflowInner > > listByResourceGroupNextAsync ( final String nextPageLink ) { return listByResourceGroupNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < WorkflowInner > > , Page < WorkflowInner > > ( ) { public Page < WorkflowInner > call ( ServiceRe... | Gets a list of workflows by resource group . |
24,479 | public Observable < Page < ClusterInner > > listByResourceGroupAsync ( String resourceGroupName ) { return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < List < ClusterInner > > , Page < ClusterInner > > ( ) { public Page < ClusterInner > call ( ServiceResponse <... | Lists all Kusto clusters within a resource group . |
24,480 | public static EntityGetOperation < AssetDeliveryPolicyInfo > get ( String assetDeliveryPolicyId ) { return new DefaultGetOperation < AssetDeliveryPolicyInfo > ( ENTITY_SET , assetDeliveryPolicyId , AssetDeliveryPolicyInfo . class ) ; } | Create an operation that will retrieve the given asset delivery policy |
24,481 | public static DefaultListOperation < AssetDeliveryPolicyInfo > list ( LinkInfo < AssetDeliveryPolicyInfo > link ) { return new DefaultListOperation < AssetDeliveryPolicyInfo > ( link . getHref ( ) , new GenericType < ListResult < AssetDeliveryPolicyInfo > > ( ) { } ) ; } | Create an operation that will list all the asset delivery policies at the given link . |
24,482 | public Observable < AdvisorListResultInner > listByDatabaseAsync ( String resourceGroupName , String serverName , String databaseName ) { return listByDatabaseWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) . map ( new Func1 < ServiceResponse < AdvisorListResultInner > , AdvisorListResultInne... | Returns a list of database advisors . |
24,483 | public AdvisorInner createOrUpdate ( String resourceGroupName , String serverName , String databaseName , String advisorName , AutoExecuteStatus autoExecuteValue ) { return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , advisorName , autoExecuteValue ) . toBlocking ( ) . single... | Creates or updates a database advisor . |
24,484 | public static MSICredentials getMSICredentials ( String managementEndpoint ) { String websiteName = System . getenv ( "WEBSITE_SITE_NAME" ) ; if ( websiteName != null && ! websiteName . isEmpty ( ) ) { MSIConfigurationForAppService config = new MSIConfigurationForAppService ( managementEndpoint ) ; return forAppService... | This method checks if the env vars MSI_ENDPOINT and MSI_SECRET exist . If they do we return the msi creds class for APP Svcs otherwise we return one for VM |
24,485 | T unsafeGetIfOpened ( ) { if ( innerObject != null && innerObject . getState ( ) == IOObject . IOObjectState . OPENED ) { return innerObject ; } return null ; } | should be invoked from reactor thread |
24,486 | public void delete ( String resourceGroupName , String registryName , String taskName ) { deleteWithServiceResponseAsync ( resourceGroupName , registryName , taskName ) . toBlocking ( ) . last ( ) . body ( ) ; } | Deletes a specified task . |
24,487 | public static void main ( String [ ] args ) throws NoSuchAlgorithmException , InvalidKeyException { final String connectionString = "endpoint={endpoint_value};id={id_value};name={secret_value}" ; final HttpMethodRequestTracker tracker = new HttpMethodRequestTracker ( ) ; final ConfigurationAsyncClient client = Configur... | Runs the sample algorithm and demonstrates how to add a custom policy to the HTTP pipeline . |
24,488 | public ConnectionStringBuilder setEndpoint ( String namespaceName , String domainName ) { try { this . endpoint = new URI ( String . format ( Locale . US , END_POINT_FORMAT , namespaceName , domainName ) ) ; } catch ( URISyntaxException exception ) { throw new IllegalConnectionStringFormatException ( String . format ( ... | Set an endpoint which can be used to connect to the EventHub instance . |
24,489 | public void marshalEntry ( Object content , OutputStream stream ) throws JAXBException { marshaller . marshal ( createEntry ( content ) , stream ) ; } | Convert the given content into an ATOM entry and write it to the given stream . |
24,490 | public Observable < Page < VaultInner > > listByResourceGroupAsync ( final String resourceGroupName , final Integer top ) { return listByResourceGroupWithServiceResponseAsync ( resourceGroupName , top ) . map ( new Func1 < ServiceResponse < Page < VaultInner > > , Page < VaultInner > > ( ) { public Page < VaultInner > ... | The List operation gets information about the vaults associated with the subscription and within the specified resource group . |
24,491 | public void setData ( String key , Object value ) { this . data = this . data . addData ( key , value ) ; } | Stores a key - value data in the context . |
24,492 | private void resetInputStreams ( ) throws IOException , MessagingException { for ( int ix = 0 ; ix < this . getCount ( ) ; ix ++ ) { BodyPart part = this . getBodyPart ( ix ) ; if ( part . getContent ( ) instanceof MimeMultipart ) { MimeMultipart subContent = ( MimeMultipart ) part . getContent ( ) ; for ( int jx = 0 ;... | reset all input streams to allow redirect filter to write the output twice |
24,493 | public Observable < Page < IntegrationAccountSessionInner > > listByIntegrationAccountsNextAsync ( final String nextPageLink ) { return listByIntegrationAccountsNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < IntegrationAccountSessionInner > > , Page < IntegrationAccountSessio... | Gets a list of integration account sessions . |
24,494 | public static JWSObject deserialize ( String json ) throws IOException { ObjectMapper mapper = new ObjectMapper ( ) ; return mapper . readValue ( json , JWSObject . class ) ; } | Construct JWSObject from json string . |
24,495 | public KeyIdentifier keyIdentifier ( ) { if ( key ( ) == null || key ( ) . kid ( ) == null || key ( ) . kid ( ) . length ( ) == 0 ) { return null ; } return new KeyIdentifier ( key ( ) . kid ( ) ) ; } | The key identifier . |
24,496 | public Map < String , String > getCachedChallenge ( HttpUrl url ) { if ( url == null ) { return null ; } String authority = getAuthority ( url ) ; authority = authority . toLowerCase ( Locale . ENGLISH ) ; return cachedChallenges . get ( authority ) ; } | Uses authority to retrieve the cached values . |
24,497 | public void addCachedChallenge ( HttpUrl url , Map < String , String > challenge ) { if ( url == null || challenge == null ) { return ; } String authority = getAuthority ( url ) ; authority = authority . toLowerCase ( Locale . ENGLISH ) ; cachedChallenges . put ( authority , challenge ) ; } | Uses authority to cache challenge . |
24,498 | public String getAuthority ( HttpUrl url ) { String scheme = url . scheme ( ) ; String host = url . host ( ) ; int port = url . port ( ) ; StringBuilder builder = new StringBuilder ( ) ; if ( scheme != null ) { builder . append ( scheme ) . append ( "://" ) ; } builder . append ( host ) ; if ( port >= 0 ) { builder . a... | Gets authority of a url . |
24,499 | static Mono < Object > decode ( HttpResponse httpResponse , SerializerAdapter serializer , HttpResponseDecodeData decodeData ) { Type headerType = decodeData . headersType ( ) ; if ( headerType == null ) { return Mono . empty ( ) ; } else { return Mono . defer ( ( ) -> { try { return Mono . just ( deserializeHeaders ( ... | Decode headers of the http response . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.