signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class PolicyStatesInner { /** * Queries policy states for the resource group level policy assignment .
* @ param policyStatesResource The virtual resource under PolicyStates resource type . In a given time range , ' latest ' represents the latest policy state ( s ) , whereas ' default ' represents all policy s... | if ( policyStatesResource == null ) { throw new IllegalArgumentException ( "Parameter policyStatesResource is required and cannot be null." ) ; } if ( subscriptionId == null ) { throw new IllegalArgumentException ( "Parameter subscriptionId is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ElementaryFunctionsType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "sinh" ) public JAXBElement < ElementaryFunctionsType > createSinh ( ElementaryFunctionsType valu... | return new JAXBElement < ElementaryFunctionsType > ( _Sinh_QNAME , ElementaryFunctionsType . class , null , value ) ; |
public class DefaultGrailsDomainClassInjector { /** * Returns whether a classNode has the specified property or not
* @ param classNode The ClassNode
* @ param propertyName The name of the property
* @ return True if the property exists in the ClassNode */
public static boolean hasProperty ( ClassNode classNode ,... | if ( classNode == null || propertyName == null || "" . equals ( propertyName . trim ( ) ) ) return false ; List properties = classNode . getProperties ( ) ; for ( Iterator i = properties . iterator ( ) ; i . hasNext ( ) ; ) { PropertyNode pn = ( PropertyNode ) i . next ( ) ; if ( pn . getName ( ) . equals ( propertyNam... |
public class SQLUtils { /** * Query the SQL for a single result object with the expected data type
* @ param connection
* connection
* @ param sql
* sql statement
* @ param args
* arguments
* @ param column
* column index
* @ param dataType
* GeoPackage data type
* @ return result , null if no res... | ResultSetResult result = wrapQuery ( connection , sql , args ) ; Object value = ResultUtils . buildSingleResult ( result , column , dataType ) ; return value ; |
public class BaseNCodec { /** * Increases our buffer by the { @ link # DEFAULT _ BUFFER _ RESIZE _ FACTOR } .
* @ param context the context to be used */
private byte [ ] resizeBuffer ( final Context context ) { } } | if ( context . buffer == null ) { context . buffer = new byte [ getDefaultBufferSize ( ) ] ; context . pos = 0 ; context . readPos = 0 ; } else { final byte [ ] b = new byte [ context . buffer . length * DEFAULT_BUFFER_RESIZE_FACTOR ] ; System . arraycopy ( context . buffer , 0 , b , 0 , context . buffer . length ) ; c... |
public class SnomedCodeComparator { /** * unstable sort for now */
public int compare ( final SnomedConcept o1 , final SnomedConcept o2 ) { } } | if ( o1 == o2 ) return 0 ; if ( o1 != null ) { if ( o2 == null ) return 1 ; // need to use BigInteger to compare SNOMED codes since some are fantastically long
else return new BigInteger ( o1 . snomedId ) . compareTo ( new BigInteger ( o2 . snomedId ) ) ; } return - 1 ; |
public class AbcGrammar { /** * \ n in name = linefeed
* voice - name : : = ( " name = " / " nm = " ) % x22 * non - quote % x22 */
Rule VoiceName ( ) { } } | return SequenceS ( FirstOfS ( IgnoreCase ( "name=" ) , IgnoreCase ( "nm=" ) ) , String ( "\"" ) , ZeroOrMore ( NonQuote ( ) ) . label ( VoiceName ) . suppressSubnodes ( ) , String ( "\"" ) ) ; |
public class CommerceWarehousePersistenceImpl { /** * Returns the last commerce warehouse in the ordered set where groupId = & # 63 ; and active = & # 63 ; and primary = & # 63 ; .
* @ param groupId the group ID
* @ param active the active
* @ param primary the primary
* @ param orderByComparator the comparator... | int count = countByG_A_P ( groupId , active , primary ) ; if ( count == 0 ) { return null ; } List < CommerceWarehouse > list = findByG_A_P ( groupId , active , primary , count - 1 , count , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class auditsyslogpolicy_systemglobal_binding { /** * Use this API to fetch auditsyslogpolicy _ systemglobal _ binding resources of given name . */
public static auditsyslogpolicy_systemglobal_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | auditsyslogpolicy_systemglobal_binding obj = new auditsyslogpolicy_systemglobal_binding ( ) ; obj . set_name ( name ) ; auditsyslogpolicy_systemglobal_binding response [ ] = ( auditsyslogpolicy_systemglobal_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class ThirdPartyAudienceSegment { /** * Sets the cost value for this ThirdPartyAudienceSegment .
* @ param cost * Specifies CPM cost for the given segment . This attribute is
* readonly and is assigned by the
* data provider .
* < p > The CPM cost comes from the active pricing ,
* if there is one ;
*... | this . cost = cost ; |
public class ApiOvhOrder { /** * Get allowed durations for ' plesk ' option
* REST : GET / order / vps / { serviceName } / plesk
* @ param domainNumber [ required ] Domain number you want to order a licence for
* @ param serviceName [ required ] The internal name of your VPS offer
* @ deprecated */
public Array... | String qPath = "/order/vps/{serviceName}/plesk" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "domainNumber" , domainNumber ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ; |
public class Logger { /** * Logs fatal ( unrecoverable ) message that caused the process to crash .
* @ param correlationId ( optional ) transaction id to trace execution through
* call chain .
* @ param error an error object associated with this message . */
public void fatal ( String correlationId , Exception e... | formatAndWrite ( LogLevel . Fatal , correlationId , error , null , null ) ; |
public class IPRange { /** * Compute the extended network prefix from the IP subnet mask .
* @ param mask Reference to the subnet mask IP number .
* @ return Return the extended network prefix . Return - 1 if the specified
* mask cannot be converted into a extended prefix network . */
private int computeNetworkPr... | int result = 0 ; int tmp = mask . getIPAddress ( ) ; while ( ( tmp & 0x00000001 ) == 0x00000001 ) { result ++ ; tmp = tmp >>> 1 ; } if ( tmp != 0 ) { return - 1 ; } return result ; |
public class GridMap { /** * Returns first local user name mapped to the specified
* globusID .
* @ param globusID globusID
* @ return local user name for the specified globusID .
* Null if the globusID is not mapped
* to a local user name . */
public String getUserID ( String globusID ) { } } | String [ ] ids = getUserIDs ( globusID ) ; if ( ids != null && ids . length > 0 ) { return ids [ 0 ] ; } else { return null ; } |
public class ChatDirector { /** * Delivers a plain chat message ( not a slash command ) on the specified speak service in the
* specified mode . The message will be mogrified and filtered prior to delivery .
* @ return { @ link ChatCodes # SUCCESS } if the message was delivered or a string indicating why it
* fai... | // run the message through our mogrification process
message = mogrifyChat ( message , mode , true , mode != ChatCodes . EMOTE_MODE ) ; // mogrification may result in something being turned into a slash command , in which case
// we have to run everything through again from the start
if ( message . startsWith ( "/" ) )... |
public class PluginWrapper { /** * Returns a one - line descriptive name of this plugin . */
@ Exported public String getLongName ( ) { } } | String name = manifest . getMainAttributes ( ) . getValue ( "Long-Name" ) ; if ( name != null ) return name ; return shortName ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < }
* { @ link EnumIncludeRelationships } { @ code > } */
@ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "includeRelationships" , scope = Query . class ) public JAXBElement < EnumIn... | return new JAXBElement < EnumIncludeRelationships > ( _GetObjectOfLatestVersionIncludeRelationships_QNAME , EnumIncludeRelationships . class , Query . class , value ) ; |
public class CommonsApi { /** * Retrieves a list of the current Commons institutions .
* < br >
* This method does not require authentication .
* @ return list of the current Commons institutions .
* @ throws JinxException if there are any errors .
* @ see < a href = " https : / / www . flickr . com / service... | Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.commons.getInstitutions" ) ; return jinx . flickrGet ( params , Institutions . class ) ; |
public class MaterialCalendarView { /** * Select a fresh range of date including first day and last day .
* @ param firstDay first day of the range to select
* @ param lastDay last day of the range to select */
public void selectRange ( final CalendarDay firstDay , final CalendarDay lastDay ) { } } | if ( firstDay == null || lastDay == null ) { return ; } else if ( firstDay . isAfter ( lastDay ) ) { adapter . selectRange ( lastDay , firstDay ) ; dispatchOnRangeSelected ( adapter . getSelectedDates ( ) ) ; } else { adapter . selectRange ( firstDay , lastDay ) ; dispatchOnRangeSelected ( adapter . getSelectedDates ( ... |
public class LocaleUtils { /** * Parse a header string and return the list of locales that were found .
* If the header is empty or null then an empty list will be returned .
* @ param acceptLanguage The Accept - Language header
* @ return The list of locales , in order of preference */
public static List < Local... | if ( acceptLanguage == null || acceptLanguage . isEmpty ( ) ) { return Collections . emptyList ( ) ; } final List < Locale > ret = new ArrayList < > ( ) ; final List < List < QValueParser . QValueResult > > parsedResults = QValueParser . parse ( acceptLanguage ) ; for ( List < QValueParser . QValueResult > qvalueResult... |
public class LdapTemplate { /** * { @ inheritDoc } */
@ Override public < T > List < T > search ( LdapQuery query , AttributesMapper < T > mapper ) { } } | SearchControls searchControls = searchControlsForQuery ( query , DONT_RETURN_OBJ_FLAG ) ; return search ( query . base ( ) , query . filter ( ) . encode ( ) , searchControls , mapper ) ; |
public class StringUtils { /** * Replaces all occurrences of the given char in the given string with the given replacement string . This method is an
* optimal version of { @ link String # replace ( CharSequence , CharSequence ) s . replace ( " c " , replacement ) } . */
public static String replaceChar ( String s , ... | int pos = s . indexOf ( c ) ; if ( pos < 0 ) { return s ; } StringBuilder sb = new StringBuilder ( s . length ( ) - 1 + replacement . length ( ) ) ; int prevPos = 0 ; do { sb . append ( s , prevPos , pos ) ; sb . append ( replacement ) ; prevPos = pos + 1 ; pos = s . indexOf ( c , pos + 1 ) ; } while ( pos > 0 ) ; sb .... |
public class Regex { /** * Determine whether a class name is to be accepted or not , based on
* the regular expression specified to the constructor .
* @ param classInfo the { @ link com . poolik . classfinder . info . ClassInfo } object to test
* @ return < tt > true < / tt > if the class name matches ,
* < tt... | return pattern . matcher ( classInfo . getClassName ( ) ) . find ( ) ; |
public class CQLService { /** * createStoreIfAbsent */
@ Override public void deleteStoreIfPresent ( String storeName ) { } } | String tableName = storeToCQLName ( storeName ) ; if ( storeExists ( tableName ) ) { new CQLSchemaManager ( this ) . dropCQLTable ( tableName ) ; } |
public class A_CmsJspValueWrapper { /** * Returns a lazy initialized map that provides trimmed to size strings of the wrapped object string value .
* The size being the integer value of the key object . < p >
* @ return a map that provides trimmed to size strings of the wrapped object string value */
public Map < O... | if ( m_trimToSize == null ) { m_trimToSize = CmsCollectionsGenericWrapper . createLazyMap ( new CmsTrimToSizeTransformer ( ) ) ; } return m_trimToSize ; |
public class BlockLeaf { /** * Validate the block , checking that row lengths and values are sensible . */
void validateBlock ( Row row ) { } } | if ( ! row . getDatabase ( ) . isValidate ( ) ) { return ; } int rowHead = _rowHead ; int blobTail = _blobTail ; if ( rowHead < blobTail ) { throw new IllegalStateException ( this + " rowHead:" + rowHead + " blobTail:" + blobTail ) ; } int rowOffset = _rowHead ; byte [ ] buffer = _buffer ; while ( rowOffset < BLOCK_SIZ... |
public class SkillsStoreSkillMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SkillsStoreSkill skillsStoreSkill , ProtocolMarshaller protocolMarshaller ) { } } | if ( skillsStoreSkill == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( skillsStoreSkill . getSkillId ( ) , SKILLID_BINDING ) ; protocolMarshaller . marshall ( skillsStoreSkill . getSkillName ( ) , SKILLNAME_BINDING ) ; protocolMarshaller .... |
public class TypeToStringUtils { /** * Prints type as string . E . g . { @ code toStringType ( ParameterizedType ( List , String ) , [ : ] ) = = " List < String > " } ,
* { @ code toStringType ( WildcardType ( String ) , [ : ] ) = = " ? extends String " } .
* If { @ link ParameterizedType } is inner class and conta... | final String res ; if ( type instanceof Class ) { res = processClass ( ( Class ) type ) ; } else if ( type instanceof ParameterizedType ) { res = processParametrizedType ( ( ParameterizedType ) type , generics ) ; } else if ( type instanceof GenericArrayType ) { res = toStringType ( ( ( GenericArrayType ) type ) . getG... |
public class Sentence { /** * word pos
* @ return */
public String [ ] [ ] toWordTagArray ( ) { } } | List < Word > wordList = toSimpleWordList ( ) ; String [ ] [ ] pair = new String [ 2 ] [ wordList . size ( ) ] ; Iterator < Word > iterator = wordList . iterator ( ) ; for ( int i = 0 ; i < pair [ 0 ] . length ; i ++ ) { Word word = iterator . next ( ) ; pair [ 0 ] [ i ] = word . value ; pair [ 1 ] [ i ] = word . label... |
public class TldTaglibTypeImpl { /** * If not already created , a new < code > tag < / code > element will be created and returned .
* Otherwise , the first existing < code > tag < / code > element will be returned .
* @ return the instance defined for the element < code > tag < / code > */
public TagType < TldTagl... | List < Node > nodeList = childNode . get ( "tag" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new TagTypeImpl < TldTaglibType < T > > ( this , "tag" , childNode , nodeList . get ( 0 ) ) ; } return createTag ( ) ; |
public class SipParser { /** * Check whether the buffer is exactly three bytes long and has the
* bytes " udp " in it . Note , in SIP there is a different between transport
* specified in a Via - header and a transport - param specified in a SIP URI .
* One is upper case , one is lower case . Another really annoy... | try { return t . capacity ( ) == 3 && t . getByte ( 0 ) == 'u' && t . getByte ( 1 ) == 'd' && t . getByte ( 2 ) == 'p' ; } catch ( final IOException e ) { return false ; } |
public class AbstractDocumentQuery { /** * Instruct the query to wait for non stale result for the specified wait timeout .
* This shouldn ' t be used outside of unit tests unless you are well aware of the implications
* @ param waitTimeout Wait timeout */
@ Override public void _waitForNonStaleResults ( Duration w... | theWaitForNonStaleResults = true ; timeout = ObjectUtils . firstNonNull ( waitTimeout , getDefaultTimeout ( ) ) ; |
public class CleaneLing { /** * Returns a new full CleaneLing solver .
* @ param f the formula factory
* @ return the solver */
public static CleaneLing full ( final FormulaFactory f ) { } } | return new CleaneLing ( f , SolverStyle . FULL , new CleaneLingConfig . Builder ( ) . build ( ) ) ; |
public class DistRaid { /** * set up input file which has the list of input files .
* @ return boolean
* @ throws IOException */
private boolean setup ( ) throws IOException { } } | estimateSavings ( ) ; final String randomId = getRandomId ( ) ; JobClient jClient = new JobClient ( jobconf ) ; Path jobdir = new Path ( jClient . getSystemDir ( ) , NAME + "_" + randomId ) ; LOG . info ( JOB_DIR_LABEL + "=" + jobdir ) ; jobconf . set ( JOB_DIR_LABEL , jobdir . toString ( ) ) ; Path log = new Path ( jo... |
public class RequestCreator { /** * Executes request and returns the first Article associated
* with this request . This is useful for individual Article requests .
* May return null .
* @ return Returns the first article associated with this request . */
public Article getFirst ( ) { } } | try { List < Article > articleList = get ( ) ; if ( articleList == null || articleList . size ( ) < 1 ) return null ; return articleList . get ( 0 ) ; } catch ( IOException e ) { return null ; } |
public class LDblUnaryOperatorBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static LDblUnaryOperator dblUnaryOperatorFrom ( Consumer < LDblUnaryOperatorBuilder > buildingFunction ) { } } | LDblUnaryOperatorBuilder builder = new LDblUnaryOperatorBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class EbeanUtils { /** * < p > checkQuery . < / p >
* @ param query a { @ link io . ebeaninternal . api . SpiQuery } object .
* @ param validation a { @ link ameba . db . ebean . internal . ListExpressionValidation } object .
* @ param ignoreUnknown a boolean . */
public static void checkQuery ( SpiQuery <... | if ( query != null ) { validate ( query . getWhereExpressions ( ) , validation , ignoreUnknown ) ; validate ( query . getHavingExpressions ( ) , validation , ignoreUnknown ) ; validate ( query . getOrderBy ( ) , validation , ignoreUnknown ) ; Set < String > invalid = validation . getUnknownProperties ( ) ; if ( ! ignor... |
public class ServiceType { /** * The start of the definition ( position of & # 39 ; service & # 39 ; )
* @ return Optional of the < code > start _ pos < / code > field value . */
@ javax . annotation . Nonnull public java . util . Optional < net . morimekta . providence . model . FilePos > optionalStartPos ( ) { } } | return java . util . Optional . ofNullable ( mStartPos ) ; |
public class JavacMessages { /** * Gets the localized string corresponding to a key , formatted with a set of args . */
public String getLocalizedString ( String key , Object ... args ) { } } | return getLocalizedString ( currentLocale , key , args ) ; |
public class GetSdkTypeResult { /** * A list of configuration properties of an < a > SdkType < / a > .
* @ param configurationProperties
* A list of configuration properties of an < a > SdkType < / a > . */
public void setConfigurationProperties ( java . util . Collection < SdkConfigurationProperty > configurationP... | if ( configurationProperties == null ) { this . configurationProperties = null ; return ; } this . configurationProperties = new java . util . ArrayList < SdkConfigurationProperty > ( configurationProperties ) ; |
public class VoidBitStore { /** * comparable methods */
@ Override public int compareNumericallyTo ( BitStore that ) { } } | if ( that == null ) throw new IllegalArgumentException ( "null that" ) ; return that . zeros ( ) . isAll ( ) ? 0 : - 1 ; |
public class EntityResolver { public Set < String > getFieldParametersOnPage ( Integer pageNumber ) { } } | Set < String > fieldParameters = parameterPageMap . get ( pageNumber ) ; if ( fieldParameters == null ) { fieldParameters = new HashSet < String > ( ) ; } return fieldParameters ; |
public class UsersApi { /** * Get the logged in user .
* Get the [ CfgPerson ] ( https : / / docs . genesys . com / Documentation / PSDK / latest / ConfigLayerRef / CfgPerson ) object for the currently logged in user .
* @ return ApiResponse & lt ; GetUsersSuccessResponse & gt ;
* @ throws ApiException If fail to... | com . squareup . okhttp . Call call = getCurrentUserValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetUsersSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class ReloadableType { /** * Check if the specified method is different to the original form from the type as loaded .
* @ param methodId the ID of the method currently executing
* @ return 0 if the method cannot have changed . 1 if the method has changed . 2 if the method has been deleted in a
* new versi... | if ( liveVersion == null ) { return 0 ; } else { int retval = 0 ; // First check if a new version of the type was loaded :
if ( liveVersion != null ) { if ( GlobalConfiguration . logging && log . isLoggable ( Level . FINER ) ) { log . info ( "MethodId=" + methodId + " method=" + typedescriptor . getMethod ( methodId ) ... |
public class TypeUtils { /** * split by comma , handling nested generified types */
private static List < String > split ( String str ) { } } | List < String > result = new ArrayList < String > ( ) ; int genericCount = 0 ; int startPos = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == ',' && genericCount == 0 ) { result . add ( str . substring ( startPos , i ) . trim ( ) ) ; startPos = i + 1 ; } else if ( str . charAt ( i ) == ... |
public class ListActionExecutionsResult { /** * The details for a list of recent executions , such as action execution ID .
* @ param actionExecutionDetails
* The details for a list of recent executions , such as action execution ID . */
public void setActionExecutionDetails ( java . util . Collection < ActionExecu... | if ( actionExecutionDetails == null ) { this . actionExecutionDetails = null ; return ; } this . actionExecutionDetails = new java . util . ArrayList < ActionExecutionDetail > ( actionExecutionDetails ) ; |
public class GrafeasV1Beta1Client { /** * Deletes the specified occurrence . For example , use this method to delete an occurrence when the
* occurrence is no longer applicable for the given resource .
* < p > Sample code :
* < pre > < code >
* try ( GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Cli... | DeleteOccurrenceRequest request = DeleteOccurrenceRequest . newBuilder ( ) . setName ( name ) . build ( ) ; deleteOccurrence ( request ) ; |
public class DatabaseManager { /** * Used by server to open a new session */
public static Session newSession ( int dbID , String user , String password , int timeZoneSeconds ) { } } | Database db = ( Database ) databaseIDMap . get ( dbID ) ; if ( db == null ) { return null ; } Session session = db . connect ( user , password , timeZoneSeconds ) ; session . isNetwork = true ; return session ; |
public class Category { /** * Creates a new category from settings , if the settings shouldn ' t be individually grouped .
* @ param description Category name , for display in { @ link CategoryView }
* @ param itemIcon Icon to be shown next to the category name
* @ param settings { @ link Setting } to be shown in... | return new Category ( description , itemIcon , Group . of ( settings ) ) ; |
public class JenkinsVersion { /** * This will check if the current instance version is < code > & gt ; < / code > the
* given version .
* @ param version The version to compare with .
* @ return true or false . */
public boolean isGreaterThan ( String version ) { } } | JenkinsVersion create = create ( version ) ; return this . cv . compareTo ( create . cv ) > 0 ; |
public class ParserUtils { /** * Remove the given number of chars from start and end .
* There is no parameter checking , the caller has to take care of this .
* @ param s the StringBuilder
* @ param left no of chars to be removed from start
* @ param right no of chars to be removed from end
* @ return the tr... | return s . substring ( left , s . length ( ) - right ) ; |
public class PHATImageUtils { /** * TODO Optimizar la conversion ! ! */
public static byte [ ] bufferedImageToBMPByteArray ( BufferedImage image , BufferedImage bufferedImage ) { } } | ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { /* ImageTypeSpecifier type =
ImageTypeSpecifier . createFromRenderedImage ( image ) ;
Iterator < ImageWriter > iter = ImageIO . getImageWriters ( type , " bmp " ) ;
System . err . println ( ImageIO . getWriterFormatNames ( ) ) ;
boolean sig = it... |
public class Log { /** * Flush this log file to the physical disk
* @ throws IOException file read error */
public void flush ( ) throws IOException { } } | if ( unflushed . get ( ) == 0 ) return ; synchronized ( lock ) { if ( logger . isTraceEnabled ( ) ) { logger . debug ( "Flushing log '" + name + "' last flushed: " + getLastFlushedTime ( ) + " current time: " + System . currentTimeMillis ( ) ) ; } segments . getLastView ( ) . getMessageSet ( ) . flush ( ) ; unflushed .... |
public class ResourceCopy { /** * Copies the configuration from " src / main / configuration " to " wisdom / conf " . Copied resources are filtered .
* @ param mojo the mojo
* @ param filtering the component required to filter resources
* @ throws IOException if a file cannot be copied */
public static void copyC... | File in = new File ( mojo . basedir , Constants . CONFIGURATION_SRC_DIR ) ; if ( in . isDirectory ( ) ) { File out = new File ( mojo . getWisdomRootDirectory ( ) , Constants . CONFIGURATION_DIR ) ; filterAndCopy ( mojo , filtering , in , out ) ; } else { mojo . getLog ( ) . warn ( "No configuration directory (src/main/... |
public class DynamoDBDeleteExpression { /** * One or more substitution variables for simplifying complex expressions .
* @ param expressionAttributeNames
* One or more substitution variables for simplifying complex
* expressions .
* @ return A reference to this updated object so that method calls can be
* cha... | setExpressionAttributeNames ( expressionAttributeNames ) ; return this ; |
public class BindingPositioner { /** * Tests whether a key from the given child injector can be made visible in
* its parent . For pinned keys , this means that they ' re exposed to the
* parent ; for keys that aren ' t pinned , it means that there ' s no other
* constraint preventing them from floating up .
* ... | GinjectorBindings parent = child . getParent ( ) ; if ( parent == null ) { // Can ' t move above the root .
return false ; } else if ( parent . isBoundLocallyInChild ( key ) ) { // If a sibling module already materialized a binding for this key , we
// can ' t float over it .
return false ; } else if ( pinned ) { // If... |
public class CamelSyncConsumer { /** * Builds response and sets it as out message on given Camel exchange .
* @ param message
* @ param exchange
* @ return */
private void buildOutMessage ( Exchange exchange , Message message ) { } } | org . apache . camel . Message reply = exchange . getOut ( ) ; for ( Map . Entry < String , Object > header : message . getHeaders ( ) . entrySet ( ) ) { if ( ! header . getKey ( ) . startsWith ( MessageHeaders . PREFIX ) ) { reply . setHeader ( header . getKey ( ) , header . getValue ( ) ) ; } } if ( message . getHead... |
public class PacketDistributer { /** * Adds a new handler for this specific Packet ID
* @ param packetID Packet ID to add handler for
* @ param packetHandler Handler for given Packet ID
* @ throws IllegalArgumentException when Packet ID already has a registered handler */
public synchronized void addHandler ( fin... | if ( registry . containsKey ( packetID ) ) throw new IllegalArgumentException ( "Handler for ID: " + packetID + " already exists" ) ; registry . put ( packetID , packetHandler ) ; |
public class BinaryResource { /** * Save the contents of the resource to a file .
* This reads the data from the stream and stores it into the given file .
* Depending on the resource the data might or might not be available afterwards .
* @ param aFileName file to save the data in
* @ return the file the conte... | BufferedOutputStream bos = new BufferedOutputStream ( new FileOutputStream ( aFileName ) , 1024 ) ; byte [ ] buffer = new byte [ 1024 ] ; int len = - 1 ; while ( ( len = inputStream . read ( buffer ) ) != - 1 ) { bos . write ( buffer , 0 , len ) ; } bos . close ( ) ; inputStream . close ( ) ; return aFileName ; |
public class DetachPolicyRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DetachPolicyRequest detachPolicyRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( detachPolicyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( detachPolicyRequest . getPolicyName ( ) , POLICYNAME_BINDING ) ; protocolMarshaller . marshall ( detachPolicyRequest . getTarget ( ) , TARGET_BINDING ) ; } catch ( E... |
public class WMultiFileWidgetExample { /** * Outputs information on the uploaded files to the text area . */
private void processFiles ( ) { } } | StringBuffer buf = new StringBuffer ( ) ; appendFileDetails ( buf , allFiles ) ; appendFileDetails ( buf , textFiles ) ; appendFileDetails ( buf , pdfFiles ) ; console . setText ( buf . toString ( ) ) ; |
public class Datasets { /** * Update a { @ link Dataset } for the given dataset or view URI string .
* You can add columns , remove columns , or change the data type of columns
* in your dataset , provided you don ' t attempt a change that is incompatible
* with written data . Avro defines rules for compatible sc... | return Datasets . < E , D > update ( URI . create ( uri ) , descriptor , type ) ; |
public class ClassUtils { /** * Lookup the getter method for the given property . This can be a getXXX ( ) or a isXXX ( ) method .
* @ param clazz
* type which contains the property .
* @ param propertyName
* name of the property .
* @ return a Method with read - access for the property . */
public static Met... | String propertyNameCapitalized = capitalize ( propertyName ) ; try { return clazz . getMethod ( "get" + propertyNameCapitalized ) ; } catch ( Exception e ) { try { return clazz . getMethod ( "is" + propertyNameCapitalized ) ; } catch ( Exception e1 ) { throw new NoSuchMethodError ( "Could not find getter (getXX or isXX... |
public class RequestBuilder { /** * Set request headers . */
@ SafeVarargs public final RequestBuilder headers ( Map . Entry < String , ? > ... headers ) { } } | headers ( Lists . of ( headers ) ) ; return this ; |
public class GImageBandMath { /** * Computes the average for each pixel across all bands in the { @ link Planar } image .
* @ param input Planar image
* @ param output Gray scale image containing average pixel values */
public static < T extends ImageGray < T > > void average ( Planar < T > input , T output ) { } } | average ( input , output , 0 , input . getNumBands ( ) - 1 ) ; |
public class CmsImageGalleryField { /** * Sets the name of the input field . < p >
* @ param name of the input field */
@ Override public void setName ( String name ) { } } | m_textbox . setName ( name ) ; m_descriptionArea . setName ( name + "_TextArea" ) ; |
public class EndiannessUtil { public static < R > short readShort ( ByteAccessStrategy < R > strategy , R resource , long offset , boolean useBigEndian ) { } } | return useBigEndian ? readShortB ( strategy , resource , offset ) : readShortL ( strategy , resource , offset ) ; |
public class PdfStamper { /** * Sets the encryption options for this document . The userPassword and the
* ownerPassword can be null or have zero length . In this case the ownerPassword
* is replaced by a random string . The open permissions for the document can be
* AllowPrinting , AllowModifyContents , AllowCop... | if ( stamper . isAppend ( ) ) throw new DocumentException ( "Append mode does not support changing the encryption status." ) ; if ( stamper . isContentWritten ( ) ) throw new DocumentException ( "Content was already written to the output." ) ; stamper . setEncryption ( userPassword , ownerPassword , permissions , stren... |
public class LSrtToFltFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static LSrtToFltFunction srtToFltFunctionFrom ( Consumer < LSrtToFltFunctionBuilder > buildingFunction ) { } } | LSrtToFltFunctionBuilder builder = new LSrtToFltFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class EpsReader { /** * Default case that adds comment with keyword to directory
* @ param directory EpsDirectory to add extracted data to
* @ param name String that holds name of current comment
* @ param value String that holds value of current comment */
private void addToDirectory ( @ NotNull final Eps... | Integer tag = EpsDirectory . _tagIntegerMap . get ( name ) ; if ( tag == null ) return ; switch ( tag ) { case EpsDirectory . TAG_IMAGE_DATA : extractImageData ( directory , value ) ; break ; case EpsDirectory . TAG_CONTINUE_LINE : directory . setString ( _previousTag , directory . getString ( _previousTag ) + " " + va... |
public class VerboseFormatter { /** * Formatter */
@ Override public String format ( LogRecord event ) { } } | final StringBuilder message = new StringBuilder ( Constant . HUNDRED ) ; appendDate ( message ) ; appendLevel ( message , event ) ; appendFunction ( message , event ) ; message . append ( event . getMessage ( ) ) . append ( System . lineSeparator ( ) ) ; appendThrown ( message , event ) ; return message . toString ( ) ... |
public class DeadlineTimerWheel { /** * Cancel a previously scheduled timer .
* @ param timerId of the timer to cancel .
* @ return true if successful otherwise false if the timerId did not exist . */
public boolean cancelTimer ( final long timerId ) { } } | final int wheelIndex = tickForTimerId ( timerId ) ; final int arrayIndex = indexInTickArray ( timerId ) ; if ( wheelIndex < wheel . length ) { final long [ ] array = wheel [ wheelIndex ] ; if ( arrayIndex < array . length && NULL_TIMER != array [ arrayIndex ] ) { array [ arrayIndex ] = NULL_TIMER ; timerCount -- ; retu... |
public class CmsJspTagIncludeTEI { /** * Checks the validity of the < code > & lt ; cms : include / & gt ; < / code > attributes . < p >
* The logic used is :
* < pre >
* if ( hasFile & & ( hasSuffix | | hasProperty | | hasAttribute ) ) return false ;
* if ( hasProperty & & hasAttribute ) return false ;
* if ... | boolean hasFile = isSpecified ( data , ATTR_FILE ) || isSpecified ( data , ATTR_PAGE ) ; boolean hasSuffix = isSpecified ( data , ATTR_SUFFIX ) ; boolean hasProperty = isSpecified ( data , ATTR_PROPERTY ) ; boolean hasAttribute = isSpecified ( data , ATTR_ATTRIBUTE ) ; // boolean hasElement = isSpecified ( data , C _ A... |
public class AbstractArakhneMojo { /** * Replies a list of files which are found on the file system .
* @ param directory
* is the directory to search in .
* @ param filter
* is the file selector
* @ return the list of files . */
public final Collection < File > findFiles ( File directory , FileFilter filter ... | final Collection < File > files = new ArrayList < > ( ) ; findFiles ( directory , filter , files ) ; return files ; |
public class DescribeBudgetsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeBudgetsRequest describeBudgetsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeBudgetsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeBudgetsRequest . getAccountId ( ) , ACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( describeBudgetsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ... |
public class SQLTable { /** * The instance method sets a new property value .
* @ param _ name name of the property
* @ param _ value value of the property
* @ throws CacheReloadException on error */
@ Override protected void setProperty ( final String _name , final String _value ) throws CacheReloadException { }... | if ( "ReadOnly" . equals ( _name ) ) { this . readOnly = "true" . equalsIgnoreCase ( "true" ) ; } |
public class ApiOvhSms { /** * Sms received associated to the sms user
* REST : GET / sms / { serviceName } / users / { login } / incoming
* @ param tag [ required ] Filter the value of tag property ( = )
* @ param sender [ required ] Filter the value of sender property ( = )
* @ param serviceName [ required ] ... | String qPath = "/sms/{serviceName}/users/{login}/incoming" ; StringBuilder sb = path ( qPath , serviceName , login ) ; query ( sb , "sender" , sender ) ; query ( sb , "tag" , tag ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ; |
public class Config { /** * Returns the TopicConfig for the given name , creating one
* if necessary and adding it to the collection of known configurations .
* The configuration is found by matching the configuration name
* pattern to the provided { @ code name } without the partition qualifier
* ( the part of... | return ConfigUtils . getConfig ( configPatternMatcher , topicConfigs , name , TopicConfig . class ) ; |
public class MimeTypeParser { /** * Try to convert the string representation of a MIME type to an object . The
* default quoting algorithm { @ link CMimeType # DEFAULT _ QUOTING } is used to
* unquote strings .
* @ param sMimeType
* The string representation to be converted . May be < code > null < / code > .
... | return parseMimeType ( sMimeType , CMimeType . DEFAULT_QUOTING ) ; |
public class BehaviorHistoryInfo { /** * 对应deleteCount的数据统计 */
public Long getDeleteNumber ( ) { } } | Long deleteNumber = 0L ; if ( items . size ( ) != 0 ) { for ( TableStat item : items ) { deleteNumber += item . getDeleteCount ( ) ; } } return deleteNumber ; |
public class CmsDefaultPasswordGenerator { /** * Generates a random password . < p >
* @ param countTotal Total password length
* @ param countCapitals Minimal count of capitals
* @ param countSpecials count of special chars
* @ return random password */
public String getRandomPassword ( int countTotal , int co... | String res = "" ; String [ ] Normals = ArrayUtils . addAll ( ArrayUtils . addAll ( Capitals , Letters ) , Numbers ) ; Random rand = new Random ( ) ; for ( int i = 0 ; i < ( countTotal - countCapitals - countSpecials ) ; i ++ ) { res = res + Normals [ rand . nextInt ( Normals . length ) ] ; } for ( int i = 0 ; i < count... |
public class IOUtils { /** * Writes all the contents of a Reader to a Writer .
* @ param input
* the input to read from
* @ param output
* the output to write to
* @ throws java . io . IOException
* if an IOExcption occurs */
public static void copy ( InputStream input , OutputStream output ) throws IOExcep... | byte [ ] buf = new byte [ BUFFER_SIZE ] ; int num = 0 ; while ( ( num = input . read ( buf , 0 , buf . length ) ) != - 1 ) { output . write ( buf , 0 , num ) ; } |
public class Clock { /** * Defines if the minute tickmarks will be drawn .
* @ param VISIBLE */
public void setMinuteTickMarksVisible ( final boolean VISIBLE ) { } } | if ( null == minuteTickMarksVisible ) { _minuteTickMarksVisible = VISIBLE ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { minuteTickMarksVisible . set ( VISIBLE ) ; } |
public class ExpandableRecyclerAdapter { /** * Given the index relative to the entire RecyclerView , returns the nearest
* ParentPosition without going past the given index .
* If it is the index of a parent , will return the corresponding parent position .
* If it is the index of a child within the RV , will ret... | if ( flatPosition == 0 ) { return 0 ; } int parentCount = - 1 ; for ( int i = 0 ; i <= flatPosition ; i ++ ) { ExpandableWrapper < P , C > listItem = mFlatItemList . get ( i ) ; if ( listItem . isParent ( ) ) { parentCount ++ ; } } return parentCount ; |
public class random { /** * Returns a pseudo - random , uniformly distributed int value between origin
* ( included ) and bound ( excluded ) .
* @ param range the allowed integer range
* @ param random the random engine to use for calculating the random
* int value
* @ return a random integer greater than or ... | return range . size ( ) == 1 ? range . getMin ( ) : nextInt ( range . getMin ( ) , range . getMax ( ) , random ) ; |
public class BufferUtil { /** * Look for value k in buffer in the range [ begin , end ) . If the value is found , return its index .
* If not , return - ( i + 1 ) where i is the index where the value would be inserted . The buffer is
* assumed to contain sorted values where shorts are interpreted as unsigned intege... | return branchyUnsignedBinarySearch ( array , position , begin , end , k ) ; |
public class ModelFactory { /** * Register a Blueprint from Class
* @ param clazz Blueprint class
* @ throws RegisterBlueprintException failed to register blueprint */
public void registerBlueprint ( Class clazz ) throws RegisterBlueprintException { } } | Object blueprint = null ; try { blueprint = clazz . newInstance ( ) ; } catch ( InstantiationException e ) { throw new RegisterBlueprintException ( e ) ; } catch ( IllegalAccessException e ) { throw new RegisterBlueprintException ( e ) ; } registerBlueprint ( blueprint ) ; |
public class MolecularFormulaManipulator { /** * Returns the string representation of the molecular formula based on Hill
* System with numbers wrapped in & lt ; sub & gt ; & lt ; / sub & gt ; tags and the
* isotope of each Element in & lt ; sup & gt ; & lt ; / sup & gt ; tags and the total
* charge of IMolecular... | String [ ] orderElements ; if ( containsElement ( formula , formula . getBuilder ( ) . newInstance ( IElement . class , "C" ) ) ) orderElements = generateOrderEle_Hill_WithCarbons ( ) ; else orderElements = generateOrderEle_Hill_NoCarbons ( ) ; return getHTML ( formula , orderElements , chargeB , isotopeB ) ; |
public class Functions { /** * Returns the natural logarithm ( base < i > e < / i > ) of a { @ code double } value .
* Any numeric string recognized by { @ code BigDecimal } is supported .
* @ param val A valid number string
* @ return the value ln & nbsp ; { @ code a } , the natural logarithm of { @ code a } .
... | BigDecimal bd ; try { bd = new BigDecimal ( val ) ; return Math . log ( bd . doubleValue ( ) ) + "" ; } catch ( Exception e ) { return null ; } |
public class ModelsImpl { /** * Gets information about the entity models .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param listEntitiesOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException throw... | return listEntitiesWithServiceResponseAsync ( appId , versionId , listEntitiesOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class IterableCursorWrapper { /** * Convenience alias to { @ code getString \ ( getColumnIndex ( columnName ) ) } . If the column does not
* exist for the cursor , return { @ code defaultValue } . */
public String getString ( String columnName , String defaultValue ) { } } | int index = getColumnIndex ( columnName ) ; if ( isValidIndex ( index ) ) { return getString ( index ) ; } else { return defaultValue ; } |
public class CQLTranslator { /** * Builds set clause for a given counter field .
* @ param builder
* the builder
* @ param field
* the field
* @ param value
* the value */
public void buildSetClauseForCounters ( StringBuilder builder , String field , Object value ) { } } | builder = ensureCase ( builder , field , false ) ; builder . append ( EQ_CLAUSE ) ; builder = ensureCase ( builder , field , false ) ; builder . append ( INCR_COUNTER ) ; appendValue ( builder , value . getClass ( ) , value , false , false ) ; builder . append ( COMMA_STR ) ; |
public class WorkersStatisticsFetcher { /** * Add the requested query string arguments to the Request .
* @ param request Request to add query string arguments to */
private void addQueryParams ( final Request request ) { } } | if ( minutes != null ) { request . addQueryParam ( "Minutes" , minutes . toString ( ) ) ; } if ( startDate != null ) { request . addQueryParam ( "StartDate" , startDate . toString ( ) ) ; } if ( endDate != null ) { request . addQueryParam ( "EndDate" , endDate . toString ( ) ) ; } if ( taskQueueSid != null ) { request ... |
public class InternalSARLParser { /** * InternalSARL . g : 12895:1 : ruleOpOther returns [ AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ] : ( kw = ' - > ' | kw = ' . . < ' | ( kw = ' > ' kw = ' . . ' ) | kw = ' . . ' | kw = ' = > ' | ( kw = ' > ' ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ... | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ; Token kw = null ; enterRule ( ) ; try { // InternalSARL . g : 12901:2 : ( ( kw = ' - > ' | kw = ' . . < ' | ( kw = ' > ' kw = ' . . ' ) | kw = ' . . ' | kw = ' = > ' | ( kw = ' > ' ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ) | kw = ' > ' ) ) ... |
public class MatchParserImpl { /** * SetExpr : : = " ( " Expression ( " , " Expression ) * " ) " */
final public List SetExpr ( ) throws ParseException { } } | List ans = new ArrayList ( ) ; Selector elem ; jj_consume_token ( 11 ) ; elem = Expression ( ) ; ans . add ( elem ) ; label_1 : while ( true ) { switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case 13 : ; break ; default : jj_la1 [ 14 ] = jj_gen ; break label_1 ; } jj_consume_token ( 13 ) ; elem = Expression ( ) ;... |
public class Point { /** * Calculate the lineprotocol entry for a single point , using a specific { @ link TimeUnit } for the timestamp .
* @ param precision the time precision unit for this point
* @ return the String without newLine */
public String lineProtocol ( final TimeUnit precision ) { } } | // setLength ( 0 ) is used for reusing cached StringBuilder instance per thread
// it reduces GC activity and performs better then new StringBuilder ( )
StringBuilder sb = CACHED_STRINGBUILDERS . get ( ) ; sb . setLength ( 0 ) ; escapeKey ( sb , measurement ) ; concatenatedTags ( sb ) ; concatenatedFields ( sb ) ; form... |
public class StringUtil { /** * Split up a string into tokens delimited by the specified separator
* character . If the string is null or zero length , returns null .
* @ param s The String to tokenize
* @ param separator The character delimiting tokens
* @ return A List of String tokens , or null is s is null ... | if ( s == null || s . length ( ) == 0 ) { return null ; } int start = 0 ; int stop = 0 ; ArrayList < String > tokens = new ArrayList < String > ( ) ; while ( start <= s . length ( ) ) { stop = s . indexOf ( separator , start ) ; if ( stop == - 1 ) { stop = s . length ( ) ; } String token = s . substring ( start , stop ... |
public class AptPropertySet { /** * Returns the property name prefix for properties in this PropertySet */
public String getPrefix ( ) { } } | if ( _propertySet == null || _propertySet . getAnnotation ( PropertySet . class ) == null ) return "" ; return _propertySet . getAnnotation ( PropertySet . class ) . prefix ( ) ; |
public class KillBillHttpClient { /** * COMMON */
private Response doPrepareRequest ( final String verb , final String uri , final Object body , final OutputStream outputStream , final RequestOptions requestOptions , final int timeoutSec ) throws KillBillClientException { } } | return doPrepareRequestInternal ( verb , uri , body , Response . class , outputStream , requestOptions , timeoutSec ) ; |
public class ArrayEntryManager { /** * Load entry log files from disk into _ entryList .
* @ throws IOException */
protected List < Entry < V > > loadEntryFiles ( ) { } } | File [ ] files = getDirectory ( ) . listFiles ( ) ; String prefix = getEntryLogPrefix ( ) ; String suffix = getEntryLogSuffix ( ) ; List < Entry < V > > entryList = new ArrayList < Entry < V > > ( ) ; if ( files == null ) return entryList ; for ( File file : files ) { String fileName = file . getName ( ) ; if ( fileNam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.