signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class sslservice { /** * Use this API to unset the properties of sslservice resource .
* Properties that need to be unset are specified in args array . */
public static base_response unset ( nitro_service client , sslservice resource , String [ ] args ) throws Exception { } } | sslservice unsetresource = new sslservice ( ) ; unsetresource . servicename = resource . servicename ; return unsetresource . unset_resource ( client , args ) ; |
public class CollectionDescriptor { /** * @ see XmlCapable # toXML ( ) */
public String toXML ( ) { } } | RepositoryTags tags = RepositoryTags . getInstance ( ) ; String eol = SystemUtils . LINE_SEPARATOR ; // write opening tag
String result = " " + tags . getOpeningTagNonClosingById ( COLLECTION_DESCRIPTOR ) + eol ; // write attributes
// name
result += " " + tags . getAttribute ( FIELD_NAME , this . getAttrib... |
public class PollTcpManagerNio { /** * Starts the manager . */
@ Override public boolean start ( ) { } } | if ( ! _lifecycle . toStarting ( ) ) { return false ; } log . isLoggable ( Level . FINER ) ; String name = "resin-nio-select-manager-" + _gId ++ ; _thread = new Thread ( this , name ) ; _thread . setDaemon ( true ) ; _thread . start ( ) ; _lifecycle . waitForActive ( 2000 ) ; if ( log . isLoggable ( Level . FINER ) ) l... |
public class Utils { /** * Replies if the given annotation is an annotation from the SARL core library .
* @ param type the type of the annotation
* @ return < code > true < / code > if the given type is a SARL annotation . */
public static boolean isSARLAnnotation ( Class < ? > type ) { } } | return ( type != null && Annotation . class . isAssignableFrom ( type ) ) && isSARLAnnotation ( type . getPackage ( ) . getName ( ) ) ; |
public class Executors { /** * Creates a work - stealing thread pool using the number of
* { @ linkplain Runtime # availableProcessors available processors }
* as its target parallelism level .
* @ return the newly created thread pool
* @ see # newWorkStealingPool ( int )
* @ since 1.8 */
public static Execut... | return new ForkJoinPool ( Runtime . getRuntime ( ) . availableProcessors ( ) , ForkJoinPool . defaultForkJoinWorkerThreadFactory , null , true ) ; |
public class ErrorReporterImpl { /** * ( non - Javadoc )
* @ see
* java . lang . Thread . UncaughtExceptionHandler # uncaughtException ( java . lang
* . Thread , java . lang . Throwable ) */
@ Override public void uncaughtException ( @ Nullable Thread t , @ NonNull Throwable e ) { } } | // If we ' re not enabled then just pass the Exception on to the defaultExceptionHandler .
if ( ! reportExecutor . isEnabled ( ) ) { reportExecutor . handReportToDefaultExceptionHandler ( t , e ) ; return ; } try { ACRA . log . e ( LOG_TAG , "ACRA caught a " + e . getClass ( ) . getSimpleName ( ) + " for " + context . ... |
public class Chars { /** * 判断字符中每个字符的类型
* @ param str 字符串
* @ see Chars # getType ( char ) */
public static CharType [ ] getType ( String str ) { } } | CharType [ ] tag = new CharType [ str . length ( ) ] ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { char c = str . charAt ( i ) ; tag [ i ] = getType ( c ) ; } return tag ; |
public class CATAsynchReadAheadReader { /** * Safely stop the consumer
* @ param Message to be traced for stop reason . */
public void stopConsumer ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "stopConsumer" ) ; try { // lock the consumerSession to ensure visibility of update to started .
synchronized ( consumerSession ) { consumerSession . getConsumerSession ( ) . stop ( ) ; consumerSession . started = fal... |
public class N { /** * The present order is kept in the result list .
* @ param a
* @ param n
* @ param cmp
* @ return */
public static < T > List < T > topp ( final T [ ] a , final int n , final Comparator < ? super T > cmp ) { } } | return topp ( a , 0 , len ( a ) , n , cmp ) ; |
public class UsersAPIClient { /** * Update the user _ metadata calling < a href = " https : / / auth0 . com / docs / api / management / v2 # ! / Users / patch _ users _ by _ id " > ' / api / v2 / users / : userId ' < / a > endpoint
* Example usage :
* < pre >
* { @ code
* client . updateMetadata ( " { user id }... | HttpUrl url = HttpUrl . parse ( auth0 . getDomainUrl ( ) ) . newBuilder ( ) . addPathSegment ( API_PATH ) . addPathSegment ( V2_PATH ) . addPathSegment ( USERS_PATH ) . addPathSegment ( userId ) . build ( ) ; return factory . PATCH ( url , client , gson , UserProfile . class , mgmtErrorBuilder ) . addParameter ( USER_M... |
public class LogFileHeader { /** * Return the firstRecordSequenceNumber field stored in the target header
* @ return long The firstRecordSequenceNumber field . */
public long firstRecordSequenceNumber ( ) { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "firstRecordSequenceNumber" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "firstRecordSequenceNumber" , new Long ( _firstRecordSequenceNumber ) ) ; return _firstRecordSequenceNumber ; |
public class MinioClient { /** * Creates a bucket with default region .
* @ param bucketName Bucket name .
* @ throws InvalidBucketNameException upon invalid bucket name is given
* @ throws NoSuchAlgorithmException
* upon requested algorithm was not found during signature calculation
* @ throws IOException up... | this . makeBucket ( bucketName , null ) ; |
public class HttpConnector { /** * Returns the system port for this connector . */
public int getPort ( ) { } } | if ( port != 0 ) { return port ; } else { final Connector connector = connectorHolder . get ( ) ; if ( connector != null ) { Preconditions . checkState ( connector . getLocalPort ( ) > 0 , "no port was set and the connector is not yet started!" ) ; return connector . getLocalPort ( ) ; } else { return 0 ; } } |
public class PropertiesField { /** * Set this property in the user ' s property area .
* @ param strProperty The property key .
* @ param strValue The property value .
* @ param iDisplayOption If true , display the new field .
* @ param iMoveMove The move mode .
* @ return An error code ( NORMAL _ RETURN for ... | if ( m_propertiesCache == null ) m_propertiesCache = this . loadProperties ( ) ; boolean bChanged = false ; // If strValue = = null , delete ; if = ' ' , it ' s okay ( key = ' ' ) [ a blank property ] !
if ( strValue == null ) { if ( m_propertiesCache . get ( strProperty ) != null ) { m_propertiesCache . remove ( strPr... |
public class StoreVersionManager { /** * Inspects the specified versionDir to see if it has been marked as disabled
* ( via a . disabled file in the directory ) . If the file is absent , the store is
* assumed to be enabled .
* @ param versionDir to inspect
* @ return true if the specified version is enabled , ... | if ( ! versionDir . exists ( ) ) { throw new IllegalArgumentException ( "The versionDir " + versionDir . getName ( ) + " does not exist." ) ; } File [ ] relevantFile = versionDir . listFiles ( new FileFilter ( ) { public boolean accept ( File pathName ) { return pathName . getName ( ) . equals ( DISABLED_MARKER_NAME ) ... |
public class BufferedServletResponseWrapper { /** * headers relates methods */
@ Override public void sendError ( int sc , String msg ) throws IOException { } } | if ( isCommitted ( ) ) { throw new IllegalStateException ( "Cannot set error status - response is already committed" ) ; } notifyBeforeCommit ( ) ; super . sendError ( sc , msg ) ; setCommitted ( ) ; |
public class BooleanExpressionParser { /** * Counterpart of { @ link # replaceBooleanStringByIntegerRepresentation }
* Checks whether a String is the Integer representation of a Boolean value and replaces it with its Boolean representation
* " 1 " - > " true "
* " 0 " - > " false "
* otherwise - > value
* @ p... | if ( value . equals ( "0" ) ) { return FALSE . toString ( ) ; } else if ( value . equals ( "1" ) ) { return TRUE . toString ( ) ; } return value ; |
public class Channel { /** * Register a chaincode event listener . Both chaincodeId pattern AND eventName pattern must match to invoke
* the chaincodeEventListener
* @ param chaincodeId Java pattern for chaincode identifier also know as chaincode name . If ma
* @ param eventName Java pattern to match the event na... | if ( shutdown ) { throw new InvalidArgumentException ( format ( "Channel %s has been shutdown." , name ) ) ; } if ( chaincodeId == null ) { throw new InvalidArgumentException ( "The chaincodeId argument may not be null." ) ; } if ( eventName == null ) { throw new InvalidArgumentException ( "The eventName argument may n... |
public class MVELEvalBuilder { /** * Builds and returns an Eval Conditional Element
* @ param context The current build context
* @ param descr The Eval Descriptor to build the eval conditional element from
* @ return the Eval Conditional Element */
public RuleConditionElement build ( final RuleBuildContext conte... | boolean typesafe = context . isTypesafe ( ) ; // it must be an EvalDescr
final EvalDescr evalDescr = ( EvalDescr ) descr ; try { MVELDialect dialect = ( MVELDialect ) context . getDialect ( "mvel" ) ; Map < String , Declaration > decls = context . getDeclarationResolver ( ) . getDeclarations ( context . getRule ( ) ) ;... |
public class ZipExtensions { /** * Extract zip entry .
* @ param zipFile
* the zip file
* @ param target
* the target
* @ param toDirectory
* the to directory
* @ throws IOException
* Signals that an I / O exception has occurred . */
public static void extractZipEntry ( final ZipFile zipFile , final Zip... | final File fileToExtract = new File ( toDirectory , target . getName ( ) ) ; new File ( fileToExtract . getParent ( ) ) . mkdirs ( ) ; try ( InputStream is = zipFile . getInputStream ( target ) ; BufferedInputStream bis = new BufferedInputStream ( is ) ; FileOutputStream fos = new FileOutputStream ( fileToExtract ) ; B... |
public class JSON { /** * Write a reconfiguration plan .
* @ param plan the plan to write
* @ param a the stream to write on .
* @ throws IllegalArgumentException if an error occurred while writing the json */
public static void write ( ReconfigurationPlan plan , Appendable a ) { } } | try { ReconfigurationPlanConverter c = new ReconfigurationPlanConverter ( ) ; c . toJSON ( plan ) . writeJSONString ( a ) ; } catch ( IOException | JSONConverterException e ) { throw new IllegalArgumentException ( e ) ; } |
public class TitlePaneButtonForegroundPainter { /** * Paint the mouse - over state of the button foreground .
* @ param g the Graphics2D context to paint with .
* @ param c the button to paint .
* @ param width the width to paint .
* @ param height the height to paint . */
public void paintHover ( Graphics2D g ... | paint ( g , c , width , height , hoverBorder , hoverCorner , hoverInterior ) ; |
public class QueueBuffer { /** * Deletes a message from SQS . Does not return until a confirmation from SQS has been received
* @ return never null */
public DeleteMessageResult deleteMessageSync ( DeleteMessageRequest request ) { } } | Future < DeleteMessageResult > future = deleteMessage ( request , null ) ; return waitForFuture ( future ) ; |
public class WXBizMsgCrypt { /** * 将公众平台回复用户的消息加密打包 .
* < ol >
* < li > 对要发送的消息进行AES - CBC加密 < / li >
* < li > 生成安全签名 < / li >
* < li > 将消息密文和安全签名打包成xml格式 < / li >
* < / ol >
* @ param replyMsg 公众平台待回复用户的消息 , xml格式的字符串
* @ param timeStamp 时间戳 , 可以自己生成 , 也可以用URL参数的timestamp
* @ param nonce 随机串 , 可以自己生成 ,... | // 加密
String encrypt = encrypt ( getRandomStr ( ) , replyMsg ) ; // 生成安全签名
if ( timeStamp . equals ( "" ) ) { timeStamp = Long . toString ( System . currentTimeMillis ( ) ) ; } String signature = SHA1 . getSHA1 ( token , timeStamp , nonce , encrypt ) ; return XMLParser . generate ( encrypt , signature , timeStamp , non... |
public class VForDefinition { /** * v - for on an array with just a loop variable and an index : " ( Item item , index ) in myArray "
* @ param loopVariablesDefinition The variable definition ( " ( Item item , index ) " above )
* @ param context The context of the parser
* @ return true if we managed the case , f... | Matcher matcher = VFOR_VARIABLE_AND_INDEX . matcher ( loopVariablesDefinition ) ; if ( matcher . matches ( ) ) { initLoopVariable ( matcher . group ( 1 ) , matcher . group ( 2 ) , context ) ; initIndexVariable ( matcher . group ( 3 ) , context ) ; return true ; } return false ; |
public class DepTreeNode { /** * Removes the specified child node
* @ param child
* The node to remove */
public void remove ( DepTreeNode child ) { } } | if ( children != null ) { DepTreeNode node = children . get ( child . getName ( ) ) ; if ( node == child ) { children . remove ( child . getName ( ) ) ; } } child . setParent ( null ) ; |
public class ComputeNodeOperations { /** * Updates the specified user account on the specified compute node .
* @ param poolId The ID of the pool that contains the compute node .
* @ param nodeId The ID of the compute node where the user account will be updated .
* @ param userName The name of the user account to... | updateComputeNodeUser ( poolId , nodeId , userName , sshPublicKey , ( Iterable < BatchClientBehavior > ) null ) ; |
public class CacheConfigurationBuilder { /** * Adds { @ link ExpiryPolicy } configuration to the returned builder .
* { @ code ExpiryPolicy } is what controls data freshness in a cache .
* @ param expiry the expiry to use
* @ return a new builder with the added expiry */
public CacheConfigurationBuilder < K , V >... | if ( expiry == null ) { throw new NullPointerException ( "Null expiry" ) ; } CacheConfigurationBuilder < K , V > otherBuilder = new CacheConfigurationBuilder < > ( this ) ; otherBuilder . expiry = expiry ; return otherBuilder ; |
public class GregorianCalendar { /** * Computes the fixed date under either the Gregorian or the
* Julian calendar , using the given year and the specified calendar fields .
* @ param cal the CalendarSystem to be used for the date calculation
* @ param year the normalized year number , with 0 indicating the
* y... | int month = JANUARY ; if ( isFieldSet ( fieldMask , MONTH ) ) { // No need to check if MONTH has been set ( no isSet ( MONTH )
// call ) since its unset value happens to be JANUARY ( 0 ) .
month = internalGet ( MONTH ) ; // If the month is out of range , adjust it into range
if ( month > DECEMBER ) { year += month / 12... |
public class InputDescription { /** * Returns the in - application stream names that are mapped to the stream source .
* @ param inAppStreamNames
* Returns the in - application stream names that are mapped to the stream source . */
public void setInAppStreamNames ( java . util . Collection < String > inAppStreamNam... | if ( inAppStreamNames == null ) { this . inAppStreamNames = null ; return ; } this . inAppStreamNames = new java . util . ArrayList < String > ( inAppStreamNames ) ; |
public class AbstractIntSet { /** * { @ inheritDoc }
* < p > This implementation simply counts the elements in the interator . */
@ Override public int size ( ) { } } | // dumb implementation . You should override .
int size = 0 ; for ( Interator it = interator ( ) ; ( size < Integer . MAX_VALUE ) && it . hasNext ( ) ; it . nextInt ( ) ) { size ++ ; } return size ; |
public class DynamoDBMapperFieldModel { /** * Creates a condition which filters on the specified value .
* @ param value The value .
* @ return The condition .
* @ see com . amazonaws . services . dynamodbv2 . model . ComparisonOperator # EQ
* @ see com . amazonaws . services . dynamodbv2 . model . Condition */... | return new Condition ( ) . withComparisonOperator ( EQ ) . withAttributeValueList ( convert ( value ) ) ; |
public class XmlExporter { /** * Build XML list tag determined by fullname status and ending class phrase
* @ return XML list tag
* @ see # exportClassEnding
* @ see # exportClassFullName */
private < T > String buildClassListTag ( final T t ) { } } | return ( exportClassFullName != null ) ? exportClassFullName : t . getClass ( ) . getSimpleName ( ) + exportClassEnding ; |
public class FindDialog { /** * Get the FindDialog for the parent if there is one or creates and returns a new one .
* @ param parent the parent Window ( or Frame ) for this FindDialog
* @ param modal a boolean indicating whether the FindDialog should ( { @ code true } ) ,
* or shouldn ' t ( { @ code false } ) be... | if ( parent == null ) { throw new IllegalArgumentException ( "The parent must not be null." ) ; } FindDialog activeDialog = getParentsMap ( ) . get ( parent ) ; if ( activeDialog != null ) { activeDialog . getTxtFind ( ) . requestFocus ( ) ; return activeDialog ; } FindDialog newDialog = new FindDialog ( parent , modal... |
public class Mtp2 { /** * Handles received data .
* @ param buff the buffer which conatins received data .
* @ param len the number of received bytes . */
private void processRx ( byte [ ] buff , int len ) { } } | int i = 0 ; // start HDLC alg
while ( i < len ) { while ( rxState . bits <= 24 && i < len ) { int b = buff [ i ++ ] & 0xff ; hdlc . fasthdlc_rx_load_nocheck ( rxState , b ) ; if ( rxState . state == 0 ) { // octet counting mode
nCount = ( nCount + 1 ) % 16 ; if ( nCount == 0 ) { countError ( "on receive" ) ; } } } int ... |
public class BeanUtils { /** * Get property value , loads nested properties
* @ param root root
* @ param properties properties forming a path
* @ return value at path */
public static Object getPropertyValue ( final Object root , final String ... properties ) { } } | Object object = root ; for ( String property : properties ) { if ( object == null ) { return null ; } if ( property . equals ( "this" ) ) { if ( ! ( object instanceof Map ) ) { continue ; } else { Object aThis = ( ( Map ) object ) . get ( "this" ) ; if ( aThis != null ) { object = aThis ; continue ; } else { continue ;... |
public class ParserUtils { /** * Returns the block comment body stripped of leading whitespace and * in all but the first line ,
* and the block comments delimiters removed .
* @ param blockComment a C - style block comment
* @ return the comment ' s body with all but the first line specially trimmed */
public st... | final String content = blockComment . substring ( 0 , blockComment . length ( ) - 2 ) ; return BLOCK_COMMENT_PROTO_STRIPPER . matcher ( content ) . replaceAll ( "" ) . substring ( 2 ) ; |
public class HomographyInducedStereo3Pts { /** * Fill rows of M with observations from image 1 */
private void fillM ( Point2D_F64 x1 , Point2D_F64 x2 , Point2D_F64 x3 ) { } } | M . data [ 0 ] = x1 . x ; M . data [ 1 ] = x1 . y ; M . data [ 2 ] = 1 ; M . data [ 3 ] = x2 . x ; M . data [ 4 ] = x2 . y ; M . data [ 5 ] = 1 ; M . data [ 6 ] = x3 . x ; M . data [ 7 ] = x3 . y ; M . data [ 8 ] = 1 ; |
public class UicStatsAsHtml { /** * Writes out the given statistics in HTML format .
* @ param writer the writer to write to .
* @ param stats the stats to write . */
public static void write ( final PrintWriter writer , final UicStats stats ) { } } | writer . println ( "<dl>" ) ; writer . print ( "<dt>Total root wcomponents found in UIC</dt>" ) ; writer . println ( "<dd>" + stats . getRootWCs ( ) . size ( ) + "</dd>" ) ; writer . print ( "<dt>Size of UIC (by serialization)</dt>" ) ; writer . println ( "<dd>" + stats . getOverallSerializedSize ( ) + "</dd>" ) ; writ... |
public class ExecutorsUtils { /** * Shutdown an { @ link ExecutorService } gradually , first disabling new task submissions and later cancelling
* existing tasks .
* The implementation is based on the implementation of Guava ' s MoreExecutors . shutdownAndAwaitTermination ,
* which is available since version 17.0... | Preconditions . checkNotNull ( unit ) ; // Disable new tasks from being submitted
executorService . shutdown ( ) ; if ( logger . isPresent ( ) ) { logger . get ( ) . info ( "Attempting to shutdown ExecutorService: " + executorService ) ; } try { long halfTimeoutNanos = TimeUnit . NANOSECONDS . convert ( timeout , unit ... |
public class JSONUtils { /** * Transforms the string into a valid Java Identifier . < br >
* The default strategy is JavaIdentifierTransformer . NOOP
* @ throws JSONException if the string can not be transformed . */
public static String convertToJavaIdentifier ( String key , JsonConfig jsonConfig ) { } } | try { return jsonConfig . getJavaIdentifierTransformer ( ) . transformToJavaIdentifier ( key ) ; } catch ( JSONException jsone ) { throw jsone ; } catch ( Exception e ) { throw new JSONException ( e ) ; } |
public class RRFedNonFedBudgetV1_1Generator { /** * This method gets KeyPersons details such as Name , ProjectRole , Compensation , TotalFundForAttachedKeyPersons
* TotalFundForKeyPersons and AttachedKeyPersons based on BudgetPeriodInfo for the RRFedNonFedBudget .
* @ param periodInfo ( BudgetPeriodInfo ) budget pe... | KeyPersons keyPersons = KeyPersons . Factory . newInstance ( ) ; if ( periodInfo != null ) { if ( periodInfo . getKeyPersons ( ) != null ) { List < KeyPersonDataType > keyPersonList = new ArrayList < > ( ) ; int keyPersonCount = 0 ; for ( KeyPersonDto keyPerson : periodInfo . getKeyPersons ( ) ) { if ( keyPerson . getR... |
public class JFapByteBuffer { /** * This method is called just before this buffer is due to be transmitted by the JFap channel .
* When calling this method the underlying byte buffer is prepared by setting the correct limits
* and the buffer is added to a List that is returned . Once this method is called the buffe... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getBufferForTransmission" ) ; // Ensure the buffer has been prepared
checkNotValid ( ) ; WsByteBuffer [ ] bufferArray = new WsByteBuffer [ dataList . size ( ) ] ; for ( int x = 0 ; x < dataList . size ( ) ; x ++ ) { ... |
public class CommunicationSeverityAnalyser { /** * This method evaluates the severity of nodes / links within a supplied set of
* communication summary stats .
* @ param nodes The nodes for the communication summary stats */
public void evaluateCommunicationSummarySeverity ( Collection < CommunicationSummaryStatist... | long max = 0 ; Map < String , CommunicationSummaryStatistics > nodeMap = new HashMap < String , CommunicationSummaryStatistics > ( ) ; for ( CommunicationSummaryStatistics css : nodes ) { // Calculate maximum average duration over the list of nodes
if ( css . getAverageDuration ( ) > max ) { max = css . getAverageDurat... |
public class MediaRow { /** * Set the data from an image with optional quality
* @ param image
* image
* @ param imageFormat
* image format
* @ param quality
* null or quality between 0.0 and 1.0
* @ throws IOException
* upon failure
* @ since 3.2.0 */
public void setData ( BufferedImage image , Strin... | setData ( ImageUtils . writeImageToBytes ( image , imageFormat , quality ) ) ; |
public class Statement { /** * Registers an input parameter into the statement .
* @ param key parameter key .
* @ param value parameter initial value ( optional ) .
* @ param type parameter SQL type code ( optional ) .
* @ throws SQLException if error occurs while registering parameter .
* @ since v1.0 */
pu... | if ( key instanceof Integer ) { if ( type == null ) { base . setObject ( ( Integer ) key , value ) ; } else { base . setObject ( ( Integer ) key , value , type ) ; } } else { if ( type == null ) { base . setObject ( ( String ) key , value ) ; } else { base . setObject ( ( String ) key , value , type ) ; } } |
public class GraphicalModel { /** * The point here is to allow us to save a copy of the model with a current set of factors and metadata mappings ,
* which can come in super handy with gameplaying applications . The cloned model doesn ' t instantiate the feature
* thunks inside factors , those are just taken over i... | GraphicalModel clone = new GraphicalModel ( ) ; clone . modelMetaData . putAll ( modelMetaData ) ; for ( int i = 0 ; i < variableMetaData . size ( ) ; i ++ ) { if ( variableMetaData . get ( i ) != null ) { clone . getVariableMetaDataByReference ( i ) . putAll ( variableMetaData . get ( i ) ) ; } } for ( Factor f : fact... |
public class ShareSheetStyle { /** * Include items from the ShareSheet by package name Array . If only " com . Slack "
* is included , then only preferred sharing options + Slack
* will be displayed , for example .
* @ param packageName { @ link String [ ] } package name to be included .
* @ return this Builder... | includeInShareSheet . addAll ( Arrays . asList ( packageName ) ) ; return this ; |
public class ConnectionFactoryValidator { /** * Utility method that attempts to construct a ConnectionSpec impl of the specified name ,
* which might or might not exist in the resource adapter .
* @ param cciConFactory the connection factory class
* @ param conSpecClassName possible connection spec impl class nam... | try { @ SuppressWarnings ( "unchecked" ) Class < ConnectionSpec > conSpecClass = ( Class < ConnectionSpec > ) cciConFactory . getClass ( ) . getClassLoader ( ) . loadClass ( conSpecClassName ) ; ConnectionSpec conSpec = conSpecClass . newInstance ( ) ; conSpecClass . getMethod ( "setPassword" , String . class ) . invok... |
public class ComponentFilter { /** * Does the mapping respected the component grouping specified by the
* query .
* @ param mapping a permutation of the query vertices
* @ return the mapping preserves the specified grouping */
@ Override public boolean apply ( final int [ ] mapping ) { } } | // no grouping required
if ( queryComponents == null ) return true ; // bidirectional map of query / target components , last index
// of query components holds the count
int [ ] usedBy = new int [ targetComponents [ targetComponents . length - 1 ] + 1 ] ; int [ ] usedIn = new int [ queryComponents [ queryComponents . ... |
public class CustomerAccountUrl { /** * Get Resource Url for ResetPassword
* @ return String Resource Url */
public static MozuUrl resetPasswordUrl ( ) { } } | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/Reset-Password" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; |
public class SystemPropertiesConfiguration { /** * Looks for System properties with the names defined in { @ link org . greencheek . related . util . config . ConfigurationConstants }
* Parsing the resulting values in to appropriate types . If the system property is not defined an
* entry in the return map ( with t... | Map < String , String > stringSystemProperties = readSystemProperties ( ) ; return parseProperties ( stringSystemProperties ) ; |
public class ChromosomeMappingTools { /** * Converts the genetic coordinate to the position of the nucleotide on the mRNA sequence for a gene
* living on the forward DNA strand .
* @ param chromPos The genetic coordinate on a chromosome
* @ param exonStarts The list holding the genetic coordinates pointing to the... | // the genetic coordinate is not in a coding region
if ( ( chromPos < ( cdsStart + base ) ) || ( chromPos > ( cdsEnd + base ) ) ) { logger . debug ( "The " + format ( chromPos ) + " position is not in a coding region" ) ; return - 1 ; } logger . debug ( "looking for CDS position for " + format ( chromPos ) ) ; // map t... |
public class Expressions { /** * Creates an StringIsLessThanOrEqual expression from the given expression and constant .
* @ param left The left expression .
* @ param constant The constant to compare to ( must be a String ) .
* @ throws IllegalArgumentException If the constant is not a String
* @ return A new i... | if ( ! ( constant instanceof String ) ) throw new IllegalArgumentException ( "constant is not a String" ) ; return new StringIsLessThanOrEqual ( left , constant ( ( String ) constant ) ) ; |
public class IdemixUtils { /** * ecpToBytes turns an ECP into a byte array
* @ param e the ECP to turn into bytes
* @ return a byte array representation of the ECP */
static byte [ ] ecpToBytes ( ECP e ) { } } | byte [ ] ret = new byte [ 2 * FIELD_BYTES + 1 ] ; e . toBytes ( ret , false ) ; return ret ; |
public class FDistort { /** * All this does is set the references to the images . Nothing else is changed and its up to the
* user to correctly update everything else .
* If called the first time you need to do the following
* < pre >
* 1 ) specify the interpolation method
* 2 ) specify the transform
* 3 ) ... | this . input = input ; this . output = output ; inputType = input . getImageType ( ) ; return this ; |
public class CmsXMLSearchConfigurationParser { /** * Helper to read an optional String value .
* @ param path The XML path of the element to read .
* @ return The String value stored in the XML , or < code > null < / code > if the value could not be read . */
protected String parseOptionalStringValue ( final String... | final I_CmsXmlContentValue value = m_xml . getValue ( path , m_locale ) ; if ( value == null ) { return null ; } else { return value . getStringValue ( null ) ; } |
public class AWSOpsWorksCMClient { /** * Lists all configuration management servers that are identified with your account . Only the stored results from
* Amazon DynamoDB are returned . AWS OpsWorks CM does not query other services .
* This operation is synchronous .
* A < code > ResourceNotFoundException < / cod... | request = beforeClientExecution ( request ) ; return executeDescribeServers ( request ) ; |
public class RouteFiltersInner { /** * Gets all route filters in a resource group .
* @ param resourceGroupName The name of the resource group .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; RouteFilterInner & gt ; object */
public O... | return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < Page < RouteFilterInner > > , Page < RouteFilterInner > > ( ) { @ Override public Page < RouteFilterInner > call ( ServiceResponse < Page < RouteFilterInner > > response ) { return response . body ( ) ; } } ) ... |
public class Messenger { /** * Starting phone auth
* @ param phone phone for authentication
* @ return promise of AuthStartRes */
@ NotNull @ ObjectiveCName ( "doStartAuthWithPhone:" ) public Promise < AuthStartRes > doStartPhoneAuth ( long phone ) { } } | return modules . getAuthModule ( ) . doStartPhoneAuth ( phone ) ; |
public class PlaceVisitor { /** * Visit an Attributes . Look at Attributes to find Places .
* @ see GedObjectVisitor # visit ( Attribute ) */
@ Override public void visit ( final Attribute attribute ) { } } | for ( final GedObject gob : attribute . getAttributes ( ) ) { gob . accept ( this ) ; } |
public class RxInstrumentedWrappers { /** * Wrap a observer .
* @ param downstream The downstream observer
* @ param instrumentations The instrumentations
* @ param < T > The type
* @ return The wrapped subscriber */
static < T > MaybeObserver < T > wrap ( MaybeObserver < T > downstream , List < RunnableInstrum... | return new RxInstrumentedMaybeObserver < > ( downstream , instrumentations ) ; |
public class EnvVars { /** * Takes a string that looks like " a = b " and adds that to this map . */
public void addLine ( String line ) { } } | int sep = line . indexOf ( '=' ) ; if ( sep > 0 ) { put ( line . substring ( 0 , sep ) , line . substring ( sep + 1 ) ) ; } |
public class AmazonKinesisFirehoseClient { /** * Writes a single data record into an Amazon Kinesis Data Firehose delivery stream . To write multiple data records
* into a delivery stream , use < a > PutRecordBatch < / a > . Applications using these operations are referred to as
* producers .
* By default , each ... | request = beforeClientExecution ( request ) ; return executePutRecord ( request ) ; |
public class DbRemoteConfigLoader { /** * 加载有变动的adapter配置 */
private void loadModifiedAdapterConfigs ( ) { } } | Map < String , ConfigItem > remoteConfigStatus = new HashMap < > ( ) ; String sql = "select id, category, name, modified_time from canal_adapter_config" ; try ( Connection conn = dataSource . getConnection ( ) ; Statement stmt = conn . createStatement ( ) ; ResultSet rs = stmt . executeQuery ( sql ) ) { while ( rs . ne... |
public class StatementAnnotationMapTable { /** * { @ inheritDoc } */
@ Override protected void _from ( ObjectInput in ) throws IOException , ClassNotFoundException { } } | final int size = in . readInt ( ) ; for ( int i = 0 ; i < size ; i ++ ) { final int statementIndex = in . readInt ( ) ; final int annotationPairsSize = in . readInt ( ) ; Set < AnnotationPair > annotationPairs = new HashSet < AnnotationPair > ( annotationPairsSize ) ; for ( int j = 0 ; j < annotationPairsSize ; ++ j ) ... |
public class DfsTask { /** * Create the appropriate output properties with their respective output ,
* restore System . out , System . err and release any resources from created
* ClassLoaders to aid garbage collection . */
protected void popContext ( ) { } } | // write output to property , if applicable
if ( outprop != null && ! System . out . checkError ( ) ) getProject ( ) . setNewProperty ( outprop , out . toString ( ) ) ; if ( out != err && errprop != null && ! System . err . checkError ( ) ) getProject ( ) . setNewProperty ( errprop , err . toString ( ) ) ; System . set... |
public class SeLionSelendroidDriver { /** * Scroll the screen to the right . The underlying application should have atleast one scroll view belonging to the
* class ' android . widget . ScrollView ' . */
public void scrollRight ( ) { } } | logger . entering ( ) ; WebElement webElement = this . findElement ( By . className ( SCROLLVIEW_CLASS ) ) ; swipeRight ( webElement ) ; logger . exiting ( ) ; |
public class TimeBaseProvider { /** * Creates a time base object which can subsequently be fetched by the client and used to send
* delta times .
* @ param timeBase the name of the time base to create .
* @ return the created and registered time base object . */
public static TimeBaseObject createTimeBase ( Strin... | TimeBaseObject object = _omgr . registerObject ( new TimeBaseObject ( ) ) ; _timeBases . put ( timeBase , object ) ; return object ; |
public class CmsUpdateBean { /** * Prepares step 5 of the update wizard . < p > */
public void prepareUpdateStep5b ( ) { } } | if ( ! isInitialized ( ) ) { return ; } addSubscriptionDriver ( ) ; if ( ( m_workplaceUpdateThread != null ) && ( m_workplaceUpdateThread . isFinished ( ) ) ) { // update is already finished , just wait for client to collect final data
return ; } if ( m_workplaceUpdateThread == null ) { m_workplaceUpdateThread = new Cm... |
public class AbstractController { /** * Gets the source .
* @ param event the event
* @ param type the cls
* @ param < T > the generic type
* @ return the source */
protected < T > Optional < T > getSource ( Event event , Class < T > type ) { } } | return getValue ( event , event :: getSource , type ) ; |
public class ReflectiveVisitorHelper { /** * Use reflection to call the appropriate < code > visit < / code > method on the
* provided visitor , passing in the specified argument .
* @ param visitor
* the visitor encapsulating the logic to process the argument
* @ param argument
* the argument to dispatch
*... | Assert . notNull ( visitor , "The visitor to visit is required" ) ; // Perform call back on the visitor through reflection .
Method method = getMethod ( visitor . getClass ( ) , argument ) ; if ( method == null ) { if ( logger . isWarnEnabled ( ) ) { logger . warn ( "No method found by reflection for visitor class [" +... |
public class JDK14Logger { /** * Infers the caller of a Logger method from the current stack trace . This can be used by
* wrappers to provide the correct calling class and method information to their underlying log
* implementation .
* @ return a two element array containing { class name , method name } or { nul... | String self = getClass ( ) . getName ( ) ; // locate ourselves in the call stack
StackTraceElement [ ] stack = ( new Throwable ( ) ) . getStackTrace ( ) ; int ii = 0 ; for ( ; ii < stack . length ; ii ++ ) { if ( self . equals ( stack [ ii ] . getClassName ( ) ) ) { break ; } } System . err . println ( "Found self at "... |
public class Tracy { /** * Call before starting an operation you want to capture elapsed time for . < br >
* You can nest before ( ) calls if you want to trace both caller and callee methods ,
* but make sure you call after ( ) for every before ( ) .
* @ param label is the name you will see in the trace event rep... | TracyThreadContext ctx = threadContext . get ( ) ; if ( isValidContext ( ctx ) ) { ctx . push ( label ) ; } |
public class MutableByte { /** * Compares this mutable to another in ascending order .
* @ param other the other mutable to compare to , not null
* @ return negative if this is less , zero if equal , positive if greater */
@ Override public int compareTo ( final MutableByte other ) { } } | return ( this . value > other . value ) ? 1 : ( ( this . value == other . value ) ? 0 : - 1 ) ; |
public class SolutionStackDescription { /** * The permitted file types allowed for a solution stack .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setPermittedFileTypes ( java . util . Collection ) } or { @ link # withPermittedFileTypes ( java . util . Col... | if ( this . permittedFileTypes == null ) { setPermittedFileTypes ( new com . amazonaws . internal . SdkInternalList < String > ( permittedFileTypes . length ) ) ; } for ( String ele : permittedFileTypes ) { this . permittedFileTypes . add ( ele ) ; } return this ; |
public class MultitonKey { /** * Generate the string key for an object .
* @ param object the object which is part of the global key
* @ return the unique string for this object */
private String buildObjectKey ( final Object object ) { } } | String objectKey = null ; final Class < ? > objectClass = object . getClass ( ) ; final KeyGenerator typeGenerator = objectClass . getAnnotation ( KeyGenerator . class ) ; if ( typeGenerator == null ) { objectKey = generateAggregatedKey ( object ) ; } else { objectKey = generateTypeKey ( object , typeGenerator ) ; } //... |
public class Template { /** * Merge this template .
* @ param vars
* @ param writer
* @ return Context
* @ throws ScriptRuntimeException
* @ throws ParseException */
public Context merge ( final Vars vars , final Writer writer ) { } } | return merge ( vars , new WriterOut ( writer , engine ) ) ; |
public class AWS4SignerRequestParams { /** * Returns the scope to be used for the signing . */
private String generateScope ( SignableRequest < ? > request , String dateStamp , String serviceName , String regionName ) { } } | final StringBuilder scopeBuilder = new StringBuilder ( ) ; return scopeBuilder . append ( dateStamp ) . append ( "/" ) . append ( regionName ) . append ( "/" ) . append ( serviceName ) . append ( "/" ) . append ( SignerConstants . AWS4_TERMINATOR ) . toString ( ) ; |
public class DirectClustering { /** * Clusters { @ link matrix } using the { @ link RandomSeed } seeding algorithm
* and the default kmeans { @ link CriterionFunction } . The best scoring
* solution out of { @ code numRepetitions } will be returned . */
public static Assignments cluster ( Matrix matrix , int numClu... | return cluster ( matrix , numClusters , numRepetitions , new RandomSeed ( ) , new I1Function ( ) ) ; |
public class DiffBase { /** * Crush the diff into an encoded string which describes the operations
* required to transform text1 into text2.
* E . g . " = 3 \ t - 2 \ t + ing " - & gt ; Keep 3 chars , delete 2 chars , insert ' ing ' .
* Operations are tab - separated . Inserted text is escaped using % xx notation... | StringBuilder text = new StringBuilder ( ) ; for ( Change aDiff : getChangeList ( ) ) { switch ( aDiff . operation ) { case INSERT : try { text . append ( "+" ) . append ( URLEncoder . encode ( aDiff . text , "UTF-8" ) . replace ( '+' , ' ' ) ) . append ( "\t" ) ; } catch ( UnsupportedEncodingException e ) { // Not lik... |
public class DefaultGroovyMethods { /** * Recursively iterates through this collection transforming each non - Collection value
* into a new value using the closure as a transformer . Returns a potentially nested
* list of transformed values .
* < pre class = " groovyTestCase " >
* assert [ 2 , [ 4,6 ] , [ 8 ] ... | return ( List ) collectNested ( ( Iterable ) self , new ArrayList ( self . size ( ) ) , transform ) ; |
public class RequestUtils { /** * This method returns a protocol of a request to web server if this container is fronted by one , such that
* it sets a header < code > X - Forwarded - Proto < / code > on the request and forwards it to the Java container .
* If such header is not present , than the { @ link # protoc... | String protocol = header ( "X-Forwarded-Proto" ) ; return Util . blank ( protocol ) ? protocol ( ) : protocol ; |
public class Context { /** * Method to get a new Context .
* @ see # begin ( String , Locale , Map , Map , Map )
* @ param _ userName Naem of the user the Context must be created for
* @ throws EFapsException on error
* @ return new Context */
public static Context begin ( final String _userName ) throws EFapsE... | return Context . begin ( _userName , Inheritance . Inheritable ) ; |
public class FileGetFromTaskHeaders { /** * Set the file creation time .
* @ param ocpCreationTime the ocpCreationTime value to set
* @ return the FileGetFromTaskHeaders object itself . */
public FileGetFromTaskHeaders withOcpCreationTime ( DateTime ocpCreationTime ) { } } | if ( ocpCreationTime == null ) { this . ocpCreationTime = null ; } else { this . ocpCreationTime = new DateTimeRfc1123 ( ocpCreationTime ) ; } return this ; |
public class AbstractRunMojo { /** * Copy the Alfresco Enterprise license to its correct place in the Platform WAR , if it exists .
* It is not enough to have it on the test classpath , then it will start up as Trial license . . .
* @ throws MojoExecutionException when any problem appears copying the Alfresco licen... | final String warOutputDir = getWarOutputDir ( PLATFORM_WAR_PREFIX_NAME ) ; final String licDestDir = warOutputDir + "/WEB-INF/classes/alfresco/extension/license" ; getLog ( ) . info ( "Copying Alfresco Enterprise license to: " + licDestDir ) ; executeMojo ( plugin ( groupId ( "org.apache.maven.plugins" ) , artifactId (... |
public class SparkQuery { /** * Parses the insert into query .
* @ param query
* the query
* @ return the map */
private Map < String , Object > parseInsertIntoQuery ( String query ) { } } | Map < String , Object > persistDetails = new HashMap < String , Object > ( ) ; String insertReg = "(?i)^insert\\s+into\\s+(\\S+)\\s+(?:as\\s+(\\S+)\\s+)?FROM\\s+\\((.*)\\)$" ; Pattern r = Pattern . compile ( insertReg ) ; Matcher m = r . matcher ( query ) ; if ( m . find ( ) ) { try { parsePersistClause ( m . group ( 1... |
public class KillBillHttpClient { /** * OPTIONS */
public Response doOptions ( final String uri , final RequestOptions requestOptions ) throws KillBillClientException { } } | return doOptions ( uri , requestOptions , this . requestTimeoutSec ) ; |
public class ConcurrentServiceReferenceMap { /** * Associates the reference with the key but only if there is not an
* existing reference associated with that key . It will only attempt to add
* the reference to the map if < code > key < / code > is not < code > null < / code > .
* @ param key Key associated with... | // If the key is null we can ' t do anything
if ( key == null ) return null ; if ( reference == null ) { // If the reference is null we can ' t add it to the map but we could still return an existing on if there was one so check this
return getReference ( key ) ; } ConcurrentServiceReferenceElement < V > element = new ... |
public class DefaultQuartzServiceImpl { /** * Pause the job with given name in given group
* @ param jobName
* the job name
* @ param jobGroupName
* the job group name
* @ return < code > true < / code > if job was paused , < code > false < / code > otherwise
* @ see QuartzService # pauseQuartzJob ( String ... | try { this . scheduler . pauseJob ( new JobKey ( jobName , jobGroupName ) ) ; return true ; } catch ( SchedulerException e ) { logger . error ( "error pausing job: " + jobName + " in group: " + jobGroupName , e ) ; } return false ; |
public class ClassIdentifiers { /** * This method throws IOException because it is assumed that we got the id from network .
* @ param id
* @ return
* @ throws IOException */
public Class < ? > getClass ( int id ) throws IOException { } } | if ( id < 0 || id > internalIdToClass . length ) { throw new IOException ( "Unknown class id " + id ) ; } Class < ? > clazz = internalIdToClass [ id ] ; if ( clazz == null ) { throw new IOException ( "Unknown class id " + id ) ; } return clazz ; |
public class DeleteDirectoryConfigRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteDirectoryConfigRequest deleteDirectoryConfigRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteDirectoryConfigRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteDirectoryConfigRequest . getDirectoryName ( ) , DIRECTORYNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall... |
public class EntryAction { /** * We have two exception in this case : One from the loader or the expiry policy , one from
* the resilience policy . Propagate exception from the resilience policy and suppress
* the other , since this is a general configuration problem . */
@ SuppressWarnings ( "unchecked" ) private ... | newValueOrException = ( V ) new ExceptionWrapper < K > ( key , _ouch , loadStartedTime , entry ) ; expiry = 0 ; expiryCalculated ( ) ; |
public class FieldInfo { /** * Set this field back to the original value .
* @ param bDisplayOption If true , display the data .
* @ return The error code . */
public int initField ( boolean bDisplayOption ) // Init this field override for other value
{ } } | if ( ( this . getDefault ( ) == null ) || ( this . getDefault ( ) instanceof String ) ) return this . setString ( ( String ) this . getDefault ( ) , bDisplayOption , Constants . INIT_MOVE ) ; // zero out the field
return this . setData ( this . getDefault ( ) , bDisplayOption , Constants . INIT_MOVE ) ; |
public class Channels { /** * Sends a { @ code " shutdownInput " } request to the
* { @ link ChannelDownstreamHandler } which is placed in the closest
* downstream from the handler associated with the specified
* { @ link ChannelHandlerContext } .
* @ param ctx the context
* @ param future the future which wi... | ctx . sendDownstream ( new DownstreamShutdownInputEvent ( ctx . getChannel ( ) , future ) ) ; |
public class Validation { /** * Cross validation of a classification model .
* @ param < T > the data type of input objects .
* @ param k k - fold cross validation .
* @ param trainer a classifier trainer that is properly parameterized .
* @ param x the test data set .
* @ param y the test data labels .
* @... | if ( k < 2 ) { throw new IllegalArgumentException ( "Invalid k for k-fold cross validation: " + k ) ; } int n = x . length ; int [ ] predictions = new int [ n ] ; CrossValidation cv = new CrossValidation ( n , k ) ; for ( int i = 0 ; i < k ; i ++ ) { T [ ] trainx = Math . slice ( x , cv . train [ i ] ) ; int [ ] trainy... |
public class TreeCoreset { /** * frees a tree of its storage */
void freeTree ( treeNode root ) { } } | while ( ! treeFinished ( root ) ) { if ( root . lc == null && root . rc == null ) { root = root . parent ; } else if ( root . lc == null && root . rc != null ) { // Schau ob rc ein Blatt ist
if ( isLeaf ( root . rc ) ) { // Gebe rechtes Kind frei
root . rc . free ( ) ; root . rc = null ; } else { // Fahre mit rechtem K... |
public class MetadataService { /** * Ensures that the specified { @ code appId } is a token of the specified { @ code project } . */
private static void ensureProjectToken ( ProjectMetadata project , String appId ) { } } | requireNonNull ( project , "project" ) ; requireNonNull ( appId , "appId" ) ; checkArgument ( project . tokens ( ) . containsKey ( appId ) , appId + " is not a token of the project " + project . name ( ) ) ; |
public class OnExitScriptTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case DroolsPackage . ON_EXIT_SCRIPT_TYPE__SCRIPT : return getScript ( ) ; case DroolsPackage . ON_EXIT_SCRIPT_TYPE__SCRIPT_FORMAT : return getScriptFormat ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class Angular { /** * Registers a module with Angular framework , with module dependency listed
* in the < code > requires < / code > parameter . If a module by the same name
* ( i . e . the same class name including the package name ) has already been
* registered , then the previous registration is overr... | return module ( module , null , requires == null ? EMPTY_STRING_ARRAY : requires ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.