signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ShortField { /** * Read the physical data from a stream file and set this field .
* @ param daIn Input stream to read this field ' s data from .
* @ param bFixedLength If false ( default ) be sure to save the length in the stream .
* @ return boolean Success ? */
public boolean read ( DataInputStream... | try { short sData = daIn . readShort ( ) ; Short shData = null ; if ( sData != NAN ) shData = new Short ( sData ) ; int errorCode = this . setData ( shData , DBConstants . DONT_DISPLAY , DBConstants . READ_MOVE ) ; return ( errorCode == DBConstants . NORMAL_RETURN ) ; // Success
} catch ( IOException ex ) { ex . printS... |
public class ExcelFunctions { /** * Converts a text string to uppercase */
public static String upper ( EvaluationContext ctx , Object text ) { } } | return Conversions . toString ( text , ctx ) . toUpperCase ( ) ; |
public class PathValueData { /** * { @ inheritDoc } */
@ Override protected InternalQName getName ( ) throws ValueFormatException { } } | if ( value . getDepth ( ) == 0 && ! value . isAbsolute ( ) ) { QPathEntry entry = value . getEntries ( ) [ 0 ] ; return new InternalQName ( entry . getNamespace ( ) , entry . getName ( ) ) ; } throw new ValueFormatException ( "Can't conver to InternalQName. Wrong value type." ) ; |
public class MonitorEndpointHelper { /** * Browse a queue for messages
* @ param muleJmsConnectorName
* @ param queueName
* @ return
* @ throws JMSException */
@ SuppressWarnings ( "rawtypes" ) private static boolean isQueueEmpty ( MuleContext muleContext , String muleJmsConnectorName , String queueName ) throw... | JmsConnector muleCon = ( JmsConnector ) MuleUtil . getSpringBean ( muleContext , muleJmsConnectorName ) ; Session s = null ; QueueBrowser b = null ; try { // Get a jms connection from mule and create a jms session
s = muleCon . getConnection ( ) . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; Queue q = s . cre... |
public class ForkedFrameworkFactory { /** * Forks a Java VM process running an OSGi framework and returns a { @ link RemoteFramework }
* handle to it .
* @ param vmArgs
* VM arguments
* @ param systemProperties
* system properties for the forked Java VM
* @ param frameworkProperties
* framework properties... | return fork ( vmArgs , systemProperties , frameworkProperties , null , null ) ; |
public class CollectionUtil { /** * 返回无序集合中的最小值和最大值
* 在返回的Pair中 , 第一个为最小值 , 第二个为最大值 */
public static < T > Pair < T , T > minAndMax ( Collection < ? extends T > coll , Comparator < ? super T > comp ) { } } | Iterator < ? extends T > i = coll . iterator ( ) ; T minCandidate = i . next ( ) ; T maxCandidate = minCandidate ; while ( i . hasNext ( ) ) { T next = i . next ( ) ; if ( comp . compare ( next , minCandidate ) < 0 ) { minCandidate = next ; } else if ( comp . compare ( next , maxCandidate ) > 0 ) { maxCandidate = next ... |
public class CandidateCluster { /** * Returns the average data point assigned to this candidate cluster */
public DoubleVector centerOfMass ( ) { } } | // Handle lazy initialization
if ( centroid == null ) { if ( indices . size ( ) == 1 ) centroid = sumVector ; else { // Update the centroid by normalizing by the number of elements .
// We expect that the centroid vector might be compared with
// other vectors multiple times . If we used a ScaledVector here ,
// we wou... |
public class CardAPI { /** * 设置卡券失效
* @ param accessToken accessToken
* @ param codeUnavailable codeUnavailable
* @ return result */
public static BaseResult codeUnavailable ( String accessToken , CodeUnavailable codeUnavailable ) { } } | return codeUnavailable ( accessToken , JsonUtil . toJSONString ( codeUnavailable ) ) ; |
public class IdentityInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( IdentityInfo identityInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( identityInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( identityInfo . getIdentityType ( ) , IDENTITYTYPE_BINDING ) ; protocolMarshaller . marshall ( identityInfo . getIdentityName ( ) , IDENTITYNAME_BINDING ) ; protocolMarshall... |
public class Request { /** * Creates a new Request configured to create a user owned Open Graph object .
* @ param session
* the Session to use , or null ; if non - null , the session must be in an opened state
* @ param type
* the fully - specified Open Graph object type ( e . g . , my _ app _ namespace : my _... | OpenGraphObject openGraphObject = OpenGraphObject . Factory . createForPost ( OpenGraphObject . class , type , title , imageUrl , url , description ) ; if ( objectProperties != null ) { openGraphObject . setData ( objectProperties ) ; } return newPostOpenGraphObjectRequest ( session , openGraphObject , callback ) ; |
public class PutResponseUnmarshaller { /** * { @ inheritDoc } */
@ Override public Object unMarshall ( Response < PutResponse > response , Object entity ) { } } | return unMarshall ( response , entity . getClass ( ) ) ; |
public class SeaGlassStyle { /** * Simple utility method that searchs the given array of Strings for the
* given string . This method is only called from getExtendedState if the
* developer has specified a specific state for the component to be in ( ie ,
* has " wedged " the component in that state ) by specifyin... | assert name != null ; for ( int i = 0 ; i < names . length ; i ++ ) { if ( name . equals ( names [ i ] ) ) { return true ; } } return false ; |
public class DataSetUtils { /** * < b > showINDArray < / b > < br >
* public void showINDArray ( int mtLv , String itemCode , INDArray INDA , < br >
* int digits , int r _ End _ I , int c _ End _ I ) < br >
* Shows content of INDArray . < br >
* Shows first rows and than columns . < br >
* @ param mtLv - meth... | showINDArray ( mtLv , itemCode , INDA , digits , r_End_I , c_End_I , false ) ; |
public class SegmentLocationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SegmentLocation segmentLocation , ProtocolMarshaller protocolMarshaller ) { } } | if ( segmentLocation == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( segmentLocation . getCountry ( ) , COUNTRY_BINDING ) ; protocolMarshaller . marshall ( segmentLocation . getGPSPoint ( ) , GPSPOINT_BINDING ) ; } catch ( Exception e ) {... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcCurveBoundedPlane ( ) { } } | if ( ifcCurveBoundedPlaneEClass == null ) { ifcCurveBoundedPlaneEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 162 ) ; } return ifcCurveBoundedPlaneEClass ; |
public class AnyValueMap { /** * Converts map element into a string or returns default value if conversion is
* not possible .
* @ param key a key of element to get .
* @ param defaultValue the default value
* @ return string value of the element or default value if conversion is not
* supported .
* @ see S... | Object value = getAsObject ( key ) ; return StringConverter . toStringWithDefault ( value , defaultValue ) ; |
public class AbstractInjectionEngine { /** * This method will unregister an instance of an InjectionMetaDataListener with the current
* engine instance . */
@ Override public void unregisterInjectionMetaDataListener ( InjectionMetaDataListener metaDataListener ) { } } | if ( metaDataListener == null ) { throw new IllegalArgumentException ( "A null InjectionMetaDataListener cannot be unregistered " + "from the injection engine." ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "unregisterInjectionMetaDataListener" , metaDataListener . g... |
public class tmtrafficpolicy { /** * Use this API to fetch all the tmtrafficpolicy resources that are configured on netscaler . */
public static tmtrafficpolicy [ ] get ( nitro_service service , options option ) throws Exception { } } | tmtrafficpolicy obj = new tmtrafficpolicy ( ) ; tmtrafficpolicy [ ] response = ( tmtrafficpolicy [ ] ) obj . get_resources ( service , option ) ; return response ; |
public class Quaternion { /** * Sets this quaternion to the rotation of the first normalized vector onto the second .
* @ return a reference to this quaternion , for chaining . */
public Quaternion fromVectors ( IVector3 from , IVector3 to ) { } } | float angle = from . angle ( to ) ; if ( angle < MathUtil . EPSILON ) { return set ( IDENTITY ) ; } if ( angle <= FloatMath . PI - MathUtil . EPSILON ) { return fromAngleAxis ( angle , from . cross ( to ) . normalizeLocal ( ) ) ; } // it ' s a 180 degree rotation ; any axis orthogonal to the from vector will do
Vector3... |
public class LssClient { /** * Update stream destination push url in live stream service
* @ param request The request object containing all options for updating destination push url */
public void updateStreamDestinationPushUrl ( UpdateStreamDestinationPushUrlRequest request ) { } } | checkNotNull ( request , "The parameter request should NOT be null." ) ; checkStringNotEmpty ( request . getDomain ( ) , "Domain should NOT be empty." ) ; checkStringNotEmpty ( request . getApp ( ) , "App should NOT be empty" ) ; checkStringNotEmpty ( request . getStream ( ) , "Stream should NOT be empty." ) ; Internal... |
public class RoleAssignmentsInner { /** * Creates a role assignment by ID .
* @ param roleAssignmentId The fully qualified ID of the role assignment , including the scope , resource name and resource type . Use the format , / { scope } / providers / Microsoft . Authorization / roleAssignments / { roleAssignmentName }... | return createByIdWithServiceResponseAsync ( roleAssignmentId , properties ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SocketUtility { /** * Create socket according to options . In case of compilation ahead of time , will throw an error
* if dependencies found , then use default socket implementation .
* @ return Socket */
@ SuppressWarnings ( "unchecked" ) public static SocketHandlerFunction getSocketHandler ( ) { } } | try { // forcing use of JNA to ensure AOT compilation
Platform . getOSType ( ) ; return ( urlParser , host ) -> { if ( urlParser . getOptions ( ) . pipe != null ) { return new NamedPipeSocket ( host , urlParser . getOptions ( ) . pipe ) ; } else if ( urlParser . getOptions ( ) . localSocket != null ) { try { return new... |
public class Endpoint { /** * Creates a new host { @ link Endpoint } .
* @ throws IllegalArgumentException if { @ code host } is not a valid host name or
* { @ code port } is not a valid port number */
public static Endpoint of ( String host , int port ) { } } | validatePort ( "port" , port ) ; return create ( host , port ) ; |
public class StreamEx { /** * Returns a new { @ code StreamEx } which is a concatenation of this stream
* and the supplied value .
* This is a < a href = " package - summary . html # StreamOps " > quasi - intermediate
* operation < / a > with < a href = " package - summary . html # TSO " > tail - stream
* optim... | return appendSpliterator ( null , new ConstSpliterator . OfRef < > ( value , 1 , true ) ) ; |
public class EntryStream { /** * Returns a { @ link Map } containing the elements of this stream . There are
* no guarantees on the type or serializability of the { @ code Map } returned ;
* if more control over the returned { @ code Map } is required , use
* { @ link # toCustomMap ( BinaryOperator , Supplier ) }... | Function < Entry < K , V > , K > keyMapper = Entry :: getKey ; Function < Entry < K , V > , V > valueMapper = Entry :: getValue ; return collect ( Collectors . toMap ( keyMapper , valueMapper , mergeFunction , HashMap :: new ) ) ; |
public class PathUtils { /** * Deletes empty directories starting with startPath and all ancestors up to but not including limitPath .
* @ param fs { @ link FileSystem } where paths are located .
* @ param limitPath only { @ link Path } s that are strict descendants of this path will be deleted .
* @ param startP... | if ( PathUtils . isAncestor ( limitPath , startPath ) && ! PathUtils . getPathWithoutSchemeAndAuthority ( limitPath ) . equals ( PathUtils . getPathWithoutSchemeAndAuthority ( startPath ) ) && fs . listStatus ( startPath ) . length == 0 ) { if ( ! fs . delete ( startPath , false ) ) { log . warn ( "Failed to delete emp... |
public class ListItemGrabberAction { /** * This operation is used to retrieve a value from a list . When the index of an element from a list is known ,
* this operation can be used to extract the element .
* @ param list The list to get the value from .
* @ param delimiter The delimiter that separates values in t... | @ Output ( RESULT_TEXT ) , @ Output ( RESPONSE ) , @ Output ( RETURN_RESULT ) , @ Output ( RETURN_CODE ) } , responses = { @ Response ( text = SUCCESS , field = RETURN_CODE , value = RETURN_CODE_SUCCESS , matchType = MatchType . COMPARE_EQUAL ) , @ Response ( text = FAILURE , field = RESPONSE , value = RETURN_CODE_FAIL... |
public class RewindableInputStream { /** * Reads up to len bytes of data from the input stream into an array of bytes . In its current
* implementation it cannot return more bytes than left in the buffer if in " non - chunked " mode (
* < code > fMayReadChunks = = false < / code > ) . After reaching the end of the ... | if ( null == b ) { throw new NullPointerException ( "Destination byte array is null." ) ; } else if ( 0 == len ) { return 0 ; } else if ( ( b . length < off ) || ( b . length < ( off + len ) ) || ( 0 > off ) || ( 0 > len ) ) { throw new IndexOutOfBoundsException ( ) ; } int bytesLeft = fLength - fOffset ; /* * There is... |
public class OpenPgpSelf { /** * Return the { @ link PGPSecretKeyRing } which we will use to sign our messages .
* @ return signing key
* @ throws IOException IO is dangerous
* @ throws PGPException PGP is brittle */
public PGPSecretKeyRing getSigningKeyRing ( ) throws IOException , PGPException { } } | PGPSecretKeyRingCollection secretKeyRings = getSecretKeys ( ) ; if ( secretKeyRings == null ) { return null ; } PGPSecretKeyRing signingKeyRing = null ; for ( PGPSecretKeyRing ring : secretKeyRings ) { if ( signingKeyRing == null ) { signingKeyRing = ring ; continue ; } if ( ring . getPublicKey ( ) . getCreationTime ( ... |
public class CoreFields { /** * Override preparePaintComponent to perform initialisation the first time through .
* @ param request the request being responded to . */
@ Override protected void preparePaintComponent ( final Request request ) { } } | super . preparePaintComponent ( request ) ; if ( ! isInitialised ( ) ) { textArea . setFocussed ( ) ; setInitialised ( true ) ; } |
public class PatchedBigQueryTableRowIterator { /** * Adjusts a field returned from the BigQuery API to match what we will receive when running
* BigQuery ' s export - to - GCS and parallel read , which is the efficient parallel implementation
* used for batch jobs executed on the Beam Runners that perform initial s... | if ( Data . isNull ( v ) ) { return null ; } if ( Objects . equals ( fieldSchema . getMode ( ) , "REPEATED" ) ) { TableFieldSchema elementSchema = fieldSchema . clone ( ) . setMode ( "REQUIRED" ) ; @ SuppressWarnings ( "unchecked" ) List < Map < String , Object > > rawCells = ( List < Map < String , Object > > ) v ; Im... |
public class GetServiceLastAccessedDetailsWithEntitiesResult { /** * An < code > EntityDetailsList < / code > object that contains details about when an IAM entity ( user or role ) used group
* or policy permissions in an attempt to access the specified AWS service .
* @ param entityDetailsList
* An < code > Enti... | if ( entityDetailsList == null ) { this . entityDetailsList = null ; return ; } this . entityDetailsList = new com . amazonaws . internal . SdkInternalList < EntityDetails > ( entityDetailsList ) ; |
public class CommerceWishListPersistenceImpl { /** * Returns a range of all the commerce wish lists where groupId = & # 63 ; and userId = & # 63 ; and defaultWishList = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code >... | return findByG_U_D ( groupId , userId , defaultWishList , start , end , null ) ; |
public class Configuration { /** * Sets the local FailureScope reference .
* @ param localFailureScope The local FailureScope */
public static final void localFailureScope ( FailureScope localFailureScope ) { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "localFailureScope" , localFailureScope ) ; _localFailureScope = localFailureScope ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "localFailureScope" ) ; |
public class CmsGroupTransferList { /** * Sets the icon actions for the transfer list . < p >
* @ param transferCol the column to set the action */
protected void setTransferAction ( CmsListColumnDefinition transferCol ) { } } | CmsListDirectAction transferAction = new CmsListDirectAction ( LIST_ACTION_TRANSFER ) ; transferAction . setName ( Messages . get ( ) . container ( Messages . GUI_GROUPS_TRANSFER_LIST_ACTION_TRANSFER_NAME_0 ) ) ; transferAction . setHelpText ( Messages . get ( ) . container ( Messages . GUI_GROUPS_TRANSFER_LIST_ACTION_... |
public class WorkQueue { /** * Add a unit of work . May be called by workers to add more work units to the tail of the queue .
* @ param workUnit
* the work unit
* @ throws NullPointerException
* if the work unit is null . */
public void addWorkUnit ( final T workUnit ) { } } | if ( workUnit == null ) { throw new NullPointerException ( "workUnit cannot be null" ) ; } numIncompleteWorkUnits . incrementAndGet ( ) ; workUnits . add ( new WorkUnitWrapper < > ( workUnit ) ) ; |
public class FastSafeIterableMap { /** * Return an entry added to prior to an entry associated with the given key .
* @ param k the key
* @ return the map . entry */
public Map . Entry < K , V > ceil ( K k ) { } } | if ( contains ( k ) ) { return mHashMap . get ( k ) . mPrevious ; } return null ; |
public class XMLUtil { /** * Replies an XML / HTML color .
* @ param red the red component .
* @ param green the green component .
* @ param blue the blue component .
* @ param alpha the alpha component .
* @ return the XML color encoding .
* @ see # parseColor ( String ) */
@ Pure public static String toCo... | return toColor ( encodeRgbaColor ( red , green , blue , alpha ) ) ; |
public class Repository { /** * simplified load method for testing */
public static Repository load ( Resolver resolver ) throws IOException { } } | Repository repository ; repository = new Repository ( ) ; repository . loadClasspath ( resolver ) ; repository . link ( ) ; return repository ; |
public class Caster { /** * cast a Object to a TimeSpan Object ( alias for toTimeSpan )
* @ param o Object to cast
* @ return casted TimeSpan Object
* @ throws PageException */
public static TimeSpan toTimespan ( Object o ) throws PageException { } } | TimeSpan ts = toTimespan ( o , null ) ; if ( ts != null ) return ts ; throw new CasterException ( o , "timespan" ) ; |
public class HtmlMenuRendererBase { /** * private static final Log log = LogFactory . getLog ( HtmlMenuRenderer . class ) ; */
public void encodeEnd ( FacesContext facesContext , UIComponent component ) throws IOException { } } | RendererUtils . checkParamValidity ( facesContext , component , null ) ; Map < String , List < ClientBehavior > > behaviors = null ; if ( component instanceof ClientBehaviorHolder ) { behaviors = ( ( ClientBehaviorHolder ) component ) . getClientBehaviors ( ) ; if ( ! behaviors . isEmpty ( ) ) { ResourceUtils . renderD... |
public class SparseDirectedTypedEdgeSet { /** * Adds the edge to this set if one of the vertices is the root vertex and
* if the non - root vertex has a greater index that this vertex . */
public boolean add ( DirectedTypedEdge < T > e ) { } } | if ( e . from ( ) == rootVertex ) return add ( outEdges , e . to ( ) , e . edgeType ( ) ) ; else if ( e . to ( ) == rootVertex ) return add ( inEdges , e . from ( ) , e . edgeType ( ) ) ; return false ; |
public class AbstractAmazonElasticLoadBalancingAsync { /** * Simplified method form for invoking the DescribeLoadBalancerPolicyTypes operation with an AsyncHandler .
* @ see # describeLoadBalancerPolicyTypesAsync ( DescribeLoadBalancerPolicyTypesRequest ,
* com . amazonaws . handlers . AsyncHandler ) */
@ Override ... | return describeLoadBalancerPolicyTypesAsync ( new DescribeLoadBalancerPolicyTypesRequest ( ) , asyncHandler ) ; |
public class ContextualStorage { /** * If the context is a passivating scope then we return
* the passivationId of the Bean . Otherwise we use
* the Bean directly .
* @ return the key to use in the context map */
public < T > Object getBeanKey ( Contextual < T > bean ) { } } | if ( passivationCapable ) { // if the
return ( ( PassivationCapable ) bean ) . getId ( ) ; } return bean ; |
public class MicrochipPotentiometerDeviceController { /** * Returns the status of the device according EEPROM and WiperLocks .
* @ return The device ' s status
* @ throws IOException Thrown if communication fails or device returned a malformed result */
public DeviceControllerDeviceStatus getDeviceStatus ( ) throws... | // get status from device
int deviceStatus = read ( MEMADDR_STATUS ) ; // check formal criterias
int reservedValue = deviceStatus & STATUS_RESERVED_MASK ; if ( reservedValue != STATUS_RESERVED_VALUE ) { throw new IOException ( "status-bits 4 to 8 must be 1 according to documentation chapter 4.2.2.1. got '" + Integer . ... |
public class InlineBox { /** * Assigns the line box assigned to this inline box and all the inline sub - boxes .
* @ param linebox The assigned linebox . */
public void setLineBox ( LineBox linebox ) { } } | this . linebox = linebox ; for ( int i = startChild ; i < endChild ; i ++ ) { Box sub = getSubBox ( i ) ; if ( sub instanceof InlineElement ) ( ( InlineElement ) sub ) . setLineBox ( linebox ) ; } |
public class File { /** * Returns a list of the files that your account has access to . The files are returned sorted by
* creation date , with the most recently created files appearing first . */
public static FileCollection list ( Map < String , Object > params ) throws StripeException { } } | return list ( params , null ) ; |
public class AmazonWorkLinkClient { /** * Updates the identity provider configuration for the fleet .
* @ param updateIdentityProviderConfigurationRequest
* @ return Result of the UpdateIdentityProviderConfiguration operation returned by the service .
* @ throws UnauthorizedException
* You are not authorized to... | request = beforeClientExecution ( request ) ; return executeUpdateIdentityProviderConfiguration ( request ) ; |
public class FSDatasetDelta { /** * / * This method is used for testing purposes */
synchronized int size ( int nsid ) { } } | Map < Long , FSDatasetDelta . BlockOperation > ns = delta . get ( nsid ) ; return ns == null ? 0 : ns . size ( ) ; |
public class ParserRoutine { /** * < SQL control statement > : : =
* < call statement >
* | < return statement >
* < compound statement >
* < case statement >
* < if statement >
* < iterate statement >
* < leave statement >
* < loop statement >
* < while statement >
* < repeat statement >
* < for ... | HsqlArrayList list = new HsqlArrayList ( ) ; while ( token . tokenType == Tokens . DECLARE ) { Object var = readLocalVariableDeclarationOrNull ( ) ; if ( var == null ) { var = readLocalHandlerDeclaration ( routine , context ) ; } list . add ( var ) ; } Object [ ] declarations = new Object [ list . size ( ) ] ; list . t... |
public class EJBMethodInvoker { /** * This invokes the target operation . We override this method to deal with the
* fact that the ' serviceObject ' is actually an EJB wrapper class . We need
* to get an equivalent method on the ' serviceObject ' class in order to invoke
* the target operation . */
@ Override pro... | // This retrieves the appropriate method from the wrapper class
m = serviceObject . getClass ( ) . getMethod ( m . getName ( ) , m . getParameterTypes ( ) ) ; return super . performInvocation ( exchange , serviceObject , m , paramArray ) ; |
public class WaveformDetailComponent { /** * Determine the X coordinate within the component at which the specified beat begins .
* @ param beat the beat number whose position is desired
* @ return the horizontal position within the component coordinate space where that beat begins
* @ throws IllegalArgumentExcep... | BeatGrid grid = beatGrid . get ( ) ; if ( grid != null ) { return millisecondsToX ( grid . getTimeWithinTrack ( beat ) ) ; } return 0 ; |
public class PrefixedPropertiesPersister { /** * Loads from json .
* @ param props
* the props
* @ param is
* the is
* @ throws IOException
* Signals that an I / O exception has occurred . */
public void loadFromYAML ( final Properties props , final InputStream is ) throws IOException { } } | try { ( ( PrefixedProperties ) props ) . loadFromYAML ( is ) ; } catch ( final NoSuchMethodError err ) { throw new IOException ( "Cannot load properties JSON file - not using PrefixedProperties: " + err . getMessage ( ) ) ; } |
public class StoryRunner { /** * Runs a Story with the given configuration and steps , applying the given
* meta filter , and staring from given state .
* @ param configuration the Configuration used to run story
* @ param candidateSteps the List of CandidateSteps containing the candidate
* steps methods
* @ ... | run ( configuration , new ProvidedStepsFactory ( candidateSteps ) , story , filter , beforeStories ) ; |
public class TwitterImpl { /** * " command = INIT & media _ type = video / mp4 & total _ bytes = 4430752" */
private UploadedMedia uploadMediaChunkedInit ( long size ) throws TwitterException { } } | return new UploadedMedia ( post ( conf . getUploadBaseURL ( ) + "media/upload.json" , new HttpParameter [ ] { new HttpParameter ( "command" , CHUNKED_INIT ) , new HttpParameter ( "media_type" , "video/mp4" ) , new HttpParameter ( "media_category" , "tweet_video" ) , new HttpParameter ( "total_bytes" , size ) } ) . asJS... |
public class TangoEventsAdapter { public void addTangoUserListener ( ITangoUserListener listener , String attrName , boolean stateless ) throws DevFailed { } } | addTangoUserListener ( listener , attrName , new String [ 0 ] , stateless ) ; |
public class DiagnosticsInner { /** * Get site detector response .
* Get site detector response .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param siteName Site Name
* @ param detectorName Detector Resource Name
* @ param slot Slot Name
* @ param serviceCallba... | return ServiceFuture . fromResponse ( getSiteDetectorResponseSlotWithServiceResponseAsync ( resourceGroupName , siteName , detectorName , slot ) , serviceCallback ) ; |
public class BaseMessageHeader { /** * Return the state of this object as a properties object .
* @ return The properties . */
public Map < String , Object > getProperties ( ) { } } | Map < String , Object > properties = new HashMap < String , Object > ( ) ; if ( m_mxProperties != null ) { for ( int i = 0 ; i < m_mxProperties . length ; i ++ ) { if ( m_mxProperties [ i ] [ MessageConstants . NAME ] != null ) if ( m_mxProperties [ i ] [ MessageConstants . VALUE ] != null ) properties . put ( ( String... |
public class XmlConfiguration { /** * Create a new array object .
* @ param obj @ param node @ return @ exception NoSuchMethodException @ exception
* ClassNotFoundException @ exception InvocationTargetException */
private Object newArray ( Object obj , XmlParser . Node node ) throws NoSuchMethodException , ClassNot... | // Get the type
Class aClass = java . lang . Object . class ; String type = node . getAttribute ( "type" ) ; String id = node . getAttribute ( "id" ) ; if ( type != null ) { aClass = TypeUtil . fromName ( type ) ; if ( aClass == null ) { if ( "String" . equals ( type ) ) aClass = java . lang . String . class ; else if ... |
public class TCPChannel { /** * Initialize the endpoint listening socket .
* @ throws ChannelException */
private void initializePort ( ) throws ChannelException { } } | try { this . endPoint . initServerSocket ( ) ; } catch ( IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "TCP Channel: " + getExternalName ( ) + "- Problem occurred while initializing TCP Channel: " + ioe . getMessage ( ) ) ; } throw new ChannelExceptio... |
public class NTriplesDataSource { /** * common utility method for adding a statement to a record */
private void addStatement ( RecordImpl record , String subject , String property , String object ) { } } | Collection < Column > cols = columns . get ( property ) ; if ( cols == null ) { if ( property . equals ( RDF_TYPE ) && ! types . isEmpty ( ) ) addValue ( record , subject , property , object ) ; return ; } for ( Column col : cols ) { String cleaned = object ; if ( col . getCleaner ( ) != null ) cleaned = col . getClean... |
public class Stanza { /** * Add to , from , id and ' xml : lang ' attributes
* @ param xml the { @ link XmlStringBuilder } .
* @ param enclosingXmlEnvironment the enclosing XML namespace .
* @ return the XML environment for this stanza . */
protected XmlEnvironment addCommonAttributes ( XmlStringBuilder xml , Xml... | String language = getLanguage ( ) ; String namespace = StreamOpen . CLIENT_NAMESPACE ; if ( enclosingXmlEnvironment != null ) { String effectiveEnclosingNamespace = enclosingXmlEnvironment . getEffectiveNamespaceOrUse ( namespace ) ; switch ( effectiveEnclosingNamespace ) { case StreamOpen . CLIENT_NAMESPACE : case Str... |
public class LoggerFactory { /** * 获取日志输出器
* @ param key 分类键
* @ return 日志输出器 , 后验条件 : 不返回null . */
public static Logger getLogger ( String key ) { } } | FailsafeLogger logger = LOGGERS . get ( key ) ; if ( logger == null ) { LOGGERS . putIfAbsent ( key , new FailsafeLogger ( LOGGER_ADAPTER . getLogger ( key ) ) ) ; logger = LOGGERS . get ( key ) ; } return logger ; |
public class ResponseImpl { /** * This conversion is needed as some values may not be Strings */
private List < String > toListOfStrings ( String headerName , List < Object > values ) { } } | if ( values == null ) { return null ; } List < String > stringValues = new ArrayList < > ( values . size ( ) ) ; HeaderDelegate < Object > hd = HttpUtils . getHeaderDelegate ( values . get ( 0 ) ) ; for ( Object value : values ) { String actualValue = hd == null ? value . toString ( ) : hd . toString ( value ) ; string... |
public class ColumnVector { /** * Gets double type values from [ rowId , rowId + count ) . The return values for the null slots
* are undefined and can be anything . */
public double [ ] getDoubles ( int rowId , int count ) { } } | double [ ] res = new double [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { res [ i ] = getDouble ( rowId + i ) ; } return res ; |
public class AdaptiveTableLayout { /** * Method change columns . Change view holders indexes , kay in map , init changing items in adapter .
* @ param fromColumn from column index which need to shift
* @ param toColumn to column index which need to shift */
private void shiftColumnsViews ( final int fromColumn , fi... | if ( mAdapter != null ) { // change data
mAdapter . changeColumns ( getBindColumn ( fromColumn ) , getBindColumn ( toColumn ) ) ; // change view holders
switchHeaders ( mHeaderColumnViewHolders , fromColumn , toColumn , ViewHolderType . COLUMN_HEADER ) ; // change indexes in array with widths
mManager . switchTwoColumn... |
public class RepositoryResourceImpl { /** * Perform the matching logic for { @ link # getResources ( Collection , Collection , Visibility , RepositoryConnectionList ) } and
* { @ link # findResources ( String , Collection , Collection , Visibility , RepositoryConnectionList ) } so that this method will return < code ... | ResourceType type = getType ( ) ; if ( ResourceType . FEATURE == type && visibility != null ) { EsaResourceImpl esa = ( EsaResourceImpl ) this ; Visibility visibilityMatches = esa . getVisibility ( ) == null ? Visibility . PUBLIC : esa . getVisibility ( ) ; if ( ! visibilityMatches . equals ( visibility ) ) { // Visibi... |
public class Jenkins { /** * Overwrites the existing item by new one .
* This is a short cut for deleting an existing job and adding a new one . */
public synchronized void putItem ( TopLevelItem item ) throws IOException , InterruptedException { } } | String name = item . getName ( ) ; TopLevelItem old = items . get ( name ) ; if ( old == item ) return ; // noop
checkPermission ( Item . CREATE ) ; if ( old != null ) old . delete ( ) ; items . put ( name , item ) ; ItemListener . fireOnCreated ( item ) ; |
public class EasyMockProvider { /** * Resets the given mock object and turns them to a mock with default
* behavior . For details , see the EasyMock documentation .
* @ param mock
* the mock object
* @ return the mock object */
@ SuppressWarnings ( "unchecked" ) public < X > X resetToDefault ( final Object mock... | EasyMock . resetToDefault ( mock ) ; return ( X ) mock ; |
public class BusItineraryHalt { /** * Replies the geo position .
* @ return the geo position . */
@ Pure public GeoLocationPoint getGeoPosition ( ) { } } | final Point2d p = getPosition2D ( ) ; if ( p != null ) { return new GeoLocationPoint ( p . getX ( ) , p . getY ( ) ) ; } return null ; |
public class AbstractSQLQuery { /** * Called to make the call back to listeners when an exception happens
* @ param context the current context in play
* @ param e the exception */
protected void onException ( SQLListenerContextImpl context , Exception e ) { } } | context . setException ( e ) ; listeners . exception ( context ) ; |
public class CollisionFindingServlet { /** * [ START createMapReduceSpec ] */
public static MapReduceSpecification < Long , Integer , Integer , ArrayList < Integer > , GoogleCloudStorageFileSet > createMapReduceSpec ( String bucket , long start , long limit , int shards ) { } } | ConsecutiveLongInput input = new ConsecutiveLongInput ( start , limit , shards ) ; Mapper < Long , Integer , Integer > mapper = new SeedToRandomMapper ( ) ; Marshaller < Integer > intermediateKeyMarshaller = Marshallers . getIntegerMarshaller ( ) ; Marshaller < Integer > intermediateValueMarshaller = Marshallers . getI... |
public class GroupedPriorityQueueLocking { public ITrackedQueue < E > getQueueByGroup ( G group ) { } } | lock . readLock ( ) . lock ( ) ; try { return this . queuesByGroup . get ( group ) ; } finally { lock . readLock ( ) . unlock ( ) ; } |
public class PropertyValues { /** * Return the property getter type */
Class < ? > getGetterPropertyType ( Clazz < ? > clazz , String name ) { } } | String getterName = "get" + capitalizeFirstLetter ( name ) ; Method getter = clazz . getMethod ( getterName ) ; if ( getter != null ) return getter . getReturnType ( ) ; // try direct field access
Field field = clazz . getAllField ( name ) ; if ( field != null ) return field . getType ( ) ; return null ; |
public class AbstractIntSet { /** * { @ inheritDoc } */
@ Override public int [ ] toArray ( int [ ] a ) { } } | if ( a . length < size ( ) ) a = new int [ size ( ) ] ; IntIterator itr = iterator ( ) ; int i = 0 ; while ( itr . hasNext ( ) ) a [ i ++ ] = itr . next ( ) ; for ( ; i < a . length ; i ++ ) a [ i ] = 0 ; return a ; |
public class CmsADEConfigData { /** * Returns the configuration for a specific resource type . < p >
* @ param typeName the name of the type
* @ return the resource type configuration for that type */
public CmsResourceTypeConfig getResourceType ( String typeName ) { } } | for ( CmsResourceTypeConfig type : getResourceTypes ( ) ) { if ( typeName . equals ( type . getTypeName ( ) ) ) { return type ; } } return null ; |
public class UserImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < OAuthAuthorizationCode > getOAuthAuthorizationCodes ( ) { } } | return ( EList < OAuthAuthorizationCode > ) eGet ( StorePackage . Literals . USER__OAUTH_AUTHORIZATION_CODES , true ) ; |
public class RunnersApi { /** * Register a new runner for the gitlab instance .
* < pre > < code > GitLab Endpoint : POST / runners / < / code > < / pre >
* @ param token the token of the project ( for project specific runners ) or the token from the admin page
* @ param description The description of a runner
... | GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "token" , token , true ) . withParam ( "description" , description , false ) . withParam ( "active" , active , false ) . withParam ( "locked" , locked , false ) . withParam ( "run_untagged" , runUntagged , false ) . withParam ( "tag_list" , tagList , false ) ... |
public class JsonBooleanDocument { /** * Creates a { @ link JsonBooleanDocument } which the document id and content .
* @ param id the per - bucket unique document id .
* @ param content the content of the document .
* @ return a { @ link JsonBooleanDocument } . */
public static JsonBooleanDocument create ( Strin... | return new JsonBooleanDocument ( id , 0 , content , 0 , null ) ; |
public class ChangeId { /** * As the part of the URL .
* @ return the url part . */
public String asUrlPart ( ) { } } | try { return encode ( projectName ) + "~" + encode ( branchName ) + "~" + id ; } catch ( UnsupportedEncodingException e ) { String parameter = projectName + "~" + branchName + "~" + id ; logger . error ( "Failed to encode ChangeId {}, falling back to unencoded {}" , this , parameter ) ; return parameter ; } |
public class WalkerState { /** * Resets the calendar */
private void resetCalendar ( ) { } } | _calendar = getCalendar ( ) ; if ( _defaultTimeZone != null ) { _calendar . setTimeZone ( _defaultTimeZone ) ; } _currentYear = _calendar . get ( Calendar . YEAR ) ; |
public class EntityStatisticsProcessor { /** * Prints and stores final result of the processing . This should be called
* after finishing the processing of a dump . It will print the statistics
* gathered during processing and it will write a CSV file with usage counts
* for every property . */
private void write... | // Print a final report :
printStatus ( ) ; // Store property counts in files :
writePropertyStatisticsToFile ( this . itemStatistics , "item-property-counts.csv" ) ; writePropertyStatisticsToFile ( this . propertyStatistics , "property-property-counts.csv" ) ; // Store site link statistics in file :
try ( PrintStream ... |
public class AnimatedModelComponent { /** * Only called for BLOCK and ITEM render type */
@ Override public void render ( Block block , MalisisRenderer < ? extends TileEntity > renderer ) { } } | if ( renderer . getRenderType ( ) == RenderType . BLOCK && animatedShapes . size ( ) != 0 ) onRender ( renderer . getWorldAccess ( ) , renderer . getPos ( ) , renderer . getBlockState ( ) ) ; model . resetState ( ) ; if ( renderer . getRenderType ( ) == RenderType . BLOCK ) model . rotate ( DirectionalComponent . getDi... |
public class CacheConfiguration { /** * 载入缓存配置
* @ param file 配置文件
* @ return 缓存配置
* @ throws IOException 配置文件读取异常 */
public static CacheConfiguration build ( File file ) throws IOException { } } | ConfigMap < String , String > config = ConfigMap . load ( file ) ; return CacheConfiguration . build ( config ) ; |
public class YggdrasilAuthenticator { /** * Creates a < code > YggdrasilAuthenticator < / code > with the given client
* token , and initializes it with password .
* @ param username the username
* @ param password the password
* @ param characterSelector the character selector
* @ param clientToken the clien... | return password ( username , password , characterSelector , clientToken , YggdrasilAuthenticationServiceBuilder . buildDefault ( ) ) ; |
public class S3ALowLevelOutputStream { /** * Executes the upload part request .
* @ param request the upload part request */
private void execUpload ( UploadPartRequest request ) { } } | File file = request . getFile ( ) ; ListenableFuture < PartETag > futureTag = mExecutor . submit ( ( Callable ) ( ) -> { PartETag partETag ; AmazonClientException lastException ; try { do { try { partETag = mClient . uploadPart ( request ) . getPartETag ( ) ; return partETag ; } catch ( AmazonClientException e ) { last... |
public class CmsElementUtil { /** * Checks if a group element is allowed in a container with a given type . < p >
* @ param containerType the container type spec ( comma separated )
* @ param groupContainer the group
* @ return true if the group is allowed in the container */
public static boolean checkGroupAllow... | return ! Sets . intersection ( CmsContainer . splitType ( containerType ) , groupContainer . getTypes ( ) ) . isEmpty ( ) ; |
public class DefaultAnnotationMetadata { /** * Registers annotation default values . Used by generated byte code . DO NOT REMOVE .
* @ param annotation The annotation name
* @ param defaultValues The default values */
@ SuppressWarnings ( "unused" ) @ Internal @ UsedByGeneratedCode protected static void registerAnn... | AnnotationMetadataSupport . registerDefaultValues ( annotation , defaultValues ) ; |
public class BigQuerySchemaMarshallerByType { /** * Parses the annotations on field and returns a populated { @ link TableFieldSchema } . */
private TableFieldSchema parseFieldAnnotations ( Field field ) { } } | TableFieldSchema tf = new TableFieldSchema ( ) ; String name = getFieldName ( field ) ; String desc = getFieldDescription ( field ) ; String fieldMode = getFieldMode ( field ) ; return tf . setName ( name ) . setDescription ( desc ) . setMode ( fieldMode ) ; |
public class SparseCpuLevel1 { /** * Adds a scalar multiple of float compressed sparse vector to a full - storage vector .
* @ param N The number of elements in vector X
* @ param alpha
* @ param X a sparse vector
* @ param pointers A DataBuffer that specifies the indices for the elements of x .
* @ param Y a... | cblas_saxpyi ( ( int ) N , ( float ) alpha , ( FloatPointer ) X . data ( ) . addressPointer ( ) , ( IntPointer ) pointers . addressPointer ( ) , ( FloatPointer ) Y . data ( ) . addressPointer ( ) ) ; |
public class inat { /** * Use this API to update inat . */
public static base_response update ( nitro_service client , inat resource ) throws Exception { } } | inat updateresource = new inat ( ) ; updateresource . name = resource . name ; updateresource . privateip = resource . privateip ; updateresource . tcpproxy = resource . tcpproxy ; updateresource . ftp = resource . ftp ; updateresource . tftp = resource . tftp ; updateresource . usip = resource . usip ; updateresource ... |
public class AbstractBaseJnlpMojo { /** * Removes the signature of the files in the specified directory which satisfy the
* specified filter .
* @ param workDirectory working directory used to unsign jars
* @ return the number of unsigned jars
* @ throws MojoExecutionException if could not remove signatures */
... | getLog ( ) . info ( "-- Remove existing signatures" ) ; // cleanup tempDir if exists
File tempDir = new File ( workDirectory , "temp_extracted_jars" ) ; ioUtil . removeDirectory ( tempDir ) ; // recreate temp dir
ioUtil . makeDirectoryIfNecessary ( tempDir ) ; // process jars
File [ ] jarFiles = workDirectory . listFil... |
public class LocalTokenGenerator { /** * Reads JWK into PrivateKEy instance
* @ param fileName Path to the JWK file
* @ return java . security . PrivateKey instance of JWK
* @ throws InvalidKeySpecException
* @ throws NoSuchAlgorithmException
* @ throws IOException
* @ throws NoSuchProviderException */
priv... | StringBuilder sb = new StringBuilder ( ) ; BufferedReader br = new BufferedReader ( new FileReader ( fileName ) ) ; try { char [ ] cbuf = new char [ 1024 ] ; for ( int i = 0 ; i <= 10 * 1024 ; i ++ ) { if ( ! br . ready ( ) ) break ; int len = br . read ( cbuf , i * 1024 , 1024 ) ; sb . append ( cbuf , 0 , len ) ; } if... |
public class WaveformFinder { /** * Ask the specified player for the specified waveform detail from the specified media slot , first checking if we
* have a cached copy .
* @ param dataReference uniquely identifies the desired waveform detail
* @ return the waveform detail , if it was found , or { @ code null }
... | ensureRunning ( ) ; for ( WaveformDetail cached : detailHotCache . values ( ) ) { if ( cached . dataReference . equals ( dataReference ) ) { // Found a hot cue hit , use it .
return cached ; } } return requestDetailInternal ( dataReference , false ) ; |
public class DescribeAutomationStepExecutionsResult { /** * A list of details about the current state of all steps that make up an execution .
* @ param stepExecutions
* A list of details about the current state of all steps that make up an execution . */
public void setStepExecutions ( java . util . Collection < S... | if ( stepExecutions == null ) { this . stepExecutions = null ; return ; } this . stepExecutions = new com . amazonaws . internal . SdkInternalList < StepExecution > ( stepExecutions ) ; |
public class RequireMavenVersion { /** * ( non - Javadoc )
* @ see org . apache . maven . enforcer . rule . api . EnforcerRule # execute ( org . apache . maven . enforcer . rule . api . EnforcerRuleHelper ) */
public void execute ( EnforcerRuleHelper helper ) throws EnforcerRuleException { } } | try { RuntimeInformation rti = ( RuntimeInformation ) helper . getComponent ( RuntimeInformation . class ) ; ArtifactVersion detectedMavenVersion = rti . getApplicationVersion ( ) ; helper . getLog ( ) . debug ( "Detected Maven Version: " + detectedMavenVersion ) ; enforceVersion ( helper . getLog ( ) , "Maven" , getVe... |
public class HashIntMap { /** * documentation inherited */
public void putAll ( IntMap < V > t ) { } } | // if we can , avoid creating Integer objects while copying
for ( IntEntry < V > entry : t . intEntrySet ( ) ) { put ( entry . getIntKey ( ) , entry . getValue ( ) ) ; } |
public class InferredNullability { /** * Get inferred nullness qualifier for an expression , if possible . */
public Optional < Nullness > getExprNullness ( ExpressionTree exprTree ) { } } | InferenceVariable iv = TypeArgInferenceVar . create ( ImmutableList . of ( ) , exprTree ) ; return constraintGraph . nodes ( ) . contains ( iv ) ? getNullness ( iv ) : Optional . empty ( ) ; |
public class CmsCmisUtil { /** * Helper method to add the dynamic properties for a resource . < p >
* @ param cms the current CMS context
* @ param typeManager the type manager instance
* @ param props the properties to which the dynamic properties should be added
* @ param typeId the type id
* @ param resour... | List < I_CmsPropertyProvider > providers = typeManager . getPropertyProviders ( ) ; for ( I_CmsPropertyProvider provider : providers ) { String propertyName = CmsCmisTypeManager . PROPERTY_PREFIX_DYNAMIC + provider . getName ( ) ; if ( ! checkAddProperty ( typeManager , props , typeId , filter , propertyName ) ) { cont... |
public class DefaultMobicentsCluster { /** * Method handle a change on the cluster members set
* @ param event */
@ ViewChanged public synchronized void onViewChangeEvent ( ViewChangedEvent event ) { } } | if ( logger . isDebugEnabled ( ) ) { logger . debug ( "onViewChangeEvent : pre[" + event . isPre ( ) + "] : event local address[" + event . getCache ( ) . getLocalAddress ( ) + "]" ) ; } final List < Address > oldView = currentView ; currentView = new ArrayList < Address > ( event . getNewView ( ) . getMembers ( ) ) ; ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.