signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CommerceDiscountPersistenceImpl { /** * Returns all the commerce discounts where groupId = & # 63 ; and couponCode = & # 63 ; .
* @ param groupId the group ID
* @ param couponCode the coupon code
* @ return the matching commerce discounts */
@ Override public List < CommerceDiscount > findByG_C ( lon... | return findByG_C ( groupId , couponCode , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class INodeDirectory { /** * Add a child inode to the directory .
* @ param node INode to insert
* @ param inheritPermission inherit permission from parent ?
* @ param propagateModTime set parent ' s mod time to that of a child ?
* @ param childIndex index of the inserted child if known
* @ return null... | if ( inheritPermission ) { FsPermission p = getFsPermission ( ) ; // make sure the permission has wx for the user
if ( ! p . getUserAction ( ) . implies ( FsAction . WRITE_EXECUTE ) ) { p = new FsPermission ( p . getUserAction ( ) . or ( FsAction . WRITE_EXECUTE ) , p . getGroupAction ( ) , p . getOtherAction ( ) ) ; }... |
public class GenRestBuilderProcessor { /** * Generate the rest service builder
* @ param restService The rest service */
private TypeSpec generateBuilder ( RestService restService ) { } } | TypeSpec . Builder typeBuilder = TypeSpec . classBuilder ( restService . getBuilderSimpleClassName ( ) ) . addModifiers ( Modifier . PUBLIC , Modifier . FINAL ) . addJavadoc ( "Generated REST service builder for {@link $L}.\n" , restService . getTypeElement ( ) . getQualifiedName ( ) ) . addMethod ( MethodSpec . constr... |
public class OptionsMapper { /** * Map environment variable value to option .
* @ param name environment variable name
* @ param option option
* @ param converter value converter ( may be null to use default converters )
* @ param < V > helper value type
* @ param < T > helper option type
* @ return mapper ... | register ( "env: " + name , option , System . getenv ( name ) , converter ) ; return this ; |
public class OperationsInner { /** * Lists all the available Cognitive Services account operations .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & l... | return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < OperationEntityInner > > , Page < OperationEntityInner > > ( ) { @ Override public Page < OperationEntityInner > call ( ServiceResponse < Page < OperationEntityInner > > response ) { return response . body ( ) ; } } ) ... |
public class DriverManagerAccessorSupport { /** * Definines the class using the given ClassLoader and ProtectionDomain */
public static Class < ? > define ( ClassLoader loader ) { } } | try { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { String packageName = DriverManagerAccessor . class . getPackage ( ) . getName ( ) ; RuntimePermission permission = new RuntimePermission ( "defineClassInPackage." + packageName ) ; sm . checkPermission ( permission ) ; } byte [ ] b = loadB... |
public class ProfileService { /** * { @ inheritDoc } */
@ Override public boolean isActive ( Object context , Profile profile ) { } } | if ( context == null || profile == null ) { StringBuilder builder = new StringBuilder ( ) . append ( "Failed to determine profile active profiles. " ) ; if ( context == null ) builder . append ( "Context cannot be null. " ) ; if ( profile == null ) builder . append ( "Profile cannot be null. " ) ; throw new IllegalArgu... |
public class Es6RewriteModules { /** * Add alias nodes to the symbol table as they going to be removed by rewriter . Example aliases :
* < pre >
* import * as foo from ' . / foo ' ;
* import { doBar } from ' . / bar ' ;
* console . log ( doBar ) ;
* < / pre >
* @ param n Alias node . In the example above al... | if ( preprocessorSymbolTable == null ) { return ; } n . putBooleanProp ( Node . MODULE_ALIAS , true ) ; // Alias can be used in js types . Types have node type STRING and not NAME so we have to
// use their name as string .
String nodeName = n . isString ( ) || n . isImportStar ( ) ? n . getString ( ) : preprocessorSym... |
public class SendGrid { /** * Attempt an API call . This method executes the API call asynchronously
* on an internal thread pool . If the call is rate limited , the thread
* will retry up to the maximum configured time . The supplied callback
* will be called in the event of an error , or a successful response .... | this . pool . execute ( new Runnable ( ) { @ Override public void run ( ) { Response response ; // Retry until the retry limit has been reached .
for ( int i = 0 ; i < rateLimitRetry ; ++ i ) { try { response = api ( request ) ; } catch ( IOException ex ) { // Stop retrying if there is a network error .
callback . erro... |
public class Element { /** * Create a new element by tag name , and add it as the last child .
* @ param tagName the name of the tag ( e . g . { @ code div } ) .
* @ return the new element , to allow you to add content to it , e . g . :
* { @ code parent . appendElement ( " h1 " ) . attr ( " id " , " header " ) .... | Element child = new Element ( Tag . valueOf ( tagName , NodeUtils . parser ( this ) . settings ( ) ) , baseUri ( ) ) ; appendChild ( child ) ; return child ; |
public class ScanRecord { /** * Returns the service data byte array associated with the { @ code serviceUuid } . Returns
* { @ code null } if the { @ code serviceDataUuid } is not found . */
@ Nullable public byte [ ] getServiceData ( @ NonNull final ParcelUuid serviceDataUuid ) { } } | // noinspection ConstantConditions
if ( serviceDataUuid == null || serviceData == null ) { return null ; } return serviceData . get ( serviceDataUuid ) ; |
public class AmazonPinpointClient { /** * Returns information about a segment version .
* @ param getSegmentVersionRequest
* @ return Result of the GetSegmentVersion operation returned by the service .
* @ throws BadRequestException
* 400 response
* @ throws InternalServerErrorException
* 500 response
* @... | request = beforeClientExecution ( request ) ; return executeGetSegmentVersion ( request ) ; |
public class WorkbooksInner { /** * Get all Workbooks defined within a specified resource group and category .
* @ param resourceGroupName The name of the resource group .
* @ param category Category of workbook to return . Possible values include : ' workbook ' , ' TSG ' , ' performance ' , ' retention '
* @ thr... | return listByResourceGroupWithServiceResponseAsync ( resourceGroupName , category ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class ICUHumanize { /** * Same as { @ link # parseNumber ( String ) parseNumber } for the specified
* locale .
* @ param text
* String containing a spelled out number .
* @ param locale
* Target locale
* @ return Text converted to Number
* @ throws ParseException */
public static Number parseNumber... | return withinLocale ( new Callable < Number > ( ) { public Number call ( ) throws Exception { return parseNumber ( text ) ; } } , locale ) ; |
public class CommerceSubscriptionEntryPersistenceImpl { /** * Returns the first commerce subscription entry in the ordered set where subscriptionStatus = & # 63 ; .
* @ param subscriptionStatus the subscription status
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code... | List < CommerceSubscriptionEntry > list = findBySubscriptionStatus ( subscriptionStatus , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class CmsXmlContainerPageFactory { /** * Create a new instance of an container page based on the given default content ,
* that will have all language nodes of the default content and ensures the presence of the given locale . < p >
* The given encoding is used when marshalling the XML again later . < p >
... | // create the XML content
CmsXmlContainerPage content = new CmsXmlContainerPage ( cms , locale , modelUri ) ; // call prepare for use content handler and return the result
return ( CmsXmlContainerPage ) content . getHandler ( ) . prepareForUse ( cms , content ) ; |
public class MaybeLens { /** * Given a lens and a default < code > B < / code > , lift < code > B < / code > into { @ link Maybe } .
* Note that this lens is NOT lawful , since " putting back what you got changes nothing " fails for any value
* < code > B < / code > where < code > S < / code > is { @ link Maybe # n... | return lens . mapB ( m -> m . orElse ( defaultB ) ) ; |
public class NaiveBayesClassifier { /** * Split the data between trainable and wrong . */
public static void splitData ( final String originalTrainingDataFile ) { } } | List < Tuple > trainingData = NaiveBayesClassifier . readTrainingData ( originalTrainingDataFile , "\\s" ) ; List < Tuple > wrongData = new ArrayList < > ( ) ; int lastTrainingDataSize ; int iterCount = 0 ; do { System . out . println ( "Iteration:\t" + ( ++ iterCount ) ) ; lastTrainingDataSize = trainingData . size ( ... |
public class AbstractInteraction { /** * Trigger reverse .
* @ param type
* the type */
protected boolean triggerReverse ( Type type , Throwable e ) { } } | return trigger ( Lists . reverse ( getAllListeners ( ) ) , type , e ) ; |
public class ExtensionDescriptor { /** * ExtDescrTagEndRange = 0xFE */
static int [ ] allTags ( ) { } } | int [ ] ints = new int [ 0xFE - 0x6A ] ; for ( int i = 0x6A ; i < 0xFE ; i ++ ) { final int pos = i - 0x6A ; LOG . trace ( "pos: {}" , pos ) ; ints [ pos ] = i ; } return ints ; |
public class forwardingsession { /** * Use this API to update forwardingsession . */
public static base_response update ( nitro_service client , forwardingsession resource ) throws Exception { } } | forwardingsession updateresource = new forwardingsession ( ) ; updateresource . name = resource . name ; updateresource . connfailover = resource . connfailover ; return updateresource . update_resource ( client ) ; |
public class UdpClient { /** * The host to which this client should connect .
* @ param host The host to connect to .
* @ return a new { @ link UdpClient } */
public final UdpClient host ( String host ) { } } | Objects . requireNonNull ( host , "host" ) ; return bootstrap ( b -> b . remoteAddress ( host , getPort ( b ) ) ) ; |
public class SmtpMailer { /** * Check to see if email should be rate limited , and if so , send a rate limit
* email notification . Next attempt to email will immediately return .
* @ param destination collection of enum values used to specify who will receive this email .
* @ param request SingularityRequest thi... | RateLimitResult result = checkRateLimitForMail ( request , emailType ) ; if ( result == RateLimitResult . DONT_SEND_MAIL_IN_COOLDOWN ) { return ; } if ( result == RateLimitResult . SEND_COOLDOWN_STARTED_MAIL ) { subject = String . format ( "%s notifications for %s are being rate limited" , emailType . name ( ) , reques... |
public class Bits { /** * Pad left bytes byte [ ] .
* @ param src the src
* @ param bytes the bytes
* @ return the byte [ ] */
public static byte [ ] padLeftBytes ( final byte [ ] src , final int bytes ) { } } | final byte [ ] dst = new byte [ bytes ] ; for ( int i = 1 ; i <= src . length ; i ++ ) { dst [ dst . length - i ] = src [ src . length - i ] ; } return dst ; |
public class CommerceWishListLocalServiceBaseImpl { /** * Returns a range of all the commerce wish lists .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set... | return commerceWishListPersistence . findAll ( start , end ) ; |
public class XAnnotationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setAnnotationType ( JvmType newAnnotationType ) { } } | JvmType oldAnnotationType = annotationType ; annotationType = newAnnotationType ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XAnnotationsPackage . XANNOTATION__ANNOTATION_TYPE , oldAnnotationType , annotationType ) ) ; |
public class Default { public void init ( ) throws UnavailableException { } } | ServletContext config = getServletContext ( ) ; _servletHandler = ( ( ServletHandler . Context ) config ) . getServletHandler ( ) ; _httpContext = _servletHandler . getHttpContext ( ) ; _acceptRanges = getInitBoolean ( "acceptRanges" ) ; _dirAllowed = getInitBoolean ( "dirAllowed" ) ; _putAllowed = getInitBoolean ( "pu... |
public class XmlDocumentReader { /** * Convert a string to an InputSource object
* @ param str string
* @ return InputSource of input */
private static InputSource stringToSource ( String str ) { } } | InputSource is = new InputSource ( new StringReader ( str ) ) ; is . setEncoding ( "UTF-8" ) ; return is ; |
public class Operators { /** * Main operator lookup routine ; lookup an operator ( either unary or binary ) in its corresponding
* map . If there ' s a matching operator , its resolve routine is called and the result is returned ;
* otherwise the result of a fallback function is returned . */
private < O > Operator... | return opMap . get ( operatorName ( tag ) ) . stream ( ) . filter ( opTestFunc ) . map ( resolveFunc ) . findFirst ( ) . orElseGet ( noResultFunc ) ; |
public class RichClientFramework { /** * Creates a copy of originalEndPoint .
* This is to prevent us causing problems when we change it . As there is no exposed way to do this we will use serialization .
* It may be a bit slow , but it is implementation safe as the implementation of CFEndPoint is designed to be se... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "cloneEndpoint" , originalEndPoint ) ; CFEndPoint endPoint ; ByteArrayOutputStream baos = null ; ObjectOutputStream out = null ; ObjectInputStream in = null ; try { baos = new ByteArrayOutputStream ( ) ; out = new Obj... |
public class WavImpl { /** * Play a sound .
* @ param media The audio media .
* @ param alignment The alignment type .
* @ param volume The audio volume value .
* @ return The created and opened playback ready to be played .
* @ throws IOException If playback error . */
private static Playback createPlayback ... | final AudioInputStream input = openStream ( media ) ; final SourceDataLine dataLine = getDataLine ( input ) ; dataLine . start ( ) ; updateAlignment ( dataLine , alignment ) ; updateVolume ( dataLine , volume ) ; return new Playback ( input , dataLine ) ; |
public class LazySocket { /** * Option 2. */
public void setSoTimeout ( int timeout ) throws SocketException { } } | if ( mSocket != null ) { mSocket . setSoTimeout ( timeout ) ; } else { setOption ( 2 , new Integer ( timeout ) ) ; } |
public class JavaScriptUtils { /** * Creates and returns a JavaScript line that sets a cookie with the specified name and value . For example , a cookie name
* of " test " and value of " 123 " would return { @ code document . cookie = " test = 123 ; " ; } . Note : The name and value will be
* HTML - encoded . */
pu... | return getJavaScriptHtmlCookieString ( name , value , null ) ; |
public class HostDatastoreSystem { /** * SDK5.0 signature */
public VmfsDatastoreOption [ ] queryVmfsDatastoreCreateOptions ( String devicePath , int vmfsMajorVersion ) throws HostConfigFault , NotFound , RuntimeFault , RemoteException { } } | return getVimService ( ) . queryVmfsDatastoreCreateOptions ( getMOR ( ) , devicePath , vmfsMajorVersion ) ; |
public class SarlPackageImpl { /** * Creates , registers , and initializes the < b > Package < / b > for this model , and for any others upon which it depends .
* < p > This method is used to initialize { @ link SarlPackage # eINSTANCE } when that field is accessed .
* Clients should not invoke it directly . Instea... | if ( isInited ) return ( SarlPackage ) EPackage . Registry . INSTANCE . getEPackage ( SarlPackage . eNS_URI ) ; // Obtain or create and register package
Object registeredSarlPackage = EPackage . Registry . INSTANCE . get ( eNS_URI ) ; SarlPackageImpl theSarlPackage = registeredSarlPackage instanceof SarlPackageImpl ? (... |
public class DayOfTheWeek { /** * Returns the information this day of the week logically follows directly the given one . Example TUE . follows ( MON ) would be true , but
* MON . follows ( TUE ) or WED . follows ( MON ) is not . Public holidays does not follow any other day .
* @ param other
* Day to compare wit... | Contract . requireArgNotNull ( "other" , other ) ; if ( this == PH || other == PH ) { return false ; } return this . id == ( other . id + 1 ) ; |
public class SipServletRequestImpl { /** * ( non - Javadoc )
* @ see javax . servlet . sip . SipServletRequest # setRequestURI ( javax . servlet . sip . URI ) */
public void setRequestURI ( URI uri ) { } } | checkReadOnly ( ) ; Request request = ( Request ) message ; URIImpl uriImpl = ( URIImpl ) uri ; javax . sip . address . URI wrappedUri = uriImpl . getURI ( ) ; request . setRequestURI ( wrappedUri ) ; // TODO look through all contacts of the user and change them depending of if STUN is enabled
// and the request is aim... |
public class Bitflyer4jFactory { /** * Create a { @ link Configuration } instance ,
* composed of multiple configurations which are enumerated in { @ link ConfigurationType } .
* @ return Composite configuration instance . */
@ VisibleForTesting AbstractConfiguration createConfiguration ( Properties properties ) { ... | CompositeConfiguration composite = new CompositeConfiguration ( ) ; ConfigurationType [ ] types = ConfigurationType . values ( ) ; Arrays . stream ( types ) . forEach ( s -> s . get ( ) . ifPresent ( composite :: addConfiguration ) ) ; Optional . ofNullable ( properties ) . ifPresent ( p -> composite . addConfiguration... |
public class VPTree { /** * Create an ndarray
* from the datapoints
* @ param data
* @ return */
public static INDArray buildFromData ( List < DataPoint > data ) { } } | INDArray ret = Nd4j . create ( data . size ( ) , data . get ( 0 ) . getD ( ) ) ; for ( int i = 0 ; i < ret . slices ( ) ; i ++ ) ret . putSlice ( i , data . get ( i ) . getPoint ( ) ) ; return ret ; |
public class MarkerRulerAction { /** * Retrieves the document from the editor .
* @ return the document from the editor */
protected IDocument getDocument ( ) { } } | Assert . isNotNull ( editor ) ; IDocumentProvider provider = editor . getDocumentProvider ( ) ; return provider . getDocument ( editor . getEditorInput ( ) ) ; |
public class BooleanUtil { /** * 对Boolean数组取异或
* < pre >
* BooleanUtil . xor ( new Boolean [ ] { Boolean . TRUE , Boolean . TRUE } ) = Boolean . FALSE
* BooleanUtil . xor ( new Boolean [ ] { Boolean . FALSE , Boolean . FALSE } ) = Boolean . FALSE
* BooleanUtil . xor ( new Boolean [ ] { Boolean . TRUE , Boolean ... | if ( ArrayUtil . isEmpty ( array ) ) { throw new IllegalArgumentException ( "The Array must not be empty !" ) ; } final boolean [ ] primitive = Convert . convert ( boolean [ ] . class , array ) ; return Boolean . valueOf ( xor ( primitive ) ) ; |
public class CommerceWishListPersistenceImpl { /** * Caches the commerce wish list in the entity cache if it is enabled .
* @ param commerceWishList the commerce wish list */
@ Override public void cacheResult ( CommerceWishList commerceWishList ) { } } | entityCache . putResult ( CommerceWishListModelImpl . ENTITY_CACHE_ENABLED , CommerceWishListImpl . class , commerceWishList . getPrimaryKey ( ) , commerceWishList ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_UUID_G , new Object [ ] { commerceWishList . getUuid ( ) , commerceWishList . getGroupId ( ) } , commerce... |
public class Flowable { /** * Returns a Flowable that emits a specified item before it begins to emit items emitted by the source
* Publisher .
* < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / startWith . png " alt = " " >
* < ... | ObjectHelper . requireNonNull ( value , "item is null" ) ; return concatArray ( just ( value ) , this ) ; |
public class ConfigurationContext { /** * Disable predicate could be registered after some items registration and to make sure that predicate
* affects all these items - apply to all currenlty registered items .
* @ param predicates new predicates */
private void applyPredicatesForRegisteredItems ( final List < Pre... | ImmutableList . builder ( ) . addAll ( getEnabledModules ( ) ) . addAll ( getEnabledBundles ( ) ) . addAll ( getEnabledExtensions ( ) ) . addAll ( getEnabledInstallers ( ) ) . build ( ) . stream ( ) . < ItemInfo > map ( this :: getInfo ) . forEach ( item -> applyDisablePredicates ( predicates , item ) ) ; |
public class JBBPParser { /** * Parse am input stream with defined external value provider .
* @ param in an input stream which content will be parsed , it must not be null
* @ param varFieldProcessor a var field processor , it may be null if there is
* not any var field in a script , otherwise NPE will be thrown... | final JBBPBitInputStream bitInStream = in instanceof JBBPBitInputStream ? ( JBBPBitInputStream ) in : new JBBPBitInputStream ( in , bitOrder ) ; this . finalStreamByteCounter = bitInStream . getCounter ( ) ; final JBBPNamedNumericFieldMap fieldMap ; if ( this . compiledBlock . hasEvaluatedSizeArrays ( ) || this . compi... |
public class AnyTransliterator { /** * Temporary hack for registry problem . Needs to be replaced by better architecture . */
public Transliterator safeClone ( ) { } } | UnicodeFilter filter = getFilter ( ) ; if ( filter != null && filter instanceof UnicodeSet ) { filter = new UnicodeSet ( ( UnicodeSet ) filter ) ; } return new AnyTransliterator ( getID ( ) , filter , target , targetScript , widthFix , cache ) ; |
public class AbstractJSSEProvider { /** * Get the key manager factory instance using the provided information .
* @ see com . ibm . websphere . ssl . JSSEProvider # getKeyManagerFactoryInstance ( )
* @ param keyMgr
* @ param ctxtProvider
* @ return KeyManagerFactory
* @ throws NoSuchAlgorithmException
* @ t... | String mgr = keyMgr ; String provider = ctxtProvider ; if ( mgr . indexOf ( '|' ) != - 1 ) { String [ ] keyManagerArray = mgr . split ( "\\|" ) ; if ( keyManagerArray != null && keyManagerArray . length == 2 ) { mgr = keyManagerArray [ 0 ] ; provider = keyManagerArray [ 1 ] ; } } KeyManagerFactory rc = KeyManagerFactor... |
public class ListThingRegistrationTasksRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListThingRegistrationTasksRequest listThingRegistrationTasksRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listThingRegistrationTasksRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listThingRegistrationTasksRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listThingRegistrationTasksRequest . getMax... |
public class PoolOperations { /** * Adds a pool to the Batch account .
* @ param poolId
* The ID of the pool .
* @ param virtualMachineSize
* The size of virtual machines in the pool . See < a href =
* " https : / / azure . microsoft . com / documentation / articles / virtual - machines - size - specs / " > h... | createPool ( poolId , virtualMachineSize , cloudServiceConfiguration , targetDedicatedNodes , 0 , null ) ; |
public class BasicAtomGenerator { /** * Generate an atom symbol element .
* @ param atom the atom to use
* @ param alignment the alignment of the atom ' s label
* @ param model the renderer model
* @ return an atom symbol element */
public AtomSymbolElement generateElement ( IAtom atom , int alignment , Rendere... | String text ; if ( atom instanceof IPseudoAtom ) { text = ( ( IPseudoAtom ) atom ) . getLabel ( ) ; } else { text = atom . getSymbol ( ) ; } return new AtomSymbolElement ( atom . getPoint2d ( ) . x , atom . getPoint2d ( ) . y , text , atom . getFormalCharge ( ) , atom . getImplicitHydrogenCount ( ) , alignment , getAto... |
public class LogViewSerialization { /** * Parses a { @ link LogView } under a given path and using the given
* { @ link Log } .
* @ param path Path to the log view .
* @ param log Log for the view .
* @ return The parsed log view .
* @ throws IOException If the log view can ' t be read under the given
* pat... | return parse ( new File ( path ) , log ) ; |
public class RDSInstanceDetailsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RDSInstanceDetails rDSInstanceDetails , ProtocolMarshaller protocolMarshaller ) { } } | if ( rDSInstanceDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( rDSInstanceDetails . getFamily ( ) , FAMILY_BINDING ) ; protocolMarshaller . marshall ( rDSInstanceDetails . getInstanceType ( ) , INSTANCETYPE_BINDING ) ; protocolMa... |
public class AmazonDynamoDBAsyncClient { /** * Deletes a table and all of its items .
* If the table is in the < code > ACTIVE < / code > state , you can delete it .
* If a table is in < code > CREATING < / code > or < code > UPDATING < / code > states
* then Amazon DynamoDB returns a < code > ResourceInUseExcept... | return executorService . submit ( new Callable < DeleteTableResult > ( ) { public DeleteTableResult call ( ) throws Exception { DeleteTableResult result ; try { result = deleteTable ( deleteTableRequest ) ; } catch ( Exception ex ) { asyncHandler . onError ( ex ) ; throw ex ; } asyncHandler . onSuccess ( deleteTableReq... |
public class ShanksAgentMovementCapability { /** * Move the agent to the target location with the specific speed . Call this
* method always you want to move . This method only moves the agent a
* fragment equals to the velocity .
* @ param simulation
* @ param agent
* @ param currentLocation
* @ param targ... | if ( ! targetLocation . equals ( currentLocation ) && agent . isAllowedToMove ( ) ) { Double2D direction = targetLocation . subtract ( currentLocation ) ; direction = direction . normalize ( ) ; Double2D movement = direction . multiply ( speed ) ; ShanksAgentMovementCapability . updateLocation ( simulation , agent , cu... |
public class SplitControllerImpl { /** * Note we restart all flows . There is no concept of " the flow completed " . It is only steps
* within the flows that may have already completed and so may not have needed to be rerun . */
private void buildSubJobBatchWorkUnits ( ) { } } | List < Flow > flows = this . split . getFlows ( ) ; parallelBatchWorkUnits = new ArrayList < BatchFlowInSplitWorkUnit > ( ) ; // Build all sub jobs from flows in split
synchronized ( subJobs ) { for ( Flow flow : flows ) { subJobs . add ( PartitionedStepBuilder . buildFlowInSplitSubJob ( jobContext , this . split , flo... |
public class YamlMappingNode { /** * Adds the specified { @ code key } / { @ code value } pair to this mapping .
* @ param key the key
* @ param value the value
* @ return { @ code this } */
public T put ( YamlNode key , Float value ) { } } | return put ( key , getNodeFactory ( ) . floatNode ( value ) ) ; |
public class RelatedWaveListener { /** * { @ inheritDoc } */
@ Override public void waveHandled ( final Wave wave ) { } } | if ( wave . relatedWave ( ) != null ) { // Return wave has been handled , so the triggered wave can be handled too
LOGGER . trace ( RELATED_WAVE_HANDLES , wave . fromClass ( ) . getSimpleName ( ) , wave . relatedWave ( ) . toString ( ) ) ; wave . relatedWave ( ) . status ( Status . Handled ) ; } |
public class ModelMessageHandler { /** * Constructor .
* @ param messageReceiver The message receiver that this listener is added to .
* @ param model The target table model . */
public void init ( BaseMessageReceiver messageReceiver , AbstractTableModel model ) { } } | super . init ( messageReceiver , null ) ; m_model = model ; |
public class StructureInterfaceList { /** * Sorts the interface list and reassigns ids based on new sorting */
public void sort ( ) { } } | Collections . sort ( list ) ; int i = 1 ; for ( StructureInterface interf : list ) { interf . setId ( i ) ; i ++ ; } |
public class Beta { /** * Beta function , also called the Euler integral of the first kind .
* The beta function is symmetric , i . e . B ( x , y ) = = B ( y , x ) . */
public static double beta ( double x , double y ) { } } | return Math . exp ( Gamma . lgamma ( x ) + Gamma . lgamma ( y ) - Gamma . lgamma ( x + y ) ) ; |
public class JvmAnnotationReferenceBuilder { /** * Visits a primitive value of the annotation .
* @ param name
* the value name .
* @ param value
* the actual value , whose type must be { @ link Byte } , { @ link Boolean } , { @ link Character } , { @ link Short } ,
* { @ link Integer } , { @ link Long } , { ... | JvmAnnotationValue annotationValue = proxies . createAnnotationValue ( value ) ; annotationValue . setOperation ( proxies . createMethodProxy ( annotationType , name ) ) ; values . addUnique ( annotationValue ) ; |
public class Inflection { /** * Return true if the word is uncountable .
* @ param word The word
* @ return True if it is uncountable */
public static boolean isUncountable ( String word ) { } } | for ( String w : UNCOUNTABLE ) { if ( w . equalsIgnoreCase ( word ) ) { return true ; } } return false ; |
public class MapExtensions { /** * Replies the elements of the given map except the pair with the given key .
* The replied map is a view on the given map . It means that any change
* in the original map is reflected to the result of this operation .
* @ param < K > type of the map keys .
* @ param < V > type o... | return Maps . filterKeys ( map , new Predicate < K > ( ) { @ Override public boolean apply ( K input ) { return ! Objects . equal ( input , key ) ; } } ) ; |
public class ListComplianceSummariesRequest { /** * One or more compliance or inventory filters . Use a filter to return a more specific list of results .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setFilters ( java . util . Collection ) } or { @ link # ... | if ( this . filters == null ) { setFilters ( new com . amazonaws . internal . SdkInternalList < ComplianceStringFilter > ( filters . length ) ) ; } for ( ComplianceStringFilter ele : filters ) { this . filters . add ( ele ) ; } return this ; |
public class Cpe { /** * Compare version numbers to obtain the correct ordering .
* @ param left the left hand version for comparison
* @ param right the right hand version for comparison
* @ return < code > - 1 < / code > if left is before the right ; < code > 0 < / code > if
* the left and right are equal ; <... | int result = 0 ; // while the strings are well formed - the backslashes will be in the exact
// same location in equal strings - for version numbers the cost of conversion
// should not be incurred
// final List < String > subLeft = splitVersion ( Convert . fromWellFormed ( left ) ) ;
// final List < String > subRight ... |
public class Commands { /** * Creates a new task that will append the result of the second task to the result - list
* of the first .
* TODO Fabian : test behavior and explain here . */
public static < A , B > BaseListCommand < A , B > flatAnd ( Command < A , ? extends Iterable < B > > first , Command < A , B > sec... | return new FlatAndCommand < > ( first , second ) ; |
public class StandardUserAgentClient { /** * Creates and configures a new StandardUserAgentClient instance .
* @ param settings the configuration settings
* @ return a new configured StandardUserAgentClient
* @ see Factory # newUserAgentClient ( Settings ) */
public static StandardUserAgentClient newInstance ( Se... | UDPConnector . Factory udpFactory = Factories . newInstance ( settings , UDP_CONNECTOR_FACTORY_KEY ) ; TCPConnector . Factory tcpFactory = Factories . newInstance ( settings , TCP_CONNECTOR_FACTORY_KEY ) ; return new StandardUserAgentClient ( udpFactory . newUDPConnector ( settings ) , tcpFactory . newTCPConnector ( se... |
public class ClientController { /** * Deletes a specific client id for a profile
* @ param model
* @ param profileIdentifier
* @ param clientUUID
* @ return returns the table of the remaining clients or an exception if deletion failed for some reason
* @ throws Exception */
@ RequestMapping ( value = "/api/pr... | logger . info ( "Attempting to remove the following client: {}" , clientUUID ) ; if ( clientUUID . compareTo ( Constants . PROFILE_CLIENT_DEFAULT_ID ) == 0 ) throw new Exception ( "Default client cannot be deleted" ) ; Integer profileId = ControllerUtils . convertProfileIdentifier ( profileIdentifier ) ; clientService ... |
public class PathHelper { /** * Converts path to posix path . Converted path starts with ' / ' if path is
* absolute and ends with ' / ' if path is directory .
* @ param path
* @ return
* @ see java . nio . file . Path # isAbsolute ( )
* @ see java . nio . file . Files # */
public static final String posixStr... | String prefix = path . isAbsolute ( ) ? "/" : "" ; String suffix = Files . isDirectory ( path ) ? "/" : "" ; return StreamSupport . stream ( path . spliterator ( ) , false ) . map ( ( p ) -> p . toString ( ) ) . collect ( Collectors . joining ( "/" , prefix , suffix ) ) ; |
public class DecimalFormat { /** * Append an affix to the given StringBuffer .
* @ param buf
* buffer to append to
* @ param isNegative
* @ param isPrefix
* @ param fieldPosition
* @ param parseAttr */
private int appendAffix ( StringBuffer buf , boolean isNegative , boolean isPrefix , FieldPosition fieldPo... | if ( currencyChoice != null ) { String affixPat = null ; if ( isPrefix ) { affixPat = isNegative ? negPrefixPattern : posPrefixPattern ; } else { affixPat = isNegative ? negSuffixPattern : posSuffixPattern ; } StringBuffer affixBuf = new StringBuffer ( ) ; expandAffix ( affixPat , null , affixBuf ) ; buf . append ( aff... |
public class InstanceInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InstanceInfo instanceInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( instanceInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instanceInfo . getInstanceName ( ) , INSTANCENAME_BINDING ) ; protocolMarshaller . marshall ( instanceInfo . getIamSessionArn ( ) , IAMSESSIONARN_BINDING ) ; protocolMarsha... |
public class StringArrayList { /** * Adds a whole List of elements .
* @ param vec List of elements to add */
public void addAll ( StringArrayList vec ) { } } | int i ; int max ; max = vec . size ( ) ; for ( i = 0 ; i < max ; i ++ ) { add ( vec . get ( i ) ) ; } |
public class AsyncRestBuilder { /** * Sets the body for the request to be an url - encoded form . This is equivalent to setting
* the { @ link # contentType ( String ) " Content - Type " } to < code > " application / x - www - form - urlencoded " < / code >
* and then setting the body via { @ link # bodyRaw ( Strin... | contentType ( HttpHeaders . Values . APPLICATION_X_WWW_FORM_URLENCODED ) ; return bodyRaw ( form . toUrlEncodedString ( ) ) ; |
public class VoltXMLElementHelper { /** * Build an element to be inserted under the " parameters " tree . */
public static VoltXMLElement buildParamElement ( String elementId , String index , String valueType ) { } } | VoltXMLElement retval = new VoltXMLElement ( "parameter" ) ; retval . attributes . put ( "id" , elementId ) ; retval . attributes . put ( "index" , index ) ; retval . attributes . put ( "valuetype" , valueType ) ; return retval ; |
public class MessagingUtils { /** * Builds a string identifying a messaging client .
* @ param ownerKind { @ link RecipientKind # DM } or { @ link RecipientKind # AGENTS }
* @ param domain the domain
* @ param applicationName the application name ( only makes sense for agents )
* @ param scopedInstancePath the ... | StringBuilder sb = new StringBuilder ( ) ; sb . append ( "[ " ) ; sb . append ( domain ) ; sb . append ( " ] " ) ; if ( ownerKind == RecipientKind . DM ) { sb . append ( "DM" ) ; } else { sb . append ( scopedInstancePath ) ; sb . append ( " @ " ) ; sb . append ( applicationName ) ; } return sb . toString ( ) ; |
public class ArrayFile { /** * Apply entries to the array file .
* The method will flatten entry data and sort it by position .
* So the array file can be updated sequentially to reduce disk seeking time .
* This method updates hwmScn and lwmScn in the array file .
* @ param entryList
* @ throws IOException *... | Chronos c = new Chronos ( ) ; // Sort values by position in the array file
T [ ] values = EntryUtility . sortEntriesToValues ( entryList ) ; if ( values == null || values . length == 0 ) return ; // Obtain maxScn
long maxScn = _arrayHwmScn ; for ( Entry < ? > e : entryList ) { maxScn = Math . max ( e . getMaxScn ( ) , ... |
public class ClosureGlobalPostProcessor { /** * ( non - Javadoc )
* @ see net . jawr . web . resource . bundle . global . processor . GlobalProcessor #
* processBundles ( net . jawr . web . resource . bundle . global . processor .
* AbstractGlobalProcessingContext , java . util . List ) */
@ Override public void ... | if ( ctx . hasBundleToBeProcessed ( ) ) { String workingDir = ctx . getRsReaderHandler ( ) . getWorkingDirectory ( ) ; if ( srcDir == null || destDir == null || tempDir == null || srcZipDir == null || destZipDir == null ) { srcDir = ctx . getBundleHandler ( ) . getBundleTextDirPath ( ) ; srcZipDir = ctx . getBundleHand... |
public class WSRdbManagedConnectionImpl { /** * Removes and closes all statements in the statement cache for this ManagedConnection . */
public final void clearStatementCache ( ) { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // The closing of cached statements is now separated from the removing of statements
// from the cache to avoid synchronization during the closing of statements .
if ( statementCache == null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug (... |
public class AndroidJsonHandler { /** * Converts a Reader to a String by copying the Reader ' s contents into a StringWriter via a
* buffer .
* @ param reader The Reader from which to extract a String .
* @ return The String contained in the Reader .
* @ throws IOException If there is an error reading from the ... | StringWriter writer = new StringWriter ( ) ; try { char [ ] buffer = new char [ COPY_BUFFER_SIZE ] ; while ( true ) { int bytesRead = reader . read ( buffer ) ; if ( bytesRead == - 1 ) { break ; } else { writer . write ( buffer , 0 , bytesRead ) ; } } return writer . toString ( ) ; } finally { reader . close ( ) ; } |
public class DRL6Expressions { /** * $ ANTLR start synpred47 _ DRL6Expressions */
public final void synpred47_DRL6Expressions_fragment ( ) throws RecognitionException { } } | // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 740:7 : ( GREATER GREATER GREATER )
// src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 740:8 : GREATER GREATER GREATER
{ match ( input , GREATER , FOLLOW_GREATER_in_synpred47_DRL6Expressions4674 ) ; if ( s... |
public class ElasticHashinator { /** * Add the given tokens to the ring and generate the new hashinator . The current hashinator is not changed .
* @ param tokensToAdd Tokens to add as a map of tokens to partitions
* @ return The new hashinator */
public ElasticHashinator addTokens ( NavigableMap < Integer , Intege... | // figure out the interval
long interval = deriveTokenInterval ( m_tokensMap . get ( ) . keySet ( ) ) ; Map < Integer , Integer > tokens = Maps . newTreeMap ( ) ; for ( Map . Entry < Integer , Integer > e : m_tokensMap . get ( ) . entrySet ( ) ) { if ( tokensToAdd . containsKey ( e . getKey ( ) ) ) { continue ; } // se... |
public class JSONConverter { /** * Debug ( dump ) the contents of an input stream . This effectively copies
* the input stream into a byte array , dumps one and then returns another .
* If logging is not enabled , nothing happens .
* @ param in
* @ throws IOException */
private InputStream debugInputStream ( In... | if ( logger . isLoggable ( Level . FINEST ) ) { final byte [ ] buffer = new byte [ 1024 ] ; final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; int len ; String line ; logger . finest ( "[START] Dumping the InputStream that will be passed to JSON.parse()" ) ; while ( ( len = in . read ( buffer ) ) > - 1 ... |
public class AbstractWFieldIndicator { /** * Return the diagnostics for this indicator .
* @ return A list of diagnostics ( may be empty ) for this indicator . */
public List < Diagnostic > getDiagnostics ( ) { } } | FieldIndicatorModel model = getComponentModel ( ) ; return Collections . unmodifiableList ( model . diagnostics ) ; |
public class AccessControlList { /** * Gets the list of { @ link Grant } objects in this access control list ( ACL ) .
* @ return The list of { @ link Grant } objects in this ACL . */
public List < Grant > getGrantsAsList ( ) { } } | checkState ( ) ; if ( grantList == null ) { if ( grantSet == null ) { grantList = new LinkedList < Grant > ( ) ; } else { grantList = new LinkedList < Grant > ( grantSet ) ; grantSet = null ; } } return grantList ; |
public class DateTimeUtil { /** * Get Date from " yyyyMMddThhmmssZ " with timezone
* @ param val String " yyyyMMddThhmmssZ "
* @ param tz TimeZone
* @ return Date
* @ throws BadDateException on format error */
@ SuppressWarnings ( "unused" ) public static Date fromISODateTimeUTC ( final String val , final TimeZ... | try { synchronized ( isoDateTimeUTCTZFormat ) { isoDateTimeUTCTZFormat . setTimeZone ( tz ) ; return isoDateTimeUTCTZFormat . parse ( val ) ; } } catch ( Throwable t ) { throw new BadDateException ( ) ; } |
public class BufferUtils { /** * Like append , but does not throw { @ link BufferOverflowException }
* @ param to Buffer is flush mode
* @ param b bytes to fill
* @ param off offset into byte
* @ param len length to fill
* @ return The position of the valid data before the flipped position . */
public static ... | int pos = flipToFill ( to ) ; try { int remaining = to . remaining ( ) ; int take = remaining < len ? remaining : len ; to . put ( b , off , take ) ; return take ; } finally { flipToFlush ( to , pos ) ; } |
public class GetReservedInstancesExchangeQuoteResult { /** * The configuration of your Convertible Reserved Instances .
* @ param reservedInstanceValueSet
* The configuration of your Convertible Reserved Instances . */
public void setReservedInstanceValueSet ( java . util . Collection < ReservedInstanceReservationV... | if ( reservedInstanceValueSet == null ) { this . reservedInstanceValueSet = null ; return ; } this . reservedInstanceValueSet = new com . amazonaws . internal . SdkInternalList < ReservedInstanceReservationValue > ( reservedInstanceValueSet ) ; |
public class ServerPluginRepository { /** * Return the key of the plugin the extension ( in the sense of { @ link Plugin . Context # addExtension ( Object ) } is coming from . */
@ CheckForNull public String getPluginKey ( Object extension ) { } } | return keysByClassLoader . get ( extension . getClass ( ) . getClassLoader ( ) ) ; |
public class DdosProtectionPlansInner { /** * Gets information about the specified DDoS protection plan .
* @ param resourceGroupName The name of the resource group .
* @ param ddosProtectionPlanName The name of the DDoS protection plan .
* @ param serviceCallback the async ServiceCallback to handle successful an... | return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , ddosProtectionPlanName ) , serviceCallback ) ; |
public class MemoryCache { /** * Removes a value from the cache by its key .
* @ param correlationId ( optional ) transaction id to trace execution through
* call chain .
* @ param key a unique value key . */
public void remove ( String correlationId , String key ) { } } | synchronized ( _lock ) { // Get the entry
CacheEntry entry = _cache . get ( key ) ; // Remove entry from the cache
if ( entry != null ) { _cache . remove ( key ) ; _count -- ; } } |
public class BoundedBuffer { /** * D638088 - implemented split locks for get queue */
private void waitGet_ ( long timeout ) throws InterruptedException { } } | // wait on a member of the lock array
int lockIndex = getQueueIndex ( getQueueLocks_ , getQueueCounter_ , true ) ; synchronized ( getQueueLocks_ [ lockIndex ] ) { try { // increment waiting threads
getQueueLocks_ [ lockIndex ] . threadsWaiting ++ ; // D497382 - Now that we have the getQueue _ lock , recheck the
// cond... |
public class WorkflowManagerImpl { /** * / * ( non - Javadoc )
* @ see nz . co . senanque . workflow . WorkflowManager # execute ( nz . co . senanque . workflow . instances . DeferredEvent ) */
@ Transactional public void executeDeferredEvent ( long deferredEventId ) { } } | DeferredEvent deferredEvent = getWorkflowDAO ( ) . findDeferredEvent ( deferredEventId ) ; log . debug ( "fired deferred event {} for {} {}" , deferredEvent . getEventType ( ) , deferredEvent . getProcessInstance ( ) . getId ( ) , deferredEvent . getComment ( ) ) ; ProcessInstance processInstance = deferredEvent . getP... |
public class WorkerPool { /** * Wait for the { @ link RingBuffer } to drain of published events then halt the workers . */
public void drainAndHalt ( ) { } } | Sequence [ ] workerSequences = getWorkerSequences ( ) ; while ( ringBuffer . getCursor ( ) > Util . getMinimumSequence ( workerSequences ) ) { Thread . yield ( ) ; } for ( WorkProcessor < ? > processor : workProcessors ) { processor . halt ( ) ; } started . set ( false ) ; |
public class EldaRouterRestlet { /** * Answer true of m ' s endpoint has no formatter called type . */
private boolean notFormat ( Match m , String type ) { } } | return m . getEndpoint ( ) . getRendererNamed ( type ) == null ; |
public class DataSetBuilder { /** * Set < code > double < / code > sequence filler for column
* with a specified step .
* A call to this method is shorthand for
* < code > sequence ( column , initial , x - & gt ; x + step ) < / code > .
* @ param column Column name .
* @ param initial Initial sequence value .... | return sequence ( column , ( Double ) initial , x -> x + step ) ; |
public class IO { /** * int c simplifies checking , casting */
public static void writeU2 ( OutputStream dest , int u2 ) throws IOException { } } | if ( ( u2 < Character . MIN_VALUE ) || ( u2 > Character . MAX_VALUE ) ) { throw new IllegalArgumentException ( ) ; } dest . write ( ( byte ) ( u2 >> 8 ) ) ; dest . write ( ( byte ) u2 ) ; |
public class Assign { /** * 数组或 Map 赋值 */
@ SuppressWarnings ( { } } | "unchecked" , "rawtypes" } ) Object assignElement ( Scope scope ) { Object target = scope . get ( id ) ; if ( target == null ) { throw new TemplateException ( "The assigned targets \"" + id + "\" can not be null" , location ) ; } Object idx = index . eval ( scope ) ; if ( idx == null ) { throw new TemplateException ( "... |
public class PackedRecordPointer { /** * Pack a record address and partition id into a single word .
* @ param recordPointer a record pointer encoded by TaskMemoryManager .
* @ param partitionId a shuffle partition id ( maximum value of 2 ^ 24 ) .
* @ return a packed pointer that can be decoded using the { @ link... | assert ( partitionId <= MAXIMUM_PARTITION_ID ) ; // Note that without word alignment we can address 2 ^ 27 bytes = 128 megabytes per page .
// Also note that this relies on some internals of how TaskMemoryManager encodes its addresses .
final long pageNumber = ( recordPointer & MASK_LONG_UPPER_13_BITS ) >>> 24 ; final ... |
public class UnconditionalValueDerefSet { /** * Set a value as being unconditionally dereferenced at the given set of
* locations .
* @ param vn
* the value
* @ param derefSet
* the Set of dereference Locations */
public void setDerefSet ( ValueNumber vn , Set < Location > derefSet ) { } } | if ( UnconditionalValueDerefAnalysis . DEBUG ) { System . out . println ( "Adding dereference of " + vn + " for # " + System . identityHashCode ( this ) + " to " + derefSet ) ; } valueNumbersUnconditionallyDereferenced . set ( vn . getNumber ( ) ) ; Set < Location > derefLocationSet = getDerefLocationSet ( vn ) ; deref... |
public class ServerConfig { /** * Set a configuration parameter with a Collection type . */
private static void setCollectionParam ( String name , List < ? > values ) throws ConfigurationException { } } | try { Field field = config . getClass ( ) . getDeclaredField ( name ) ; Class < ? > fieldClass = field . getType ( ) ; if ( Map . class . isAssignableFrom ( fieldClass ) ) { setMapParam ( field , values ) ; } else if ( List . class . isAssignableFrom ( fieldClass ) ) { setListParam ( field , values ) ; } else { throw n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.