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 state ( s ) . Possible values include : ' default ' , ' latest '
* @ param subscriptionId Microsoft Azure subscription ID .
* @ param resourceGroupName Resource group name .
* @ param policyAssignmentName Policy assignment name .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PolicyStatesQueryResultsInner object */
public Observable < ServiceResponse < PolicyStatesQueryResultsInner > > listQueryResultsForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync ( PolicyStatesResource policyStatesResource , String subscriptionId , String resourceGroupName , String policyAssignmentName ) { } } | 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 new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( policyAssignmentName == null ) { throw new IllegalArgumentException ( "Parameter policyAssignmentName is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } final String authorizationNamespace = "Microsoft.Authorization" ; final QueryOptions queryOptions = null ; Integer top = null ; String orderBy = null ; String select = null ; DateTime from = null ; DateTime to = null ; String filter = null ; String apply = null ; return service . listQueryResultsForResourceGroupLevelPolicyAssignment ( policyStatesResource , subscriptionId , resourceGroupName , authorizationNamespace , policyAssignmentName , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , top , orderBy , select , from , to , filter , apply , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < PolicyStatesQueryResultsInner > > > ( ) { @ Override public Observable < ServiceResponse < PolicyStatesQueryResultsInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PolicyStatesQueryResultsInner > clientResponse = listQueryResultsForResourceGroupLevelPolicyAssignmentDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
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 value ) { } } | 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 , String propertyName ) { } } | 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 ( propertyName ) ) return true ; } return false ; |
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 result
* @ since 3.1.0 */
public static Object querySingleResult ( Connection connection , String sql , String [ ] args , int column , GeoPackageDataType dataType ) { } } | 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 ) ; context . buffer = b ; } return context . buffer ; |
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 to order the set by ( optionally < code > null < / code > )
* @ return the last matching commerce warehouse , or < code > null < / code > if a matching commerce warehouse could not be found */
@ Override public CommerceWarehouse fetchByG_A_P_Last ( long groupId , boolean active , boolean primary , OrderByComparator < CommerceWarehouse > orderByComparator ) { } } | 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 ;
* otherwise it comes from the latest pricing . */
public void setCost ( com . google . api . ads . admanager . axis . v201808 . Money cost ) { } } | 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 ArrayList < String > vps_serviceName_plesk_GET ( String serviceName , OvhPleskLicenseDomainNumberEnum domainNumber ) throws IOException { } } | 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 error ) { } } | 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 computeNetworkPrefixFromMask ( IPAddress mask ) { } } | 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
* failed . */
protected String deliverChat ( SpeakService speakSvc , String message , byte mode ) { } } | // 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 ( "/" ) ) { return requestChat ( speakSvc , message , false ) ; } // make sure this client is not restricted from performing this chat message for some
// reason or other
String errmsg = checkCanChat ( speakSvc , message , mode ) ; if ( errmsg != null ) { return errmsg ; } // speak on the specified service
requestSpeak ( speakSvc , message , mode ) ; return ChatCodes . SUCCESS ; |
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 < EnumIncludeRelationships > createQueryIncludeRelationships ( EnumIncludeRelationships value ) { } } | 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 / services / api / flickr . commons . getInstitutions . html " > flickr . commons . getInstitutions < / a > */
public Institutions getInstitutions ( ) throws JinxException { } } | 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 < Locale > getLocalesFromHeader ( final List < String > acceptLanguage ) { } } | 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 : parsedResults ) { for ( QValueParser . QValueResult res : qvalueResult ) { if ( ! res . isQValueZero ( ) ) { Locale e = LocaleUtils . getLocaleFromString ( res . getValue ( ) ) ; ret . add ( e ) ; } } } return ret ; |
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 , char c , String replacement ) { } } | 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 . append ( s , prevPos , s . length ( ) ) ; return sb . toString ( ) ; |
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 > false < / tt > if it doesn ' t */
public boolean accept ( ClassInfo classInfo , ClassHierarchyResolver hierarchyResolver ) { } } | 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 < Object , String > getTrimToSize ( ) { } } | 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_SIZE ) { int code = buffer [ rowOffset ] & CODE_MASK ; switch ( code ) { case INSERT : row . validate ( buffer , rowOffset , rowHead , blobTail ) ; break ; case INSERT_DEAD : case REMOVE : break ; default : throw new IllegalStateException ( this + " " + rowOffset + " " + code + " unknown code" ) ; } int len = getLength ( code , row ) ; if ( len < 0 || len + rowOffset > BLOCK_SIZE ) { throw new IllegalStateException ( this + " " + rowOffset + " code:" + code + " len:" + len + " invalid len" ) ; } rowOffset += len ; } |
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 . marshall ( skillsStoreSkill . getShortDescription ( ) , SHORTDESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( skillsStoreSkill . getIconUrl ( ) , ICONURL_BINDING ) ; protocolMarshaller . marshall ( skillsStoreSkill . getSampleUtterances ( ) , SAMPLEUTTERANCES_BINDING ) ; protocolMarshaller . marshall ( skillsStoreSkill . getSkillDetails ( ) , SKILLDETAILS_BINDING ) ; protocolMarshaller . marshall ( skillsStoreSkill . getSupportsLinking ( ) , SUPPORTSLINKING_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
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 contains information about outer generics , it will be printed
* as { @ code Outer < Generics > . Inner < Generics > } in order to indicate all available information .
* In other cases outer class is not indicated .
* @ param type type to convert to string
* @ param generics type class generics type
* @ return string representation of provided type
* @ throws UnknownGenericException when found generic not declared on type ( e . g . method generic )
* @ see ru . vyarus . java . generics . resolver . util . map . PrintableGenericsMap to print not known generic names
* @ see # toStringTypeIgnoringVariables ( Type ) shortcut to print Object instead of not known generic
* @ see # toStringType ( Type ) shortcut for types without variables */
@ SuppressWarnings ( "PMD.UseStringBufferForStringAppends" ) public static String toStringType ( final Type type , final Map < String , Type > generics ) { } } | 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 ) . getGenericComponentType ( ) , generics ) + "[]" ; } else if ( type instanceof WildcardType ) { res = processWildcardType ( ( WildcardType ) type , generics ) ; } else if ( type instanceof ExplicitTypeVariable ) { // print generic name ( only when PrintableGenericsMap used )
res = type . toString ( ) ; } else { // deep generics nesting case
// when PrintableGenericsMap used and generics is not known , will print generic name ( see above )
res = toStringType ( declaredGeneric ( ( TypeVariable ) type , generics ) , generics ) ; } return res ; |
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 ; } return pair ; |
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 < TldTaglibType < T > > getOrCreateTag ( ) { } } | 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 annoying thing
* with SIP .
* @ param t
* @ return */
public static boolean isUDPLower ( final Buffer t ) { } } | 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 waitTimeout ) { } } | 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 ( jobdir , "_logs" ) ; // The control file should have small size blocks . This helps
// in spreading out the load from mappers that will be spawned .
jobconf . setInt ( "dfs.blocks.size" , OP_LIST_BLOCK_SIZE ) ; FileOutputFormat . setOutputPath ( jobconf , log ) ; LOG . info ( "log=" + log ) ; // create operation list
FileSystem fs = jobdir . getFileSystem ( jobconf ) ; Path opList = new Path ( jobdir , "_" + OP_LIST_LABEL ) ; jobconf . set ( OP_LIST_LABEL , opList . toString ( ) ) ; int opCount = 0 , synCount = 0 ; SequenceFile . Writer opWriter = null ; try { opWriter = SequenceFile . createWriter ( fs , jobconf , opList , Text . class , PolicyInfo . class , SequenceFile . CompressionType . NONE ) ; for ( RaidPolicyPathPair p : raidPolicyPathPairList ) { // If a large set of files are Raided for the first time , files
// in the same directory that tend to have the same size will end up
// with the same map . This shuffle mixes things up , allowing a better
// mix of files .
java . util . Collections . shuffle ( p . srcPaths ) ; for ( EncodingCandidate ec : p . srcPaths ) { opWriter . append ( new Text ( ec . toString ( ) ) , p . policy ) ; opCount ++ ; if ( ++ synCount > SYNC_FILE_MAX ) { opWriter . sync ( ) ; synCount = 0 ; } } } } finally { if ( opWriter != null ) { opWriter . close ( ) ; } fs . setReplication ( opList , OP_LIST_REPLICATION ) ; // increase replication for control file
} raidPolicyPathPairList . clear ( ) ; jobconf . setInt ( OP_COUNT_LABEL , opCount ) ; LOG . info ( "Number of files=" + opCount ) ; jobconf . setNumMapTasks ( getMapCount ( opCount ) ) ; LOG . info ( "jobName= " + jobName + " numMapTasks=" + jobconf . getNumMapTasks ( ) ) ; return opCount != 0 ; |
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 < ? > query , ListExpressionValidation validation , boolean ignoreUnknown ) { } } | if ( query != null ) { validate ( query . getWhereExpressions ( ) , validation , ignoreUnknown ) ; validate ( query . getHavingExpressions ( ) , validation , ignoreUnknown ) ; validate ( query . getOrderBy ( ) , validation , ignoreUnknown ) ; Set < String > invalid = validation . getUnknownProperties ( ) ; if ( ! ignoreUnknown && ! invalid . isEmpty ( ) ) { UnprocessableEntityException . throwQuery ( invalid ) ; } } |
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 > configurationProperties ) { } } | 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 call the API , e . g . server error or cannot deserialize the response body */
public ApiResponse < GetUsersSuccessResponse > getCurrentUserWithHttpInfo ( ) throws ApiException { } } | 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 version . */
@ UsedByGeneratedCode public int changed ( int methodId ) { } } | 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 ) ) ; } // TODO [ perf ] could be faster to return the executor here and if one isn ' t returned , do the original thing .
// the reason for 3 ret vals here is due to catching methods that have been deleted early - lets let the
// executor throw that exception , then this side we don ' t have to worry so much and instead of 2 check calls ( changed then getexecutor ) we can
// just have one . Will increase speed and reduce generated code ( speeding up loadtime ! )
// was the method deleted ?
boolean b = liveVersion . incrementalTypeDescriptor . hasBeenDeleted ( methodId ) ; if ( b ) { retval = 2 ; } else { retval = liveVersion . incrementalTypeDescriptor . mustUseExecutorForThisMethod ( methodId ) ? 1 : 0 ; } } // TODO could be extremely fine grained and consider individual method changes
// return memberIntMap . get ( methodId ) . hasChanged ( ) ;
return retval ; } |
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 ) == '<' ) { genericCount ++ ; } else if ( str . charAt ( i ) == '>' ) { genericCount -- ; } } result . add ( str . substring ( startPos ) . trim ( ) ) ; return result ; |
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 < ActionExecutionDetail > actionExecutionDetails ) { } } | 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 = GrafeasV1Beta1Client . create ( ) ) {
* OccurrenceName name = OccurrenceName . of ( " [ PROJECT ] " , " [ OCCURRENCE ] " ) ;
* grafeasV1Beta1Client . deleteOccurrence ( name . toString ( ) ) ;
* < / code > < / pre >
* @ param name The name of the occurrence in the form of
* ` projects / [ PROJECT _ ID ] / occurrences / [ OCCURRENCE _ ID ] ` .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
public final void deleteOccurrence ( String name ) { } } | 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 the { @ link CategoryView }
* @ return initialized Category object */
public static Category of ( String description , Node itemIcon , Setting ... settings ) { } } | 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 trimmed string */
public static String trimBy ( final StringBuilder s , final int left , final int right ) { } } | 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 = iter . hasNext ( ) ; */
// BufferedImage bufferedImage = new BufferedImage ( image . getWidth ( null ) , image . getHeight ( null ) , BufferedImage . TYPE _ INT _ RGB ) ;
Graphics2D ngraphics = ( Graphics2D ) bufferedImage . getGraphics ( ) ; /* ngraphics . setRenderingHint ( RenderingHints . KEY _ INTERPOLATION ,
RenderingHints . VALUE _ INTERPOLATION _ BILINEAR ) ; */
// ngraphics . drawImage ( image , 0 , 0,512,384,0,0 , image . getWidth ( ) , image . getHeight ( ) , null ) ;
// ngraphics . drawImage ( image . getScaledInstance ( 200 , 300 , BufferedImage . SCALE _ FAST ) , 0 , 0 , null ) ;
ngraphics . drawImage ( image , 0 , 0 , null ) ; ImageIO . write ( bufferedImage , "bmp" , baos ) ; baos . flush ( ) ; byte [ ] imageInByte = baos . toByteArray ( ) ; baos . close ( ) ; return imageInByte ; } catch ( IOException ex ) { Logger . getLogger ( PHATImageUtils . class . getName ( ) ) . log ( Level . SEVERE , "bufferedImageToByteArray" , ex ) ; } return null ; |
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 . set ( 0 ) ; lastflushedTime . set ( System . currentTimeMillis ( ) ) ; } |
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 copyConfiguration ( AbstractWisdomWatcherMojo mojo , MavenResourcesFiltering filtering ) throws IOException { } } | 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/configuration) - use this mode at your own risk" ) ; mojo . getLog ( ) . warn ( "A fake application configuration is going to be created, " + "using a fake application secret, do not use this file in production" ) ; // No configuration directory , generate a fake application configuration
File conf = new File ( mojo . getWisdomRootDirectory ( ) , "conf" ) ; mojo . getLog ( ) . debug ( "Creating conf directory " + conf . mkdirs ( ) ) ; File output = new File ( conf , "application.conf" ) ; ApplicationSecretGenerator . generateFakeConfiguration ( output ) ; } |
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
* chained together .
* @ see DeleteItemRequest # withExpressionAttributeNames ( Map ) */
public DynamoDBDeleteExpression withExpressionAttributeNames ( java . util . Map < String , String > expressionAttributeNames ) { } } | 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 .
* < p > Note that " pinned " states whether the key was pinned in the injector it
* started in ; it might not be pinned in child . */
private boolean canExposeKeyFrom ( Key < ? > key , GinjectorBindings child , boolean pinned ) { } } | 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 a key is pinned , it ' s visible in the parent iff it has an
// ExposedChildBinding pointing at the child .
Binding binding = parent . getBinding ( key ) ; if ( binding == null ) { return false ; } else if ( ! ( binding instanceof ExposedChildBinding ) ) { // This should never happen ( it would have been caught as a
// double - binding earlier ) .
throw new RuntimeException ( "Unexpected binding shadowing a pinned binding: " + binding ) ; } else { ExposedChildBinding exposedChildBinding = ( ExposedChildBinding ) binding ; if ( exposedChildBinding . getChildBindings ( ) != child ) { throw new RuntimeException ( "Unexpected exposed child binding shadowing a pinned binding: " + binding ) ; } else { return true ; } } } else { return true ; } |
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 . getHeader ( CitrusCamelMessageHeaders . EXCHANGE_EXCEPTION ) != null ) { String exceptionClass = message . getHeader ( CitrusCamelMessageHeaders . EXCHANGE_EXCEPTION ) . toString ( ) ; String exceptionMsg = null ; if ( message . getHeader ( CitrusCamelMessageHeaders . EXCHANGE_EXCEPTION_MESSAGE ) != null ) { exceptionMsg = message . getHeader ( CitrusCamelMessageHeaders . EXCHANGE_EXCEPTION_MESSAGE ) . toString ( ) ; } try { Class < ? > exception = Class . forName ( exceptionClass ) ; if ( exceptionMsg != null ) { exchange . setException ( ( Throwable ) exception . getConstructor ( String . class ) . newInstance ( exceptionMsg ) ) ; } else { exchange . setException ( ( Throwable ) exception . newInstance ( ) ) ; } } catch ( RuntimeException e ) { log . warn ( "Unable to create proper exception instance for exchange!" , e ) ; } catch ( Exception e ) { log . warn ( "Unable to create proper exception instance for exchange!" , e ) ; } } reply . setBody ( message . getPayload ( ) ) ; |
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 ( final short packetID , final PacketHandler packetHandler ) { } } | 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 content was stored at
* @ throws IOException */
public File save ( File aFileName ) throws IOException { } } | 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 ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , 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 schema evolution . See
* < a href = " http : / / kitesdk . org / docs / current / Schema - Evolution . html " > Schema
* Evolution < / a > .
* This method updates the dataset descriptor , so you can also add
* or change properties .
* The recommended way to update a dataset descriptor is to build it
* based on an existing descriptor . Use
* { @ link DatasetDescriptor . Builder ( DatasetDescriptor ) } to
* build a DatasetDescriptor based on an existing instance .
* You cannot change a dataset format or partition strategy .
* URIs must begin with { @ code dataset : } . The remainder of
* the URI is implementation specific , depending on the dataset scheme .
* @ param uri a { @ code Dataset } URI string
* @ param type a Java class that represents an entity in the dataset
* @ param < E > the type used for readers and writers created by this
* { @ code Dataset }
* @ param < D > the type of { @ code Dataset } expected
* @ return a { @ code Dataset } for the given URI
* @ throws NullPointerException
* if { @ code uri } , { @ code descriptor } , or { @ code type } is
* { @ code null }
* @ throws IllegalArgumentException if { @ code uri } is not a dataset URI
* @ throws DatasetNotFoundException
* if there is no dataset for the given URI
* @ throws UnsupportedOperationException
* if descriptor updates are not supported by the implementation
* @ throws ConcurrentSchemaModificationException
* if the { @ code Dataset } schema is updated concurrently
* @ throws IncompatibleSchemaException
* if the schema is not compatible with previous schemas , or with
* existing datasets with shared storage ( for example , in the same
* HBase table ) */
public static < E , D extends Dataset < E > > D update ( String uri , DatasetDescriptor descriptor , Class < E > type ) { } } | 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 Method getReadMethod ( Class < ? > clazz , String propertyName ) throws NoSuchMethodError { } } | 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 isXXX) for property: " + propertyName ) ; } } |
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 , AllowCopy , AllowModifyAnnotations ,
* AllowFillIn , AllowScreenReaders , AllowAssembly and AllowDegradedPrinting .
* The permissions can be combined by ORing them .
* @ param userPassword the user password . Can be null or empty
* @ param ownerPassword the owner password . Can be null or empty
* @ param permissions the user permissions
* @ param strength128Bits < code > true < / code > for 128 bit key length , < code > false < / code > for 40 bit key length
* @ throws DocumentException if anything was already written to the output */
public void setEncryption ( byte userPassword [ ] , byte ownerPassword [ ] , int permissions , boolean strength128Bits ) throws DocumentException { } } | 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 , strength128Bits ? PdfWriter . STANDARD_ENCRYPTION_128 : PdfWriter . STANDARD_ENCRYPTION_40 ) ; |
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 EpsDirectory directory , String name , String value ) throws IOException { } } | 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 ) + " " + value ) ; break ; default : if ( EpsDirectory . _tagNameMap . containsKey ( tag ) && ! directory . containsTag ( tag ) ) { directory . setString ( tag , value ) ; _previousTag = tag ; } else { // Set previous tag to an Integer that doesn ' t exist in EpsDirectory
_previousTag = 0 ; } break ; } _previousTag = tag ; |
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 -- ; return true ; } } return false ; |
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 ( hasSuffix & & ! ( hasProperty | | hasAttribute ) ) return false ;
* < / pre >
* @ param data the tag data
* @ return true if attributes are valid , false otherwise */
@ Override public boolean isValid ( TagData data ) { } } | 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 _ ATTR _ ELEMENT ) ;
if ( hasFile && ( hasSuffix || hasProperty || hasAttribute ) ) { return false ; } if ( hasProperty && hasAttribute ) { return false ; } if ( hasSuffix && ! ( hasProperty || hasAttribute ) ) { return false ; } return true ; |
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 ) ; protocolMarshaller . marshall ( describeBudgetsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
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 ] The internal name of your SMS offer
* @ param login [ required ] The sms user login */
public ArrayList < Long > serviceName_users_login_incoming_GET ( String serviceName , String login , String sender , String tag ) throws IOException { } } | 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 the name after { @ code ' @ ' } ) .
* If no configuration matches , it will create one by cloning the
* { @ code " default " } configuration and add it to the configuration
* collection .
* This method is intended to easily and fluently create and add
* configurations more specific than the default configuration without
* explicitly adding it by invoking { @ link # addTopicConfig ( TopicConfig ) } .
* Because it adds new configurations if they are not already present ,
* this method is intended to be used before this config is used to
* create a hazelcast instance . Afterwards , newly added configurations
* may be ignored .
* @ param name name of the topic config
* @ return the topic configuration
* @ throws ConfigurationException if ambiguous configurations are found
* @ see StringPartitioningStrategy # getBaseName ( java . lang . String )
* @ see # setConfigPatternMatcher ( ConfigPatternMatcher )
* @ see # getConfigPatternMatcher ( ) */
public TopicConfig getTopicConfig ( String name ) { } } | 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 < code > null < / code > if the parsed string is empty .
* @ throws MimeTypeParserException
* In case of an error */
@ Nullable public static MimeType parseMimeType ( @ Nullable final String sMimeType ) { } } | 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 countCapitals , int countSpecials ) { } } | 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 < countSpecials ; i ++ ) { int pos = rand . nextInt ( res . length ( ) ) ; res = res . substring ( 0 , pos ) + Specials [ rand . nextInt ( Specials . length ) ] + res . substring ( pos ) ; } for ( int i = 0 ; i < countCapitals ; i ++ ) { int pos = rand . nextInt ( res . length ( ) ) ; res = res . substring ( 0 , pos ) + Capitals [ rand . nextInt ( Capitals . length ) ] + res . substring ( pos ) ; } return res ; |
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 IOException { } } | 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 return the position of that child ' s parent . */
@ UiThread int getNearestParentPosition ( int flatPosition ) { } } | 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 equal to { @ code min } and
* less than or equal to { @ code max }
* @ throws IllegalArgumentException if { @ code range . getMin ( ) > = range . getMax ( ) } */
public static int nextInt ( final IntRange range , final Random random ) { } } | 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 integers .
* @ param array buffer where we search
* @ param position starting position of the container in the ByteBuffer
* @ param begin first index ( inclusive )
* @ param end last index ( exclusive )
* @ param k value we search for
* @ return count */
public static int unsignedBinarySearch ( final ByteBuffer array , int position , final int begin , final int end , final short k ) { } } | 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 IMolecularFormula in & lt ; sup & gt ; & lt ; / sup & gt ; tags . Useful for
* displaying formulae in Swing components or on the web .
* @ param formula The IMolecularFormula object
* @ param chargeB True , If it has to show the charge
* @ param isotopeB True , If it has to show the Isotope mass
* @ return A HTML representation of the molecular formula
* @ see # getHTML ( IMolecularFormula ) */
public static String getHTML ( IMolecularFormula formula , boolean chargeB , boolean isotopeB ) { } } | 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 } .
* @ see BigDecimal */
public static String log ( String val ) { } } | 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 thrown if parameters fail the validation
* @ throws ErrorResponseException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the List & lt ; EntityExtractor & gt ; object if successful . */
public List < EntityExtractor > listEntities ( UUID appId , String versionId , ListEntitiesOptionalParameter listEntitiesOptionalParameter ) { } } | 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 . addQueryParam ( "TaskQueueSid" , taskQueueSid ) ; } if ( taskQueueName != null ) { request . addQueryParam ( "TaskQueueName" , taskQueueName ) ; } if ( friendlyName != null ) { request . addQueryParam ( "FriendlyName" , friendlyName ) ; } if ( taskChannel != null ) { request . addQueryParam ( "TaskChannel" , taskChannel ) ; } |
public class InternalSARLParser { /** * InternalSARL . g : 12895:1 : ruleOpOther returns [ AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ] : ( kw = ' - > ' | kw = ' . . < ' | ( kw = ' > ' kw = ' . . ' ) | kw = ' . . ' | kw = ' = > ' | ( kw = ' > ' ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ) | kw = ' > ' ) ) | ( kw = ' < ' ( ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) ) | kw = ' < ' | kw = ' = > ' ) ) | kw = ' < > ' | kw = ' ? : ' ) ; */
public final AntlrDatatypeRuleToken ruleOpOther ( ) throws RecognitionException { } } | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ; Token kw = null ; enterRule ( ) ; try { // InternalSARL . g : 12901:2 : ( ( kw = ' - > ' | kw = ' . . < ' | ( kw = ' > ' kw = ' . . ' ) | kw = ' . . ' | kw = ' = > ' | ( kw = ' > ' ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ) | kw = ' > ' ) ) | ( kw = ' < ' ( ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) ) | kw = ' < ' | kw = ' = > ' ) ) | kw = ' < > ' | kw = ' ? : ' ) )
// InternalSARL . g : 12902:2 : ( kw = ' - > ' | kw = ' . . < ' | ( kw = ' > ' kw = ' . . ' ) | kw = ' . . ' | kw = ' = > ' | ( kw = ' > ' ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ) | kw = ' > ' ) ) | ( kw = ' < ' ( ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) ) | kw = ' < ' | kw = ' = > ' ) ) | kw = ' < > ' | kw = ' ? : ' )
{ // InternalSARL . g : 12902:2 : ( kw = ' - > ' | kw = ' . . < ' | ( kw = ' > ' kw = ' . . ' ) | kw = ' . . ' | kw = ' = > ' | ( kw = ' > ' ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ) | kw = ' > ' ) ) | ( kw = ' < ' ( ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) ) | kw = ' < ' | kw = ' = > ' ) ) | kw = ' < > ' | kw = ' ? : ' )
int alt311 = 9 ; alt311 = dfa311 . predict ( input ) ; switch ( alt311 ) { case 1 : // InternalSARL . g : 12903:3 : kw = ' - > '
{ kw = ( Token ) match ( input , 120 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getHyphenMinusGreaterThanSignKeyword_0 ( ) ) ; } } break ; case 2 : // InternalSARL . g : 12909:3 : kw = ' . . < '
{ kw = ( Token ) match ( input , 121 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getFullStopFullStopLessThanSignKeyword_1 ( ) ) ; } } break ; case 3 : // InternalSARL . g : 12915:3 : ( kw = ' > ' kw = ' . . ' )
{ // InternalSARL . g : 12915:3 : ( kw = ' > ' kw = ' . . ' )
// InternalSARL . g : 12916:4 : kw = ' > ' kw = ' . . '
{ kw = ( Token ) match ( input , 41 , FOLLOW_120 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getGreaterThanSignKeyword_2_0 ( ) ) ; } kw = ( Token ) match ( input , 122 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getFullStopFullStopKeyword_2_1 ( ) ) ; } } } break ; case 4 : // InternalSARL . g : 12928:3 : kw = ' . . '
{ kw = ( Token ) match ( input , 122 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getFullStopFullStopKeyword_3 ( ) ) ; } } break ; case 5 : // InternalSARL . g : 12934:3 : kw = ' = > '
{ kw = ( Token ) match ( input , 76 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getEqualsSignGreaterThanSignKeyword_4 ( ) ) ; } } break ; case 6 : // InternalSARL . g : 12940:3 : ( kw = ' > ' ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ) | kw = ' > ' ) )
{ // InternalSARL . g : 12940:3 : ( kw = ' > ' ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ) | kw = ' > ' ) )
// InternalSARL . g : 12941:4 : kw = ' > ' ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ) | kw = ' > ' )
{ kw = ( Token ) match ( input , 41 , FOLLOW_121 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getGreaterThanSignKeyword_5_0 ( ) ) ; } // InternalSARL . g : 12946:4 : ( ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) ) | kw = ' > ' )
int alt309 = 2 ; int LA309_0 = input . LA ( 1 ) ; if ( ( LA309_0 == 41 ) ) { int LA309_1 = input . LA ( 2 ) ; if ( ( LA309_1 == EOF || ( LA309_1 >= RULE_STRING && LA309_1 <= RULE_RICH_TEXT_START ) || ( LA309_1 >= RULE_HEX && LA309_1 <= RULE_DECIMAL ) || ( LA309_1 >= 25 && LA309_1 <= 26 ) || ( LA309_1 >= 28 && LA309_1 <= 30 ) || LA309_1 == 36 || ( LA309_1 >= 39 && LA309_1 <= 40 ) || ( LA309_1 >= 42 && LA309_1 <= 46 ) || ( LA309_1 >= 48 && LA309_1 <= 49 ) || ( LA309_1 >= 51 && LA309_1 <= 55 ) || ( LA309_1 >= 57 && LA309_1 <= 58 ) || ( LA309_1 >= 60 && LA309_1 <= 63 ) || ( LA309_1 >= 65 && LA309_1 <= 68 ) || ( LA309_1 >= 73 && LA309_1 <= 75 ) || ( LA309_1 >= 78 && LA309_1 <= 96 ) || ( LA309_1 >= 105 && LA309_1 <= 106 ) || LA309_1 == 129 || ( LA309_1 >= 131 && LA309_1 <= 140 ) ) ) { alt309 = 2 ; } else if ( ( LA309_1 == 41 ) && ( synpred37_InternalSARL ( ) ) ) { alt309 = 1 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 309 , 1 , input ) ; throw nvae ; } } else { if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 309 , 0 , input ) ; throw nvae ; } switch ( alt309 ) { case 1 : // InternalSARL . g : 12947:5 : ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) )
{ // InternalSARL . g : 12947:5 : ( ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' ) )
// InternalSARL . g : 12948:6 : ( ( ' > ' ' > ' ) ) = > ( kw = ' > ' kw = ' > ' )
{ // InternalSARL . g : 12953:6 : ( kw = ' > ' kw = ' > ' )
// InternalSARL . g : 12954:7 : kw = ' > ' kw = ' > '
{ kw = ( Token ) match ( input , 41 , FOLLOW_121 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getGreaterThanSignKeyword_5_1_0_0_0 ( ) ) ; } kw = ( Token ) match ( input , 41 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getGreaterThanSignKeyword_5_1_0_0_1 ( ) ) ; } } } } break ; case 2 : // InternalSARL . g : 12967:5 : kw = ' > '
{ kw = ( Token ) match ( input , 41 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getGreaterThanSignKeyword_5_1_1 ( ) ) ; } } break ; } } } break ; case 7 : // InternalSARL . g : 12975:3 : ( kw = ' < ' ( ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) ) | kw = ' < ' | kw = ' = > ' ) )
{ // InternalSARL . g : 12975:3 : ( kw = ' < ' ( ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) ) | kw = ' < ' | kw = ' = > ' ) )
// InternalSARL . g : 12976:4 : kw = ' < ' ( ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) ) | kw = ' < ' | kw = ' = > ' )
{ kw = ( Token ) match ( input , 40 , FOLLOW_122 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getLessThanSignKeyword_6_0 ( ) ) ; } // InternalSARL . g : 12981:4 : ( ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) ) | kw = ' < ' | kw = ' = > ' )
int alt310 = 3 ; int LA310_0 = input . LA ( 1 ) ; if ( ( LA310_0 == 40 ) ) { int LA310_1 = input . LA ( 2 ) ; if ( ( synpred38_InternalSARL ( ) ) ) { alt310 = 1 ; } else if ( ( true ) ) { alt310 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 310 , 1 , input ) ; throw nvae ; } } else if ( ( LA310_0 == 76 ) ) { alt310 = 3 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 310 , 0 , input ) ; throw nvae ; } switch ( alt310 ) { case 1 : // InternalSARL . g : 12982:5 : ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) )
{ // InternalSARL . g : 12982:5 : ( ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' ) )
// InternalSARL . g : 12983:6 : ( ( ' < ' ' < ' ) ) = > ( kw = ' < ' kw = ' < ' )
{ // InternalSARL . g : 12988:6 : ( kw = ' < ' kw = ' < ' )
// InternalSARL . g : 12989:7 : kw = ' < ' kw = ' < '
{ kw = ( Token ) match ( input , 40 , FOLLOW_91 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getLessThanSignKeyword_6_1_0_0_0 ( ) ) ; } kw = ( Token ) match ( input , 40 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getLessThanSignKeyword_6_1_0_0_1 ( ) ) ; } } } } break ; case 2 : // InternalSARL . g : 13002:5 : kw = ' < '
{ kw = ( Token ) match ( input , 40 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getLessThanSignKeyword_6_1_1 ( ) ) ; } } break ; case 3 : // InternalSARL . g : 13008:5 : kw = ' = > '
{ kw = ( Token ) match ( input , 76 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getEqualsSignGreaterThanSignKeyword_6_1_2 ( ) ) ; } } break ; } } } break ; case 8 : // InternalSARL . g : 13016:3 : kw = ' < > '
{ kw = ( Token ) match ( input , 123 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getLessThanSignGreaterThanSignKeyword_7 ( ) ) ; } } break ; case 9 : // InternalSARL . g : 13022:3 : kw = ' ? : '
{ kw = ( Token ) match ( input , 124 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpOtherAccess ( ) . getQuestionMarkColonKeyword_8 ( ) ) ; } } break ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ; |
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 ( ) ; ans . add ( elem ) ; } jj_consume_token ( 12 ) ; { if ( true ) return ans ; } throw new Error ( "Missing return statement in function" ) ; |
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 ) ; formatedTime ( sb , precision ) ; return sb . toString ( ) ; |
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 or 0 length . */
public static List < String > tokenizeToList ( String s , char separator ) { } } | 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 ) ; tokens . add ( token ) ; start = stop + 1 ; } return tokens ; |
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 ( fileName . startsWith ( prefix ) && fileName . endsWith ( suffix ) ) { try { Entry < V > entry = _entryPool . next ( ) ; entry . load ( file ) ; entryList . add ( entry ) ; } catch ( Exception e ) { String filePath = file . getAbsolutePath ( ) ; _log . warn ( filePath + " corrupted: length=" + file . length ( ) , e ) ; if ( file . delete ( ) ) { _log . warn ( filePath + " deleted" ) ; } } } } return entryList ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.