signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Schema { /** * Converts this descriptor into a set of properties . */
@ Override public Map < String , String > toProperties ( ) { } } | DescriptorProperties properties = new DescriptorProperties ( ) ; List < Map < String , String > > subKeyValues = new ArrayList < > ( ) ; for ( Map . Entry < String , LinkedHashMap < String , String > > entry : tableSchema . entrySet ( ) ) { String name = entry . getKey ( ) ; LinkedHashMap < String , String > props = en... |
public class DynamicList { /** * regardless of its future position in the list from other modifications */
public Node < E > append ( E value , int maxSize ) { } } | Node < E > newTail = new Node < > ( randomLevel ( ) , value ) ; lock . writeLock ( ) . lock ( ) ; try { if ( size >= maxSize ) return null ; size ++ ; Node < E > tail = head ; for ( int i = maxHeight - 1 ; i >= newTail . height ( ) ; i -- ) { Node < E > next ; while ( ( next = tail . next ( i ) ) != null ) tail = next ... |
public class MapTilePreCache { /** * Search for a tile bitmap into the list of providers and put it in the memory cache */
private void search ( final long pMapTileIndex ) { } } | for ( final MapTileModuleProviderBase provider : mProviders ) { try { if ( provider instanceof MapTileDownloader ) { final ITileSource tileSource = ( ( MapTileDownloader ) provider ) . getTileSource ( ) ; if ( tileSource instanceof OnlineTileSourceBase ) { if ( ! ( ( OnlineTileSourceBase ) tileSource ) . getTileSourceP... |
public class SpringSecurityWebApplicationContextUtils { /** * This method mimics the behaviour in
* org . springframework . security . web . context . support . SecurityWebApplicationContextUtils # findRequiredWebApplicationContext ( sc ) ,
* which provides a default mechanism for looking for the WebApplicationCont... | WebApplicationContext wac = WebApplicationContextUtils . getWebApplicationContext ( servletContext ) ; if ( wac == null ) { final Enumeration < String > attrNames = servletContext . getAttributeNames ( ) ; while ( attrNames . hasMoreElements ( ) ) { final String attrName = attrNames . nextElement ( ) ; final Object att... |
public class CmsSeoOptionsDialog { /** * The method which is called when the user clicks the save button of the dialog . < p > */
protected void onClickSave ( ) { } } | Timer timer = new Timer ( ) { @ Override public void run ( ) { m_aliasList . clearValidationErrors ( ) ; m_aliasValidationStatus = VALIDATION_RUNNING ; m_propertyValidationStatus = VALIDATION_RUNNING ; m_aliasList . validate ( new Runnable ( ) { public void run ( ) { m_aliasValidationStatus = ! m_aliasList . hasValidat... |
public class LongBestFitAllocator { /** * / * Check all the chunks in a treebin . */
private void checkTreeBin ( int index ) { } } | long tb = treeBins [ index ] ; boolean empty = ( treeMap & ( 1 << index ) ) == 0 ; if ( tb == - 1 && ! empty ) { throw new AssertionError ( "Tree " + index + " is marked as occupied but has an invalid head pointer" ) ; } if ( ! empty ) { checkTree ( tb ) ; } |
public class ByteArrayPersistedValueData { /** * { @ inheritDoc } */
public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } } | orderNumber = in . readInt ( ) ; value = new byte [ in . readInt ( ) ] ; if ( value . length > 0 ) { in . readFully ( value ) ; } |
public class ModbusTCPMaster { /** * Sets the flag that specifies whether to maintain a
* constant connection or reconnect for every transaction .
* @ param b true if a new connection should be established for each
* transaction , false otherwise . */
public synchronized void setReconnecting ( boolean b ) { } } | reconnecting = b ; if ( transaction != null ) { ( ( ModbusTCPTransaction ) transaction ) . setReconnecting ( b ) ; } |
public class LightCluster { /** * Implement serviceToUrl with client side service discovery .
* @ param protocol String
* @ param serviceId String
* @ param requestKey String
* @ return String */
@ Override public String serviceToUrl ( String protocol , String serviceId , String tag , String requestKey ) { } } | URL url = loadBalance . select ( discovery ( protocol , serviceId , tag ) , requestKey ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "final url after load balance = " + url ) ; // construct a url in string
return protocol + "://" + url . getHost ( ) + ":" + url . getPort ( ) ; |
public class ZanataInterface { /** * Run copy trans against a Source Document in zanata and then wait for it to complete
* @ param zanataId The id of the document to run copytrans for .
* @ param waitForFinish Wait for copytrans to finish running .
* @ return True if copytrans was run successfully , otherwise fal... | log . debug ( "Running Zanata CopyTrans for " + zanataId ) ; try { final CopyTransResource copyTransResource = proxyFactory . getCopyTransResource ( ) ; copyTransResource . startCopyTrans ( details . getProject ( ) , details . getVersion ( ) , zanataId ) ; performZanataRESTCallWaiting ( ) ; if ( waitForFinish ) { while... |
public class KunderaCriteriaBuilder { /** * ( non - Javadoc )
* @ see
* javax . persistence . criteria . CriteriaBuilder # array ( javax . persistence . criteria
* . Selection < ? > [ ] ) */
@ Override public CompoundSelection < Object [ ] > array ( Selection < ? > ... arg0 ) { } } | return new DefaultCompoundSelection < Object [ ] > ( Arrays . asList ( arg0 ) , Object . class ) ; |
public class AdminRelatedcontentAction { private HtmlResponse asListHtml ( ) { } } | return asHtml ( path_AdminRelatedcontent_AdminRelatedcontentJsp ) . renderWith ( data -> { RenderDataUtil . register ( data , "relatedContentItems" , relatedContentService . getRelatedContentList ( relatedContentPager ) ) ; } ) . useForm ( SearchForm . class , setup -> { setup . setup ( form -> { copyBeanToBean ( relat... |
public class FunctionToBlockMutator { /** * Create a valid statement Node containing an assignment to name of the
* given expression . */
private static Node createAssignStatementNode ( String name , Node expression ) { } } | // Create ' name = result - expression ; ' statement .
// EXPR ( ASSIGN ( NAME , EXPRESSION ) )
Node nameNode = IR . name ( name ) ; Node assign = IR . assign ( nameNode , expression ) ; return NodeUtil . newExpr ( assign ) ; |
public class OutlineBuildingXMLReaderWrapper { /** * Returns the string excerpt . */
private String excerpt ( String str , int maxLength ) { } } | return str . length ( ) > maxLength ? excerptPattern . matcher ( str . substring ( 0 , maxLength ) ) . replaceFirst ( "…" ) : str ; |
public class AlphabeticIndex { /** * Return a list of the first character in each script . Only exposed for testing .
* @ return list of first characters in each script
* @ deprecated This API is ICU internal , only for testing .
* @ hide original deprecated declaration
* @ hide draft / provisional / internal a... | List < String > dest = new ArrayList < String > ( 200 ) ; // Fetch the script - first - primary contractions which are defined in the root collator .
// They all start with U + FDD1.
UnicodeSet set = new UnicodeSet ( ) ; collatorPrimaryOnly . internalAddContractions ( 0xFDD1 , set ) ; if ( set . isEmpty ( ) ) { throw n... |
public class ActionUtils { /** * Generates a client - level request by extracting the user parameters ( if */
private static AmazonWebServiceRequest generateRequest ( ActionContext context , Class < ? > type , RequestModel model , AmazonWebServiceRequest request , Object token ) throws InstantiationException , IllegalA... | if ( request == null ) { request = ( AmazonWebServiceRequest ) type . newInstance ( ) ; } request . getRequestClientOptions ( ) . appendUserAgent ( USER_AGENT ) ; for ( PathTargetMapping mapping : model . getIdentifierMappings ( ) ) { Object value = context . getIdentifier ( mapping . getSource ( ) ) ; if ( value == nu... |
public class Row { /** * Adds or overrides a column with a default destination
* @ param index the origin index
* @ param name a unique name of the column .
* @ param value
* @ return reference for method chaining */
public Row addColumn ( int index , String name , Object value ) { } } | Objects . requireNonNull ( name , "Name of the column cannot be null" ) ; Objects . requireNonNull ( value , "Value of " + name + " cannot be null" ) ; final Column column = new Column ( index , name , value ) ; return this . addColumn ( column ) ; |
public class ReplicationTrigger { /** * Re - sync the replica to the master . The primary keys of both entries are
* assumed to match .
* @ param listener optional
* @ param replicaEntry current replica entry , or null if none
* @ param masterEntry current master entry , or null if none
* @ param reload true ... | if ( replicaEntry == null && masterEntry == null ) { return ; } Log log = LogFactory . getLog ( ReplicatedRepository . class ) ; setReplicationDisabled ( ) ; try { Transaction masterTxn = mRepository . getMasterRepository ( ) . enterTransaction ( ) ; Transaction replicaTxn = mRepository . getReplicaRepository ( ) . ent... |
public class OrientedBox3f { /** * Set the center .
* @ param cx the center x .
* @ param cy the center y .
* @ param cz the center z . */
@ Override public void setCenter ( double cx , double cy , double cz ) { } } | this . center . set ( cx , cy , cz ) ; |
public class Config { /** * Check that the configuration is valid in terms of the * standard
* configuration * . This method is useful in the
* Pool implementation constructors .
* @ throws IllegalArgumentException If the size is less than one , if the
* { @ link Expiration } is ` null ` , if the { @ link Alloc... | if ( size < 1 ) { throw new IllegalArgumentException ( "Size must be at least 1, but was " + size ) ; } if ( allocator == null ) { throw new IllegalArgumentException ( "Allocator cannot be null" ) ; } if ( expiration == null ) { throw new IllegalArgumentException ( "Expiration cannot be null" ) ; } if ( threadFactory =... |
public class HttpResponseParser { /** * Parses a header value . This is called from the generated bytecode .
* @ param buffer The buffer
* @ param state The current state
* @ param builder The exchange builder
* @ return The number of bytes remaining */
@ SuppressWarnings ( "unused" ) final void handleHeaderVal... | StringBuilder stringBuilder = state . stringBuilder ; if ( stringBuilder == null ) { stringBuilder = new StringBuilder ( ) ; state . parseState = 0 ; } int parseState = state . parseState ; while ( buffer . hasRemaining ( ) ) { final byte next = buffer . get ( ) ; switch ( parseState ) { case NORMAL : { if ( next == '\... |
public class VisualStudioNETProjectWriter { /** * Get value of DebugInformationFormat property .
* @ param compilerConfig
* compiler configuration .
* @ return value of DebugInformationFormat property . */
private String getDebugInformationFormat ( final CommandLineCompilerConfiguration compilerConfig ) { } } | String format = "0" ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( "/Z7" . equals ( arg ) ) { format = "1" ; } if ( "/Zd" . equals ( arg ) ) { format = "2" ; } if ( "/Zi" . equals ( arg ) ) { format = "3" ; } if ( "/ZI" . equals ( arg ) ) { format = "4" ; } } ret... |
public class OIDCClientAuthenticatorUtil { /** * Perform OpenID Connect client authenticate for the given web request .
* Return an OidcAuthenticationResult which contains the status and subject
* A routine flow can come through here twice . First there ' s no state and it goes to handleRedirectToServer
* second ... | ProviderAuthenticationResult oidcResult = null ; if ( ! isEndpointValid ( clientConfig ) ) { return new ProviderAuthenticationResult ( AuthResult . SEND_401 , HttpServletResponse . SC_UNAUTHORIZED ) ; } boolean isImplicit = false ; if ( Constants . IMPLICIT . equals ( clientConfig . getGrantType ( ) ) ) { isImplicit = ... |
public class AbstractGenericRevisionedDao { /** * This method gets a historic revision of the { @ link net . sf . mmm . util . entity . api . GenericEntity } with the given
* < code > id < / code > .
* @ param id is the { @ link net . sf . mmm . util . entity . api . GenericEntity # getId ( ) ID } of the requested ... | Class < ? extends ENTITY > entityClassImplementation = getEntityClass ( ) ; ENTITY entity = getAuditReader ( ) . find ( entityClassImplementation , id , revision ) ; if ( entity != null ) { entity . setRevision ( revision ) ; } return entity ; |
public class Exceptions { /** * Prepare an unchecked { @ link RuntimeException } that will bubble upstream if thrown by an operator .
* @ param t the root cause
* @ return an unchecked exception that should choose bubbling up over error callback path . */
public static RuntimeException bubble ( Throwable t ) { } } | if ( t instanceof ExecutionException ) { return bubble ( t . getCause ( ) ) ; } if ( t instanceof TimeoutException ) { return new RedisCommandTimeoutException ( t ) ; } if ( t instanceof InterruptedException ) { Thread . currentThread ( ) . interrupt ( ) ; return new RedisCommandInterruptedException ( t ) ; } if ( t in... |
public class druidGParser { /** * druidG . g : 537:1 : hyperUniqueCardinality returns [ PostAggItem postAggItem ] : ( UNIQUE ( WS ) ? LPARAN ( WS ) ? a = ID ( WS ) ? RPARAN ) ; */
public final PostAggItem hyperUniqueCardinality ( ) throws RecognitionException { } } | PostAggItem postAggItem = null ; Token a = null ; postAggItem = new PostAggItem ( "hyperUniqueCardinality" ) ; try { // druidG . g : 539:2 : ( ( UNIQUE ( WS ) ? LPARAN ( WS ) ? a = ID ( WS ) ? RPARAN ) )
// druidG . g : 539:4 : ( UNIQUE ( WS ) ? LPARAN ( WS ) ? a = ID ( WS ) ? RPARAN )
{ // druidG . g : 539:4 : ( UNIQU... |
public class GetIdentityPoolRolesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetIdentityPoolRolesRequest getIdentityPoolRolesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getIdentityPoolRolesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getIdentityPoolRolesRequest . getIdentityPoolId ( ) , IDENTITYPOOLID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall... |
public class ServletLogContext { /** * Sets the user in the logging context
* @ param user The user */
public static void putUser ( final String user ) { } } | if ( ( user != null ) && ( 0 < user . length ( ) ) ) { MDC . put ( USER , user ) ; } |
public class ApiOvhXdsl { /** * Update and get advanced diagnostic of the line
* REST : POST / xdsl / { serviceName } / lines / { number } / diagnostic / run
* @ param actionsDone [ required ] Customer possible actions
* @ param answers [ required ] Customer answers for line diagnostic
* @ param faultType [ req... | String qPath = "/xdsl/{serviceName}/lines/{number}/diagnostic/run" ; StringBuilder sb = path ( qPath , serviceName , number ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "actionsDone" , actionsDone ) ; addBody ( o , "answers" , answers ) ; addBody ( o , "faultType" , faultType ... |
public class Base64Slow { /** * Decode Base64 encoded data from the InputStream to the OutputStream . Characters in the Base64
* alphabet , white space and equals sign are expected to be in url encoded data . The presence of
* other characters could be a sign that the data is corrupted .
* @ param in Stream from ... | // Base64 decoding converts four bytes of input to three bytes of output
int [ ] inBuffer = new int [ 4 ] ; // read bytes un - mapping them from their ASCII encoding in the process
// we must read at least two bytes to be able to output anything
boolean done = false ; while ( ! done && ( inBuffer [ 0 ] = readBase64 ( i... |
public class WebhookManager { /** * Methods for use with sns poller */
public void saveTaskUpdateForRetry ( SingularityTaskHistoryUpdate taskHistoryUpdate ) { } } | String parentPath = ZKPaths . makePath ( SNS_TASK_RETRY_ROOT , taskHistoryUpdate . getTaskId ( ) . getRequestId ( ) ) ; if ( ! isChildNodeCountSafe ( parentPath ) ) { LOG . warn ( "Too many queued webhooks for path {}, dropping" , parentPath ) ; return ; } String updatePath = ZKPaths . makePath ( SNS_TASK_RETRY_ROOT , ... |
public class Beta { /** * Incomplete fraction summation used in the method regularizedIncompleteBeta
* using a modified Lentz ' s method . */
private static double incompleteFractionSummation ( double alpha , double beta , double x ) { } } | final int MAXITER = 500 ; final double EPS = 3.0E-7 ; double aplusb = alpha + beta ; double aplus1 = alpha + 1.0 ; double aminus1 = alpha - 1.0 ; double c = 1.0 ; double d = 1.0 - aplusb * x / aplus1 ; if ( Math . abs ( d ) < FPMIN ) { d = FPMIN ; } d = 1.0 / d ; double h = d ; double aa = 0.0 ; double del = 0.0 ; int ... |
public class WebSocketConnectionManager { /** * Send JSON representation of given data object to all connections tagged with all give tag labels
* @ param data the data object
* @ param labels the tag labels */
public void sendJsonToTagged ( Object data , String ... labels ) { } } | for ( String label : labels ) { sendJsonToTagged ( data , label ) ; } |
public class AmazonEC2Client { /** * Describes your import snapshot tasks .
* @ param describeImportSnapshotTasksRequest
* Contains the parameters for DescribeImportSnapshotTasks .
* @ return Result of the DescribeImportSnapshotTasks operation returned by the service .
* @ sample AmazonEC2 . DescribeImportSnaps... | request = beforeClientExecution ( request ) ; return executeDescribeImportSnapshotTasks ( request ) ; |
public class DocumentSubscriptions { /** * Creates a data subscription in a database . The subscription will expose all documents that match the specified subscription options for a given type .
* @ param options Subscription options
* @ param clazz Document class
* @ param < T > Document class
* @ param databa... | options = ObjectUtils . firstNonNull ( options , new SubscriptionCreationOptions ( ) ) ; return create ( ensureCriteria ( options , clazz , false ) , database ) ; |
public class AWSLogsClient { /** * Deletes the specified destination , and eventually disables all the subscription filters that publish to it . This
* operation does not delete the physical resource encapsulated by the destination .
* @ param deleteDestinationRequest
* @ return Result of the DeleteDestination op... | request = beforeClientExecution ( request ) ; return executeDeleteDestination ( request ) ; |
public class MutableURI { /** * Set the value of the < code > MutableURI < / code > .
* < p > This method can also be used to clear the < code > MutableURI < / code > . < / p >
* @ param uriString the string to be parsed into a URI
* @ param encoded Flag indicating whether the string is
* already encoded . */
p... | if ( uriString == null ) { setScheme ( null ) ; setUserInfo ( null ) ; setHost ( null ) ; setPort ( UNDEFINED_PORT ) ; setPath ( null ) ; setQuery ( null ) ; setFragment ( null ) ; } else { URI uri = null ; if ( encoded ) { // Get ( parse ) the components using java . net . URI
uri = new URI ( uriString ) ; } else { //... |
public class QuotaRequestAggregator { /** * Clears this instances cache of aggregated operations .
* Is intended to be called by the driver before shutdown . */
public void clear ( ) { } } | if ( cache == null ) { return ; } synchronized ( cache ) { inFlushAll = true ; cache . invalidateAll ( ) ; out . clear ( ) ; inFlushAll = false ; } |
public class BaseDurationField { public int compareTo ( DurationField otherField ) { } } | long otherMillis = otherField . getUnitMillis ( ) ; long thisMillis = getUnitMillis ( ) ; // cannot do ( thisMillis - otherMillis ) as can overflow
if ( thisMillis == otherMillis ) { return 0 ; } if ( thisMillis < otherMillis ) { return - 1 ; } else { return 1 ; } |
public class TephraHBaseUtils { /** * Commits work done . */
@ Override public void commit ( ) throws DataCorruptedException , IOException , IllegalStateException { } } | try { this . txContext . finish ( ) ; } catch ( final TransactionFailureException tfe1 ) { try { this . txContext . abort ( ) ; } catch ( final TransactionFailureException tfe2 ) { } throw new IOException ( "Error trying to commit transaction." , tfe1 ) ; } |
public class RandomVariableAAD { /** * / * ( non - Javadoc )
* @ see net . finmath . stochastic . RandomVariable # pow ( double ) */
@ Override public RandomVariable pow ( double exponent ) { } } | return apply ( OperatorType . POW , new RandomVariable [ ] { this , constructNewAADRandomVariable ( exponent ) } ) ; |
public class DescribeVpnConnectionsResult { /** * Information about one or more VPN connections .
* @ param vpnConnections
* Information about one or more VPN connections . */
public void setVpnConnections ( java . util . Collection < VpnConnection > vpnConnections ) { } } | if ( vpnConnections == null ) { this . vpnConnections = null ; return ; } this . vpnConnections = new com . amazonaws . internal . SdkInternalList < VpnConnection > ( vpnConnections ) ; |
public class IfcPostalAddressImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) public EList < String > getAddressLines ( ) { } } | return ( EList < String > ) eGet ( Ifc2x3tc1Package . Literals . IFC_POSTAL_ADDRESS__ADDRESS_LINES , true ) ; |
public class RottenTomatoesApi { /** * Retrieves the current top DVD rentals
* @ param country Provides localized data for the selected country
* @ param limit Limits the number of opening movies returned
* @ return
* @ throws RottenTomatoesException */
public List < RTMovie > getTopRentals ( String country , i... | properties . clear ( ) ; properties . put ( ApiBuilder . PROPERTY_URL , URL_TOP_RENTALS ) ; properties . put ( ApiBuilder . PROPERTY_LIMIT , ApiBuilder . validateLimit ( limit ) ) ; properties . put ( ApiBuilder . PROPERTY_COUNTRY , ApiBuilder . validateCountry ( country ) ) ; WrapperLists wrapper = response . getRespo... |
public class CreateBotVersionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateBotVersionRequest createBotVersionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createBotVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createBotVersionRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createBotVersionRequest . getChecksum ( ) , CHECKSUM_BINDING ) ; } catch... |
public class OffsetPredicate { /** * Releases an offset from the segment .
* @ param offset The offset to release .
* @ return Indicates whether the offset was newly released . */
public boolean release ( long offset ) { } } | Assert . argNot ( offset < 0 , "offset must be positive" ) ; if ( bits . size ( ) <= offset ) { while ( bits . size ( ) <= offset ) { bits . resize ( bits . size ( ) * 2 ) ; } } return bits . set ( offset ) ; |
public class ContentType { /** * Returns the value of the charset parameter or < code > default < / code > if there is no charset parameter .
* @ return A { @ link String } containing the charset . */
public String getCharset ( String defaultCharset ) { } } | Parameter charsetParam = param ( PARAM_CHARSET ) ; return charsetParam == null || charsetParam . value . length ( ) == 0 ? defaultCharset : charsetParam . value ; |
public class IPAddressDivisionGrouping { /** * Returns the number of consecutive trailing one or zero bits .
* If network is true , returns the number of consecutive trailing zero bits .
* Otherwise , returns the number of consecutive trailing one bits .
* @ param network
* @ return */
public int getTrailingBit... | int count = getDivisionCount ( ) ; if ( count == 0 ) { return 0 ; } long back = network ? 0 : getDivision ( 0 ) . getMaxValue ( ) ; int bitLen = 0 ; for ( int i = count - 1 ; i >= 0 ; i -- ) { IPAddressDivision seg = getDivision ( i ) ; long value = seg . getDivisionValue ( ) ; if ( value != back ) { return bitLen + se... |
public class DefaultCommandRegistry { /** * { @ inheritDoc } */
public void registerCommand ( AbstractCommand command ) { } } | Assert . notNull ( command , "Command cannot be null." ) ; Assert . isTrue ( command . getId ( ) != null , "A command must have an identifier to be placed in a registry." ) ; Object previousCommand = this . commandMap . put ( command . getId ( ) , command ) ; if ( previousCommand != null && logger . isWarnEnabled ( ) )... |
public class SingleItemSubscriberStream { /** * { @ inheritDoc } */
public void receiveAudio ( boolean receive ) { } } | // check if engine currently receives audio , returns previous value
boolean receiveAudio = engine . receiveAudio ( receive ) ; if ( receiveAudio && ! receive ) { // send a blank audio packet to reset the player
engine . sendBlankAudio ( true ) ; } else if ( ! receiveAudio && receive ) { // do a seek
seekToCurrentPlayb... |
public class ConfigImpl { /** * @ Override public String [ ] getCFMLExtensions ( ) { return getAllExtensions ( ) ; }
* @ Override public String getCFCExtension ( ) { return getComponentExtension ( ) ; }
* @ Override public String [ ] getAllExtensions ( ) { return Constants . ALL _ EXTENSION ; }
* @ Override publi... | if ( dialect == CFMLEngine . DIALECT_CFML ) { cfmlFlds = flds ; combinedCFMLFLDs = null ; // TODO improve check ( hash )
} else { luceeFlds = flds ; combinedLuceeFLDs = null ; // TODO improve check ( hash )
} |
public class IPSImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setYpsOset ( Integer newYpsOset ) { } } | Integer oldYpsOset = ypsOset ; ypsOset = newYpsOset ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . IPS__YPS_OSET , oldYpsOset , ypsOset ) ) ; |
public class HeaderFooterRecyclerAdapter { /** * Notifies that multiple header items are inserted .
* @ param positionStart the position .
* @ param itemCount the item count . */
public final void notifyHeaderItemRangeInserted ( int positionStart , int itemCount ) { } } | int newHeaderItemCount = getHeaderItemCount ( ) ; if ( positionStart < 0 || itemCount < 0 || positionStart + itemCount > newHeaderItemCount ) { throw new IndexOutOfBoundsException ( "The given range [" + positionStart + " - " + ( positionStart + itemCount - 1 ) + "] is not within the position bounds for header items [0... |
public class OnDiskMatrix { /** * { @ inheritDoc } */
public double get ( int row , int col ) { } } | int region = getMatrixRegion ( row , col ) ; int regionOffset = getRegionOffset ( row , col ) ; return matrixRegions [ region ] . get ( regionOffset ) ; |
public class JMCollections { /** * Gets last .
* @ param < T > the type parameter
* @ param < L > the type parameter
* @ param list the list
* @ return the last */
public static < T , L extends List < T > > T getLast ( List < T > list ) { } } | return isNullOrEmpty ( list ) ? null : list . get ( list . size ( ) - 1 ) ; |
public class ExpressRouteCircuitAuthorizationsInner { /** * Gets all authorizations in an express route circuit .
* @ param resourceGroupName The name of the resource group .
* @ param circuitName The name of the circuit .
* @ param serviceCallback the async ServiceCallback to handle successful and failed respons... | return AzureServiceFuture . fromPageResponse ( listSinglePageAsync ( resourceGroupName , circuitName ) , new Func1 < String , Observable < ServiceResponse < Page < ExpressRouteCircuitAuthorizationInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ExpressRouteCircuitAuthorizationInner > > > call... |
public class BytesImpl { /** * adds bytes from the buffer */
@ Override public BytesImpl write ( byte [ ] buffer , int offset , int length ) { } } | while ( length > 0 ) { int sublen = Math . min ( _data . length - _head , length ) ; System . arraycopy ( buffer , offset , _data , _head , sublen ) ; if ( sublen <= 0 ) { throw new UnsupportedOperationException ( ) ; } length -= sublen ; offset += sublen ; _head += sublen ; } return this ; |
public class ValidatorProcessParameters { /** * Decide which of the command line arguments are keywords and which are
* values , and build a map to hold them . */
private Map < String , String > parseArgsIntoMap ( String [ ] args ) { } } | Map < String , String > parms = new HashMap < String , String > ( ) ; for ( int i = 0 ; i < args . length ; i ++ ) { String key = args [ i ] ; if ( ! isKeyword ( key ) ) { throw new ValidatorProcessUsageException ( "'" + key + "' is not a keyword." ) ; } if ( ! ALL_PARAMETERS . contains ( key ) ) { throw new ValidatorP... |
public class AbstractSqlBuilder { /** * 设置List类型参数 .
* @ param fieldName 参数名
* @ param value 参数值 */
public void setObject ( String fieldName , Object value ) { } } | if ( value == null ) { // list默认允许传入null
return ; } fieldList . add ( fieldName ) ; statementParameter . setObject ( value ) ; |
public class CreateVpcPeeringConnectionRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < CreateVpcPeeringConnectionRequest > getDryRunRequest ( ) { } } | Request < CreateVpcPeeringConnectionRequest > request = new CreateVpcPeeringConnectionRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class DomainXml_10 { /** * ManagamentXmlDelegate Methods */
@ Override public boolean parseSecurityRealms ( XMLExtendedStreamReader reader , ModelNode address , List < ModelNode > operationsList ) throws XMLStreamException { } } | throw unexpectedElement ( reader ) ; |
public class MSDelegatingXAResource { /** * Ends the association that this resource has with the passed transaction
* branch . Either temporarily via a TMSUSPEND or permanently via TMSUCCESS or
* TMFAIL .
* @ param xid The identifier of the global transaction to dis - associate from . This must
* match a value ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "end" , new Object [ ] { "XID=" + xid , _manager . xaFlagsToString ( flags ) } ) ; try { _manager . end ( new PersistentTranId ( xid ) , flags ) ; // Reset our instance variables .
_currentTran = null ; _currentPtid =... |
public class CPMeasurementUnitWrapper { /** * Returns the localized name of this cp measurement unit in the language , optionally using the default language if no localization exists for the requested language .
* @ param languageId the ID of the language
* @ param useDefault whether to use the default language if ... | return _cpMeasurementUnit . getName ( languageId , useDefault ) ; |
public class BaseLevel2 { /** * gbmv computes a matrix - vector product using a general band matrix and performs one of the following matrix - vector operations :
* y : = alpha * a * x + beta * y for trans = ' N ' or ' n ' ;
* y : = alpha * a ' * x + beta * y for trans = ' T ' or ' t ' ;
* y : = alpha * conjg ( a... | if ( Nd4j . getExecutioner ( ) . getProfilingMode ( ) == OpExecutioner . ProfilingMode . ALL ) OpProfiler . getInstance ( ) . processBlasCall ( false , A , X , Y ) ; // FIXME : int cast
if ( A . data ( ) . dataType ( ) == DataType . DOUBLE ) { DefaultOpExecutioner . validateDataType ( DataType . DOUBLE , A , X , Y ) ; ... |
public class Op { /** * Returns a string representation of the given value
* @ tparam T determines the class type of the value
* @ param x is the value
* @ return a string representation of the given value */
public static < T extends Number > String str ( T x ) { } } | return str ( x , FuzzyLite . getFormatter ( ) ) ; |
public class ObjectInputStream { /** * Registers a callback for post - deserialization validation of objects . It
* allows to perform additional consistency checks before the { @ code
* readObject ( ) } method of this class returns its result to the caller . This
* method can only be called from within the { @ co... | // Validation can only be registered when inside readObject calls
Object instanceBeingRead = this . currentObject ; if ( instanceBeingRead == null && nestedLevels == 0 ) { throw new NotActiveException ( ) ; } if ( object == null ) { throw new InvalidObjectException ( "Callback object cannot be null" ) ; } // From now o... |
public class Merge { /** * Merge two sorted list into a bigger list in ascending order . This routine runs in O ( n ) time .
* @ param < E > the type of elements in this list .
* @ param list list with two sorted sub arrays that will be merged
* @ param start index of the starting point of the left list
* @ par... | List < E > temp = new LinkedList < > ( ) ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { temp . add ( list . get ( i ) ) ; } int left = start ; int right = middle + 1 ; int current = start ; while ( left <= middle && right <= end ) { list . remove ( current ) ; if ( temp . get ( left ) . compareTo ( temp . get ( rig... |
public class FeatureLinkingCandidate { /** * / * @ Nullable */
protected LightweightTypeReference getReceiverType ( ) { } } | if ( isStatic ( ) ) return null ; LightweightTypeReference result ; if ( getImplicitReceiver ( ) != null ) result = getImplicitReceiverType ( ) ; else result = getSyntacticReceiverType ( ) ; return result ; |
public class InputExcelDataProvider { /** * { @ inheritDoc } */
@ Override public void prepare ( String scenario ) throws TechnicalException { } } | scenarioName = scenario ; try { openInputData ( ) ; initColumns ( ) ; } catch ( EmptyDataFileContentException | WrongDataFileFormatException e ) { logger . error ( Messages . getMessage ( TechnicalException . TECHNICAL_ERROR_MESSAGE_DATA_IOEXCEPTION ) , e ) ; System . exit ( - 1 ) ; } |
public class Cob2Xsd { /** * Remove any non COBOL Structure characters from the source .
* @ param cobolReader reads the raw COBOL source
* @ return a cleaned up source
* @ throws CleanerException if source cannot be read */
public String clean ( final Reader cobolReader ) throws CleanerException { } } | if ( _log . isDebugEnabled ( ) ) { _log . debug ( "1. Cleaning COBOL source code" ) ; } switch ( getConfig ( ) . getCodeFormat ( ) ) { case FIXED_FORMAT : CobolFixedFormatSourceCleaner fixedCleaner = new CobolFixedFormatSourceCleaner ( getErrorHandler ( ) , getConfig ( ) . getStartColumn ( ) , getConfig ( ) . getEndCol... |
public class SelectionCriteria { /** * Sets the alias . By default the entire attribute path participates in the alias
* @ param alias The name of the alias to set */
public void setAlias ( String alias ) { } } | m_alias = alias ; String attributePath = ( String ) getAttribute ( ) ; boolean allPathsAliased = true ; m_userAlias = new UserAlias ( alias , attributePath , allPathsAliased ) ; |
public class TermsByQueryRequest { /** * The query source to execute . */
public TermsByQueryRequest query ( XContentBuilder builder ) { } } | this . querySource = builder == null ? null : builder . bytes ( ) ; return this ; |
public class Index { /** * Wait the publication of a task on the server .
* All server task are asynchronous and you can check with this method that the task is published .
* @ param taskID the id of the task returned by server
* @ param timeToWait time to sleep seed */
public void waitTask ( String taskID , long... | this . waitTask ( taskID , timeToWait , RequestOptions . empty ) ; |
public class SessionMgrComponentImpl { /** * Derives a unique identifier for the current server .
* The result of this method is used to create a cloneId .
* @ return a unique identifier for the current server ( in lower case ) */
private String getServerId ( ) { } } | UUID fullServerId = null ; WsLocationAdmin locationService = this . wsLocationAdmin ; if ( locationService != null ) { fullServerId = locationService . getServerId ( ) ; } if ( fullServerId == null ) { fullServerId = UUID . randomUUID ( ) ; // shouldn ' t get here , but be careful just in case
} return fullServerId . t... |
public class CleverTapAPI { /** * PN */
private void handlePushNotificationsInResponse ( JSONArray pushNotifications ) { } } | try { for ( int i = 0 ; i < pushNotifications . length ( ) ; i ++ ) { Bundle pushBundle = new Bundle ( ) ; JSONObject pushObject = pushNotifications . getJSONObject ( i ) ; if ( pushObject . has ( "wzrk_acct_id" ) ) pushBundle . putString ( "wzrk_acct_id" , pushObject . getString ( "wzrk_acct_id" ) ) ; if ( pushObject ... |
public class CmsSecurityManager { /** * Copies a resource to the current project of the user . < p >
* @ param context the current request context
* @ param resource the resource to apply this operation to
* @ throws CmsException if something goes wrong
* @ throws CmsRoleViolationException if the current user d... | CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; try { checkOfflineProject ( dbc ) ; checkManagerOfProjectRole ( dbc , context . getCurrentProject ( ) ) ; m_driverManager . copyResourceToProject ( dbc , resource ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messa... |
public class AbstractNumber { /** * This method is used in constructor that takes byte [ ] or ByteArrayInputStream as parameter . Decodes header part ( its 1 or
* 2 bytes usually . ) Default implemetnation decodes header of one byte - where most significant bit is O / E indicator and
* bits 7-1 are NAI . This metho... | if ( bis . available ( ) == 0 ) { throw new ParameterException ( "No more data to read." ) ; } int b = bis . read ( ) & 0xff ; this . oddFlag = ( b & 0x80 ) >> 7 ; return 1 ; |
public class ConnectionService { /** * Retrieves the connection history records matching the given criteria .
* Retrieves up to < code > limit < / code > connection history records matching
* the given terms and sorted by the given predicates . Only history records
* associated with data that the given user can r... | List < ConnectionRecordModel > searchResults ; // Bypass permission checks if the user is a system admin
if ( user . getUser ( ) . isAdministrator ( ) ) searchResults = connectionRecordMapper . search ( requiredContents , sortPredicates , limit ) ; // Otherwise only return explicitly readable history records
else searc... |
public class ReactionSetManipulator { /** * Gets a reaction from a ReactionSet by ID . If several exist ,
* only the first one will be returned .
* @ param reactionSet The reactionSet to search in
* @ param id The id to search for .
* @ return The Reaction or null ; */
public static IReaction getReactionByReact... | Iterable < IReaction > reactionIter = reactionSet . reactions ( ) ; for ( IReaction reaction : reactionIter ) { if ( reaction . getID ( ) != null && reaction . getID ( ) . equals ( id ) ) { return reaction ; } } return null ; |
public class JdonPicoContainer { /** * Returns the first current monitor found in the ComponentAdapterFactory ,
* the component adapters and the child containers , if these support a
* ComponentMonitorStrategy . { @ inheritDoc }
* @ throws PicoIntrospectionException
* if no component monitor is found in contain... | if ( componentAdapterFactory instanceof ComponentMonitorStrategy ) { return ( ( ComponentMonitorStrategy ) componentAdapterFactory ) . currentMonitor ( ) ; } for ( Iterator i = compAdapters . iterator ( ) ; i . hasNext ( ) ; ) { Object adapter = i . next ( ) ; if ( adapter instanceof ComponentMonitorStrategy ) { return... |
public class WebSocketContext { /** * Send JSON representation of a data object to all connections connected to
* the same URL of this context with the connection of this context excluded
* @ param data the data to be sent
* @ param excludeSelf whether it should send to the connection of this context
* @ return... | return sendToPeers ( JSON . toJSONString ( data ) , excludeSelf ) ; |
public class Window { /** * End waiting for a pending offer to be accepted . Decrements pendingOffers by 1.
* If " pendingOffersAborted " is true and pendingOffers reaches 0 then
* pendingOffersAborted will be reset to false .
* @ return True if a pending offer should be aborted . False if a pending
* offer can... | int newValue = this . pendingOffers . decrementAndGet ( ) ; // if newValue reaches zero , make sure to always reset " offeringAborted "
if ( newValue == 0 ) { // if slotWaitingCanceled was true , then reset it back to false , and
// return true to make sure the caller knows to cancel waiting
return this . pendingOffers... |
public class SegmentGroupListMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SegmentGroupList segmentGroupList , ProtocolMarshaller protocolMarshaller ) { } } | if ( segmentGroupList == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( segmentGroupList . getGroups ( ) , GROUPS_BINDING ) ; protocolMarshaller . marshall ( segmentGroupList . getInclude ( ) , INCLUDE_BINDING ) ; } catch ( Exception e ) { ... |
public class RestUtils { /** * Update response as JSON .
* @ param object object to validate and update
* @ param is entity input stream
* @ param app the app object
* @ return a status code 200 or 400 or 404 */
public static Response getUpdateResponse ( App app , ParaObject object , InputStream is ) { } } | try ( final Metrics . Context context = Metrics . time ( app == null ? null : app . getAppid ( ) , RestUtils . class , "crud" , "update" ) ) { if ( app != null && object != null ) { Map < String , Object > newContent ; Response entityRes = getEntity ( is , Map . class ) ; String [ ] errors = { } ; if ( entityRes . getS... |
public class ObjectMetaData { /** * 获取需要发送的报文长度
* @ param bean
* @ param charset
* @ return
* @ throws NoSuchMethodException
* @ throws InvocationTargetException
* @ throws IllegalAccessException */
public int getFieldsSendTotalByteSize ( Object bean , Charset charset ) { } } | if ( ! hasDynamicField ( ) ) { return fieldsTotalSize ; } else { return getDynamicTotalFieldSize ( bean , charset ) ; } |
public class UnusedPrivateFieldCheck { /** * VJ : copy from MethodsHelper */
public static IdentifierTree methodName ( MethodInvocationTree mit ) { } } | IdentifierTree id ; if ( mit . methodSelect ( ) . is ( Tree . Kind . IDENTIFIER ) ) { id = ( IdentifierTree ) mit . methodSelect ( ) ; } else { id = ( ( MemberSelectExpressionTree ) mit . methodSelect ( ) ) . identifier ( ) ; } return id ; |
public class PoolsImpl { /** * Disables automatic scaling for a pool .
* @ param poolId The ID of the pool on which to disable automatic scaling .
* @ param poolDisableAutoScaleOptions Additional parameters for the operation
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws... | disableAutoScaleWithServiceResponseAsync ( poolId , poolDisableAutoScaleOptions ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class PromptX509TrustManager { /** * This method is used to create a " SHA - 1 " or " MD5 " digest on an
* X509Certificate as the " fingerprint " .
* @ param algorithmName
* @ param cert
* @ return String */
private String generateDigest ( String algorithmName , X509Certificate cert ) { } } | try { MessageDigest md = MessageDigest . getInstance ( algorithmName ) ; md . update ( cert . getEncoded ( ) ) ; byte data [ ] = md . digest ( ) ; StringBuilder buffer = new StringBuilder ( 3 * data . length ) ; int i = 0 ; buffer . append ( HEX_CHARS [ ( data [ i ] >> 4 ) & 0xF ] ) ; buffer . append ( HEX_CHARS [ ( da... |
public class Utils { /** * Returns true if { @ code element } is a { @ link Class } type . */
static boolean isClassType ( Element element , Elements elements , Types types ) { } } | TypeMirror classType = types . getDeclaredType ( elements . getTypeElement ( Class . class . getName ( ) ) , types . getWildcardType ( null , null ) ) ; return types . isAssignable ( element . asType ( ) , classType ) ; |
public class HBCIMsgStatus { /** * Gibt zurück , ob der Fehler " PIN ungültig " zurückgemeldet wurde
* @ return invalid pin code */
public String getInvalidPinCode ( ) { } } | for ( HBCIRetVal hbciRetVal : globStatus . getErrors ( ) ) { if ( invalidPinCodes . contains ( hbciRetVal . code ) ) { return hbciRetVal . code ; } } for ( HBCIRetVal hbciRetVal : segStatus . getErrors ( ) ) { if ( invalidPinCodes . contains ( hbciRetVal . code ) ) { return hbciRetVal . code ; } } return null ; |
public class InterfaceMetricImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < MethodMetric > getMethods ( ) { } } | return ( EList < MethodMetric > ) eGet ( StorePackage . Literals . INTERFACE_METRIC__METHODS , true ) ; |
public class View { /** * Deletes the view , persistently .
* NOTE : It should be - ( void ) deleteView ; */
@ InterfaceAudience . Public public void delete ( ) { } } | if ( viewStore != null ) viewStore . deleteView ( ) ; if ( database != null && name != null ) database . forgetView ( name ) ; close ( ) ; |
public class Latency { /** * Copy the current immutable object by setting a value for the { @ link AbstractLatency # getMin ( ) min } attribute .
* A value equality check is used to prevent copying of the same value by returning { @ code this } .
* @ param value A new value for min
* @ return A modified copy of t... | if ( this . min == value ) return this ; long newValue = value ; return new Latency ( this . median , this . percentile98th , this . percentile99th , this . percentile999th , this . mean , newValue , this . max ) ; |
public class MessageProcessor { /** * Create this message processor ' s persistent store . */
private void createPersistentStore ( ) throws MessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createPersistentStore" ) ; _persistentStore = new MessageProcessorStore ( new SIBUuid8 ( _engine . getUuid ( ) ) , _msgStore , _txManager ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr ... |
public class ServerSentEventConnection { /** * Sets the keep alive time in milliseconds . If this is larger than zero a ' : ' message will be sent this often
* ( assuming there is no activity ) to keep the connection alive .
* The spec recommends a value of 15000 ( 15 seconds ) .
* @ param keepAliveTime The time ... | this . keepAliveTime = keepAliveTime ; if ( this . timerKey != null ) { this . timerKey . remove ( ) ; } this . timerKey = sink . getIoThread ( ) . executeAtInterval ( new Runnable ( ) { @ Override public void run ( ) { if ( shutdown || open == 0 ) { if ( timerKey != null ) { timerKey . remove ( ) ; } return ; } if ( p... |
public class AbstractLayoutManager { /** * Creates a JasperReport DesignTextField from a DynamicJasper AbstractColumn .
* @ param col
* @ param height
* @ param group
* @ return JRDesignTextField */
protected JRDesignTextField generateTextFieldFromColumn ( AbstractColumn col , int height , DJGroup group ) { } } | JRDesignTextField textField = new JRDesignTextField ( ) ; JRDesignExpression exp = new JRDesignExpression ( ) ; if ( col . getPattern ( ) != null && "" . equals ( col . getPattern ( ) . trim ( ) ) ) { textField . setPattern ( col . getPattern ( ) ) ; } if ( col . getTruncateSuffix ( ) != null ) { textField . getPropert... |
public class FlashOverlayCreative { /** * Gets the apiFramework value for this FlashOverlayCreative .
* @ return apiFramework * The API framework of the asset . This attribute is optional . */
public com . google . api . ads . admanager . axis . v201811 . ApiFramework getApiFramework ( ) { } } | return apiFramework ; |
public class Angle { /** * The difference between two angles
* @ param a1
* @ param a2
* @ return New Angle representing the difference */
public static final Angle difference ( Angle a1 , Angle a2 ) { } } | return new Angle ( normalizeToHalfAngle ( angleDiff ( a1 . value , a2 . value ) ) ) ; |
public class CustomField { /** * Sets the dataType value for this CustomField .
* @ param dataType * The type of data this custom field contains . This attribute
* is read - only
* if there exists a { @ link CustomFieldValue } for this
* field . */
public void setDataType ( com . google . api . ads . admanager ... | this . dataType = dataType ; |
public class VTimezone { /** * Sets an ID for this timezone . This is a < b > required < / b > property .
* @ param timezoneId the timezone ID or null to remove
* @ return the property that was created
* @ see < a href = " http : / / tools . ietf . org / html / rfc5545 # page - 102 " > RFC 5545
* p . 102-3 < / ... | TimezoneId prop = ( timezoneId == null ) ? null : new TimezoneId ( timezoneId ) ; setTimezoneId ( prop ) ; return prop ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.