signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ClientService { /** * This function returns a { @ link List } of PAYMILL { @ link Client } objects . In which order this list is returned depends on the
* optional parameters . If < code > null < / code > is given , no filter or order will be applied .
* @ param filter
* { @ link com . paymill . mode... | return this . list ( filter , order , null , null ) ; |
public class Download { /** * Downloads the content to a specified file .
* @ param config the ` HttpConfig ` instance
* @ param file the file where content will be downloaded */
public static void toFile ( final HttpConfig config , final File file ) { } } | toFile ( config , ContentTypes . ANY . getAt ( 0 ) , file ) ; |
public class ThreadContext { /** * Set the inbound connection info on this context to the input value .
* @ param connectionInfo */
public void setInboundConnectionInfo ( Map < String , Object > connectionInfo ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setInboundConnectionInfo" ) ; this . inboundConnectionInfo = connectionInfo ; |
public class MemcmpEncoder { /** * Bytes are encoded by writing all bytes out as themselves , except for bytes
* of value 0x00 . Bytes of value 0x00 are encoded as two bytes , 0x00 0x01 . The
* end marker is signified by two 0x00 bytes . This guarantees that the end
* marker is the least possible value .
* @ pa... | for ( int i = start ; i < start + len ; ++ i ) { if ( bytes [ i ] == 0x00 ) { out . write ( 0 ) ; out . write ( 1 ) ; } else { out . write ( ( int ) bytes [ i ] ) ; } } out . write ( 0 ) ; out . write ( 0 ) ; |
public class EverySupportingMessagingService { /** * Sends the message . The message can be anything with any content and that
* must be delivered to something or someone .
* Ask each sender if it is able to handle the message . Each sender that
* can ' t handle the message is skipped . Each sender that is able t... | LOG . info ( "Sending message..." ) ; LOG . debug ( "{}" , message ) ; LOG . debug ( "Find senders that is able to send the message {}" , message ) ; boolean sent = false ; for ( ConditionalSender sender : senders ) { if ( sender . supports ( message ) ) { LOG . debug ( "Sending message {} using sender {}..." , message... |
public class GeometryIndexService { /** * Checks to see if a given index is the child of another index .
* @ param parentIndex
* The so - called parent index .
* @ param childIndex
* The so - called child index .
* @ return Is the second index really a child of the first index ? */
public boolean isChildOf ( ... | if ( parentIndex . getValue ( ) != childIndex . getValue ( ) ) { return false ; } if ( parentIndex . hasChild ( ) && childIndex . hasChild ( ) ) { return isChildOf ( parentIndex . getChild ( ) , childIndex . getChild ( ) ) ; } else if ( ! parentIndex . hasChild ( ) && childIndex . hasChild ( ) ) { return true ; } retur... |
public class IOUtils { /** * Read next string from input stream .
* @ param is The input stream to read .
* @ param term Terminator character .
* @ return The string up until , but not including the terminator .
* @ throws IOException when unable to read from stream . */
public static String readString ( InputS... | return readString ( new Utf8StreamReader ( is ) , term ) ; |
public class ModifyTableBuilder { /** * This method will build { @ link ModifyColumnFamiliesRequest } objects based on a diff of the
* new and existing set of column descriptors . This is for use in
* { @ link org . apache . hadoop . hbase . client . Admin # modifyTable ( TableName , HTableDescriptor ) } .
* @ pa... | Preconditions . checkNotNull ( newTableDesc ) ; Preconditions . checkNotNull ( currentTableDesc ) ; ModifyTableBuilder requestBuilder = ModifyTableBuilder . newBuilder ( currentTableDesc . getTableName ( ) ) ; Set < String > currentColumnNames = getColumnNames ( currentTableDesc ) ; Set < String > newColumnNames = getC... |
public class AttributeCollector { /** * Method called to allow reusing of collector , usually right before
* starting collecting attributes for a new start tag .
* Note : public only so that it can be called by unit tests . */
public void reset ( ) { } } | if ( mNsCount > 0 ) { mNamespaceBuilder . reset ( ) ; mDefaultNsDeclared = false ; mNsCount = 0 ; } /* No need to clear attr name , or NS prefix Strings ; they are
* canonicalized and will be referenced by symbol table in any
* case . . . so we can save trouble of cleaning them up . This Object
* will get GC ' ed... |
public class Config { /** * Retrieve an < code > InetAddress < / code > . If the address is not
* an IP address and cannot be resolved < code > null < / code > will
* be returned . */
public static InetAddress getInetAddress ( Properties props , String key , InetAddress def ) { } } | String addr = props . getProperty ( key ) ; if ( addr != null ) { try { def = InetAddress . getByName ( addr ) ; } catch ( UnknownHostException uhe ) { log . error ( "Unknown host " + addr , uhe ) ; } } return def ; |
public class BitsUtil { /** * Compute the cardinality ( number of set bits )
* Low - endian layout for the array .
* @ param v Value
* @ return Number of bits set in long [ ] */
public static int cardinality ( long [ ] v ) { } } | int sum = 0 ; for ( int i = 0 ; i < v . length ; i ++ ) { sum += Long . bitCount ( v [ i ] ) ; } return sum ; |
public class A_CmsAjaxGallery { /** * Returns a JSON object containing information of the given resource for usage in the gallery . < p >
* The content of the JSON object consists of a common and a specific part of the given resource . < p >
* @ param res the resource to create the object from
* @ return the JSON... | // create a new JSON object
JSONObject jsonObj = new JSONObject ( ) ; String sitePath = getCms ( ) . getRequestContext ( ) . getSitePath ( res ) ; // fill JSON object with common information
buildJsonItemCommonPart ( jsonObj , res , sitePath ) ; // fill JSON object with specific information
buildJsonItemSpecificPart ( ... |
public class RequestController { /** * Pauses a given entry point . This can be used to stop all requests though a given mechanism , e . g . all web requests
* @ param controlPoint The control point
* @ param listener The listener */
public synchronized void pauseControlPoint ( final String controlPoint , ServerAct... | final List < ControlPoint > eps = new ArrayList < ControlPoint > ( ) ; for ( ControlPoint ep : entryPoints . values ( ) ) { if ( ep . getEntryPoint ( ) . equals ( controlPoint ) ) { if ( ! ep . isPaused ( ) ) { eps . add ( ep ) ; } } } if ( eps . isEmpty ( ) ) { if ( listener != null ) { listener . done ( ) ; } } Count... |
public class Bessel { /** * Bessel function of the first kind , of order 0.
* @ param x Value .
* @ return I0 value . */
public static double I0 ( double x ) { } } | double ans ; double ax = Math . abs ( x ) ; if ( ax < 3.75 ) { double y = x / 3.75 ; y = y * y ; ans = 1.0 + y * ( 3.5156229 + y * ( 3.0899424 + y * ( 1.2067492 + y * ( 0.2659732 + y * ( 0.360768e-1 + y * 0.45813e-2 ) ) ) ) ) ; } else { double y = 3.75 / ax ; ans = ( Math . exp ( ax ) / Math . sqrt ( ax ) ) * ( 0.39894... |
public class LabAccountsInner { /** * Get regional availability information for each size category configured under a lab account .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ throws IllegalArgumentException thrown if parameters fail the ... | if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( labAcco... |
public class KiteTicker { /** * Setting different modes for an arraylist of tokens .
* @ param tokens an arraylist of tokens
* @ param mode the mode that needs to be set . Scroll up to see different
* kind of modes */
public void setMode ( ArrayList < Long > tokens , String mode ) { } } | JSONObject jobj = new JSONObject ( ) ; try { // int a [ ] = { 256265 , 408065 , 779521 , 738561 , 177665 , 25601 } ;
JSONArray list = new JSONArray ( ) ; JSONArray listMain = new JSONArray ( ) ; listMain . put ( 0 , mode ) ; for ( int i = 0 ; i < tokens . size ( ) ; i ++ ) { list . put ( i , tokens . get ( i ) ) ; } li... |
public class SQLExpressions { /** * Convert timestamp to date
* @ param dateTime timestamp
* @ return date */
public static < D extends Comparable > DateExpression < D > date ( DateTimeExpression < D > dateTime ) { } } | return Expressions . dateOperation ( dateTime . getType ( ) , Ops . DateTimeOps . DATE , dateTime ) ; |
public class Config { /** * Sets the map of { @ link com . hazelcast . ringbuffer . Ringbuffer } configurations ,
* mapped by config name . The config name may be a pattern with which the
* configuration will be obtained in the future .
* @ param ringbufferConfigs the ringbuffer configuration map to set
* @ ret... | this . ringbufferConfigs . clear ( ) ; this . ringbufferConfigs . putAll ( ringbufferConfigs ) ; for ( Entry < String , RingbufferConfig > entry : ringbufferConfigs . entrySet ( ) ) { entry . getValue ( ) . setName ( entry . getKey ( ) ) ; } return this ; |
public class HtmlDocumentBuilder { /** * < p > parse . < / p >
* @ param html a { @ link java . lang . String } object .
* @ return a { @ link com . greenpepper . Example } object . */
public Example parse ( String html ) { } } | String text = removeComments ( html ) ; return doParse ( text ) ; |
public class JBBPDslBuilder { /** * Add named parametric custom variable .
* @ param type custom type , must not be null
* @ param name name of the field , can be null for anonymous
* @ param param optional parameter for the field , can be null
* @ return the builder instance , must not be null */
public JBBPDs... | final ItemCustom custom = new ItemCustom ( type , name , this . byteOrder ) ; custom . bitLenExpression = param == null ? null : assertExpressionChars ( param ) ; this . addItem ( custom ) ; return this ; |
public class HyperionClient { /** * Read the response and unmarshall into the expected type
* @ param response The http response
* @ param javaType The type to return
* @ return The response value */
protected < T > T readResponse ( Response response , JavaType javaType ) { } } | try { return objectMapper . readValue ( response . body ( ) . byteStream ( ) , javaType ) ; } catch ( IOException e ) { throw new ClientMarshallingException ( "Error reading results." , e ) ; } |
public class AccountingChronology { /** * Checks if the specified year is a leap year .
* An Accounting proleptic - year is leap if the time between the end of the previous year
* and the end of the current year is 371 days .
* This method does not validate the year passed in , and only has a
* well - defined r... | return Math . floorMod ( prolepticYear + getISOLeapYearCount ( prolepticYear ) + yearZeroDifference , 7 ) == 0 || Math . floorMod ( prolepticYear + getISOLeapYearCount ( prolepticYear + 1 ) + yearZeroDifference , 7 ) == 0 ; |
public class CommerceAddressUtil { /** * Returns all the commerce addresses where groupId = & # 63 ; and classNameId = & # 63 ; and classPK = & # 63 ; .
* @ param groupId the group ID
* @ param classNameId the class name ID
* @ param classPK the class pk
* @ return the matching commerce addresses */
public stat... | return getPersistence ( ) . findByG_C_C ( groupId , classNameId , classPK ) ; |
public class Command { /** * Create a CORBA Any object and insert a float data in it .
* @ param data The float data to be inserted into the Any object
* @ exception DevFailed If the Any object creation failed .
* Click < a href = " . . / . . / tango _ basic / idl _ html / Tango . html # DevFailed " > here < / a ... | Any out_any = alloc_any ( ) ; out_any . insert_float ( data ) ; return out_any ; |
public class JmsSessionImpl { /** * This method is overriden by subclasses in order to instantiate an instance
* of the MsgProducer class . This means that the QueueSession . createSender
* method can delegate straight to Session . createProducer , and still get back
* an instance of a QueueSender , rather than a... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "instantiateProducer" , jmsDestination ) ; JmsMsgProducer messageProducer = new JmsMsgProducerImpl ( jmsDestination , coreConnection , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ... |
public class CodeGenBase { /** * Emits generated code to a file .
* @ param outputFolder
* outputFolder The output folder that will store the generated code .
* @ param fileName
* The name of the file that will store the generated code .
* @ param code
* The generated code .
* @ param encoding
* The enc... | try { File javaFile = new File ( outputFolder , File . separator + fileName ) ; javaFile . getParentFile ( ) . mkdirs ( ) ; javaFile . createNewFile ( ) ; PrintWriter writer = new PrintWriter ( new OutputStreamWriter ( new FileOutputStream ( javaFile , false ) , encoding ) ) ; BufferedWriter out = new BufferedWriter ( ... |
public class SeqRes2AtomAligner { /** * Map the seqRes groups to the atomRes chain .
* Updates the atomRes chain object with the mapped data
* The seqRes chain should not be needed after this and atomRes should be further used .
* @ param atomRes the chain containing ATOM groups ( in atomGroups slot ) . This chai... | List < Group > seqResGroups = seqRes . getAtomGroups ( ) ; List < Group > atmResGroups = atomRes . getAtomGroups ( ) ; logger . debug ( "Comparing ATOM {} ({} groups) to SEQRES {} ({} groups) " , atomRes . getId ( ) , atmResGroups . size ( ) , seqRes . getId ( ) , seqResGroups . size ( ) ) ; List < Group > matchedGroup... |
public class UNode { /** * Create a MAP UNode with the given node name .
* @ param name Name for new MAP node .
* @ return New MAP UNode . */
public static UNode createMapNode ( String name ) { } } | return new UNode ( name , NodeType . MAP , null , false , "" ) ; |
public class DataTypeFactory { /** * Provides access to the data type factory associated with the specified type name .
* @ param tname the name of the data type for the desired factory
* @ return the factory representing the specified type name
* @ throws InvalidAttributeException when an unknown type is sought ... | DataTypeFactory < ? > factory = factories . get ( tname ) ; if ( factory == null ) { throw new InvalidAttributeException ( "Unknown type name: " + tname ) ; } return factory ; |
public class GCI { /** * B & # 8849 ; C & # 8851 ; D & rarr ; { B & # 8849 ; C , B & # 8849 ; D }
* @ param gcis
* @ return */
Inclusion [ ] rule7 ( Inclusion [ ] gcis ) { } } | assert isRule7Applicable ( ) ; final Conjunction conjunction = ( Conjunction ) rhs ; final AbstractConcept [ ] concepts = conjunction . getConcepts ( ) ; if ( concepts . length > gcis . length ) { gcis = new Inclusion [ concepts . length ] ; } for ( int i = 0 ; i < concepts . length ; i ++ ) { gcis [ i ] = new GCI ( lh... |
public class ServiceProviders { /** * Returns true if the { @ link ClassLoader } is for android . */
static boolean isAndroid ( ClassLoader cl ) { } } | try { // Specify a class loader instead of null because we may be running under Robolectric
Class . forName ( "android.app.Application" , /* initialize = */
false , cl ) ; return true ; } catch ( Exception e ) { // If Application isn ' t loaded , it might as well not be Android .
return false ; } |
public class JvmArrayTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public NotificationChain basicSetComponentType ( JvmComponentType newComponentType , NotificationChain msgs ) { } } | msgs = eBasicSetContainer ( ( InternalEObject ) newComponentType , TypesPackage . JVM_ARRAY_TYPE__COMPONENT_TYPE , msgs ) ; return msgs ; |
public class NavigationHelper { /** * Based on the list of measured intersections and the step distance traveled , finds
* the current intersection a user is traveling along .
* @ param intersections along the step
* @ param measuredIntersections measured intersections along the step
* @ param stepDistanceTrave... | for ( Pair < StepIntersection , Double > measuredIntersection : measuredIntersections ) { double intersectionDistance = measuredIntersection . second ; int intersectionIndex = measuredIntersections . indexOf ( measuredIntersection ) ; int nextIntersectionIndex = intersectionIndex + ONE_INDEX ; int measuredIntersectionS... |
public class ScalableStatistics { /** * Adds the given data value to the data set */
public void add ( double value ) { } } | count ++ ; min = Math . min ( min , value ) ; max = Math . max ( max , value ) ; sum += value ; sumOfSquares += value * value ; addQuantileValue ( value ) ; |
public class LofCalculator { /** * basePointの局所外れ係数 ( Local outlier factor ) を算出する 。
* @ param basePoint 算出元対象点
* @ param dataSet 全体データ
* @ return 局所外れ係数 */
protected static double calculateLof ( LofPoint basePoint , LofDataSet dataSet ) { } } | int countedData = 0 ; double totalAmount = 0.0d ; for ( String targetDataId : basePoint . getkDistanceNeighbor ( ) ) { LofPoint targetPoint = dataSet . getDataMap ( ) . get ( targetDataId ) ; totalAmount = totalAmount + ( targetPoint . getLrd ( ) / basePoint . getLrd ( ) ) ; countedData ++ ; } if ( countedData == 0 ) {... |
public class HttpContinue { /** * Creates a response sender that can be used to send a HTTP 100 - continue response .
* @ param exchange The exchange
* @ return The response sender */
public static ContinueResponseSender createResponseSender ( final HttpServerExchange exchange ) throws IOException { } } | if ( ! exchange . isResponseChannelAvailable ( ) ) { throw UndertowMessages . MESSAGES . cannotSendContinueResponse ( ) ; } if ( exchange . getAttachment ( ALREADY_SENT ) != null ) { return new ContinueResponseSender ( ) { @ Override public boolean send ( ) throws IOException { return true ; } @ Override public void aw... |
public class CDDImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . CDD__XOC_BASE : return XOC_BASE_EDEFAULT == null ? xocBase != null : ! XOC_BASE_EDEFAULT . equals ( xocBase ) ; case AfplibPackage . CDD__YOC_BASE : return YOC_BASE_EDEFAULT == null ? yocBase != null : ! YOC_BASE_EDEFAULT . equals ( yocBase ) ; case AfplibPackage . CDD__XOC_U... |
public class TransitionsExtractorImpl { /** * Check the tile transition and add it to transitions collection if valid .
* @ param transitions The transitions collection .
* @ param extractor The transition extractor .
* @ param tile The tile to check . */
private static void checkTransition ( Map < Transition , C... | final Transition transition = extractor . getTransition ( tile ) ; if ( transition != null ) { getTiles ( transitions , transition ) . add ( new TileRef ( tile ) ) ; final Transition symetric = new Transition ( transition . getType ( ) . getSymetric ( ) , transition . getOut ( ) , transition . getIn ( ) ) ; getTiles ( ... |
public class ConfigurationAdminOptions { /** * Creates an overriding , empty configuration for the given PID
* @ param pid
* the pid for this configuration
* @ return empty configuration */
public static ConfigurationOption overrideConfiguration ( String pid ) { } } | return new org . ops4j . pax . exam . cm . internal . ConfigurationProvisionOption ( pid , new HashMap < String , Object > ( ) ) . override ( true ) . create ( false ) ; |
public class TempFile { /** * Gets the temp file .
* @ exception IllegalStateException if already deleted */
public File getFile ( ) throws IllegalStateException { } } | File f = tempFile ; if ( f == null ) throw new IllegalStateException ( ) ; return f ; |
public class GuardingHttpServletResponse { /** * / * ( non - Javadoc )
* @ see javax . servlet . http . HttpServletResponseWrapper # setHeader ( java . lang . String , java . lang . String ) */
@ Override public void setHeader ( String name , String value ) { } } | this . checkState ( ) ; super . setHeader ( name , value ) ; |
public class ConstantSize { /** * Splits a string that encodes size with unit into the size and unit substrings . Returns an
* array of two strings .
* @ param encodedValueAndUnit a strings that represents a size with unit , trimmed and in lower
* case
* @ return the first element is size , the second is unit *... | String [ ] result = new String [ 2 ] ; int len = encodedValueAndUnit . length ( ) ; int firstLetterIndex = len ; while ( firstLetterIndex > 0 && Character . isLetter ( encodedValueAndUnit . charAt ( firstLetterIndex - 1 ) ) ) { firstLetterIndex -- ; } result [ 0 ] = encodedValueAndUnit . substring ( 0 , firstLetterInde... |
public class ManagedPolicyDetail { /** * A list containing information about the versions of the policy .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setPolicyVersionList ( java . util . Collection ) } or { @ link # withPolicyVersionList ( java . util . C... | if ( this . policyVersionList == null ) { setPolicyVersionList ( new com . amazonaws . internal . SdkInternalList < PolicyVersion > ( policyVersionList . length ) ) ; } for ( PolicyVersion ele : policyVersionList ) { this . policyVersionList . add ( ele ) ; } return this ; |
public class DescribeBudgetRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeBudgetRequest describeBudgetRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeBudgetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeBudgetRequest . getAccountId ( ) , ACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( describeBudgetRequest . getBudgetName ( ) , BUDGETNAME_BINDING ) ;... |
public class PubSubManager { /** * Creates a node with default configuration .
* @ param nodeId The id of the node , which must be unique within the
* pubsub service
* @ return The node that was created
* @ throws XMPPErrorException
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throw... | return ( LeafNode ) createNode ( nodeId , null ) ; |
public class PGStream { /** * Read a tuple from the back end . A tuple is a two dimensional array of bytes . This variant reads
* the V3 protocol ' s tuple representation .
* @ return tuple from the back end
* @ throws IOException if a data I / O error occurs */
public byte [ ] [ ] receiveTupleV3 ( ) throws IOExc... | // TODO : use msgSize
int msgSize = receiveInteger4 ( ) ; int nf = receiveInteger2 ( ) ; byte [ ] [ ] answer = new byte [ nf ] [ ] ; OutOfMemoryError oom = null ; for ( int i = 0 ; i < nf ; ++ i ) { int size = receiveInteger4 ( ) ; if ( size != - 1 ) { try { answer [ i ] = new byte [ size ] ; receive ( answer [ i ] , 0... |
public class OpenApiReaderException { /** * Returns a reason for the errors in the document at the given location . */
private static String errorReasonFor ( URL location , List < String > errors ) { } } | return Stream . concat ( Stream . of ( String . format ( "%s conformance problem(s) found in Open API document%s" , errors . size ( ) , locationId ( location ) ) ) , IntStream . range ( 0 , errors . size ( ) ) . mapToObj ( i -> String . format ( "[%s] %s" , i , errors . get ( i ) ) ) ) . collect ( joining ( "\n" ) ) ; |
public class ColorAnalyzer { /** * Obtains the percentage of the text that has the given color .
* @ param color the color to be tested .
* @ return the percentage ( 0 . . 1) */
public double getColorPercentage ( Color color ) { } } | if ( color == null ) return 0 ; else { Integer num = colors . get ( colorKey ( color ) ) ; if ( num == null ) num = 0 ; if ( totalLength == 0 ) return 0 ; else return ( double ) num / totalLength ; } |
public class ActionExecutionOutputMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ActionExecutionOutput actionExecutionOutput , ProtocolMarshaller protocolMarshaller ) { } } | if ( actionExecutionOutput == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( actionExecutionOutput . getOutputArtifacts ( ) , OUTPUTARTIFACTS_BINDING ) ; protocolMarshaller . marshall ( actionExecutionOutput . getExecutionResult ( ) , EXECU... |
public class CompilerConfiguration { /** * Adds compilation customizers to the compilation process . A compilation customizer is a class node
* operation which performs various operations going from adding imports to access control .
* @ param customizers the list of customizers to be added
* @ return this config... | if ( customizers == null ) throw new IllegalArgumentException ( "provided customizers list must not be null" ) ; compilationCustomizers . addAll ( Arrays . asList ( customizers ) ) ; return this ; |
public class MultimapSubject { /** * Fails if the multimap contains the given key . */
public void doesNotContainKey ( @ NullableDecl Object key ) { } } | check ( "keySet()" ) . that ( actual ( ) . keySet ( ) ) . doesNotContain ( key ) ; |
public class Stream { /** * Returns a stream of tuples which are aggregated results of a window which slides at duration of { @ code slidingInterval }
* and completes a window at { @ code windowDuration }
* @ param windowDuration represents window duration configuration
* @ param inputFields projected fields for ... | return window ( SlidingDurationWindow . of ( windowDuration , slidingInterval ) , windowStoreFactory , inputFields , aggregator , functionFields ) ; |
public class FieldDocImpl { /** * Get the value of a constant field .
* @ return the value of a constant field . The value is
* automatically wrapped in an object if it has a primitive type .
* If the field is not constant , returns null . */
public Object constantValue ( ) { } } | Object result = sym . getConstValue ( ) ; if ( result != null && sym . type . hasTag ( BOOLEAN ) ) // javac represents false and true as Integers 0 and 1
result = Boolean . valueOf ( ( ( Integer ) result ) . intValue ( ) != 0 ) ; return result ; |
public class HttpQuery { /** * Sets the local serializer based on a query string parameter or content type .
* If the caller supplies a " serializer = " parameter , the proper serializer is
* loaded if found . If the serializer doesn ' t exist , an exception will be
* thrown and the user gets an error
* If no q... | if ( this . hasQueryStringParam ( "serializer" ) ) { final String qs = this . getQueryStringParam ( "serializer" ) ; Constructor < ? extends HttpSerializer > ctor = serializer_map_query_string . get ( qs ) ; if ( ctor == null ) { this . serializer = new HttpJsonSerializer ( this ) ; throw new BadRequestException ( Http... |
public class PactDslRequestWithPath { /** * The body of the request with possible single quotes as delimiters
* and using { @ link QuoteUtil } to convert single quotes to double quotes if required .
* @ param body Request body in string form */
public PactDslRequestWithPath bodyWithSingleQuotes ( String body ) { } ... | if ( body != null ) { body = QuoteUtil . convert ( body ) ; } return body ( body ) ; |
public class Utils { /** * Return the list of ProgramElementDoc objects as Array . */
public ProgramElementDoc [ ] toProgramElementDocArray ( List < ProgramElementDoc > list ) { } } | ProgramElementDoc [ ] pgmarr = new ProgramElementDoc [ list . size ( ) ] ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { pgmarr [ i ] = list . get ( i ) ; } return pgmarr ; |
public class MPP14CalendarFactory { /** * { @ inheritDoc } */
@ Override protected VarMeta getCalendarVarMeta ( DirectoryEntry directory ) throws IOException { } } | return new VarMeta12 ( new DocumentInputStream ( ( ( DocumentEntry ) directory . getEntry ( "VarMeta" ) ) ) ) ; |
public class ConnectionTypesInner { /** * Retrieve the connectiontype identified by connectiontype name .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param connectionTypeName The name of connectiontype .
* @ throws Illega... | return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , connectionTypeName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class Position { /** * the indicated range has been passed by the scanner . */
public void update ( char [ ] data , int start , int end ) { } } | int i ; for ( i = start ; i < end ; i ++ ) { if ( data [ i ] == '\n' ) { col = 1 ; line ++ ; } else { col ++ ; } } ofs += ( end - start ) ; |
public class HashOperations { /** * Inserts the given long array into the given hash table array of the target size ,
* removes any negative input values , ignores duplicates and counts the values inserted .
* The given hash table may have values , but they must have been inserted by this method or one
* of the o... | int count = 0 ; final int arrLen = srcArr . length ; checkThetaCorruption ( thetaLong ) ; for ( int i = 0 ; i < arrLen ; i ++ ) { // scan source array , build target array
final long hash = srcArr [ i ] ; checkHashCorruption ( hash ) ; if ( continueCondition ( thetaLong , hash ) ) { continue ; } if ( hashSearchOrInsert... |
public class RandomVariable { /** * / * ( non - Javadoc )
* @ see net . finmath . stochastic . RandomVariableInterface # getQuantile ( ) */
@ Override public double getQuantile ( double quantile ) { } } | if ( isDeterministic ( ) ) { return valueIfNonStochastic ; } if ( size ( ) == 0 ) { return Double . NaN ; } double [ ] realizationsSorted = realizations . clone ( ) ; java . util . Arrays . sort ( realizationsSorted ) ; int indexOfQuantileValue = Math . min ( Math . max ( ( int ) Math . round ( ( size ( ) + 1 ) * quant... |
public class CmsADEConfigData { /** * Creates the content directory for this configuration node if possible . < p >
* @ throws CmsException if something goes wrong */
protected void createContentDirectory ( ) throws CmsException { } } | if ( ! isModuleConfiguration ( ) ) { String contentFolder = getContentFolderPath ( ) ; if ( ! getCms ( ) . existsResource ( contentFolder ) ) { getCms ( ) . createResource ( contentFolder , OpenCms . getResourceManager ( ) . getResourceType ( CmsResourceTypeFolder . getStaticTypeName ( ) ) ) ; } } |
public class JMSManager { /** * This is a synchronous listen . The caller will block until a message is
* received for the given destination .
* Messages will be filtered based on the provided message selector .
* @ param dest
* the Destination to listen on
* @ param messageSelector
* selection criteria for... | if ( logger . isDebugEnabled ( ) ) { logger . debug ( "listen() - Synchronous listen on destination " + dest ) ; } try { Session s = connection . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; MessageConsumer c = s . createConsumer ( dest , messageSelector ) ; Message msg = c . receive ( ) ; s . close ( ) ; ret... |
public class WidgetUtilImpl { /** * Creates the HTML needed to display a Java applet . */
public HTML createApplet ( String ident , String archive , String clazz , String width , String height , boolean mayScript , String ptags ) { } } | String html = "<object classid=\"java:" + clazz + ".class\" " + "type=\"application/x-java-applet\" archive=\"" + archive + "\" " + "width=\"" + width + "\" height=\"" + height + "\">" ; if ( mayScript ) { html += "<param name=\"mayscript\" value=\"true\"/>" ; } html += ptags ; html += "</object>" ; return new HTML ( h... |
public class Master { /** * Launches the master process . */
public synchronized void start ( ) { } } | Preconditions . checkState ( mProcess == null , "Master is already running" ) ; LOG . info ( "Starting master with port {}" , mProperties . get ( PropertyKey . MASTER_RPC_PORT ) ) ; mProcess = new ExternalProcess ( mProperties , LimitedLifeMasterProcess . class , new File ( mLogsDir , "master.out" ) ) ; try { mProcess ... |
public class MessageStore { /** * Add message to the storage .
* Every call will change values returned by { @ link # getNextPosition ( ) } and
* { @ link # getLatestPosition ( ) } . Any call may change value returned by
* { @ link # getFirstPosition ( ) } , which will happen if a message is discarded
* due to ... | final int nextKey = this . getNextPosition ( ) ; this . store . put ( nextKey , msg ) ; MessageStore . LOGGER . info ( "Message #{} stored on position #{}" , msg . getUniqueId ( ) , nextKey ) ; this . nextMessagePosition . incrementAndGet ( ) ; if ( this . store . size ( ) > this . messageLimit ) { // discard first mes... |
public class DisjointMultiDeletionNeighbourhood { /** * Generates the list of all possible moves that perform \ ( k \ ) deletions , where \ ( k \ ) is the fixed number
* specified at construction . Note : taking into account the current number of selected items , the imposed
* minimum subset size ( if set ) and the... | // create empty list to store generated moves
List < SubsetMove > moves = new ArrayList < > ( ) ; // get set of candidate IDs for removal ( fixed IDs are discarded )
Set < Integer > delCandidates = getRemoveCandidates ( solution ) ; // compute number of deletions
int curNumDel = numDeletions ( delCandidates , solution ... |
public class JobsResource { /** * Returns the job status for the given job id . The job status includes things like where it ' s
* deployed , and the status of the jobs where it ' s deployed , etc .
* @ param id The job ID .
* @ return The job status . */
@ Path ( "{id}/status" ) @ GET @ Produces ( APPLICATION_JS... | if ( ! id . isFullyQualified ( ) ) { throw badRequest ( "Invalid id" ) ; } return Optional . fromNullable ( model . getJobStatus ( id ) ) ; |
public class AWSIoTAnalyticsClient { /** * Updates the settings of a data store .
* @ param updateDatastoreRequest
* @ return Result of the UpdateDatastore operation returned by the service .
* @ throws InvalidRequestException
* The request was not valid .
* @ throws ResourceNotFoundException
* A resource w... | request = beforeClientExecution ( request ) ; return executeUpdateDatastore ( request ) ; |
public class GroovyClassLoader { /** * Parses the given text into a Java class capable of being run
* @ param text the text of the script / class to parse
* @ return the main class defined in the given script */
public Class parseClass ( String text ) throws CompilationFailedException { } } | return parseClass ( text , "script" + System . currentTimeMillis ( ) + Math . abs ( text . hashCode ( ) ) + ".groovy" ) ; |
public class NoiseNullDeref { /** * Find set of blocks which were known to be dead before doing the null
* pointer analysis .
* @ return set of previously dead blocks , indexed by block id
* @ throws CFGBuilderException
* @ throws DataflowAnalysisException */
private BitSet findPreviouslyDeadBlocks ( ) throws D... | BitSet deadBlocks = new BitSet ( ) ; ValueNumberDataflow vnaDataflow = classContext . getValueNumberDataflow ( method ) ; for ( Iterator < BasicBlock > i = vnaDataflow . getCFG ( ) . blockIterator ( ) ; i . hasNext ( ) ; ) { BasicBlock block = i . next ( ) ; ValueNumberFrame vnaFrame = vnaDataflow . getStartFact ( bloc... |
public class OptionalWeak { /** * Shortcut for as ( List . class ) , with malleable generic type
* @ see OptionalWeak # as ( Class ) */
public < T > Optional < List < T > > asList ( ) { } } | return inner . filter ( d -> d . isList ( ) ) . map ( d -> d . asList ( ) ) ; |
public class PropNeighBoolsChannel2 { @ Override public void propagate ( int evtmask ) throws ContradictionException { } } | for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( matrix [ i ] [ j ] . getLB ( ) == 1 ) { g . enforceArc ( i , j , this ) ; } else if ( matrix [ i ] [ j ] . getUB ( ) == 0 ) { g . removeArc ( i , j , this ) ; } } } |
public class HttpResponse { /** * 创建CompletionHandler子类的实例 < br >
* 传入的CompletionHandler子类必须是public , 且保证其子类可被继承且completed 、 failed可被重载且包含空参数的构造函数 。
* @ param < H > 泛型
* @ param handlerClass CompletionHandler子类
* @ return CompletionHandler */
@ SuppressWarnings ( "unchecked" ) public < H extends CompletionHandl... | if ( handlerClass == null || handlerClass == CompletionHandler . class ) return ( H ) createAsyncHandler ( ) ; return context . loadAsyncHandlerCreator ( handlerClass ) . create ( createAsyncHandler ( ) ) ; |
public class MyFiles { /** * 将字符串写到文件
* @ param path
* @ param str
* @ throws IOException */
public static void write ( String path , String str ) throws IOException { } } | BufferedWriter out = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( path ) , "utf8" ) ) ; out . append ( str ) ; out . close ( ) ; |
public class XSDocument { /** * type = " qname ( $ typeNS , $ typeLocalpart ) " */
public XSDocument type ( String typeNS , String typeLocalpart ) throws SAXException { } } | xml . addAttribute ( "type" , xml . toQName ( typeNS , typeLocalpart ) ) ; return this ; |
public class ByteBufferUtil { /** * Encode a String in a ByteBuffer using UTF _ 8.
* @ param s the string to encode
* @ return the encoded string */
public static ByteBuffer bytes ( String s ) { } } | return ByteBuffer . wrap ( s . getBytes ( StandardCharsets . UTF_8 ) ) ; |
public class WebhookClientBuilder { /** * Builds a new { @ link net . dv8tion . jda . webhook . WebhookClient WebhookClient } instance
* with the current state of this builder .
* < p > < b > < u > Remember to close the WebhookClient once you don ' t need it anymore to free resources ! < / u > < / b >
* @ return ... | OkHttpClient client = this . client ; if ( client == null ) { if ( builder == null ) builder = DEFAULT_HTTP_BUILDER ; client = builder . build ( ) ; } if ( pool == null ) { if ( threadFactory == null ) threadFactory = new DefaultWebhookThreadFactory ( ) ; pool = Executors . newSingleThreadScheduledExecutor ( threadFact... |
public class Transform { /** * Build Java code to represent a type reference to the given class .
* This will be of the form " pkg . Cls1 " or " pkc . Cls2 [ ] " or " primtype " .
* @ param builder the builder in which to build the type reference
* @ param cls the type for the reference */
private static void bui... | int arrayDims = 0 ; Class tmp = cls ; while ( tmp . isArray ( ) ) { arrayDims ++ ; tmp = tmp . getComponentType ( ) ; } builder . append ( tmp . getName ( ) ) ; if ( arrayDims > 0 ) { for ( ; arrayDims > 0 ; arrayDims -- ) { builder . append ( "[]" ) ; } } |
public class RowMajorSparseMatrix { /** * Parses { @ link RowMajorSparseMatrix } from the given CSV string .
* @ param csv the CSV string representing a matrix
* @ return a parsed matrix */
public static RowMajorSparseMatrix fromCSV ( String csv ) { } } | return Matrix . fromCSV ( csv ) . to ( Matrices . SPARSE_ROW_MAJOR ) ; |
public class Utils { /** * Converts a Set of Date objects to a Set of Calendar objects .
* @ param dates
* @ return the converted Set & lt ; Calendar & gt ; */
public static HolidayCalendar < Calendar > toHolidayCalendarSet ( final HolidayCalendar < Date > dates ) { } } | final Set < Calendar > calendars = new HashSet < > ( ) ; for ( final Date date : dates . getHolidays ( ) ) { calendars . add ( getCal ( date ) ) ; } return new DefaultHolidayCalendar < > ( calendars , getCal ( dates . getEarlyBoundary ( ) ) , getCal ( dates . getLateBoundary ( ) ) ) ; |
public class HammerWidget { /** * Unregister Hammer Gwt handler .
* @ param eventType { @ link org . geomajas . hammergwt . client . event . EventType }
* @ since 1.0.0 */
@ Api public void unregisterHandler ( EventType eventType ) { } } | if ( ! jsHandlersMap . containsKey ( eventType ) ) { return ; } HammerGwt . off ( hammertime , eventType , ( NativeHammmerHandler ) jsHandlersMap . remove ( eventType ) ) ; |
public class DefaultBigDecimalMath { /** * Returns the { @ link BigDecimal } that is < code > x % y < / code > using the default { @ link MathContext } .
* @ param x the x value
* @ param y the y value to divide
* @ return the resulting { @ link BigDecimal } with the precision specified in the default { @ link Ma... | return x . remainder ( y , defaultMathContext ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public ColorSpecificationColSpce createColorSpecificationColSpceFromString ( EDataType eDataType , String initialValue ) { } } | ColorSpecificationColSpce result = ColorSpecificationColSpce . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class CmsPreferences { /** * Builds the html for the direct edit button style select box . < p >
* @ param htmlAttributes optional html attributes for the & lgt ; select & gt ; tag
* @ return the html for the direct edit button style select box */
public String buildSelectDirectEditButtonStyle ( String htmlA... | int selectedIndex = Integer . parseInt ( getParamTabEdDirectEditButtonStyle ( ) ) ; return buildSelectButtonStyle ( htmlAttributes , selectedIndex ) ; |
public class Cron4jJob { @ Override public synchronized void becomeNonCron ( ) { } } | verifyCanScheduleState ( ) ; if ( JobChangeLog . isEnabled ( ) ) { JobChangeLog . log ( "#job ...Becoming non-cron: {}" , toString ( ) ) ; } cron4jId . ifPresent ( id -> { cron4jTask . becomeNonCrom ( ) ; cron4jNow . getCron4jScheduler ( ) . deschedule ( id ) ; cron4jId = OptionalThing . empty ( ) ; } ) ; |
public class FaunusPipeline { /** * Go back to an element a named step ago .
* Currently only backing up to vertices is supported .
* @ param step the name of the step to back up to
* @ return the extended FaunusPipeline */
public FaunusPipeline back ( final String step ) { } } | this . state . assertNotLocked ( ) ; this . state . assertNoProperty ( ) ; this . compiler . addMapReduce ( BackFilterMapReduce . Map . class , BackFilterMapReduce . Combiner . class , BackFilterMapReduce . Reduce . class , LongWritable . class , Holder . class , NullWritable . class , FaunusVertex . class , BackFilter... |
public class TemplateProcessor { /** * Instantiates the templates specified by @ Template within @ Templates */
public List < ? super OpenShiftResource > processTemplateResources ( ) { } } | List < ? extends OpenShiftResource > resources ; final List < ? super OpenShiftResource > processedResources = new ArrayList < > ( ) ; templates = OpenShiftResourceFactory . getTemplates ( getType ( ) ) ; boolean sync_instantiation = OpenShiftResourceFactory . syncInstantiation ( getType ( ) ) ; /* Instantiate template... |
public class BaasDocument { /** * Asynchronously retrieves the list of documents readable to the user in < code > collection < / code > .
* @ param collection the collection to retrieve not < code > null < / code >
* @ param handler a callback to be invoked with the result of the request
* @ return a { @ link com... | return fetchAll ( collection , null , RequestOptions . DEFAULT , handler ) ; |
public class MgmtSystemManagementResource { /** * Collects and returns system usage statistics . It provides a system wide
* overview and tenant based stats .
* @ return system usage statistics */
@ Override public ResponseEntity < MgmtSystemStatisticsRest > getSystemUsageStats ( ) { } } | final SystemUsageReportWithTenants report = systemManagement . getSystemUsageStatisticsWithTenants ( ) ; final MgmtSystemStatisticsRest result = new MgmtSystemStatisticsRest ( ) . setOverallActions ( report . getOverallActions ( ) ) . setOverallArtifacts ( report . getOverallArtifacts ( ) ) . setOverallArtifactVolumeIn... |
public class HttpServerExchange { /** * Adds a listener that will be invoked on response commit
* @ param listener The response listener */
public void addResponseCommitListener ( final ResponseCommitListener listener ) { } } | // technically it is possible to modify the exchange after the response conduit has been created
// as the response channel should not be retrieved until it is about to be written to
// if we get complaints about this we can add support for it , however it makes the exchange bigger and the connectors more complex
addRe... |
public class ReflectionUtil { /** * Returns an arbitrary object instance based on a class name .
* @ param className The name of a desired class to instantiate . */
@ SuppressWarnings ( "unchecked" ) public static < T > T getObjectInstance ( String className ) { } } | try { Class clazz = Class . forName ( className ) ; return ( T ) clazz . newInstance ( ) ; } catch ( Exception e ) { throw new Error ( e ) ; } |
public class syslog_generic { /** * < pre >
* Report for generic syslog message received by this collector . .
* < / pre > */
public static syslog_generic [ ] get ( nitro_service client ) throws Exception { } } | syslog_generic resource = new syslog_generic ( ) ; resource . validate ( "get" ) ; return ( syslog_generic [ ] ) resource . get_resources ( client ) ; |
public class MessagingService { /** * Send a non - mutation message to a given endpoint . This method specifies a callback
* which is invoked with the actual response .
* @ param message message to be sent .
* @ param to endpoint to which the message needs to be sent
* @ param cb callback interface which is use... | int id = addCallback ( cb , message , to , timeout , failureCallback ) ; sendOneWay ( failureCallback ? message . withParameter ( FAILURE_CALLBACK_PARAM , ONE_BYTE ) : message , id , to ) ; return id ; |
public class BsonFactory { /** * Method for enabling / disabling specified generator features
* ( check { @ link BsonGenerator . Feature } for list of features )
* @ param f the feature to enable or disable
* @ param state true if the feature should be enabled , false otherwise
* @ return this BsonFactory */
pu... | if ( state ) { return enable ( f ) ; } return disable ( f ) ; |
public class EDBConverter { /** * Filters the reference prefix values added in the model to EDBObject conversion out of the EDBObject */
private void filterEngineeringObjectInformation ( EDBObject object , Class < ? > model ) { } } | if ( ! AdvancedModelWrapper . isEngineeringObjectClass ( model ) ) { return ; } Iterator < String > keys = object . keySet ( ) . iterator ( ) ; while ( keys . hasNext ( ) ) { if ( keys . next ( ) . startsWith ( REFERENCE_PREFIX ) ) { keys . remove ( ) ; } } |
public class TransparentDataEncryptionsInner { /** * Creates or updates a database ' s transparent data encryption configuration .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverNam... | if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( serverN... |
public class CommonOps_DDF5 { /** * Returns the absolute value of the element in the matrix that has the smallest absolute value . < br >
* < br >
* Min { | a < sub > ij < / sub > | } for all i and j < br >
* @ param a A matrix . Not modified .
* @ return The max element value of the matrix . */
public static d... | double min = Math . abs ( a . a11 ) ; double tmp = Math . abs ( a . a12 ) ; if ( tmp < min ) min = tmp ; tmp = Math . abs ( a . a13 ) ; if ( tmp < min ) min = tmp ; tmp = Math . abs ( a . a14 ) ; if ( tmp < min ) min = tmp ; tmp = Math . abs ( a . a15 ) ; if ( tmp < min ) min = tmp ; tmp = Math . abs ( a . a21 ) ; if (... |
public class GuildAction { /** * Adds a { @ link net . dv8tion . jda . core . entities . Channel Channel } to the resulting
* Guild . This cannot be of type { @ link net . dv8tion . jda . core . entities . ChannelType # CATEGORY CATEGORY } !
* @ param channel
* The { @ link net . dv8tion . jda . core . requests .... | Checks . notNull ( channel , "Channel" ) ; this . channels . add ( channel ) ; return this ; |
public class IfcDocumentInformationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcRelAssociatesDocument > getDocumentInfoForObjects ( ) { } } | return ( EList < IfcRelAssociatesDocument > ) eGet ( Ifc4Package . Literals . IFC_DOCUMENT_INFORMATION__DOCUMENT_INFO_FOR_OBJECTS , true ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.