signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Command { /** * Create a CORBA Any object and insert an long data in it . * @ param data The int data to be inserted into the Any object * @ exception DevFailed If the Any object creation failed . * Click < a href = " . . / . . / tango _ basic / idl _ html / Tango . html # DevFailed " > here < / a > to read * < b > DevFailed < / b > exception specification */ public Any insert_u ( long data ) throws DevFailed { } }
Any out_any = alloc_any ( ) ; out_any . insert_longlong ( data ) ; return out_any ;
public class IntBigArrays { /** * Sorts the specified range of elements according to the order induced by the specified * comparator using quicksort . * < p > The sorting algorithm is a tuned quicksort adapted from Jon L . Bentley and M . Douglas * McIlroy , & ldquo ; Engineering a Sort Function & rdquo ; , < i > Software : Practice and Experience < / i > , 23(11 ) , pages * 1249 & minus ; 1265 , 1993. * @ param x the big array to be sorted . * @ param from the index of the first element ( inclusive ) to be sorted . * @ param to the index of the last element ( exclusive ) to be sorted . * @ param comp the comparator to determine the sorting order . */ @ SuppressWarnings ( "checkstyle:InnerAssignment" ) public static void quickSort ( final int [ ] [ ] x , final long from , final long to , final IntComparator comp ) { } }
final long len = to - from ; // Selection sort on smallest arrays if ( len < SMALL ) { selectionSort ( x , from , to , comp ) ; return ; } // Choose a partition element , v long m = from + len / 2 ; // Small arrays , middle element if ( len > SMALL ) { long l = from ; long n = to - 1 ; if ( len > MEDIUM ) { // Big arrays , pseudomedian of 9 long s = len / 8 ; l = med3 ( x , l , l + s , l + 2 * s , comp ) ; m = med3 ( x , m - s , m , m + s , comp ) ; n = med3 ( x , n - 2 * s , n - s , n , comp ) ; } m = med3 ( x , l , m , n , comp ) ; // Mid - size , med of 3 } final int v = get ( x , m ) ; // Establish Invariant : v * ( < v ) * ( > v ) * v * long a = from ; long b = a ; long c = to - 1 ; long d = c ; while ( true ) { int comparison ; while ( b <= c && ( comparison = comp . compare ( get ( x , b ) , v ) ) <= 0 ) { if ( comparison == 0 ) { swap ( x , a ++ , b ) ; } b ++ ; } while ( c >= b && ( comparison = comp . compare ( get ( x , c ) , v ) ) >= 0 ) { if ( comparison == 0 ) { swap ( x , c , d -- ) ; } c -- ; } if ( b > c ) { break ; } swap ( x , b ++ , c -- ) ; } // Swap partition elements back to middle long s ; long n = to ; s = Math . min ( a - from , b - a ) ; vecSwap ( x , from , b - s , s ) ; s = Math . min ( d - c , n - d - 1 ) ; vecSwap ( x , b , n - s , s ) ; // Recursively sort non - partition - elements if ( ( s = b - a ) > 1 ) { quickSort ( x , from , from + s , comp ) ; } if ( ( s = d - c ) > 1 ) { quickSort ( x , n - s , n , comp ) ; }
public class CertDuplicator { /** * Create a self - signed certificate that duplicates as many of the given cert ' s fields as possible . * @ param cert Source certificate * @ return A self - signed X509Certificate certificate , not null */ static public X509Certificate duplicate ( X509Certificate cert ) { } }
// log . info ( " Duplicating cert = { } . " , cert ) ; X500Principal prince = cert . getSubjectX500Principal ( ) ; log . info ( "Principal={}." , prince . getName ( ) ) ; KeyPairGenerator kpg ; try { kpg = KeyPairGenerator . getInstance ( "RSA" ) ; } catch ( NoSuchAlgorithmException e1 ) { // TODO Auto - generated catch block throw new UnsupportedOperationException ( "OGTE TODO!" , e1 ) ; } KeyPair keyPair = kpg . generateKeyPair ( ) ; AlgorithmId alg ; try { alg = new AlgorithmId ( new ObjectIdentifier ( cert . getSigAlgOID ( ) ) ) ; } catch ( IOException e1 ) { // TODO Auto - generated catch block throw new UnsupportedOperationException ( "OGTE TODO!" , e1 ) ; } X509CertInfo info = new X509CertInfo ( ) ; try { info . set ( X509CertInfo . SUBJECT , new CertificateSubjectName ( new X500Name ( prince . getName ( ) ) ) ) ; info . set ( X509CertInfo . KEY , new CertificateX509Key ( keyPair . getPublic ( ) ) ) ; info . set ( X509CertInfo . VALIDITY , new CertificateValidity ( cert . getNotBefore ( ) , cert . getNotAfter ( ) ) ) ; info . set ( X509CertInfo . ISSUER , new CertificateIssuerName ( new X500Name ( prince . getName ( ) ) ) ) ; info . set ( X509CertInfo . ALGORITHM_ID , new CertificateAlgorithmId ( alg ) ) ; info . set ( X509CertInfo . SERIAL_NUMBER , new CertificateSerialNumber ( cert . getSerialNumber ( ) ) ) ; info . set ( X509CertInfo . VERSION , new CertificateVersion ( cert . getVersion ( ) - 1 ) ) ; // info . set ( x509CertInfo . EXTENSIONS , cert . get ) } catch ( CertificateException | IOException e ) { // TODO Auto - generated catch block throw new UnsupportedOperationException ( "OGTE TODO!" , e ) ; } log . info ( "Cert info={}." , info ) ; X509CertImpl newCert = new X509CertImpl ( info ) ; try { newCert . sign ( keyPair . getPrivate ( ) , alg . getName ( ) ) ; } catch ( InvalidKeyException | CertificateException | NoSuchAlgorithmException | NoSuchProviderException | SignatureException e ) { // TODO Auto - generated catch block throw new UnsupportedOperationException ( "OGTE TODO!" , e ) ; } log . info ( "Returning new cert={}." , newCert ) ; return newCert ;
public class FunctionReturnDecoder { /** * Decode ABI encoded return values from smart contract function call . * @ param rawInput ABI encoded input * @ param outputParameters list of return types as { @ link TypeReference } * @ return { @ link List } of values returned by function , { @ link Collections # emptyList ( ) } if * invalid response */ public static List < Type > decode ( String rawInput , List < TypeReference < Type > > outputParameters ) { } }
String input = Numeric . cleanHexPrefix ( rawInput ) ; if ( Strings . isEmpty ( input ) ) { return Collections . emptyList ( ) ; } else { return build ( input , outputParameters ) ; }
public class Num { /** * Convert < tt > Num < / tt > to defined custom object * @ param customObject * @ return */ public < T > T toObject ( Class < T > toClass , Class < ? extends NumConverter > converterClass ) { } }
return ( T ) toObject ( toClass , null , converterClass ) ;
public class AbstractTypeConvertingMap { /** * Obtains a date for the given parameter name and format * @ param name The name of the parameter * @ param formats The formats * @ return The date object or null if it cannot be parsed */ public Date date ( String name , Collection < String > formats ) { } }
return getDate ( name , formats ) ;
public class PropertyUtils { /** * Similar to { @ link PropertyUtils # getPropertyClass ( Class , List ) } but returns the property class . * @ param beanClass bean to be accessed * @ param field bean ' s fieldName * @ return bean ' s property class */ public static Type getPropertyType ( Class < ? > beanClass , String field ) { } }
try { return INSTANCE . findPropertyType ( beanClass , field ) ; } catch ( NoSuchMethodException | IllegalAccessException | InvocationTargetException e ) { throw handleReflectionException ( beanClass , field , e ) ; }
public class WildcardImport { /** * Collect all on demand imports . */ private static ImmutableList < ImportTree > getWildcardImports ( List < ? extends ImportTree > imports ) { } }
ImmutableList . Builder < ImportTree > result = ImmutableList . builder ( ) ; for ( ImportTree tree : imports ) { // javac represents on - demand imports as a member select where the selected name is ' * ' . Tree ident = tree . getQualifiedIdentifier ( ) ; if ( ! ( ident instanceof MemberSelectTree ) ) { continue ; } MemberSelectTree select = ( MemberSelectTree ) ident ; if ( select . getIdentifier ( ) . contentEquals ( "*" ) ) { result . add ( tree ) ; } } return result . build ( ) ;
public class LazyObject { /** * Returns the JSON array stored in this object for the given key . * @ param key the name of the field on this object * @ return an array value * @ throws LazyException if the value for the given key was not an array . */ public LazyArray getJSONArray ( String key ) throws LazyException { } }
LazyNode token = getFieldToken ( key ) ; if ( token . type != LazyNode . ARRAY ) throw new LazyException ( "Requested value is not an array" , token ) ; LazyArray arr = new LazyArray ( token ) ; arr . parent = this ; return arr ;
public class MoreCollectors { /** * Returns a { @ code Collector } which finds the index of the maximal stream * element according to the specified { @ link Comparator } . If there are * several maximal elements , the index of the first one is returned . * @ param < T > the type of the input elements * @ param comparator a { @ code Comparator } to compare the elements * @ return a { @ code Collector } which finds the index of the maximal element . * @ see # maxIndex ( ) * @ since 0.3.5 */ public static < T > Collector < T , ? , OptionalLong > maxIndex ( Comparator < ? super T > comparator ) { } }
return minIndex ( comparator . reversed ( ) ) ;
public class DescribeRaidArraysRequest { /** * An array of RAID array IDs . If you use this parameter , < code > DescribeRaidArrays < / code > returns descriptions of * the specified arrays . Otherwise , it returns a description of every array . * @ return An array of RAID array IDs . If you use this parameter , < code > DescribeRaidArrays < / code > returns * descriptions of the specified arrays . Otherwise , it returns a description of every array . */ public java . util . List < String > getRaidArrayIds ( ) { } }
if ( raidArrayIds == null ) { raidArrayIds = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return raidArrayIds ;
public class Validator { /** * Performs all data validation that is appicable to the data value itself * @ param object - the data value * @ throws DataValidationException if any of the data constraints are violated */ @ SuppressWarnings ( "unchecked" ) public void postValidate ( Object object ) throws DataValidationException { } }
if ( _values != null || _ranges != null ) { if ( _values != null ) for ( Object value : _values ) { if ( value . equals ( object ) ) return ; } if ( _ranges != null ) for ( @ SuppressWarnings ( "rawtypes" ) Range r : _ranges ) { @ SuppressWarnings ( "rawtypes" ) Comparable o = ( Comparable ) object ; if ( r . inclusive ) { if ( ( r . min == null || r . min . compareTo ( o ) <= 0 ) && ( r . max == null || o . compareTo ( r . max ) <= 0 ) ) { return ; } } else { if ( ( r . min == null || r . min . compareTo ( o ) < 0 ) && ( r . max == null || o . compareTo ( r . max ) < 0 ) ) { return ; } } } throw new DataValidationException ( "VALUES/RANGES" , _name , object ) ; }
public class HeaderFooterRecyclerAdapter { /** * Notifies that multiple content items are removed . * @ param positionStart the position . * @ param itemCount the item count . */ public final void notifyContentItemRangeRemoved ( int positionStart , int itemCount ) { } }
if ( positionStart < 0 || itemCount < 0 || positionStart + itemCount > contentItemCount ) { throw new IndexOutOfBoundsException ( "The given range [" + positionStart + " - " + ( positionStart + itemCount - 1 ) + "] is not within the position bounds for content items [0 - " + ( contentItemCount - 1 ) + "]." ) ; } notifyItemRangeRemoved ( positionStart + headerItemCount , itemCount ) ;
public class ModuleEntries { /** * Delete an Entry . * @ param entry Entry ID * @ return Integer representing the success ( 204 ) of the action * @ throws IllegalArgumentException if spaceId is null . * @ throws IllegalArgumentException if environmentId is null . * @ throws IllegalArgumentException if entryId is null . * @ throws IllegalArgumentException if entry is null . */ public Integer delete ( CMAEntry entry ) { } }
assertNotNull ( entry . getSpaceId ( ) , "spaceId" ) ; assertNotNull ( entry . getEnvironmentId ( ) , "environmentId" ) ; assertNotNull ( entry . getId ( ) , "entryId" ) ; return service . delete ( entry . getSpaceId ( ) , entry . getEnvironmentId ( ) , entry . getId ( ) ) . blockingFirst ( ) . code ( ) ;
public class SmartsFragmentExtractor { /** * Generate a SMARTS for the substructure formed of the provided * atoms . * @ param atomIdxs atom indexes * @ return SMARTS , null if an empty array is passed */ public String generate ( int [ ] atomIdxs ) { } }
if ( atomIdxs == null ) throw new NullPointerException ( "No atom indexes provided" ) ; if ( atomIdxs . length == 0 ) return null ; // makes sense ? // special case if ( atomIdxs . length == 1 && mode == MODE_EXACT ) return aexpr [ atomIdxs [ 0 ] ] ; // initialize traversal information Arrays . fill ( rbnds , 0 ) ; Arrays . fill ( avisit , 0 ) ; for ( int atmIdx : atomIdxs ) avisit [ atmIdx ] = - 1 ; // first visit marks ring information numVisit = 1 ; for ( int atomIdx : atomIdxs ) { if ( avisit [ atomIdx ] < 0 ) markRings ( atomIdx , - 1 ) ; } // reset visit flags and generate numVisit = 1 ; for ( int atmIdx : atomIdxs ) avisit [ atmIdx ] = - 1 ; // second pass builds the expression StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < atomIdxs . length ; i ++ ) { if ( avisit [ atomIdxs [ i ] ] < 0 ) { if ( i > 0 ) sb . append ( '.' ) ; encodeExpr ( atomIdxs [ i ] , - 1 , sb ) ; } } return sb . toString ( ) ;
public class Params { /** * Return a new parameters object . * @ param name the name of the parameters * @ param params the actual parameters * @ param < T > the parameter type * @ throws NullPointerException if one of the parameters is { @ code null } * @ return a new parameters object */ public static < T > Params < T > of ( final String name , final ISeq < T > params ) { } }
return new Params < > ( name , params ) ;
public class Query { /** * Begin this { @ link Query } with all { @ link WindupVertexFrame } instances of the given type . */ public static QueryBuilderFind fromType ( Class < ? extends WindupVertexFrame > type ) { } }
final Query query = new Query ( ) ; // this query is going to be added after evaluate ( ) method , because in some cases we need gremlin and in some // frames query . searchType = type ; return query ;
public class dnszone { /** * Use this API to fetch all the dnszone resources that are configured on netscaler . */ public static dnszone [ ] get ( nitro_service service ) throws Exception { } }
dnszone obj = new dnszone ( ) ; dnszone [ ] response = ( dnszone [ ] ) obj . get_resources ( service ) ; return response ;
public class Tree { /** * Get the first matched child with the given value from all of the sub - tree * @ param value * @ return */ public Optional < Tree < T > > deepChild ( T value ) { } }
return breadthFirstTraversal ( ) . filter ( rx ( its ( Tree :: getValue , isEquals ( value ) ) ) ) . map ( Optional :: of ) . blockingFirst ( Optional . empty ( ) ) ;
public class CachedDirectoryLookupService { /** * Dump the ServiceCache to CacheDumpLogger Logger . * @ return * true if dump complete . * @ throws Exception */ private boolean dumpCache ( ) throws Exception { } }
if ( CacheDumpLogger . isDebugEnabled ( ) ) { List < ModelService > services = getCache ( ) . getAllServicesWithInstance ( ) ; if ( dumper == null ) { dumper = new JsonSerializer ( ) ; } StringBuilder sb = new StringBuilder ( ) ; sb . append ( "LookupManager dump Service Cache at: " ) . append ( System . currentTimeMillis ( ) ) . append ( "\n" ) ; for ( ModelService service : services ) { sb . append ( new String ( dumper . serialize ( service ) ) ) . append ( "\n" ) ; } CacheDumpLogger . debug ( sb . toString ( ) ) ; return true ; } else { return false ; }
public class MetadataUtil { /** * Checks for the first parent node occurrence of the a w3c parentEnum element . * @ param parentElement * the element from which the search starts . * @ param parentEnum * the < code > XsdElementEnum < / code > specifying the parent element . * @ return true , if found , otherwise false . */ public static boolean hasParentOf ( final Element parentElement , XsdElementEnum parentEnum ) { } }
Node parent = parentElement . getParentNode ( ) ; while ( parent != null ) { if ( parent . getNodeType ( ) == Node . ELEMENT_NODE ) { final Element parentElm = ( Element ) parent ; if ( parentEnum . isTagNameEqual ( parentElm . getTagName ( ) ) ) { return true ; } } parent = parent . getParentNode ( ) ; } return false ;
public class MapperComplex { /** * Creates an object from a value map . * This does some special handling to take advantage of us using the value map so it avoids creating * a bunch of array objects and collections . Things you have to worry about when writing a * high - speed JSON serializer . * @ param cls the new type * @ return new object from value map */ @ Override @ SuppressWarnings ( "unchecked" ) public < T > T fromValueMap ( final Map < String , Value > valueMap , final Class < T > cls ) { } }
T newInstance = Reflection . newInstance ( cls ) ; ValueMap map = ( ValueMap ) ( Map ) valueMap ; Map < String , FieldAccess > fields = fieldsAccessor . getFields ( cls ) ; Map . Entry < String , Object > [ ] entries ; FieldAccess field = null ; String fieldName = null ; Map . Entry < String , Object > entry ; int size ; /* if the map is not hydrated get its entries right form the array to avoid collection creations . */ if ( ! map . hydrated ( ) ) { size = map . len ( ) ; entries = map . items ( ) ; } else { size = map . size ( ) ; entries = ( Map . Entry < String , Object > [ ] ) map . entrySet ( ) . toArray ( new Map . Entry [ size ] ) ; } /* guard . We should check if this is still needed . * I might have added it for debugging and forgot to remove it . */ if ( size == 0 || entries == null ) { return newInstance ; } /* Iterate through the entries . */ for ( int index = 0 ; index < size ; index ++ ) { Object value = null ; try { entry = entries [ index ] ; fieldName = entry . getKey ( ) ; if ( ignoreSet != null ) { if ( ignoreSet . contains ( fieldName ) ) { continue ; } } field = fields . get ( fieldsAccessor . isCaseInsensitive ( ) ? fieldName . toLowerCase ( ) : fieldName ) ; if ( field == null ) { continue ; } if ( view != null ) { if ( ! field . isViewActive ( view ) ) { continue ; } } if ( respectIgnore ) { if ( field . ignore ( ) ) { continue ; } } value = entry . getValue ( ) ; if ( value instanceof Value ) { fromValueMapHandleValueCase ( newInstance , field , ( Value ) value ) ; } else { fromMapHandleNonValueCase ( newInstance , field , value ) ; } } catch ( Exception ex ) { return ( T ) Exceptions . handle ( Object . class , ex , "fieldName" , fieldName , "of class" , cls , "had issues for value" , value , "for field" , field ) ; } } return newInstance ;
public class druidGLexer { /** * $ ANTLR start " RIGHT _ JOIN " */ public final void mRIGHT_JOIN ( ) throws RecognitionException { } }
try { int _type = RIGHT_JOIN ; int _channel = DEFAULT_TOKEN_CHANNEL ; // druidG . g : 655:13 : ( ( ' RIGHT _ JOIN ' | ' right _ join ' ) ) // druidG . g : 655:15 : ( ' RIGHT _ JOIN ' | ' right _ join ' ) { // druidG . g : 655:15 : ( ' RIGHT _ JOIN ' | ' right _ join ' ) int alt36 = 2 ; int LA36_0 = input . LA ( 1 ) ; if ( ( LA36_0 == 'R' ) ) { alt36 = 1 ; } else if ( ( LA36_0 == 'r' ) ) { alt36 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 36 , 0 , input ) ; throw nvae ; } switch ( alt36 ) { case 1 : // druidG . g : 655:16 : ' RIGHT _ JOIN ' { match ( "RIGHT_JOIN" ) ; } break ; case 2 : // druidG . g : 655:31 : ' right _ join ' { match ( "right_join" ) ; } break ; } } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class SchemaBuilder { /** * Shortcut for { @ link # dropIndex ( CqlIdentifier , CqlIdentifier ) } * dropIndex ( CqlIdentifier . fromCql ( keyspace ) , CqlIdentifier . fromCql ( indexName ) } . */ @ NonNull public static Drop dropIndex ( @ Nullable String keyspace , @ NonNull String indexName ) { } }
return dropIndex ( keyspace == null ? null : CqlIdentifier . fromCql ( keyspace ) , CqlIdentifier . fromCql ( indexName ) ) ;
public class EventSubscriptionsInner { /** * List all event subscriptions for a specific domain topic . * List all event subscriptions that have been created for a specific domain topic . * @ param resourceGroupName The name of the resource group within the user ' s subscription . * @ param domainName Name of the top level domain * @ param topicName Name of the domain topic * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; EventSubscriptionInner & gt ; object */ public Observable < ServiceResponse < List < EventSubscriptionInner > > > listByDomainTopicWithServiceResponseAsync ( String resourceGroupName , String domainName , String topicName ) { } }
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( domainName == null ) { throw new IllegalArgumentException ( "Parameter domainName is required and cannot be null." ) ; } if ( topicName == null ) { throw new IllegalArgumentException ( "Parameter topicName is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . listByDomainTopic ( this . client . subscriptionId ( ) , resourceGroupName , domainName , topicName , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < List < EventSubscriptionInner > > > > ( ) { @ Override public Observable < ServiceResponse < List < EventSubscriptionInner > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PageImpl < EventSubscriptionInner > > result = listByDomainTopicDelegate ( response ) ; List < EventSubscriptionInner > items = null ; if ( result . body ( ) != null ) { items = result . body ( ) . items ( ) ; } ServiceResponse < List < EventSubscriptionInner > > clientResponse = new ServiceResponse < List < EventSubscriptionInner > > ( items , result . response ( ) ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class ClassUtils { /** * Gets a Field object representing the named field on the specified class . This method will recursively search * up the class hierarchy of the specified class until the Object class is reached . If the named field is found * then a Field object representing the class field is returned , otherwise a NoSuchFieldException is thrown . * @ param type the Class type to search for the specified field . * @ param fieldName a String indicating the name of the field on the class . * @ return a Field object representing the named field on the specified class . * @ throws FieldNotFoundException if the named field does not exist on the specified class * or a superclass of the specified class . * @ see java . lang . Class * @ see java . lang . Class # getDeclaredField ( String ) * @ see java . lang . reflect . Field */ public static Field getField ( Class < ? > type , String fieldName ) { } }
try { return type . getDeclaredField ( fieldName ) ; } catch ( NoSuchFieldException cause ) { if ( type . getSuperclass ( ) != null ) { return getField ( type . getSuperclass ( ) , fieldName ) ; } throw new FieldNotFoundException ( cause ) ; }
public class ReceiveQueueBuffer { /** * This method is called by the batches after they have finished retrieving the messages . */ void reportBatchFinished ( ReceiveMessageBatchTask batch ) { } }
synchronized ( finishedTasks ) { finishedTasks . addLast ( batch ) ; if ( log . isTraceEnabled ( ) ) { log . info ( "Queue " + qUrl + " now has " + finishedTasks . size ( ) + " receive results cached " ) ; } } synchronized ( taskSpawnSyncPoint ) { -- inflightReceiveMessageBatches ; } satisfyFuturesFromBuffer ( ) ; spawnMoreReceiveTasks ( ) ;
public class AuditSigningImpl { /** * The < code > decrypt < / code > operation takes a UTF - 8 encoded String in the form of a byte [ ] . * The byte [ ] is generated from String . getBytes ( " UTF - 8 " ) . * A decrypted byte [ ] is returned . * @ param byte [ ] data to decrypt * @ param java . security . Key shared key * @ return byte [ ] of dcecrypted data * @ throws com . ibm . wsspi . security . audit . AuditEncryptException */ public byte [ ] decrypt ( byte [ ] data , Key sharedKey ) throws AuditDecryptionException { } }
if ( data == null ) { Tr . error ( tc , "security.audit.decryption.data.error" ) ; throw new AuditDecryptionException ( "Invalid data passed into the decryption algorithm." ) ; } if ( sharedKey == null ) { Tr . error ( tc , "security.audit.invalid.shared.key.error" ) ; throw new AuditDecryptionException ( "An invalid shared key was detected." ) ; } AuditCrypto ac = new AuditCrypto ( ) ; byte [ ] decryptedData = ac . decrypt ( data , sharedKey . getEncoded ( ) ) ; return decryptedData ;
public class AwtExtensions { /** * Gets the toplevel < code > Frame < / code > or < code > Dialog < / code > * @ param component * the parent component * @ return the the toplevel < code > Frame < / code > or < code > Dialog < / code > * @ throws HeadlessException * if < code > GraphicsEnvironment . isHeadless < / code > returns < code > true < / code > * @ see java . awt . GraphicsEnvironment # isHeadless */ public static Window getWindowForComponent ( Component component ) throws HeadlessException { } }
if ( component == null ) { return JOptionPane . getRootFrame ( ) ; } if ( component instanceof Frame || component instanceof Dialog ) { return ( Window ) component ; } return getWindowForComponent ( component . getParent ( ) ) ;
public class SarlBehaviorImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case SarlPackage . SARL_BEHAVIOR__EXTENDS : return extends_ != null ; } return super . eIsSet ( featureID ) ;
public class ResultQueueEntry { /** * < p > fromThrowable . < / p > * @ param throwable a { @ link java . lang . Throwable } object . * @ param < T > a T object . * @ return a { @ link com . google . cloud . bigtable . grpc . scanner . ResultQueueEntry } object . */ public static < T > ResultQueueEntry < T > fromThrowable ( Throwable throwable ) { } }
Preconditions . checkArgument ( throwable != null , "Throwable may not be null" ) ; return new ExceptionResultQueueEntry < T > ( throwable ) ;
public class Version { /** * Sets a new version number . * @ param index available version number index . * @ param number version number ( not negative ) . * @ param label version number label ( optional ) . * @ return version descriptor . * @ throws IllegalArgumentException if either index or number are illegal . * @ since v1.1.0 */ public Version setNumber ( int index , int number , String label ) { } }
validateNumber ( number ) ; if ( isBeyondBounds ( index ) ) { String message = String . format ( "illegal number index: %d" , index ) ; throw new IllegalArgumentException ( message ) ; } labels . set ( -- index , label ) ; numbers . set ( index , number ) ; return this ;
public class ProtoClient { /** * Generic protocol buffer based HTTP request . Not intended for general consumption , but public * for advance use cases . * @ param builder The appropriate Builder for the object received from the request . * @ param method The HTTP method ( e . g . GET ) for this request . * @ param path The URL path to call ( e . g . / api / v1 / namespaces / default / pods / pod - name ) * @ param body The body to send with the request ( optional ) * @ param apiVersion The ' apiVersion ' to use when encoding , required if body is non - null , ignored * otherwise . * @ param kind The ' kind ' field to use when encoding , required if body is non - null , ignored * otherwise . * @ return An ObjectOrStatus which contains the Object requested , or a Status about the request . */ public < T extends Message > ObjectOrStatus < T > request ( T . Builder builder , String path , String method , T body , String apiVersion , String kind ) throws ApiException , IOException { } }
HashMap < String , String > headers = new HashMap < > ( ) ; headers . put ( "Content-Type" , MEDIA_TYPE ) ; headers . put ( "Accept" , MEDIA_TYPE ) ; String [ ] localVarAuthNames = new String [ ] { "BearerToken" } ; Request request = apiClient . buildRequest ( path , method , new ArrayList < Pair > ( ) , new ArrayList < Pair > ( ) , null , headers , new HashMap < String , Object > ( ) , localVarAuthNames , null ) ; if ( body != null ) { byte [ ] bytes = encode ( body , apiVersion , kind ) ; switch ( method ) { case "POST" : request = request . newBuilder ( ) . post ( RequestBody . create ( MediaType . parse ( MEDIA_TYPE ) , bytes ) ) . build ( ) ; break ; case "PUT" : request = request . newBuilder ( ) . put ( RequestBody . create ( MediaType . parse ( MEDIA_TYPE ) , bytes ) ) . build ( ) ; break ; case "PATCH" : request = request . newBuilder ( ) . patch ( RequestBody . create ( MediaType . parse ( MEDIA_TYPE ) , bytes ) ) . build ( ) ; break ; default : throw new ApiException ( "Unknown proto client API method: " + method ) ; } } Response resp = apiClient . getHttpClient ( ) . newCall ( request ) . execute ( ) ; Unknown u = parse ( resp . body ( ) . byteStream ( ) ) ; resp . body ( ) . close ( ) ; if ( u . getTypeMeta ( ) . getApiVersion ( ) . equals ( "v1" ) && u . getTypeMeta ( ) . getKind ( ) . equals ( "Status" ) ) { Status status = Status . newBuilder ( ) . mergeFrom ( u . getRaw ( ) ) . build ( ) ; return new ObjectOrStatus ( null , status ) ; } return new ObjectOrStatus ( ( T ) builder . mergeFrom ( u . getRaw ( ) ) . build ( ) , null ) ;
public class KerasModelBuilder { /** * Provide training configuration as file input stream from YAML * @ param trainingYamlInputStream Input stream of training YAML string * @ return Model builder */ public KerasModelBuilder trainingYamlInputStream ( InputStream trainingYamlInputStream ) throws IOException { } }
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; IOUtils . copy ( trainingYamlInputStream , byteArrayOutputStream ) ; this . trainingYaml = new String ( byteArrayOutputStream . toByteArray ( ) ) ; return this ;
public class AdditionalRequestHeadersInterceptor { /** * Adds the additional header values to the HTTP request . * @ param theRequest the HTTP request */ @ Override public void interceptRequest ( IHttpRequest theRequest ) { } }
for ( Map . Entry < String , List < String > > header : additionalHttpHeaders . entrySet ( ) ) { for ( String headerValue : header . getValue ( ) ) { if ( headerValue != null ) { theRequest . addHeader ( header . getKey ( ) , headerValue ) ; } } }
public class JsHdrsImpl { /** * Set the Guaranteed Delivery Remote Get Start Tick value in the message . * Javadoc description supplied by JsMessage interface . */ public final void setGuaranteedRemoteGetStartTick ( long value ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setGuaranteedRemoteGetStartTick" , Long . valueOf ( value ) ) ; getHdr2 ( ) . setLongField ( JsHdr2Access . GUARANTEEDREMOTEGET_SET_STARTTICK , value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setGuaranteedRemoteGetStartTick" ) ;
public class SystemInputJson { /** * Returns the SystemInputDef represented by the given JSON object . */ public static SystemInputDef asSystemInputDef ( JsonObject json ) { } }
String systemName = json . getString ( SYSTEM_KEY ) ; try { SystemInputDef systemInputDef = new SystemInputDef ( validIdentifier ( systemName ) ) ; // Get system annotations Optional . ofNullable ( json . getJsonObject ( HAS_KEY ) ) . ifPresent ( has -> has . keySet ( ) . stream ( ) . forEach ( key -> systemInputDef . setAnnotation ( key , has . getString ( key ) ) ) ) ; // Get system functions json . keySet ( ) . stream ( ) . filter ( key -> ! ( key . equals ( SYSTEM_KEY ) || key . equals ( HAS_KEY ) ) ) . forEach ( function -> systemInputDef . addFunctionInputDef ( asFunctionInputDef ( function , json . getJsonObject ( function ) ) ) ) ; return systemInputDef ; } catch ( SystemInputException e ) { throw new SystemInputException ( String . format ( "Error defining system=%s" , systemName ) , e ) ; }
public class EasyGeneralFeatureDetector { /** * Reshape derivative images to match the input image */ private void initializeDerivatives ( T input ) { } }
// reshape derivatives if the input image has changed size if ( detector . getRequiresGradient ( ) || detector . getRequiresHessian ( ) ) { derivX . reshape ( input . width , input . height ) ; derivY . reshape ( input . width , input . height ) ; } if ( detector . getRequiresHessian ( ) ) { derivXX . reshape ( input . width , input . height ) ; derivYY . reshape ( input . width , input . height ) ; derivXY . reshape ( input . width , input . height ) ; }
public class FormLayout { /** * Creates and returns a deep copy of the given array . Unlike { @ code # clone } that performs a * shallow copy , this method copies both array levels . * @ param array the array to clone * @ return a deep copy of the given array * @ see Object # clone ( ) */ private static int [ ] [ ] deepClone ( int [ ] [ ] array ) { } }
int [ ] [ ] result = new int [ array . length ] [ ] ; for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = array [ i ] . clone ( ) ; } return result ;
public class NettyUtils { /** * This method will first read an unsigned short to find the length of the * string and then read the actual string based on the length . This method * will also reset the reader index to end of the string * @ param buffer * The Netty buffer containing at least one unsigned short * followed by a string of similar length . * @ param charset * The Charset say ' UTF - 8 ' in which the decoding needs to be * done . * @ return Returns the String or throws { @ link IndexOutOfBoundsException } if * the length is greater than expected . */ public static String readString ( ChannelBuffer buffer , Charset charset ) { } }
String readString = null ; if ( null != buffer && buffer . readableBytes ( ) > 2 ) { int length = buffer . readUnsignedShort ( ) ; readString = readString ( buffer , length , charset ) ; } return readString ;
public class DeleteVpnConnectionRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DeleteVpnConnectionRequest > getDryRunRequest ( ) { } }
Request < DeleteVpnConnectionRequest > request = new DeleteVpnConnectionRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class JKDefaultTableModel { /** * Returns the column name . * @ param column the column * @ return a name for this column using the string value of the appropriate * member in < code > columnIdentifiers < / code > . If * < code > columnIdentifiers < / code > does not have an entry for this index , * returns the default name provided by the superclass . */ @ Override public String getColumnName ( final int column ) { } }
Object id = null ; // This test is to cover the case when // getColumnCount has been subclassed by mistake . . . if ( column < this . columnIdentifiers . size ( ) && column >= 0 ) { id = this . columnIdentifiers . elementAt ( column ) ; } return id == null ? super . getColumnName ( column ) : id . toString ( ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcLine ( ) { } }
if ( ifcLineEClass == null ) { ifcLineEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 350 ) ; } return ifcLineEClass ;
public class InternalSimpleAntlrParser { /** * $ ANTLR start synpred20 _ InternalSimpleAntlr */ public final void synpred20_InternalSimpleAntlr_fragment ( ) throws RecognitionException { } }
EObject this_Parenthesized_4 = null ; // InternalSimpleAntlr . g : 813:2 : ( this _ Parenthesized _ 4 = ruleParenthesized ) // InternalSimpleAntlr . g : 813:2 : this _ Parenthesized _ 4 = ruleParenthesized { if ( state . backtracking == 0 ) { } pushFollow ( FOLLOW_2 ) ; this_Parenthesized_4 = ruleParenthesized ( ) ; state . _fsp -- ; if ( state . failed ) return ; }
public class StringEntityRepository { /** * Find for the column associated with the given name . * @ param name column name . * @ return return the column if exits , otherwise returns null . */ protected Column getColumn ( String name ) { } }
for ( Column column : getColumns ( ) ) { if ( column . getColumnName ( ) . equals ( name ) ) { return column ; } } return null ;
public class AggregationIterator { /** * Returns whether or not there are more values to aggregate . * @ param update _ pos Whether or not to also move the internal pointer * { @ link # pos } to the index of the next value to aggregate . * @ return true if there are more values to aggregate , false otherwise . */ private boolean hasNextValue ( boolean update_pos ) { } }
final int size = iterators . length ; for ( int i = pos + 1 ; i < size ; i ++ ) { if ( timestamps [ i ] != 0 ) { // LOG . debug ( " hasNextValue - > true # " + i ) ; if ( update_pos ) { pos = i ; } return true ; } } // LOG . debug ( " hasNextValue - > false ( ran out ) " ) ; return false ;
public class FormTool { /** * Constructs a button input element with the specified parameter name , * the specified button text , and the specified extra text . */ public String button ( String name , String text , String extra ) { } }
return fixedInput ( "button" , name , text , extra ) ;
public class AllureFileUtils { /** * Unmarshal test suite from given file . */ public static TestSuiteResult unmarshal ( File testSuite ) throws IOException { } }
try ( InputStream stream = new FileInputStream ( testSuite ) ) { return unmarshal ( stream ) ; }
public class LifecycleHooks { /** * Invoke an intercepted method through its callable proxy . * < b > NOTE < / b > : If the invoked method throws an exception , this method re - throws the original exception . * @ param proxy callable proxy for the intercepted method * @ return { @ code anything } - value returned by the intercepted method * @ throws Exception { @ code anything } ( exception thrown by the intercepted method ) */ static Object callProxy ( final Callable < ? > proxy ) throws Exception { } }
try { return proxy . call ( ) ; } catch ( InvocationTargetException e ) { throw UncheckedThrow . throwUnchecked ( e . getCause ( ) ) ; }
public class Vector4d { /** * / * ( non - Javadoc ) * @ see org . joml . Vector4dc # mul ( double , org . joml . Vector4d ) */ public Vector4d mul ( double scalar , Vector4d dest ) { } }
dest . x = x * scalar ; dest . y = y * scalar ; dest . z = z * scalar ; dest . w = w * scalar ; return dest ;
public class ProjectProperties { /** * Sets the Calendar used . ' Standard ' if no value is set . * @ param calendarName Calendar name */ public void setDefaultCalendarName ( String calendarName ) { } }
if ( calendarName == null || calendarName . length ( ) == 0 ) { calendarName = DEFAULT_CALENDAR_NAME ; } set ( ProjectField . DEFAULT_CALENDAR_NAME , calendarName ) ;
public class OidcCommonClientRequest { /** * do not overridden */ public void errorCommon ( String [ ] msgCodes , Object [ ] objects ) { } }
int msgIndex = 0 ; if ( ! TYPE_ID_TOKEN . equals ( this . getTokenType ( ) ) ) { msgIndex = 1 ; } if ( ! bInboundSupported ) { Tr . error ( tcCommon , msgCodes [ msgIndex ] , objects ) ; }
public class BundleProcessor { /** * Process the Jawr Servlets * @ param destDirPath * the destination directory path * @ param jawrServletDefinitions * the destination directory * @ throws Exception * if an exception occurs . */ protected void processJawrServlets ( String destDirPath , List < ServletDefinition > jawrServletDefinitions , boolean keepUrlMapping ) throws Exception { } }
String appRootDir = "" ; String jsServletMapping = "" ; String cssServletMapping = "" ; String binaryServletMapping = "" ; for ( Iterator < ServletDefinition > iterator = jawrServletDefinitions . iterator ( ) ; iterator . hasNext ( ) ; ) { ServletDefinition servletDef = ( ServletDefinition ) iterator . next ( ) ; ServletConfig servletConfig = servletDef . getServletConfig ( ) ; // Force the production mode , and remove config listener parameters Map < ? , ? > initParameters = ( ( MockServletConfig ) servletConfig ) . getInitParameters ( ) ; initParameters . remove ( "jawr.config.reload.interval" ) ; String jawrServletMapping = servletConfig . getInitParameter ( JawrConstant . SERVLET_MAPPING_PROPERTY_NAME ) ; String servletMapping = servletConfig . getInitParameter ( JawrConstant . SPRING_SERVLET_MAPPING_PROPERTY_NAME ) ; if ( servletMapping == null ) { servletMapping = jawrServletMapping ; } ResourceBundlesHandler bundleHandler = null ; BinaryResourcesHandler binaryRsHandler = null ; // Retrieve the bundle Handler ServletContext servletContext = servletConfig . getServletContext ( ) ; String type = servletConfig . getInitParameter ( TYPE_INIT_PARAMETER ) ; if ( type == null || type . equals ( JawrConstant . JS_TYPE ) ) { bundleHandler = ( ResourceBundlesHandler ) servletContext . getAttribute ( JawrConstant . JS_CONTEXT_ATTRIBUTE ) ; String contextPathOverride = bundleHandler . getConfig ( ) . getContextPathOverride ( ) ; if ( StringUtils . isNotEmpty ( contextPathOverride ) ) { int idx = contextPathOverride . indexOf ( "//" ) ; if ( idx != - 1 ) { idx = contextPathOverride . indexOf ( "/" , idx + 2 ) ; if ( idx != - 1 ) { appRootDir = PathNormalizer . asPath ( contextPathOverride . substring ( idx ) ) ; } } } if ( jawrServletMapping != null ) { jsServletMapping = PathNormalizer . asPath ( jawrServletMapping ) ; } } else if ( type . equals ( JawrConstant . CSS_TYPE ) ) { bundleHandler = ( ResourceBundlesHandler ) servletContext . getAttribute ( JawrConstant . CSS_CONTEXT_ATTRIBUTE ) ; if ( jawrServletMapping != null ) { cssServletMapping = PathNormalizer . asPath ( jawrServletMapping ) ; } } else if ( type . equals ( JawrConstant . BINARY_TYPE ) ) { binaryRsHandler = ( BinaryResourcesHandler ) servletContext . getAttribute ( JawrConstant . BINARY_CONTEXT_ATTRIBUTE ) ; if ( jawrServletMapping != null ) { binaryServletMapping = PathNormalizer . asPath ( jawrServletMapping ) ; } } if ( bundleHandler != null ) { createBundles ( servletDef . getServlet ( ) , bundleHandler , destDirPath , servletMapping , keepUrlMapping ) ; } else if ( binaryRsHandler != null ) { createBinaryBundle ( servletDef . getServlet ( ) , binaryRsHandler , destDirPath , servletConfig , keepUrlMapping ) ; } } // Create the apache rewrite config file . createApacheRewriteConfigFile ( destDirPath , appRootDir , jsServletMapping , cssServletMapping , binaryServletMapping ) ;
public class PropertyConverter { /** * Get the JCR property name for an RDF predicate * @ param namespaceRegistry the namespace registry * @ param predicate the predicate to map to a property name * @ param namespaceMapping the namespace mapping * @ return JCR property name for an RDF predicate * @ throws RepositoryException if repository exception occurred */ private static String getPropertyNameFromPredicate ( final NamespaceRegistry namespaceRegistry , final Resource predicate , final Map < String , String > namespaceMapping ) throws RepositoryException { } }
// reject if update request contains any fcr namespaces if ( namespaceMapping != null && namespaceMapping . containsKey ( "fcr" ) ) { throw new FedoraInvalidNamespaceException ( "Invalid fcr namespace properties " + predicate + "." ) ; } final String rdfNamespace = predicate . getNameSpace ( ) ; // log warning if the user - supplied namespace doesn ' t match value from predicate . getNameSpace ( ) , // e . g . , if the Jena method returns " http : / / " for " http : / / myurl . org " ( no terminating character ) . if ( namespaceMapping != null && namespaceMapping . size ( ) > 0 && ! namespaceMapping . containsValue ( rdfNamespace ) ) { LOGGER . warn ( "The namespace of predicate: {} was possibly misinterpreted as: {}." , predicate , rdfNamespace ) ; } final String rdfLocalname = predicate . getLocalName ( ) ; final String prefix ; assert ( namespaceRegistry != null ) ; final String namespace = getJcrNamespaceForRDFNamespace ( rdfNamespace ) ; if ( namespaceRegistry . isRegisteredUri ( namespace ) ) { LOGGER . debug ( "Discovered namespace: {} in namespace registry." , namespace ) ; prefix = namespaceRegistry . getPrefix ( namespace ) ; } else { LOGGER . debug ( "Didn't discover namespace: {} in namespace registry." , namespace ) ; if ( namespaceMapping != null && namespaceMapping . containsValue ( namespace ) ) { LOGGER . debug ( "Discovered namespace: {} in namespace map: {}." , namespace , namespaceMapping ) ; prefix = namespaceMapping . entrySet ( ) . stream ( ) . filter ( t -> t . getValue ( ) . equals ( namespace ) ) . map ( Map . Entry :: getKey ) . findFirst ( ) . orElse ( null ) ; namespaceRegistry . registerNamespace ( prefix , namespace ) ; } else { prefix = namespaceRegistry . registerNamespace ( namespace ) ; LOGGER . debug ( "Registered prefix: {} for namespace: {}." , prefix , namespace ) ; } } final String propertyName = prefix + ":" + rdfLocalname ; LOGGER . debug ( "Took RDF predicate {} and translated it to JCR property {}" , namespace , propertyName ) ; return propertyName ;
public class ClassUseMapper { /** * Map the AnnotationType to the ProgramElementDocs that use them as * type parameters . * @ param map the map the insert the information into . * @ param doc the doc whose type parameters are being checked . * @ param holder the holder that owns the type parameters . */ private < T extends ProgramElementDoc > void mapAnnotations ( Map < String , List < T > > map , Object doc , T holder ) { } }
AnnotationDesc [ ] annotations ; boolean isPackage = false ; if ( doc instanceof ProgramElementDoc ) { annotations = ( ( ProgramElementDoc ) doc ) . annotations ( ) ; } else if ( doc instanceof PackageDoc ) { annotations = ( ( PackageDoc ) doc ) . annotations ( ) ; isPackage = true ; } else if ( doc instanceof Parameter ) { annotations = ( ( Parameter ) doc ) . annotations ( ) ; } else { throw new DocletAbortException ( "should not happen" ) ; } for ( AnnotationDesc annotation : annotations ) { AnnotationTypeDoc annotationDoc = annotation . annotationType ( ) ; if ( isPackage ) refList ( map , annotationDoc ) . add ( holder ) ; else add ( map , annotationDoc , holder ) ; }
public class VMath { /** * Returns an orthonormalization of this matrix . * @ param m1 Input matrix * @ return the orthonormalized matrix */ public static double [ ] [ ] orthonormalize ( final double [ ] [ ] m1 ) { } }
final int columndimension = getColumnDimensionality ( m1 ) ; final double [ ] [ ] v = copy ( m1 ) ; // FIXME : optimize - excess copying ! for ( int i = 1 ; i < columndimension ; i ++ ) { final double [ ] u_i = getCol ( m1 , i ) ; final double [ ] sum = new double [ m1 . length ] ; for ( int j = 0 ; j < i ; j ++ ) { final double [ ] v_j = getCol ( v , j ) ; final double scalar = scalarProduct ( u_i , v_j ) / scalarProduct ( v_j , v_j ) ; plusEquals ( sum , times ( v_j , scalar ) ) ; } final double [ ] v_i = minus ( u_i , sum ) ; setCol ( v , i , v_i ) ; } normalizeColumns ( v ) ; return v ;
public class XYCurve { /** * Add a coordinate pair , but don ' t simplify * @ param x X coordinate * @ param y Y coordinate */ public void add ( double x , double y ) { } }
data . add ( x ) ; data . add ( y ) ; minx = Math . min ( minx , x ) ; maxx = Math . max ( maxx , x ) ; miny = Math . min ( miny , y ) ; maxy = Math . max ( maxy , y ) ;
public class JavaSmsApi { /** * 取账户信息 * @ return json格式字符串 */ public static Single < String > getUserInfo ( String apikey ) { } }
Map < String , String > params = new HashMap < > ( ) ; params . put ( "apikey" , apikey ) ; return post ( URI_GET_USER_INFO , params ) ;
public class AdManagerAxisHeaderHandler { /** * Creates a SOAP header . * @ param adsServiceDescriptor the ads service descriptor * @ return the instantiated SOAP header * @ throws ClassNotFoundException if the SOAP header class could not be found * @ throws IllegalAccessException if the SOAP header class could not be created * @ throws InstantiationException if the SOAP header class could not be created */ private Object createSoapHeader ( AdManagerServiceDescriptor adsServiceDescriptor ) throws InstantiationException , IllegalAccessException , ClassNotFoundException { } }
return Class . forName ( adsServiceDescriptor . getInterfaceClass ( ) . getPackage ( ) . getName ( ) + ".SoapRequestHeader" ) . newInstance ( ) ;
public class TomcatService { /** * Creates a new { @ link TomcatService } with the web application at the specified document base directory * inside the JAR / WAR / directory where the specified class is located at . */ public static TomcatService forClassPath ( Class < ? > clazz , String docBase ) { } }
return TomcatServiceBuilder . forClassPath ( clazz , docBase ) . build ( ) ;
public class MPPUtility { /** * Writes a large byte array to a file . * @ param fileName output file name * @ param data target data */ public static final void fileDump ( String fileName , byte [ ] data ) { } }
System . out . println ( "FILE DUMP" ) ; try { FileOutputStream os = new FileOutputStream ( fileName ) ; os . write ( data ) ; os . close ( ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; }
public class XmlRpcDataMarshaller { /** * Transforms the Vector of the Repository parameters into a Repository Object . < br > * Structure of the parameters : < br > * Vector [ name , Vector [ project parameters ] , type , content type , uri ] * @ param xmlRpcParameters Vector [ name , Vector [ project parameters ] , type , content type , uri ] * @ return the Repository . */ @ SuppressWarnings ( "unchecked" ) public static Repository toRepository ( Vector < Object > xmlRpcParameters ) { } }
Repository repository = null ; if ( ! xmlRpcParameters . isEmpty ( ) ) { repository = Repository . newInstance ( ( String ) xmlRpcParameters . get ( REPOSITORY_UID_IDX ) ) ; repository . setName ( ( String ) xmlRpcParameters . get ( REPOSITORY_NAME_IDX ) ) ; repository . setProject ( toProject ( ( Vector ) xmlRpcParameters . get ( REPOSITORY_PROJECT_IDX ) ) ) ; repository . setType ( toRepositoryType ( ( Vector ) xmlRpcParameters . get ( REPOSITORY_TYPE_IDX ) ) ) ; repository . setContentType ( ContentType . getInstance ( ( String ) xmlRpcParameters . get ( REPOSITORY_CONTENTTYPE_IDX ) ) ) ; repository . setBaseUrl ( ( String ) xmlRpcParameters . get ( REPOSITORY_BASE_URL_IDX ) ) ; repository . setBaseRepositoryUrl ( ( String ) xmlRpcParameters . get ( REPOSITORY_BASEREPO_URL_IDX ) ) ; repository . setBaseTestUrl ( ( String ) xmlRpcParameters . get ( REPOSITORY_BASETEST_URL_IDX ) ) ; repository . setUsername ( toNullIfEmpty ( ( String ) xmlRpcParameters . get ( REPOSITORY_USERNAME_IDX ) ) ) ; repository . setPassword ( toNullIfEmpty ( ( String ) xmlRpcParameters . get ( REPOSITORY_PASSWORD_IDX ) ) ) ; repository . setMaxUsers ( ( Integer ) xmlRpcParameters . get ( REPOSITORY_MAX_USERS_IDX ) ) ; } return repository ;
public class DescribeProvisioningArtifactResult { /** * The URL of the CloudFormation template in Amazon S3. * @ param info * The URL of the CloudFormation template in Amazon S3. * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeProvisioningArtifactResult withInfo ( java . util . Map < String , String > info ) { } }
setInfo ( info ) ; return this ;
public class TypeMappings { /** * Get the WIM input property that maps to the UserRegistry input property . * @ param inputVirtualRealm Virtual realm to find the mappings . * @ param inputProperty String representing the input UserRegistry property . * @ return String representing the input WIM property . * @ pre inputVirtualRealm ! = null * @ pre inputVirtualRealm ! = empty * @ pre inputProperty ! = null * @ pre inputProperty ! = " " * @ pre inputDefaultProperty ! = null * @ pre inputDefaultProperty ! = " " * @ post $ return ! = " " * @ post $ return ! = null */ @ FFDCIgnore ( Exception . class ) private String getInputMapping ( String inputVirtualRealm , String inputProperty , String inputDefaultProperty ) { } }
String methodName = "getInputMapping" ; // initialize the return value String returnValue = null ; RealmConfig realmConfig = mappingUtils . getCoreConfiguration ( ) . getRealmConfig ( inputVirtualRealm ) ; if ( realmConfig != null ) { try { returnValue = realmConfig . getURMapInputPropertyInRealm ( inputProperty ) ; if ( ( returnValue == null ) || ( returnValue . equals ( "" ) ) ) { returnValue = inputDefaultProperty ; } } catch ( Exception toCatch ) { returnValue = inputDefaultProperty ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " " + toCatch . getMessage ( ) , toCatch ) ; } } } else { returnValue = inputDefaultProperty ; } return returnValue ;
public class ProfilerTimerFilter { /** * Profile a MessageReceived event . This method will gather the following * informations : * - the method duration * - the shortest execution time * - the slowest execution time * - the average execution time * - the global number of calls * @ param nextFilter The filter to call next * @ param session The associated session * @ param message the received message */ @ Override public void messageReceived ( NextFilter nextFilter , IoSession session , Object message ) throws Exception { } }
if ( profileMessageReceived ) { long start = timeNow ( ) ; nextFilter . messageReceived ( session , message ) ; long end = timeNow ( ) ; messageReceivedTimerWorker . addNewDuration ( end - start ) ; } else { nextFilter . messageReceived ( session , message ) ; }
public class AbstractStore { /** * ( non - Javadoc ) * @ see com . arakelian . dao . Dao # getAll ( java . lang . String [ ] ) */ @ Override public List < T > getAll ( final String ... ids ) { } }
if ( ids == null || ids . length == 0 ) { return Collections . < T > emptyList ( ) ; } // delegate to internal method that partitions the list into smaller groups and aggregates // the result return getAll ( Lists . newArrayList ( ids ) ) ;
public class IntStreamEx { /** * Returns a sequential { @ code IntStreamEx } containing the results of * applying the given function to the corresponding pairs of values in given * two arrays . * @ param first the first array * @ param second the second array * @ param mapper a non - interfering , stateless function to apply to each pair * of the corresponding array elements . * @ return a new { @ code IntStreamEx } * @ throws IllegalArgumentException if length of the arrays differs . * @ since 0.2.1 */ public static IntStreamEx zip ( int [ ] first , int [ ] second , IntBinaryOperator mapper ) { } }
return of ( new RangeBasedSpliterator . ZipInt ( 0 , checkLength ( first . length , second . length ) , mapper , first , second ) ) ;
public class ItemAndSupport { /** * Returns a negative integer , zero , or a positive integer * as this object ' s support is less than , equal to , or * greater than the specified object ' s support . */ public int compareTo ( ItemAndSupport other ) { } }
if ( other . support == this . support ) { return this . item - other . item ; } else { return other . support - this . support ; }
public class SignatureUtil { /** * 生成sign HMAC - SHA256 或 MD5 签名 * @ param map map * @ param paternerKey paternerKey * @ return sign */ public static String generateSign ( Map < String , String > map , String paternerKey ) { } }
return generateSign ( map , null , paternerKey ) ;
public class DeviceImpl { /** * Remove a command * @ param command * @ throws DevFailed */ public synchronized void removeCommand ( final CommandImpl command ) throws DevFailed { } }
if ( ! command . getName ( ) . equalsIgnoreCase ( INIT_CMD ) ) { pollingManager . removeCommandPolling ( command . getName ( ) ) ; commandList . remove ( command ) ; }
public class HostStorageSystem { /** * Attach one or more SCSI LUNs . This is an asynchronous , batch operation of attachScisLun . * @ param lunUuid each element specifies UUID of LUN to be attached . * @ return Task * @ throws HostConfigFault * @ throws RuntimeFault * @ throws RemoteException * @ see # attachScsiLun ( String ) for operational details . * @ since 6.0 */ public Task attachScsiLunEx_Task ( String [ ] lunUuid ) throws HostConfigFault , RuntimeFault , RemoteException { } }
ManagedObjectReference taskMor = getVimService ( ) . attachScsiLunEx_Task ( getMOR ( ) , lunUuid ) ; return new Task ( getServerConnection ( ) , taskMor ) ;
public class PatternCriteria { /** * To sql pattern . * @ param attribute the attribute * @ return the string */ private String toSQLPattern ( String attribute ) { } }
String pattern = attribute . replace ( "*" , "%" ) ; if ( ! pattern . startsWith ( "%" ) ) { pattern = "%" + pattern ; } if ( ! pattern . endsWith ( "%" ) ) { pattern = pattern . concat ( "%" ) ; } return pattern ;
public class ApiTokenStore { /** * Same as { @ link # regenerateTokenFromLegacy ( Secret ) } but only applied if there is an existing legacy token . * Otherwise , no effect . */ public synchronized void regenerateTokenFromLegacyIfRequired ( @ Nonnull Secret newLegacyApiToken ) { } }
if ( tokenList . stream ( ) . noneMatch ( HashedToken :: isLegacy ) ) { deleteAllLegacyAndGenerateNewOne ( newLegacyApiToken , true ) ; }
public class FastDOC { /** * Performs a single run of FastDOC , finding a single cluster . * @ param database Database context * @ param relation used to get actual values for DBIDs . * @ param S The set of points we ' re working on . * @ param d Dimensionality of the data set we ' re currently working on . * @ param r Size of random samples . * @ param m Number of inner iterations ( per seed point ) . * @ param n Number of outer iterations ( seed points ) . * @ param minClusterSize Minimum size a cluster must have to be accepted . * @ return a cluster , if one is found , else < code > null < / code > . */ @ Override protected Cluster < SubspaceModel > runDOC ( Database database , Relation < V > relation , ArrayModifiableDBIDs S , int d , int n , int m , int r , int minClusterSize ) { } }
// Relevant attributes of highest cardinality . long [ ] D = null ; // The seed point for the best dimensions . DBIDVar dV = DBIDUtil . newVar ( ) ; // Inform the user about the progress in the current iteration . FiniteProgress iprogress = LOG . isVerbose ( ) ? new FiniteProgress ( "Iteration progress for current cluster" , m * n , LOG ) : null ; Random random = rnd . getSingleThreadedRandom ( ) ; DBIDArrayIter iter = S . iter ( ) ; outer : for ( int i = 0 ; i < n ; ++ i ) { // Pick a random seed point . iter . seek ( random . nextInt ( S . size ( ) ) ) ; for ( int j = 0 ; j < m ; ++ j ) { // Choose a set of random points . DBIDs randomSet = DBIDUtil . randomSample ( S , r , random ) ; // Initialize cluster info . long [ ] nD = BitsUtil . zero ( d ) ; // Test each dimension . for ( int k = 0 ; k < d ; ++ k ) { if ( dimensionIsRelevant ( k , relation , randomSet ) ) { BitsUtil . setI ( nD , k ) ; } } if ( D == null || BitsUtil . cardinality ( nD ) > BitsUtil . cardinality ( D ) ) { D = nD ; dV . set ( iter ) ; if ( BitsUtil . cardinality ( D ) >= d_zero ) { if ( iprogress != null ) { iprogress . setProcessed ( iprogress . getTotal ( ) , LOG ) ; } break outer ; } } LOG . incrementProcessed ( iprogress ) ; } } LOG . ensureCompleted ( iprogress ) ; // If no relevant dimensions were found , skip it . if ( D == null || BitsUtil . cardinality ( D ) == 0 ) { return null ; } // Get all points in the box . DBIDs C = findNeighbors ( dV , D , S , relation ) ; // If we have a non - empty cluster , return it . return ( C . size ( ) >= minClusterSize ) ? makeCluster ( relation , C , D ) : null ;
public class FileSystem { /** * Reads first line in the file specified by { @ code path } . * @ param path Path to read . * @ return First line from the file . * @ throws FileNotFoundException File cannot be found . * @ throws IOException Error reading the file . */ public static String readFirstLine ( String path ) throws FileNotFoundException , IOException { } }
try ( FileInputStream fis = new FileInputStream ( path ) ) { try ( InputStreamReader isr = new InputStreamReader ( fis ) ) { try ( BufferedReader br = new BufferedReader ( isr ) ) { return br . readLine ( ) ; } } }
public class ProgressBar { /** * Wraps a { @ link Stream } so that when iterated , a progress bar is shown to track the traversal progress . * For this function the progress bar can be fully customized by using a { @ link ProgressBarBuilder } . * @ param stream Underlying stream ( can be sequential or parallel ) * @ param pbb An instance of a { @ link ProgressBarBuilder } */ public static < T , S extends BaseStream < T , S > > Stream < T > wrap ( S stream , ProgressBarBuilder pbb ) { } }
Spliterator < T > sp = wrap ( stream . spliterator ( ) , pbb ) ; return StreamSupport . stream ( sp , stream . isParallel ( ) ) ;
public class Session { /** * Executes SQL query , which returns list of entities . * @ param < T > Entity type . * @ param query SQL query string . * @ param entityClass Entity class . * @ param params Parameters , which will be placed instead of ' ? ' signs . * @ return List of result entities . * @ throws SQLException In general SQL error case . * @ throws NoSuchFieldException If result set has field which entity class doesn ' t . * @ throws InstantiationException If entity class hasn ' t default constructor . * @ throws IllegalAccessException If entity class is not accessible . */ public < T > List < T > getList ( String query , Class < T > entityClass , Object ... params ) throws SQLException , NoSuchFieldException , InstantiationException , IllegalAccessException { } }
Cursor < T > cursor = getCursor ( query , entityClass , params ) ; return cursor . fetchList ( ) ;
public class JNDIProjectStageDetector { /** * Performs a JNDI lookup to obtain the current project stage . The method use the standard JNDI name for the JSF project * stage for the lookup * @ return name bound to JNDI or < code > null < / code > */ private String getProjectStageNameFromJNDI ( ) { } }
try { InitialContext context = new InitialContext ( ) ; Object obj = context . lookup ( ProjectStage . PROJECT_STAGE_JNDI_NAME ) ; if ( obj != null ) { return obj . toString ( ) . trim ( ) ; } } catch ( NamingException e ) { // ignore } return null ;
public class TableMeta { /** * カラムのメタデータを追加します 。 * @ param columnMeta カラム記述 */ public void addColumnMeta ( ColumnMeta columnMeta ) { } }
columnMetas . add ( columnMeta ) ; columnMeta . setTableMeta ( this ) ; if ( columnMeta . isPrimaryKey ( ) ) { primaryKeyColumnMetas . add ( columnMeta ) ; }
public class AlertService { /** * Remove Alert policies * @ param policyRefs policy references * @ return OperationFuture wrapper for list of AlertPolicy */ public OperationFuture < List < AlertPolicy > > delete ( AlertPolicy ... policyRefs ) { } }
List < AlertPolicy > policiesList = Arrays . asList ( policyRefs ) ; List < JobFuture > jobs = policiesList . stream ( ) . map ( ref -> delete ( ref ) . jobFuture ( ) ) . collect ( toList ( ) ) ; return new OperationFuture < > ( policiesList , new ParallelJobsFuture ( jobs ) ) ;
public class Parser { /** * 11.5 Multiplicative Expression */ private ParseTree parseMultiplicativeExpression ( ) { } }
SourcePosition start = getTreeStartLocation ( ) ; ParseTree left = parseExponentiationExpression ( ) ; while ( peekMultiplicativeOperator ( ) ) { Token operator = nextToken ( ) ; ParseTree right = parseExponentiationExpression ( ) ; left = new BinaryOperatorTree ( getTreeLocation ( start ) , left , operator , right ) ; } return left ;
public class InverseDepsAnalyzer { /** * Prepend end point to the path */ private Stream < Deque < Archive > > makePaths ( Deque < Archive > path ) { } }
Set < Archive > nodes = endPoints . get ( path . peekFirst ( ) ) ; if ( nodes == null || nodes . isEmpty ( ) ) { return Stream . of ( new LinkedList < > ( path ) ) ; } else { return nodes . stream ( ) . map ( n -> { Deque < Archive > newPath = new LinkedList < > ( ) ; newPath . addFirst ( n ) ; newPath . addAll ( path ) ; return newPath ; } ) ; }
public class ThreadLocalProxyCopyOnWriteArrayList { /** * Appends the specified element to the end of this list . * @ param e element to be appended to this list * @ return < tt > true < / tt > ( as specified by { @ link Collection # add } ) */ @ Override public boolean add ( E e ) { } }
final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { Object [ ] elements = getArray ( ) ; int len = elements . length ; Object [ ] newElements = Arrays . copyOf ( elements , len + 1 ) ; newElements [ len ] = e ; setArray ( newElements ) ; return true ; } finally { lock . unlock ( ) ; }
public class X509CRLImpl { /** * Verifies that this CRL was signed using the * private key that corresponds to the given public key , * and that the signature verification was computed by * the given provider . * @ param key the PublicKey used to carry out the verification . * @ param sigProvider the name of the signature provider . * @ exception NoSuchAlgorithmException on unsupported signature * algorithms . * @ exception InvalidKeyException on incorrect key . * @ exception NoSuchProviderException on incorrect provider . * @ exception SignatureException on signature errors . * @ exception CRLException on encoding errors . */ public synchronized void verify ( PublicKey key , String sigProvider ) throws CRLException , NoSuchAlgorithmException , InvalidKeyException , NoSuchProviderException , SignatureException { } }
if ( sigProvider == null ) { sigProvider = "" ; } if ( ( verifiedPublicKey != null ) && verifiedPublicKey . equals ( key ) ) { // this CRL has already been successfully verified using // this public key . Make sure providers match , too . if ( sigProvider . equals ( verifiedProvider ) ) { return ; } } if ( signedCRL == null ) { throw new CRLException ( "Uninitialized CRL" ) ; } Signature sigVerf = null ; if ( sigProvider . length ( ) == 0 ) { sigVerf = Signature . getInstance ( sigAlgId . getName ( ) ) ; } else { sigVerf = Signature . getInstance ( sigAlgId . getName ( ) , sigProvider ) ; } sigVerf . initVerify ( key ) ; if ( tbsCertList == null ) { throw new CRLException ( "Uninitialized CRL" ) ; } sigVerf . update ( tbsCertList , 0 , tbsCertList . length ) ; if ( ! sigVerf . verify ( signature ) ) { throw new SignatureException ( "Signature does not match." ) ; } verifiedPublicKey = key ; verifiedProvider = sigProvider ;
public class PipelineApi { /** * Modifies a pipeline schedule for project . * < pre > < code > PUT / projects / : id / pipeline _ schedules / : pipeline _ schedule _ id < / code > < / pre > * @ param projectIdOrPath projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance , required * @ param pipelineSchedule the pipelineSchedule instance that contains the pipelineSchedule info to modify * @ return the modified project schedule * @ throws GitLabApiException if any exception occurs */ public PipelineSchedule updatePipelineSchedule ( Object projectIdOrPath , PipelineSchedule pipelineSchedule ) throws GitLabApiException { } }
GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "description" , pipelineSchedule . getDescription ( ) , false ) . withParam ( "ref" , pipelineSchedule . getRef ( ) , false ) . withParam ( "cron" , pipelineSchedule . getCron ( ) , false ) . withParam ( "cron_timezone" , pipelineSchedule . getCronTimezone ( ) , false ) . withParam ( "active" , pipelineSchedule . getActive ( ) , false ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "pipeline_schedules" , pipelineSchedule . getId ( ) ) ; return ( response . readEntity ( PipelineSchedule . class ) ) ;
public class PropertiesLoader { /** * Load properties from resource , with handling of the inclusion . < br > * 从指定的资源中载入properties , 处理包含关系 。 * @ param namelocation of the properties file , which can ends with & quot ; . * & quot ; . < br > * properties文件的位置 , 可以以 & quot ; . * & quot ; 结尾 。 * @ param includePropertyNameTo override the default inclusion keyword . < br > * 如果不想使用缺省的包含属性关键字 , 可以在这里指定 。 * @ returnnull if not found , otherwise return the loaded properties * @ throws IOException resource found , but error when reading * @ throws InvalidPropertiesFormatException resource found , but with wrong format */ public Properties load ( String name , String includePropertyName ) throws InvalidPropertiesFormatException , IOException { } }
return load ( name , includePropertyName , null ) ;
public class OGCGeometry { /** * Create an OGCGeometry instance from the GeometryCursor . * @ param gc * @ param sr * @ return Geometry instance created from the geometry cursor . */ public static OGCGeometry createFromEsriCursor ( GeometryCursor gc , SpatialReference sr ) { } }
return createFromEsriCursor ( gc , sr , false ) ;
public class MetricCollectorSupport { /** * Returns true if the collector is successfully created and started ; * false otherwise . */ private static boolean createAndStartCollector ( CloudWatchMetricConfig config ) { } }
MetricCollectorSupport collector = new MetricCollectorSupport ( config ) ; if ( collector . start ( ) ) { singleton = collector ; return true ; } return false ;
public class Generics { /** * Maps type parameters in a type to their values . * @ param toMapType * Type possibly containing type arguments * @ param typeAndParams * must be either ParameterizedType , or ( in case there are no * type arguments , or it ' s a raw type ) Class * @ return toMapType , but with type parameters from typeAndParams replaced . */ private static Type mapTypeParameters ( Type toMapType , Type typeAndParams ) { } }
if ( isMissingTypeParameters ( typeAndParams ) ) { return erase ( toMapType ) ; } else { VarMap varMap = new VarMap ( ) ; Type handlingTypeAndParams = typeAndParams ; while ( handlingTypeAndParams instanceof ParameterizedType ) { ParameterizedType pType = ( ParameterizedType ) handlingTypeAndParams ; Class < ? > clazz = ( Class < ? > ) pType . getRawType ( ) ; // getRawType // should always // be Class varMap . addAll ( clazz . getTypeParameters ( ) , pType . getActualTypeArguments ( ) ) ; handlingTypeAndParams = pType . getOwnerType ( ) ; } return varMap . map ( toMapType ) ; }
public class SpanOfWeekdays { /** * / * [ deutsch ] * < p > Ermittelt die Anzahl der Tage , die zu dieser Wochentagsspanne geh & ouml ; ren . < / p > * @ return count of days in range { @ code 1-7} */ public int length ( ) { } }
int days = 1 ; Weekday current = this . start ; while ( current != this . end ) { days ++ ; current = current . next ( ) ; } return days ;
public class StringUtil { /** * splits this string around matches of the given separator . * @ param str strings * @ param separator separator * @ param trim include the last separator * @ return the array of strings computed by splitting this string around matches of the given separator */ public static String [ ] split ( String str , String separator , boolean trim ) { } }
if ( str == null ) { return null ; } char sep = separator . charAt ( 0 ) ; ArrayList < String > strList = new ArrayList < String > ( ) ; StringBuilder split = new StringBuilder ( ) ; int index = 0 ; while ( ( index = StringUtils . findNext ( str , sep , StringUtils . ESCAPE_CHAR , index , split ) ) >= 0 ) { ++ index ; // move over the separator for next search strList . add ( split . toString ( ) ) ; split . setLength ( 0 ) ; // reset the buffer } strList . add ( split . toString ( ) ) ; // remove trailing empty split ( s ) if ( trim ) { int last = strList . size ( ) ; // last split while ( -- last >= 0 && "" . equals ( strList . get ( last ) ) ) { strList . remove ( last ) ; } } return strList . toArray ( new String [ strList . size ( ) ] ) ;
public class WxApi2Impl { /** * 微信支付公共POST方法 ( 不带证书 ) * @ param url * 请求路径 * @ param key * 商户KEY * @ param params * 参数 * @ return */ @ Override public NutMap postPay ( String url , String key , Map < String , Object > params ) { } }
params . remove ( "sign" ) ; String sign = WxPaySign . createSign ( key , params ) ; params . put ( "sign" , sign ) ; Request req = Request . create ( url , METHOD . POST ) ; req . setData ( Xmls . mapToXml ( params ) ) ; Response resp = Sender . create ( req ) . send ( ) ; if ( ! resp . isOK ( ) ) throw new IllegalStateException ( "postPay, resp code=" + resp . getStatus ( ) ) ; return Xmls . xmlToMap ( resp . getContent ( "UTF-8" ) ) ;
public class ReferenceCompositeGroupService { /** * Find EntityIdentifiers for entities whose name matches the query string according to the * specified method and is of the specified type */ @ Override public EntityIdentifier [ ] searchForEntities ( String query , IGroupConstants . SearchMethod method , Class type ) throws GroupsException { } }
Set allIds = new HashSet ( ) ; for ( Iterator services = getComponentServices ( ) . values ( ) . iterator ( ) ; services . hasNext ( ) ; ) { IIndividualGroupService service = ( IIndividualGroupService ) services . next ( ) ; EntityIdentifier [ ] ids = service . searchForEntities ( query , method , type ) ; for ( int i = 0 ; i < ids . length ; i ++ ) { allIds . add ( ids [ i ] ) ; } } return ( EntityIdentifier [ ] ) allIds . toArray ( new EntityIdentifier [ allIds . size ( ) ] ) ;
public class SpiderService { /** * Validate the table option " sharding - field " . */ private void validateTableOptionShardingField ( TableDefinition tableDef , String optValue ) { } }
// Verify that the sharding - field exists and is a timestamp field . FieldDefinition shardingFieldDef = tableDef . getFieldDef ( optValue ) ; Utils . require ( shardingFieldDef != null , "Sharding field has not been defined: " + optValue ) ; assert shardingFieldDef != null ; // Make FindBugs happy Utils . require ( shardingFieldDef . getType ( ) == FieldType . TIMESTAMP , "Sharding field must be a timestamp field: " + optValue ) ; Utils . require ( ! shardingFieldDef . isCollection ( ) , "Sharding field cannot be a collection: " + optValue ) ; // Default sharding - granularity to MONTH . if ( tableDef . getOption ( CommonDefs . OPT_SHARDING_GRANULARITY ) == null ) { tableDef . setOption ( CommonDefs . OPT_SHARDING_GRANULARITY , "MONTH" ) ; } // Default sharding - start to " tomorrow " . if ( tableDef . getOption ( CommonDefs . OPT_SHARDING_START ) == null ) { GregorianCalendar startDate = new GregorianCalendar ( Utils . UTC_TIMEZONE ) ; startDate . add ( Calendar . DAY_OF_MONTH , 1 ) ; // adds 1 day String startOpt = String . format ( "%04d-%02d-%02d" , startDate . get ( Calendar . YEAR ) , startDate . get ( Calendar . MONTH ) + 1 , // 0 - relative ! startDate . get ( Calendar . DAY_OF_MONTH ) ) ; tableDef . setOption ( CommonDefs . OPT_SHARDING_START , startOpt ) ; }
public class StringMapTransform { /** * Transform an object * in to another object * @ param input the record to transform * @ return the transformed writable */ @ Override public Object map ( Object input ) { } }
String orig = input . toString ( ) ; if ( map . containsKey ( orig ) ) { return map . get ( orig ) ; } if ( input instanceof String ) return input ; else return orig ;
public class FieldTable { /** * Move all the fields to the output buffer . * @ exception Exception File exception . */ public void fieldsToData ( Rec record ) throws DBException { } }
this . setupNewDataSource ( ) ; int fieldCount = record . getFieldCount ( ) ; // Number of fields to write out for ( int iFieldSeq = Constants . MAIN_FIELD ; iFieldSeq < fieldCount + Constants . MAIN_FIELD ; iFieldSeq ++ ) { Field field = record . getField ( iFieldSeq ) ; if ( field . isVirtual ( ) ) // x | | ( ! field . isSelected ( ) ) ) continue ; // This field is never moved to a buffer this . fieldToData ( field ) ; }
public class NumberCodeGenerator { /** * Adds a method to return the symbol or display name for a currency . */ private void addCurrencyInfoMethod ( TypeSpec . Builder type , String name , Map < String , String > mapping ) { } }
MethodSpec . Builder method = MethodSpec . methodBuilder ( name ) . addModifiers ( PUBLIC ) . addParameter ( Types . CLDR_CURRENCY_ENUM , "code" ) . returns ( String . class ) ; method . beginControlFlow ( "if (code == null)" ) ; method . addStatement ( "return $S" , "" ) ; method . endControlFlow ( ) ; method . beginControlFlow ( "switch (code)" ) ; for ( Map . Entry < String , String > entry : mapping . entrySet ( ) ) { String key = entry . getKey ( ) ; String val = entry . getValue ( ) ; if ( ! key . equals ( val ) ) { method . addStatement ( "case $L: return $S" , key , val ) ; } } method . addStatement ( "default: return code.name()" ) ; method . endControlFlow ( ) ; type . addMethod ( method . build ( ) ) ;
public class ListDatastoresRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListDatastoresRequest listDatastoresRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listDatastoresRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listDatastoresRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listDatastoresRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ConceptDrawProjectReader { /** * Read an exception day for a calendar . * @ param mpxjCalendar ProjectCalendar instance * @ param day ConceptDraw PROJECT exception day */ private void readExceptionDay ( ProjectCalendar mpxjCalendar , ExceptedDay day ) { } }
ProjectCalendarException mpxjException = mpxjCalendar . addCalendarException ( day . getDate ( ) , day . getDate ( ) ) ; if ( day . isIsDayWorking ( ) ) { for ( Document . Calendars . Calendar . ExceptedDays . ExceptedDay . TimePeriods . TimePeriod period : day . getTimePeriods ( ) . getTimePeriod ( ) ) { mpxjException . addRange ( new DateRange ( period . getFrom ( ) , period . getTo ( ) ) ) ; } }
public class OpportunitiesApi { /** * Get opportunities task ( asynchronously ) Return information of an * opportunities task - - - This route expires daily at 11:05 * @ param taskId * ID of an opportunities task ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param callback * The callback to be executed when the API call finishes * @ return The request call * @ throws ApiException * If fail to process the API call , e . g . serializing the request * body object */ public com . squareup . okhttp . Call getOpportunitiesTasksTaskIdAsync ( Integer taskId , String datasource , String ifNoneMatch , final ApiCallback < OpportunitiesTasksResponse > callback ) throws ApiException { } }
com . squareup . okhttp . Call call = getOpportunitiesTasksTaskIdValidateBeforeCall ( taskId , datasource , ifNoneMatch , callback ) ; Type localVarReturnType = new TypeToken < OpportunitiesTasksResponse > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , callback ) ; return call ;