signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class GlobusGSSContextImpl { /** * Currently not implemented . */
public void unwrap ( InputStream inStream , OutputStream outStream , MessageProp msgProp ) throws GSSException { } } | throw new GSSException ( GSSException . UNAVAILABLE ) ; |
public class Table { /** * Select records from database table using < I > obj < / I > object as template
* for selection .
* @ param obj example object for search .
* @ param mask field mask indicating which fields in the example object
* should be used when building the query . */
public final Cursor < T > que... | return new Cursor < T > ( this , conn , obj , mask , false ) ; |
public class Props { /** * Creating mailbox for actor
* @ param queue queue of mailboxes
* @ return mailbox */
public Mailbox createMailbox ( MailboxesQueue queue ) { } } | if ( mailboxCreator != null ) { return mailboxCreator . createMailbox ( queue ) ; } else { return new Mailbox ( queue ) ; } |
public class SCannedBox { /** * Initialize .
* @ param itsLocation The location of this component within the parent .
* @ param parentScreen The parent screen .
* @ param fieldConverter The field this screen field is linked to .
* @ param iDisplayFieldDesc Do I display the field desc ?
* @ param strValue The ... | m_record = record ; m_field = field ; m_strValue = strValue ; m_iDisplayFieldDesc = iDisplayFieldDesc ; if ( record != null ) if ( fieldConverter == null ) if ( this . getDisplayFieldDesc ( this ) ) { // Use the record name as the desc
fieldConverter = new FieldDescConverter ( null , record . getRecordName ( ) ) ; reco... |
public class HashUtil { /** * ELF算法
* @ param str 字符串
* @ return hash值 */
public static int elfHash ( String str ) { } } | int hash = 0 ; int x = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { hash = ( hash << 4 ) + str . charAt ( i ) ; if ( ( x = ( int ) ( hash & 0xF0000000L ) ) != 0 ) { hash ^= ( x >> 24 ) ; hash &= ~ x ; } } return hash & 0x7FFFFFFF ; |
public class Compiler { /** * Compiles a list of modules .
* < p > This is a convenience method to wrap up all the work of compilation , including
* generating the error and warning report .
* < p > NOTE : All methods called here must be public , because client code must be able to replicate
* and customize thi... | // The compile method should only be called once .
checkState ( jsRoot == null ) ; try { initModules ( externs , modules , options ) ; if ( options . printConfig ) { printConfig ( System . err ) ; } if ( ! hasErrors ( ) ) { parseForCompilation ( ) ; } if ( ! hasErrors ( ) ) { // TODO ( bradfordcsmith ) : The option to ... |
public class Dispatching { /** * Partial application of the first parameter to a ternary function .
* @ param < T1 > the function first parameter type
* @ param < T2 > the function second parameter type
* @ param < T3 > the function third parameter type
* @ param < R > the function return type
* @ param funct... | dbc . precondition ( function != null , "cannot bind parameter of a null function" ) ; return ( second , third ) -> function . apply ( first , second , third ) ; |
public class CodecCipher { /** * Encrypt or decrypt . */
private byte [ ] cipher ( byte [ ] input , int mode ) { } } | try { return doCipher ( input , mode ) ; } catch ( Exception e ) { throw new IllegalStateException ( e ) ; } |
public class GraphL3 { /** * This method creates a wrapper for every wrappable L3 element .
* @ param obj Object to wrap
* @ return The wrapper */
@ Override public Node wrap ( Object obj ) { } } | // Check if the object is level3
if ( ! ( obj instanceof Level3Element ) ) throw new IllegalArgumentException ( "An object other than a Level3Element is trying to be wrapped: " + obj ) ; // Check if the object passes the filter
if ( ! passesFilters ( ( Level3Element ) obj ) ) return null ; // Wrap if traversible
if ( o... |
public class EntityFactory { public Entity buildEntity ( EntityConfig entityConfig ) { } } | Entity entity = applicationContext . getBean ( Entity . class ) ; entityConfigFactory . applyFallBacks ( entityConfig ) ; entity . setEntityConfig ( entityConfig ) ; Table table = getTableStrict ( entityConfig ) ; if ( table . getType ( ) == TableType . VIEW ) { entity . setView ( true ) ; } entity . setTable ( table )... |
public class UserType { /** * Note : the only reason we override this is to provide nicer error message , but since that ' s not that much code . . . */
@ Override public void validate ( ByteBuffer bytes ) throws MarshalException { } } | ByteBuffer input = bytes . duplicate ( ) ; for ( int i = 0 ; i < size ( ) ; i ++ ) { // we allow the input to have less fields than declared so as to support field addition .
if ( ! input . hasRemaining ( ) ) return ; if ( input . remaining ( ) < 4 ) throw new MarshalException ( String . format ( "Not enough bytes to r... |
public class GroupByBuilder { /** * Get the results as a map
* @ param expression projection
* @ return new result transformer */
@ SuppressWarnings ( "unchecked" ) public < V > ResultTransformer < Map < K , V > > as ( Expression < V > expression ) { } } | final Expression < V > lookup = getLookup ( expression ) ; return new GroupByMap < K , V > ( key , expression ) { @ Override protected Map < K , V > transform ( Map < K , Group > groups ) { Map < K , V > results = new LinkedHashMap < K , V > ( ( int ) Math . ceil ( groups . size ( ) / 0.75 ) , 0.75f ) ; for ( Map . Ent... |
public class Launcher { /** * Returns a decorated { @ link Launcher } for the given node .
* @ param node Node for which this launcher is created .
* @ return Decorated instance of the Launcher . */
@ Nonnull public final Launcher decorateFor ( @ Nonnull Node node ) { } } | Launcher l = this ; for ( LauncherDecorator d : LauncherDecorator . all ( ) ) l = d . decorate ( l , node ) ; return l ; |
public class LObjBoolFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < T , R > LObjBoolFunctionBuilder < T , R > objBoolFunction ( Consumer < LObjBoolFu... | return new LObjBoolFunctionBuilder ( consumer ) ; |
public class DDF { /** * for backward compatibility */
public List < HistogramBin > getVectorHistogram_Hive ( String columnName , int numBins ) throws DDFException { } } | return getVectorApproxHistogram ( columnName , numBins ) ; |
public class TransientUserLayoutManagerWrapper { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . layout . IUserLayoutManager # getSubscribeId ( java . lang . String , java . lang . String ) */
@ Override public String getSubscribeId ( String parentFolderId , String fname ) { } } | return this . man . getSubscribeId ( parentFolderId , fname ) ; |
public class TextCommandFactory { /** * ( non - Javadoc )
* @ see net . rubyeye . xmemcached . CommandFactory # createFlushAllCommand ( java . util
* . concurrent . CountDownLatch ) */
public final Command createFlushAllCommand ( CountDownLatch latch , int exptime , boolean noreply ) { } } | return new TextFlushAllCommand ( latch , exptime , noreply ) ; |
public class Version { /** * Checks if this version satisfies the specified SemVer Expression .
* This method is a part of the SemVer Expressions API .
* @ param expr
* the SemVer Expression
* @ return { @ code true } if this version satisfies the specified SemVer Expression or { @ code false }
* otherwise
... | Parser < Expression > parser = ExpressionParser . newInstance ( ) ; return parser . parse ( expr ) . interpret ( this ) ; |
public class SortedSetRelation { /** * Utility that could be on SortedSet . Allows faster implementation than
* what is in Java for doing addAll , removeAll , retainAll , ( complementAll ) .
* @ param a first set
* @ param relation the relation filter , using ANY , CONTAINS , etc .
* @ param b second set
* @ ... | // TODO : optimize this as above
TreeSet < ? extends T > temp ; switch ( relation ) { case ADDALL : a . addAll ( b ) ; return a ; case A : return a ; // no action
case B : a . clear ( ) ; a . addAll ( b ) ; return a ; case REMOVEALL : a . removeAll ( b ) ; return a ; case RETAINALL : a . retainAll ( b ) ; return a ; //... |
public class PdfStamper { /** * Sets the thumbnail image for a page .
* @ param image the image
* @ param page the page
* @ throws PdfException on error
* @ throws DocumentException on error */
public void setThumbnail ( Image image , int page ) throws PdfException , DocumentException { } } | stamper . setThumbnail ( image , page ) ; |
public class EnvironmentsInner { /** * Starts an environment by starting all resources inside the environment . This operation can take a while to complete .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ param labName The name of the lab . ... | return ServiceFuture . fromResponse ( beginStartWithServiceResponseAsync ( resourceGroupName , labAccountName , labName , environmentSettingName , environmentName ) , serviceCallback ) ; |
public class CmsSitemapActionElement { /** * Returns the needed server data for client - side usage . < p >
* @ return the needed server data for client - side usage */
public CmsSitemapData getSitemapData ( ) { } } | if ( m_sitemapData == null ) { try { m_sitemapData = CmsVfsSitemapService . prefetch ( getRequest ( ) , getCmsObject ( ) . getRequestContext ( ) . getUri ( ) ) ; } catch ( CmsRpcException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } return m_sitemapData ; |
public class AccountsEndpoint { /** * The { accountSid } could be the email address of the account we need to update . Later we check if this is SID or EMAIL */
@ Path ( "/{accountSid}" ) @ Consumes ( APPLICATION_FORM_URLENCODED ) @ POST @ Produces ( { } } | MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) public Response updateAccountAsXmlPost ( @ PathParam ( "accountSid" ) final String accountSid , final MultivaluedMap < String , String > data , @ HeaderParam ( "Accept" ) String accept , @ Context SecurityContext sec ) { return updateAccount ( accountSid , ... |
public class BTCTurkAdapters { /** * Adapts a BTCTurkTrade to a Trade Object
* @ param btcTurkTrade The BTCTurkTrade trade
* @ param currencyPair ( e . g . BTC / TRY )
* @ return The XChange Trade */
public static Trade adaptTrade ( BTCTurkTrades btcTurkTrade , CurrencyPair currencyPair ) { } } | return new Trade ( null , btcTurkTrade . getAmount ( ) , currencyPair , btcTurkTrade . getPrice ( ) , btcTurkTrade . getDate ( ) , btcTurkTrade . getTid ( ) . toString ( ) ) ; |
public class HostControllerBootstrap { /** * Start the host controller services .
* @ throws Exception */
public void bootstrap ( ) throws Exception { } } | final HostRunningModeControl runningModeControl = environment . getRunningModeControl ( ) ; final ControlledProcessState processState = new ControlledProcessState ( true ) ; shutdownHook . setControlledProcessState ( processState ) ; ServiceTarget target = serviceContainer . subTarget ( ) ; ControlledProcessStateServic... |
public class IdTokenImpl { /** * returns Authentication Methods References
* This is optional
* ( claim amr )
* @ return Authentication Methods References */
@ SuppressWarnings ( "unchecked" ) public List < String > getMethodsReferences ( ) { } } | return ( List < String > ) mapAll . get ( PayloadConstants . METHODS_REFERENCE ) ; |
public class DeleteWorkerBlockRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteWorkerBlockRequest deleteWorkerBlockRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteWorkerBlockRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteWorkerBlockRequest . getWorkerId ( ) , WORKERID_BINDING ) ; protocolMarshaller . marshall ( deleteWorkerBlockRequest . getReason ( ) , REASON_BINDING ) ; ... |
public class Token { /** * Retrieve the { @ link TokenAttributes } object associated with this
* { @ linkplain Token } . The attributes include the user ' s username , first name ,
* last name , and email address .
* @ return A valid { @ linkplain TokenAttributes } object or null if not decrypted . */
public Toke... | TokenAttributes attrs = null ; if ( this . isDecoded ) { attrs = this . attributes ; } else { try { this . decryptData ( ) ; } catch ( Exception e ) { log . error ( "No TokenAttributes available!" ) ; } attrs = this . attributes ; } return attrs ; |
public class ConfigObjectRecord { /** * Retreive matching config object records from the directory .
* @ param ldapEntry The ldapEntry object to examine . Must be a valid entry .
* @ param attr The attribute used to store COR ' s
* @ param recordType the record recordType to use , can not be null .
* @ param gu... | if ( ldapEntry == null ) { throw new NullPointerException ( "ldapEntry can not be null" ) ; } if ( attr == null ) { throw new NullPointerException ( "attr can not be null" ) ; } if ( recordType == null ) { throw new NullPointerException ( "recordType can not be null" ) ; } // Read the attribute
final Set < String > val... |
public class Multiset { /** * Returns the number of elements , i . e . the sum of all multiplicities .
* @ return The number of all elements . */
public int size ( ) { } } | int result = 0 ; for ( O o : multiplicities . keySet ( ) ) { result += multiplicity ( o ) ; } return result ; |
public class DescribeAccountAttributesResult { /** * The attributes that are currently set for the account .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAttributes ( java . util . Collection ) } or { @ link # withAttributes ( java . util . Collection )... | if ( this . attributes == null ) { setAttributes ( new java . util . ArrayList < AccountAttribute > ( attributes . length ) ) ; } for ( AccountAttribute ele : attributes ) { this . attributes . add ( ele ) ; } return this ; |
public class DaoImages { /** * Get the current data envelope .
* @ param connection the db connection .
* @ return the envelope .
* @ throws Exception */
public static ReferencedEnvelope getEnvelope ( IHMConnection connection ) throws Exception { } } | String query = "SELECT min(" + ImageTableFields . COLUMN_LON . getFieldName ( ) + "), max(" + ImageTableFields . COLUMN_LON . getFieldName ( ) + "), min(" + ImageTableFields . COLUMN_LAT . getFieldName ( ) + "), max(" + ImageTableFields . COLUMN_LAT . getFieldName ( ) + ") " + " FROM " + TABLE_IMAGES ; try ( IHMStateme... |
public class WTabSetRenderer { /** * Paints the given WTabSet .
* @ param component the WTabSet to paint .
* @ param renderContext the RenderContext to paint to . */
@ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } } | WTabSet tabSet = ( WTabSet ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; xml . appendTagOpen ( "ui:tabset" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , component . ... |
public class BoxCollaboration { /** * Deletes this collaboration . */
public void delete ( ) { } } | BoxAPIConnection api = this . getAPI ( ) ; URL url = COLLABORATION_URL_TEMPLATE . build ( api . getBaseURL ( ) , this . getID ( ) ) ; BoxAPIRequest request = new BoxAPIRequest ( api , url , "DELETE" ) ; BoxAPIResponse response = request . send ( ) ; response . disconnect ( ) ; |
public class PlaceObject { /** * Requests that the < code > occupantInfo < / code > field be set to the
* specified value . Generally one only adds , updates and removes
* entries of a distributed set , but certain situations call for a
* complete replacement of the set value . The local value will be
* updated... | "com.threerings.presents.tools.GenDObjectTask" } ) public void setOccupantInfo ( DSet < OccupantInfo > value ) { requestAttributeChange ( OCCUPANT_INFO , value , this . occupantInfo ) ; DSet < OccupantInfo > clone = ( value == null ) ? null : value . clone ( ) ; this . occupantInfo = clone ; |
public class ElementsExceptionsFactory { /** * Constructs and initializes a new { @ link NoAvailablePortException } with the given { @ link String message }
* formatted with the given { @ link Object [ ] arguments } .
* @ param message { @ link String } describing the { @ link NoAvailablePortException exception } .... | return newNoAvailablePortException ( null , message , args ) ; |
public class ControllerService { /** * Controller Service API to delete scope .
* @ param scope Name of scope to be deleted .
* @ return Status of delete scope . */
public CompletableFuture < DeleteScopeStatus > deleteScope ( final String scope ) { } } | Exceptions . checkNotNullOrEmpty ( scope , "scope" ) ; return streamStore . deleteScope ( scope ) ; |
public class BinaryNumberIncrementor { /** * Deserialize this object from a POF stream .
* @ param reader POF reader to use
* @ throws IOException if an error occurs during deserialization */
public void readExternal ( PofReader reader ) throws IOException { } } | super . readExternal ( reader ) ; numInc = ( Number ) reader . readObject ( 10 ) ; fPostInc = reader . readBoolean ( 11 ) ; |
public class SplitData { /** * Retrieves the list of incoming transitions for the respective label .
* This method will always return a non - { @ code null } value .
* @ param label
* the label
* @ return the ( possibly empty ) list associated with the given state label */
public T getIncoming ( O label ) { } } | return incomingTransitions . computeIfAbsent ( label , k -> listSuppllier . get ( ) ) ; |
public class Mail { /** * Sends the email asynchronously .
* This method returns immediately , sending the request to the Mailgun
* service in the background . It is a < strong > non - blocking < / strong >
* method .
* @ param callback the callback to be invoked upon completion or failure */
public void sendAs... | if ( ! configuration . mailSendFilter ( ) . filter ( this ) ) return ; prepareSend ( ) ; request ( ) . async ( ) . post ( entity ( ) , new InvocationCallback < javax . ws . rs . core . Response > ( ) { @ Override public void completed ( javax . ws . rs . core . Response o ) { callback . completed ( new Response ( o ) )... |
public class ConformanceConfig { /** * < code > repeated . jscomp . Requirement requirement = 1 ; < / code > */
public java . util . List < ? extends com . google . javascript . jscomp . RequirementOrBuilder > getRequirementOrBuilderList ( ) { } } | return requirement_ ; |
public class MultiMEProxyHandler { /** * Recovers the Neighbours from the MessageStore .
* @ exception WsException Thrown if there was a problem
* recovering the Neighbours . */
public void recoverNeighbours ( ) throws SIResourceException , MessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "recoverNeighbours" ) ; try { // Lock the manager exclusively
_lockManager . lockExclusive ( ) ; // Indicate that we are now reconciling
_reconciling = true ; _neighbours . recoverNeighbours ( ) ; } finally { _lockManager . ... |
public class Settings { /** * Change a property value in a restricted scope only , depending on execution context . New value
* is < b > never < / b > persisted . New value is ephemeral and kept in memory only :
* < ul >
* < li > during current analysis in the case of scanner stack < / li >
* < li > during proc... | String validKey = definitions . validKey ( key ) ; if ( value == null ) { removeProperty ( validKey ) ; } else { set ( validKey , trim ( value ) ) ; } return this ; |
public class hqlParser { /** * hql . g : 220:1 : intoClause : INTO ^ path insertablePropertySpec ; */
public final hqlParser . intoClause_return intoClause ( ) throws RecognitionException { } } | hqlParser . intoClause_return retval = new hqlParser . intoClause_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token INTO30 = null ; ParserRuleReturnScope path31 = null ; ParserRuleReturnScope insertablePropertySpec32 = null ; CommonTree INTO30_tree = null ; try { // hql . g : 221:2 : ( I... |
public class DependencyFinder { /** * Returns the location to archive map ; or NOT _ FOUND .
* Location represents a parsed class . */
Archive locationToArchive ( Location location ) { } } | return parsedClasses . containsKey ( location ) ? parsedClasses . get ( location ) : configuration . findClass ( location ) . orElse ( NOT_FOUND ) ; |
public class BeadledomClientConfiguration { /** * Default client config builder . */
public static Builder builder ( ) { } } | return new AutoValue_BeadledomClientConfiguration . Builder ( ) . connectionPoolSize ( DEFAULT_CONNECTION_POOL_SIZE ) . maxPooledPerRouteSize ( DEFAULT_MAX_POOLED_PER_ROUTE ) . socketTimeoutMillis ( DEFAULT_SOCKET_TIMEOUT_MILLIS ) . connectionTimeoutMillis ( DEFAULT_CONNECTION_TIMEOUT_MILLIS ) . ttlMillis ( DEFAULT_TTL... |
public class CommerceNotificationQueueEntryPersistenceImpl { /** * Returns all the commerce notification queue entries .
* @ return the commerce notification queue entries */
@ Override public List < CommerceNotificationQueueEntry > findAll ( ) { } } | return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class DownloadManager { /** * Tasks */
public void requestState ( long fileId , final FileCallback callback ) { } } | if ( LOG ) { Log . d ( TAG , "Requesting state file #" + fileId ) ; } Downloaded downloaded1 = downloaded . getValue ( fileId ) ; if ( downloaded1 != null ) { FileSystemReference reference = Storage . fileFromDescriptor ( downloaded1 . getDescriptor ( ) ) ; boolean isExist = reference . isExist ( ) ; int fileSize = ref... |
public class OR { /** * Checks the inner mapping of the wrapped constraints and figures the size .
* @ return the size */
@ Override public int getVariableSize ( ) { } } | int size = 0 ; for ( MappedConst mc : con ) { int m = max ( mc . getInds ( ) ) ; if ( m > size ) size = m ; } return size + 1 ; |
public class SSLContextBuilder { /** * Workaround for keystores containing multiple keys . Java will take the first key that matches
* and this way we can still offer configuration for a keystore with multiple keys and a selection
* based on alias . Also much easier than making a subclass of a KeyManagerFactory */
... | KeyStore singleKeyKeyStore = KeyStore . getInstance ( keyStore . getType ( ) , keyStore . getProvider ( ) ) ; final char [ ] password = keyStorePassword . toCharArray ( ) ; singleKeyKeyStore . load ( null , password ) ; Key key = keyStore . getKey ( keyAlias , password ) ; Certificate [ ] chain = keyStore . getCertific... |
public class CountryTileSkin { /** * * * * * * Initialization * * * * * */
@ Override protected void initGraphics ( ) { } } | super . initGraphics ( ) ; // poiLocations = FXCollections . observableHashMap ( ) ;
// chartDataLocations = FXCollections . observableHashMap ( ) ;
// circleHandlerMap = new HashMap < > ( ) ;
country = tile . getCountry ( ) ; if ( null == country ) { country = Country . DE ; } clickHandler = event -> tile . fireTileEv... |
public class IOUtils { /** * Check whether provided url string is a valid java { @ link java . net . URL }
* @ param url URL to be validated
* @ return TRUE if URL is valid */
public static boolean isValidUrl ( String url ) { } } | try { if ( Strings . isNullOrEmpty ( url ) ) { return false ; } new URL ( url ) ; return true ; } catch ( MalformedURLException e ) { return false ; } |
public class BootstrapContextImpl { /** * Shutdown */
public void shutdown ( ) { } } | if ( timers != null ) { for ( Timer t : timers ) { t . cancel ( ) ; t . purge ( ) ; } } |
public class VisitorHelper { /** * Return the field descriptor for the given type and field signature .
* @ param name
* The variable name .
* @ param signature
* The variable signature .
* @ return The field descriptor . */
VariableDescriptor getVariableDescriptor ( String name , String signature ) { } } | VariableDescriptor variableDescriptor = scannerContext . getStore ( ) . create ( VariableDescriptor . class ) ; variableDescriptor . setName ( name ) ; variableDescriptor . setSignature ( signature ) ; return variableDescriptor ; |
public class UpdateDocumentVersionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateDocumentVersionRequest updateDocumentVersionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateDocumentVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateDocumentVersionRequest . getAuthenticationToken ( ) , AUTHENTICATIONTOKEN_BINDING ) ; protocolMarshaller . marshall ( updateDocumentVersionRequest . g... |
public class MethodFinder { /** * Recursively search the class hierarchy of the class which declares { @ code originalMethod } to find a method named { @ code methodName } with the same signature as
* { @ code originalMethod }
* @ return The matching method , or { @ code null } if one could not be found */
public s... | Class < ? > originalClass = originalMethod . getDeclaringClass ( ) ; return AccessController . doPrivileged ( new PrivilegedAction < Method > ( ) { @ Override public Method run ( ) { return findMatchingMethod ( originalMethod , methodName , originalClass , new ResolutionContext ( ) , originalClass ) ; } } ) ; |
public class PropertiesReplacementUtil { /** * Creates an InputStream containing the document resulting from replacing template
* parameters in the given InputStream source .
* @ param source The source stream
* @ param props The properties
* @ return An InputStream containing the resulting document . */
static... | return replaceProperties ( source , props , "${" , "}" ) ; |
public class KafkaNotification { /** * - - - - - Service - - - - - */
@ Override public void start ( ) throws AtlasException { } } | if ( isHAEnabled ( ) ) { LOG . info ( "Not starting embedded instances when HA is enabled." ) ; return ; } if ( isEmbedded ( ) ) { try { startZk ( ) ; startKafka ( ) ; } catch ( Exception e ) { throw new AtlasException ( "Failed to start embedded kafka" , e ) ; } } |
public class JobResource { /** * The Amazon Machine Images ( AMIs ) associated with this job .
* @ param ec2AmiResources
* The Amazon Machine Images ( AMIs ) associated with this job . */
public void setEc2AmiResources ( java . util . Collection < Ec2AmiResource > ec2AmiResources ) { } } | if ( ec2AmiResources == null ) { this . ec2AmiResources = null ; return ; } this . ec2AmiResources = new java . util . ArrayList < Ec2AmiResource > ( ec2AmiResources ) ; |
public class UtilizationCollector { /** * main program to run on the Collector server */
public static void main ( String argv [ ] ) throws Exception { } } | StringUtils . startupShutdownMessage ( UtilizationCollector . class , argv , LOG ) ; try { Configuration conf = new Configuration ( ) ; UtilizationCollector collector = new UtilizationCollector ( conf ) ; if ( collector != null ) { collector . join ( ) ; } } catch ( Throwable e ) { LOG . error ( StringUtils . stringify... |
public class GetApiToken { /** * Generates the next MediaWiki API urlEncodedToken and adds it to < code > msgs < / code > .
* @ param intoken type to get the urlEncodedToken for
* @ param title title of the article to generate the urlEncodedToken for */
private static Get generateTokenRequest ( Intoken intoken , St... | return new ApiRequestBuilder ( ) . action ( "query" ) . formatXml ( ) . param ( "prop" , "info" ) . param ( "intoken" , intoken . toString ( ) . toLowerCase ( ) ) . param ( "titles" , MediaWiki . urlEncode ( title ) ) . buildGet ( ) ; |
public class Router { /** * Pops all { @ link Controller } s until the Controller with the passed tag is at the top
* @ param tag The tag being popped to
* @ return Whether or not any { @ link Controller } s were popped in order to get to the transaction with the passed tag */
@ UiThread public boolean popToTag ( @... | ThreadUtils . ensureMainThread ( ) ; return popToTag ( tag , null ) ; |
public class Humanize { /** * Same as { @ link # decamelize ( String String ) } defaulting to SPACE for
* replacement
* @ param words
* String to be converted
* @ return words converted to human - readable name */
@ Expose public static String decamelize ( final String words ) { } } | return SPLIT_CAMEL . matcher ( words ) . replaceAll ( SPACE ) ; |
public class JMSManager { /** * Stops a durable message consumer . Note that this is not
* the same as unsubscribing . When a durable message consumer is
* restarted all messages received since it was stopped will be
* delivered .
* @ param subscriptionName - the name of the subscription
* @ throws MessagingE... | try { MessageConsumer durableSubscriber = durableSubscriptions . get ( subscriptionName ) ; if ( durableSubscriber != null ) { durableSubscriber . close ( ) ; } } catch ( JMSException jmse ) { throw new MessagingException ( "Exception encountered attempting to " + "stop durable subscription with name: " + subscriptionN... |
public class ArtifactoryServer { /** * Decides what are the preferred credentials to use for resolving the repo keys of the server
* @ return Preferred credentials for repo resolving . Never null . */
public CredentialsConfig getResolvingCredentialsConfig ( ) { } } | if ( resolverCredentialsConfig != null && resolverCredentialsConfig . isCredentialsProvided ( ) ) { return getResolverCredentialsConfig ( ) ; } if ( deployerCredentialsConfig != null ) { return getDeployerCredentialsConfig ( ) ; } return CredentialsConfig . EMPTY_CREDENTIALS_CONFIG ; |
public class AmazonIdentityManagementClient { /** * Removes the specified IAM role from the specified EC2 instance profile .
* < important >
* Make sure that you do not have any Amazon EC2 instances running with the role you are about to remove from the
* instance profile . Removing a role from an instance profil... | request = beforeClientExecution ( request ) ; return executeRemoveRoleFromInstanceProfile ( request ) ; |
public class Command { /** * Dispose unbindService stopService */
public static void dispose ( ) { } } | synchronized ( Command . class ) { if ( IS_BIND ) { Context context = Cmd . getContext ( ) ; if ( context != null ) { try { context . unbindService ( I_CONN ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } I_COMMAND = null ; IS_BIND = false ; } } |
public class DelegateEbeanServer { /** * Construct with a EbeanServer to delegate and using ImmediateBackgroundExecutor .
* This delegate will be used on all method calls that are not overwritten . */
public DelegateEbeanServer withDelegate ( EbeanServer delegate ) { } } | this . delegate = delegate ; this . delegateQuery = new DelegateQuery ( delegate , this ) ; this . save = new DelegateSave ( delegate ) ; this . delete = new DelegateDelete ( delegate ) ; this . bulkUpdate = new DelegateBulkUpdate ( delegate ) ; this . find = new DelegateFind ( delegate ) ; this . findSqlQuery = new De... |
public class ClassInfoCache { /** * The class info is last , or the class info is somewhere in the middle . */
public void makeFirst ( NonDelayedClassInfo classInfo ) { } } | String methodName = "makeFirst" ; boolean doLog = tc . isDebugEnabled ( ) ; String useHashText = ( doLog ? getHashText ( ) : null ) ; String useClassHashText = ( doLog ? classInfo . getHashText ( ) : null ) ; if ( doLog ) { logLinks ( methodName , classInfo ) ; } if ( classInfo == firstClassInfo ) { if ( doLog ) { Tr .... |
public class ServerControllerImpl { /** * < p > Scans for file used to configure Undertow : < ul >
* < li > Always consider < code > org . ops4j . pax . web < / code > PID < / li >
* < li > If this PID contains < code > org . ops4j . pax . web . config . url < / code > or < code > org . ops4j . pax . web . config .... | URL undertowResource = configuration . getConfigurationURL ( ) ; // even if it ' s " dir " it may point to " file "
// ( same as in o . o . p . w . s . jetty . internal . JettyFactoryImpl . getHttpConfiguration ( ) )
File serverConfigDir = configuration . getConfigurationDir ( ) ; try { if ( undertowResource == null &&... |
public class PlaceManager { /** * Adds the supplied delegate to the list for this manager . */
public void addDelegate ( PlaceManagerDelegate delegate ) { } } | if ( _delegates == null ) { _delegates = Lists . newArrayList ( ) ; } if ( _omgr != null ) { delegate . init ( this , _omgr , _invmgr ) ; delegate . didInit ( _config ) ; } _delegates . add ( delegate ) ; |
public class ZeroCodeExternalFileProcessorImpl { /** * Digs deep into the nested map and looks for external file reference , if found , replaces the place holder with
* the file content . This is handy when the engineers wants to drive the common contents from a central place .
* @ param map A map representing the ... | map . entrySet ( ) . stream ( ) . forEach ( entry -> { Object value = entry . getValue ( ) ; if ( value instanceof Map ) { digReplaceContent ( ( Map < String , Object > ) value ) ; } else { LOGGER . debug ( "Leaf node found = {}, checking for any external json file..." , value ) ; if ( value != null && value . toString... |
public class ScheduledInstancesNetworkInterface { /** * The specific IPv6 addresses from the subnet range .
* @ return The specific IPv6 addresses from the subnet range . */
public java . util . List < ScheduledInstancesIpv6Address > getIpv6Addresses ( ) { } } | if ( ipv6Addresses == null ) { ipv6Addresses = new com . amazonaws . internal . SdkInternalList < ScheduledInstancesIpv6Address > ( ) ; } return ipv6Addresses ; |
public class FuncId { /** * Execute the function . The function must return
* a valid object .
* @ param xctxt The current execution context .
* @ return A valid XObject .
* @ throws javax . xml . transform . TransformerException */
public XObject execute ( XPathContext xctxt ) throws javax . xml . transform . ... | int context = xctxt . getCurrentNode ( ) ; DTM dtm = xctxt . getDTM ( context ) ; int docContext = dtm . getDocument ( ) ; if ( DTM . NULL == docContext ) error ( xctxt , XPATHErrorResources . ER_CONTEXT_HAS_NO_OWNERDOC , null ) ; XObject arg = m_arg0 . execute ( xctxt ) ; int argType = arg . getType ( ) ; XNodeSet nod... |
public class DnsProtocol { /** * / * atomic 16 - bit xorshift LSFR , cycling through all 16 - bit values except zero */
public static short generateTransactionId ( ) { } } | return ( short ) xorshiftState . updateAndGet ( old -> { short x = ( short ) old ; x ^= ( x & 0xffff ) << 7 ; x ^= ( x & 0xffff ) >>> 9 ; x ^= ( x & 0xffff ) << 8 ; assert x != 0 : "Xorshift LFSR can never produce zero" ; return x ; } ) ; |
public class SpringQueryInputProcessor { /** * Parse the SQL statement and locate any placeholders or named parameters .
* Named parameters are substituted for a JDBC placeholder .
* @ param sql the SQL statement
* @ return the parsed statement , represented as ParsedSql instance */
private static ProcessedInput ... | Map < String , String > parsedSqlResult = new HashMap < String , String > ( ) ; Set < String > namedParameters = new HashSet < String > ( ) ; String sqlToUse = sql ; List < ParameterHolder > parameterList = new ArrayList < ParameterHolder > ( ) ; char [ ] statement = sql . toCharArray ( ) ; int namedParameterCount = 0 ... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */
@ XmlElementDecl ( namespace = "http://belframework.org/schema/1.0/xbel" , name = "license" ) public JAXBElement < String > createLicense ( String value ) { } } | return new JAXBElement < String > ( _License_QNAME , String . class , null , value ) ; |
public class SingleEvaluatedMoveCache { /** * Retrieve a cached validation , if still available . If the validation of any other move has
* been cached at a later point in time , the value for this move will have been overwritten .
* @ param move move applied to the current solution
* @ return cached validation o... | if ( validatedMove == null || ! validatedMove . equals ( move ) ) { // cache miss
return null ; } else { // cache hit
return validation ; } |
public class UserApi { /** * Get an impersonation token of a user . Available only for admin users .
* < pre > < code > GitLab Endpoint : GET / users / : user _ id / impersonation _ tokens / : impersonation _ token _ id < / code > < / pre >
* @ param userIdOrUsername the user in the form of an Integer ( ID ) , Stri... | if ( tokenId == null ) { throw new RuntimeException ( "tokenId cannot be null" ) ; } Response response = get ( Response . Status . OK , null , "users" , getUserIdOrUsername ( userIdOrUsername ) , "impersonation_tokens" , tokenId ) ; return ( response . readEntity ( ImpersonationToken . class ) ) ; |
public class SavedAuthenticationImpl { /** * Get array of authorizations which apply for the user . In many cases there is one object for each role .
* A union is used to combine these authorizations ( and any other which may apply for the authentication token ) .
* @ return array of { @ link org . geomajas . secur... | BaseAuthorization [ ] res = new BaseAuthorization [ authorizations . length ] ; try { for ( int i = 0 ; i < authorizations . length ; i ++ ) { ByteArrayInputStream bais = new ByteArrayInputStream ( authorizations [ i ] ) ; JBossObjectInputStream deserialize = new JBossObjectInputStream ( bais ) ; Object obj = deseriali... |
public class NotificationManager { /** * This synchronized method will assign an unique ID to a new notification client */
private synchronized int getNewClientID ( ) { } } | if ( ( clientIDGenerator + 1 ) >= Integer . MAX_VALUE ) { // if we can ' t find a reusable ID within the first 100 slots , then fail .
// Revisit : I don ' t want to loop through all 2 + billion entries to find that they are all taken , as this
// could be seem as a DoS , but maybe some better heuristics for finding an... |
public class MonitorService { /** * Returns the script for the given monitor id .
* @ param monitorId The id for the monitor to return
* @ return The script */
public Optional < Script > showScript ( String monitorId ) { } } | return HTTP . GET ( String . format ( "/v3/monitors/%s/script" , monitorId ) , SCRIPT ) ; |
public class ServiceRegistry { /** * If a system property is found with key equal to :
* A . B
* where A is the current classname and B is some constant
* String defined in ServicePropertyNames , then the value V
* of this system property will be included in a new property
* added to the return value Properti... | final String PROP_PREFIX = sourceClass ; Properties props = new Properties ( ) ; for ( String propName : getAllServicePropertyNames ( ) ) { final String key = PROP_PREFIX + "." + propName ; final String val = System . getProperty ( key ) ; if ( val != null ) { logger . fine ( "Found override property from system proper... |
public class RestfulMgrImpl { /** * Retry封装 RemoteUrl 支持多Server的下载
* @ param remoteUrl
* @ param localTmpFile
* @ param retryTimes
* @ param sleepSeconds
* @ return */
private Object retry4ConfDownload ( RemoteUrl remoteUrl , File localTmpFile , int retryTimes , int sleepSeconds ) throws Exception { } } | Exception ex = null ; for ( URL url : remoteUrl . getUrls ( ) ) { // 可重试的下载
UnreliableInterface unreliableImpl = new FetchConfFile ( url , localTmpFile ) ; try { return retryStrategy . retry ( unreliableImpl , retryTimes , sleepSeconds ) ; } catch ( Exception e ) { ex = e ; try { Thread . sleep ( 1000 ) ; } catch ( Int... |
public class CollectionUtil { /** * Converts a { @ link Collection < Long > } to a primitive { @ code long [ ] } array .
* @ param collection the given collection
* @ return a primitive long [ ] array
* @ throws NullPointerException if collection is { @ code null } */
public static long [ ] toLongArray ( Collecti... | long [ ] collectionArray = new long [ collection . size ( ) ] ; int index = 0 ; for ( Long item : collection ) { collectionArray [ index ++ ] = item ; } return collectionArray ; |
public class ObjectComparatorFactory { /** * Create a new instance of a the specified factory class .
* @ param objectComparatorFactoryClassName the factory class
* @ return a new instance of a the specified factory
* @ throws InstantiationException if creation of the factory fails
* @ throws IllegalAccessExcep... | return ( ObjectComparatorFactory ) Class . forName ( objectComparatorFactoryClassName ) . newInstance ( ) ; |
public class SVGPlot { /** * Convert screen coordinates to element coordinates .
* @ param tag Element to convert the coordinates for
* @ param evt Event object
* @ return Coordinates */
public SVGPoint elementCoordinatesFromEvent ( Element tag , Event evt ) { } } | return SVGUtil . elementCoordinatesFromEvent ( document , tag , evt ) ; |
public class DataNode { /** * stores an object for the given key
* @ param < T >
* @ param key
* @ param object */
public < T > void setObject ( DataKey < T > key , T object ) { } } | if ( key == null ) { throw new IllegalArgumentException ( "key must not be null" ) ; } if ( object == null && ! key . allowNull ( ) ) { throw new IllegalArgumentException ( "key \"" + key . getName ( ) + "\" disallows null values but object was null" ) ; } data . put ( key . getName ( ) , object ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcAirToAirHeatRecoveryTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class HandlerUtil { /** * Sets a JSON encoded response . The response ' s { @ code Content - Type } header will be set to { @ code application / json }
* @ param response The response object
* @ param encoded The JSON - encoded string */
public static void makeJsonResponse ( HttpResponse response , String en... | StringEntity ent = new StringEntity ( encoded , ContentType . APPLICATION_JSON ) ; response . setEntity ( ent ) ; |
public class BrokerHelper { /** * Detect if the given object has a PK field represents a ' null ' value . */
public boolean hasNullPKField ( ClassDescriptor cld , Object obj ) { } } | FieldDescriptor [ ] fields = cld . getPkFields ( ) ; boolean hasNull = false ; // an unmaterialized proxy object can never have nullified PK ' s
IndirectionHandler handler = ProxyHelper . getIndirectionHandler ( obj ) ; if ( handler == null || handler . alreadyMaterialized ( ) ) { if ( handler != null ) obj = handler .... |
public class WikiUpdate { /** * Read the file .
* @ param _ installFile the install file
* @ return JavaScriptUpdate */
public static WikiUpdate readFile ( final InstallFile _installFile ) { } } | final WikiUpdate ret = new WikiUpdate ( _installFile ) ; final WikiDefinition definition = ret . new WikiDefinition ( _installFile ) ; ret . addDefinition ( definition ) ; return ret ; |
public class ServletUtil { /** * / * getContextAttribute ( ServletConfig . . . ) */
public static final < T > T getContextAttribute ( ServletConfig conf , String name , Class < T > cls , Set < GetOpts > opts , T defaultValue ) { } } | return getContextAttribute ( conf . getServletContext ( ) , name , cls , opts , defaultValue ) ; |
public class PlainTime { /** * also called by ZonalDateTime */
static void printNanos ( StringBuilder sb , int nano ) { } } | sb . append ( PlainTime . ISO_DECIMAL_SEPARATOR ) ; String num = Integer . toString ( nano ) ; int len ; if ( ( nano % MIO ) == 0 ) { len = 3 ; } else if ( ( nano % KILO ) == 0 ) { len = 6 ; } else { len = 9 ; } for ( int i = num . length ( ) ; i < 9 ; i ++ ) { sb . append ( '0' ) ; } for ( int i = 0 , n = len + num . ... |
public class MemoryAddressHash { /** * Returns a stream of longs that are all of the various memory locations
* @ return stream of the various memory locations */
public LongStream toStream ( ) { } } | return LongStream . iterate ( memory , l -> l + 8 ) . limit ( pointerCount ) . map ( UNSAFE :: getLong ) . filter ( l -> l != 0 ) ; |
public class AnalysisJobBuilder { /** * Gets all available { @ link InputColumn } s of a particular type to map to a
* particular { @ link ComponentBuilder }
* @ param componentBuilder
* @ param dataType
* @ return */
public List < InputColumn < ? > > getAvailableInputColumns ( final ComponentBuilder componentB... | List < InputColumn < ? > > result = getAvailableInputColumns ( dataType ) ; final SourceColumnFinder finder = new SourceColumnFinder ( ) ; finder . addSources ( this ) ; result = CollectionUtils . filter ( result , new Predicate < InputColumn < ? > > ( ) { @ Override public Boolean eval ( InputColumn < ? > inputColumn ... |
public class ModuleNameReader { /** * ensureCapacity will increase the buffer as needed , taking note that
* the new buffer will always be greater than the needed and never
* exactly equal to the needed size or bp . If equal then the read ( above )
* will infinitely loop as buf . length - bp = = 0. */
private sta... | if ( buf . length <= needed ) { byte [ ] old = buf ; buf = new byte [ Integer . highestOneBit ( needed ) << 1 ] ; System . arraycopy ( old , 0 , buf , 0 , old . length ) ; } return buf ; |
public class Generators { /** * Returns the appropriate folder for a given artifact .
* @ param generatorName
* Unique name of the generator to return a target folder for .
* @ param artifactName
* Unique name of the artifact to return a target folder for .
* @ return Target folder . */
@ Nullable public fina... | Contract . requireArgNotEmpty ( "generatorName" , generatorName ) ; Contract . requireArgNotEmpty ( "artifactName" , artifactName ) ; if ( parent == null ) { throw new IllegalStateException ( "Parent for generators is not set" ) ; } try { return parent . findTargetFolder ( generatorName , artifactName ) ; } catch ( fin... |
public class DateTimeUtils { /** * / * long - > ISO8601 */
public String toISO8601Date ( long utcEpochMillis , @ Nullable DateTimeZone dtz ) { } } | return toISO8601Date ( new DateTime ( utcEpochMillis , dtz ) , dtz ) ; |
public class SessionBeanO { /** * SessionBeanO */
@ Override public void setEnterpriseBean ( Object bean ) { } } | super . setEnterpriseBean ( bean ) ; if ( bean instanceof SessionBean ) { sessionBean = ( SessionBean ) bean ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.