signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Shape { /** * Returns true if the given array * is meant for the whole dimension * @ param arr the array to test * @ return true if arr . length = = 1 & & arr [ 0 ] is Integer . MAX _ VALUE */ public static boolean wholeArrayDimension ( int ... arr ) { } }
return arr == null || arr . length == 0 || ( arr . length == 1 && arr [ 0 ] == Integer . MAX_VALUE ) ;
public class CharSkippingBufferedString { /** * Converts the current window into byte buffer to a { @ link BufferedString } . The resulting new instance of { @ link BufferedString } * is backed by a newly allocated byte [ ] buffer sized exactly to fit the desired string represented by current buffer window , * excl...
if ( _skipped . length == 0 ) return _bufferedString ; byte [ ] buf = MemoryManager . malloc1 ( _bufferedString . _len - _skipped . length ) ; // Length of the buffer window minus skipped chars int copyStart = _bufferedString . _off ; int target = 0 ; for ( int skippedIndex : _skipped ) { for ( int i = copyStart ; i < ...
public class QueryUtil { /** * Crafts a regular expression for scanning over data table rows and filtering * time series that the user doesn ' t want . At least one of the parameters * must be set and have values . * NOTE : This method will sort the group bys . * @ param group _ bys An optional list of tag keys...
return getRowKeyUIDRegex ( group_bys , row_key_literals , false , null , null ) ;
public class MongoDBDataAccess { /** * queries with the given string , sorts the result and returns the first element . < code > null < / code > is returned if no element is found . * @ param query the query string * @ param sort the sort string * @ param params the parameters to replace # symbols * @ return th...
Find find = this . collection . find ( query , params ) ; if ( ( sort != null ) && ! sort . isEmpty ( ) ) { find . sort ( sort ) ; } Iterable < T > as = find . limit ( 1 ) . as ( this . entityClass ) ; Iterator < T > iterator = as . iterator ( ) ; if ( iterator . hasNext ( ) ) { return Optional . of ( iterator . next (...
public class ComputerVisionImpl { /** * This operation recognizes content within an image by applying a domain - specific model . The list of domain - specific models that are supported by the Computer Vision API can be retrieved using the / models GET request . Currently , the API only provides a single domain - speci...
return analyzeImageByDomainWithServiceResponseAsync ( model , url , analyzeImageByDomainOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class PostNameBuilder { /** * { @ inheritDoc } */ @ Override public PostName buildObject ( String namespaceURI , String localName , String namespacePrefix ) { } }
return new PostNameImpl ( namespaceURI , localName , namespacePrefix ) ;
public class UaaAuthorizationEndpoint { /** * This method handles / oauth / authorize calls when user is not logged in and the prompt = none param is used */ @ Override public void commence ( HttpServletRequest request , HttpServletResponse response , AuthenticationException authException ) throws IOException , Servlet...
String clientId = request . getParameter ( OAuth2Utils . CLIENT_ID ) ; String redirectUri = request . getParameter ( OAuth2Utils . REDIRECT_URI ) ; String [ ] responseTypes = ofNullable ( request . getParameter ( OAuth2Utils . RESPONSE_TYPE ) ) . map ( rt -> rt . split ( " " ) ) . orElse ( new String [ 0 ] ) ; ClientDe...
public class RubberLoaderView { /** * Sets loader prime and extra color . * @ param primeId Prime color resId * @ param extraId Extra color resId */ public void setPaletteRes ( @ ColorRes int primeId , @ ColorRes int extraId ) { } }
this . primeColor = ContextCompat . getColor ( getContext ( ) , primeId ) ; this . extraColor = ContextCompat . getColor ( getContext ( ) , extraId ) ; pathPaint . setColor ( primeColor ) ; gradient = null ;
public class MtasSolrComponentList { /** * ( non - Javadoc ) * @ see * mtas . solr . handler . component . util . MtasSolrComponent # modifyRequest ( org . apache * . solr . handler . component . ResponseBuilder , * org . apache . solr . handler . component . SearchComponent , * org . apache . solr . handler ...
if ( sreq . params . getBool ( MtasSolrSearchComponent . PARAM_MTAS , false ) && sreq . params . getBool ( PARAM_MTAS_LIST , false ) ) { // compute keys Set < String > keys = MtasSolrResultUtil . getIdsFromParameters ( rb . req . getParams ( ) , PARAM_MTAS_LIST ) ; if ( ( sreq . purpose & ShardRequest . PURPOSE_GET_TOP...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ResourcesType } { @ code > } } */ @ XmlElementDecl ( namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os" , name = "Resources" ) public JAXBElement < ResourcesType > createResources ( ResourcesType value ) { } }
return new JAXBElement < ResourcesType > ( _Resources_QNAME , ResourcesType . class , null , value ) ;
public class AttributeMappingRepositoryImpl { /** * Returns attributes for the source attribute names in the given entity . Ignores attribute names * for which no attribute exists in the source entity type due to ( see * https : / / github . com / molgenis / molgenis / issues / 8051 ) . * < p > package - private ...
List < Attribute > attributes ; String sourceAttributesString = attributeMappingEntity . getString ( SOURCE_ATTRIBUTES ) ; if ( sourceAttributesString != null ) { attributes = new ArrayList < > ( ) ; for ( String sourceAttributeStr : sourceAttributesString . split ( "," ) ) { Attribute sourceAttribute = sourceEntityTyp...
public class AttributeDataset { /** * Returns a dataset with selected columns . */ public AttributeDataset columns ( String ... cols ) { } }
Attribute [ ] attrs = new Attribute [ cols . length ] ; int [ ] index = new int [ cols . length ] ; for ( int k = 0 ; k < cols . length ; k ++ ) { for ( int j = 0 ; j < attributes . length ; j ++ ) { if ( attributes [ j ] . getName ( ) . equals ( cols [ k ] ) ) { index [ k ] = j ; attrs [ k ] = attributes [ j ] ; break...
public class FrameManager { /** * Initializes this frame manager and prepares it for operation . */ protected void init ( ManagedRoot root , MediaTimer timer ) { } }
_window = root . getWindow ( ) ; _root = root ; _root . init ( this ) ; _timer = timer ; // set up our custom repaint manager _repainter = new ActiveRepaintManager ( ( _root instanceof Component ) ? ( Component ) _root : _window ) ; RepaintManager . setCurrentManager ( _repainter ) ; // turn off double buffering for th...
public class CmsImportVersion5 { /** * Reads all file nodes plus their meta - information ( properties , ACL ) * from the < code > manifest . xml < / code > and imports them as Cms resources to the VFS . < p > * @ throws CmsImportExportException if something goes wrong */ @ SuppressWarnings ( "unchecked" ) protecte...
String source = null , destination = null , uuidstructure = null , uuidresource = null , userlastmodified = null , usercreated = null , flags = null , timestamp = null ; long datelastmodified = 0 , datecreated = 0 , datereleased = 0 , dateexpired = 0 ; List < Node > fileNodes = null , acentryNodes = null ; Element curr...
public class GenJsCodeVisitor { /** * Implementations for specific nodes . */ @ Override protected void visitSoyFileSetNode ( SoyFileSetNode node ) { } }
for ( SoyFileNode soyFile : node . getChildren ( ) ) { visit ( soyFile ) ; }
public class LineSegmentPath { /** * Computes the velocity at which the pathable will need to travel along this path such that * it will arrive at the destination in approximately the specified number of milliseconds . * Efforts are taken to get the pathable there as close to the desired time as possible , but * ...
// if we have only zero or one nodes , we don ' t have enough // information to compute our velocity int ncount = _nodes . size ( ) ; if ( ncount < 2 ) { log . warning ( "Requested to set duration of bogus path" , "path" , this , "duration" , millis ) ; return ; } // compute the total distance along our path float dist...
public class UserAPI { /** * 批量获取用户基本信息 * @ param access _ token access _ token * @ param langzh - CN * @ param openids 最多支持一次拉取100条 * @ return UserInfoList */ public static UserInfoList userInfoBatchget ( String access_token , String lang , List < String > openids ) { } }
return userInfoBatchget ( access_token , lang , openids , 0 ) ;
public class AbstractMessage { /** * / * ( non - Javadoc ) * @ see javax . jms . Message # setFloatProperty ( java . lang . String , float ) */ @ Override public final void setFloatProperty ( String name , float value ) throws JMSException { } }
setProperty ( name , new Float ( value ) ) ;
public class UUIDUtils { /** * Convert byte array into UUID . Byte array is a compact form of bits in UUID * @ param bytes Byte array to convert from * @ return UUID result */ public static UUID fromBytes ( byte [ ] bytes ) { } }
long mostBits = ByteUtils . readLong ( bytes , 0 ) ; long leastBits = 0 ; if ( bytes . length > 8 ) { leastBits = ByteUtils . readLong ( bytes , 8 ) ; } return new UUID ( mostBits , leastBits ) ;
public class ChatApi { /** * Send notification that the agent stopped typing * Send notification that the agent stopped typing to the other participants in the specified chat . * @ param id The ID of the chat interaction . ( required ) * @ param acceptData Request parameters . ( optional ) * @ return ApiRespons...
com . squareup . okhttp . Call call = sendTypingStoppedValidateBeforeCall ( id , acceptData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class CPDefinitionOptionValueRelUtil { /** * Returns the first cp definition option value rel in the ordered set where CPDefinitionOptionRelId = & # 63 ; . * @ param CPDefinitionOptionRelId the cp definition option rel ID * @ param orderByComparator the comparator to order the set by ( optionally < code > nu...
return getPersistence ( ) . findByCPDefinitionOptionRelId_First ( CPDefinitionOptionRelId , orderByComparator ) ;
public class MolecularFormulaGenerator { /** * Decides wheter to use the round robin algorithm or full enumeration algorithm . * The round robin implementation here is optimized for chemical elements in organic compounds . It gets slow * if * - the mass of the smallest element is very large ( i . e . hydrogen is ...
// when the number of integers to decompose is incredible large // we have to adjust the internal settings ( e . g . precision ! ) // instead we simply fallback to the full enumeration method if ( maxMass - minMass >= 1 ) return true ; if ( maxMass > 400000 ) return true ; // if the number of elements to decompose is v...
public class Activator { /** * Track JSPs . * @ param bundleContext the BundleContext associated with this bundle */ private void trackJspMappings ( final BundleContext bundleContext ) { } }
final ServiceTracker < JspMapping , JspWebElement > jspMappingTracker = JspMappingTracker . createTracker ( extenderContext , bundleContext ) ; jspMappingTracker . open ( ) ; trackers . add ( 0 , jspMappingTracker ) ;
public class BucketImpl { /** * Return the index of the element with the specified key */ private int findIndexByKey ( Object key ) { } }
// Traverse the vector from the back . Given proper locking done at // a higher level , this will ensure that the cache gets to the same // element in the presence of duplicates . // Traversing the vector from the first element causes a problem since // elements are inserted at the end of the vector ( for efficiency ) ...
public class Spies { /** * Monitors calls to a predicate . * @ param < T > the predicate parameter type * @ param predicate the predicate that will be monitored * @ param calls a value holder accumulating calls * @ return the proxied predicate */ public static < T > Predicate < T > monitor ( Predicate < T > pre...
return new MonitoringPredicate < T > ( predicate , calls ) ;
public class JaasCallbackHandler { /** * CallbackHandler Method */ public void handle ( Callback [ ] callbacks ) throws IOException , UnsupportedCallbackException { } }
if ( callbacks . length == 1 && callbacks [ 0 ] instanceof AuthorizeCallback ) { AuthorizeCallback acb = ( AuthorizeCallback ) callbacks [ 0 ] ; boolean authorized = acb . getAuthenticationID ( ) . equals ( acb . getAuthorizationID ( ) ) ; if ( authorized == false ) { SECURITY_LOGGER . tracef ( "Checking 'AuthorizeCall...
public class AndPermission { /** * Some privileges permanently disabled , may need to set up in the execute . * @ param fragment { @ link Fragment } . * @ param deniedPermissions one or more permissions . * @ return true , other wise is false . */ public static boolean hasAlwaysDeniedPermission ( Fragment fragmen...
return hasAlwaysDeniedPermission ( new XFragmentSource ( fragment ) , deniedPermissions ) ;
public class DTMDocumentImpl { /** * Get the depth level of this node in the tree ( equals 1 for * a parentless node ) . * @ param nodeHandle The node id . * @ return the number of ancestors , plus one * @ xsl . usage internal */ public short getLevel ( int nodeHandle ) { } }
short count = 0 ; while ( nodeHandle != 0 ) { count ++ ; nodeHandle = nodes . readEntry ( nodeHandle , 1 ) ; } return count ;
public class SessionStateEventDispatcher { /** * Method sessionUserNameSet * @ see com . ibm . wsspi . session . ISessionStateObserver # sessionUserNameSet ( com . ibm . wsspi . session . ISession , java . lang . String , java . lang . String ) */ public void sessionUserNameSet ( ISession session , String oldUserName...
// ArrayList sessionStateObservers = null ; /* * Check to see if there is a non - empty list of sessionStateObservers . */ if ( _sessionStateObservers == null || _sessionStateObservers . size ( ) < 1 ) { return ; } // synchronized ( _ sessionStateObservers ) { // sessionStateObservers = ( ArrayList ) _ sessionStateObse...
public class SuggestedFix { /** * { @ link Builder # replace ( Tree , String ) } */ public static SuggestedFix replace ( Tree tree , String replaceWith ) { } }
return builder ( ) . replace ( tree , replaceWith ) . build ( ) ;
public class Meter { /** * Gets the mean throughput . * @ return the mean throughput */ public double getMeanThp ( ) { } }
if ( getCount ( ) == 0 ) { return 0.0 ; } else { final double elapsed = getTick ( ) - startTime ; return getCount ( ) / elapsed * TimeUnit . SECONDS . toNanos ( 1 ) ; }
public class TextElement { /** * Only sends the given keystroke * @ param key the Keys to put into the text area */ public void pressKey ( final String key ) { } }
if ( key == null ) return ; runWithRetries ( ( ) -> { elementImpl . locateElement ( ) . sendKeys ( key ) ; } ) ;
public class SipServerService { /** * { @ inheritDoc } */ public synchronized void start ( StartContext context ) throws StartException { } }
// FIXME : kakonyii // if ( org . apache . tomcat . util . Constants . ENABLE _ MODELER ) { // Set the MBeanServer final MBeanServer mbeanServer = this . mbeanServer . getOptionalValue ( ) ; if ( mbeanServer != null ) { // Registry . getRegistry ( null , null ) . setMBeanServer ( mbeanServer ) ; } System . setProperty ...
public class PreferencesHelper { /** * Retrieves strings array stored as single string . * Uses { @ link # DEFAULT _ DELIMITER } as delimiter . */ @ Nullable public static String [ ] getStringArray ( @ NonNull SharedPreferences prefs , @ NonNull String key ) { } }
return getStringArray ( prefs , key , DEFAULT_DELIMITER ) ;
public class DoubleStreamEx { /** * Returns a stream consisting of the elements of this stream sorted * according to the given comparator . Stream elements are boxed before * passing to the comparator . * For ordered streams , the sort is stable . For unordered streams , no * stability guarantees are made . *...
return new DoubleStreamEx ( stream ( ) . boxed ( ) . sorted ( comparator ) . mapToDouble ( Double :: doubleValue ) , context ) ;
public class AWSRoboMakerClient { /** * Returns a list of deployment jobs for a fleet . You can optionally provide filters to retrieve specific deployment * jobs . * < note > * < / note > * @ param listDeploymentJobsRequest * @ return Result of the ListDeploymentJobs operation returned by the service . * @ ...
request = beforeClientExecution ( request ) ; return executeListDeploymentJobs ( request ) ;
public class Try { /** * Static factory method for creating a failure value . * @ param t the wrapped { @ link Throwable } * @ param < T > the failure parameter type * @ param < A > the success parameter type * @ return a failure value of t */ public static < T extends Throwable , A > Try < T , A > failure ( T ...
return new Failure < > ( t ) ;
public class Request { /** * Sets a header per - request * @ param key Header key * @ param value Header value * @ return The request itself */ public Request header ( String key , String value ) { } }
this . headers . put ( key , value ) ; return this ;
public class AbstractDraweeControllerBuilder { /** * Creates a data source supplier for the given image request . */ protected Supplier < DataSource < IMAGE > > getDataSourceSupplierForRequest ( final DraweeController controller , final String controllerId , final REQUEST imageRequest , final CacheLevel cacheLevel ) { ...
final Object callerContext = getCallerContext ( ) ; return new Supplier < DataSource < IMAGE > > ( ) { @ Override public DataSource < IMAGE > get ( ) { return getDataSourceForRequest ( controller , controllerId , imageRequest , callerContext , cacheLevel ) ; } @ Override public String toString ( ) { return Objects . to...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getRenderingIntentOCRI ( ) { } }
if ( renderingIntentOCRIEEnum == null ) { renderingIntentOCRIEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 182 ) ; } return renderingIntentOCRIEEnum ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */ @ XmlElementDecl...
return new JAXBElement < Object > ( __GenericApplicationPropertyOfBuildingInstallation_QNAME , Object . class , null , value ) ;
public class StringTools { /** * Adds spaces before words that are not punctuation . * @ param word Word to add the preceding space . * @ param language * Language of the word ( to check typography conventions ) . Currently * French convention of not adding spaces only before ' . ' and ' , ' is * implemented ...
String space = " " ; if ( word . length ( ) == 1 ) { char c = word . charAt ( 0 ) ; if ( "fr" . equals ( language . getShortCode ( ) ) ) { if ( c == '.' || c == ',' ) { space = "" ; } } else { if ( c == '.' || c == ',' || c == ';' || c == ':' || c == '?' || c == '!' ) { space = "" ; } } } return space ;
public class JsonWebKey { /** * Get the y value . * @ return the y value */ @ JsonProperty ( "y" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] y ( ) { } }
return ByteExtensions . clone ( this . y ) ;
public class DateTimeUtil { /** * Get Date from " yyyyMMddThhmmssZ " * @ param val String " yyyyMMddThhmmssZ " * @ return Date * @ throws BadDateException on format error */ public static Date fromISODateTimeUTC ( final String val ) throws BadDateException { } }
try { synchronized ( isoDateTimeUTCFormat ) { return isoDateTimeUTCFormat . parse ( val ) ; } } catch ( Throwable t ) { throw new BadDateException ( ) ; }
public class ExtensionFeedItem { /** * Sets the geoTargeting value for this ExtensionFeedItem . * @ param geoTargeting * Geo targeting specifies what locations this extension can serve * with . * On update , if the field is left unspecified , the previous * geo targeting state will not * be changed . * On u...
this . geoTargeting = geoTargeting ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getObjectCount ( ) { } }
if ( objectCountEClass == null ) { objectCountEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 513 ) ; } return objectCountEClass ;
public class CmsXmlContentEditor { /** * Performs the change element language action of the editor . < p > */ public void actionChangeElementLanguage ( ) { } }
// save eventually changed content of the editor Locale oldLocale = CmsLocaleManager . getLocale ( getParamOldelementlanguage ( ) ) ; Locale newLocale = getElementLocale ( ) ; try { setEditorValues ( oldLocale ) ; if ( ! m_content . validate ( getCms ( ) ) . hasErrors ( oldLocale ) ) { // no errors found in content if ...
public class UpdateFlowSourceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateFlowSourceRequest updateFlowSourceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateFlowSourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateFlowSourceRequest . getDecryption ( ) , DECRYPTION_BINDING ) ; protocolMarshaller . marshall ( updateFlowSourceRequest . getDescription ( ) , DESCRIPTION_B...
public class StaticTypeCheckingVisitor { /** * / it seems attractive to want to do this for more cases but perhaps not all cases */ private ClassNode checkForTargetType ( final Expression expr , final ClassNode type ) { } }
BinaryExpression enclosingBinaryExpression = typeCheckingContext . getEnclosingBinaryExpression ( ) ; if ( enclosingBinaryExpression instanceof DeclarationExpression && isEmptyCollection ( expr ) && isAssignment ( enclosingBinaryExpression . getOperation ( ) . getType ( ) ) ) { VariableExpression target = ( VariableExp...
public class ModelAdapter { /** * allows you to define your own Filter implementation instead of the default ` ItemFilter ` * @ param itemFilter the filter to use * @ return this */ public ModelAdapter < Model , Item > withItemFilter ( ItemFilter < Model , Item > itemFilter ) { } }
this . mItemFilter = itemFilter ; return this ;
public class CaptchaWriterInterceptor { /** * { @ inheritDoc } */ @ Override public void aroundWriteTo ( WriterInterceptorContext context ) throws IOException , WebApplicationException { } }
Object entity = context . getEntity ( ) ; if ( entity instanceof Images . Captcha || entity instanceof Captcha ) { context . setMediaType ( IMG_TYPE ) ; context . getHeaders ( ) . putSingle ( HttpHeaders . CONTENT_TYPE , IMG_TYPE ) ; if ( entity instanceof Captcha ) { Captcha captcha = ( Captcha ) entity ; context . se...
public class ValueFileIOHelper { /** * Copy input to output data using NIO . * @ param in * InputStream * @ param out * OutputStream * @ return The number of bytes , possibly zero , that were actually copied * @ throws IOException * if error occurs */ protected long copy ( InputStream in , OutputStream ou...
// compare classes as in Java6 Channels . newChannel ( ) , Java5 has a bug in newChannel ( ) . boolean inFile = in instanceof FileInputStream && FileInputStream . class . equals ( in . getClass ( ) ) ; boolean outFile = out instanceof FileOutputStream && FileOutputStream . class . equals ( out . getClass ( ) ) ; if ( i...
public class AdaptiveGrid { /** * Decreases the number of solutions into a specific hypercube . * @ param location Number of hypercube . */ public void removeSolution ( int location ) { } }
// Decrease the solutions in the location specified . hypercubes [ location ] -- ; // Update the most populated hypercube if ( location == mostPopulatedHypercube ) { for ( int i = 0 ; i < hypercubes . length ; i ++ ) { if ( hypercubes [ i ] > hypercubes [ mostPopulatedHypercube ] ) { mostPopulatedHypercube = i ; } } } ...
public class FallbackContextStore { /** * DS method to activate this component . * @ param compcontext */ protected void activate ( ComponentContext compcontext ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Activating " + this . getClass ( ) . getName ( ) ) ; } this . unauthenticatedSubjectServiceRef . activate ( compcontext ) ;
public class BundleUtils { /** * Returns a optional char array value . In other words , returns the value mapped by key if it exists and is a char array . * The bundle argument is allowed to be { @ code null } . If the bundle is null , this method returns null . * @ param bundle a bundle . If the bundle is null , t...
if ( bundle == null ) { return fallback ; } return bundle . getCharArray ( key ) ;
public class Rythm { /** * Prepare the render operation environment settings * @ param codeType * @ param locale * @ param usrCtx * @ return the engine instance itself */ public final RythmEngine prepare ( ICodeType codeType , Locale locale , Map < String , Object > usrCtx ) { } }
return engine ( ) . prepare ( codeType , locale , usrCtx ) ;
public class CharOperation { /** * Answers the first index in the array for which the toBeFound array is a matching subarray following the case rule * starting at the index start . Answers - 1 if no match is found . < br > * < br > * For example : * < ol > * < li > * < pre > * toBeFound = { ' c ' } * ar...
return indexOf ( toBeFound , array , isCaseSensitive , start , array . length ) ;
public class ESHttpMarshaller { /** * Creates a single " application / vnd . eventstore . events ( + json / + xml ) " entry surrounded by " [ ] " ( JSON ) or * " & lt ; Events & gt ; & lt ; / Events & gt ; " ( XML ) . * @ param registry * Registry with known serializers . * @ param commonEvent * Event to mars...
Contract . requireArgNotNull ( "registry" , registry ) ; Contract . requireArgNotNull ( "commonEvent" , commonEvent ) ; final Serializer serializer = registry . getSerializer ( EscEvent . SER_TYPE ) ; final EscEvent event = createEscEvent ( registry , serializer . getMimeType ( ) , commonEvent ) ; final byte [ ] data =...
public class PendingMerge { /** * Seals this PendingMerge instance and returns a list of all the registered FutureReadResultEntries associated with it . * After this method returns , all calls to register ( ) will return false . * @ return A List of all the registered FutureReadResultEntries recorded . */ synchroni...
this . sealed = true ; List < FutureReadResultEntry > result = new ArrayList < > ( this . reads ) ; this . reads . clear ( ) ; return result ;
public class Items { /** * Returns all the registered { @ link TopLevelItemDescriptor } s that the specified security principal is allowed to * create within the specified item group . * @ since 1.607 */ public static List < TopLevelItemDescriptor > all ( Authentication a , ItemGroup c ) { } }
List < TopLevelItemDescriptor > result = new ArrayList < > ( ) ; ACL acl ; if ( c instanceof AccessControlled ) { acl = ( ( AccessControlled ) c ) . getACL ( ) ; } else { // fall back to root acl = Jenkins . getInstance ( ) . getACL ( ) ; } for ( TopLevelItemDescriptor d : all ( ) ) { if ( acl . hasCreatePermission ( a...
public class SearchResult { /** * The requested field statistics information . * @ param stats * The requested field statistics information . * @ return Returns a reference to this object so that method calls can be chained together . */ public SearchResult withStats ( java . util . Map < String , FieldStats > st...
setStats ( stats ) ; return this ;
public class CatalogDiffEngine { /** * Check if there is a unique index that exists in the old catalog * that is covered by the new index . That would mean adding this index * can ' t fail with a duplicate key . * @ param newIndex The new index to check . * @ return True if the index can be created without a ch...
Table table = ( Table ) newIndex . getParent ( ) ; CatalogMap < Index > existingIndexes = m_originalIndexesByTable . get ( table . getTypeName ( ) ) ; for ( Index existingIndex : existingIndexes ) { if ( indexCovers ( newIndex , existingIndex ) ) { return true ; } } return false ;
public class StartDocumentAnalysisRequest { /** * A list of the types of analysis to perform . Add TABLES to the list to return information about the tables that * are detected in the input document . Add FORMS to return detected fields and the associated text . To perform both * types of analysis , add TABLES and ...
java . util . ArrayList < String > featureTypesCopy = new java . util . ArrayList < String > ( featureTypes . length ) ; for ( FeatureType value : featureTypes ) { featureTypesCopy . add ( value . toString ( ) ) ; } if ( getFeatureTypes ( ) == null ) { setFeatureTypes ( featureTypesCopy ) ; } else { getFeatureTypes ( )...
public class IndexCommitBuilder { /** * Marks the given object for insertion in the commit . * @ param object a OpenEngSBModel instance * @ return this for chaining */ public IndexCommitBuilder insert ( Object object ) { } }
updateModelClassSet ( object ) ; getInsertList ( object . getClass ( ) ) . add ( ( OpenEngSBModel ) object ) ; return this ;
public class StringDimensionHandler { /** * Value for absent column , i . e . { @ link NilColumnValueSelector } , should be equivalent to [ null ] during index merging . * During index merging , if one of the merged indexes has absent columns , { @ link StringDimensionMergerV9 } ensures * that null value is present...
if ( s instanceof DimensionSelector ) { return ( ( DimensionSelector ) s ) . getRow ( ) ; } else if ( s instanceof NilColumnValueSelector ) { return ZeroIndexedInts . instance ( ) ; } else { throw new ISE ( "ColumnValueSelector[%s], only DimensionSelector or NilColumnValueSelector is supported" , s . getClass ( ) ) ; }
public class IndexQueryBuilder { public IndexQueryBuilder setIndex ( String indexName ) { } }
Preconditions . checkArgument ( StringUtils . isNotBlank ( indexName ) ) ; this . indexName = indexName ; return this ;
public class SignalUtil { /** * Implements the same semantics as { @ link CompletionService # take ( ) } , except that the wait will * periodically time out within this method to log a warning message that the thread appears * stuck . This cycle will be repeated until a { @ link Future } is obtained . If the thread...
final String sourceMethod = "take" ; // $ NON - NLS - 1 $ final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { Thread . currentThread ( ) , cs , callerClass , callerMethod , args } ) ; } long start = System . currentTi...
public class ObserverQueue { /** * ( non - Javadoc ) * @ see java . lang . Runnable # run ( ) */ public void run ( ) { } }
while ( true ) { Object obj ; try { obj = messages . take ( ) ; notifySubscribers ( obj ) ; } catch ( InterruptedException e ) { // restore interrupted status Thread . currentThread ( ) . interrupt ( ) ; } }
public class LDAPQuery { /** * Sets the names of the attributes to extract for each returned entity . * @ param attributes * the names of the attributes to extract for each returned entity . * @ return * the object itself , for method chaining . */ public LDAPQuery setAttributes ( String ... attributes ) { } }
if ( attributes != null && attributes . length > 0 ) { this . attributes = attributes ; } else { this . attributes = ALL_ATTRIBUTES ; } return this ;
public class CommandLine { /** * Retrieve any left - over non - recognized options and arguments * @ return remaining items passed in but not parsed as an array */ public String [ ] getArgs ( ) { } }
String [ ] answer = new String [ args . size ( ) ] ; args . toArray ( answer ) ; return answer ;
public class JZUtils { /** * Get AppCompatActivity from context * @ param context context * @ return AppCompatActivity if it ' s not null */ public static AppCompatActivity getAppCompActivity ( Context context ) { } }
if ( context == null ) return null ; if ( context instanceof AppCompatActivity ) { return ( AppCompatActivity ) context ; } else if ( context instanceof ContextThemeWrapper ) { return getAppCompActivity ( ( ( ContextThemeWrapper ) context ) . getBaseContext ( ) ) ; } return null ;
public class OWLObjectPropertyRangeAxiomImpl_CustomFieldSerializer { /** * Serializes the content of the object into the * { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } . * @ param streamWriter the { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } to w...
serialize ( streamWriter , instance ) ;
public class JDBCUtils { /** * Opens a JDBC connection with the given parameters . */ public static Statement open ( String driverklass , String jdbcuri , Properties props ) { } }
try { Driver driver = ( Driver ) ObjectUtils . instantiate ( driverklass ) ; Connection conn = driver . connect ( jdbcuri , props ) ; if ( conn == null ) throw new DukeException ( "Couldn't connect to database at " + jdbcuri ) ; return conn . createStatement ( ) ; } catch ( SQLException e ) { throw new DukeException ( ...
public class PreciseDurationDateTimeField { /** * This method assumes that this field is properly rounded on * 1970-01-01T00:00:00 . If the rounding alignment differs , override this * method as follows : * < pre > * return super . roundFloor ( instant + ALIGNMENT _ MILLIS ) - ALIGNMENT _ MILLIS ; * < / pre >...
if ( instant >= 0 ) { return instant - instant % iUnitMillis ; } else { instant += 1 ; return instant - instant % iUnitMillis - iUnitMillis ; }
public class AbstractTaskStateTracker { /** * Schedule a { @ link TaskMetricsUpdater } . * @ param taskMetricsUpdater the { @ link TaskMetricsUpdater } to schedule * @ param task the { @ link Task } that the { @ link TaskMetricsUpdater } is associated to * @ return a { @ link java . util . concurrent . ScheduledF...
return this . taskMetricsUpdaterExecutor . scheduleAtFixedRate ( taskMetricsUpdater , task . getTaskContext ( ) . getStatusReportingInterval ( ) , task . getTaskContext ( ) . getStatusReportingInterval ( ) , TimeUnit . MILLISECONDS ) ;
public class JCusparse { /** * Description : Gather of non - zero elements from dense vector y into * sparse vector x . */ public static int cusparseSgthr ( cusparseHandle handle , int nnz , Pointer y , Pointer xVal , Pointer xInd , int idxBase ) { } }
return checkResult ( cusparseSgthrNative ( handle , nnz , y , xVal , xInd , idxBase ) ) ;
public class TSSubQuery { /** * Make sure the parameters for histogram query are valid . * < ul > * < li > aggregation function : only NONE and SUM supported < / li > * < li > aggregation function in downsampling : only SUM supported < / li > * < li > percentile : only in rage ( 0,100 ) < / li > * < / ul > */...
if ( ! isHistogramQuery ( ) ) { return ; } // only support NONE and SUM if ( agg != null && agg != Aggregators . NONE && agg != Aggregators . SUM ) { throw new IllegalArgumentException ( "Only NONE or SUM aggregation function supported for histogram query" ) ; } // only support SUM in downsampling if ( DownsamplingSpec...
public class MonetaryFormat { /** * Set character to use as the decimal mark . If the formatted value does not have any decimals , no decimal mark is * used either . */ public MonetaryFormat decimalMark ( char decimalMark ) { } }
checkArgument ( ! Character . isDigit ( decimalMark ) ) ; checkArgument ( decimalMark > 0 ) ; if ( decimalMark == this . decimalMark ) return this ; else return new MonetaryFormat ( negativeSign , positiveSign , zeroDigit , decimalMark , minDecimals , decimalGroups , shift , roundingMode , codes , codeSeparator , codeP...
public class Line { /** * Checks for a valid HTML block . Sets < code > xmlEndLine < / code > . * @ return < code > true < / code > if it is a valid block . */ private boolean checkHTML ( ) { } }
final LinkedList < String > tags = new LinkedList < String > ( ) ; final StringBuilder temp = new StringBuilder ( ) ; int pos = this . leading ; if ( this . value . charAt ( this . leading + 1 ) == '!' ) { if ( this . readXMLComment ( this , this . leading ) > 0 ) { return true ; } } pos = Utils . readXML ( temp , this...
public class PlanAssembler { /** * Push the given aggregate if the plan is distributed , then add the * coordinator node on top of the send / receive pair . If the plan * is not distributed , or coordNode is not provided , the distNode * is added at the top of the plan . * Note : this works in part because the ...
AggregatePlanNode rootAggNode ; // remember that coordinating aggregation has a pushed - down // counterpart deeper in the plan . this allows other operators // to be pushed down past the receive as well . if ( coordNode != null ) { coordNode . m_isCoordinatingAggregator = true ; } /* * Push this node down to partition...
public class MessageItem { /** * Set the maximum storage strategy permitted */ public void setMaxStorageStrategy ( int requestedMaxStrategy ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setMaxStorageStrategy" , Integer . valueOf ( requestedMaxStrategy ) ) ; maxStorageStrategy = requestedMaxStrategy ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc ...
public class ClientBehaviorContext { /** * < p class = " changed _ added _ 2_0 " > Creates a ClientBehaviorContext instance . < / p > * @ param context the < code > FacesContext < / code > for the current request . * @ param component the component instance to which the * < code > ClientBehavior < / code > is att...
return new ClientBehaviorContextImpl ( context , component , eventName , sourceId , parameters ) ;
public class SerializerIntrinsics { /** * Round Scalar DP - FP Values ( SSE4.1 ) . */ public final void roundsd ( XMMRegister dst , XMMRegister src , Immediate imm8 ) { } }
emitX86 ( INST_ROUNDSD , dst , src , imm8 ) ;
public class RandomUtil { /** * Creates a random string consisting of lowercase letters . * @ param minLength minimum length of String to create . * @ param maxLength maximum length ( non inclusive ) of String to create . * @ return lowercase letters . */ public String randomLowerMaxLength ( int minLength , int m...
int range = maxLength - minLength ; int randomLength = 0 ; if ( range > 0 ) { randomLength = random ( range ) ; } return randomLower ( minLength + randomLength ) ;
public class BatchDeleteConnectionRequest { /** * A list of names of the connections to delete . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setConnectionNameList ( java . util . Collection ) } or { @ link # withConnectionNameList ( java . util . Collecti...
if ( this . connectionNameList == null ) { setConnectionNameList ( new java . util . ArrayList < String > ( connectionNameList . length ) ) ; } for ( String ele : connectionNameList ) { this . connectionNameList . add ( ele ) ; } return this ;
public class SipSessionImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . SipSession # setAttribute ( java . lang . String , java . lang . Object ) */ public void setAttribute ( String key , Object attribute ) { } }
if ( ! isValid ( ) ) { throw new IllegalStateException ( "Can not bind object to session that has been invalidated!!" ) ; } if ( key == null ) { throw new NullPointerException ( "Name of attribute to bind cant be null!!!" ) ; } if ( attribute == null ) { throw new NullPointerException ( "Attribute that is to be bound c...
public class Period { /** * Returns a new period with the specified number of days . * This period instance is immutable and unaffected by this method call . * @ param days the amount of days to add , may be negative * @ return the new period with the increased days * @ throws UnsupportedOperationException if t...
int [ ] values = getValues ( ) ; // cloned getPeriodType ( ) . setIndexedField ( this , PeriodType . DAY_INDEX , values , days ) ; return new Period ( values , getPeriodType ( ) ) ;
public class AbstractBundleLinkRenderer { /** * Adds an HTML comment to the output stream . * @ param commentText * the comment * @ param out * Writer * @ throws IOException * if an IO exception occurs */ protected void addComment ( String commentText , Writer out ) throws IOException { } }
StringBuilder sb = new StringBuilder ( "<script type=\"text/javascript\">/* " ) ; sb . append ( commentText ) . append ( " */</script>" ) . append ( "\n" ) ; out . write ( sb . toString ( ) ) ;
public class Combinations { /** * Initialize with a new list and bucket size * @ param list List which is to be symbols * @ param bucketSize Size of the bucket */ public void init ( List < T > list , int bucketSize ) { } }
if ( list . size ( ) < bucketSize ) { throw new RuntimeException ( "There needs to be more than or equal to elements in the 'list' that there are in the bucket" ) ; } this . k = bucketSize ; this . c = bucketSize - 1 ; N = list . size ( ) ; bins = new int [ bucketSize ] ; for ( int i = 0 ; i < bins . length ; i ++ ) { ...
public class TypeCache { /** * Finds an existing type or inserts a new one if the previous type was not found . * @ param classLoader The class loader for which this type is stored . * @ param key The key for the type in question . * @ param lazy A lazy creator for the type to insert of no previous type was store...
Class < ? > type = find ( classLoader , key ) ; if ( type != null ) { return type ; } else { try { return insert ( classLoader , key , lazy . call ( ) ) ; } catch ( Throwable throwable ) { throw new IllegalArgumentException ( "Could not create type" , throwable ) ; } }
public class CreateSnapshotTaskRunner { /** * Constructs the contents of a properties file given a set of * key / value pairs * @ param props snapshot properties * @ return Properties - file formatted key / value pairs */ protected String buildSnapshotProps ( Map < String , String > props ) { } }
Properties snapshotProperties = new Properties ( ) ; for ( String key : props . keySet ( ) ) { snapshotProperties . setProperty ( key , props . get ( key ) ) ; } StringWriter writer = new StringWriter ( ) ; try { snapshotProperties . store ( writer , null ) ; } catch ( IOException e ) { throw new TaskException ( "Could...
public class HttpResponse { /** * 将对象数组用Map的形式以JSON格式输出 < br > * 例如 : finishMap ( " a " , 2 , " b " , 3 ) 输出结果为 { " a " : 2 , " b " : 3} * @ param convert 指定的JsonConvert * @ param objs 输出对象 */ public void finishMapJson ( final JsonConvert convert , final Object ... objs ) { } }
this . contentType = this . jsonContentType ; if ( this . recycleListener != null ) this . output = objs ; finish ( convert . convertMapTo ( getBodyBufferSupplier ( ) , objs ) ) ;
public class ViewDragHelper { /** * Check if any of the edges specified were initially touched in the currently active gesture . * If there is no currently active gesture this method will return false . * @ param edges Edges to check for an initial edge touch . See { @ link # EDGE _ LEFT } , * { @ link # EDGE _ T...
final int count = mInitialEdgesTouched . length ; for ( int i = 0 ; i < count ; i ++ ) { if ( isEdgeTouched ( edges , i ) ) { return true ; } } return false ;
public class Component { /** * Convenience method for retrieving a list of named properties . * @ param name name of properties to retrieve * @ return a property list containing only properties with the specified name */ public final < C extends Property > PropertyList < C > getProperties ( final String name ) { } ...
return getProperties ( ) . getProperties ( name ) ;
public class ScaleRoundedOperator { /** * Creates the rounded Operator from scale and roundingMode * @ param scale the scale to be used * @ param roundingMode the rounding mode to be used * @ return the { @ link MonetaryOperator } using the scale and { @ link RoundingMode } used in parameter * @ throws NullPoin...
Objects . requireNonNull ( roundingMode ) ; if ( RoundingMode . UNNECESSARY . equals ( roundingMode ) ) { throw new IllegalStateException ( "To create the ScaleRoundedOperator you cannot use the RoundingMode.UNNECESSARY" ) ; } return new ScaleRoundedOperator ( scale , roundingMode ) ;
public class CloudStorageFileSystemProvider { /** * Convenience method : replaces spaces with " % 20 " , builds a URI , and calls getPath ( uri ) . */ public CloudStoragePath getPath ( String uriInStringForm ) { } }
String escaped = UrlEscapers . urlFragmentEscaper ( ) . escape ( uriInStringForm ) ; return getPath ( URI . create ( escaped ) ) ;
public class JsonActionInvocation { /** * Uses getResult to get the final Result and executes it * @ throws ConfigurationException * If not result can be found with the returned code */ private void executeResult ( ) throws Exception { } }
result = createResult ( ) ; String timerKey = "executeResult: " + getResultCode ( ) ; try { UtilTimerStack . push ( timerKey ) ; if ( result != null ) { result . execute ( this ) ; } else if ( resultCode != null && ! Action . NONE . equals ( resultCode ) ) { throw new ConfigurationException ( "No result defined for act...
public class Sheet { /** * Convert to PF SortOrder enum since we are leveraging PF sorting code . * @ return */ protected SortOrder convertSortOrder ( ) { } }
final String sortOrder = getSortOrder ( ) ; if ( sortOrder == null ) { return SortOrder . UNSORTED ; } else { final SortOrder result = SortOrder . valueOf ( sortOrder . toUpperCase ( Locale . ENGLISH ) ) ; return result ; }
public class Whitelist { /** * Remove a list of allowed attributes from a tag . ( If an attribute is not allowed on an element , it will be removed . ) * E . g . : < code > removeAttributes ( " a " , " href " , " class " ) < / code > disallows < code > href < / code > and < code > class < / code > * attributes on <...
Validate . notEmpty ( tag ) ; Validate . notNull ( attributes ) ; Validate . isTrue ( attributes . length > 0 , "No attribute names supplied." ) ; TagName tagName = TagName . valueOf ( tag ) ; Set < AttributeKey > attributeSet = new HashSet < > ( ) ; for ( String key : attributes ) { Validate . notEmpty ( key ) ; attri...
public class CachedXPathAPI { /** * Use an XPath string to select a single node . XPath namespace * prefixes are resolved from the context node , which may not * be what you want ( see the next method ) . * @ param contextNode The node to start searching from . * @ param str A valid XPath string . * @ return ...
return selectSingleNode ( contextNode , str , contextNode ) ;