signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Messenger { /** * Starting new group call
* @ param gid group you want to call
* @ return command to execute */
@ ObjectiveCName ( "doCallWithGid:" ) public Command < Long > doGroupCall ( int gid ) { } } | return modules . getCallsModule ( ) . makeCall ( Peer . group ( gid ) , false ) ; |
public class UUIDSet { /** * 解析如下格式字符串为Interval : 1 = > Interval { start : 1 , stop : 2 } 1-3 = >
* Interval { start : 1 , stop : 4 } 注意 ! 字符串格式表达时 [ n , m ] 是两侧都包含的 , Interval表达时 [ n , m ) 右侧开
* @ param str
* @ return */
public static Interval parseInterval ( String str ) { } } | String [ ] ss = str . split ( "-" ) ; Interval interval = new Interval ( ) ; switch ( ss . length ) { case 1 : interval . start = Long . parseLong ( ss [ 0 ] ) ; interval . stop = interval . start + 1 ; break ; case 2 : interval . start = Long . parseLong ( ss [ 0 ] ) ; interval . stop = Long . parseLong ( ss [ 1 ] ) +... |
public class ScriptRunner { /** * Invokes the specified < code > Task < / code > with the specified
* < code > TaskRequest < / code > and returns the < code > RETURN _ VALUE < / code > .
* Use this overload of the < code > evaluate < / code > method if you need to
* pre - load information into the < code > TaskRe... | return evaluate ( k , req , new RuntimeRequestResponse ( ) ) ; |
public class ServerParams { /** * Get the parameters defined for the given module in the given parameter map . This
* method first attempts to load the class information for the given module . If it
* cannot be loaded , an IllegalArgumentException is thrown . Otherwise , it searches the
* given map for parameters... | Map < String , Object > result = new HashMap < > ( ) ; try { Class < ? > moduleClass = Class . forName ( modulePackageName ) ; while ( ! moduleClass . getSimpleName ( ) . equals ( "Object" ) ) { Map < String , Object > moduleParams = ( Map < String , Object > ) paramMap . get ( moduleClass . getSimpleName ( ) ) ; if ( ... |
public class CryptoUtil { /** * A utility method to encrypt the value of field marked by the @ Secret annotation using its
* setter / mutator method .
* @ param object the actual Object representing the POJO we want the Id of .
* @ param cmd the CollectionMetaData object from which we can obtain the list
* cont... | for ( String secretAnnotatedFieldName : cmd . getSecretAnnotatedFieldNames ( ) ) { Method getterMethod = cmd . getGetterMethodForFieldName ( secretAnnotatedFieldName ) ; Method setterMethod = cmd . getSetterMethodForFieldName ( secretAnnotatedFieldName ) ; String value ; String encryptedValue = null ; try { value = ( S... |
public class OptionalHeader { /** * Checks if image base is too large or zero and relocates it accordingly .
* Otherwise the usual image base is returned .
* see : @ see < a
* href = " https : / / code . google . com / p / corkami / wiki / PE # ImageBase " > corkami < / a >
* @ return relocated image base */
pu... | long imageBase = get ( WindowsEntryKey . IMAGE_BASE ) ; long sizeOfImage = get ( WindowsEntryKey . SIZE_OF_IMAGE ) ; if ( imageBase + sizeOfImage >= 0x80000000L || imageBase == 0L ) { return 0x10000L ; } return imageBase ; |
public class FXBinder { /** * Start point of the fluent API to create a binding .
* @ param property the Dolphin Platform property
* @ return binder that can be used by the fluent API to create binding . */
public static NumericDolphinBinder < Long > bindLong ( Property < Long > property ) { } } | requireNonNull ( property , "property" ) ; return new LongDolphinBinder ( property ) ; |
public class BasicUserProfile { /** * Add permissions .
* @ param permissions the permissions to add . */
@ Override public void addPermissions ( final Collection < String > permissions ) { } } | CommonHelper . assertNotNull ( "permissions" , permissions ) ; this . permissions . addAll ( permissions ) ; |
public class CmsResourceUtil { /** * Returns < code > true < / code > if the given resource is editable by the current user . < p >
* Returns < code > false < / code > if no request context is set . < p >
* @ return < code > true < / code > if the given resource is editable by the current user */
public boolean isE... | if ( m_request == null ) { return false ; } CmsExplorerTypeSettings settings = OpenCms . getWorkplaceManager ( ) . getExplorerTypeSetting ( getResourceTypeName ( ) ) ; if ( settings != null ) { String rightSite = OpenCms . getSiteManager ( ) . getSiteRoot ( getResource ( ) . getRootPath ( ) ) ; if ( rightSite == null )... |
public class VorbisFile { /** * In Reading mode , will close the underlying ogg
* file and free its resources .
* In Writing mode , will write out the Info , Comments
* and Setup objects , and then the audio data . */
public void close ( ) throws IOException { } } | if ( r != null ) { r = null ; ogg . close ( ) ; ogg = null ; } if ( w != null ) { w . bufferPacket ( info . write ( ) , true ) ; w . bufferPacket ( comment . write ( ) , false ) ; w . bufferPacket ( setup . write ( ) , true ) ; long lastGranule = 0 ; for ( VorbisAudioData vd : writtenPackets ) { // Update the granule p... |
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 6853:1 : ruleQualifiedNameInStaticImport returns [ AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ] : ( this _ ValidID _ 0 = ruleValidID kw = ' . ' ) + ; */
public final AntlrDatatypeRuleToken ruleQualifiedNameInStaticImport ( ) throw... | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ; Token kw = null ; AntlrDatatypeRuleToken this_ValidID_0 = null ; enterRule ( ) ; try { // InternalPureXbase . g : 6859:2 : ( ( this _ ValidID _ 0 = ruleValidID kw = ' . ' ) + )
// InternalPureXbase . g : 6860:2 : ( this _ ValidID _ 0 = ruleValidID kw = '... |
public class BuildStepsInner { /** * Creates a build step for a build task .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param buildTaskName The name of the container registry build task .
* ... | return createWithServiceResponseAsync ( resourceGroupName , registryName , buildTaskName , stepName , properties ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class DefaultHistoryService { /** * ~ Methods * * * * * */
@ Override @ Transactional public void deleteExpiredHistory ( ) { } } | requireNotDisposed ( ) ; try { int deletedCount = History . deleteExpiredHistory ( emf . get ( ) ) ; _logger . info ( "Deleted {} expired job history records." , deletedCount ) ; } catch ( Exception ex ) { _logger . warn ( "Couldn't delete expired job history : {}" , ex . getMessage ( ) ) ; } |
public class BMPCLocalManager { /** * Check if Local BrowserMob Proxy is running .
* @ return " true " if Local BrowserMob Proxy is running . */
public synchronized boolean isRunning ( ) { } } | if ( null == process ) return false ; try { process . exitValue ( ) ; return false ; } catch ( IllegalThreadStateException itse ) { return true ; } |
public class OWLSameIndividualAxiomImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } .
* @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to read... | deserialize ( streamReader , instance ) ; |
public class ConstructorGenericsContext { /** * { @ code < T extends Serializable > Some ( T arg ) ; } .
* < pre > { @ code context . constructor ( Some . class . getConstructor ( Object . class ) ) . constructorGenericTypes ( ) = =
* [ Class < Serializable > ] } < / pre >
* @ return current constructor generics ... | return constructorGenerics . isEmpty ( ) ? Collections . < Type > emptyList ( ) : new ArrayList < Type > ( constructorGenerics . values ( ) ) ; |
public class SimpleMonthView { /** * Called when the user clicks on a day . Handles callbacks to the
* { @ link OnDayClickListener } if one is set .
* @ param day A time object representing the day that was clicked */
private void onDayClick ( CalendarDay day ) { } } | if ( mOnDayClickListener != null ) { mOnDayClickListener . onDayClick ( this , day ) ; } // This is a no - op if accessibility is turned off .
mNodeProvider . sendEventForItem ( day , AccessibilityEvent . TYPE_VIEW_CLICKED ) ; |
public class AbstractDb { /** * 结果的条目数
* @ param where 查询条件
* @ return 复合条件的结果数
* @ throws SQLException SQL执行异常 */
public int count ( Entity where ) throws SQLException { } } | Connection conn = null ; try { conn = this . getConnection ( ) ; return runner . count ( conn , where ) ; } catch ( SQLException e ) { throw e ; } finally { this . closeConnection ( conn ) ; } |
public class Container { /** * Add a server event listener .
* @ param listener ComponentEventListener or LifeCycleEventListener */
public void addEventListener ( EventListener listener ) throws IllegalArgumentException { } } | if ( _eventListeners == null ) _eventListeners = new ArrayList ( ) ; if ( listener instanceof ComponentListener || listener instanceof LifeCycleListener ) { if ( log . isDebugEnabled ( ) ) log . debug ( "addEventListener: " + listener ) ; _eventListeners = LazyList . add ( _eventListeners , listener ) ; } |
public class ServletAsyncSpec { /** * Create an async spec with 99999 ( debug mode ) or 30 ( production ) seconds
* timeout and no async listeners .
* @ return A new { @ link ServletAsyncSpec } and never < code > null < / code > . */
@ Nonnull public static ServletAsyncSpec createAsyncDefault ( ) { } } | return createAsync ( GlobalDebug . isDebugMode ( ) ? 999_999 * CGlobal . MILLISECONDS_PER_SECOND : 30 * CGlobal . MILLISECONDS_PER_SECOND , null ) ; |
public class EnvironmentClassLoader { /** * Adds a listener to detect environment lifecycle changes . */
public void removeListener ( EnvLoaderListener listener ) { } } | super . removeListener ( listener ) ; ArrayList < EnvLoaderListener > listeners = _listeners ; if ( _listeners == null ) return ; synchronized ( listeners ) { for ( int i = listeners . size ( ) - 1 ; i >= 0 ; i -- ) { EnvLoaderListener oldListener = listeners . get ( i ) ; if ( listener == oldListener ) { listeners . r... |
public class SgMethod { /** * Returns the name of the method ( first character upper case ) and the
* argument types divided by by an underscore .
* @ return Method name and argument types ( like
* " MethodXY _ String _ int _ boolean " ) . */
public final String getUnderscoredNameAndTypes ( ) { } } | final StringBuffer sb = new StringBuffer ( ) ; sb . append ( SgUtils . firstCharUpper ( getName ( ) ) ) ; sb . append ( "_" ) ; for ( int i = 0 ; i < getArguments ( ) . size ( ) ; i ++ ) { if ( i > 0 ) { sb . append ( "_" ) ; } final SgArgument arg = getArguments ( ) . get ( i ) ; final String typeName = arg . getType ... |
public class SessionController { /** * Action called to clear the session */
@ Route ( method = HttpMethod . POST , uri = "/session/clear" ) public Result clear ( ) { } } | session ( ) . clear ( ) ; return redirect ( router . getReverseRouteFor ( this , "index" ) ) ; |
public class SignalServiceMessageSender { /** * Send a message to a group .
* @ param recipients The group members .
* @ param message The group message .
* @ throws IOException */
public List < SendMessageResult > sendMessage ( List < SignalServiceAddress > recipients , List < Optional < UnidentifiedAccessPair >... | byte [ ] content = createMessageContent ( message ) ; long timestamp = message . getTimestamp ( ) ; List < SendMessageResult > results = sendMessage ( recipients , getTargetUnidentifiedAccess ( unidentifiedAccess ) , timestamp , content , false ) ; boolean needsSyncInResults = false ; for ( SendMessageResult result : r... |
public class ExpressionColumn { /** * Append the names of all the elements in the set of resolutions to the
* string buffer . This is only used for error messages . */
private < T > void appendNameList ( StringBuffer sb , java . util . Set < T > resolutions , String sep ) { } } | for ( T oneRes : resolutions ) { sb . append ( sep ) . append ( oneRes . toString ( ) ) ; sep = ", " ; } |
public class ArrayHeap { /** * Remove the last element of the heap ( last in the index array ) .
* Do not call this on other entries ; the last entry is only passed
* in for efficiency .
* @ param entry the last entry in the array */
private void removeLast ( HeapEntry < E > entry ) { } } | indexToEntry . remove ( entry . index ) ; objectToEntry . remove ( entry . object ) ; |
public class DescribeSubscriptionFiltersResult { /** * The subscription filters .
* @ return The subscription filters . */
public java . util . List < SubscriptionFilter > getSubscriptionFilters ( ) { } } | if ( subscriptionFilters == null ) { subscriptionFilters = new com . amazonaws . internal . SdkInternalList < SubscriptionFilter > ( ) ; } return subscriptionFilters ; |
public class WhileyFileParser { /** * Parse a range expression , which has the form :
* < pre >
* RangeExpr : : = Expr " . . " Expr
* < / pre >
* @ param scope
* The enclosing scope for this statement , which determines the
* set of visible ( i . e . declared ) variables and also the current
* indentation... | int start = index ; Expr lhs = parseAdditiveExpression ( scope , true ) ; match ( DotDot ) ; Expr rhs = parseAdditiveExpression ( scope , true ) ; Expr range = new Expr . ArrayRange ( Type . Void , lhs , rhs ) ; return annotateSourceLocation ( range , start ) ; |
public class AbstractCLA { /** * createCamelCapVersionOfKeyword .
* @ param _ keyword a { @ link java . lang . String } object .
* @ return a { @ link java . lang . String } object . */
static public String createCamelCapVersionOfKeyword ( final String _keyword ) { } } | if ( _keyword == null || _keyword . trim ( ) . length ( ) == 0 ) return null ; final StringBuilder sb = new StringBuilder ( ) ; if ( Character . isLowerCase ( _keyword . charAt ( 0 ) ) ) sb . append ( Character . toUpperCase ( _keyword . charAt ( 0 ) ) ) ; final Matcher matcher = CAMELCAPS . matcher ( _keyword ) ; whil... |
public class Config { public static Long getPropertyLong ( Class < ? > aClass , String key , long aDefault ) { } } | return getSettings ( ) . getPropertyLong ( aClass , key , aDefault ) ; |
public class ProactiveDetectionConfigurationsInner { /** * Update the ProactiveDetection configuration for this configuration id .
* @ param resourceGroupName The name of the resource group .
* @ param resourceName The name of the Application Insights component resource .
* @ param configurationId The ProactiveDe... | return updateWithServiceResponseAsync ( resourceGroupName , resourceName , configurationId , proactiveDetectionProperties ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class RuleModel { /** * This will return the ActionInsertFact that a variable is bound to .
* @ param var The bound fact variable ( NOT bound field ) .
* @ return null or the ActionInsertFact found . */
public ActionInsertFact getRHSBoundFact ( final String var ) { } } | if ( this . rhs == null ) { return null ; } for ( int i = 0 ; i < this . rhs . length ; i ++ ) { if ( this . rhs [ i ] instanceof ActionInsertFact ) { final ActionInsertFact p = ( ActionInsertFact ) this . rhs [ i ] ; if ( p . getBoundName ( ) != null && var . equals ( p . getBoundName ( ) ) ) { return p ; } } } return... |
public class SerializationUtils { /** * Decode and serialize object .
* @ param < T > the type parameter
* @ param object the object
* @ param cipher the cipher
* @ param type the type
* @ param parameters the parameters
* @ return the t
* @ since 4.2 */
@ SneakyThrows public static < T extends Serializab... | val decoded = ( byte [ ] ) cipher . decode ( object , parameters ) ; return deserializeAndCheckObject ( decoded , type ) ; |
public class StructuredQueryBuilder { /** * Matches an element , attribute , JSON property , or field
* that has at least one of the criteria words .
* @ param index the word container
* @ param words the possible words to match
* @ return the StructuredQueryDefinition for the word query */
public StructuredQue... | return new WordQuery ( index , null , null , null , words ) ; |
public class MapReduceServletImpl { /** * Handle POST http requests . */
public static void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException { } } | String handler = getHandler ( request ) ; if ( handler . startsWith ( CONTROLLER_PATH ) ) { if ( ! checkForTaskQueue ( request , response ) ) { return ; } new ShardedJobRunner < > ( ) . completeShard ( checkNotNull ( request . getParameter ( JOB_ID_PARAM ) , "Null job id" ) , checkNotNull ( request . getParameter ( TAS... |
public class PruneStructureFromSceneProjective { /** * Computes reprojection error for all features . Sorts the resulting residuals by magnitude .
* Prunes observations which have the largest errors first . After calling this function you should
* call { @ link # prunePoints ( int ) } and { @ link # pruneViews ( in... | Point2D_F64 observation = new Point2D_F64 ( ) ; Point2D_F64 predicted = new Point2D_F64 ( ) ; Point3D_F64 X3 = new Point3D_F64 ( ) ; Point4D_F64 X4 = new Point4D_F64 ( ) ; // Create a list of observation errors
List < Errors > errors = new ArrayList < > ( ) ; for ( int viewIndex = 0 ; viewIndex < observations . views .... |
public class GuicedResteasy { /** * Try to initialise a ServletContainerDispatcher with the connection to the Guice REST services */
protected void configure ( ServletContainerDispatcher dispatcher ) throws ServletException { } } | // Make sure we are registered with the Guice registry
registry . register ( this , true ) ; // Configure the dispatcher
final Registry resteasyRegistry ; final ResteasyProviderFactory providerFactory ; { final ResteasyRequestResponseFactory converter = new ResteasyRequestResponseFactory ( dispatcher ) ; dispatcher . i... |
public class HostMessenger { /** * Generate a slot for the mailbox and put a noop box there . Can also
* supply a value */
public long generateMailboxId ( Long mailboxId ) { } } | final long hsId = mailboxId == null ? getHSIdForLocalSite ( m_nextSiteId . getAndIncrement ( ) ) : mailboxId ; addMailbox ( hsId , new Mailbox ( ) { @ Override public void send ( long hsId , VoltMessage message ) { } @ Override public void send ( long [ ] hsIds , VoltMessage message ) { } @ Override public void deliver... |
public class ConstraintsBase { /** * Constraint that ensures that the proxy - prefetching - limit has a valid value .
* @ param def The descriptor ( class , reference , collection )
* @ param checkLevel The current check level ( this constraint is checked in basic and strict ) */
protected void checkProxyPrefetchin... | if ( CHECKLEVEL_NONE . equals ( checkLevel ) ) { return ; } if ( def . hasProperty ( PropertyHelper . OJB_PROPERTY_PROXY_PREFETCHING_LIMIT ) ) { if ( ! def . hasProperty ( PropertyHelper . OJB_PROPERTY_PROXY ) ) { if ( def instanceof ClassDescriptorDef ) { LogHelper . warn ( true , ConstraintsBase . class , "checkProxy... |
public class JsonReader { /** * Begins an object with an expected name .
* @ param expectedName The name that the next object should have
* @ return the structured reader
* @ throws IOException Something happened reading or the expected name was not found */
public JsonReader beginObject ( String expectedName ) t... | String name = beginObject ( ) ; if ( ! StringUtils . isNullOrBlank ( expectedName ) && ! name . equals ( expectedName ) ) { throw new IOException ( "Expected " + expectedName ) ; } return this ; |
public class FNCImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . FNC__RETIRED : setRetired ( ( Integer ) newValue ) ; return ; case AfplibPackage . FNC__PAT_TECH : setPatTech ( ( Integer ) newValue ) ; return ; case AfplibPackage . FNC__RESERVED1 : setReserved1 ( ( byte [ ] ) newValue ) ; return ; case AfplibPackage . FNC__FNT_FLAGS : setF... |
public class IonBinary { /** * TODO : move this to IonConstants or IonUTF8 */
static final public int makeUTF8IntFromScalar ( int c ) throws IOException { } } | // TO DO : check this encoding , it is from :
// http : / / en . wikipedia . org / wiki / UTF - 8
// we probably should use some sort of Java supported
// library for this . this class might be of interest :
// CharsetDecoder ( Charset cs , float averageCharsPerByte , float maxCharsPerByte )
// in : java . nio . charse... |
public class OutboundConnectionTracker { /** * Purges a conneciton from the tracker . This is invoked when an error is detected on
* a connection and we do not want any further conversations to attempt to use it .
* @ param connection The connection to purge
* @ param notifyPeer Should we send notification to the... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "purgeFromInvalidateImpl" , new Object [ ] { connection , "" + notifyPeer } ) ; connection . getConnectionData ( ) . getConnectionDataGroup ( ) . purgeFromInvalidateImpl ( connection , notifyPeer ) ; if ( TraceCompone... |
public class AbstractElementTransformer { /** * class OR is defined on a supertype or interface of an enclosing class */
protected boolean isMemberOnEnhancementOfEnclosingType ( AbstractDynamicSymbol symbol ) { } } | if ( ! _cc ( ) . isNonStaticInnerClass ( ) ) { return false ; } IType enhancement = symbol . getGosuClass ( ) ; if ( ! ( enhancement instanceof IGosuEnhancement ) ) { return false ; } IType enhancedType = ( ( IGosuEnhancement ) enhancement ) . getEnhancedType ( ) ; // If the symbol is on this class , or any ancestors ,... |
public class DelayedQueue { /** * Return the next object that is safe for delivery or null
* if there are no safe objects to deliver .
* Null response could mean empty , or could mean all objects
* are scheduled for the future .
* @ param systemCurrentTimeMillis The current time .
* @ return Object of type T ... | if ( delayed . size ( ) == 0 ) { return null ; } // no ready objects
if ( delayed . firstKey ( ) > systemCurrentTimeMillis ) { return null ; } Entry < Long , Object [ ] > entry = delayed . pollFirstEntry ( ) ; Object [ ] values = entry . getValue ( ) ; @ SuppressWarnings ( "unchecked" ) T value = ( T ) values [ 0 ] ; /... |
public class SupervisorEndpoint { /** * Register a remote location where Restcomm will send monitoring updates */
@ Path ( "/remote" ) @ POST @ Produces ( { } } | MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) public Response registerForMetricsUpdates ( @ PathParam ( "accountSid" ) final String accountSid , @ Context UriInfo info , @ HeaderParam ( "Accept" ) String accept ) { return registerForUpdates ( accountSid , info , retrieveMediaType ( accept ) ) ; |
public class HttpServer { void statsCloseConnection ( long duration , int requests ) { } } | synchronized ( _statsLock ) { _connections ++ ; _connectionsOpen -- ; _connectionsDurationTotal += duration ; if ( _connectionsOpen < 0 ) _connectionsOpen = 0 ; if ( _connectionsOpen < _connectionsOpenMin ) _connectionsOpenMin = _connectionsOpen ; if ( _connectionsDurationMin == 0 || duration < _connectionsDurationMin ... |
public class JobScheduleEnableOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has been modified since the specified time .
* @ param ifModifiedSince the ifModifiedSince value to set
* @ return... | if ( ifModifiedSince == null ) { this . ifModifiedSince = null ; } else { this . ifModifiedSince = new DateTimeRfc1123 ( ifModifiedSince ) ; } return this ; |
public class TransportProtocol { /** * Request that the remote server starts a transport protocol service . This
* is only available in CLIENT _ MODE .
* @ param servicename
* @ throws IOException */
public void startService ( String servicename ) throws SshException { } } | ByteArrayWriter baw = new ByteArrayWriter ( ) ; try { baw . write ( SSH_MSG_SERVICE_REQUEST ) ; baw . writeString ( servicename ) ; if ( Log . isDebugEnabled ( ) ) { Log . debug ( this , "Sending SSH_MSG_SERVICE_REQUEST" ) ; } sendMessage ( baw . toByteArray ( ) , true ) ; byte [ ] msg ; do { msg = readMessage ( ) ; } ... |
public class NodeUtil { /** * Permanently delete all the children of the given node , including reporting changes . */
public static void deleteChildren ( Node n , AbstractCompiler compiler ) { } } | while ( n . hasChildren ( ) ) { deleteNode ( n . getFirstChild ( ) , compiler ) ; } |
public class ClientImpl { /** * Synchronously invoke a procedure call blocking until a result is available .
* @ param batchTimeout procedure invocation batch timeout .
* @ param procName class name ( not qualified by package ) of the procedure to execute .
* @ param parameters vararg list of procedure ' s parame... | return callProcedureWithClientTimeout ( batchTimeout , procName , Distributer . USE_DEFAULT_CLIENT_TIMEOUT , TimeUnit . SECONDS , parameters ) ; |
public class UrlUtilities { /** * Get content from the passed in URL . This code will open a connection to
* the passed in server , fetch the requested content , and return it as a
* byte [ ] .
* Anyone using the proxy calls such as this one should have that managed by the jvm with - D parameters :
* http . pro... | return getContentFromUrl ( url , inCookies , outCookies , allowAllCerts ) ; |
public class Responder { /** * Close the socket and tell the processing loop to terminate . This is a
* forced shutdown rather then a natural shutdown . A natural shutdown happens
* when the shutdown hook fires when the VM exists . This method forces all
* that to happen . This is done to allow multiple Responder... | LOGGER . info ( "Force shutdown of Responder [" + _runtimeId + "]" ) ; _shutdownHook . start ( ) ; Runtime . getRuntime ( ) . removeShutdownHook ( _shutdownHook ) ; |
public class ListAssignmentsForHITRequest { /** * The status of the assignments to return : Submitted | Approved | Rejected
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAssignmentStatuses ( java . util . Collection ) } or { @ link # withAssignmentStatus... | if ( this . assignmentStatuses == null ) { setAssignmentStatuses ( new java . util . ArrayList < String > ( assignmentStatuses . length ) ) ; } for ( String ele : assignmentStatuses ) { this . assignmentStatuses . add ( ele ) ; } return this ; |
public class DistributedLogSessionClient { /** * Returns a new distributed log session builder .
* @ return a new distributed log session builder */
public LogSession . Builder sessionBuilder ( ) { } } | return new DistributedLogSession . Builder ( ) { @ Override public LogSession build ( ) { return new DistributedLogSession ( partitionId , sessionIdProvider . get ( ) . join ( ) , clusterMembershipService , protocol , primaryElection , threadContextFactory . createContext ( ) ) ; } } ; |
public class StoreFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public ActionState createActionStateFromString ( EDataType eDataType , String initialValue ) { } } | ActionState result = ActionState . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class HttpServerExchange { /** * Get the response sender .
* For blocking exchanges this will return a sender that uses the underlying output stream .
* @ return the response sender , or { @ code null } if another party already acquired the channel or the sender
* @ see # getResponseChannel ( ) */
public S... | if ( blockingHttpExchange != null ) { return blockingHttpExchange . getSender ( ) ; } if ( sender != null ) { return sender ; } return sender = new AsyncSenderImpl ( this ) ; |
public class StorableGenerator { /** * Returns the properties that match on a given case . The array length is
* the same as the case count . Each list represents the matches . The lists
* themselves may be null if no matches for that case . */
private List < StorableProperty < ? > > [ ] caseMatches ( int caseCount... | List < StorableProperty < ? > > [ ] cases = new List [ caseCount ] ; for ( StorableProperty < ? > prop : mAllProperties . values ( ) ) { int hashCode = prop . getName ( ) . hashCode ( ) ; int caseValue = ( hashCode & 0x7fffffff ) % caseCount ; List matches = cases [ caseValue ] ; if ( matches == null ) { matches = case... |
public class DefaultRoleManager { /** * getRoles gets the roles that a subject inherits .
* domain is a prefix to the roles . */
@ Override public List < String > getRoles ( String name , String ... domain ) { } } | if ( domain . length == 1 ) { name = domain [ 0 ] + "::" + name ; } else if ( domain . length > 1 ) { throw new Error ( "error: domain should be 1 parameter" ) ; } if ( ! hasRole ( name ) ) { throw new Error ( "error: name does not exist" ) ; } List < String > roles = createRole ( name ) . getRoles ( ) ; if ( domain . ... |
public class PKeyArea { /** * Delete the key from this buffer .
* @ param table The basetable .
* @ param keyArea The basetable ' s key area .
* @ param buffer The buffer to compare .
* @ exception DBException File exception . */
public void doRemove ( FieldTable table , KeyAreaInfo keyArea , BaseBuffer buffer ... | if ( ! this . atCurrent ( buffer ) ) { buffer = this . doSeek ( "==" , table , keyArea ) ; if ( buffer == null ) throw new DBException ( Constants . FILE_INCONSISTENCY ) ; } this . removeCurrent ( buffer ) ; |
public class LibUtils { /** * Returns a the < strong > lower case < / strong > String representation of
* the { @ link # calculateOS ( ) OSType } of this platform . E . g .
* < code > " windows " < / code > .
* @ return The string describing the operating system */
private static String osString ( ) { } } | OSType osType = calculateOS ( ) ; return osType . toString ( ) . toLowerCase ( Locale . ENGLISH ) ; |
public class HttpResendQueue { /** * Drains the resend queue until empty or error
* @ param httpClient The HTTP client
* @ param path REST path
* @ param gzip True if the post should be gzipped , false otherwise */
public void drain ( final HttpClient httpClient , final String path , final boolean gzip ) { } } | if ( ! resendQueue . isEmpty ( ) ) { // queued items are available for retransmission
try { // drain resend queue until empty or first exception
LOGGER . info ( "Attempting to retransmit {} requests" , resendQueue . size ( ) ) ; while ( ! resendQueue . isEmpty ( ) ) { // get next item off queue
HttpResendQueueItem item... |
public class AbcGrammar { /** * field - notes : : = % x4E . 3A * WSP tex - text header - eol < p >
* < tt > N : < / tt > */
Rule FieldNotes ( ) { } } | return Sequence ( String ( "N:" ) , ZeroOrMore ( WSP ( ) ) . suppressNode ( ) , TexText ( ) , HeaderEol ( ) ) . label ( FieldNotes ) ; |
public class RemoveFromLoadAllOperation { /** * Removes keys from the provided collection which
* are contained in the partition record store .
* @ param keys the keys to be filtered */
private void removeExistingKeys ( Collection < Data > keys ) { } } | if ( keys == null || keys . isEmpty ( ) ) { return ; } Storage storage = recordStore . getStorage ( ) ; keys . removeIf ( storage :: containsKey ) ; |
public class PID { /** * Return the normalized form of the given pid string , or throw a
* MalformedPIDException .
* @ param pidString
* @ return String normalized version of the pid
* @ throws MalformedPIDException */
public static String normalize ( String pidString ) throws MalformedPIDException { } } | if ( pidString == null ) { throw new MalformedPIDException ( "PID is null." ) ; } return normalize ( pidString , 0 , pidString . length ( ) ) ; |
public class PasswordService { /** * Checks the asserted BCrypt formatted hashed password and determines if the password should
* be rehashed or not . If the BCrypt work factor is increased ( from 12 to 14 for example ) ,
* passwords should be evaluated and if the existing stored hash uses a work factor less than
... | int rounds ; if ( bcryptHash . length < 59 ) { return true ; } final StringBuilder sb = new StringBuilder ( ) ; sb . append ( bcryptHash [ 4 ] ) ; if ( bcryptHash [ 5 ] != '$' ) { sb . append ( bcryptHash [ 5 ] ) ; } rounds = Integer . valueOf ( sb . toString ( ) ) ; return rounds < ROUNDS ; |
public class AbstractCli { /** * Runs the program , parsing any options from { @ code args } .
* @ param args arguments to the program , in the same format as
* provided by { @ code main } . */
public void run ( String [ ] args ) { } } | // Add and parse options .
OptionParser parser = new OptionParser ( ) ; initializeCommonOptions ( parser ) ; initializeOptions ( parser ) ; String errorMessage = null ; try { parsedOptions = parser . parse ( args ) ; } catch ( OptionException e ) { errorMessage = e . getMessage ( ) ; } boolean printHelp = false ; if ( ... |
public class DatePicker { /** * zSetAppropriateTextFieldMinimumWidth , This sets the minimum ( and preferred ) width of the date
* picker text field . The width will be determined ( or calculated ) from the current date picker
* settings , as described below .
* If the programmer has not supplied a setting for th... | if ( settings == null ) { return ; } Integer programmerSuppliedWidth = settings . getSizeTextFieldMinimumWidth ( ) ; // Determine the appropriate minimum width for the text field .
int minimumWidthPixels = CalculateMinimumDateFieldSize . getFormattedDateWidthInPixels ( settings . getFormatForDatesCommonEra ( ) , settin... |
public class DailyZipRollingFileAppender { /** * Rollover the current file to a new file . */
void rollOver ( ) throws IOException { } } | // If compression is enabled we start a separated thread
if ( getCompressBackups ( ) . equalsIgnoreCase ( "YES" ) || getCompressBackups ( ) . equalsIgnoreCase ( "TRUE" ) ) { File file = new File ( fileName ) ; Thread fileCompressor = new Thread ( new CompressFile ( file ) ) ; fileCompressor . start ( ) ; } /* Compute f... |
public class DirectoryScanner { /** * Do we have to traverse a symlink when trying to reach path from
* basedir ?
* @ param base base File ( dir ) .
* @ param pathElements Vector of path elements ( dirs . . . file ) .
* @ since Ant 1.6 */
private boolean isSymlink ( File base , Vector pathElements ) { } } | if ( pathElements . size ( ) > 0 ) { String current = ( String ) pathElements . remove ( 0 ) ; try { return FileUtil . isSymbolicLink ( base , current ) || isSymlink ( new File ( base , current ) , pathElements ) ; } catch ( IOException ioe ) { String msg = "IOException caught while checking " + "for links, couldn't ge... |
public class Beans { /** * New attribute repository person attribute dao .
* @ param p the properties
* @ return the person attribute dao */
@ SneakyThrows public static IPersonAttributeDao newStubAttributeRepository ( final PrincipalAttributesProperties p ) { } } | val dao = new NamedStubPersonAttributeDao ( ) ; val pdirMap = new LinkedHashMap < String , List < Object > > ( ) ; val stub = p . getStub ( ) ; stub . getAttributes ( ) . forEach ( ( key , value ) -> { val vals = StringUtils . commaDelimitedListToStringArray ( value ) ; pdirMap . put ( key , Arrays . stream ( vals ) . ... |
public class SipServletRequestImpl { /** * { @ inheritDoc } */
public Proxy getProxy ( boolean create ) throws TooManyHopsException { } } | if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getProxy - create=" + create ) ; } checkReadOnly ( ) ; final MobicentsSipSession session = getSipSession ( ) ; if ( session . getB2buaHelper ( ) != null ) throw new IllegalStateException ( "Cannot proxy request" ) ; final MaxForwardsHeader mfHeader = ( MaxForwardsH... |
public class LinkedList { /** * Links e as last element . */
void linkLast ( E e ) { } } | final Node < E > l = last ; final Node < E > newNode = new Node < > ( l , e , null ) ; last = newNode ; if ( l == null ) first = newNode ; else l . next = newNode ; size ++ ; modCount ++ ; |
public class OutboundVirtualConnectionFactoryImpl { /** * This method is only ever called from the framework ' s clear method which is
* only
* called when the framework is being destroyed or when automated tests are
* clearing
* out the frameworks config . */
public void destroyInternal ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "destroyInternal; " + this ) ; } // Stop and destroy the chain . Ignore exceptions
try { this . cf . stopChainInternal ( getChain ( ) , 0 ) ; this . cf . destroyChainInternal ( getChain ( ) ) ; } catch ( ChannelException e ) ... |
public class ListQueueTagsResult { /** * The list of all tags added to the specified queue .
* @ param tags
* The list of all tags added to the specified queue .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListQueueTagsResult withTags ( java . util . Map ... | setTags ( tags ) ; return this ; |
public class EllipseClustersIntoGrid { /** * Finds all the nodes which form an approximate line
* @ param seed First ellipse
* @ param next Second ellipse , specified direction of line relative to seed
* @ param line
* @ return All the nodes along the line */
protected static List < NodeInfo > findLine ( NodeIn... | if ( next == null ) return null ; if ( line == null ) line = new ArrayList < > ( ) ; else line . clear ( ) ; next . marked = true ; double anglePrev = direction ( next , seed ) ; double prevDist = next . ellipse . center . distance ( seed . ellipse . center ) ; line . add ( seed ) ; line . add ( next ) ; NodeInfo previ... |
public class Constraints { /** * we have only one implementation on classpath . */
private static Constraint loadConstraint ( Annotation context ) { } } | Constraint constraint = null ; final ServiceLoader < Constraint > constraints = ServiceLoader . load ( Constraint . class ) ; for ( Constraint aConstraint : constraints ) { try { aConstraint . getClass ( ) . getDeclaredMethod ( "check" , context . annotationType ( ) ) ; constraint = aConstraint ; break ; } catch ( NoSu... |
public class SpiderScan { /** * Stops the scan .
* The call to this method has no effect if the scan was not yet started or has already finished . */
@ Override public void stopScan ( ) { } } | lock . lock ( ) ; try { if ( ! State . NOT_STARTED . equals ( state ) && ! State . FINISHED . equals ( state ) ) { spiderThread . stopScan ( ) ; state = State . FINISHED ; SpiderEventPublisher . publishScanEvent ( ScanEventPublisher . SCAN_STOPPED_EVENT , this . scanId ) ; } } finally { lock . unlock ( ) ; } |
public class Termination { /** * The countries to which calls are allowed .
* @ param callingRegions
* The countries to which calls are allowed . */
public void setCallingRegions ( java . util . Collection < String > callingRegions ) { } } | if ( callingRegions == null ) { this . callingRegions = null ; return ; } this . callingRegions = new java . util . ArrayList < String > ( callingRegions ) ; |
public class StringUtils { /** * Prepends the prefix to the start of the string if the string does not
* already start with any of the prefixes .
* < pre >
* StringUtils . prependIfMissing ( null , null ) = null
* StringUtils . prependIfMissing ( " abc " , null ) = " abc "
* StringUtils . prependIfMissing ( "... | return prependIfMissing ( str , prefix , false , prefixes ) ; |
public class LZ4DecompressorWithLength { /** * Decompresses < code > src [ srcOff : ] < / code > into < code > dest [ destOff : ] < / code >
* and returns the number of bytes read from < code > src < / code > .
* The positions and limits of the { @ link ByteBuffer } s remain unchanged .
* @ param src the compress... | final int destLen = getDecompressedLength ( src , srcOff ) ; return decompressor . decompress ( src , srcOff + 4 , dest , destOff , destLen ) + 4 ; |
public class AbstractWComponent { /** * Adds the given component as a child of this component .
* @ param component the component to add . */
void add ( final WComponent component ) { } } | assertAddSupported ( component ) ; assertNotReparenting ( component ) ; if ( ! ( this instanceof Container ) ) { throw new UnsupportedOperationException ( "Components can only be added to a container" ) ; } ComponentModel model = getOrCreateComponentModel ( ) ; if ( model . getChildren ( ) == null ) { model . setChildr... |
public class TLSTransportClient { /** * only client side */
public void start ( ) throws InterruptedException { } } | logger . debug ( "Staring client TLSTransportClient {} " , socketDescription ) ; if ( isConnected ( ) ) { logger . debug ( "Already connected TLSTransportClient {} " , socketDescription ) ; return ; } workerGroup = new NioEventLoopGroup ( ) ; Bootstrap bootstrap = new Bootstrap ( ) ; bootstrap . group ( workerGroup ) .... |
public class ShutdownHooks { /** * Register an action to be run when the JVM exits .
* @ param priority The priority level at which this action should be run . Lower values will run earlier .
* @ param runOnCrash Whether or not this action should be performed if the server is shutting down
* due to a call to cras... | m_instance . addHook ( priority , runOnCrash , action ) ; // Any hook registered lets print crash messsage .
ShutdownHooks . m_crashMessage = true ; |
public class Cyc { /** * Returns a Object which is the best representation for a given String , so long as it doesn ' t
* need to be created in the KB . This static method wraps a call to
* { @ link KbService # getApiObjectDwim ( java . lang . String ) } ; see that method ' s documentation for more
* details .
... | /* if ( cycLOrId . startsWith ( " { " ) & & cycLOrId . endsWith ( " } " ) ) {
cycLOrId = " ( TheSet " + cycLOrId . substring ( 1 , cycLOrId . length ( ) - 1 ) + " ) " ;
if ( cycLOrId . startsWith ( " [ " ) & & cycLOrId . endsWith ( " ] " ) ) {
cycLOrId = " ( TheList " + cycLOrId . substring ( 1 , cycLOrId . lengt... |
public class AmazonSimpleEmailServiceClient { /** * Modifies an association between a configuration set and a custom domain for open and click event tracking .
* By default , images and links used for tracking open and click events are hosted on domains operated by Amazon
* SES . You can configure a subdomain of yo... | request = beforeClientExecution ( request ) ; return executeUpdateConfigurationSetTrackingOptions ( request ) ; |
public class CmsLock { /** * Returns the html code to build the dialogs default confirmation message js . < p >
* @ return html code */
public String buildDefaultConfirmationJS ( ) { } } | StringBuffer html = new StringBuffer ( 512 ) ; html . append ( "<script type='text/javascript'><!--\n" ) ; html . append ( "function setConfirmationMessage(locks, blockinglocks) {\n" ) ; html . append ( "\tvar confMsg = document.getElementById('conf-msg');\n" ) ; html . append ( "\tif (locks > -1) {\n" ) ; if ( ! getSe... |
public class ContainerSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ContainerSettings containerSettings , ProtocolMarshaller protocolMarshaller ) { } } | if ( containerSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( containerSettings . getContainer ( ) , CONTAINER_BINDING ) ; protocolMarshaller . marshall ( containerSettings . getF4vSettings ( ) , F4VSETTINGS_BINDING ) ; protocolM... |
public class VirtualFile { /** * Returns view of content .
* @ return ByteBuffer position set to given position limit is position + needs . */
ByteBuffer writeView ( int position , int needs ) throws IOException { } } | int waterMark = position + needs ; if ( waterMark > content . capacity ( ) ) { if ( refSet . containsKey ( content ) ) { throw new IOException ( "cannot grow file because of writable mapping for content. (non carbage collected mapping?)" ) ; } int blockSize = fileStore . getBlockSize ( ) ; int newCapacity = Math . max ... |
public class DefaultWatchThread { /** * Closes the watch service . */
protected void closeWatchService ( ) { } } | try { getWatchService ( ) . close ( ) ; } catch ( IOException e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( "Error stopping file watch service: " + e . getMessage ( ) , e ) ; } } |
public class GlobalLogFactory { /** * 自定义日志实现
* @ see Slf4jLogFactory
* @ see Log4jLogFactory
* @ see Log4j2LogFactory
* @ see ApacheCommonsLogFactory
* @ see JdkLogFactory
* @ see ConsoleLogFactory
* @ param logFactory 日志工厂类对象
* @ return 自定义的日志工厂类 */
public static LogFactory set ( LogFactory logFactory... | logFactory . getLog ( GlobalLogFactory . class ) . debug ( "Custom Use [{}] Logger." , logFactory . name ) ; currentLogFactory = logFactory ; return currentLogFactory ; |
public class Util { /** * Returns all the super classes of given type . I . e . the returned list does NOT contain any interfaces
* the class or tis superclasses implement .
* @ param types the Types instance of the compilation environment from which the type comes from
* @ param type the type
* @ return the li... | List < TypeMirror > ret = new ArrayList < > ( ) ; try { List < ? extends TypeMirror > superTypes = types . directSupertypes ( type ) ; while ( superTypes != null && ! superTypes . isEmpty ( ) ) { TypeMirror superClass = superTypes . get ( 0 ) ; ret . add ( superClass ) ; superTypes = types . directSupertypes ( superCla... |
public class Vector3d { /** * / * ( non - Javadoc )
* @ see org . joml . Vector3dc # sub ( org . joml . Vector3dc , org . joml . Vector3d ) */
public Vector3d sub ( Vector3dc v , Vector3d dest ) { } } | dest . x = x - v . x ( ) ; dest . y = y - v . y ( ) ; dest . z = z - v . z ( ) ; return dest ; |
public class ViewPortHandler { /** * Apply more { @ link Boundary } s to the detection conditions . */
public ViewPortHandler or ( Boundary boundary ) { } } | if ( ! boundaries . contains ( boundary ) ) { boundaries . add ( boundary ) ; } return this ; |
public class ExecutionChain { /** * Add a { @ link Task } to be run on a { @ link org . gearvrf . utility . Threads # spawn ( Runnable )
* background thread } . It will be run after all Tasks added prior to this
* call .
* @ param task
* { @ code Task } to run
* @ return Reference to the { @ code ExecutionCha... | runOnThread ( Context . Type . BACKGROUND , task ) ; return this ; |
public class ProvideForkJoinTask { /** * Makes a copy of the data in the packet to make the packet safe to store for longer periods of time .
* JDA changed to have only one backing array for all packets , to reduce allocations .
* This means that in JAPP code we have to copy the packet data before storing it for lo... | if ( packet != null ) { packet . setData ( packet . getData ( ) . clone ( ) , packet . getOffset ( ) , packet . getLength ( ) ) ; } return packet ; |
public class Service { /** * A histogram that maps the spread of service durations .
* @ param durationHistogram
* A histogram that maps the spread of service durations . */
public void setDurationHistogram ( java . util . Collection < HistogramEntry > durationHistogram ) { } } | if ( durationHistogram == null ) { this . durationHistogram = null ; return ; } this . durationHistogram = new java . util . ArrayList < HistogramEntry > ( durationHistogram ) ; |
public class NumbersClient { /** * Start renting a Nexmo Virtual Number .
* @ param country A String containing a 2 - character ISO country code .
* @ param msisdn The phone number to be bought .
* @ throws IOException if an error occurs contacting the Nexmo API
* @ throws NexmoClientException if an error is re... | this . buyNumber . execute ( new BuyNumberRequest ( country , msisdn ) ) ; |
public class UfsJournalFile { /** * Creates a temporary checkpoint file .
* @ param location the file location
* @ return the file */
static UfsJournalFile createTmpCheckpointFile ( URI location ) { } } | return new UfsJournalFile ( location , UfsJournal . UNKNOWN_SEQUENCE_NUMBER , UfsJournal . UNKNOWN_SEQUENCE_NUMBER , false ) ; |
public class UnitJudge { /** * 注意 : 请先使用 { { @ link # defined ( String , String ) } } 检查合法性 , 然后再使用本方法取属性
* @ return 判定指定的unit是否是广播型 */
public static boolean isBroadcast ( String groupName , String unitName ) { } } | try { return UnitRouter . SINGLETON . newestDefinition ( Unit . fullName ( groupName , unitName ) ) . getMeta ( ) . getBroadcast ( ) != null ; } catch ( UnitUndefinedException e ) { throw new RuntimeException ( "Please call UnitJudge.defined() first." , e ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.