signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class FieldUtils { /** * Writes a named { @ code static } { @ link Field } . Superclasses will be considered .
* @ param cls
* { @ link Class } on which the field is to be found
* @ param fieldName
* to write
* @ param value
* to set
* @ param forceAccess
* whether to break scope restrictions usi... | final Field field = getField ( cls , fieldName , forceAccess ) ; Validate . isTrue ( field != null , "Cannot locate field %s on %s" , fieldName , cls ) ; // already forced access above , don ' t repeat it here :
writeStaticField ( field , value , false ) ; |
public class QuickStartSecurity { /** * Unregister the quick start security security UserRegistryConfiguration . */
private void unregisterQuickStartSecurityRegistryConfiguration ( ) { } } | if ( urConfigReg != null ) { urConfigReg . unregister ( ) ; urConfigReg = null ; quickStartRegistry = null ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "QuickStartSecurityRegistry configuration is not registered." ) ; } } |
public class ConsumerSessionImpl { /** * Retrieve the MPSubscription object that represents the subscription ( durable or non - durable )
* that this ConsumerSession is feeding from
* This function is only available on locally homed subscriptions
* Performing this against a queue consumer results in a SIDurableSu... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getSubscription" ) ; ConsumerDispatcher cd = ( ConsumerDispatcher ) _localConsumerPoint . getConsumerManager ( ) ; MPSubscription mpSubscription = cd . getMPSubscription ( ) ; if ( mpSubscription == null ) { if ( TraceCompo... |
public class InternalXbaseParser { /** * $ ANTLR start synpred66 _ InternalXbase */
public final void synpred66_InternalXbase_fragment ( ) throws RecognitionException { } } | // InternalXbase . g : 2711:2 : ( ( ( rule _ _ XFeatureCall _ _ FeatureCallArgumentsAssignment _ 3_1_0 ) ) )
// InternalXbase . g : 2711:2 : ( ( rule _ _ XFeatureCall _ _ FeatureCallArgumentsAssignment _ 3_1_0 ) )
{ // InternalXbase . g : 2711:2 : ( ( rule _ _ XFeatureCall _ _ FeatureCallArgumentsAssignment _ 3_1_0 ) )... |
public class Consumers { /** * Yields all elements of the iterator ( in the provided map ) .
* @ param < M > the returned map type
* @ param < K > the map key type
* @ param < V > the map value type
* @ param iterator the iterator that will be consumed
* @ param map the map where the iterator is consumed
* ... | dbc . precondition ( map != null , "cannot call dict with a null map" ) ; final Function < Iterator < Pair < K , V > > , M > consumer = new ConsumeIntoMap < > ( new ConstantSupplier < M > ( map ) ) ; return consumer . apply ( iterator ) ; |
public class QueryExecution { /** * unsafely coerce Map < String , String > to Map < CharSequence , CharSequence > */
@ SuppressWarnings ( "unchecked" ) private Map < CharSequence , CharSequence > sneakyCast ( Object m ) { } } | return ( Map < CharSequence , CharSequence > ) m ; |
public class AnimatedDialog { /** * < / p > Closes the dialog with a translation animation to the content view < / p > */
private void slideClose ( ) { } } | if ( ! isClosing_ ) { isClosing_ = true ; TranslateAnimation slideDown = new TranslateAnimation ( Animation . RELATIVE_TO_SELF , 0 , Animation . RELATIVE_TO_SELF , 0 , Animation . RELATIVE_TO_SELF , 0.0f , Animation . RELATIVE_TO_SELF , 1f ) ; slideDown . setDuration ( 500 ) ; slideDown . setInterpolator ( new Decelera... |
public class DateUtils { /** * Attempt to extract a date or date range in standard format from a provided verbatim
* date string .
* @ param verbatimEventDate a string containing a verbatim event date .
* @ return a map with result and resultState as keys
* @ deprecated
* @ see # extractDateFromVerbatimER ( S... | return extractDateFromVerbatim ( verbatimEventDate , DateUtils . YEAR_BEFORE_SUSPECT ) ; |
public class BeanAnalyzer { /** * 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 .
* < p ... | Map < String , PropertyDescriptor > properties = cPropertiesCache . get ( root ) ; if ( properties == null ) { GenericType rootType = root . getRootType ( ) ; if ( rootType == null ) { rootType = root ; } properties = Collections . unmodifiableMap ( createProperties ( rootType , root ) ) ; cPropertiesCache . put ( root... |
public class ListDatasetsResult { /** * A list of " DatasetSummary " objects .
* @ param datasetSummaries
* A list of " DatasetSummary " objects . */
public void setDatasetSummaries ( java . util . Collection < DatasetSummary > datasetSummaries ) { } } | if ( datasetSummaries == null ) { this . datasetSummaries = null ; return ; } this . datasetSummaries = new java . util . ArrayList < DatasetSummary > ( datasetSummaries ) ; |
public class CPDefinitionOptionRelUtil { /** * Returns an ordered range of all the cp definition option rels where CPDefinitionId = & # 63 ; and skuContributor = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < ... | return getPersistence ( ) . findByC_SC ( CPDefinitionId , skuContributor , start , end , orderByComparator , retrieveFromCache ) ; |
public class FeatureStyleInfo { /** * String identifier which is guaranteed to include sufficient information to assure to be different for two
* instances which could produce different result . It is typically used as basis for calculation of hash codes ( like
* MD5 , SHA1 , SHA2 etc ) of ( collections of ) object... | return "FeatureStyleInfo{" + "index=" + index + ", name='" + name + '\'' + ", formula='" + formula + '\'' + ", fillColor='" + fillColor + '\'' + ", fillOpacity=" + fillOpacity + ", strokeColor='" + strokeColor + '\'' + ", strokeOpacity=" + strokeOpacity + ", strokeWidth=" + strokeWidth + ", dashArray='" + dashArray + '... |
public class LongTuples { /** * Recursively increment the given tuple lexicographically , starting at
* the given index .
* @ param current The tuple to increment
* @ param min The minimum values
* @ param max The maximum values
* @ param index The index
* @ return Whether the tuple could be incremented */
... | if ( index == - 1 ) { return false ; } long oldValue = current . get ( index ) ; long newValue = oldValue + 1 ; current . set ( index , newValue ) ; if ( newValue >= max . get ( index ) ) { current . set ( index , min . get ( index ) ) ; return incrementLexicographically ( current , min , max , index - 1 ) ; } return t... |
public class ParquetAvroWriters { /** * Creates a ParquetWriterFactory that accepts and writes Avro generic types .
* The Parquet writers will use the given schema to build and write the columnar data .
* @ param schema The schema of the generic type . */
public static ParquetWriterFactory < GenericRecord > forGene... | final String schemaString = schema . toString ( ) ; final ParquetBuilder < GenericRecord > builder = ( out ) -> createAvroParquetWriter ( schemaString , GenericData . get ( ) , out ) ; return new ParquetWriterFactory < > ( builder ) ; |
public class Jar { /** * Sets an attribute in a non - main section of the manifest .
* @ param section the section ' s name
* @ param name the attribute ' s name
* @ param value the attribute ' s value
* @ return { @ code this }
* @ throws IllegalStateException if entries have been added or the JAR has been w... | verifyNotSealed ( ) ; if ( jos != null ) throw new IllegalStateException ( "Manifest cannot be modified after entries are added." ) ; Attributes attr = getManifest ( ) . getAttributes ( section ) ; if ( attr == null ) { attr = new Attributes ( ) ; getManifest ( ) . getEntries ( ) . put ( section , attr ) ; } attr . put... |
public class StringUtil { /** * Returns subtraction between given String arrays .
* @ param arr1 first array
* @ param arr2 second array
* @ return arr1 without values which are not present in arr2 */
public static String [ ] subtraction ( String [ ] arr1 , String [ ] arr2 ) { } } | if ( arr1 == null || arr1 . length == 0 || arr2 == null || arr2 . length == 0 ) { return arr1 ; } List < String > list = new ArrayList < String > ( Arrays . asList ( arr1 ) ) ; list . removeAll ( Arrays . asList ( arr2 ) ) ; return list . toArray ( new String [ 0 ] ) ; |
public class MarkdownNotebookOutput { /** * Format string .
* @ param fmt the fmt
* @ param args the args
* @ return the string */
@ javax . annotation . Nonnull public String format ( @ javax . annotation . Nonnull String fmt , @ javax . annotation . Nonnull Object ... args ) { } } | return 0 == args . length ? fmt : String . format ( fmt , args ) ; |
public class MetadataCache { /** * Creates a metadata cache archive file of all tracks in the specified slot on the specified player . Any
* previous contents of the specified file will be replaced . If a non - { @ code null } { @ code listener } is
* supplied , its { @ link MetadataCacheCreationListener # cacheCre... | "SameParameterValue" , "WeakerAccess" } ) public static void createMetadataCache ( final SlotReference slot , final int playlistId , final File cache , final MetadataCacheCreationListener listener ) throws Exception { ConnectionManager . ClientTask < Object > task = new ConnectionManager . ClientTask < Object > ( ) { @... |
public class DataSiftPush { /** * Updates the name or output parameters for a push sucription
* @ param id the subscription ID
* @ param connector the output parameters to update to
* @ param name an optional name to update with
* @ return the updated push subscription */
public FutureData < PushSubscription > ... | if ( id == null || id . isEmpty ( ) || connector == null ) { throw new IllegalArgumentException ( "A push subscription ID and output parameters is required" ) ; } FutureData < PushSubscription > future = new FutureData < > ( ) ; URI uri = newParams ( ) . forURL ( config . newAPIEndpointURI ( UPDATE ) ) ; POST request =... |
public class HttpOutputStreamImpl { /** * @ see java . io . OutputStream # write ( byte [ ] , int , int ) */
@ Override public void write ( byte [ ] value , int start , int len ) throws IOException { } } | validate ( ) ; writeToBuffers ( value , start , len ) ; |
public class Resource { /** * 得到Resource指定行数的内容 , 用于调试 , 报错等显示原有模板信息 , 如果获取不了 返回NUll
* @ param start
* @ param end
* @ return */
public String getContent ( int start , int end ) throws IOException { } } | // bug , 混合回车符号也许定位不到准确行数 ?
String lineSeparator = System . getProperty ( "line.separator" ) ; Reader br = null ; try { br = openReader ( ) ; BufferedReader reader = new BufferedReader ( br ) ; String line = null ; StringBuilder sb = new StringBuilder ( ) ; int index = 0 ; while ( ( line = reader . readLine ( ) ) != nu... |
public class CamelCatalogHelper { /** * Checks whether the given key is a multi valued option
* @ param scheme the component name
* @ param key the option key
* @ return < tt > true < / tt > if the key is multi valued , < tt > false < / tt > otherwise */
public static String getPrefix ( CamelCatalog camelCatalog ... | // use the camel catalog
String json = camelCatalog . componentJSonSchema ( scheme ) ; if ( json == null ) { throw new IllegalArgumentException ( "Could not find catalog entry for component name: " + scheme ) ; } List < Map < String , String > > data = JSonSchemaHelper . parseJsonSchema ( "properties" , json , true ) ;... |
public class ChatRoomClient { /** * Add members to chat room
* @ param roomId chat room id
* @ param members username array
* @ return No content
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public ResponseWrapper addChatRoomMember ( long roomId , Str... | Preconditions . checkArgument ( roomId > 0 , "room id is invalid" ) ; Preconditions . checkArgument ( members != null && members . length > 0 , "member should not be empty" ) ; JsonArray array = new JsonArray ( ) ; for ( String username : members ) { array . add ( new JsonPrimitive ( username ) ) ; } return _httpClient... |
public class FileUtilsV2_2 { /** * Copies a whole directory to a new location preserving the file dates .
* This method copies the specified directory and all its child
* directories and files to the specified destination .
* The destination is the new location and name of the directory .
* The destination dire... | copyDirectory ( srcDir , destDir , true ) ; |
public class JsonReader { /** * Check if the passed Path can be resembled to valid Json content . This is
* accomplished by fully parsing the Json file each time the method is called .
* This consumes < b > less memory < / b > than calling any of the
* < code > read . . . < / code > methods and checking for a non... | return isValidJson ( new FileSystemResource ( aPath ) , aFallbackCharset ) ; |
public class TrivialSwap { /** * Swap the elements of two float arrays at the specified positions .
* @ param floatArray1 one of the arrays that will have one of its values swapped .
* @ param array1Index the index of the first array that will be swapped .
* @ param floatArray2 the other array that will have one ... | if ( floatArray1 [ array1Index ] != floatArray2 [ array2Index ] ) { float hold = floatArray1 [ array1Index ] ; floatArray1 [ array1Index ] = floatArray2 [ array2Index ] ; floatArray2 [ array2Index ] = hold ; } |
public class WriterOutputStream { /** * Write bytes from the specified byte array to the stream .
* @ param b the byte array containing the bytes to write ,
* @ param off the start offset in the byte array ,
* @ param len the number of bytes to write .
* @ throws IOException if writing operation to underlying t... | while ( len > 0 ) { int c = Math . min ( len , bytesBuffer . remaining ( ) ) ; bytesBuffer . put ( b , off , c ) ; processBytesBuffer ( false ) ; len -= c ; off += c ; } |
public class PdfStamper { /** * Applies a digital signature to a document . The returned PdfStamper
* can be used normally as the signature is only applied when closing .
* A possible use is :
* < pre >
* KeyStore ks = KeyStore . getInstance ( " pkcs12 " ) ;
* ks . load ( new FileInputStream ( " my _ private ... | return createSignature ( reader , os , pdfVersion , tempFile , false ) ; |
public class UrlHelper { /** * Returns an absolute URL for the specified path .
* Example : If the current request URL is http : / / example . org / helloworld / internal / status ,
* { @ code absoluteHrefOf ( " / internal / health " ) } will return http : / / example . org / helloworld / internal / health ( with
... | try { return fromCurrentServletMapping ( ) . path ( path ) . build ( ) . toString ( ) ; } catch ( final IllegalStateException e ) { return path ; } |
public class TypeEnter { /** * Generate default constructor for given class . For classes different
* from java . lang . Object , this is :
* c ( argtype _ 0 x _ 0 , . . . , argtype _ n x _ n ) throws thrown {
* super ( x _ 0 , . . . , x _ n )
* or , if based = = true :
* c ( argtype _ 0 x _ 0 , . . . , argty... | JCTree result ; if ( ( c . flags ( ) & ENUM ) != 0 && ( types . supertype ( c . type ) . tsym == syms . enumSym ) ) { // constructors of true enums are private
flags = ( flags & ~ AccessFlags ) | PRIVATE | GENERATEDCONSTR ; } else flags |= ( c . flags ( ) & AccessFlags ) | GENERATEDCONSTR ; if ( c . name . isEmpty ( ) ... |
public class AmazonRoute53Client { /** * Retrieves a list of supported geographic locations .
* Countries are listed first , and continents are listed last . If Amazon Route 53 supports subdivisions for a
* country ( for example , states or provinces ) , the subdivisions for that country are listed in alphabetical ... | request = beforeClientExecution ( request ) ; return executeListGeoLocations ( request ) ; |
public class EntityUtils { /** * Read the contents of an entity and return it as a byte array .
* @ param entity
* @ return byte array containing the entity content . May be null if
* { @ link HttpEntity # getContent ( ) } is null .
* @ throws IOException if an error occurs reading the input stream
* @ throws... | if ( entity == null ) { throw new IllegalArgumentException ( "HTTP entity may not be null" ) ; } InputStream instream = entity . getContent ( ) ; if ( instream == null ) { return null ; } try { if ( entity . getContentLength ( ) > Integer . MAX_VALUE ) { throw new IllegalArgumentException ( "HTTP entity too large to be... |
public class WhiteboxImpl { /** * Check if parameter types are same .
* @ param isVarArgs Whether or not the method or constructor contains var args .
* @ param expectedParameterTypes the expected parameter types
* @ param actualParameterTypes the actual parameter types
* @ return if all actual parameter types ... | return new ParameterTypesMatcher ( isVarArgs , expectedParameterTypes , actualParameterTypes ) . match ( ) ; |
public class JSpinField { /** * Sets the value . This is a bound property .
* @ param newValue
* the new value
* @ see # getValue */
public void setValue ( int newValue ) { } } | setValue ( newValue , true , true ) ; spinner . setValue ( new Integer ( value ) ) ; |
public class FedoraPolicyStore { /** * ( non - Javadoc )
* @ see
* org . fcrepo . server . security . xacml . pdp . data . PolicyDataManager # addPolicy
* ( java . lang . String , java . lang . String ) */
@ Override public String addPolicy ( String document , String name ) throws PolicyStoreException { } } | String policyName ; if ( name == null || name . isEmpty ( ) ) { // no policy name , derive from document
// ( note : policy ID is mandatory according to schema )
try { policyName = utils . getPolicyName ( document ) ; } catch ( MelcoePDPException e ) { throw new PolicyStoreException ( "Could not get policy name from po... |
public class AmazonCodeDeployClient { /** * Lists the deployment groups for an application registered with the IAM user or AWS account .
* @ param listDeploymentGroupsRequest
* Represents the input of a ListDeploymentGroups operation .
* @ return Result of the ListDeploymentGroups operation returned by the servic... | request = beforeClientExecution ( request ) ; return executeListDeploymentGroups ( request ) ; |
public class TypesImpl { /** * The direct superclass is the class from whose implementation the
* implementation of the current class is derived .
* @ param t
* @ return */
@ Override public List < ? extends TypeMirror > directSupertypes ( TypeMirror t ) { } } | switch ( t . getKind ( ) ) { case DECLARED : DeclaredType dt = ( DeclaredType ) t ; TypeElement te = ( TypeElement ) dt . asElement ( ) ; List < TypeMirror > list = new ArrayList < > ( ) ; TypeElement superclass = ( TypeElement ) asElement ( te . getSuperclass ( ) ) ; if ( superclass != null ) { list . add ( 0 , superc... |
public class LookupManagerImpl { /** * Get the DirectoryLookupService to do the lookup .
* It is thread safe and lazy initialized .
* @ return
* the LookupService . */
private DirectoryLookupService getLookupService ( ) { } } | if ( lookupService == null ) { synchronized ( this ) { if ( lookupService == null ) { boolean cacheEnabled = Configurations . getBoolean ( SD_API_CACHE_ENABLED_PROPERTY , SD_API_CACHE_ENABLED_DEFAULT ) ; if ( cacheEnabled ) { CachedDirectoryLookupService service = new CachedDirectoryLookupService ( directoryServiceClie... |
public class ResponseBuilder { /** * Removes < speak > < / speak > XML tag in speechOutput
* @ param outputSpeech output speech
* @ return trimmed output speech */
private String trimOutputSpeech ( String outputSpeech ) { } } | if ( outputSpeech == null ) { return "" ; } String trimmedOutputSpeech = outputSpeech . trim ( ) ; if ( trimmedOutputSpeech . startsWith ( "<speak>" ) && trimmedOutputSpeech . endsWith ( "</speak>" ) ) { return trimmedOutputSpeech . substring ( 7 , trimmedOutputSpeech . length ( ) - 8 ) . trim ( ) ; } return trimmedOut... |
public class Builder { /** * Closes the last opened tag or section .
* @ return this builder
* @ throws IllegalStateException if there are no pending tags to close */
public Builder end ( ) { } } | if ( ends . isEmpty ( ) ) throw new IllegalStateException ( "No pending tag/section to close." ) ; String tag = ends . pop ( ) ; html . a ( tag ) ; if ( newLineAfterTheseTags . contains ( tag . toLowerCase ( ) ) ) { html . nl ( ) ; text . nl ( ) ; } return this ; |
public class TypedValue { /** * Sets the value of the test property .
* @ param value
* allowed object is
* { @ link AValue } */
public void setValueItem ( AValue value ) { } } | this . avalue = value ; if ( value != null ) { Object o = SQLValueConverter . convertFromAValue ( value ) ; if ( o != null ) { if ( o instanceof QualifiedName ) { this . value = o ; } else { this . value = o . toString ( ) ; } } } |
public class FailsafeExecutor { /** * Executes the { @ code supplier } asynchronously until a successful result is returned or the configured policies are
* exceeded .
* If a configured circuit breaker is open , the resulting future is completed with { @ link
* CircuitBreakerOpenException } .
* @ throws NullPoi... | return callAsync ( execution -> Functions . promiseOf ( supplier , execution ) , false ) ; |
public class Times { /** * Gets the day end time with the specified time .
* @ param time the specified time
* @ return day end time */
public static long getDayEndTime ( final long time ) { } } | final Calendar end = Calendar . getInstance ( ) ; end . setTimeInMillis ( time ) ; final int year = end . get ( Calendar . YEAR ) ; final int month = end . get ( Calendar . MONTH ) ; final int day = end . get ( Calendar . DATE ) ; end . set ( year , month , day , 23 , 59 , 59 ) ; end . set ( Calendar . MILLISECOND , 99... |
public class onlinkipv6prefix { /** * Use this API to unset the properties of onlinkipv6prefix resources .
* Properties that need to be unset are specified in args array . */
public static base_responses unset ( nitro_service client , onlinkipv6prefix resources [ ] , String [ ] args ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { onlinkipv6prefix unsetresources [ ] = new onlinkipv6prefix [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { unsetresources [ i ] = new onlinkipv6prefix ( ) ; unsetresources [ i ] . ipv6prefix = resources [ i ... |
public class DateFormat { /** * Returns the date formatter with the given formatting style
* for the given locale .
* @ param style the given formatting style . For example ,
* SHORT for " M / d / yy " in the US locale . As currently implemented , relative date
* formatting only affects a limited range of calen... | return get ( style , - 1 , ULocale . forLocale ( aLocale ) , null ) ; |
public class NetUtils { /** * Turns an Inet4Address into a 32 - bit integer representation
* @ param addr address
* @ return integer representation */
public static int ipv4ToInt ( final Inet4Address addr ) { } } | int value = 0 ; for ( byte chunk : addr . getAddress ( ) ) { value <<= 8 ; value |= chunk & 0xff ; } return value ; |
public class UriUtils { /** * Returns a pair of strings created from two strings .
* @ param s1 The first string .
* @ param s2 The second string .
* @ return A pair of strings created from the two given strings . */
public static Pair < String , String > pair ( final String s1 , final String s2 ) { } } | if ( StringUtils . isBlank ( s1 ) ) { LOG . warn ( "Blank first arg" ) ; } if ( StringUtils . isBlank ( s2 ) ) { LOG . warn ( "Blank second arg for: " + s1 ) ; } return new PairImpl < String , String > ( s1 , s2 ) ; |
public class LoggingService { /** * Makes the provided log lines available to all log tail subscribers
* @ param lines */
private void storeWithSubscribers ( final List < LogLineTableEntity > lines ) { } } | synchronized ( subscribers ) { if ( subscribers . isEmpty ( ) ) return ; // No subscribers , ignore call
for ( LogSubscriber subscriber : subscribers ) { subscriber . append ( lines ) ; } if ( System . currentTimeMillis ( ) > nextSubscriberPurge ) { purgeIdleSubscribers ( ) ; nextSubscriberPurge = System . currentTimeM... |
public class RemoteServiceProxy { /** * Returns a { @ link com . google . gwt . user . client . rpc . SerializationStreamReader
* SerializationStreamReader } that is ready for reading .
* @ param encoded string that encodes the response of an RPC request
* @ return { @ link com . google . gwt . user . client . rp... | ClientSerializationStreamReader clientSerializationStreamReader = new ClientSerializationStreamReader ( serializer ) ; clientSerializationStreamReader . prepareToRead ( getEncodedInstance ( encoded ) ) ; return clientSerializationStreamReader ; |
public class ArrayUtils { /** * Returns the element at the given index in the { @ code array } .
* @ param < T > { @ link Class } type of elements in the array .
* @ param array array from which to extract the given element at index .
* @ param index integer indicating the index of the element in the array to ret... | return nullSafeLength ( array ) > index ? array [ index ] : defaultValue ; |
public class ObjectClassDefinitionSpecification { /** * Helper method to filter between required and optional ADs
* @ param isRequired
* @ return */
private AttributeDefinitionSpecification [ ] getADs ( boolean isRequired ) { } } | AttributeDefinitionSpecification [ ] retVal = null ; Vector < AttributeDefinitionSpecification > vector = new Vector < AttributeDefinitionSpecification > ( ) ; for ( Map . Entry < String , AttributeDefinitionSpecification > entry : attributes . entrySet ( ) ) { AttributeDefinitionSpecification ad = entry . getValue ( )... |
public class ISUPMessageImpl { /** * takes care of endoding parameters - poniters and actual parameters .
* @ param parameters - list of parameters
* @ param bos - output
* @ param isOptionalPartPresent - if < b > true < / b > this will encode pointer to point for start of optional part , otherwise it
* will en... | try { byte [ ] pointers = null ; // complicated
if ( ! mandatoryVariablePartPossible ( ) ) { // we ommit pointer to this part , go straight for optional pointer .
if ( optionalPartIsPossible ( ) ) { if ( isOptionalPartPresent ) { pointers = new byte [ ] { 0x01 } ; } else { // zeros
pointers = new byte [ ] { 0x00 } ; } ... |
public class CertificatesImpl { /** * Deletes a certificate from the specified account .
* You cannot delete a certificate if a resource ( pool or compute node ) is using it . Before you can delete a certificate , you must therefore make sure that the certificate is not associated with any existing pools , the certif... | if ( this . client . batchUrl ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.batchUrl() is required and cannot be null." ) ; } if ( thumbprintAlgorithm == null ) { throw new IllegalArgumentException ( "Parameter thumbprintAlgorithm is required and cannot be null." ) ; } if ( thumbprint == n... |
public class BubbleChart { /** * Add a value
* @ param x x
* @ param y y
* @ param radius radius
* @ param label label */
public void addValue ( Float x , Float y , Float radius , String label ) { } } | bubbleData . addValue ( new BubbleItem ( x , y , radius , label ) ) ; |
public class ArgumentDefinition { /** * Composes the help string on the possible options an { @ link Enum } typed argument can take .
* @ param clazz target enum class . Assumed no to be { @ code null } .
* @ param < T > enum class type .
* @ throws CommandLineException if { @ code & lt ; T & gt ; } has no consta... | // We assume that clazz is guaranteed to be a Class < ? extends Enum > , thus
// getEnumConstants ( ) won ' t ever return a null .
final T [ ] enumConstants = clazz . getEnumConstants ( ) ; if ( enumConstants . length == 0 ) { throw new CommandLineException ( String . format ( "Bad argument enum type '%s' with no optio... |
public class CustomizableFocusTraversalPolicy { /** * Sets a custom focus traversal order for the given container . Child
* components for which there is no order specified will receive focus after
* components that do have an order specified in the standard " layout "
* order .
* @ param container
* the cont... | for ( Iterator i = componentsInOrder . iterator ( ) ; i . hasNext ( ) ; ) { Component comp = ( Component ) i . next ( ) ; if ( comp . getParent ( ) != container ) { throw new IllegalArgumentException ( "Component [" + comp + "] is not a child of [" + container + "]." ) ; } } container . putClientProperty ( FOCUS_ORDER_... |
public class ForgetSmartHomeAppliancesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ForgetSmartHomeAppliancesRequest forgetSmartHomeAppliancesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( forgetSmartHomeAppliancesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( forgetSmartHomeAppliancesRequest . getRoomArn ( ) , ROOMARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall req... |
public class CopyDataPublisher { /** * Publish data for a { @ link CopyableDataset } . */
private void publishFileSet ( CopyEntity . DatasetAndPartition datasetAndPartition , Collection < WorkUnitState > datasetWorkUnitStates ) throws IOException { } } | Map < String , String > additionalMetadata = Maps . newHashMap ( ) ; Preconditions . checkArgument ( ! datasetWorkUnitStates . isEmpty ( ) , "publishFileSet received an empty collection work units. This is an error in code." ) ; CopyableDatasetMetadata metadata = CopyableDatasetMetadata . deserialize ( datasetWorkUnitS... |
public class ProtectableContainersInner { /** * Lists the containers registered to Recovery Services Vault .
* @ param vaultName The name of the recovery services vault .
* @ param resourceGroupName The name of the resource group where the recovery services vault is present .
* @ param fabricName Fabric name asso... | return listWithServiceResponseAsync ( vaultName , resourceGroupName , fabricName , filter ) . map ( new Func1 < ServiceResponse < Page < ProtectableContainerResourceInner > > , Page < ProtectableContainerResourceInner > > ( ) { @ Override public Page < ProtectableContainerResourceInner > call ( ServiceResponse < Page <... |
public class SourceTableFeatureDetails { /** * Represents the LSI properties for the table when the backup was created . It includes the IndexName , KeySchema and
* Projection for the LSIs on the table at the time of backup .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Us... | if ( this . localSecondaryIndexes == null ) { setLocalSecondaryIndexes ( new java . util . ArrayList < LocalSecondaryIndexInfo > ( localSecondaryIndexes . length ) ) ; } for ( LocalSecondaryIndexInfo ele : localSecondaryIndexes ) { this . localSecondaryIndexes . add ( ele ) ; } return this ; |
public class MyTableModel { /** * Re - evaluates the expressions in the table . */
void updateModel ( ) { } } | for ( int i = 0 ; i < expressions . size ( ) ; ++ i ) { String expr = expressions . get ( i ) ; String result = "" ; if ( expr . length ( ) > 0 ) { result = debugGui . dim . eval ( expr ) ; if ( result == null ) result = "" ; } else { result = "" ; } result = result . replace ( '\n' , ' ' ) ; values . set ( i , result ... |
public class ViewSelectorAssertions { /** * Fluent assertion entry point for a selection of views from the given activity
* based on the given selector . It may be helpful to statically import this rather
* than { @ link # assertThat ( ViewSelection ) } to avoid conflicts with other statically
* imported { @ code... | return assertThat ( selection ( selector , activity ) ) ; |
public class CPDefinitionServiceBaseImpl { /** * Sets the asset category remote service .
* @ param assetCategoryService the asset category remote service */
public void setAssetCategoryService ( com . liferay . asset . kernel . service . AssetCategoryService assetCategoryService ) { } } | this . assetCategoryService = assetCategoryService ; |
public class NameSpace { /** * Sets a variable or property . See " setVariable " for rules regarding
* scoping .
* We first check for the existence of the variable . If it exists , we set
* it . If the variable does not exist we look for a property . If the
* property exists and is writable we set it . Finally ... | this . setVariableOrProperty ( name , value , strictJava , true ) ; |
public class PushbackReader { /** * Reads a single character .
* @ return The character read , or - 1 if the end of the stream has been
* reached
* @ exception IOException If an I / O error occurs */
public int read ( ) throws IOException { } } | synchronized ( lock ) { ensureOpen ( ) ; if ( pos < buf . length ) return buf [ pos ++ ] ; else return super . read ( ) ; } |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcSensorType ( ) { } } | if ( ifcSensorTypeEClass == null ) { ifcSensorTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 592 ) ; } return ifcSensorTypeEClass ; |
public class JesqueUtils { /** * Join the given strings , separated by the given separator .
* @ param sep
* the separator
* @ param strs
* the strings to join
* @ return the joined string */
public static String join ( final String sep , final String ... strs ) { } } | return join ( sep , Arrays . asList ( strs ) ) ; |
public class AWSApplicationDiscoveryClient { /** * Associates one or more configuration items with an application .
* @ param associateConfigurationItemsToApplicationRequest
* @ return Result of the AssociateConfigurationItemsToApplication operation returned by the service .
* @ throws AuthorizationErrorException... | request = beforeClientExecution ( request ) ; return executeAssociateConfigurationItemsToApplication ( request ) ; |
public class EnableOnPhysicalHandler { /** * Constructor .
* @ param record My owner ( usually passed as null , and set on addListener in setOwner ( ) ) .
* @ param field Target field .
* @ param iFieldSeq Target field .
* @ param bEnbleOnValid Enable / disable the fields on valid .
* @ param bEnableOnNew Ena... | super . init ( record , null , null , true , true , null ) ; |
public class BitZMarketDataServiceRaw { /** * TODO : Exception Handling - See Bitfinex */
public BitZKline getBitZKline ( String pair , String type ) throws IOException { } } | return bitz . getKlineResult ( pair , type ) . getData ( ) ; |
public class ImportNodeData { /** * { @ inheritDoc } */
public AccessControlList getACL ( ) { } } | if ( exoPrivileges != null || exoOwner != null ) { return ACLInitializationHelper . initAcl ( super . getACL ( ) , exoOwner , exoPrivileges ) ; } return super . getACL ( ) ; |
public class BdbStoreFactory { /** * Creates a Berkeley DB database environment from the provided environment
* configuration .
* @ return an environment instance .
* @ throws SecurityException if the directory for storing the databases
* could not be created .
* @ throws EnvironmentNotFoundException if the e... | EnvironmentConfig envConf = createEnvConfig ( ) ; if ( ! envFile . exists ( ) ) { envFile . mkdirs ( ) ; } LOGGER . log ( Level . INFO , "Initialized BerkeleyDB cache environment at {0}" , envFile . getAbsolutePath ( ) ) ; return new Environment ( this . envFile , envConf ) ; |
public class QuestQueryProcessor { /** * Returns the final rewriting of the given query */
@ Override public String getRewritingRendering ( InputQuery query ) throws OntopReformulationException { } } | InternalSparqlQuery translation = query . translate ( inputQueryTranslator ) ; try { IQ converetedIQ = preProcess ( translation ) ; IQ rewrittenIQ = rewriter . rewrite ( converetedIQ ) ; return rewrittenIQ . toString ( ) ; } catch ( EmptyQueryException e ) { e . printStackTrace ( ) ; } return "EMPTY REWRITING" ; |
public class Validate { /** * < p > Validate that the specified argument map is neither { @ code null } nor a size of zero ( no elements ) ; otherwise throwing an exception with the specified message .
* < pre > Validate . notEmpty ( myMap , " The map must not be empty " ) ; < / pre >
* @ param < T >
* the map ty... | return INSTANCE . notEmpty ( map , message , values ) ; |
public class VirtualMachineScaleSetsInner { /** * Deallocates specific virtual machines in a VM scale set . Shuts down the virtual machines and releases the compute resources . You are not billed for the compute resources that this virtual machine scale set deallocates .
* @ param resourceGroupName The name of the re... | return deallocateWithServiceResponseAsync ( resourceGroupName , vmScaleSetName ) . map ( new Func1 < ServiceResponse < OperationStatusResponseInner > , OperationStatusResponseInner > ( ) { @ Override public OperationStatusResponseInner call ( ServiceResponse < OperationStatusResponseInner > response ) { return response... |
public class X509CertSelector { /** * Make a { @ code GeneralNameInterface } out of a name type ( 0-8 ) and an
* Object that may be a byte array holding the ASN . 1 DER encoded
* name or a String form of the name . Except for X . 509
* Distinguished Names , the String form of the name must not be the
* result f... | GeneralNameInterface result ; if ( debug != null ) { debug . println ( "X509CertSelector.makeGeneralNameInterface(" + type + ")..." ) ; } if ( name instanceof String ) { if ( debug != null ) { debug . println ( "X509CertSelector.makeGeneralNameInterface() " + "name is String: " + name ) ; } switch ( type ) { case NAME_... |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcPipeSegmentTypeEnum createIfcPipeSegmentTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcPipeSegmentTypeEnum result = IfcPipeSegmentTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class FessMessages { /** * Add the created action message for the key ' errors . suffix ' with parameters .
* < pre >
* message : & lt ; / li & gt ;
* < / pre >
* @ param property The property name for the message . ( NotNull )
* @ return this . ( NotNull ) */
public FessMessages addErrorsSuffix ( Stri... | assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_SUFFIX ) ) ; return this ; |
public class GraphRunner { /** * Write out the session options used
* by this { @ link GraphRunner }
* a s a json string using the
* { @ link JsonFormat }
* @ return */
public String sessionOptionsToJson ( ) { } } | try { return JsonFormat . printer ( ) . print ( protoBufConfigProto ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ; |
public class ItemLevelRecoveryConnectionsInner { /** * Revokes an iSCSI connection which can be used to download a script . Executing this script opens a file explorer displaying all recoverable files and folders . This is an asynchronous operation .
* @ param vaultName The name of the Recovery Services vault .
* @... | return ServiceFuture . fromResponse ( revokeWithServiceResponseAsync ( vaultName , resourceGroupName , fabricName , containerName , protectedItemName , recoveryPointId ) , serviceCallback ) ; |
public class ResourceHandler { void sendDirectory ( HttpRequest request , HttpResponse response , Resource resource , boolean parent ) throws IOException { } } | if ( ! _dirAllowed ) { response . sendError ( HttpResponse . __403_Forbidden ) ; return ; } request . setHandled ( true ) ; if ( log . isDebugEnabled ( ) ) log . debug ( "sendDirectory: " + resource ) ; byte [ ] data = null ; if ( resource instanceof CachedResource ) data = ( ( CachedResource ) resource ) . getCachedDa... |
public class Frame { /** * Pushes a value into the operand stack of this frame .
* @ param value
* the value that must be pushed into the stack .
* @ throws IndexOutOfBoundsException
* if the operand stack is full . */
public void push ( final V value ) throws IndexOutOfBoundsException { } } | if ( top + locals >= values . length ) { throw new IndexOutOfBoundsException ( "Insufficient maximum stack size." ) ; } values [ top ++ + locals ] = value ; |
public class Curve25519 { /** * / * Convert from internal format to little - endian byte format . The
* number must be in a reduced form which is output by the following ops :
* unpack , mul , sqr
* set - - if input in range 0 . . P25
* If you ' re unsure if the number is reduced , first multiply it by 1. */
pr... | int ld = 0 , ud = 0 ; long t ; ld = ( is_overflow ( x ) ? 1 : 0 ) - ( ( x . _9 < 0 ) ? 1 : 0 ) ; ud = ld * - ( P25 + 1 ) ; ld *= 19 ; t = ld + x . _0 + ( x . _1 << 26 ) ; m [ 0 ] = ( byte ) t ; m [ 1 ] = ( byte ) ( t >> 8 ) ; m [ 2 ] = ( byte ) ( t >> 16 ) ; m [ 3 ] = ( byte ) ( t >> 24 ) ; t = ( t >> 32 ) + ( x . _2 <... |
public class VarExporter { /** * Write all variables as a JSON object . Will not escape names or values . All values are
* written as Strings .
* @ param out writer */
public void dumpJson ( final PrintWriter out ) { } } | out . append ( "{" ) ; visitVariables ( new Visitor ( ) { int count = 0 ; public void visit ( Variable var ) { if ( count ++ > 0 ) { out . append ( ", " ) ; } out . append ( var . getName ( ) ) . append ( "='" ) . append ( String . valueOf ( var . getValue ( ) ) ) . append ( "'" ) ; } } ) ; out . append ( "}" ) ; |
public class Lpc { /** * interpolates the log curve from the linear curve . */
void lpc_to_curve ( float [ ] curve , float [ ] lpc , float amp ) { } } | for ( int i = 0 ; i < ln * 2 ; i ++ ) curve [ i ] = 0.0f ; if ( amp == 0 ) return ; for ( int i = 0 ; i < m ; i ++ ) { curve [ i * 2 + 1 ] = lpc [ i ] / ( 4 * amp ) ; curve [ i * 2 + 2 ] = - lpc [ i ] / ( 4 * amp ) ; } fft . backward ( curve ) ; { int l2 = ln * 2 ; float unit = ( float ) ( 1. / amp ) ; curve [ 0 ] = ( ... |
public class FctConvertersToFromString { /** * < p > Create put CnvTfsHasId ( Composite ) . < / p >
* @ param pBeanName - bean name
* @ param pClass - bean class
* @ param pIdName - bean ID name
* @ return requested CnvTfsHasId ( String )
* @ throws Exception - an exception */
protected final CnvTfsHasId < IH... | CnvTfsHasId < IHasId < Object > , Object > convrt = new CnvTfsHasId < IHasId < Object > , Object > ( ) ; convrt . setUtlReflection ( getUtlReflection ( ) ) ; Field rapiFieldId = this . fieldsRapiHolder . getFor ( pClass , pIdName ) ; convrt . setIdConverter ( lazyGetCnvTfsObject ( rapiFieldId . getType ( ) ) ) ; convrt... |
public class ParquetGroup { /** * Add any object of { @ link PrimitiveType } or { @ link Group } type with a String key .
* @ param key
* @ param object */
public void add ( String key , Object object ) { } } | int fieldIndex = getIndex ( key ) ; if ( object . getClass ( ) == ParquetGroup . class ) { this . addGroup ( key , ( Group ) object ) ; } else { this . add ( fieldIndex , ( Primitive ) object ) ; } |
public class FileUtils { /** * Copia el contenido de un fichero a otro en caso de error lanza una excepcion .
* @ param source
* @ param dest
* @ throws IOException */
public static void copyFromFileToFile ( File source , File dest ) throws IOException { } } | try { FileInputStream in = new FileInputStream ( source ) ; FileOutputStream out = new FileOutputStream ( dest ) ; try { FileChannel canalFuente = in . getChannel ( ) ; FileChannel canalDestino = out . getChannel ( ) ; canalFuente . transferTo ( 0 , canalFuente . size ( ) , canalDestino ) ; } catch ( IOException e ) { ... |
public class RobustLoaderWriterResilienceStrategy { /** * Delete the key from the loader - writer if it is found with a matching value . Note that the load and write pair
* is not atomic . This atomicity , if needed , should be handled by the something else .
* @ param key the key being removed
* @ param value th... | try { V loadedValue ; try { loadedValue = loaderWriter . load ( key ) ; } catch ( Exception e1 ) { throw ExceptionFactory . newCacheLoadingException ( e1 , e ) ; } if ( loadedValue == null ) { return false ; } if ( ! loadedValue . equals ( value ) ) { return false ; } try { loaderWriter . delete ( key ) ; } catch ( Exc... |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getMBC ( ) { } } | if ( mbcEClass == null ) { mbcEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 287 ) ; } return mbcEClass ; |
public class LogConfiguration { /** * The configuration options to send to the log driver . This parameter requires version 1.19 of the Docker Remote
* API or greater on your container instance . To check the Docker Remote API version on your container instance , log
* in to your container instance and run the foll... | setOptions ( options ) ; return this ; |
public class Tracer { /** * Stop the trace .
* This may only be done once and must be done from the same thread
* that started it .
* @ param silenceThreshold Traces for time less than silence _ threshold
* ms will be left out of the trace report . A value of - 1 indicates
* that the current ThreadTrace silen... | checkState ( Thread . currentThread ( ) == startThread ) ; ThreadTrace trace = getThreadTrace ( ) ; // Do nothing if the thread trace was not initialized .
if ( ! trace . isInitialized ( ) ) { return 0 ; } stopTimeMs = clock . currentTimeMillis ( ) ; if ( extraTracingValues != null ) { // We use extraTracingValues . le... |
public class DirectoryOperation { /** * Get the total number of bytes that this operation will transfer
* @ return long */
public long getTransferSize ( ) throws SftpStatusException , SshException { } } | Object obj ; long size = 0 ; SftpFile sftpfile ; File file ; for ( Enumeration e = newFiles . elements ( ) ; e . hasMoreElements ( ) ; ) { obj = e . nextElement ( ) ; if ( obj instanceof File ) { file = ( File ) obj ; if ( file . isFile ( ) ) { size += file . length ( ) ; } } else if ( obj instanceof SftpFile ) { sftpf... |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcThermalLoadSourceEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class ManagementModule { /** * { @ inheritDoc } */
@ Override public Date [ ] purgeDatastream ( Context context , String pid , String datastreamID , Date startDT , Date endDT , String logMessage ) throws ServerException { } } | return mgmt . purgeDatastream ( context , pid , datastreamID , startDT , endDT , logMessage ) ; |
public class LongRunningJobMonitor { /** * Run the too long jobs detection on the { @ link Scheduler } .
* This method is * not * thread safe . */
@ Override public void run ( ) { } } | long currentTime = timeProvider . currentTime ( ) ; for ( Job job : scheduler . jobStatus ( ) ) { cleanUpLongJobIfItHasFinishedExecuting ( currentTime , job ) ; detectLongRunningJob ( currentTime , job ) ; } |
public class JCRStoreResource { /** * Tells the resource manager to forget about a heuristically completed
* transaction branch .
* @ param _ xid global transaction identifier ( not used , because each file
* with the file id gets a new VFS store resource instance ) */
@ Override public void forget ( final Xid _x... | if ( JCRStoreResource . LOG . isDebugEnabled ( ) ) { JCRStoreResource . LOG . debug ( "forget (xid = " + _xid + ")" ) ; } |
public class TimeArrayTimeZoneRule { /** * { @ inheritDoc } */
@ Override public Date getPreviousStart ( long base , int prevOffset , int prevDSTSavings , boolean inclusive ) { } } | int i = startTimes . length - 1 ; for ( ; i >= 0 ; i -- ) { long time = getUTC ( startTimes [ i ] , prevOffset , prevDSTSavings ) ; if ( time < base || ( inclusive && time == base ) ) { return new Date ( time ) ; } } return null ; |
public class MtasSolrBaseList { /** * Adds the .
* @ param status
* the status
* @ throws IOException
* Signals that an I / O exception has occurred . */
public void add ( MtasSolrStatus status ) throws IOException { } } | Objects . requireNonNull ( status ) ; if ( enabled ) { data . add ( status ) ; if ( ! index . containsKey ( status . key ( ) ) ) { index . put ( status . key ( ) , status ) ; garbageCollect ( ) ; } else { garbageCollect ( ) ; // retry
MtasSolrStatus oldStatus = index . get ( status . key ( ) ) ; if ( oldStatus == null ... |
public class Instrumentation { /** * < code > optional string app _ name _ setter = 5 ; < / code >
* < pre >
* name of function ( & lt ; string & gt ; ) ;
* used to inform the harness about the app name
* < / pre > */
public java . lang . String getAppNameSetter ( ) { } } | java . lang . Object ref = appNameSetter_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; if ( bs . isValidUtf8 ( ) ) { appNameSetter_ =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.