signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DroolsSwitch { /** * Calls < code > caseXXX < / code > for each class of the model until one returns a non null result ; it yields that result .
* < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ return the first non - null result returned by a < code > caseXXX < / code > call . ... | switch ( classifierID ) { case DroolsPackage . DOCUMENT_ROOT : { DocumentRoot documentRoot = ( DocumentRoot ) theEObject ; T result = caseDocumentRoot ( documentRoot ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case DroolsPackage . GLOBAL_TYPE : { GlobalType globalType = ( GlobalTyp... |
public class DescribeDimensionKeysResult { /** * The dimension keys that were requested .
* @ param keys
* The dimension keys that were requested . */
public void setKeys ( java . util . Collection < DimensionKeyDescription > keys ) { } } | if ( keys == null ) { this . keys = null ; return ; } this . keys = new java . util . ArrayList < DimensionKeyDescription > ( keys ) ; |
public class Start { /** * Get the locale if specified on the command line
* else return null and if locale option is not used
* then return default locale . */
private Locale getLocale ( String localeName ) throws ToolException { } } | Locale userlocale = null ; if ( localeName == null || localeName . isEmpty ( ) ) { return Locale . getDefault ( ) ; } int firstuscore = localeName . indexOf ( '_' ) ; int seconduscore = - 1 ; String language = null ; String country = null ; String variant = null ; if ( firstuscore == 2 ) { language = localeName . subst... |
public class SharedReference { /** * Decrement the reference count for the shared reference . If the reference count drops to zero ,
* then dispose of the referenced value */
public void deleteReference ( ) { } } | if ( decreaseRefCount ( ) == 0 ) { T deleted ; synchronized ( this ) { deleted = mValue ; mValue = null ; } mResourceReleaser . release ( deleted ) ; removeLiveReference ( deleted ) ; } |
public class BaseXmlTrxMessageOut { /** * Convert this tree to a DOM object .
* Currently this is lame because I convert the tree to text , then to DOM .
* In the future , jaxb will be able to convert directly .
* @ return The dom tree . */
public Node getDOM ( ) { } } | if ( this . getConvertToNative ( ) != null ) { Node node = this . getConvertToNative ( ) . getDOM ( ) ; if ( node != null ) return node ; } String strXML = this . getXML ( ) ; return Utility . convertXMLToDOM ( strXML ) ; |
public class ExcelTransformer { /** * Writes the Excel file to disk
* @ throws IOException
* @ throws WriteException */
public void writeExcelFile ( ) throws IOException , WriteException { } } | WritableWorkbook excelWrkBook = null ; int curDsPointer = 0 ; try { final String [ ] columnNames = ds . getColumns ( ) ; final List < String > exportOnlyColumnsList = getExportOnlyColumns ( ) != null ? Arrays . asList ( exportOnlyColumns ) : null ; final List < String > excludeFromExportColumnsList = getExcludeFromExpo... |
public class RespokeCall { /** * Process a connected messsage received from the remote endpoint . This is used internally to the SDK and should not be called directly by your client application . */
public void connectedReceived ( ) { } } | if ( null != listenerReference ) { final Listener listener = listenerReference . get ( ) ; if ( null != listener ) { new Handler ( Looper . getMainLooper ( ) ) . post ( new Runnable ( ) { public void run ( ) { if ( isActive ( ) ) { listener . onConnected ( RespokeCall . this ) ; } } } ) ; } } |
public class HttpMergeRequestFilter { /** * Write a fresh HttpResponse from this filter down the filter chain , based on the provided request , with the specified http status code .
* @ param nextFilter the next filter in the chain
* @ param session the IO session
* @ param httpRequest the request that the respon... | return writeHttpResponse ( nextFilter , session , httpRequest , httpStatus , null ) ; |
public class CPDefinitionGroupedEntryModelImpl { /** * Converts the soap model instances into normal model instances .
* @ param soapModels the soap model instances to convert
* @ return the normal model instances */
public static List < CPDefinitionGroupedEntry > toModels ( CPDefinitionGroupedEntrySoap [ ] soapMod... | if ( soapModels == null ) { return null ; } List < CPDefinitionGroupedEntry > models = new ArrayList < CPDefinitionGroupedEntry > ( soapModels . length ) ; for ( CPDefinitionGroupedEntrySoap soapModel : soapModels ) { models . add ( toModel ( soapModel ) ) ; } return models ; |
public class DataModelDtoConverters { /** * Converts { @ link IDataModel } to { @ link DataModelDto } . */
static DataModelDto toDataModelDto ( final IDataModel dataModel ) { } } | Map < String , Object > names = dataModel . getNamedAddresses ( ) . entrySet ( ) . stream ( ) . collect ( Collectors . toMap ( e -> e . getKey ( ) , e -> e . getValue ( ) . address ( ) ) ) ; dataModel . getNamedValues ( ) . forEach ( ( k , v ) -> names . put ( k , v . get ( ) ) ) ; Map < String , Object > table = new H... |
public class HttpMessage { /** * Sets new header name value pair .
* @ param headerName The name of the header
* @ param headerValue The value of the header
* @ return The altered HttpMessage */
public HttpMessage header ( final String headerName , final Object headerValue ) { } } | return ( HttpMessage ) super . setHeader ( headerName , headerValue ) ; |
public class IoUtil { /** * 从Reader中读取String , 读取完毕后并不关闭Reader
* @ param reader Reader
* @ return String
* @ throws IORuntimeException IO异常 */
public static String read ( Reader reader ) throws IORuntimeException { } } | final StringBuilder builder = StrUtil . builder ( ) ; final CharBuffer buffer = CharBuffer . allocate ( DEFAULT_BUFFER_SIZE ) ; try { while ( - 1 != reader . read ( buffer ) ) { builder . append ( buffer . flip ( ) . toString ( ) ) ; } } catch ( IOException e ) { throw new IORuntimeException ( e ) ; } return builder . ... |
public class AtomicRateLimiter { /** * A side - effect - free function that can calculate next { @ link State } from current .
* It determines time duration that you should wait for permission and reserves it for you ,
* if you ' ll be able to wait long enough .
* @ param timeoutInNanos max time that caller can w... | long cyclePeriodInNanos = activeState . config . getLimitRefreshPeriodInNanos ( ) ; int permissionsPerCycle = activeState . config . getLimitForPeriod ( ) ; long currentNanos = currentNanoTime ( ) ; long currentCycle = currentNanos / cyclePeriodInNanos ; long nextCycle = activeState . activeCycle ; int nextPermissions ... |
public class BucketImpl { /** * Copies elements from the bucket into the destination array starting at
* index 0 . The destination array must be at least large enough to hold all
* the elements in the bucket ; otherwise , the behavior is undefined .
* @ param dest the destination array */
public void toArray ( El... | if ( ivElements != null ) { System . arraycopy ( ivElements , ivHeadIndex , dest , 0 , size ( ) ) ; } |
public class CacheProxy { /** * Returns the time when the entry will expire .
* @ param created if the write is an insert or update
* @ return the time when the entry will expire , zero if it should expire immediately ,
* Long . MIN _ VALUE if it should not be changed , or Long . MAX _ VALUE if eternal */
protect... | try { Duration duration = created ? expiry . getExpiryForCreation ( ) : expiry . getExpiryForUpdate ( ) ; if ( duration == null ) { return Long . MIN_VALUE ; } else if ( duration . isZero ( ) ) { return 0L ; } else if ( duration . isEternal ( ) ) { return Long . MAX_VALUE ; } return duration . getAdjustedTime ( current... |
public class Crypt { /** * encrypt the given property
* @ param property
* @ return
* @ throws GeneralSecurityException
* @ throws UnsupportedEncodingException */
String encrypt ( String property ) throws GeneralSecurityException , UnsupportedEncodingException { } } | SecretKeyFactory keyFactory = SecretKeyFactory . getInstance ( "PBEWithMD5AndDES" ) ; SecretKey key = keyFactory . generateSecret ( new PBEKeySpec ( cypher ) ) ; Cipher pbeCipher = Cipher . getInstance ( "PBEWithMD5AndDES" ) ; pbeCipher . init ( Cipher . ENCRYPT_MODE , key , new PBEParameterSpec ( salt , 20 ) ) ; retur... |
public class DITAOTCollator { /** * Comparing method required to compare .
* @ see java . util . Comparator # compare ( java . lang . Object , java . lang . Object ) */
@ Override public int compare ( final Object source , final Object target ) { } } | try { return ( Integer ) compareMethod . invoke ( collatorInstance , source , target ) ; } catch ( final Exception e ) { throw new RuntimeException ( e . getMessage ( ) , e ) ; } |
public class AbstractApplication { /** * Load all Messages files before showing anything . */
private void loadMessagesFiles ( ) { } } | // Parse the first annotation found ( manage overriding )
final Localized local = ClassUtility . getLastClassAnnotation ( this . getClass ( ) , Localized . class ) ; // Conf variable cannot be null because it was defined in this class
// It ' s possible to discard default behavior by setting an empty string to the valu... |
public class StyleUtilities { /** * Creates a default { @ link Style } for a point .
* @ return the default style . */
public static Style createDefaultPointStyle ( ) { } } | FeatureTypeStyle featureTypeStyle = sf . createFeatureTypeStyle ( ) ; featureTypeStyle . rules ( ) . add ( createDefaultPointRule ( ) ) ; Style style = sf . createStyle ( ) ; style . featureTypeStyles ( ) . add ( featureTypeStyle ) ; return style ; |
public class QrCodePositionPatternDetector { /** * < p > Specifies transforms which can be used to change coordinates from distorted to undistorted and the opposite
* coordinates . The undistorted image is never explicitly created . < / p >
* @ param width Input image width . Used in sanity check only .
* @ param... | interpolate = FactoryInterpolation . bilinearPixelS ( squareDetector . getInputType ( ) , BorderType . EXTENDED ) ; if ( model != null ) { PixelTransform < Point2D_F32 > distToUndist = new PointToPixelTransform_F32 ( model . undistort_F32 ( true , true ) ) ; PixelTransform < Point2D_F32 > undistToDist = new PointToPixe... |
public class SymoplibParser { /** * Load all SpaceGroup information from the file spacegroups . xml
* @ return a map providing information for all spacegroups */
public static TreeMap < Integer , SpaceGroup > parseSpaceGroupsXML ( InputStream spaceGroupIS ) throws IOException , JAXBException { } } | String xml = convertStreamToString ( spaceGroupIS ) ; SpaceGroupMapRoot spaceGroups = SpaceGroupMapRoot . fromXML ( xml ) ; return spaceGroups . getMapProperty ( ) ; |
public class ListFixture { /** * Retrieves element at index ( 0 - based ) .
* @ param index 0 - based index of element to retrieve value of .
* @ param aList list to get element value from .
* @ return element at specified index .
* @ throws SlimFixtureException if the list does not have at least index elements... | if ( aList . size ( ) > index ) { return aList . get ( index ) ; } else { throw new SlimFixtureException ( false , "list only has " + aList . size ( ) + " elements" ) ; } |
public class CmsWorkplace { /** * Generates the footer for the simple report view . < p >
* @ return html code */
public static String generatePageEndSimple ( ) { } } | StringBuffer result = new StringBuffer ( 128 ) ; result . append ( "</td></tr>\n" ) ; result . append ( "</table></div>\n" ) ; result . append ( "</body>\n</html>" ) ; return result . toString ( ) ; |
public class ClassPathUtils { /** * Find the root path for the given class . If the class is found in a Jar file , then the
* result will be an absolute path to the jar file . If the resource is found in a directory ,
* then the result will be the parent path of the given resource .
* @ param clazz class to searc... | Objects . requireNonNull ( clazz , "resourceName" ) ; String resourceName = classToResourceName ( clazz ) ; return findRootPathForResource ( resourceName , clazz . getClassLoader ( ) ) ; |
public class EventFilterParser { /** * EventFilter . g : 128:1 : comparison _ function : ( path _ function EQUALS value _ function - > ^ ( EQUALS path _ function value _ function ) | path _ function NOT _ EQUALS value _ function - > ^ ( NOT _ EQUALS path _ function value _ function ) | path _ function GT compariable _ ... | EventFilterParser . comparison_function_return retval = new EventFilterParser . comparison_function_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token EQUALS19 = null ; Token NOT_EQUALS22 = null ; Token GT25 = null ; Token GE28 = null ; Token LT31 = null ; Token LE34 = null ; EventFilterP... |
public class BinaryReader { /** * Write a signed number as varint ( integer with variable number of bytes ,
* determined as part of the bytes themselves .
* NOTE : Reading varint accepts end of stream as ' 0 ' .
* @ return The varint read from stream .
* @ throws IOException if unable to read from stream . */
p... | int i = in . read ( ) ; if ( i < 0 ) { return 0 ; } boolean c = ( i & 0x80 ) > 0 ; int out = ( i & 0x7f ) ; int shift = 0 ; while ( c ) { shift += 7 ; i = expectUInt8 ( ) ; c = ( i & 0x80 ) > 0 ; out |= ( ( i & 0x7f ) << shift ) ; } return out ; |
public class TextColumn { /** * TODO ( lwhite ) : This could avoid the append and do a list copy */
@ Override public TextColumn copy ( ) { } } | TextColumn newCol = create ( name ( ) , size ( ) ) ; int r = 0 ; for ( String string : this ) { newCol . set ( r , string ) ; r ++ ; } return newCol ; |
public class CypherFormatterUtils { /** * - - - - to string - - - - */
public static String quote ( Iterable < String > ids ) { } } | StringBuilder builder = new StringBuilder ( ) ; for ( Iterator < String > iterator = ids . iterator ( ) ; iterator . hasNext ( ) ; ) { String id = iterator . next ( ) ; builder . append ( quote ( id ) ) ; if ( iterator . hasNext ( ) ) { builder . append ( "," ) ; } } return builder . toString ( ) ; |
public class BeanO { /** * Gets the handle list associated with this bean , optionally creating one
* if the bean does not have a handle list yet .
* @ param create true if a handle list should be created if the bean does
* not already have a handle list */
HandleList getHandleList ( boolean create ) // d662032
{... | if ( connectionHandleList == null && create ) { connectionHandleList = new HandleList ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getHandleList: created " + connectionHandleList ) ; } return connectionHandleList ; |
public class SFStatement { /** * Sanity check query text
* @ param sql The SQL statement to check
* @ throws SQLException */
private void sanityCheckQuery ( String sql ) throws SQLException { } } | if ( sql == null || sql . isEmpty ( ) ) { throw new SnowflakeSQLException ( SqlState . SQL_STATEMENT_NOT_YET_COMPLETE , ErrorCode . INVALID_SQL . getMessageCode ( ) , sql ) ; } |
public class MinimalMetaBean { /** * Adds an alias to the meta - bean .
* When using { @ link # metaProperty ( String ) } , the alias will return the
* meta - property of the real name .
* @ param alias the alias
* @ param realName the real name
* @ return the new meta - bean instance
* @ throws IllegalArgu... | if ( ! metaPropertyMap . containsKey ( realName ) ) { throw new IllegalArgumentException ( "Invalid property name: " + realName ) ; } Map < String , String > aliasMap = new HashMap < > ( this . aliasMap ) ; aliasMap . put ( alias , realName ) ; return new MinimalMetaBean < > ( beanType , builderSupplier , metaPropertyM... |
public class LogBuffer { /** * Return 64 - bit unsigned long from buffer . ( big - endian )
* @ see mysql - 5.6.10 / include / myisampack . h - mi _ uint8korr */
public final BigInteger getBeUlong64 ( final int pos ) { } } | final long long64 = getBeLong64 ( pos ) ; return ( long64 >= 0 ) ? BigInteger . valueOf ( long64 ) : BIGINT_MAX_VALUE . add ( BigInteger . valueOf ( 1 + long64 ) ) ; |
public class ServicePoolBuilder { /** * Adds a { @ link HostDiscoverySource } instance to the builder . Multiple instances of { @ code HostDiscoverySource }
* may be specified . The service pool will query the sources in the order they were registered and use the first
* non - null { @ link HostDiscovery } returned... | checkNotNull ( hostDiscoverySource ) ; return withHostDiscovery ( hostDiscoverySource , true ) ; |
public class KeyStoreCredentialResolverBuilder { /** * Adds all key names and their passwords which are specified by the { @ code keyPasswords } . */
public KeyStoreCredentialResolverBuilder addKeyPasswords ( Map < String , String > keyPasswords ) { } } | requireNonNull ( keyPasswords , "keyPasswords" ) ; keyPasswords . forEach ( this :: addKeyPassword ) ; return this ; |
public class AbstractRegionPainter { /** * Given parameters for creating a LinearGradientPaint , this method will
* create and return a linear gradient paint . One primary purpose for this
* method is to avoid creating a LinearGradientPaint where the start and end
* points are equal . In such a case , the end y p... | if ( x1 == x2 && y1 == y2 ) { y2 += .00001f ; } return new LinearGradientPaint ( x1 , y1 , x2 , y2 , midpoints , colors ) ; |
public class QueryParameterValue { /** * Creates a { @ code QueryParameterValue } object with the given value and type . */
public static < T > QueryParameterValue of ( T value , StandardSQLTypeName type ) { } } | return QueryParameterValue . newBuilder ( ) . setValue ( valueToStringOrNull ( value , type ) ) . setType ( type ) . build ( ) ; |
public class ClassGraph { /** * Prints associations recovered from the fields of a class . An association is inferred only
* if another relation between the two classes is not already in the graph .
* @ param classes */
public void printInferredRelations ( ClassDoc c ) { } } | // check if the source is excluded from inference
if ( hidden ( c ) ) return ; Options opt = optionProvider . getOptionsFor ( c ) ; for ( FieldDoc field : c . fields ( false ) ) { if ( hidden ( field ) ) continue ; // skip statics
if ( field . isStatic ( ) ) continue ; // skip primitives
FieldRelationInfo fri = getFiel... |
public class AWSS3ControlClient { /** * Retrieves the Public Access Block configuration for an Amazon Web Services account .
* @ param getPublicAccessBlockRequest
* @ return Result of the GetPublicAccessBlock operation returned by the service .
* @ throws NoSuchPublicAccessBlockConfigurationException
* This exc... | request = beforeClientExecution ( request ) ; return executeGetPublicAccessBlock ( request ) ; |
public class StringParser { /** * Parse the given { @ link Object } as double . Note : both the locale independent
* form of a double can be parsed here ( e . g . 4.523 ) as well as a localized
* form using the comma as the decimal separator ( e . g . the German 4,523 ) .
* @ param aObject
* The object to parse... | if ( aObject == null ) return dDefault ; if ( aObject instanceof Number ) return ( ( Number ) aObject ) . doubleValue ( ) ; return parseDouble ( aObject . toString ( ) , dDefault ) ; |
public class MessageReader { /** * Extracts the message body ' s charset encoding
* by looking it up in the message properties if
* given there and choosing the default charset ( UTF - 8)
* otherwise .
* @ return The message body ' s charset encoding */
public Charset readCharset ( ) { } } | BasicProperties basicProperties = message . getBasicProperties ( ) ; if ( basicProperties == null ) { return Message . DEFAULT_MESSAGE_CHARSET ; } String contentCharset = basicProperties . getContentEncoding ( ) ; if ( contentCharset == null ) { return Message . DEFAULT_MESSAGE_CHARSET ; } return Charset . forName ( co... |
public class ObserverList { /** * Applies the operation to the observer , catching and logging any exceptions thrown in the
* process . */
protected boolean checkedApply ( ObserverOp < T > obop , T obs ) { } } | try { return obop . apply ( obs ) ; } catch ( Throwable thrown ) { log . warning ( "ObserverOp choked during notification" , "op" , obop , "obs" , observerForLog ( obs ) , thrown ) ; // if they booched it , definitely don ' t remove them
return true ; } |
public class ApptentiveAttachmentLoader { /** * Returns singleton class instance */
public static ApptentiveAttachmentLoader getInstance ( ) { } } | if ( instance == null ) { synchronized ( ApptentiveAttachmentLoader . class ) { if ( instance == null ) { instance = new ApptentiveAttachmentLoader ( ) ; } } } return instance ; |
public class DurableSubscriptionManager { /** * Register a new durable subscription
* @ param clientID
* @ param subscriptionName */
public boolean register ( String clientID , String subscriptionName ) { } } | String key = clientID + "-" + subscriptionName ; synchronized ( subscriptions ) { if ( subscriptions . containsKey ( key ) ) return false ; subscriptions . put ( key , new DurableTopicSubscription ( System . currentTimeMillis ( ) , clientID , subscriptionName ) ) ; return true ; } |
public class ElementSelectors { /** * Applies the wrapped ElementSelector ' s logic if and only if the
* control element matches the given predicate . */
public static ElementSelector conditionalSelector ( final Predicate < ? super Element > predicate , final ElementSelector es ) { } } | if ( predicate == null ) { throw new IllegalArgumentException ( "predicate must not be null" ) ; } if ( es == null ) { throw new IllegalArgumentException ( "es must not be null" ) ; } return new ElementSelector ( ) { @ Override public boolean canBeCompared ( Element controlElement , Element testElement ) { return predi... |
public class Level2 { /** * Explain how the distance was computed . */
public String explainScore ( StringWrapper s , StringWrapper t ) { } } | StringBuffer buf = new StringBuffer ( ) ; BagOfTokens sBag = asBagOfTokens ( s ) ; BagOfTokens tBag = asBagOfTokens ( t ) ; double sumOverI = 0 ; for ( Iterator i = sBag . tokenIterator ( ) ; i . hasNext ( ) ; ) { Token tokenI = ( Token ) i . next ( ) ; buf . append ( "token=" + tokenI ) ; double maxOverJ = - Double . ... |
public class Config { /** * Get a mapping from strength to curve desired .
* @ return mapping from strength to curve name to use . */
public Map < Integer , String > getSecurityCurveMapping ( ) { } } | if ( curveMapping == null ) { curveMapping = parseSecurityCurveMappings ( getProperty ( SECURITY_CURVE_MAPPING ) ) ; } return Collections . unmodifiableMap ( curveMapping ) ; |
public class MappingFilterParser { /** * C : \ \ Project \ \ Obdalib \ \ obdalib - parent \ \ obdalib - core \ \ src \ \ main \ \ java \ \ it \ \ unibz \ \ inf \ \ obda \ \ gui \ \ swing \ \ utils \ \ MappingFilter . g : 86:1 : input returns [ String value ] : ( unquoted _ string | quoted _ string ) ; */
public final S... | String value = null ; String unquoted_string3 = null ; String quoted_string4 = null ; try { // C : \ \ Project \ \ Obdalib \ \ obdalib - parent \ \ obdalib - core \ \ src \ \ main \ \ java \ \ it \ \ unibz \ \ inf \ \ obda \ \ gui \ \ swing \ \ utils \ \ MappingFilter . g : 87:3 : ( unquoted _ string | quoted _ string ... |
public class ActionContext { /** * Return cached object by key . The key will be concatenated with
* current session id when fetching the cached object
* @ param key
* @ param < T >
* the object type
* @ return the cached object */
public < T > T cached ( String key ) { } } | H . Session sess = session ( ) ; if ( null != sess ) { return sess . cached ( key ) ; } else { return app ( ) . cache ( ) . get ( key ) ; } |
public class ResourceLeakDetector { /** * This method is called when an untraced leak is detected . It can be overridden for tracking how many times leaks
* have been detected . */
protected void reportUntracedLeak ( String resourceType ) { } } | logger . error ( "LEAK: {}.release() was not called before it's garbage-collected. " + "Enable advanced leak reporting to find out where the leak occurred. " + "To enable advanced leak reporting, " + "specify the JVM option '-D{}={}' or call {}.setLevel() " + "See http://netty.io/wiki/reference-counted-objects.html for... |
public class SleUtility { /** * Sorts and groups a set of entries .
* @ param values List of Extendable implementations .
* @ param groups Group items to group by .
* @ param sort Field to sort on .
* @ param ascending Sort ascending / descending
* @ return Grouped and sorted list of entries . */
public stati... | List < T > list = sort ( values , sort , ascending ) ; list = group ( list , groups ) ; return list ; |
public class CmsShell { /** * Gets the top of thread - local shell stack , or null if it is empty .
* @ return the top of the shell stack */
public static CmsShell getTopShell ( ) { } } | ArrayList < CmsShell > shells = SHELL_STACK . get ( ) ; if ( shells . isEmpty ( ) ) { return null ; } return shells . get ( shells . size ( ) - 1 ) ; |
public class DeleteUserDefinedFunctionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteUserDefinedFunctionRequest deleteUserDefinedFunctionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteUserDefinedFunctionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteUserDefinedFunctionRequest . getCatalogId ( ) , CATALOGID_BINDING ) ; protocolMarshaller . marshall ( deleteUserDefinedFunctionRequest . getDataba... |
public class EventBus { /** * Sends an event that will notify any registered listener for that class .
* < p > Listeners are looked up by an < b > exact match < / b > on the class of the object , as returned by
* { @ code event . getClass ( ) } . Listeners of a supertype won ' t be notified .
* < p > The listener... | LOG . debug ( "[{}] Firing an instance of {}: {}" , logPrefix , event . getClass ( ) , event ) ; // if the exact match thing gets too cumbersome , we can reconsider , but I ' d like to avoid
// scanning all the keys with instanceof checks .
Class < ? > eventClass = event . getClass ( ) ; for ( Consumer < ? > l : listen... |
public class Packages { /** * Computes the BND clause from the given set of packages .
* @ param packages the packages
* @ return the clause */
public static String toClause ( List < String > packages ) { } } | return Joiner . on ( ", " ) . skipNulls ( ) . join ( packages ) ; |
public class Speller { /** * Match the last letter of the candidate against two or more letters of the word . */
private int matchAnyToOne ( final int wordIndex , final int candIndex ) { } } | if ( replacementsAnyToOne . containsKey ( candidate [ candIndex ] ) ) { for ( final char [ ] rep : replacementsAnyToOne . get ( candidate [ candIndex ] ) ) { int i = 0 ; while ( i < rep . length && ( wordIndex + i ) < wordLen && rep [ i ] == wordProcessed [ wordIndex + i ] ) { i ++ ; } if ( i == rep . length ) { return... |
public class Configuration { /** * Return the qualified name of the < code > ClassDoc < / code > if it ' s qualifier is not excluded . Otherwise ,
* return the unqualified < code > ClassDoc < / code > name .
* @ param cd the < code > ClassDoc < / code > to check . */
public String getClassName ( ClassDoc cd ) { } } | PackageDoc pd = cd . containingPackage ( ) ; if ( pd != null && shouldExcludeQualifier ( cd . containingPackage ( ) . name ( ) ) ) { return cd . name ( ) ; } else { return cd . qualifiedName ( ) ; } |
public class ApiOvhIpLoadbalancing { /** * Ssl for this iplb
* REST : GET / ipLoadbalancing / { serviceName } / ssl
* @ param type [ required ] Filter the value of type property ( = )
* @ param serial [ required ] Filter the value of serial property ( like )
* @ param fingerprint [ required ] Filter the value o... | String qPath = "/ipLoadbalancing/{serviceName}/ssl" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "fingerprint" , fingerprint ) ; query ( sb , "serial" , serial ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ; |
public class ByteArray { /** * 写入一组byte值
* @ param values 一组byte值 */
public void write ( byte ... values ) { } } | if ( count >= content . length - values . length ) { byte [ ] ns = new byte [ content . length + values . length ] ; System . arraycopy ( content , 0 , ns , 0 , count ) ; this . content = ns ; } System . arraycopy ( values , 0 , content , count , values . length ) ; count += values . length ; |
public class ClusterState { /** * Starts the join to the cluster . */
private synchronized CompletableFuture < Void > join ( ) { } } | joinFuture = new CompletableFuture < > ( ) ; context . getThreadContext ( ) . executor ( ) . execute ( ( ) -> { // Transition the server to the appropriate state for the local member type .
context . transition ( member . type ( ) ) ; // Attempt to join the cluster . If the local member is ACTIVE then failing to join t... |
public class DestinationManager { /** * Checks that the queuePointLocalising size is valid */
private void checkQueuePointLocalizingSize ( Set < String > queuePointLocalizingMEs , DestinationDefinition destinationDefinition ) { } } | // There must be at least one queue point
if ( ( ( destinationDefinition . getDestinationType ( ) != DestinationType . SERVICE ) && ( queuePointLocalizingMEs . size ( ) == 0 ) ) || ( ( destinationDefinition . getDestinationType ( ) == DestinationType . SERVICE ) && ( queuePointLocalizingMEs . size ( ) != 0 ) ) ) { thro... |
public class Calendar { /** * Validate a single field of this calendar . Subclasses should
* override this method to validate any calendar - specific fields .
* Generic fields can be handled by
* < code > Calendar . validateField ( ) < / code > .
* @ see # validateField ( int , int , int ) */
protected void val... | int y ; switch ( field ) { case DAY_OF_MONTH : y = handleGetExtendedYear ( ) ; validateField ( field , 1 , handleGetMonthLength ( y , internalGet ( MONTH ) ) ) ; break ; case DAY_OF_YEAR : y = handleGetExtendedYear ( ) ; validateField ( field , 1 , handleGetYearLength ( y ) ) ; break ; case DAY_OF_WEEK_IN_MONTH : if ( ... |
public class FSNamesystem { /** * Close down this file system manager .
* Causes heartbeat and lease daemons to stop ; waits briefly for
* them to finish , but a short timeout returns control back to caller . */
public void close ( ) { } } | fsRunning = false ; try { if ( pendingReplications != null ) { pendingReplications . stop ( ) ; } if ( hbthread != null ) { hbthread . interrupt ( ) ; } if ( underreplthread != null ) { underreplthread . interrupt ( ) ; } if ( overreplthread != null ) { overreplthread . interrupt ( ) ; } if ( raidEncodingTaskThread != ... |
public class EndpointUser { /** * Custom attributes that describe the user by associating a name with an array of values . For example , an attribute
* named " interests " might have the following values : [ " science " , " politics " , " travel " ] . You can use these
* attributes as selection criteria when you cr... | return userAttributes ; |
public class JMLambda { /** * Partition by map .
* @ param < T > the type parameter
* @ param collection the collection
* @ param predicate the predicate
* @ return the map */
public static < T > Map < Boolean , List < T > > partitionBy ( Collection < T > collection , Predicate < T > predicate ) { } } | return collection . stream ( ) . collect ( partitioningBy ( predicate ) ) ; |
public class PageAutoDialect { /** * 初始化 helper
* @ param dialectClass
* @ param properties */
private AbstractHelperDialect initDialect ( String dialectClass , Properties properties ) { } } | AbstractHelperDialect dialect ; if ( StringUtil . isEmpty ( dialectClass ) ) { throw new PageException ( "使用 PageHelper 分页插件时,必须设置 helper 属性" ) ; } try { Class sqlDialectClass = resloveDialectClass ( dialectClass ) ; if ( AbstractHelperDialect . class . isAssignableFrom ( sqlDialectClass ) ) { dialect = ( AbstractHelpe... |
public class SparkLine { /** * Adds a new value to the DATA _ LIST of the sparkline
* @ param DATA */
public void addDataPoint ( final double DATA ) { } } | for ( DataPoint dataPoint : DATA_LIST ) { if ( System . currentTimeMillis ( ) - dataPoint . getTimeStamp ( ) > timeFrame ) { trashList . add ( dataPoint ) ; } } for ( DataPoint dataPoint : trashList ) { DATA_LIST . remove ( dataPoint ) ; } trashList . clear ( ) ; DATA_LIST . add ( new DataPoint ( System . currentTimeMi... |
public class FunctionSignature { /** * Parses a signature . */
public static FunctionSignature valueOf ( String serial ) { } } | int paramStart = serial . indexOf ( "(" ) ; int paramEnd = serial . indexOf ( ")" ) ; if ( paramStart < 0 || paramEnd != serial . length ( ) - 1 ) throw new IllegalArgumentException ( "Malformed method signature: " + serial ) ; String function = serial . substring ( 0 , paramStart ) . trim ( ) ; String arguments = seri... |
public class AbstractCentralAuthenticationService { /** * Evaluate proxied service if needed .
* @ param service the service
* @ param ticketGrantingTicket the ticket granting ticket
* @ param registeredService the registered service */
protected void evaluateProxiedServiceIfNeeded ( final Service service , final... | val proxiedBy = ticketGrantingTicket . getProxiedBy ( ) ; if ( proxiedBy != null ) { LOGGER . debug ( "Ticket-granting ticket is proxied by [{}]. Locating proxy service in registry..." , proxiedBy . getId ( ) ) ; val proxyingService = this . servicesManager . findServiceBy ( proxiedBy ) ; if ( proxyingService != null )... |
public class SibRaXaResource { /** * ( non - Javadoc )
* @ see javax . transaction . xa . XAResource # commit ( javax . transaction . xa . Xid ,
* boolean ) */
public void commit ( final Xid xid , final boolean onePhase ) throws XAException { } } | final String methodName = "commit" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { xid , Boolean . valueOf ( onePhase ) } ) ; } _siXaResource . commit ( xid , onePhase ) ; // Add the value false to indicate we have commited t... |
public class SraReader { /** * Read a run set from the specified input stream .
* @ param inputStream input stream , must not be null
* @ return a run set read from the specified input stream
* @ throws IOException if an I / O error occurs */
public static RunSet readRunSet ( final InputStream inputStream ) throw... | checkNotNull ( inputStream ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ) { return readRunSet ( reader ) ; } |
public class SessionApi { /** * Get information about the current user
* Get information about the current user , including any existing media logins , calls , and interactions . The returned user information includes state recovery information about the active session . You can make this request at startup to check ... | com . squareup . okhttp . Call call = getCurrentSessionValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < CurrentSession > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class JKTimeObject { /** * After .
* @ param thareTime the thare time
* @ return true , if successful */
public boolean after ( JKTimeObject thareTime ) { } } | if ( getYear ( ) == thareTime . getYear ( ) || thareTime . getYear ( ) > getYear ( ) ) { System . out . println ( "after:: Year true" ) ; if ( thareTime . getMonth ( ) < getMonth ( ) ) { return true ; } if ( getMonth ( ) == thareTime . getMonth ( ) ) { System . out . println ( "after:: Month true" ) ; if ( thareTime . ... |
public class LdapAdapter { /** * Method to get the ancestors of the given entity .
* @ param entity
* @ param ldapEntry
* @ param ancesCtrl
* @ throws WIMException */
private void getAncestors ( Entity entity , LdapEntry ldapEntry , AncestorControl ancesCtrl ) throws WIMException { } } | if ( ancesCtrl == null ) { return ; } List < String > propNames = ancesCtrl . getProperties ( ) ; int level = ancesCtrl . getLevel ( ) ; List < String > ancesTypes = getEntityTypes ( ancesCtrl ) ; String [ ] bases = getBases ( ancesCtrl , ancesTypes ) ; String dn = ldapEntry . getDN ( ) ; List < String > ancestorDns = ... |
public class EncodedElement { /** * Add a number of bits from a long to the end of this list ' s data . Will
* add a new element if necessary . The bits stored are taken from the lower -
* order of input .
* @ param input Long containing bits to append to end .
* @ param bitCount Number of bits to append .
* ... | if ( next != null ) { EncodedElement end = EncodedElement . getEnd_S ( next ) ; return end . addLong ( input , bitCount ) ; } else if ( data . length * 8 <= usableBits + bitCount ) { // create child and attach to next .
// Set child ' s offset appropriately ( i . e , manually set usable bits )
int tOff = usableBits % 8... |
public class A_CmsPublishGroupHelper { /** * Returns the localized name for a given publish group based on its age . < p >
* @ param resources the resources of the publish group
* @ param age the age of the publish group
* @ return the localized name of the publish group */
public String getPublishGroupName ( Lis... | long groupDate = getDateLastModified ( resources . get ( 0 ) ) ; String groupName ; switch ( age ) { case young : groupName = Messages . get ( ) . getBundle ( m_locale ) . key ( Messages . GUI_GROUPNAME_SESSION_1 , new Date ( groupDate ) ) ; break ; case medium : groupName = Messages . get ( ) . getBundle ( m_locale ) ... |
public class ZipUtil { /** * See @ link { { @ link # iterate ( InputStream , ZipEntryCallback , Charset ) } . It is a
* shorthand where no Charset is specified .
* @ param is
* input ZIP stream ( it will not be closed automatically ) .
* @ param entryNames
* names of entries to iterate
* @ param action
* ... | iterate ( is , entryNames , action , null ) ; |
public class JournalingBlockBasedDataStore { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . storage . data . impl . AbstractBlockBasedDataStore # extendStoreFiles ( int , int ) */
@ Override protected void extendStoreFiles ( int oldBlockCount , int newBlockCount ) throws DataStoreException { } } | journal . extendStore ( blockSize , oldBlockCount , newBlockCount ) ; |
public class GuestAliasManager { /** * Defines an alias for a guest account in a virtual machine .
* After the alias is defined , the ESXi Server will use the alias to authenticate guest operations requests .
* This will add the given VMWare SSO Server ' s certificate and a subject to the alias store of the specifi... | getVimService ( ) . addGuestAlias ( getMOR ( ) , virtualMachine . getMOR ( ) , guestAuthentication , userName , mapCert , base64Cert , guestAuthAliasInfo ) ; |
public class DatastoreEmulator { /** * Starts the emulator . It is the caller ' s responsibility to call { @ link # stop } . Note that
* receiving an exception does not indicate that the server did not start . We recommend calling
* { @ link # stop } to ensure the server is not running regardless of the result of t... | checkNotNull ( emulatorDir , "emulatorDir cannot be null" ) ; checkNotNull ( projectId , "projectId cannot be null" ) ; checkState ( state == State . NEW , "Cannot call start() more than once." ) ; try { startEmulatorInternal ( emulatorDir + "/cloud_datastore_emulator" , projectId , Arrays . asList ( commandLineOptions... |
public class Subframe_LPC { /** * Quantize coefficients to integer values of the given precision , and
* calculate the shift needed .
* @ param coefficients values to quantize . These values will not be changed .
* @ param dest destination for quantized values .
* @ param order number of values to quantize . Fi... | assert ( precision >= 2 && precision <= 15 ) ; assert ( coefficients . length >= order + 1 ) ; assert ( dest . length >= order + 1 ) ; if ( precision < 2 || precision > 15 ) throw new IllegalArgumentException ( "Error! precision must be between 2 and 15, inclusive." ) ; int shiftApplied = 0 ; int maxValAllowed = ( 1 <<... |
public class Specification { /** * Specifies that no exception of the given type should be
* thrown , failing with a { @ link UnallowedExceptionThrownError } otherwise .
* @ param type the exception type that should not be thrown */
public void notThrown ( Class < ? extends Throwable > type ) { } } | Throwable thrown = getSpecificationContext ( ) . getThrownException ( ) ; if ( thrown == null ) return ; if ( type . isAssignableFrom ( thrown . getClass ( ) ) ) { throw new UnallowedExceptionThrownError ( type , thrown ) ; } ExceptionUtil . sneakyThrow ( thrown ) ; |
public class CollectionPartitionsInner { /** * Retrieves the usages ( most recent storage data ) for the given collection , split by partition .
* @ param resourceGroupName Name of an Azure resource group .
* @ param accountName Cosmos DB database account name .
* @ param databaseRid Cosmos DB database rid .
* ... | return listUsagesWithServiceResponseAsync ( resourceGroupName , accountName , databaseRid , collectionRid ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class DbCloser { /** * Handle closing a connection . Calls
* { @ link # close ( Connection , Logger , Object ) } with null for name .
* @ param conn The conneciton to close .
* @ param logExceptionTo The log to log any { @ link SQLException }
* to . If this is null , the logger for the DbCloser class
*... | return close ( conn , logExceptionTo , null ) ; |
public class ModulesEx { /** * Create a single module that derived from all bootstrap annotations
* on a class , where that class itself is a module .
* For example ,
* < pre >
* { @ code
* public class MainApplicationModule extends AbstractModule {
* @ Override
* public void configure ( ) {
* / / Appli... | List < Module > modules = new ArrayList < > ( ) ; // Iterate through all annotations of the main class , create a binding for the annotation
// and add the module to the list of modules to install
for ( final Annotation annot : cls . getDeclaredAnnotations ( ) ) { final Class < ? extends Annotation > type = annot . ann... |
public class RepositoryReaderImpl { /** * returns log records from the binary repository that are within the date range and which satisfy condition of the filter as specified by the parameters .
* @ param beginTime the minimum { @ link Date } value that the returned records can have
* @ param endTime the maximum { ... | final long min = beginTime == null ? - 1 : beginTime . getTime ( ) ; final long max = endTime == null ? - 1 : endTime . getTime ( ) ; LogRepositoryBrowser logs ; if ( beginTime == null ) { logs = logInstanceBrowser . findNext ( ( LogRepositoryBrowser ) null , max ) ; } else { logs = logInstanceBrowser . findByMillis ( ... |
public class FTPConnection { /** * Gets the help message from a command
* @ param label The command name
* @ return The help message or { @ code null } if the command was not found */
public String getHelpMessage ( String label ) { } } | CommandInfo info = commands . get ( label ) ; return info != null ? info . help : null ; |
public class SnorocketOWLReasoner { /** * Determines if the specified set of axioms is entailed by the reasoner
* axioms .
* @ param axioms
* The set of axioms to be tested
* @ return < code > true < / code > if the set of axioms is entailed by the axioms
* in the imports closure of the root ontology , otherw... | throw new UnsupportedEntailmentTypeException ( axioms . iterator ( ) . next ( ) ) ; |
public class CompressionCodecFactory { /** * Removes a suffix from a filename , if it has it .
* @ param filename the filename to strip
* @ param suffix the suffix to remove
* @ return the shortened filename */
public static String removeSuffix ( String filename , String suffix ) { } } | if ( filename . endsWith ( suffix ) ) { return filename . substring ( 0 , filename . length ( ) - suffix . length ( ) ) ; } return filename ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcClassificationItemRelationship ( ) { } } | if ( ifcClassificationItemRelationshipEClass == null ) { ifcClassificationItemRelationshipEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 81 ) ; } return ifcClassificationItemRelationshipEClass ; |
public class ListTrafficPolicyInstancesResult { /** * A list that contains one < code > TrafficPolicyInstance < / code > element for each traffic policy instance that matches
* the elements in the request .
* @ param trafficPolicyInstances
* A list that contains one < code > TrafficPolicyInstance < / code > eleme... | if ( trafficPolicyInstances == null ) { this . trafficPolicyInstances = null ; return ; } this . trafficPolicyInstances = new com . amazonaws . internal . SdkInternalList < TrafficPolicyInstance > ( trafficPolicyInstances ) ; |
public class CommerceSubscriptionEntryPersistenceImpl { /** * Removes all the commerce subscription entries where subscriptionStatus = & # 63 ; from the database .
* @ param subscriptionStatus the subscription status */
@ Override public void removeBySubscriptionStatus ( int subscriptionStatus ) { } } | for ( CommerceSubscriptionEntry commerceSubscriptionEntry : findBySubscriptionStatus ( subscriptionStatus , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceSubscriptionEntry ) ; } |
public class Choice7 { /** * { @ inheritDoc } */
@ Override public < H > Choice7 < A , B , C , D , E , F , H > zip ( Applicative < Function < ? super G , ? extends H > , Choice7 < A , B , C , D , E , F , ? > > appFn ) { } } | return Monad . super . zip ( appFn ) . coerce ( ) ; |
public class VToDoUserAgent { /** * < pre >
* 3.4.8 . DECLINECOUNTER
* The " DECLINECOUNTER " method in a " VTODO " calendar component is used
* by an " Organizer " of the " VTODO " calendar component to reject a
* counter proposal offered by one of the " Attendees " . The " Organizer "
* sends the message to... | Calendar declineCounter = transform ( Method . DECLINE_COUNTER , counter ) ; declineCounter . validate ( ) ; return declineCounter ; |
public class LinkedTransferQueue { /** * Tries to append node s as tail .
* @ param s the node to append
* @ param haveData true if appending in data mode
* @ return null on failure due to losing race with append in
* different mode , else s ' s predecessor , or s itself if no
* predecessor */
private Node tr... | for ( Node t = tail , p = t ; ; ) { // move p to last node and append
Node n , u ; // temps for reads of next & tail
if ( p == null && ( p = head ) == null ) { if ( casHead ( null , s ) ) return s ; // initialize
} else if ( p . cannotPrecede ( haveData ) ) return null ; // lost race vs opposite mode
else if ( ( n = p ... |
public class TagletWriterImpl { /** * { @ inheritDoc } */
public Content getThrowsHeader ( ) { } } | HtmlTree result = HtmlTree . DT ( HtmlTree . SPAN ( HtmlStyle . throwsLabel , new StringContent ( configuration . getText ( "doclet.Throws" ) ) ) ) ; return result ; |
public class PDTFactory { /** * Get the passed date time but with micro and nanoseconds set to 0 , so that
* only the milliseconds part is present . This is helpful for XSD
* serialization , where only milliseconds granularity is available .
* @ param aODT
* Source date time . May be < code > null < / code > . ... | return aODT == null ? null : aODT . withNano ( aODT . get ( ChronoField . MILLI_OF_SECOND ) * ( int ) CGlobal . NANOSECONDS_PER_MILLISECOND ) ; |
public class Line { /** * FIXME . . . hack */
public String stripID ( ) { } } | if ( m_bIsEmpty || m_sValue . charAt ( m_sValue . length ( ) - m_nTrailing - 1 ) != '}' ) return null ; int nPos = m_nLeading ; boolean bFound = false ; while ( nPos < m_sValue . length ( ) && ! bFound ) { switch ( m_sValue . charAt ( nPos ) ) { case '\\' : if ( nPos + 1 < m_sValue . length ( ) ) { if ( m_sValue . char... |
public class BatchUpdatePhoneNumberRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BatchUpdatePhoneNumberRequest batchUpdatePhoneNumberRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( batchUpdatePhoneNumberRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchUpdatePhoneNumberRequest . getUpdatePhoneNumberRequestItems ( ) , UPDATEPHONENUMBERREQUESTITEMS_BINDING ) ; } catch ( Exception e ) { throw new SdkCli... |
public class RowProcessingPublisher { /** * Runs the whole row processing logic , start to finish , including
* initialization , process rows , result collection and cleanup / closing
* resources .
* @ param resultQueue
* a queue on which to append results
* @ param finishedTaskListener
* a task listener wh... | final LifeCycleHelper lifeCycleHelper = _publishers . getLifeCycleHelper ( ) ; final TaskRunner taskRunner = _publishers . getTaskRunner ( ) ; final List < RowProcessingConsumer > configurableConsumers = getConfigurableConsumers ( ) ; final int numConsumerTasks = configurableConsumers . size ( ) ; // add tasks for clos... |
public class DSClient { /** * ( non - Javadoc )
* @ see com . impetus . client . cassandra . CassandraClientBase # searchInInvertedIndex ( java . lang . String ,
* com . impetus . kundera . metadata . model . EntityMetadata , java . util . Map ) */
@ Override public List < SearchResult > searchInInvertedIndex ( Str... | throw new UnsupportedOperationException ( "Support available only for thrift/pelops." ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.