signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DependentHostedNumberOrderReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return DependentHostedNumberOrder ResourceSet */
@ Override public ResourceSet < DependentHostedNumberOrder > read ( final TwilioRestCli... | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class Matchers { /** * Matches an AST node that represents a local variable or parameter . */
public static Matcher < ExpressionTree > isVariable ( ) { } } | return new Matcher < ExpressionTree > ( ) { @ Override public boolean matches ( ExpressionTree expressionTree , VisitorState state ) { Symbol symbol = ASTHelpers . getSymbol ( expressionTree ) ; if ( symbol == null ) { return false ; } return symbol . getKind ( ) == ElementKind . LOCAL_VARIABLE || symbol . getKind ( ) ... |
public class TransportFactory { /** * Primary transport getting method . Tries to connect and test UDP Transport .
* If UDP failed , tries TCP transport . If it fails , too , throws IOException
* @ param addr
* @ return Transport instance
* @ throws IOException */
public static Transport getTransport ( SocketAd... | Transport trans ; try { log . debug ( "Connecting TCP" ) ; trans = TCPInstance ( addr ) ; if ( ! trans . test ( ) ) { throw new IOException ( "Agent is unreachable via TCP" ) ; } return trans ; } catch ( IOException e ) { log . info ( "Can't connect TCP transport for host: " + addr . toString ( ) , e ) ; try { log . de... |
public class RecyclerView { /** * Focus handling */
@ Override public View focusSearch ( View focused , int direction ) { } } | View result = mLayout . onInterceptFocusSearch ( focused , direction ) ; if ( result != null ) { return result ; } final FocusFinder ff = FocusFinder . getInstance ( ) ; result = ff . findNextFocus ( this , focused , direction ) ; if ( result == null && mAdapter != null ) { eatRequestLayout ( ) ; result = mLayout . onF... |
public class ModelsImpl { /** * Adds an entity extractor to the application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param addEntityOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException throw... | return addEntityWithServiceResponseAsync ( appId , versionId , addEntityOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SeleniumDriverFixture { /** * < p > < code >
* | start browser | < i > firefox < / i > | on url | < i > http : / / localhost < / i > |
* < / code > < / p >
* @ param browser
* @ param browserUrl */
public void startBrowserOnUrl ( final String browser , final String browserUrl ) { } } | setBrowser ( browser ) ; startDriverOnUrl ( defaultWebDriverInstance ( ) , browserUrl ) ; |
public class DoCopy { /** * helper method of copy ( ) recursively copies the FOLDER at source path to destination path
* @ param transaction indicates that the method is within the scope of a WebDAV transaction
* @ param sourcePath where to read
* @ param destinationPath where to write
* @ param errorList all e... | store . createFolder ( transaction , destinationPath ) ; boolean infiniteDepth = true ; String depth = req . getHeader ( "Depth" ) ; if ( depth != null ) { if ( depth . equals ( "0" ) ) { infiniteDepth = false ; } } if ( infiniteDepth ) { String [ ] children = store . getChildrenNames ( transaction , sourcePath ) ; chi... |
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1114:1 : constantExpression : expression ; */
public final void constantExpression ( ) throws RecognitionException { } } | int constantExpression_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 107 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1115:5 : ( expression )
// src / main / resources / org / drools / compiler / seman... |
public class SecondsBasedEntryTaskScheduler { /** * package private for testing */
static int findRelativeSecond ( long delayMillis ) { } } | long now = Clock . currentTimeMillis ( ) ; long d = ( now + delayMillis - INITIAL_TIME_MILLIS ) ; return ceilToSecond ( d ) ; |
public class L3ToSBGNPDConverter { /** * Creates a glyph for the complex member .
* @ param pe PhysicalEntity to represent as complex member
* @ param container Glyph for the complex shell */
private Glyph createComplexMember ( PhysicalEntity pe , Glyph container ) { } } | Glyph g = createGlyphBasics ( pe , false ) ; container . getGlyph ( ) . add ( g ) ; // A PhysicalEntity may appear in many complexes - - we identify the member using its complex
g . setId ( g . getId ( ) + "_" + ModelUtils . md5hex ( container . getId ( ) ) ) ; glyphMap . put ( g . getId ( ) , g ) ; Set < String > uris... |
public class RequestContext { /** * Renders with { " code " : int } .
* @ param code the specified code
* @ return this context */
public RequestContext renderCode ( final int code ) { } } | if ( renderer instanceof JsonRenderer ) { final JsonRenderer r = ( JsonRenderer ) renderer ; final JSONObject ret = r . getJSONObject ( ) ; ret . put ( Keys . CODE , code ) ; } return this ; |
public class JdbcDatabaseMetaDataGenerator { /** * Integer [ 0 ] is the column size and Integer [ 1 ] is the radix */
private Integer [ ] getParamPrecisionAndRadix ( ProcParameter param ) { } } | VoltType type = VoltType . get ( ( byte ) param . getType ( ) ) ; return type . getTypePrecisionAndRadix ( ) ; |
public class SQLiteSession { /** * Begins a transaction .
* Transactions may nest . If the transaction is not in progress ,
* then a database connection is obtained and a new transaction is started .
* Otherwise , a nested transaction is started .
* < / p > < p >
* Each call to { @ link # beginTransaction } m... | throwIfTransactionMarkedSuccessful ( ) ; beginTransactionUnchecked ( transactionMode , transactionListener , connectionFlags , cancellationSignal ) ; |
public class BuilderFactory { /** * Return the builder for the class .
* @ param typeElement the class being documented .
* @ param prevClass the previous class that was documented .
* @ param nextClass the next class being documented .
* @ param classTree the class tree .
* @ return the writer for the class ... | return ClassBuilder . getInstance ( context , typeElement , writerFactory . getClassWriter ( typeElement , prevClass , nextClass , classTree ) ) ; |
public class XMeans { /** * Split an existing centroid into two initial centers .
* @ param parentCluster Existing cluster
* @ param relation Data relation
* @ return List of new centroids */
protected double [ ] [ ] splitCentroid ( Cluster < ? extends MeanModel > parentCluster , Relation < V > relation ) { } } | double [ ] parentCentroid = parentCluster . getModel ( ) . getMean ( ) ; // Compute size of cluster / region
double radius = 0. ; for ( DBIDIter it = parentCluster . getIDs ( ) . iter ( ) ; it . valid ( ) ; it . advance ( ) ) { double d = getDistanceFunction ( ) . distance ( relation . get ( it ) , DoubleVector . wrap ... |
public class HttpHealthCheckClient { /** * Deletes the specified HttpHealthCheck resource .
* < p > Sample code :
* < pre > < code >
* try ( HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient . create ( ) ) {
* ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName ... | DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest . newBuilder ( ) . setHttpHealthCheck ( httpHealthCheck ) . build ( ) ; return deleteHttpHealthCheck ( request ) ; |
public class StringHelper { /** * Cross between { @ link # collapse } and { @ link # partiallyUnqualify } . Functions much like { @ link # collapse }
* except that only the qualifierBase is collapsed . For example , with a base of ' org . hibernate ' the name
* ' org . hibernate . internal . util . StringHelper ' w... | if ( name == null || ! name . startsWith ( qualifierBase ) ) { return collapse ( name ) ; } return collapseQualifier ( qualifierBase , true ) + name . substring ( qualifierBase . length ( ) ) ; |
public class ThroughputInfo { /** * 对应size的数据统计平均值 */
public Long getQuantity ( ) { } } | Long quantity = 0L ; if ( items . size ( ) != 0 ) { for ( ThroughputStat item : items ) { if ( item . getEndTime ( ) . equals ( item . getStartTime ( ) ) ) { quantity += item . getSize ( ) ; } else { quantity += item . getSize ( ) * 1000 / ( item . getEndTime ( ) . getTime ( ) - item . getStartTime ( ) . getTime ( ) ) ... |
public class FactoryVisualOdometry { /** * Creates a stereo visual odometry algorithm that independently tracks features in left and right camera .
* @ see VisOdomDualTrackPnP
* @ param thresholdAdd When the number of inliers is below this number new features are detected
* @ param thresholdRetire When a feature ... | EstimateNofPnP pnp = FactoryMultiView . pnp_N ( EnumPNP . P3P_FINSTERWALDER , - 1 ) ; DistanceFromModelMultiView < Se3_F64 , Point2D3D > distanceMono = new PnPDistanceReprojectionSq ( ) ; PnPStereoDistanceReprojectionSq distanceStereo = new PnPStereoDistanceReprojectionSq ( ) ; PnPStereoEstimator pnpStereo = new PnPSte... |
public class ThriftClientPool { /** * get a client from pool
* @ return
* @ throws ThriftException
* @ throws NoBackendServiceException if
* { @ link PoolConfig # setFailover ( boolean ) } is set and no
* service can connect to
* @ throws ConnectionFailException if
* { @ link PoolConfig # setFailover ( bo... | try { return pool . borrowObject ( ) ; } catch ( Exception e ) { if ( e instanceof ThriftException ) { throw ( ThriftException ) e ; } throw new ThriftException ( "Get client from pool failed." , e ) ; } |
public class CProductUtil { /** * Removes the c product with the primary key from the database . Also notifies the appropriate model listeners .
* @ param CProductId the primary key of the c product
* @ return the c product that was removed
* @ throws NoSuchCProductException if a c product with the primary key co... | return getPersistence ( ) . remove ( CProductId ) ; |
public class PortableNavigatorContext { /** * Populates the context with multi - positions that have to be processed later on in the navigation process .
* The contract is that the cell [ 0 ] path is read in the non - multi - position navigation .
* Cells [ 1 , len - 1 ] are stored in the multi - positions and will... | // populate " recursive " multi - positions
if ( multiPositions == null ) { // lazy - init only if necessary
multiPositions = new ArrayDeque < NavigationFrame > ( ) ; } for ( int cellIndex = len - 1 ; cellIndex > 0 ; cellIndex -- ) { multiPositions . addFirst ( new NavigationFrame ( cd , pathTokenIndex , cellIndex , in... |
public class EJBModuleMetaDataImpl { /** * Gets the application exception status of the specified exception class
* from either the deployment descriptor or from the annotation .
* @ param klass is the Throwable class
* @ return the settings , or null if no application - exception was provided
* for the specifi... | ApplicationException result = null ; if ( ivApplicationExceptionMap != null ) { result = ivApplicationExceptionMap . get ( klass . getName ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) && result != null ) { Tr . debug ( tc , "found application-exception for " + klass . getName ( ) + "... |
public class HlpEntitiesPage { /** * < p > Make SQL WHERE clause for enum if need . < / p >
* @ param pSbWhere result clause
* @ param pRequestData - Request Data
* @ param pEntityClass - entity class
* @ param pFldNm - field name
* @ param pFilterMap - map to store current filter
* @ param pFilterAppearanc... | String nmRnd = pRequestData . getParameter ( "nmRnd" ) ; String fltOrdPrefix ; if ( nmRnd . contains ( "pickerDub" ) ) { fltOrdPrefix = "fltordPD" ; } else if ( nmRnd . contains ( "picker" ) ) { fltOrdPrefix = "fltordP" ; } else { fltOrdPrefix = "fltordM" ; } String fltforcedName = fltOrdPrefix + "forcedFor" ; String f... |
public class AWSBudgetsClient { /** * Creates a subscriber . You must create the associated budget and notification before you create the subscriber .
* @ param createSubscriberRequest
* Request of CreateSubscriber
* @ return Result of the CreateSubscriber operation returned by the service .
* @ throws Internal... | request = beforeClientExecution ( request ) ; return executeCreateSubscriber ( request ) ; |
public class WSKeyStore { /** * Print a warning about a certificate being expired or soon to be expired in
* the keystore .
* @ param daysBeforeExpireWarning
* @ param keyStoreName
* @ param alias
* @ param cert */
public void printWarning ( int daysBeforeExpireWarning , String keyStoreName , String alias , X... | try { long millisDelta = ( ( ( ( daysBeforeExpireWarning * 24L ) * 60L ) * 60L ) * 1000L ) ; long millisBeforeExpiration = cert . getNotAfter ( ) . getTime ( ) - System . currentTimeMillis ( ) ; long daysLeft = ( ( ( ( millisBeforeExpiration / 1000L ) / 60L ) / 60L ) / 24L ) ; // cert is already expired
if ( millisBefo... |
public class CmsFlexCache { /** * Copies the key set of a map while synchronizing on the map . < p >
* @ param map the map whose key set should be copied
* @ return the copied key set */
private static < K , V > Set < K > synchronizedCopyKeys ( Map < K , V > map ) { } } | if ( map == null ) { return new HashSet < K > ( ) ; } synchronized ( map ) { return new HashSet < K > ( map . keySet ( ) ) ; } |
public class AdapterUtil { /** * Display the javax . xa . XAResource Resource Manager vote constant corresponding to the
* value supplied .
* @ param level a valid javax . xa . XAResource vote constant .
* @ return the name of the constant , or a string indicating the constant is unknown . */
public static String... | switch ( vote ) { case XAResource . XA_OK : return "XA_OK (" + vote + ')' ; case XAResource . XA_RDONLY : return "XA_RDONLY (" + vote + ')' ; } return "UNKNOWN XA RESOURCE VOTE (" + vote + ')' ; |
public class SQLTable { /** * Method to initialize the Cache of this CacheObjectInterface .
* @ param _ class Clas that started the initialization */
public static void initialize ( final Class < ? > _class ) { } } | if ( InfinispanCache . get ( ) . exists ( SQLTable . UUIDCACHE ) ) { InfinispanCache . get ( ) . < UUID , SQLTable > getCache ( SQLTable . UUIDCACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < UUID , SQLTable > getCache ( SQLTable . UUIDCACHE ) . addListener ( new CacheLogListener ( SQLTable . LOG ) ) ; } if... |
public class ZipFileIndex { /** * Tests if a specific path exists in the zip . This method will return true
* for file entries and directories .
* @ param path A path within the zip .
* @ return True if the path is a file or dir , false otherwise . */
public synchronized boolean contains ( RelativePath path ) { }... | try { checkIndex ( ) ; return getZipIndexEntry ( path ) != null ; } catch ( IOException e ) { return false ; } |
public class RString { /** * they can be used again . */
public void clear ( ) { } } | for ( Placeholder p : _placeholders . values ( ) ) { p . start . removeTill ( p . end ) ; } |
public class DocEnv { /** * Create a FieldDoc for a var symbol . */
protected void makeFieldDoc ( VarSymbol var , TreePath treePath ) { } } | FieldDocImpl result = fieldMap . get ( var ) ; if ( result != null ) { if ( treePath != null ) result . setTreePath ( treePath ) ; } else { result = new FieldDocImpl ( this , var , treePath ) ; fieldMap . put ( var , result ) ; } |
public class AbstractIoBufferEx { /** * { @ inheritDoc } */
@ Override public AbstractIoBufferEx putEnumInt ( int index , Enum < ? > e ) { } } | return putInt ( index , e . ordinal ( ) ) ; |
public class AbstractConsoleEditor { /** * Starts the editor .
* This methods actually creates the { @ link Reader } . */
public void start ( ) { } } | running = true ; try { init ( ) ; show ( ) ; while ( running ) { EditorOperation operation = readOperation ( ) ; if ( operation != null ) { Command cmd = create ( operation ) ; onCommand ( cmd ) ; } else { break ; } } } catch ( Exception e ) { // noop .
} |
public class DecodedHttpRequest { /** * Aborts the { @ link HttpResponse } which responds to this request if it exists .
* @ see Http2RequestDecoder # onRstStreamRead ( ChannelHandlerContext , int , long ) */
void abortResponse ( Throwable cause ) { } } | isResponseAborted = true ; // Try to close the request first , then abort the response if it is already closed .
if ( ! tryClose ( cause ) && response != null && ! response . isComplete ( ) ) { response . abort ( ) ; } |
public class KeyValueStoreSessionManager { @ Override protected Object save ( final NoSqlSession session , final Object version , final boolean activateAfterSave ) { } } | try { log . debug ( "save:" + session ) ; session . willPassivate ( ) ; if ( ! session . isValid ( ) ) { log . debug ( "save: skip saving invalidated session: id=" + session . getId ( ) ) ; deleteKey ( session . getId ( ) ) ; return null ; } ISerializableSession data ; synchronized ( session ) { data = getSessionFactor... |
public class GodHandableAction { protected ActionResponse actuallyExecute ( OptionalThing < VirtualForm > optForm , ActionHook hook ) { } } | showAction ( runtime ) ; final Object [ ] requestArgs = toRequestArgs ( optForm ) ; final Object result = invokeExecuteMethod ( execute . getExecuteMethod ( ) , requestArgs ) ; // # to _ action
redCardableAssist . assertExecuteReturnNotNull ( requestArgs , result ) ; redCardableAssist . assertExecuteMethodReturnTypeAct... |
public class Asm { /** * Create dword ( 4 Bytes ) pointer operand . */
public static final Mem dword_ptr ( Label label , Register index , int shift , long disp ) { } } | return _ptr_build ( label , index , shift , disp , SIZE_DWORD ) ; |
public class ZookeeperConfigGroup { /** * 加载节点并监听节点变化 */
void loadNode ( ) { } } | final String nodePath = ZKPaths . makePath ( configProfile . getVersionedRootNode ( ) , node ) ; final GetChildrenBuilder childrenBuilder = client . getChildren ( ) ; try { final List < String > children = childrenBuilder . watched ( ) . forPath ( nodePath ) ; if ( children != null ) { final Map < String , String > con... |
public class CmsRole { /** * Returns a role violation exception configured with a localized , role specific message
* for this role . < p >
* @ param requestContext the current users OpenCms request context
* @ param orgUnitFqn the organizational unit used for the role check , it may be < code > null < / code >
... | return new CmsRoleViolationException ( Messages . get ( ) . container ( Messages . ERR_USER_NOT_IN_ROLE_FOR_ORGUNIT_3 , requestContext . getCurrentUser ( ) . getName ( ) , getName ( requestContext . getLocale ( ) ) , orgUnitFqn ) ) ; |
public class ListConfigurationSetsResult { /** * A list of configuration sets .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setConfigurationSets ( java . util . Collection ) } or { @ link # withConfigurationSets ( java . util . Collection ) } if
* you w... | if ( this . configurationSets == null ) { setConfigurationSets ( new com . amazonaws . internal . SdkInternalList < ConfigurationSet > ( configurationSets . length ) ) ; } for ( ConfigurationSet ele : configurationSets ) { this . configurationSets . add ( ele ) ; } return this ; |
public class ResolutionReportHelper { /** * Should be called just prior to the resolve bundle operation from the same thread .
* @ param bContext bundleContext */
public void startHelper ( BundleContext bContext ) { } } | _resolvingThread = Thread . currentThread ( ) . getId ( ) ; ResolverHookFactoryReg = bContext . registerService ( ResolverHookFactory . class , this , null ) ; |
public class GetMsgSendIntentApi { /** * HuaweiApiClient 连接结果回调
* @ param rst 结果码
* @ param client HuaweiApiClient 实例 */
@ Override public void onConnect ( int rst , HuaweiApiClient client ) { } } | if ( client == null || ! ApiClientMgr . INST . isConnect ( client ) ) { HMSAgentLog . e ( "client not connted" ) ; onSnsGetMsgIntentResult ( rst , null ) ; return ; } PendingResult < IntentResult > sendMsgResult = HuaweiSns . HuaweiSnsApi . getMsgSendIntent ( client , msg , needResult ) ; sendMsgResult . setResultCallb... |
public class JJTMithraQLState { /** * / * A definite node is constructed from a specified number of
* children . That number of nodes are popped from the stack and
* made the children of the definite node . Then the definite node
* is pushed on to the stack . */
void closeNodeScope ( Node n , int num ) { } } | mk = ( ( Integer ) marks . pop ( ) ) . intValue ( ) ; while ( num -- > 0 ) { Node c = popNode ( ) ; c . jjtSetParent ( n ) ; n . jjtAddChild ( c , num ) ; } n . jjtClose ( ) ; pushNode ( n ) ; node_created = true ; |
public class CmsResultFacets { /** * Selects the given field facet . < p >
* @ param field the field name
* @ param value the value */
void selectFieldFacet ( String field , String value ) { } } | m_selectedFieldFacets . clear ( ) ; m_selectedRangeFacets . clear ( ) ; m_selectedFieldFacets . put ( field , Collections . singletonList ( value ) ) ; m_manager . search ( m_selectedFieldFacets , m_selectedRangeFacets ) ; |
public class AddExpiration { /** * Adds a long constructor assignment . */
private void addTimeConstructorAssignment ( MethodSpec . Builder constructor , String field ) { } } | constructor . addStatement ( "$T.UNSAFE.putLong(this, $N, $N)" , UNSAFE_ACCESS , offsetName ( field ) , "now" ) ; |
public class HttpHelper { /** * Attempt to send all the batches totalling numMetrics in the allowed time .
* @ return The total number of metrics sent . */
public int sendAll ( Iterable < Observable < Integer > > batches , final int numMetrics , long timeoutMillis ) { } } | final AtomicBoolean err = new AtomicBoolean ( false ) ; final AtomicInteger updated = new AtomicInteger ( 0 ) ; LOGGER . debug ( "Got {} ms to send {} metrics" , timeoutMillis , numMetrics ) ; try { final CountDownLatch completed = new CountDownLatch ( 1 ) ; final Subscription s = Observable . mergeDelayError ( Observa... |
public class FileManagerImpl { /** * Allocate a block of storage . It may or may not be cleared to 0.
* @ param size Number of bytes to allocate .
* @ return address in file that is allocated .
* @ exception FileManagerException
* @ exception IOException
* @ exception EOFException */
public long allocate ( in... | // System . out . println ( " * * * allocate filename = " + filename + " size = " + request _ size ) ;
if ( readOnly ) { throw ( new FileManagerException ( "Attempt to allocate in read only mode" ) ) ; } allocs ++ ; request_size = request_size + HDR_SIZE ; if ( request_size <= last_quick_size_block ) { return allocate_... |
public class MirrorUtil { /** * Normalizes the specified { @ code path } . A path which starts and ends with { @ code / } would be returned .
* Also , it would not have consecutive { @ code / } . */
public static String normalizePath ( String path ) { } } | requireNonNull ( path , "path" ) ; if ( path . isEmpty ( ) ) { return "/" ; } if ( ! path . startsWith ( "/" ) ) { path = '/' + path ; } if ( ! path . endsWith ( "/" ) ) { path += '/' ; } return path . replaceAll ( "//+" , "/" ) ; |
public class ListBinding { /** * Updates the selection model with the selected values from the value model . */
protected void updateSelectedItemsFromValueModel ( ) { } } | Object value = getValue ( ) ; Object [ ] selectedValues = EMPTY_VALUES ; if ( value != null ) { selectedValues = ( Object [ ] ) convertValue ( value , Object [ ] . class ) ; } // flag is used to avoid a round trip while we are selecting the values
selectingValues = true ; try { ListSelectionModel selectionModel = getLi... |
public class DnsCacheManipulator { /** * Set JVM DNS negative cache policy
* @ param negativeCacheSeconds set default dns cache time . Special input case :
* < ul >
* < li > { @ code - 1 } means never expired . ( In effect , all negative value ) < / li >
* < li > { @ code 0 } never cached . < / li >
* < / ul ... | try { InetAddressCacheUtil . setDnsNegativeCachePolicy ( negativeCacheSeconds ) ; } catch ( Exception e ) { throw new DnsCacheManipulatorException ( "Fail to setDnsNegativeCachePolicy, cause: " + e . toString ( ) , e ) ; } |
public class GenericHibernateDao { /** * This method returns a { @ link Map } that maps { @ link PersistentObject } s
* to PermissionCollections for the passed { @ link UserGroup } . I . e . the keySet
* of the map is the collection of all { @ link PersistentObject } s where the
* user group has at least one perm... | "unchecked" } ) public Map < PersistentObject , PermissionCollection > findAllUserGroupPermissionsOfUserGroup ( UserGroup userGroup ) { Criteria criteria = getSession ( ) . createCriteria ( PersistentObject . class ) ; // by only setting the alias , we will only get those entities where
// there is at least one permiss... |
public class DomLayersModelRenderer { @ Override public void registerLayerRenderer ( Layer layer , LayerRenderer layerRenderer ) { } } | if ( layerRenderers . containsKey ( layer ) ) { layerRenderers . remove ( layer ) ; } layerRenderers . put ( layer , layerRenderer ) ; |
public class UDPRelayServer { public void run ( ) { } } | try { if ( Thread . currentThread ( ) . getName ( ) . equals ( "pipe1" ) ) pipe ( remote_sock , client_sock , false ) ; else pipe ( client_sock , remote_sock , true ) ; } catch ( IOException ioe ) { } finally { abort ( ) ; log ( "UDP Pipe thread " + Thread . currentThread ( ) . getName ( ) + " stopped." ) ; } |
public class PushNotificationManager { /** * Stop and restart the current connection to the Apple server using server settings from the previous connection .
* @ throws CommunicationException thrown if a communication error occurs
* @ throws KeystoreException thrown if there is a problem with your keystore */
priva... | try { logger . debug ( "Closing connection to restart previous one" ) ; this . socket . close ( ) ; } catch ( Exception e ) { /* Do not complain if connection is already closed . . . */
} initializePreviousConnection ( ) ; |
public class SearchExpression { /** * A list of search expression objects .
* @ param subExpressions
* A list of search expression objects . */
public void setSubExpressions ( java . util . Collection < SearchExpression > subExpressions ) { } } | if ( subExpressions == null ) { this . subExpressions = null ; return ; } this . subExpressions = new java . util . ArrayList < SearchExpression > ( subExpressions ) ; |
public class KeyManagementServiceClient { /** * Returns metadata for a given [ KeyRing ] [ google . cloud . kms . v1 . KeyRing ] .
* < p > Sample code :
* < pre > < code >
* try ( KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient . create ( ) ) {
* KeyRingName name = KeyRingName... | GetKeyRingRequest request = GetKeyRingRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; return getKeyRing ( request ) ; |
public class MetamodelConfiguration { /** * Method to prepare class simple name to list of pu ' s mapping . 1 class can
* be mapped to multiple persistence units , in case of RDBMS , in other cases
* it will only be 1!
* @ param clazz
* entity class to be mapped .
* @ param pu
* current persistence unit nam... | List < String > puCol = new ArrayList < String > ( 1 ) ; if ( clazzToPuMap == null ) { clazzToPuMap = new HashMap < String , List < String > > ( ) ; } else { if ( clazzToPuMap . containsKey ( clazz . getName ( ) ) ) { puCol = clazzToPuMap . get ( clazz . getName ( ) ) ; } } if ( ! puCol . contains ( pu ) ) { puCol . ad... |
public class ClusterControllerClient { /** * Deletes a cluster in a project .
* < p > Sample code :
* < pre > < code >
* try ( ClusterControllerClient clusterControllerClient = ClusterControllerClient . create ( ) ) {
* String projectId = " " ;
* String region = " " ;
* String clusterName = " " ;
* cluste... | DeleteClusterRequest request = DeleteClusterRequest . newBuilder ( ) . setProjectId ( projectId ) . setRegion ( region ) . setClusterName ( clusterName ) . build ( ) ; return deleteClusterAsync ( request ) ; |
public class ExpressRouteCrossConnectionsInner { /** * Gets the route table summary associated with the express route cross connection in a resource group .
* @ param resourceGroupName The name of the resource group .
* @ param crossConnectionName The name of the ExpressRouteCrossConnection .
* @ param peeringNam... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( crossConnectionName == null ) { throw new IllegalArgumentException ( "Parameter crossConnectionName is required and cannot be null." ) ; } if ( peeringName == null ) { throw n... |
public class AbstractRegistry { /** * If this registry depends on other registries , this method can be used to tell this registry if all depending registries are consistent .
* @ return The method returns should return false if at least one depending registry is not consistent ! */
protected boolean isDependingOnCon... | dependingRegistryMapLock . readLock ( ) . lock ( ) ; try { return dependingRegistryMap . keySet ( ) . stream ( ) . noneMatch ( ( registry ) -> ( ! registry . isConsistent ( ) ) ) ; } finally { dependingRegistryMapLock . readLock ( ) . unlock ( ) ; } |
public class CreateVaultRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateVaultRequest createVaultRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createVaultRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createVaultRequest . getAccountId ( ) , ACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( createVaultRequest . getVaultName ( ) , VAULTNAME_BINDING ) ; } catch ( ... |
public class StunHandler { /** * All STUN messages MUST start with a 20 - byte header followed by zero or more Attributes .
* The STUN header contains a STUN message type , magic cookie , transaction ID , and message length .
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* | 0 0 | ... | /* * All STUN messages MUST start with a 20 - byte header followed by zero
* or more Attributes . */
if ( length >= 20 ) { // The most significant 2 bits of every STUN message MUST be zeroes .
byte b0 = data [ offset ] ; boolean firstBitsValid = ( ( b0 & 0xC0 ) == 0 ) ; // The magic cookie field MUST contain the fixe... |
public class AbstractMetaCache { /** * Looks up the object from the cache
* @ param oid The Identity to look up the object for
* @ return The object if found , otherwise null */
public Object lookup ( Identity oid ) { } } | Object ret = null ; if ( oid != null ) { ObjectCache cache = getCache ( oid , null , METHOD_LOOKUP ) ; if ( cache != null ) { ret = cache . lookup ( oid ) ; } } return ret ; |
public class DerInputStream { /** * Return a set of encoded entities . ASN . 1 sets are unordered ,
* though DER may specify an order for some kinds of sets ( such
* as the attributes in an X . 500 relative distinguished name )
* to facilitate binary comparisons of encoded values .
* @ param startLen guess abou... | tag = ( byte ) buffer . read ( ) ; if ( tag != DerValue . tag_Set ) throw new IOException ( "Set tag error" ) ; return readVector ( startLen ) ; |
public class Stream { /** * Zip together the iterators until one of them runs out of values .
* Each array of values is combined into a single value using the supplied zipFunction function .
* @ param c
* @ param zipFunction
* @ return */
@ SuppressWarnings ( "resource" ) public static < R > Stream < R > zip ( ... | if ( N . isNullOrEmpty ( c ) ) { return Stream . empty ( ) ; } final int len = c . size ( ) ; final ByteIterator [ ] iters = new ByteIterator [ len ] ; int i = 0 ; for ( ByteStream s : c ) { iters [ i ++ ] = s . iteratorEx ( ) ; } return new IteratorStream < > ( new ObjIteratorEx < R > ( ) { @ Override public boolean h... |
public class Device { /** * The instances belonging to this device .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setInstances ( java . util . Collection ) } or { @ link # withInstances ( java . util . Collection ) } if you want to
* override the existin... | if ( this . instances == null ) { setInstances ( new java . util . ArrayList < DeviceInstance > ( instances . length ) ) ; } for ( DeviceInstance ele : instances ) { this . instances . add ( ele ) ; } return this ; |
public class CentralDogma { /** * Returns the primary port of the server .
* @ return the primary { @ link ServerPort } if the server is started . { @ link Optional # empty ( ) } otherwise . */
public Optional < ServerPort > activePort ( ) { } } | final Server server = this . server ; return server != null ? server . activePort ( ) : Optional . empty ( ) ; |
public class MariaDbDatabaseMetaData { /** * Retrieves a description of the access rights for each table available in a catalog . Note that a
* table privilege applies to one or more columns in the table . It would be wrong to assume that
* this privilege applies to all columns ( this may be true for some systems b... | String sql = "SELECT TABLE_SCHEMA TABLE_CAT,NULL TABLE_SCHEM, TABLE_NAME, NULL GRANTOR," + "GRANTEE, PRIVILEGE_TYPE PRIVILEGE, IS_GRANTABLE FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES " + " WHERE " + catalogCond ( "TABLE_SCHEMA" , catalog ) + " AND " + patternCond ( "TABLE_NAME" , tableNamePattern ) + "ORDER BY TABLE_S... |
public class Mutation { /** * This is equivalent to calling commit . Applies the changes to
* to the keyspace that is obtained by calling Keyspace . open ( ) . */
public void apply ( ) { } } | Keyspace ks = Keyspace . open ( keyspaceName ) ; ks . apply ( this , ks . metadata . durableWrites ) ; |
public class BigtableInstanceAdminClient { /** * Lists all app profiles of the specified instance .
* < p > Sample code :
* < pre > { @ code
* List < AppProfile > appProfiles = client . listAppProfiles ( " my - instance " ) ;
* } < / pre >
* @ see AppProfile */
@ SuppressWarnings ( "WeakerAccess" ) public Lis... | return ApiExceptions . callAndTranslateApiException ( listAppProfilesAsync ( instanceId ) ) ; |
public class SLF4JLoggingCallback { /** * Logs Simon stop on a specified log marker .
* @ param split stopped split
* @ param sample stopwatch sample */
@ Override public void onStopwatchStop ( Split split , StopwatchSample sample ) { } } | logger . debug ( marker , "SIMON STOP: {} ({})" , sample . toString ( ) , split . runningFor ( ) ) ; |
public class OLAPService { /** * Perform an aggregate query on the given table using the given request .
* @ param tableDef { @ link TableDefinition } of table to query .
* @ param request { @ link OlapAggregate } that defines query parameters .
* @ return { @ link AggregateResult } containing search results . */... | checkServiceState ( ) ; AggregationResult result = m_olap . aggregate ( tableDef . getAppDef ( ) , tableDef . getTableName ( ) , request ) ; return AggregateResultConverter . create ( result , request ) ; |
public class BaseObject { /** * Call a function on this object
* @ param method
* @ param args
* @ return
* @ throws Exception */
protected JSONArray callMethod ( String method , Object ... args ) throws Exception { } } | return new QueryBuilder ( ) . retrieveResult ( storedId ) . call ( method , args ) . storeResult ( "LAST_" + getStoredId ( ) ) . execute ( ) ; |
public class InetSubnet { /** * Repopulates the transient fields based on the IP and prefix */
private void recache ( ) { } } | // If we ' ve already cached the values then don ' t bother recalculating ; we
// assume a mask of 0 means a recompute is needed ( unless prefix is also 0)
// We skip the computation completely is prefix is 0 - this is fine , since
// the mask and maskedNetwork for prefix 0 result in 0 , the default values .
// We need... |
public class Prefix { /** * - - prefix methods */
public int first ( ) { } } | long remaining ; long next ; remaining = data ; while ( true ) { next = remaining / BASE ; if ( next == 0 ) { return ( int ) remaining - 1 ; } remaining = next ; } |
public class TupleCombiner { /** * Returns all fully - combined N - tuples of values for the included input variables . */
private Collection < Tuple > getCombinedTuples ( List < VarDef > combinedVars , Collection < Tuple > tuples ) { } } | // Apply any once - only constraints .
Set < Tuple > onceTuples = getOnceTupleDefs ( combinedVars ) ; if ( ! onceTuples . isEmpty ( ) ) { for ( Tuple tuple : tuples ) { tuple . setOnce ( onceTuples . contains ( tuple ) ) ; } } return tuples ; |
public class IsolationRunner { /** * Run a single task
* @ param args the first argument is the task directory */
public static void main ( String [ ] args ) throws ClassNotFoundException , IOException , InterruptedException { } } | if ( args . length != 1 ) { System . out . println ( "Usage: IsolationRunner <path>/job.xml" ) ; System . exit ( 1 ) ; } File jobFilename = new File ( args [ 0 ] ) ; if ( ! jobFilename . exists ( ) || ! jobFilename . isFile ( ) ) { System . out . println ( jobFilename + " is not a valid job file." ) ; System . exit ( 1... |
public class Vacuum { /** * Get the vacuums current fan speed setting .
* @ return The fan speed .
* @ throws CommandExecutionException When there has been a error during the communication or the response was invalid . */
public int getFanSpeed ( ) throws CommandExecutionException { } } | int resp = sendToArray ( "get_custom_mode" ) . optInt ( 0 , - 1 ) ; if ( ( resp < 0 ) || ( resp > 100 ) ) throw new CommandExecutionException ( CommandExecutionException . Error . INVALID_RESPONSE ) ; return resp ; |
public class SpanId { /** * Generates a new random { @ code SpanId } .
* @ param random The random number generator .
* @ return a valid new { @ code SpanId } .
* @ since 0.5 */
public static SpanId generateRandomId ( Random random ) { } } | long id ; do { id = random . nextLong ( ) ; } while ( id == INVALID_ID ) ; return new SpanId ( id ) ; |
public class TransformProcess { /** * Execute a TransformProcess that starts with a single ( non - sequence ) record ,
* and converts it to a sequence record .
* < b > NOTE < / b > : This method has the following significant limitation :
* if it contains a ConvertToSequence op ,
* it MUST be using singleStepSeq... | List < List < List < Writable > > > ret = new ArrayList < > ( ) ; for ( List < Writable > record : inputExample ) ret . add ( execute ( record , null ) . getRight ( ) ) ; return ret ; |
public class CMBlob { /** * Converts a CloudMe Blob to a generic CBlob
* @ return CBlob */
public CBlob toCBlob ( ) { } } | CBlob cBlob = new CBlob ( getPath ( ) , length , contentType ) ; cBlob . setModificationDate ( updated ) ; return cBlob ; |
public class GeoJsonReaderDriver { /** * Parses the all GeoJSON feature to create the PreparedStatement .
* @ throws SQLException
* @ throws IOException */
private boolean parseMetadata ( ) throws SQLException , IOException { } } | FileInputStream fis = null ; try { fis = new FileInputStream ( fileName ) ; this . fc = fis . getChannel ( ) ; this . fileSize = fc . size ( ) ; // Given the file size and an average node file size .
// Skip how many nodes in order to update progression at a step of 1%
readFileSizeEachNode = Math . max ( 1 , ( this . f... |
public class BlockingDataCollector { /** * Starts a data collecting Thread that will call { @ link # collectData ( ) }
* @ return */
@ Override public final ReportDataHolderImpl collect ( ) { } } | holder = new BlockingDataHolder ( dataQueueSize , queueTimeout ) ; Runnable r = new collectThread ( ) ; Thread t = new Thread ( r , DATA_COLLECTOR_THREAD ) ; t . setUncaughtExceptionHandler ( this ) ; t . start ( ) ; return holder ; |
public class Image { /** * Draw this image at a specified location and size
* @ param x The x location to draw the image at
* @ param y The y location to draw the image at
* @ param width The width to render the image at
* @ param height The height to render the image at
* @ param filter The color to filter w... | if ( alpha != 1 ) { if ( filter == null ) { filter = Color . white ; } filter = new Color ( filter ) ; filter . a *= alpha ; } if ( filter != null ) { filter . bind ( ) ; } texture . bind ( ) ; GL . glTranslatef ( x , y , 0 ) ; if ( angle != 0 ) { GL . glTranslatef ( centerX , centerY , 0.0f ) ; GL . glRotatef ( angle ... |
public class ProgressionUtil { /** * Set the value of the given task progression ,
* if not < code > null < / code > .
* The value must be greater than the current progression value .
* @ param model is the progression to change
* @ param value is the value to add to the progression value .
* @ param comment ... | if ( model != null && value > model . getValue ( ) ) { model . setValue ( value , comment ) ; } |
public class AsmInvokeDistributeFactory { /** * 创建if分支的byte code
* @ param mv MethodVisitor
* @ param method Method
* @ param next 下一个分支的起始位置
* @ param start 该分支的结束位置 */
private static void createIf ( MethodVisitor mv , Method method , Label next , Label start , String className , Class < ? > parentClass ) { } ... | // 标记分支开始位置
mv . visitLabel ( start ) ; mv . visitFrame ( F_SAME , 0 , null , 0 , null ) ; // 比较方法声明类
stringEquals ( mv , ( ) -> mv . visitVarInsn ( ALOAD , 1 ) , convert ( method . getDeclaringClass ( ) ) , next , ( ) -> { // 比较方法名
stringEquals ( mv , ( ) -> mv . visitVarInsn ( ALOAD , 2 ) , method . getName ( ) , nex... |
public class ConsoleConsumer { /** * Creates and starts a daemon thread which consumes a { @ linkplain Process processes }
* { @ link Process # getInputStream ( ) stdout } stream and pipes the date to the output stream .
* Note that when using this method the { @ link ProcessBuilder # redirectErrorStream ( boolean ... | return start ( process . getInputStream ( ) , out ) ; |
public class JPAAuditLogService { /** * / * ( non - Javadoc )
* @ see org . jbpm . process . audit . AuditLogService # clear ( ) */
@ Override public void clear ( ) { } } | EntityManager em = getEntityManager ( ) ; Object newTx = joinTransaction ( em ) ; try { int deletedNodes = em . createQuery ( "delete FROM NodeInstanceLog WHERE processInstanceId in (select spl.processInstanceId FROM ProcessInstanceLog spl WHERE spl.status in (2, 3))" ) . executeUpdate ( ) ; logger . debug ( "CLEAR:: d... |
public class JavacProcessingEnvironment { /** * Called retroactively to determine if a class loader was required ,
* after we have failed to create one . */
private boolean needClassLoader ( String procNames , Iterable < ? extends File > workingpath ) { } } | if ( procNames != null ) return true ; URL [ ] urls = new URL [ 1 ] ; for ( File pathElement : workingpath ) { try { urls [ 0 ] = pathElement . toURI ( ) . toURL ( ) ; if ( ServiceProxy . hasService ( Processor . class , urls ) ) return true ; } catch ( MalformedURLException ex ) { throw new AssertionError ( ex ) ; } c... |
public class CmsJspResourceWrapper { /** * Returns the folder name of this resource from the root site . < p >
* In case this resource already is a { @ link CmsFolder } , the folder path is returned without modification .
* In case it is a { @ link CmsFile } , the parent folder name of the file is returned . < p > ... | String result ; if ( isFile ( ) ) { result = getRootPathParentFolder ( ) ; } else { result = getRootPath ( ) ; } return result ; |
public class TtlTimerTask { /** * Unwrap { @ link TtlTimerTask } to the original / underneath one .
* this method is { @ code null } - safe , when input { @ code TimerTask } parameter is { @ code null } , return { @ code null } ;
* if input { @ code TimerTask } parameter is not a { @ link TtlTimerTask } just return... | if ( ! ( timerTask instanceof TtlTimerTask ) ) return timerTask ; else return ( ( TtlTimerTask ) timerTask ) . getTimerTask ( ) ; |
public class AdSenseSettings { /** * Sets the fontSize value for this AdSenseSettings .
* @ param fontSize * Specifies the font size of the { @ link AdUnit } . This attribute
* is optional
* and defaults to the ad unit ' s parent or ancestor ' s
* setting if one has been
* set . If no ancestor of the ad unit ... | this . fontSize = fontSize ; |
public class IfcRepresentationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcRepresentationMap > getRepresentationMap ( ) { } } | return ( EList < IfcRepresentationMap > ) eGet ( Ifc4Package . Literals . IFC_REPRESENTATION__REPRESENTATION_MAP , true ) ; |
public class HawtioManagementConfiguration { @ Bean public Redirector redirector ( ) { } } | final Redirector redirector = new Redirector ( ) ; redirector . setApplicationContextPath ( hawtioPath ) ; return redirector ; |
public class CryptUtils { /** * 根据密匙进行DES加密
* @ param key
* 密匙
* @ param info
* 要加密的信息
* @ return String 加密后的信息 */
public static String encryptToDES ( SecretKey key , String info ) { } } | // 定义 加密算法 , 可用 DES , DESede , Blowfish
String Algorithm = "DES" ; // 加密随机数生成器 ( RNG ) , ( 可以不写 )
SecureRandom sr = new SecureRandom ( ) ; // 定义要生成的密文
byte [ ] cipherByte = null ; try { // 得到加密 / 解密器
Cipher c1 = Cipher . getInstance ( Algorithm ) ; // 用指定的密钥和模式初始化Cipher对象
// 参数 : ( ENCRYPT _ MODE , DECRYPT _ MODE , WRA... |
public class Funnel { /** * Construct the jsonifiable arguments for this request .
* @ return A jsonifiable Map to use for the request body . */
@ Override Map < String , Object > constructRequestArgs ( ) { } } | Map < String , Object > args = new HashMap < String , Object > ( ) ; args . put ( KeenQueryConstants . STEPS , this . steps . constructParameterRequestArgs ( ) ) ; if ( null != this . timeframe ) { args . putAll ( timeframe . constructTimeframeArgs ( ) ) ; } return args ; |
public class FieldType { /** * Create a shell object and assign its id field . */
private < FT , FID > FT createForeignShell ( ConnectionSource connectionSource , Object val , ObjectCache objectCache ) throws SQLException { } } | @ SuppressWarnings ( "unchecked" ) Dao < FT , FID > castDao = ( Dao < FT , FID > ) foreignDao ; FT foreignObject = castDao . createObjectInstance ( ) ; foreignIdField . assignField ( connectionSource , foreignObject , val , false , objectCache ) ; return foreignObject ; |
public class Alert { /** * Creates a new instance of { @ code Alert } with same members .
* @ return a new { @ code Alert } instance */
public Alert newInstance ( ) { } } | Alert item = new Alert ( this . pluginId ) ; item . setRiskConfidence ( this . risk , this . confidence ) ; item . setName ( this . name ) ; item . setDetail ( this . description , this . uri , this . param , this . attack , this . otherInfo , this . solution , this . reference , this . historyRef ) ; item . setSource ... |
public class UnsavedRevision { /** * Sets the attachment with the given name . The Attachment data will be written
* to the Database when the Revision is saved .
* @ param name The name of the Attachment to set .
* @ param contentType The content - type of the Attachment .
* @ param contentStreamURL The URL tha... | try { InputStream inputStream = contentStreamURL . openStream ( ) ; setAttachment ( name , contentType , inputStream ) ; } catch ( IOException e ) { Log . e ( Database . TAG , "Error opening stream for url: %s" , contentStreamURL ) ; throw new RuntimeException ( e ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.