signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Humanize { /** * Applies the proper format for a given plural state .
* Example :
* < pre >
* PluralizeParams p = PluralizeParams
* . begin ( & quot ; There is one file on { 1 } . & quot ; )
* . many ( & quot ; There are { 0 } files on { 1 } . & quot ; )
* . none ( & quot ; There are no files o... | Preconditions . checkNotNull ( p . many , "Please, specify a format for many elements" ) ; Preconditions . checkNotNull ( p . one , "Please, specify a format for a single element" ) ; String none = p . none == null ? p . many : p . none ; MessageFormat format = pluralizeFormat ( "{0}" , none , p . one , p . many ) ; Ob... |
public class ConnectionFactoryAbstractImpl { /** * Initialize the connection with the specified properties in OJB
* configuration files and platform depended properties .
* Invoke this method after a NEW connection is created , not if re - using from pool .
* @ see org . apache . ojb . broker . platforms . Platfo... | try { PlatformFactory . getPlatformFor ( jcd ) . initializeJdbcConnection ( jcd , con ) ; } catch ( PlatformException e ) { throw new LookupException ( "Platform dependent initialization of connection failed" , e ) ; } |
public class Async { /** * Convert a synchronous function call into an asynchronous function call through an Observable .
* < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . png " alt = " " >
* @ param < T1 > the first parameter type
* @... | return toAsyncThrowing ( func , Schedulers . computation ( ) ) ; |
public class WebApplicationContext { public void handle ( String pathInContext , String pathParams , HttpRequest httpRequest , HttpResponse httpResponse ) throws HttpException , IOException { } } | if ( ! isStarted ( ) ) return ; try { super . handle ( pathInContext , pathParams , httpRequest , httpResponse ) ; } finally { if ( ! httpRequest . isHandled ( ) ) httpResponse . sendError ( HttpResponse . __404_Not_Found ) ; httpRequest . setHandled ( true ) ; if ( ! httpResponse . isCommitted ( ) ) { httpResponse . c... |
public class LockSession { /** * Lock this bookmark in this record for this session .
* @ param strRecordName The record to create the lock in .
* @ param bookmark The bookmark to lock .
* @ param objSession The session that wants the lock .
* @ param strUser The name of the user that wants the lock .
* @ par... | sessionInfo . m_iRemoteSessionID = this . getSessionID ( ) ; LockTable lockTable = this . getLockTable ( strDatabaseName , strRecordName ) ; SessionInfo sessionLocking = lockTable . addLock ( bookmark , sessionInfo ) ; if ( sessionInfo . equals ( sessionLocking ) ) sessionLocking = null ; // Ignore if I ' m the one who... |
public class DateFormatSymbols { /** * Sets calendar zodiac name strings , for example : " Rat " , " Ox " , " Tiger " , etc .
* @ param zodiacNames The new zodiac name strings .
* @ param context The usage context : FORMAT , STANDALONE ( currently only FORMAT is supported ) .
* @ param width The name width : WIDE... | if ( context == FORMAT && width == ABBREVIATED ) { shortZodiacNames = duplicate ( zodiacNames ) ; } |
public class Log { public void warn ( final Throwable t , final String message , final Object ... args ) { } } | wrappedLogger . warn ( String . format ( message , args ) , t ) ; |
public class VoiceApi { /** * Redirect a call
* Redirect a call to the specified destination .
* @ param id The connection ID of the current call to redirect . ( required )
* @ param redirectData ( required )
* @ return ApiSuccessResponse
* @ throws ApiException If fail to call the API , e . g . server error ... | ApiResponse < ApiSuccessResponse > resp = redirectWithHttpInfo ( id , redirectData ) ; return resp . getData ( ) ; |
public class ModelsImpl { /** * Suggests examples that would improve the accuracy of the intent model .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param intentId The intent classifier ID .
* @ param getIntentSuggestionsOptionalParameter the object representing the optional par... | return ServiceFuture . fromResponse ( getIntentSuggestionsWithServiceResponseAsync ( appId , versionId , intentId , getIntentSuggestionsOptionalParameter ) , serviceCallback ) ; |
public class ModificationBuilderTarget { /** * Remove a misc file .
* @ param name the file name
* @ param path the relative path
* @ param existingHash the existing hash
* @ param isDirectory whether the file is a directory or not
* @ return the builder */
public T removeFile ( final String name , final List... | return removeFile ( name , path , existingHash , isDirectory , null ) ; |
public class ObjectTypedValueWrapper { /** * / * ( non - Javadoc )
* @ see io . github . classgraph . ScanResultObject # setScanResult ( io . github . classgraph . ScanResult ) */
@ Override void setScanResult ( final ScanResult scanResult ) { } } | super . setScanResult ( scanResult ) ; if ( enumValue != null ) { enumValue . setScanResult ( scanResult ) ; } else if ( classRef != null ) { classRef . setScanResult ( scanResult ) ; } else if ( annotationInfo != null ) { annotationInfo . setScanResult ( scanResult ) ; } else if ( objectArrayValue != null ) { for ( fi... |
public class CmsExplorerTypeSettings { /** * Sets the icon path and file name of the explorer type setting . < p >
* @ param icon the icon path and file name of the explorer type setting */
public void setIcon ( String icon ) { } } | m_icon = icon ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SET_ICON_1 , icon ) ) ; } |
public class ElementUtil { /** * Returns true if there ' s a SuppressedWarning annotation with the specified warning .
* The SuppressWarnings annotation can be inherited from the owning method or class ,
* but does not have package scope . */
@ SuppressWarnings ( "unchecked" ) public static boolean suppressesWarnin... | if ( element == null || isPackage ( element ) ) { return false ; } AnnotationMirror annotation = getAnnotation ( element , SuppressWarnings . class ) ; if ( annotation != null ) { for ( AnnotationValue elem : ( List < ? extends AnnotationValue > ) getAnnotationValue ( annotation , "value" ) ) { if ( warning . equals ( ... |
public class Change { /** * Queries gerrit for the files included in this patch set .
* @ param gerritQueryHandler the query handler , responsible for the queries to gerrit .
* @ return a list of files that are part of this patch set . */
public List < String > getFiles ( GerritQueryHandler gerritQueryHandler ) { }... | if ( files == null ) { files = FileHelper . getFilesByChange ( gerritQueryHandler , id ) ; } return files ; |
public class MapViewPosition { /** * Sets the new zoom level of the map
* @ param zoomLevel desired zoom level
* @ param animated true if the transition should be animated , false otherwise
* @ throws IllegalArgumentException if the zoom level is negative . */
@ Override public void setZoomLevel ( byte zoomLevel ... | if ( zoomLevel < 0 ) { throw new IllegalArgumentException ( "zoomLevel must not be negative: " + zoomLevel ) ; } synchronized ( this ) { setZoomLevelInternal ( zoomLevel , animated ) ; } notifyObservers ( ) ; |
public class ListBackupsResult { /** * List of < code > BackupSummary < / code > objects .
* @ param backupSummaries
* List of < code > BackupSummary < / code > objects . */
public void setBackupSummaries ( java . util . Collection < BackupSummary > backupSummaries ) { } } | if ( backupSummaries == null ) { this . backupSummaries = null ; return ; } this . backupSummaries = new java . util . ArrayList < BackupSummary > ( backupSummaries ) ; |
public class HtmlDataTable { /** * < p > Return the value of the < code > rules < / code > property . < / p >
* < p > Contents : Code specifying which rules will appear between cells
* within this table . Valid values are : none ( no rules ,
* default value ) ; groups ( between row groups ) ; rows
* ( between r... | return ( java . lang . String ) getStateHelper ( ) . eval ( PropertyKeys . rules ) ; |
public class PrimaveraPMFileReader { /** * Populates a field based on baseline and actual values .
* @ param container field container
* @ param target target field
* @ param types fields to test for not - null values */
private void populateField ( FieldContainer container , FieldType target , FieldType ... type... | for ( FieldType type : types ) { Object value = container . getCachedValue ( type ) ; if ( value != null ) { container . set ( target , value ) ; break ; } } |
public class StylesheetRoot { /** * Get an " xsl : variable " property .
* @ see < a href = " http : / / www . w3 . org / TR / xslt # top - level - variables " > top - level - variables in XSLT Specification < / a >
* @ param qname Qualified name of variable or param
* @ return The ElemVariable with the given qua... | if ( null != m_variables ) { int n = m_variables . size ( ) ; for ( int i = 0 ; i < n ; i ++ ) { ElemVariable var = ( ElemVariable ) m_variables . elementAt ( i ) ; if ( var . getName ( ) . equals ( qname ) ) return var ; } } return null ; |
public class MP3AudioOnlyInputStream { /** * Reads throw the buffer up to the given index , filling the buffer from the underlying stream if
* necessary . Returns - 1 if the underlying stream terminates before the given offset can be
* reached . */
private int bufferedPeek ( final int offset ) throws IOException { ... | if ( buffer . size ( ) > offset ) { // We ' ve got enough of the file in memory already , we just pull from the buffer
final ListIterator < Integer > iterator = buffer . listIterator ( offset ) ; return iterator . next ( ) ; } // We don ' t have enough in the buffer to peek . . . Read until we do , then recurse .
while... |
public class SanitizedType { /** * Given a content kind , return the corresponding soy type .
* < p > For { @ link SanitizedContentKind # TEXT } this returns { @ link StringType } , for all other types
* it is a { @ link SanitizedType } . */
public static SoyType getTypeForContentKind ( SanitizedContentKind content... | switch ( contentKind ) { case ATTRIBUTES : return AttributesType . getInstance ( ) ; case CSS : return StyleType . getInstance ( ) ; case HTML : return HtmlType . getInstance ( ) ; case JS : return JsType . getInstance ( ) ; case URI : return UriType . getInstance ( ) ; case TRUSTED_RESOURCE_URI : return TrustedResourc... |
public class BatchListObjectPoliciesResponse { /** * A list of policy < code > ObjectIdentifiers < / code > , that are attached to the object .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAttachedPolicyIds ( java . util . Collection ) } or { @ link # w... | if ( this . attachedPolicyIds == null ) { setAttachedPolicyIds ( new java . util . ArrayList < String > ( attachedPolicyIds . length ) ) ; } for ( String ele : attachedPolicyIds ) { this . attachedPolicyIds . add ( ele ) ; } return this ; |
public class Resolver { /** * syck _ resolver _ add _ type */
@ JRubyMethod public static IRubyObject add_type ( IRubyObject self , IRubyObject taguri , IRubyObject cls ) { } } | IRubyObject tags = self . callMethod ( self . getRuntime ( ) . getCurrentContext ( ) , "tags" ) ; ( ( RubyHash ) tags ) . fastASet ( taguri , cls ) ; return self . getRuntime ( ) . getNil ( ) ; |
public class SimpleDBShardingRuleImpl { /** * 初始化dbcode的集合 , 依赖于数据库的shardingNum */
private void setDbCodeCollection ( ) { } } | dbCodeCollection = new ArrayList < String > ( shardingNum ) ; int codeLength = Integer . toBinaryString ( shardingNum - 1 ) . length ( ) ; for ( int i = 0 ; i < shardingNum ; i ++ ) { String dbcode = Integer . toBinaryString ( i ) ; for ( int j = dbcode . length ( ) ; j < codeLength ; j ++ ) { dbcode = "0" + dbcode ; }... |
public class KeyMatcher { /** * Add a new enumerated object to the matcher .
* @ param key */
public synchronized void add ( GenericKeys key ) { } } | KeyBucket bucket = makeBucket ( key . getName ( ) . charAt ( 0 ) ) ; if ( null != bucket ) { bucket . add ( key ) ; } |
public class HttpMessage { /** * Sets the response body of this message .
* @ param resBody the new response body
* @ throws IllegalArgumentException if parameter { @ code resBody } is { @ code null } . */
public void setResponseBody ( HttpResponseBody resBody ) { } } | if ( resBody == null ) { throw new IllegalArgumentException ( "The parameter resBody must not be null." ) ; } mResBody = resBody ; getResponseBody ( ) . setCharset ( getResponseHeader ( ) . getCharset ( ) ) ; |
public class DelimitedInputFormat { /** * Get the character set used for the row delimiter . This is also used by
* subclasses to interpret field delimiters , comment strings , and for
* configuring { @ link FieldParser } s .
* @ return the charset */
@ PublicEvolving public Charset getCharset ( ) { } } | if ( this . charset == null ) { this . charset = Charset . forName ( charsetName ) ; } return this . charset ; |
public class TenantService { /** * Return true if the given userid / password are valid system credentials . */
private boolean isValidSystemCredentials ( String userid , String password ) { } } | String superUser = ServerParams . instance ( ) . getModuleParamString ( "DoradusServer" , "super_user" ) ; String superPassword = ServerParams . instance ( ) . getModuleParamString ( "DoradusServer" , "super_password" ) ; return Utils . isEmpty ( superUser ) || Utils . isEmpty ( superPassword ) || ( superUser . equals ... |
public class ListenersHolder { /** * Invoke listeners with an action expressed by the passed { @ code invocationAction } . This method does the necessary
* validations required for invoking a listener and also guards against a listener throwing exceptions on invocation .
* @ param invocationAction The action to per... | ListenerInvocationException exception = null ; for ( ListenerHolder < T > listener : listeners ) { if ( ! listener . subscription . isUnsubscribed ( ) ) { try { invocationAction . call ( listener . delegate , duration , timeUnit ) ; } catch ( Throwable e ) { exception = handleListenerError ( exception , listener , e ) ... |
public class ResourceStrings { /** * Returns new instance of OptionalString with given key and value
* @ param key key of the returned OptionalString
* @ param value wrapped string
* @ return given object wrapped in OptionalString with given key */
public static OptionalString ofNullable ( ResourceKey key , Strin... | return new GenericOptionalString ( RUNTIME_SOURCE , key , value ) ; |
public class AmazonAlexaForBusinessClient { /** * Lists all skills in the Alexa skill store by category .
* @ param listSkillsStoreSkillsByCategoryRequest
* @ return Result of the ListSkillsStoreSkillsByCategory operation returned by the service .
* @ sample AmazonAlexaForBusiness . ListSkillsStoreSkillsByCategor... | request = beforeClientExecution ( request ) ; return executeListSkillsStoreSkillsByCategory ( request ) ; |
public class ApiOvhDbaaslogs { /** * Returns details of specified permission
* REST : GET / dbaas / logs / { serviceName } / role / { roleId } / permission / { permissionId }
* @ param serviceName [ required ] Service name
* @ param roleId [ required ] Role ID
* @ param permissionId [ required ] Permission ID *... | String qPath = "/dbaas/logs/{serviceName}/role/{roleId}/permission/{permissionId}" ; StringBuilder sb = path ( qPath , serviceName , roleId , permissionId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t5 ) ; |
public class CommerceShippingFixedOptionRelPersistenceImpl { /** * Caches the commerce shipping fixed option rels in the entity cache if it is enabled .
* @ param commerceShippingFixedOptionRels the commerce shipping fixed option rels */
@ Override public void cacheResult ( List < CommerceShippingFixedOptionRel > com... | for ( CommerceShippingFixedOptionRel commerceShippingFixedOptionRel : commerceShippingFixedOptionRels ) { if ( entityCache . getResult ( CommerceShippingFixedOptionRelModelImpl . ENTITY_CACHE_ENABLED , CommerceShippingFixedOptionRelImpl . class , commerceShippingFixedOptionRel . getPrimaryKey ( ) ) == null ) { cacheRes... |
public class PutVoiceConnectorTerminationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( PutVoiceConnectorTerminationRequest putVoiceConnectorTerminationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( putVoiceConnectorTerminationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putVoiceConnectorTerminationRequest . getVoiceConnectorId ( ) , VOICECONNECTORID_BINDING ) ; protocolMarshaller . marshall ( putVoiceConnectorTermina... |
public class ControllerRepository { /** * Returns the controller class that is registered for the given name . For more information about controller
* classes and the name definition see { @ link RemotingController }
* @ param name the name
* @ return the controller class */
public synchronized Class < ? > getCon... | Assert . requireNonBlank ( name , "name" ) ; Class < ? > foundClass = controllersClasses . get ( name ) ; if ( foundClass == null ) { throw new IllegalArgumentException ( "Can't find controller type with name " + name ) ; } return foundClass ; |
public class DoubleRadixHeap { /** * { @ inheritDoc } */
@ Override protected int msd ( Double a , Double b ) { } } | /* * For this to work , arithmetic must be unsigned */
long ux = Double . doubleToLongBits ( a ) ; long uy = Double . doubleToLongBits ( b ) ; if ( ux == uy ) { return - 1 ; } double d = UnsignedUtils . unsignedLongToDouble ( ux ^ uy ) ; return Math . getExponent ( d ) ; |
public class StrSubstitutor { /** * Recursive handler for multiple levels of interpolation . This is the main
* interpolation method , which resolves the values of all variable references
* contained in the passed in text .
* @ param buf the string builder to substitute into , not null
* @ param offset the star... | final StrMatcher pfxMatcher = getVariablePrefixMatcher ( ) ; final StrMatcher suffMatcher = getVariableSuffixMatcher ( ) ; final char escape = getEscapeChar ( ) ; final StrMatcher valueDelimMatcher = getValueDelimiterMatcher ( ) ; final boolean substitutionInVariablesEnabled = isEnableSubstitutionInVariables ( ) ; fina... |
public class RandomCollectionUtils { /** * Returns a set filled randomly from the given element supplier . This will randomly put < code >
* attemptedSize < / code > elements into the set , if any are equal then the returned set will contain
* less than < code > attemptedSize < / code > elements .
* @ param eleme... | return Sets . newHashSet ( randomListFrom ( elementSupplier , attemptedSize ) ) ; |
public class Gauge { /** * Calling this method will stop all threads . This is needed when using
* JavaFX on mobile devices when the device goes to sleep mode . */
public void stop ( ) { } } | setLedOn ( false ) ; if ( null != blinkFuture ) { blinkFuture . cancel ( true ) ; } if ( null != blinkService ) { blinkService . shutdownNow ( ) ; } |
public class Graph { /** * Dereference an injectable object . When it ' s not referenced by anything else after this
* dereferencing , release its cached instance if possible .
* @ param instance the instance is to dereference
* @ param type the type of the object
* @ param qualifier the qualifier
* @ param i... | doRelease ( instance , null , type , qualifier , injectAnnotation ) ; Provider < T > provider = findProvider ( type , qualifier ) ; provider . release ( ) ; dereferenceProvider ( provider , instance ) ; |
public class tmsessionpolicy { /** * Use this API to fetch tmsessionpolicy resource of given name . */
public static tmsessionpolicy get ( nitro_service service , String name ) throws Exception { } } | tmsessionpolicy obj = new tmsessionpolicy ( ) ; obj . set_name ( name ) ; tmsessionpolicy response = ( tmsessionpolicy ) obj . get_resource ( service ) ; return response ; |
public class ProtocolFactory { /** * 注册协议到适配协议
* @ param protocolInfo 协议描述信息 */
protected static synchronized void registerAdaptiveProtocol ( ProtocolInfo protocolInfo ) { } } | // 取最大偏移量
maxMagicOffset = Math . max ( maxMagicOffset , protocolInfo . magicFieldOffset ( ) + protocolInfo . magicFieldLength ( ) ) ; |
public class PolicyDefinitionsInner { /** * Gets all the policy definitions for a subscription at management group level .
* ServiceResponse < PageImpl < PolicyDefinitionInner > > * @ param managementGroupId The ID of the management group .
* @ throws IllegalArgumentException thrown if parameters fail the validatio... | if ( managementGroupId == null ) { throw new IllegalArgumentException ( "Parameter managementGroupId is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . lis... |
public class rewritepolicy_rewriteglobal_binding { /** * Use this API to fetch rewritepolicy _ rewriteglobal _ binding resources of given name . */
public static rewritepolicy_rewriteglobal_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | rewritepolicy_rewriteglobal_binding obj = new rewritepolicy_rewriteglobal_binding ( ) ; obj . set_name ( name ) ; rewritepolicy_rewriteglobal_binding response [ ] = ( rewritepolicy_rewriteglobal_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class MessageEndpointFactoryImpl { /** * ( non - Javadoc )
* @ see com . ibm . ws . kernel . launch . service . PauseableComponent # pause ( ) */
@ Override public void pause ( ) throws PauseableComponentException { } } | try { if ( ivState == ACTIVE_STATE ) { deactivateEndpoint ( ) ; } else if ( ivState == INACTIVE_STATE ) { Tr . info ( tc , "MDB_ENDPOINT_ALREADY_INACTIVE_CNTR4117I" , beanMetaData . enterpriseBeanName , beanMetaData . getModuleMetaData ( ) . getName ( ) , beanMetaData . getModuleMetaData ( ) . getApplicationMetaData ( ... |
public class XmlDomWriter { /** * Sets the output writer . */
public void setOutput ( java . io . Writer writer ) { } } | fOut = writer instanceof PrintWriter ? ( PrintWriter ) writer : new PrintWriter ( writer ) ; |
public class JsonResponseConsumer { /** * onInt .
* @ param val
* a { @ link java . lang . Integer } object .
* @ param fieldName
* a { @ link java . lang . String } object .
* @ param jp
* a { @ link org . codehaus . jackson . JsonParser } object . */
protected void onInt ( Integer val , String fieldName ,... | log . trace ( fieldName + " " + val ) ; |
public class Money { /** * Parses an instance of { @ code Money } from a string .
* The string format is ' $ currencyCode $ amount ' where there may be
* zero to many spaces between the two parts .
* The currency code must be a valid three letter currency .
* The amount must match the regular expression { @ cod... | return Money . of ( BigMoney . parse ( moneyStr ) ) ; |
public class ModeledUser { /** * Returns the time zone associated with this user . This time zone must be
* used when interpreting all date / time restrictions related to this user .
* @ return
* The time zone associated with this user . */
private TimeZone getTimeZone ( ) { } } | // If no time zone is set , use the default
String timeZone = getModel ( ) . getTimeZone ( ) ; if ( timeZone == null ) return TimeZone . getDefault ( ) ; // Otherwise parse and return time zone
return TimeZone . getTimeZone ( timeZone ) ; |
public class SparkComputationGraph { /** * Fit the SparkComputationGraph network using a directory of serialized MultiDataSet objects
* The assumption here is that the directory contains a number of serialized { @ link MultiDataSet } objects
* @ param path Path to the directory containing the serialized MultiDataSe... | if ( Nd4j . getExecutioner ( ) instanceof GridExecutioner ) ( ( GridExecutioner ) Nd4j . getExecutioner ( ) ) . flushQueue ( ) ; JavaRDD < String > paths ; try { paths = SparkUtils . listPaths ( sc , path ) ; } catch ( IOException e ) { throw new RuntimeException ( "Error listing paths in directory" , e ) ; } return fi... |
public class HTMLParser { /** * A safe way to remove the tags from an HTML string . The method removes first
* javascript , css and other non text blocks and then removes all HTML tags .
* @ param html
* @ return */
public static String safeRemoveAllTags ( String html ) { } } | html = removeNonTextTags ( html ) ; html = unsafeRemoveAllTags ( html ) ; return html ; |
public class RegexContextGenerator { /** * Pattern compile . */
private static void patternCompile ( ) { } } | try { ptnNumber = Pattern . compile ( strNumberPattern ) ; ptnShortDate = Pattern . compile ( strShortDatePattern ) ; ptnLongDate = Pattern . compile ( strLongDatePattern ) ; ptnPercentage = Pattern . compile ( strPercentagePattern ) ; ptnCurrency = Pattern . compile ( strCurrencyPattern ) ; ptnViCurrency = Pattern . c... |
public class LocalDriverFactory { /** * Set firefox profile . For example to make sure text / csv file is downloaded without asking ( convenient if run on buildserver ) , do :
* | script | selenium driver setup |
* | start driver for | firefox | with profile | ! { browser . download . folderList : 2 , browser . hel... | FirefoxProfile fxProfile = new FirefoxProfile ( ) ; if ( profile != null ) { for ( Map . Entry < String , Object > profileEntry : profile . entrySet ( ) ) { String key = profileEntry . getKey ( ) ; Object value = profileEntry . getValue ( ) ; if ( value instanceof Boolean ) { fxProfile . setPreference ( key , ( Boolean... |
public class API { /** * Returns a nonce that will be valid for the lifetime of the ZAP process to used with the API call specified by the URL
* @ param apiUrl the API URL
* @ return a nonce that will be valid for the lifetime of the ZAP process
* @ since 2.6.0 */
public String getLongLivedNonce ( String apiUrl )... | String nonce = Long . toHexString ( random . nextLong ( ) ) ; this . nonces . put ( nonce , new Nonce ( nonce , apiUrl , false ) ) ; return nonce ; |
public class SonarProcessor { /** * Filters a ReviewResult to keep only the violations that are about a file
* which is modified by a given review . */
@ VisibleForTesting ReviewResult filterResults ( ReviewResult results , Review review ) { } } | ReviewResult filteredResults = new ReviewResult ( ) ; Set < String > reviewFiles = new HashSet < > ( ) ; for ( ReviewFile file : review . getFiles ( ) ) { reviewFiles . add ( file . getReviewFilename ( ) ) ; } for ( Violation violation : results . getViolations ( ) ) { if ( reviewFiles . contains ( violation . getFilen... |
public class RegistriesInner { /** * Creates a new build based on the request parameters and add it to the build queue .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param buildRequest The param... | return beginQueueBuildWithServiceResponseAsync ( resourceGroupName , registryName , buildRequest ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SigningPolicyParser { /** * find first space or tab as separator . */
private int findIndex ( String line ) { } } | int index = - 1 ; if ( line == null ) { return index ; } String trimmedLine = line . trim ( ) ; int spaceIndex = trimmedLine . indexOf ( " " ) ; int tabIndex = trimmedLine . indexOf ( "\t" ) ; if ( spaceIndex != - 1 ) { if ( tabIndex != - 1 ) { if ( spaceIndex < tabIndex ) { index = spaceIndex ; } else { index = tabInd... |
public class BOCImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . BOC__OBJ_CNAME : return OBJ_CNAME_EDEFAULT == null ? objCName != null : ! OBJ_CNAME_EDEFAULT . equals ( objCName ) ; case AfplibPackage . BOC__TRIPLETS : return triplets != null && ! triplets . isEmpty ( ) ; } return super . eIsSet ( featureID ) ; |
public class VectorizedColumnReader { /** * Reads ` total ` values from this columnReader into column . */
void readBatch ( int total , WritableColumnVector column ) throws IOException { } } | int rowId = 0 ; WritableColumnVector dictionaryIds = null ; if ( dictionary != null ) { // SPARK - 16334 : We only maintain a single dictionary per row batch , so that it can be used to
// decode all previous dictionary encoded pages if we ever encounter a non - dictionary encoded
// page .
dictionaryIds = column . res... |
public class LineHeightProperty { /** * The used value of the property is this < code > value < / code > multiplied by the
* element ' s font size . Negative values are illegal . */
public CssSetter with ( Integer value ) { } } | return new SimpleCssSetter ( CSS_PROPERTY , value != null ? "" + value : null ) ; |
public class PorterStemmer { /** * / * doublec ( j ) is true < = > j , ( j - 1 ) contain a double consonant . */
private final boolean doublec ( int j ) { } } | if ( j < k0 + 1 ) return false ; if ( b [ j ] != b [ j - 1 ] ) return false ; return cons ( j ) ; |
public class JScreen { /** * Process this action .
* @ param strAction The action to process .
* By default , this method handles RESET , SUBMIT , and DELETE . */
public boolean doAction ( String strAction , int iOptions ) { } } | FieldList fieldList = this . getFieldList ( ) ; FieldTable fieldTable = null ; if ( fieldList != null ) fieldTable = fieldList . getTable ( ) ; boolean bFlag = false ; try { if ( Constants . RESET . equalsIgnoreCase ( strAction ) ) { if ( fieldTable != null ) { fieldTable . addNew ( ) ; } this . resetFocus ( ) ; bFlag ... |
public class CmsJspTagContainer { /** * Gets the container width as a number . < p >
* If the container width is not set , or not a number , - 1 will be returned . < p >
* @ return the container width or - 1 */
private int getContainerWidth ( ) { } } | int containerWidth = - 1 ; try { containerWidth = Integer . parseInt ( m_width ) ; } catch ( NumberFormatException e ) { // do nothing , set width to - 1
LOG . debug ( "Error parsing container width." , e ) ; } return containerWidth ; |
public class AbstractMarshaller { /** * Template method for handling { @ code StaxSource } s .
* < p > This implementation delegates to { @ code unmarshalXmlStreamReader } or
* { @ code unmarshalXmlEventReader } .
* @ param staxSource the { @ code StaxSource }
* @ return the object graph
* @ throws XmlMapping... | XMLStreamReader streamReader = StaxUtils . getXMLStreamReader ( staxSource ) ; if ( streamReader != null ) { return unmarshalXmlStreamReader ( streamReader ) ; } else { XMLEventReader eventReader = StaxUtils . getXMLEventReader ( staxSource ) ; if ( eventReader != null ) { return unmarshalXmlEventReader ( eventReader )... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link OperationParameterRefType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link OperationParameterRefT... | return new JAXBElement < OperationParameterRefType > ( _OperationParameterRef_QNAME , OperationParameterRefType . class , null , value ) ; |
public class DefaultValidator { /** * Validate the given introspection and object .
* @ param introspection The introspection
* @ param object The object
* @ param groups The groups
* @ param < T > The object type
* @ return The constraint violations */
@ Override @ SuppressWarnings ( "ConstantConditions" ) @... | if ( introspection == null ) { throw new ValidationException ( "Passed object [" + object + "] cannot be introspected. Please annotate with @Introspected" ) ; } @ SuppressWarnings ( "unchecked" ) final Collection < ? extends BeanProperty < Object , Object > > constrainedProperties = ( ( BeanIntrospection < Object > ) i... |
public class DrizzleConnection { /** * Retrieves this < code > Connection < / code > object ' s current catalog name .
* catalogs are not supported in drizzle
* TODO : Explain the wrapper interface to be able to change database
* @ return the current catalog name or < code > null < / code > if there is none
* @... | try { return protocol . getCatalog ( ) ; } catch ( QueryException e ) { throw SQLExceptionMapper . get ( e ) ; } |
public class SipCall { /** * The waitForDisconnect ( ) method waits for a BYE request addressed to this user agent to be
* received from the network . Call this method after calling the listenForDisconnect ( ) method .
* This method blocks until one of the following occurs : 1 ) A BYE request message has been
* r... | initErrorInfo ( ) ; RequestEvent event = parent . waitRequest ( timeout ) ; if ( event == null ) { setReturnCode ( parent . getReturnCode ( ) ) ; setErrorMessage ( parent . getErrorMessage ( ) ) ; setException ( parent . getException ( ) ) ; return false ; } Request request = event . getRequest ( ) ; receivedRequests .... |
public class ConnectorsRegistry { /** * Registers new connector
* @ param connector connector to register */
public void addConnector ( Connector connector ) { } } | connectors . put ( connector . getClass ( ) . getCanonicalName ( ) , new ConnectorEntry ( connector ) ) ; |
public class UrlBeautifier { /** * < code >
* Clean up all mappings .
* < / code > */
public void clearSavedFields ( ) { } } | append = null ; tokenToName = new LinkedHashMap < String , Navigation > ( ) ; nameToToken = new LinkedHashMap < String , Navigation > ( ) ; remainingMappings = new ArrayList < Navigation > ( ) ; |
public class EJBWrapper { /** * d583041 */
private static void addNoInterfaceEqualsMethod ( ClassWriter cw , String implClassName ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , INDENT + "adding method : equals (Ljava/lang/Object;)Z" ) ; // public boolean equals ( Object other )
final String desc = "(Ljava/lang/Object;)Z" ; MethodVisitor mv = cw . visitMethod ( ACC_PUBLIC , "equals" , desc , null , nul... |
public class DelegatingRemotingConnectorServer { /** * Write the header message to the client .
* The header message will contain the following items to allow the client to select a version : -
* - The bytes for the characters ' JMX ' - not completely fail safe but will allow early detection the client is connected... | CancellableDataOutputStream dos = new CancellableDataOutputStream ( channel . writeMessage ( ) ) ; try { dos . writeBytes ( JMX ) ; byte [ ] versions = getSupportedVersions ( fullVersionList ) ; dos . writeInt ( versions . length ) ; dos . write ( versions ) ; if ( Version . isSnapshot ( ) ) { dos . write ( SNAPSHOT ) ... |
public class SelectableItem { /** * Creation of a list of selectable items from a list of items , using an extractor for the id and the name ,
* and a predicate for the selection . */
public static < T > List < SelectableItem > listOf ( Collection < T > items , Function < T , String > idFn , Function < T , String > n... | return items . stream ( ) . map ( i -> new SelectableItem ( selectedFn . test ( i ) , idFn . apply ( i ) , nameFn . apply ( i ) ) ) . collect ( Collectors . toList ( ) ) ; |
public class ClientObject { /** * Checks whether or not this client has the specified permission .
* @ return null if the user has access , a fully - qualified translatable message string
* indicating the reason for denial of access .
* @ see ClientObject . PermissionPolicy */
public String checkAccess ( Permissi... | if ( _permPolicy == null ) { _permPolicy = createPermissionPolicy ( ) ; } return _permPolicy . checkAccess ( perm , context ) ; |
public class DeterministicExecutor { /** * Runs all commands that are currently pending . If those commands also
* schedule commands for execution , the scheduled commands will < em > not < / em >
* be executed until the next call to { @ link # runPendingCommands ( ) } or
* { @ link # runUntilIdle ( ) } . */
publ... | List < Runnable > commandsToRun = commands ; commands = new ArrayList < Runnable > ( ) ; for ( Runnable command : commandsToRun ) { command . run ( ) ; } |
public class ReporterDiagnosticListener { /** * ( non - Javadoc )
* @ see com . github . misberner . duzzt . DuzztDiagnosticListener # unparseableExpression ( java . lang . Exception , java . lang . String ) */
@ Override public void unparseableExpression ( Exception parseException , String exprName ) { } } | reporter . error ( prefix ( exprName ) , "Could not parse regular expression: " , parseException . getMessage ( ) ) ; |
public class TTTLearnerVPDA { /** * Determines a global splitter , i . e . , a splitter for any block . This method may ( but is not required to ) employ
* heuristics to obtain a splitter with a relatively short suffix length .
* @ return a splitter for any of the blocks */
private GlobalSplitter < I > findSplitter... | DTNode < I > bestBlockRoot = null ; Splitter < I > bestSplitter = null ; for ( DTNode < I > blockRoot : blockList ) { Splitter < I > splitter = findSplitter ( blockRoot ) ; if ( splitter != null ) { if ( bestSplitter == null || splitter . getNewDiscriminatorLength ( ) < bestSplitter . getNewDiscriminatorLength ( ) ) { ... |
public class CPInstanceUtil { /** * Removes all the cp instances where CPDefinitionId = & # 63 ; and displayDate & lt ; & # 63 ; and status = & # 63 ; from the database .
* @ param CPDefinitionId the cp definition ID
* @ param displayDate the display date
* @ param status the status */
public static void removeBy... | getPersistence ( ) . removeByC_LtD_S ( CPDefinitionId , displayDate , status ) ; |
public class Async { /** * Convert a synchronous function call into an asynchronous function call through an Observable .
* < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . s . png " alt = " " >
* @ param < R > the result type
* @ param... | return new Func0 < Observable < R > > ( ) { @ Override public Observable < R > call ( ) { return startCallable ( func , scheduler ) ; } } ; |
public class ClientMain { /** * Returns a usable { @ link Inet4Address } for the given interface name .
* If an interface name is given , return the first usable IPv4 address for
* that interface . If no interface name is given or if that interface
* doesn ' t have an IPv4 address , return ' s localhost address (... | if ( iface != null ) { Enumeration < InetAddress > addresses = NetworkInterface . getByName ( iface ) . getInetAddresses ( ) ; while ( addresses . hasMoreElements ( ) ) { InetAddress addr = addresses . nextElement ( ) ; if ( addr instanceof Inet4Address ) { return ( Inet4Address ) addr ; } } } InetAddress localhost = I... |
public class CommercePriceListUserSegmentEntryRelPersistenceImpl { /** * Returns the commerce price list user segment entry rel where commercePriceListId = & # 63 ; and commerceUserSegmentEntryId = & # 63 ; or throws a { @ link NoSuchPriceListUserSegmentEntryRelException } if it could not be found .
* @ param commerc... | CommercePriceListUserSegmentEntryRel commercePriceListUserSegmentEntryRel = fetchByC_C ( commercePriceListId , commerceUserSegmentEntryId ) ; if ( commercePriceListUserSegmentEntryRel == null ) { StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commercePriceListI... |
public class ChangeListenerMap { /** * Removes a listener from the list of listeners for the specified property .
* If the listener was added more than once to the same event source ,
* this listener will be notified one less time after being removed .
* @ param name the name of the property to listen on
* @ pa... | if ( this . map != null ) { L [ ] array = this . map . get ( name ) ; if ( array != null ) { for ( int i = 0 ; i < array . length ; i ++ ) { if ( listener . equals ( array [ i ] ) ) { int size = array . length - 1 ; if ( size > 0 ) { L [ ] clone = newArray ( size ) ; System . arraycopy ( array , 0 , clone , 0 , i ) ; S... |
public class AppServiceEnvironmentsInner { /** * Get all multi - role pools .
* Get all multi - role pools .
* ServiceResponse < PageImpl < WorkerPoolResourceInner > > * @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters... | if ( nextPageLink == null ) { throw new IllegalArgumentException ( "Parameter nextPageLink is required and cannot be null." ) ; } String nextUrl = String . format ( "%s" , nextPageLink ) ; return service . listMultiRolePoolsNext ( nextUrl , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ... |
public class BinaryImageOps { /** * For each pixel it applies the logical ' and ' operator between two images .
* @ param inputA First input image . Not modified .
* @ param inputB Second input image . Not modified .
* @ param output Output image . Can be same as either input . If null a new instance will be decl... | InputSanityCheck . checkSameShape ( inputA , inputB ) ; output = InputSanityCheck . checkDeclare ( inputA , output ) ; if ( BoofConcurrency . USE_CONCURRENT ) { ImplBinaryImageOps_MT . logicAnd ( inputA , inputB , output ) ; } else { ImplBinaryImageOps . logicAnd ( inputA , inputB , output ) ; } return output ; |
public class mps { /** * Use this operation to get Management Service Information . */
public static mps get ( nitro_service client ) throws Exception { } } | mps resource = new mps ( ) ; resource . validate ( "get" ) ; return ( ( mps [ ] ) resource . get_resources ( client ) ) [ 0 ] ; |
public class Option { /** * Return all value from Option Collection
* @ param values */
public static < T > List < T > getAll ( Collection < Option < T > > values ) { } } | List < T > results = CollectUtils . newArrayList ( values . size ( ) ) ; for ( Option < T > op : values ) { if ( op . isDefined ( ) ) results . add ( op . get ( ) ) ; } return results ; |
public class GenericCriteria { /** * This method is called to create a new list of values , converting from
* any symbolic values ( represented by FieldType instances ) to actual
* values retrieved from a Task or Resource instance .
* @ param oldValues list of old values containing symbolic items
* @ param cont... | Object [ ] newValues = new Object [ 2 ] ; for ( int loop = 0 ; loop < oldValues . length ; loop ++ ) { Object value = oldValues [ loop ] ; if ( value == null ) { continue ; } if ( value instanceof FieldType ) { FieldType type = ( FieldType ) value ; value = container . getCachedValue ( type ) ; switch ( type . getDataT... |
public class DatabasesInner { /** * Returns database metric definitions .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .
* @ param databaseName The n... | return listMetricDefinitionsWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class CDKHueckelAromaticityDetector { /** * Determines if the isolatedRingSystem has attached double bonds , which are not part of the ring system itself ,
* and not part of any other ring system . Exceptions : a N . sp2.3 nitrogen with a double ring to an
* oxygen outwards . */
private static boolean isRing... | Iterator < IAtom > atoms = isolatedRingSystem . atoms ( ) . iterator ( ) ; while ( atoms . hasNext ( ) ) { IAtom atom = atoms . next ( ) ; Iterator < IBond > neighborBonds = fullContainer . getConnectedBondsList ( atom ) . iterator ( ) ; while ( neighborBonds . hasNext ( ) ) { IBond neighborBond = neighborBonds . next ... |
public class PubSubInputHandler { /** * This method processes Acks from PubSubOutputHandlers .
* It uses the stream ID to determine the correct InputStream
* to aggregate the Ack into . This will be a sourceStream if this
* is the publishing ME , or an internalInputStream if not .
* If the aggregated Ack causes... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processAck" ) ; SIBUuid12 stream = ack . getGuaranteedStreamUUID ( ) ; // This code iterates through all of the OutputHandlers
// associated with this InputHandler , checking their ack prefixes
// The ack prefix of the Inpu... |
public class StringGroovyMethods { /** * Support the range subscript operator for String
* @ param text a String
* @ param range a Range
* @ return a substring corresponding to the Range
* @ since 1.0 */
public static String getAt ( String text , Range range ) { } } | RangeInfo info = subListBorders ( text . length ( ) , range ) ; String answer = text . substring ( info . from , info . to ) ; if ( info . reverse ) { answer = reverse ( answer ) ; } return answer ; |
public class MultiLayerNetwork { /** * Clear the previous state of the RNN layers ( if any ) . */
public void rnnClearPreviousState ( ) { } } | if ( layers == null ) return ; for ( int i = 0 ; i < layers . length ; i ++ ) { if ( layers [ i ] instanceof RecurrentLayer ) ( ( RecurrentLayer ) layers [ i ] ) . rnnClearPreviousState ( ) ; else if ( layers [ i ] instanceof MultiLayerNetwork ) { ( ( MultiLayerNetwork ) layers [ i ] ) . rnnClearPreviousState ( ) ; } e... |
public class ContainerNetworkingConfig { /** * Add networking aliases to a custom network
* @ param config network config as configured in the pom . xml
* @ return this configuration */
public ContainerNetworkingConfig aliases ( NetworkConfig config ) { } } | JsonObject endPoints = new JsonObject ( ) ; endPoints . add ( "Aliases" , JsonFactory . newJsonArray ( config . getAliases ( ) ) ) ; JsonObject endpointConfigMap = new JsonObject ( ) ; endpointConfigMap . add ( config . getCustomNetwork ( ) , endPoints ) ; networkingConfig . add ( "EndpointsConfig" , endpointConfigMap ... |
public class PrintDialog { /** * < editor - fold defaultstate = " collapsed " desc = " Generated Code " > / / GEN - BEGIN : initComponents */
private void initComponents ( ) { } } | java . awt . GridBagConstraints gridBagConstraints ; jLabel1 = new javax . swing . JLabel ( ) ; jProgressBar1 = new javax . swing . JProgressBar ( ) ; cancelButton = new javax . swing . JButton ( ) ; getContentPane ( ) . setLayout ( new java . awt . GridBagLayout ( ) ) ; addWindowListener ( new java . awt . event . Win... |
public class CouchDBClient { /** * ( non - Javadoc )
* @ see com . impetus . kundera . client . Client # delete ( java . lang . Object ,
* java . lang . Object ) */
@ Override public void delete ( Object entity , Object pKey ) { } } | HttpResponse response = null ; try { EntityMetadata entityMetadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entity . getClass ( ) ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( entityMetadata . getPersistenceUnit ( ) ) ; String _id =... |
public class ModelsImpl { /** * Gets custom prebuilt intents information of this application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the List & lt ; IntentClassifier & gt... | if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgu... |
public class RefreshSchemasRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RefreshSchemasRequest refreshSchemasRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( refreshSchemasRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( refreshSchemasRequest . getEndpointArn ( ) , ENDPOINTARN_BINDING ) ; protocolMarshaller . marshall ( refreshSchemasRequest . getReplicationInstanceArn ( ) , REPLIC... |
public class LinearRing { /** * Feed the path with the segments corresponding to the GeoPoint pairs
* projected using pProjection and clipped into a " reasonable " clip area
* In most cases ( Polygon without holes , Polyline ) the offset parameter will be null .
* In the case of a Polygon with holes , the first p... | final int size = mOriginalPoints . size ( ) ; if ( size < 2 ) { // nothing to paint
return pOffset ; } computeProjected ( pProjection ) ; computeDistances ( ) ; final PointL offset ; if ( pOffset != null ) { offset = pOffset ; } else { offset = new PointL ( ) ; getBestOffset ( pProjection , offset ) ; } mSegmentClipper... |
public class PointLocation { /** * { @ inheritDoc }
* @ see java . lang . Comparable # compareTo ( java . lang . Object ) */
@ Override public int compareTo ( final PointLocation pointLocation ) { } } | int comparison ; comparison = ( int ) Math . signum ( altitude - pointLocation . altitude ) ; if ( comparison == 0 ) { comparison = latitude . compareTo ( pointLocation . latitude ) ; } if ( comparison == 0 ) { comparison = longitude . compareTo ( pointLocation . longitude ) ; } return comparison ; |
public class SibRaEndpointActivation { /** * Called on deactivation of this endpoint . */
void deactivate ( ) { } } | final String methodName = "deactivate" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } _active = false ; /* * Deregister the messaging engine listener */
SibRaEngineComponent . deregisterMessagingEngineListener ( this , _endpointConfigura... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.