signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AbstractOptionsForSelect { /** * Set the given retry policy
* @ throws NullPointerException if value is null */
public T withRetryPolicy ( RetryPolicy retryPolicy ) { } } | getOptions ( ) . setRetryPolicy ( Optional . of ( retryPolicy ) ) ; return getThis ( ) ; |
public class ReflectCache { /** * 从缓存里获取方法
* @ param serviceName 服务名 ( 非接口名 )
* @ param methodName 方法名
* @ param methodSigs 方法描述
* @ return 方法 */
public static Method getOverloadMethodCache ( String serviceName , String methodName , String [ ] methodSigs ) { } } | ConcurrentHashMap < String , Method > methods = OVERLOAD_METHOD_CACHE . get ( serviceName ) ; if ( methods == null ) { return null ; } StringBuilder mSigs = new StringBuilder ( 128 ) ; mSigs . append ( methodName ) ; for ( String methodSign : methodSigs ) { mSigs . append ( methodSign ) ; } return methods . get ( mSigs... |
public class CertificatesImpl { /** * Gets information about the specified certificate .
* @ param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter . This must be sha1.
* @ param thumbprint The thumbprint of the certificate to get .
* @ param serviceCallback the async ServiceCallback to h... | return ServiceFuture . fromHeaderResponse ( getWithServiceResponseAsync ( thumbprintAlgorithm , thumbprint ) , serviceCallback ) ; |
public class JsonWriter { /** * Write the int as object key .
* @ param key The int key .
* @ return The JSON Writer . */
public JsonWriter key ( int key ) { } } | startKey ( ) ; writer . write ( '\"' ) ; writer . print ( key ) ; writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ; |
public class LeaderElector { /** * Start participation in a leader election .
* @ return { @ link Future } which is completed after the leader election has been performed
* @ throws KeeperException If there is an error creating election nodes
* @ throws InterruptedException If this thread was interrupted */
publi... | node = createParticipantNode ( zk , dir , prefix , data ) ; return es . submit ( electionEventHandler ) ; |
public class FBContrib { /** * shows the simple help
* @ param args
* standard command line args */
public static void main ( final String [ ] args ) { } } | JOptionPane . showMessageDialog ( null , "To use fb-contrib, copy this jar file into your local SpotBugs plugin directory, and use SpotBugs as usual.\n\nfb-contrib is a trademark of MeBigFatGuy.com" , "fb-contrib: copyright 2005-2019" , JOptionPane . INFORMATION_MESSAGE ) ; System . exit ( 0 ) ; |
public class ImageLoader { /** * Adds display image task to execution pool . Image will be set to ImageAware when it ' s turn . < br / >
* Default { @ linkplain DisplayImageOptions display image options } from { @ linkplain ImageLoaderConfiguration
* configuration } will be used . < br / >
* < b > NOTE : < / b > ... | displayImage ( uri , imageAware , null , null , null ) ; |
public class CreateVpcPeeringConnectionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateVpcPeeringConnectionRequest createVpcPeeringConnectionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createVpcPeeringConnectionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createVpcPeeringConnectionRequest . getFleetId ( ) , FLEETID_BINDING ) ; protocolMarshaller . marshall ( createVpcPeeringConnectionRequest . getPeerVpc... |
public class InternalUtils { /** * Set the forwarded form . This overrides the auto - generated form created by processActionForm
* and populated by processPopulate ( in PageFlowRequestProcessor ) . */
public static void setForwardedFormBean ( ServletRequest request , ActionForm form ) { } } | if ( form == null ) { request . removeAttribute ( FORWARDED_FORMBEAN_ATTR ) ; } else { request . setAttribute ( FORWARDED_FORMBEAN_ATTR , form ) ; } |
public class HessianSchurComplement_Base { /** * Computes the gradient using Schur complement
* @ param jacLeft ( Input ) Left side of Jacobian
* @ param jacRight ( Input ) Right side of Jacobian
* @ param residuals ( Input ) Residuals
* @ param gradient ( Output ) Gradient */
@ Override public void computeGrad... | // Find the gradient using the two matrices for Jacobian
// g = J ' * r = [ L , R ] ' * r
x1 . reshape ( jacLeft . getNumCols ( ) , 1 ) ; x2 . reshape ( jacRight . getNumCols ( ) , 1 ) ; multTransA ( jacLeft , residuals , x1 ) ; multTransA ( jacRight , residuals , x2 ) ; CommonOps_DDRM . insert ( x1 , gradient , 0 , 0 ... |
public class ChangeAvailabilityResponseHandler { /** * Handles the response when the change of availability has been accepted or scheduled , e . g . not rejected .
* @ param chargingStationId The charging station identifier .
* @ param domainService The domain service .
* @ param addOnIdentity The AddOn identity ... | if ( Changeavailability . Type . INOPERATIVE . equals ( availabilityType ) ) { if ( evseId . getNumberedId ( ) == 0 ) { domainService . changeChargingStationAvailabilityToInoperative ( chargingStationId , getCorrelationToken ( ) , addOnIdentity ) ; } else { domainService . changeComponentAvailabilityToInoperative ( cha... |
public class KillSessionsArgs { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } } | if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case SESSION_IDS : return isSetSessionIds ( ) ; case WHO : return isSetWho ( ) ; } throw new IllegalStateException ( ) ; |
public class MapperHelper { /** * 判断当前的接口方法是否需要进行拦截
* @ param msId
* @ return */
public MapperTemplate isMapperMethod ( String msId ) { } } | MapperTemplate mapperTemplate = getMapperTemplateByMsId ( msId ) ; if ( mapperTemplate == null ) { // 通过 @ RegisterMapper 注解自动注册的功能
try { Class < ? > mapperClass = getMapperClass ( msId ) ; if ( mapperClass . isInterface ( ) && hasRegisterMapper ( mapperClass ) ) { mapperTemplate = getMapperTemplateByMsId ( msId ) ; } ... |
public class IoTDiscoveryManager { /** * Thing Claiming - XEP - 0347 § 3.9 */
public IoTClaimed claimThing ( Collection < Tag > metaTags ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } } | return claimThing ( metaTags , true ) ; |
public class CachedCacheManager { /** * Bean may , but not necessarily , have deep hierarchies of references
* to other beans . Since a cache store beans per schema we must
* dig out this hierarchy and flatten it out , */
private Set < Bean > flattenReferences ( Bean bean ) { } } | Set < Bean > beans = new HashSet < > ( ) ; for ( String referenceName : bean . getReferenceNames ( ) ) { List < BeanId > ids = bean . getReference ( referenceName ) ; for ( BeanId id : ids ) { if ( id . getBean ( ) == null ) { continue ; } beans . addAll ( flattenReferences ( id . getBean ( ) ) ) ; } } beans . add ( be... |
public class JavaClasspathParser { /** * Returns the kind of a < code > PackageFragmentRoot < / code > from its < code > String < / code > form .
* @ param kindStr
* - string to test
* @ return the integer identifier of the type of the specified string : CPE _ PROJECT , CPE _ VARIABLE , CPE _ CONTAINER , etc . */... | if ( kindStr . equalsIgnoreCase ( "prj" ) ) { // $ NON - NLS - 1 $
return IClasspathEntry . CPE_PROJECT ; } if ( kindStr . equalsIgnoreCase ( "var" ) ) { // $ NON - NLS - 1 $
return IClasspathEntry . CPE_VARIABLE ; } if ( kindStr . equalsIgnoreCase ( "con" ) ) { // $ NON - NLS - 1 $
return IClasspathEntry . CPE_CONTAIN... |
public class MultimapJoiner { /** * Returns a multimap joiner with the same behavior as this one , except automatically substituting { @ code nullText } for
* any provided null keys or values . */
public MultimapJoiner useForNull ( final String nullText ) { } } | return new MultimapJoiner ( entryJoiner . useForNull ( nullText ) , separator , keyValueSeparator ) { @ Override protected CharSequence toString ( Object part ) { return ( part == null ) ? nullText : MultimapJoiner . this . toString ( part ) ; } @ Override public MultimapJoiner useForNull ( String nullText ) { throw ne... |
public class JQueryJsAppenderBehavior { /** * Factory method to create the rendered statement .
* @ param component
* the component
* @ return the char sequence */
public CharSequence newRenderedStatement ( final Component component ) { } } | final JsStatement statement = new JsQuery ( component ) . $ ( ) . chain ( statementLabel , JsUtils . quotes ( statementArgs ) ) ; // $ ( ' # component ' ) . statementLabel ( ' statementArgs ' ) ;
return statement . render ( ) ; |
public class TypeAnnotationPosition { /** * Create a { @ code TypeAnnotationPosition } for a constructor reference .
* @ param location The type path .
* @ param onLambda The lambda for this constructor reference .
* @ param pos The position from the associated tree node . */
public static TypeAnnotationPosition ... | return new TypeAnnotationPosition ( TargetType . CONSTRUCTOR_REFERENCE , pos , Integer . MIN_VALUE , onLambda , Integer . MIN_VALUE , Integer . MIN_VALUE , location ) ; |
public class OcrClient { /** * Gets the general recognition properties of specific image resource .
* The caller < i > must < / i > authenticate with a valid BCE Access Key / Private Key pair .
* @ param image The image data which needs to be base64
* @ return The general recognition properties of the image resou... | GeneralRecognitionRequest request = new GeneralRecognitionRequest ( ) . withImage ( image ) ; return generalRecognition ( request ) ; |
public class AdsServiceClientFactory { /** * Creates the proxy for the { @ link AdsServiceClient } .
* @ param < T > the service type
* @ param adsServiceClient the client to proxy
* @ return the proxy */
< T > T createProxy ( Class < T > interfaceClass , C adsServiceClient ) { } } | Set < Class < ? > > interfaces = Sets . newHashSet ( adsServiceClient . getClass ( ) . getInterfaces ( ) ) ; interfaces . add ( interfaceClass ) ; Object proxy = Proxy . newProxyInstance ( adsServiceClient . getSoapClient ( ) . getClass ( ) . getClassLoader ( ) , interfaces . toArray ( new Class [ ] { } ) , adsServiceC... |
public class CommerceNotificationTemplateLocalServiceBaseImpl { /** * Returns a range of all the commerce notification templates .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are i... | return commerceNotificationTemplatePersistence . findAll ( start , end ) ; |
public class ConjunctionImpl { /** * Add a SimpleTest to the Conjunction , searching for contradictions .
* @ param newTest the new SimpleTest to be added
* @ return true if the new test is compatible with the old ( a false return means the
* conjunction will always be false because the test is always false ) */
... | for ( int i = 0 ; i < tmpSimpleTests . size ( ) ; i ++ ) { SimpleTest cand = ( SimpleTest ) tmpSimpleTests . get ( i ) ; if ( cand . getIdentifier ( ) . getName ( ) . equals ( newTest . getIdentifier ( ) . getName ( ) ) ) { // Careful , may be operating in XPath selector domain , in which
// case we need more stringent... |
public class PrcItSpecEmbFlDel { /** * < p > Process entity request . < / p >
* @ param pReqVars additional request scoped parameters
* @ param pRequestData Request Data
* @ param pEntity Entity to process
* @ return Entity processed for farther process or null
* @ throws Exception - an exception */
@ Overrid... | File fileToDel ; if ( pEntity . getStringValue2 ( ) != null ) { fileToDel = new File ( pEntity . getStringValue2 ( ) ) ; if ( fileToDel . exists ( ) && ! fileToDel . delete ( ) ) { throw new ExceptionWithCode ( ExceptionWithCode . SOMETHING_WRONG , "Can not delete file: " + fileToDel ) ; } } if ( pEntity . getStringVal... |
public class StyleUtils { /** * Create new polygon options populated with the feature style
* @ param featureStyle feature style
* @ param density display density : { @ link android . util . DisplayMetrics # density }
* @ return polygon options populated with the feature style */
public static PolygonOptions crea... | PolygonOptions polygonOptions = new PolygonOptions ( ) ; setFeatureStyle ( polygonOptions , featureStyle , density ) ; return polygonOptions ; |
public class ConnectionDAODefaultImpl { public void init ( final Connection connection , final String devname , final String host , final String port ) throws DevFailed { } } | connection . url = new TangoUrl ( buildUrlName ( host , port , devname ) ) ; connection . devname = connection . url . devname ; connection . setDevice_is_dbase ( false ) ; // Check if connection is possible
if ( connection . url . protocol == TANGO ) { connection . ior = get_exported_ior ( connection ) ; } |
public class HttpServerHandler { /** * Instrument an incoming request before it is handled .
* < p > This method will create a span under the deserialized propagated parent context . If the
* parent context is not present , the span will be created under the current context .
* < p > The generated span will NOT b... | checkNotNull ( carrier , "carrier" ) ; checkNotNull ( request , "request" ) ; SpanBuilder spanBuilder = null ; String spanName = getSpanName ( request , extractor ) ; // de - serialize the context
SpanContext spanContext = null ; try { spanContext = textFormat . extract ( carrier , getter ) ; } catch ( SpanContextParse... |
public class WarningsResult { /** * { @ inheritDoc } */
public String getDisplayName ( ) { } } | if ( group == null ) { return Messages . Warnings_ProjectAction_Name ( ) ; } else { return ParserRegistry . getParser ( group ) . getLinkName ( ) . toString ( ) ; } |
public class CrystalBuilder { /** * Returns the list of unique interfaces that the given Structure has upon
* generation of all crystal symmetry mates . An interface is defined as any pair of chains
* that contact , i . e . for which there is at least a pair of atoms ( one from each chain ) within
* the given cut... | StructureInterfaceList set = new StructureInterfaceList ( ) ; // certain structures in the PDB are not macromolecules ( contain no polymeric chains at all ) , e . g . 1ao2
// with the current mmCIF parsing , those will be empty since purely non - polymeric chains are removed
// see commit e9562781f23da0ebf3547146a307d7... |
public class SourceLineAnnotation { /** * Factory method for creating a source line annotation describing the
* source line number for the instruction being visited by given visitor .
* @ param classContext
* the ClassContext
* @ param visitor
* a BetterVisitor which is visiting the method
* @ param pc
* ... | return fromVisitedInstructionRange ( classContext , visitor , pc , pc ) ; |
public class Polarizability { /** * calculates the mean molecular polarizability as described in paper of Kang and Jhorn .
* @ param atomContainer AtomContainer
* @ return polarizabilitiy */
public double calculateKJMeanMolecularPolarizability ( IAtomContainer atomContainer ) { } } | double polarizabilitiy = 0 ; IAtomContainer acH = atomContainer . getBuilder ( ) . newInstance ( IAtomContainer . class , atomContainer ) ; addExplicitHydrogens ( acH ) ; for ( int i = 0 ; i < acH . getAtomCount ( ) ; i ++ ) { polarizabilitiy += getKJPolarizabilityFactor ( acH , acH . getAtom ( i ) ) ; } return polariz... |
public class Javalin { /** * Adds a PATCH request handler for the specified path to the instance .
* @ see < a href = " https : / / javalin . io / documentation # handlers " > Handlers in docs < / a > */
public Javalin patch ( @ NotNull String path , @ NotNull Handler handler ) { } } | return addHandler ( HandlerType . PATCH , path , handler ) ; |
public class RowExtractors { /** * Obtain an extractor of a tuple containing each of the values from the supplied extractors .
* @ param extractors the extractors ; may not be null or empty
* @ return the tuple extractor */
public static ExtractFromRow extractorWith ( final Collection < ExtractFromRow > extractors ... | final int len = extractors . size ( ) ; assert len > 0 ; // There are a few cases where specific row extractor implementations would be better . . .
if ( len == 1 ) { return extractors . iterator ( ) . next ( ) ; } if ( len == 2 ) { Iterator < ExtractFromRow > iter = extractors . iterator ( ) ; ExtractFromRow first = i... |
public class ChangesListener { /** * Push changes to coordinator to apply . */
protected void pushChangesToCoordinator ( ChangesItem changesItem ) throws SecurityException , RPCException { } } | if ( ! changesItem . isEmpty ( ) ) { rpcService . executeCommandOnCoordinator ( applyPersistedChangesTask , true , changesItem ) ; } |
public class BeanDefinitionDtoConverterServiceImpl { /** * Convert from a DTO to an internal Spring bean definition .
* @ param beanDefinitionDto The DTO object .
* @ return Returns a Spring bean definition . */
public BeanDefinition toInternal ( BeanDefinitionInfo beanDefinitionInfo ) { } } | if ( beanDefinitionInfo instanceof GenericBeanDefinitionInfo ) { GenericBeanDefinitionInfo genericInfo = ( GenericBeanDefinitionInfo ) beanDefinitionInfo ; GenericBeanDefinition def = new GenericBeanDefinition ( ) ; def . setBeanClassName ( genericInfo . getClassName ( ) ) ; if ( genericInfo . getPropertyValues ( ) != ... |
public class LeaderAppender { /** * Triggers a heartbeat to a majority of the cluster .
* For followers to which no AppendRequest is currently being sent , a new empty AppendRequest will be
* created and sent . For followers to which an AppendRequest is already being sent , the appendEntries ( )
* call will piggy... | // If there are no other active members in the cluster , simply complete the append operation .
if ( context . getClusterState ( ) . getRemoteMemberStates ( ) . isEmpty ( ) ) return CompletableFuture . completedFuture ( null ) ; // If no heartbeat future already exists , that indicates there ' s no heartbeat currently ... |
public class QuantilesHelper { /** * Convert the weights into totals of the weights preceding each item
* @ param array of weights
* @ return total weight */
public static long convertToPrecedingCummulative ( final long [ ] array ) { } } | long subtotal = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) { final long newSubtotal = subtotal + array [ i ] ; array [ i ] = subtotal ; subtotal = newSubtotal ; } return subtotal ; |
public class LocaleUtils { /** * Resolves the best matching locale from the given set of preferred
* locales , supported locales and the default locale . Use ordered
* collections to get deterministic results and prevent unexpected behavior .
* The algorithm for resolving works as follows :
* < ol >
* < li > ... | // No point if there are no options
if ( supportedLocales == null || supportedLocales . isEmpty ( ) ) { return defaultLocale ; } else if ( preferredLocales == null || ! preferredLocales . hasNext ( ) ) { return defaultLocale ; } /* Use this as last fallback before using default locale */
final List < Locale > countryMa... |
public class AmazonRoute53Client { /** * Updates the resource record sets in a specified hosted zone that were created based on the settings in a
* specified traffic policy version .
* When you update a traffic policy instance , Amazon Route 53 continues to respond to DNS queries for the root
* resource record se... | request = beforeClientExecution ( request ) ; return executeUpdateTrafficPolicyInstance ( request ) ; |
public class ConfigRepository { /** * Create a new commit reflecting the provided properties , removing any property not mentioned here
* @ param name
* @ param email
* @ param data
* @ param message */
public void setAll ( final String name , final String email , final Map < String , Map < String , ConfigPrope... | set ( name , email , data , ConfigChangeMode . WIPE_ALL , message ) ; |
public class MarkdownParser { /** * Verify that JSON entities contain the required fields and that entity indices are correct . */
private void validateEntities ( JsonNode data ) throws InvalidInputException { } } | for ( JsonNode node : data . findParents ( INDEX_START ) ) { for ( String key : new String [ ] { INDEX_START , INDEX_END , ID , TYPE } ) { if ( node . path ( key ) . isMissingNode ( ) ) { throw new InvalidInputException ( "Required field \"" + key + "\" missing from the entity payload" ) ; } } int startIndex = node . g... |
public class Bip44WalletUtils { /** * Generates a BIP - 44 compatible Ethereum wallet on top of BIP - 39 generated seed .
* @ param password Will be used for both wallet encryption and passphrase for BIP - 39 seed
* @ param destinationDirectory The directory containing the wallet
* @ return A BIP - 39 compatible ... | return generateBip44Wallet ( password , destinationDirectory , false ) ; |
public class Prefs { /** * Removed all the stored keys and values .
* @ return the { @ link Editor } for chaining . The changes have already been committed / applied
* through the execution of this method .
* @ see android . content . SharedPreferences . Editor # clear ( ) */
public static Editor clear ( ) { } } | final Editor editor = getPreferences ( ) . edit ( ) . clear ( ) ; editor . apply ( ) ; return editor ; |
public class ReviewsImpl { /** * Publish video review to make it available for review .
* @ param teamName Your team name .
* @ param reviewId Id of the review .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws APIErrorException thrown if the request is rejected by server ... | publishVideoReviewWithServiceResponseAsync ( teamName , reviewId ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class VarNamePattern { /** * Returns true if this pattern is valid . */
public boolean isValid ( ) { } } | // Must be non - empty . . .
boolean valid = varNamePath_ != null ; if ( valid ) { // Containing a sequence of identifiers . . .
int i ; for ( i = 0 ; i < varNamePath_ . length && DefUtils . isIdentifier ( varNamePath_ [ i ] ) ; i ++ ) ; // Optionally terminated by a single wildcard .
int membersLeft = varNamePath_ . l... |
public class P1_QueryOp { /** * 查询列表
* @ param clazz
* @ param selectOnlyKey 是否只查询主键 , 只查询主键时 , 拦截器不进行拦截 , RelatedColumn也不处理
* @ param withCount 是否计算总数 , 将使用SQL _ CALC _ FOUND _ ROWS配合select FOUND _ ROWS ( ) ; 来查询
* @ param offset 从0开始 , null时不生效 ; 当offset不为null时 , 要求limit存在
* @ param limit null时不生效
* @ par... | "unchecked" , "rawtypes" } ) private < T > PageData < T > _getPage ( Class < T > clazz , boolean selectOnlyKey , boolean withCount , Integer offset , Integer limit , String postSql , Object ... args ) { StringBuilder sql = new StringBuilder ( ) ; sql . append ( SQLUtils . getSelectSQL ( clazz , selectOnlyKey , withCoun... |
public class CommerceShipmentPersistenceImpl { /** * Returns a range of all the commerce shipments .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thu... | return findAll ( start , end , null ) ; |
public class DropwizardMetricRegistry { /** * Creates a named { @ link Timer } that wraps a Dropwizard Metrics { @ link
* com . codahale . metrics . Timer } .
* @ param name
* @ return a { @ link Timer } that wraps a Dropwizard Metrics { @ link com . codahale . metrics . Timer } */
@ Override public Timer timer (... | final com . codahale . metrics . Timer timer = registry . timer ( name ) ; return new Timer ( ) { @ Override public Timer . Context time ( ) { final com . codahale . metrics . Timer . Context timerContext = timer . time ( ) ; return new Context ( ) { @ Override public void close ( ) { timerContext . close ( ) ; } } ; }... |
public class AIStreamIterator { /** * / * ( non - Javadoc )
* @ see java . util . Iterator # next ( ) */
public Object next ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "next" ) ; Long ticks ; RemoteMessageRequest remoteMessageRequest ; if ( msgIterator . hasNext ( ) ) { ticks = ( Long ) msgIterator . next ( ) ; remoteMessageRequest = new RemoteMessageRequest ( ticks . longValue ( ) , aiStr... |
public class DeepEquals { /** * Compare two objects with a ' deep ' comparison . This will traverse the
* Object graph and perform either a field - by - field comparison on each
* object ( if not . equals ( ) method has been overridden from Object ) , or it
* will call the customized . equals ( ) method if it exi... | Set < DualKey > visited = new HashSet < > ( ) ; Deque < DualKey > stack = new LinkedList < > ( ) ; Set < String > ignoreCustomEquals = ( Set < String > ) options . get ( IGNORE_CUSTOM_EQUALS ) ; stack . addFirst ( new DualKey ( a , b ) ) ; while ( ! stack . isEmpty ( ) ) { DualKey dualKey = stack . removeFirst ( ) ; vi... |
public class FindBugsWorker { /** * Run FindBugs on the given collection of resources from same project
* ( note : This is currently not thread - safe )
* @ param resources
* files or directories which should be on the project classpath .
* All resources must belong to the same project , and no one of
* the e... | if ( resources == null || resources . isEmpty ( ) ) { if ( DEBUG ) { FindbugsPlugin . getDefault ( ) . logInfo ( "No resources to analyse for project " + project ) ; } return ; } if ( DEBUG ) { System . out . println ( resources ) ; } st = new StopTimer ( ) ; st . newPoint ( "initPlugins" ) ; // make sure it ' s initia... |
public class cmppolicy { /** * Use this API to fetch all the cmppolicy resources that are configured on netscaler . */
public static cmppolicy [ ] get ( nitro_service service ) throws Exception { } } | cmppolicy obj = new cmppolicy ( ) ; cmppolicy [ ] response = ( cmppolicy [ ] ) obj . get_resources ( service ) ; return response ; |
public class CanalServerWithEmbedded { /** * 取消订阅 */
@ Override public void unsubscribe ( ClientIdentity clientIdentity ) throws CanalServerException { } } | CanalInstance canalInstance = canalInstances . get ( clientIdentity . getDestination ( ) ) ; canalInstance . getMetaManager ( ) . unsubscribe ( clientIdentity ) ; // 执行一下meta订阅
logger . info ( "unsubscribe successfully, {}" , clientIdentity ) ; |
public class AbstractProxySessionManager { /** * For testing */
public final long getSessionAcquireCount ( RaftGroupId groupId , long sessionId ) { } } | SessionState session = sessions . get ( groupId ) ; return session != null && session . id == sessionId ? session . acquireCount . get ( ) : 0 ; |
public class SwipeActionAdapter { /** * SwipeActionTouchListener . ActionCallbacks callback
* We just link it through to our own interface
* @ param listView The originating { @ link ListView } .
* @ param position The positions to perform the action on , sorted in descending order
* for convenience .
* @ par... | if ( mSwipeActionListener != null ) mSwipeActionListener . onSwipe ( position , direction ) ; |
public class StylesContainer { /** * Write the various styles in the automatic styles .
* @ param util an XML util
* @ param appendable the destination
* @ throws IOException if the styles can ' t be written */
public void writeContentAutomaticStyles ( final XMLUtil util , final Appendable appendable ) throws IOE... | final Iterable < ObjectStyle > styles = this . objectStylesContainer . getValues ( Dest . CONTENT_AUTOMATIC_STYLES ) ; for ( final ObjectStyle style : styles ) assert style . isHidden ( ) : style . toString ( ) ; this . write ( styles , util , appendable ) ; |
public class BaseMatchMethodPermutationBuilder { /** * Returns the statement arguments for the match method matcher statement . */
protected static Object [ ] getMatcherStatementArgs ( int matchedCount ) { } } | TypeName matcher = ParameterizedTypeName . get ( ClassName . get ( Matcher . class ) , TypeName . OBJECT ) ; TypeName listOfMatchers = ParameterizedTypeName . get ( ClassName . get ( List . class ) , matcher ) ; TypeName lists = TypeName . get ( Lists . class ) ; TypeName argumentMatchers = TypeName . get ( ArgumentMat... |
public class RaftNodeImpl { /** * Takes a snapshot if { @ code commitIndex } advanced equal to or more than
* { @ link RaftAlgorithmConfig # getCommitIndexAdvanceCountToSnapshot ( ) } .
* Snapshot is not created if there ' s an ongoing membership change or Raft group is being destroyed . */
private void takeSnapsho... | long commitIndex = state . commitIndex ( ) ; if ( ( commitIndex - state . log ( ) . snapshotIndex ( ) ) < commitIndexAdvanceCountToSnapshot ) { return ; } if ( isTerminatedOrSteppedDown ( ) ) { // If the status is UPDATING _ MEMBER _ LIST or TERMINATING , it means the status is normally ACTIVE
// and there is an append... |
public class Statistics { /** * Get the estimated saving of this code in bytes when RAIDing is done
* @ return The saving in bytes */
public long getDoneSaving ( Configuration conf ) { } } | try { DFSClient dfs = ( ( DistributedFileSystem ) FileSystem . get ( conf ) ) . getClient ( ) ; Counters raidedCounters = stateToSourceCounters . get ( RaidState . RAIDED ) ; Counters shouldRaidCounters = stateToSourceCounters . get ( RaidState . NOT_RAIDED_BUT_SHOULD ) ; long physical = estimatedDoneSourceSize + estim... |
public class CopyCallable { /** * Performs the copy of an Amazon S3 object from source bucket to
* destination bucket as multiple copy part requests . The information about
* the part to be copied is specified in the request as a byte range
* ( first - last )
* @ throws Exception
* Any Exception that occurs w... | multipartUploadId = initiateMultipartUpload ( copyObjectRequest ) ; long optimalPartSize = getOptimalPartSize ( metadata . getContentLength ( ) ) ; try { CopyPartRequestFactory requestFactory = new CopyPartRequestFactory ( copyObjectRequest , multipartUploadId , optimalPartSize , metadata . getContentLength ( ) ) ; cop... |
public class AsteriskQueueImpl { /** * Returns a member by its location .
* @ param location ot the member
* @ return the member by its location . */
AsteriskQueueMemberImpl getMember ( String location ) { } } | synchronized ( members ) { if ( members . containsKey ( location ) ) { return members . get ( location ) ; } } return null ; |
public class FormatUtils { /** * Parses a byte array into a hex string where each byte is represented in the
* format { @ code % 02x } .
* @ param bytes the byte array to be transformed
* @ param prefix the prefix to use
* @ param separator the separator to use
* @ return the string representation of the byte... | StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < bytes . length ; i ++ ) { sb . append ( String . format ( "%s%02x" , prefix , bytes [ i ] ) ) ; if ( i != bytes . length - 1 ) { sb . append ( separator ) ; } } return sb . toString ( ) ; |
public class PropertyController { /** * Deletes the value of a property .
* @ param entityType Type of the entity to edit
* @ param id ID of the entity to edit
* @ param propertyTypeName Fully qualified name of the property to delete */
@ RequestMapping ( value = "{entityType}/{id}/{propertyTypeName}/edit" , meth... | return propertyService . deleteProperty ( getEntity ( entityType , id ) , propertyTypeName ) ; |
public class CreateLoadBalancer { /** * Creates an Application Load Balancer .
* To create listeners for your load balancer , use CreateListener . You can add security groups , subnets , and tags when
* you create your load balancer , or you can add them later using SetSecurityGroups , SetSubnets , and AddTags . To... | @ Output ( OutputNames . RETURN_CODE ) , @ Output ( OutputNames . RETURN_RESULT ) , @ Output ( OutputNames . EXCEPTION ) } , responses = { @ Response ( text = SUCCESS , field = OutputNames . RETURN_CODE , value = SUCCESS_RETURN_CODE , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . RESOLVED ) , @ ... |
public class StyleUtilities { /** * Converts a style to its string representation to be written to file .
* @ param style the style to convert .
* @ return the style string .
* @ throws Exception */
public static String styleToString ( Style style ) throws Exception { } } | StyledLayerDescriptor sld = sf . createStyledLayerDescriptor ( ) ; UserLayer layer = sf . createUserLayer ( ) ; layer . setLayerFeatureConstraints ( new FeatureTypeConstraint [ ] { null } ) ; sld . addStyledLayer ( layer ) ; layer . addUserStyle ( style ) ; SLDTransformer aTransformer = new SLDTransformer ( ) ; aTransf... |
public class SipStack { /** * FOR INTERNAL USE ONLY . Not to be used by a test program . */
public void processTimeout ( TimeoutEvent arg0 ) { } } | synchronized ( listeners ) { Iterator < SipListener > iter = listeners . iterator ( ) ; while ( iter . hasNext ( ) == true ) { SipListener listener = ( SipListener ) iter . next ( ) ; listener . processTimeout ( arg0 ) ; } } |
public class TSSyntax { /** * Create a TS * Syntax class around the provided ClassTemplate .
* That class will perform the heavy lifting of rendering TS - specific strings into the template .
* @ param template the ClassTemplate
* @ return a TS * Syntax class ( see { @ link TSSyntax } class - level docs for more ... | if ( template instanceof RecordTemplateSpec ) { return new TSRecordSyntax ( ( RecordTemplateSpec ) template ) ; } else if ( template instanceof TyperefTemplateSpec ) { return TSTyperefSyntaxCreate ( ( TyperefTemplateSpec ) template ) ; } else if ( template instanceof FixedTemplateSpec ) { return TSFixedSyntaxCreate ( (... |
public class Inject { /** * Returns an injector implementation which uses the given dependency
* object ' s type to infer which setter / field to inject .
* @ param target
* The target object for injection . */
public static IVarargDependencyInjector bean ( final Object target ) { } } | return new AbstractVarargDependencyInjector ( ) { public void with ( Object ... dependencies ) { TypeBasedInjector injector = new TypeBasedInjector ( ) ; for ( Object dependency : dependencies ) { injector . validateInjectionOf ( target , dependency ) ; } for ( Object dependency : dependencies ) { injector . inject ( t... |
public class AptControlImplementation { /** * Enforces the VersionRequired annotation for control extensions . */
private void enforceVersionSupported ( ) { } } | if ( _versionSupported != null ) { int majorSupported = _versionSupported . major ( ) ; int minorSupported = _versionSupported . minor ( ) ; if ( majorSupported < 0 ) // no real version support requirement
return ; AptControlInterface ci = getControlInterface ( ) ; if ( ci == null ) return ; int majorPresent = - 1 ; in... |
public class CoverSheetBase { /** * Override load list to clear display if no patient in context . */
@ Override protected void loadData ( ) { } } | if ( patient == null ) { asyncAbort ( ) ; reset ( ) ; status ( "No patient selected." ) ; } else { super . loadData ( ) ; } detailView . setValue ( null ) ; |
public class RingBufferDiagnostics { /** * Returns the count of all requests in the ringbuffer */
@ InterfaceAudience . Public @ InterfaceStability . Experimental public int totalCount ( ) { } } | int total = countNonService ; for ( Map . Entry < ServiceType , Integer > entry : counts . entrySet ( ) ) { total += entry . getValue ( ) ; } return total ; |
public class FunctionUtils { /** * Search for functions in string and replace with respective function result .
* @ param str to parse
* @ return parsed string result */
public static String replaceFunctionsInString ( String str , TestContext context ) { } } | return replaceFunctionsInString ( str , context , false ) ; |
public class WebhookUtils { /** * Utility method to process the webhook notification from { @ link HttpServlet # doPost } .
* The { @ link HttpServletRequest # getInputStream ( ) } is closed in a finally block inside this
* method . If it is not detected to be a webhook notification , an
* { @ link HttpServletRes... | Preconditions . checkArgument ( "POST" . equals ( req . getMethod ( ) ) ) ; InputStream contentStream = req . getInputStream ( ) ; try { // log headers
if ( LOGGER . isLoggable ( Level . CONFIG ) ) { StringBuilder builder = new StringBuilder ( ) ; Enumeration < ? > e = req . getHeaderNames ( ) ; if ( e != null ) { whil... |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getTBMDIRCTION ( ) { } } | if ( tbmdirctionEEnum == null ) { tbmdirctionEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 74 ) ; } return tbmdirctionEEnum ; |
public class JacksonJsonDataFormat { /** * Identifies the canonical type of an object heuristically .
* @ return the canonical type identifier of the object ' s class
* according to Jackson ' s type format ( see { @ link TypeFactory # constructFromCanonical ( String ) } ) */
public String getCanonicalTypeName ( Obj... | ensureNotNull ( "object" , object ) ; for ( TypeDetector typeDetector : typeDetectors ) { if ( typeDetector . canHandle ( object ) ) { return typeDetector . detectType ( object ) ; } } throw LOG . unableToDetectCanonicalType ( object ) ; |
public class JFeatureSpec { /** * Java wrapper for { @ link FeatureSpec # extractWithSettings ( String , FeatureBuilder , ClassTag ) . */
public JRecordExtractor < T , SparseLabeledPoint > extractWithSubsetSettingsSparseLabeledPoint ( String settings ) { } } | return new JRecordExtractor < > ( JavaOps . extractWithSubsetSettingsSparseLabeledPoint ( self , settings ) ) ; |
public class FailoverWatcher { /** * Deal with create node event , just call the leader election .
* @ param path which znode is created */
protected void processNodeCreated ( String path ) { } } | if ( path . equals ( masterZnode ) ) { LOG . info ( masterZnode + " created and try to become active master" ) ; handleMasterNodeChange ( ) ; } |
public class AddCrmBasedUserList { /** * Runs the example .
* @ param adWordsServices the services factory .
* @ param session the session .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors .
* @ throws... | // Get the UserListService .
AdwordsUserListServiceInterface userListService = adWordsServices . get ( session , AdwordsUserListServiceInterface . class ) ; // Create a user list .
CrmBasedUserList userList = new CrmBasedUserList ( ) ; userList . setName ( "Customer relationship management list #" + System . currentTim... |
public class AbstractLoginManager { /** * Main login routine .
* @ param aRequestScope
* Request scope
* @ param aUnifiedResponse
* Response
* @ return { @ link EContinue # BREAK } to indicate that no user is logged in and
* therefore the login screen should be shown ,
* { @ link EContinue # CONTINUE } if... | final LoggedInUserManager aLoggedInUserManager = LoggedInUserManager . getInstance ( ) ; String sSessionUserID = aLoggedInUserManager . getCurrentUserID ( ) ; boolean bLoggedInInThisRequest = false ; if ( sSessionUserID == null ) { // No user currently logged in - > start login
boolean bLoginError = false ; ICredential... |
public class CancelSchemaExtensionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CancelSchemaExtensionRequest cancelSchemaExtensionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( cancelSchemaExtensionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( cancelSchemaExtensionRequest . getDirectoryId ( ) , DIRECTORYID_BINDING ) ; protocolMarshaller . marshall ( cancelSchemaExtensionRequest . getSchemaExtensio... |
public class RedBlackTreeLong { /** * Returns the node containing the key just before the given key . */
public Node < T > getPrevious ( long value ) { } } | if ( value == first . value ) return null ; if ( value == root . value ) { if ( root . left == null ) return null ; Node < T > n = root . left ; while ( n . right != null ) n = n . right ; return n ; } if ( value < root . value ) { if ( root . left == null ) return null ; return getPrevious ( root . left , value ) ; } ... |
public class PolyBind { /** * Sets up a " choice " for the injector to resolve at injection time .
* @ param binder the binder for the injector that is being configured
* @ param property the property that will be checked to determine the implementation choice
* @ param interfaceKey the interface that will be inj... | return createChoiceWithDefault ( binder , property , interfaceKey , defaultKey , null ) ; |
public class DataJoinReducerBase { /** * This is the function that re - groups values for a key into sub - groups based
* on a secondary key ( input tag ) .
* @ param arg1
* @ return */
private SortedMap < Object , ResetableIterator > regroup ( Object key , Iterator arg1 , Reporter reporter ) throws IOException {... | this . numOfValues = 0 ; SortedMap < Object , ResetableIterator > retv = new TreeMap < Object , ResetableIterator > ( ) ; TaggedMapOutput aRecord = null ; while ( arg1 . hasNext ( ) ) { this . numOfValues += 1 ; if ( this . numOfValues % 100 == 0 ) { reporter . setStatus ( "key: " + key . toString ( ) + " numOfValues: ... |
public class Logger { /** * Issue a log message with parameters and a throwable with a level of ERROR .
* @ param message the message
* @ param params the message parameters
* @ param t the throwable
* @ deprecated To log a message with parameters , using { @ link # errorv ( Throwable , String , Object . . . ) ... | doLog ( Level . ERROR , FQCN , message , params , t ) ; |
public class Mapper { /** * Create a new Map by using the array objects as keys , and the mapping result as values . Discard keys which return
* null values from the mapper .
* @ param mapper a Mapper to map the values
* @ param a array of items
* @ return a new Map with values mapped */
public static Map makeM... | return makeMap ( mapper , java . util . Arrays . asList ( a ) , false ) ; |
public class PlotCanvas { /** * Adds a label to this canvas . */
public void label ( String text , Font font , double ... coord ) { } } | Label label = new Label ( text , coord ) ; label . setFont ( font ) ; add ( label ) ; |
public class AmazonKinesisVideoArchivedMediaClient { /** * Gets media for a list of fragments ( specified by fragment number ) from the archived data in an Amazon Kinesis
* video stream .
* < note >
* You must first call the < code > GetDataEndpoint < / code > API to get an endpoint . Then send the
* < code > G... | request = beforeClientExecution ( request ) ; return executeGetMediaForFragmentList ( request ) ; |
public class FilePanelService { /** * Checks for matching exclude patterns . */
private static boolean exclude ( String host , java . nio . file . Path path ) { } } | List < PathMatcher > exclusions = getExcludes ( host ) ; if ( exclusions == null && host != null ) { exclusions = getExcludes ( null ) ; // check global config
} if ( exclusions != null ) { for ( PathMatcher matcher : exclusions ) { if ( matcher . matches ( path ) ) return true ; } } return false ; |
public class MessageBundleControl { /** * ( non - Javadoc )
* @ see java . util . ResourceBundle . Control # getTimeToLive ( java . lang . String ,
* java . util . Locale ) */
@ Override public long getTimeToLive ( String baseName , Locale locale ) { } } | if ( baseName == null || locale == null ) { throw new NullPointerException ( ) ; } return TTL_DONT_CACHE ; |
public class UserPasswordChange { /** * Do the special HTML command .
* This gives the screen a chance to change screens for special HTML commands .
* You have a chance to change two things :
* 1 . The information display line ( this will display on the next screen . . . ie . , submit was successful )
* 2 . The... | ScreenModel screen = super . doServletCommand ( screenParent ) ; // Process params from previous screen
if ( MenuConstants . SUBMIT . equalsIgnoreCase ( this . getProperty ( DBParams . COMMAND ) ) ) { if ( this . getTask ( ) . getStatusText ( DBConstants . WARNING_MESSAGE ) == null ) { // Normal return = logged in , go... |
public class DiameterStackMultiplexer { /** * = = = = = EventListener < Request , Answer > IMPLEMENTATION = = = = = */
@ Override public void receivedSuccessMessage ( Request request , Answer answer ) { } } | DiameterListener listener = findListener ( request ) ; if ( listener != null ) { listener . receivedSuccessMessage ( request , answer ) ; } |
public class Bitstream { /** * Parses the data previously read with read _ frame _ data ( ) . */
void parse_frame ( ) { } } | // Convert Bytes read to int
int b = 0 ; byte [ ] byteread = frame_bytes ; int bytesize = framesize ; // Check ID3v1 TAG ( True only if last frame ) .
// for ( int t = 0 ; t < ( byteread . length ) - 2 ; t + + )
// if ( ( byteread [ t ] = = ' T ' ) & & ( byteread [ t + 1 ] = = ' A ' ) & & ( byteread [ t + 2 ] = = ' G '... |
public class cudnnStatus { /** * Returns a string representation of the given constant
* @ return A string representation of the given constant */
public static String stringFor ( int n ) { } } | switch ( n ) { case CUDNN_STATUS_SUCCESS : return "CUDNN_STATUS_SUCCESS" ; case CUDNN_STATUS_NOT_INITIALIZED : return "CUDNN_STATUS_NOT_INITIALIZED" ; case CUDNN_STATUS_ALLOC_FAILED : return "CUDNN_STATUS_ALLOC_FAILED" ; case CUDNN_STATUS_BAD_PARAM : return "CUDNN_STATUS_BAD_PARAM" ; case CUDNN_STATUS_INTERNAL_ERROR : ... |
public class EvidenceManager { /** * エビデンスファイルに出力する文字列を構築します 。
* @ return エビデンスファイルに出力する文字列 */
private String build ( Evidence evidence ) { } } | VelocityContext context = new VelocityContext ( ) ; StringWriter writer = new StringWriter ( ) ; context . put ( "records" , evidence . getRecords ( ) ) ; context . put ( "caseNo" , evidence . getCaseNo ( ) ) ; context . put ( "testScriptName" , evidence . getScriptName ( ) ) ; context . put ( "result" , ( evidence . h... |
public class Director { /** * Get installed feature collections
* @ return Map of feature name to InstalledFeatureCollection */
public Map < String , InstalledFeatureCollection > getInstalledFeatureCollections ( ) { } } | try { Map < String , InstalledFeatureCollection > installedFeatureCollections = new TreeMap < String , InstalledFeatureCollection > ( ) ; Map < String , ProvisioningFeatureDefinition > fdMap = product . getFeatureCollectionDefinitions ( ) ; for ( Entry < String , ProvisioningFeatureDefinition > entry : fdMap . entrySet... |
public class MSPDIWriter { /** * This method writes data for a single assignment to an MSPDI file .
* @ param mpx Resource assignment data
* @ return New MSPDI assignment instance */
private Project . Assignments . Assignment writeAssignment ( ResourceAssignment mpx ) { } } | Project . Assignments . Assignment xml = m_factory . createProjectAssignmentsAssignment ( ) ; xml . setActualCost ( DatatypeConverter . printCurrency ( mpx . getActualCost ( ) ) ) ; xml . setActualFinish ( mpx . getActualFinish ( ) ) ; xml . setActualOvertimeCost ( DatatypeConverter . printCurrency ( mpx . getActualOve... |
public class NonBlockingPushbackReader { /** * Reads a single character .
* @ return The character read , or - 1 if the end of the stream has been reached
* @ exception IOException
* If an I / O error occurs */
@ Override public int read ( ) throws IOException { } } | _ensureOpen ( ) ; if ( m_nBufPos < m_aBuf . length ) return m_aBuf [ m_nBufPos ++ ] ; return super . read ( ) ; |
public class TopScreen { /** * Initialize .
* @ param itsLocation The location of this component within the parent .
* @ param parentScreen The parent screen .
* @ param fieldConverter The field this screen field is linked to .
* @ param iDisplayFieldDesc Do I display the field desc ?
* @ param properties Ext... | if ( ! ( parentScreen instanceof BasePanel ) ) { // The parent is an SApplet ( but the view packages are not accessible from here )
m_recordOwnerParent = parentScreen ; if ( properties != null ) if ( properties . get ( DBParams . TASK ) instanceof Task ) m_recordOwnerParent = ( Task ) properties . get ( DBParams . TASK... |
public class LabsInner { /** * Create or replace an existing Lab .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ param labName The name of the lab .
* @ param lab Represents a lab .
* @ param serviceCallback the async ServiceCallback to... | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , labAccountName , labName , lab ) , serviceCallback ) ; |
public class GenJsCodeVisitorAssistantForMsgs { /** * Builds the googMsgVarName for an MsgNode . */
private String buildGoogMsgVarNameHelper ( MsgNode msgNode ) { } } | // NOTE : MSG _ UNNAMED / MSG _ EXTERNAL are a special tokens recognized by the jscompiler . MSG _ UNNAMED
// disables the default logic that requires all messages to be uniquely named .
// and MSG _ EXTERNAL causes the jscompiler to not extract these messages .
String desiredName = jsSrcOptions . googMsgsAreExternal (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.