signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TreeMap { /** * Determines if the tree is empty as viewed by the transaction . * Returns true if there are no entries visible to the transaction and false * if there are entries visible . * @ param transaction the transaction which sees the tree as empty . * @ return true if no entries are visible ...
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "isEmpty" , new Object [ ] { transaction } ) ; boolean returnValue ; if ( firstEntry ( transaction ) == null ) { returnValue = true ; } else { returnValue = false ; } if ( Tracing . isAnyTracingEnabled ( ) && trace . ...
public class Constraint { /** * Checks for foreign key or check constraint violation when * inserting a row into the child table . */ void checkInsert ( Session session , Table table , Object [ ] row ) { } }
switch ( constType ) { case CHECK : if ( ! isNotNull ) { checkCheckConstraint ( session , table , row ) ; } return ; case FOREIGN_KEY : PersistentStore store = session . sessionData . getRowStore ( core . mainTable ) ; if ( ArrayUtil . hasNull ( row , core . refCols ) ) { if ( core . matchType == OpTypes . MATCH_SIMPLE...
public class AbstractValidate { /** * Validate that the specified primitive value falls between the two exclusive values specified ; otherwise , throws an exception . * < pre > Validate . exclusiveBetween ( 0 , 2 , 1 ) ; < / pre > * @ param start * the exclusive start value * @ param end * the exclusive end v...
if ( value <= start || value >= end ) { fail ( String . format ( DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE , value , start , end ) ) ; } return value ;
public class UploadManager { /** * 同步上传文件 。 使用 form 表单方式上传 , 建议只在文件较小情况下使用此方式 , 如 file . size ( ) < 1024 * 1024。 * @ param file 上传的文件绝对路径 * @ param key 上传数据保存的文件名 * @ param token 上传凭证 * @ param options 上传数据的可选参数 * @ return 响应信息 ResponseInfo # response 响应体 , 序列化后 json 格式 */ public ResponseInfo syncPut ( String...
return syncPut ( new File ( file ) , key , token , options ) ;
public class Dispatching { /** * Adapts a function to a binary function by ignoring the first parameter . * @ param < T1 > the adapted function first parameter type * @ param < T2 > the adapted function second parameter type * @ param < R > the adapted function result type * @ param function the function to be ...
dbc . precondition ( function != null , "cannot ignore parameter of a null function" ) ; return ( first , second ) -> function . apply ( second ) ;
public class LifeCycleHelper { /** * Assigns / injects { @ link Provided } property values to a component . * @ param descriptor * @ param component */ public void assignProvidedProperties ( ComponentDescriptor < ? > descriptor , Object component ) { } }
AssignProvidedCallback callback = new AssignProvidedCallback ( _injectionManager ) ; callback . onEvent ( component , descriptor ) ;
public class ExpressionUtil { /** * Substitutes dynamic values for expressions in the input string . * @ param input raw input string * @ param model object containing the values to substitute * @ param map of images to populate based on special $ { image : * . gif } syntax * @ return string with values substit...
StringBuffer substituted = new StringBuffer ( input . length ( ) ) ; try { Matcher matcher = tokenPattern . matcher ( input ) ; int index = 0 ; while ( matcher . find ( ) ) { String match = matcher . group ( ) ; substituted . append ( input . substring ( index , matcher . start ( ) ) ) ; if ( imageMap != null && ( matc...
public class AndroidResourceBitmap { /** * clearResourceBitmaps is called */ public static void clearResourceBitmaps ( ) { } }
if ( ! AndroidGraphicFactory . KEEP_RESOURCE_BITMAPS ) { return ; } synchronized ( RESOURCE_BITMAPS ) { for ( Pair < android . graphics . Bitmap , Integer > p : RESOURCE_BITMAPS . values ( ) ) { p . first . recycle ( ) ; if ( AndroidGraphicFactory . DEBUG_BITMAPS ) { rInstances . decrementAndGet ( ) ; } } if ( AndroidG...
public class DatabaseInformationFull { /** * The DOMAINS view has one row for each domain . < p > * < pre class = " SqlCodeExample " > * < / pre > * @ return Table */ Table DOMAINS ( ) { } }
Table t = sysTables [ DOMAINS ] ; if ( t == null ) { t = createBlankTable ( sysTableHsqlNames [ DOMAINS ] ) ; addColumn ( t , "DOMAIN_CATALOG" , SQL_IDENTIFIER ) ; addColumn ( t , "DOMAIN_SCHEMA" , SQL_IDENTIFIER ) ; addColumn ( t , "DOMAIN_NAME" , SQL_IDENTIFIER ) ; addColumn ( t , "DATA_TYPE" , SQL_IDENTIFIER ) ; add...
public class MessageCacheImpl { /** * Cleans the cache . */ public void clean ( ) { } }
Instant minAge = Instant . now ( ) . minus ( storageTimeInSeconds , ChronoUnit . SECONDS ) ; synchronized ( messages ) { messages . removeIf ( messageRef -> Optional . ofNullable ( messageRef . get ( ) ) . map ( message -> ! message . isCachedForever ( ) && message . getCreationTimestamp ( ) . isBefore ( minAge ) ) . o...
public class ImportServlet { /** * Trust every server - dont check for any certificate */ private static void trustAllHosts ( ) { } }
// Create a trust manager that does not validate certificate chains TrustManager [ ] trustAllCerts = new TrustManager [ ] { new X509TrustManager ( ) { @ Override public java . security . cert . X509Certificate [ ] getAcceptedIssuers ( ) { return new java . security . cert . X509Certificate [ ] { } ; } @ Override public...
public class LdapTemplate { /** * Delete all subcontexts including the current one recursively . * @ param ctx The context to use for deleting . * @ param name The starting point to delete recursively . * @ throws NamingException if any error occurs */ protected void deleteRecursively ( DirContext ctx , Name name...
NamingEnumeration enumeration = null ; try { enumeration = ctx . listBindings ( name ) ; while ( enumeration . hasMore ( ) ) { Binding binding = ( Binding ) enumeration . next ( ) ; LdapName childName = LdapUtils . newLdapName ( binding . getName ( ) ) ; childName . addAll ( 0 , name ) ; deleteRecursively ( ctx , child...
public class CreateApplicationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateApplicationRequest createApplicationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createApplicationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createApplicationRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getTags ( ) , TAGS_BINDING ) ; } catch ( Ex...
public class HttpRequestUtils { /** * Gets request headers . * @ param request the request * @ return the request headers */ public static Map < String , String > getRequestHeaders ( final HttpServletRequest request ) { } }
val headers = new LinkedHashMap < String , Object > ( ) ; val headerNames = request . getHeaderNames ( ) ; if ( headerNames != null ) { while ( headerNames . hasMoreElements ( ) ) { val headerName = headerNames . nextElement ( ) ; val headerValue = StringUtils . stripToEmpty ( request . getHeader ( headerName ) ) ; hea...
public class ShowcaseEntryPoint { /** * Event coming from old dashboards ( created with versions prior to 0.7) */ private void onDashboardDeletedEvent ( @ Observes DashboardDeletedEvent event ) { } }
NavTree navTree = navigationManager . getNavTree ( ) ; navTree . deleteItem ( event . getDashboardId ( ) ) ; navBar . show ( NavTreeDefinitions . GROUP_APP ) ; workbenchNotification . fire ( new NotificationEvent ( constants . notification_dashboard_deleted ( event . getDashboardName ( ) ) , INFO ) ) ;
public class VdmEditor { /** * highlights a node in the text editor . * @ param node */ public void setHighlightRange ( INode node ) { } }
try { int [ ] offsetLength = this . locationSearcher . getNodeOffset ( node ) ; // int offset = getSourceViewer ( ) . getTextWidget ( ) . getCaretOffset ( ) ; Assert . isNotNull ( offsetLength ) ; Assert . isTrue ( offsetLength [ 0 ] > 0 , "Illegal start offset" ) ; Assert . isTrue ( offsetLength [ 0 ] > 0 , "Illegal o...
public class Conversion { /** * Converts an array of short into a long using the default ( little endian , Lsb0 ) byte and * bit ordering . * @ param src the short array to convert * @ param srcPos the position in { @ code src } , in short unit , from where to start the * conversion * @ param dstInit initial ...
if ( src . length == 0 && srcPos == 0 || 0 == nShorts ) { return dstInit ; } if ( ( nShorts - 1 ) * 16 + dstPos >= 64 ) { throw new IllegalArgumentException ( "(nShorts-1)*16+dstPos is greater or equal to than 64" ) ; } long out = dstInit ; for ( int i = 0 ; i < nShorts ; i ++ ) { final int shift = i * 16 + dstPos ; fi...
public class ModelsImpl { /** * Updates the name of an intent classifier . * @ param appId The application ID . * @ param versionId The version ID . * @ param intentId The intent classifier ID . * @ param updateIntentOptionalParameter the object representing the optional parameters to be set before calling this...
return updateIntentWithServiceResponseAsync ( appId , versionId , intentId , updateIntentOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Utilities { /** * This method read a application descriptor file and return a { @ link org . openqa . selenium . By } object ( xpath , id , link . . . ) . * @ param page * is target page * @ param code * Name of element on the web Page . * @ param args * list of description ( xpath , id , link ...
return getLocator ( page . getApplication ( ) , page . getPageKey ( ) + code , args ) ;
public class CollectionJsonSerializer { /** * { @ inheritDoc } */ @ Override public void doSerialize ( JsonWriter writer , C values , JsonSerializationContext ctx , JsonSerializerParameters params ) { } }
if ( values . isEmpty ( ) ) { if ( ctx . isWriteEmptyJsonArrays ( ) ) { writer . beginArray ( ) ; writer . endArray ( ) ; } else { writer . cancelName ( ) ; } return ; } if ( ctx . isWriteSingleElemArraysUnwrapped ( ) && values . size ( ) == 1 ) { // there is only one element , we write it directly serializer . seriali...
public class AWSCognitoIdentityProviderClient { /** * Creates a new group in the specified user pool . * Requires developer credentials . * @ param createGroupRequest * @ return Result of the CreateGroup operation returned by the service . * @ throws InvalidParameterException * This exception is thrown when t...
request = beforeClientExecution ( request ) ; return executeCreateGroup ( request ) ;
public class FilterChain { /** * Appends the given element . */ private boolean appendText ( final String indent , final Element element , final StringBuilder sb ) { } }
if ( sb != null ) { if ( element . getTagName ( ) . indexOf ( ":annotation" ) < 0 && element . getTagName ( ) . indexOf ( ":documentation" ) < 0 ) { sb . append ( String . format ( ELEMENT_LOG , indent , element . getTagName ( ) , element . getAttribute ( "name" ) ) ) ; return true ; } } return false ;
public class TargetSpecifications { /** * { @ link Specification } for retrieving { @ link JpaTarget } s including * { @ link JpaTarget # getAssignedDistributionSet ( ) } . * @ param controllerIDs * to search for * @ return the { @ link Target } { @ link Specification } */ public static Specification < JpaTarge...
return ( targetRoot , query , cb ) -> { final Predicate predicate = targetRoot . get ( JpaTarget_ . controllerId ) . in ( controllerIDs ) ; targetRoot . fetch ( JpaTarget_ . assignedDistributionSet ) ; return predicate ; } ;
public class SnowflakeFileTransferAgent { /** * A callable that can be executed in a separate thread using executor service . * The callable download files from a stage location to a local location * @ param stage stage information * @ param srcFilePath path that stores the downloaded file * @ param localLocati...
return new Callable < Void > ( ) { public Void call ( ) throws Exception { logger . debug ( "Entering getDownloadFileCallable..." ) ; FileMetadata metadata = fileMetadataMap . get ( srcFilePath ) ; // this shouldn ' t happen if ( metadata == null ) { throw new SnowflakeSQLException ( SqlState . INTERNAL_ERROR , ErrorCo...
public class ModuleXmlReader { /** * Parse module . xml from an input stream . * @ param inputStream The InputStream to parse * @ return Document the parsed DOM * @ throws ParserConfigurationException In case of parser mis - configuration * @ throws SAXException In case of SAX exception * @ throws IOException...
DocumentBuilderFactory dbFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder dBuilder = dbFactory . newDocumentBuilder ( ) ; Document doc = dBuilder . parse ( inputStream ) ; doc . getDocumentElement ( ) . normalize ( ) ; return doc ;
public class CopticChronology { /** * Obtains a local date in Coptic calendar system from the * proleptic - year , month - of - year and day - of - month fields . * @ param prolepticYear the proleptic - year * @ param month the month - of - year * @ param dayOfMonth the day - of - month * @ return the Coptic ...
return CopticDate . of ( prolepticYear , month , dayOfMonth ) ;
public class CommonAhoCorasickSegmentUtil { /** * 最长分词 , 合并未知语素 * @ param charArray 文本 * @ param trie 自动机 * @ param < V > 类型 * @ return 结果链表 */ public static < V > LinkedList < ResultTerm < V > > segment ( final char [ ] charArray , AhoCorasickDoubleArrayTrie < V > trie ) { } }
LinkedList < ResultTerm < V > > termList = new LinkedList < ResultTerm < V > > ( ) ; final ResultTerm < V > [ ] wordNet = new ResultTerm [ charArray . length ] ; trie . parseText ( charArray , new AhoCorasickDoubleArrayTrie . IHit < V > ( ) { @ Override public void hit ( int begin , int end , V value ) { if ( wordNet [...
public class Helper { /** * < p > firstUpperCase . < / p > * @ param s a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . */ public static String firstUpperCase ( String s ) { } }
String first = s . length ( ) > 0 ? s . substring ( 0 , 1 ) . toUpperCase ( ) : "" ; String second = s . length ( ) > 1 ? s . substring ( 1 ) . toLowerCase ( ) : "" ; return first + second ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } * { @ link CmisExtensionType } { @ code > } */ @ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "extension" , scope = CreateFolder . class ) public JAXBElement < CmisExtensionType...
return new JAXBElement < CmisExtensionType > ( _GetPropertiesExtension_QNAME , CmisExtensionType . class , CreateFolder . class , value ) ;
public class ServerCookieEncoder { /** * Batch encodes cookies into Set - Cookie header values . * @ param cookies a bunch of cookies * @ return the corresponding bunch of Set - Cookie headers */ public List < String > encode ( Collection < ? extends Cookie > cookies ) { } }
if ( checkNotNull ( cookies , "cookies" ) . isEmpty ( ) ) { return Collections . emptyList ( ) ; } List < String > encoded = new ArrayList < String > ( cookies . size ( ) ) ; Map < String , Integer > nameToIndex = strict && cookies . size ( ) > 1 ? new HashMap < String , Integer > ( ) : null ; int i = 0 ; boolean hasDu...
public class MiniTemplatorCache { /** * Returns a cloned MiniTemplator object from the cache . If there is not yet a MiniTemplator object with the * specified < code > templateFileName < / code > in the cache , a new MiniTemplator object is created and stored in the * cache . Then the cached MiniTemplator object is...
String key = generateCacheKey ( templateSpec ) ; MiniTemplator mt = cache . get ( key ) ; if ( mt == null ) { mt = new MiniTemplator ( templateSpec ) ; cache . put ( key , mt ) ; } return mt . cloneReset ( ) ;
public class Money { /** * ( non - Javadoc ) * @ see MonetaryAmount # divide ( MonetaryAmount ) */ @ Override public Money divide ( double divisor ) { } }
if ( NumberVerifier . isInfinityAndNotNaN ( divisor ) ) { return Money . of ( 0 , getCurrency ( ) ) ; } if ( divisor == 1.0d ) { return this ; } return divide ( new BigDecimal ( String . valueOf ( divisor ) ) ) ;
public class GPixelMath { /** * Each element has the specified number added to it . Both input and output images can * be the same . * @ param input The input image . Not modified . * @ param value What is added to each element . * @ param output The output image . Modified . */ public static < T extends ImageB...
if ( input instanceof ImageGray ) { if ( GrayU8 . class == input . getClass ( ) ) { PixelMath . plus ( ( GrayU8 ) input , ( int ) value , ( GrayU8 ) output ) ; } else if ( GrayS8 . class == input . getClass ( ) ) { PixelMath . plus ( ( GrayS8 ) input , ( int ) value , ( GrayS8 ) output ) ; } else if ( GrayU16 . class =...
public class Event { /** * Adds the given event to the events to be thrown when this event * has completed ( see { @ link # isDone ( ) } ) . Such an event is called * a " completion event " . * Completion events are considered to be caused by the event that * caused the completed event . If an event * e1 * caus...
if ( completionEvents == null ) { completionEvents = new HashSet < > ( ) ; } completionEvents . add ( completionEvent ) ; return this ;
public class XMLCharHelper { /** * Check if the passed character is invalid for a text node . * @ param eXMLVersion * XML version to be used . May not be < code > null < / code > . * @ param c * char to check * @ return < code > true < / code > if the char is invalid */ public static boolean isInvalidXMLTextC...
switch ( eXMLVersion ) { case XML_10 : return INVALID_VALUE_CHAR_XML10 . get ( c ) ; case XML_11 : return INVALID_TEXT_VALUE_CHAR_XML11 . get ( c ) ; case HTML : return INVALID_CHAR_HTML . get ( c ) ; default : throw new IllegalArgumentException ( "Unsupported XML version " + eXMLVersion + "!" ) ; }
public class UpdatePipelineRequest { /** * A list of " PipelineActivity " objects . Activities perform transformations on your messages , such as removing , * renaming or adding message attributes ; filtering messages based on attribute values ; invoking your Lambda * functions on messages for advanced processing ;...
if ( this . pipelineActivities == null ) { setPipelineActivities ( new java . util . ArrayList < PipelineActivity > ( pipelineActivities . length ) ) ; } for ( PipelineActivity ele : pipelineActivities ) { this . pipelineActivities . add ( ele ) ; } return this ;
public class LayoutManager { /** * Loads a the previously saved layout for the current page . If no * previously persisted layout exists for the given page the built * in default layout is used . * @ param manager The docking manager to use * @ param pageId The page to get the layout for * @ return a boolean ...
manager . beginLoadLayoutData ( ) ; try { if ( isValidLayout ( manager , pageId , perspective ) ) { String pageLayout = MessageFormat . format ( PAGE_LAYOUT , pageId , perspective . getId ( ) ) ; manager . loadLayoutDataFrom ( pageLayout ) ; return true ; } else { manager . loadLayoutData ( ) ; return false ; } } catch...
public class DomainsInner { /** * List domains under an Azure subscription . * List all the domains under an Azure subscription . * @ return the observable to the List & lt ; DomainInner & gt ; object */ public Observable < Page < DomainInner > > listAsync ( ) { } }
return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < List < DomainInner > > , Page < DomainInner > > ( ) { @ Override public Page < DomainInner > call ( ServiceResponse < List < DomainInner > > response ) { PageImpl < DomainInner > page = new PageImpl < > ( ) ; page . setItems ( response . body...
public class TokVariable { /** * { @ inheritDoc } */ @ Override public EquPart morph ( ) throws Exception { } }
final EquPart fun = Equ . getInstance ( ) . function ( this ) ; if ( fun == null ) return this ; return fun ;
public class EditText { /** * Sets the Drawables ( if any ) to appear to the left of , above , to the * right of , and below the text . Use 0 if you do not want a Drawable there . * The Drawables ' bounds will be set to their intrinsic bounds . * Calling this method will overwrite any Drawables previously set usi...
mInputView . setCompoundDrawablesWithIntrinsicBounds ( left , top , right , bottom ) ;
public class SearchResultToBDBRecordAdapter { /** * ( non - Javadoc ) * @ see org . archive . wayback . util . Adapter # adapt ( java . lang . Object ) */ public BDBRecord adapt ( CaptureSearchResult result ) { } }
StringBuilder keySB = new StringBuilder ( 40 ) ; StringBuilder valSB = new StringBuilder ( 100 ) ; String origUrl = result . getOriginalUrl ( ) ; String urlKey ; try { urlKey = canonicalizer . urlStringToKey ( origUrl ) ; } catch ( URIException e ) { // e . printStackTrace ( ) ; LOGGER . warning ( "FAILED canonicalize(...
public class XlsSaver { /** * 複数のオブジェクトをそれぞれのシートへ保存する 。 * @ param templateXlsIn 雛形となるExcelファイルの入力 * @ param xlsOut xlsOut 出力先のストリーム * @ param beanObjs 書き込むオブジェクトの配列 。 * @ throws IllegalArgumentException { @ literal templateXlsIn = = null or xlsOut = = null or beanObjs = = null } * @ throws XlsMapperExcep...
saveMultipleDetail ( templateXlsIn , xlsOut , beanObjs ) ;
public class XStreamUtils { /** * Takes the incoming file - name and checks whether this is a URI using the < tt > file : < / tt > protocol or a non - URI and treats * it accordingly . * @ return a file - name { @ link java . io . File } representation or < tt > null < / tt > if the file - name was in an invalid UR...
try { final String astFileName = uriOrFileName + ".xml" ; return uriOrFileName . startsWith ( "file:" ) ? new File ( URI . create ( astFileName ) ) : new File ( astFileName ) ; } catch ( IllegalArgumentException e ) { return null ; }
public class WebhooksInner { /** * Lists recent events for the specified webhook . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; EventInner & g...
return listEventsNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < EventInner > > , Observable < ServiceResponse < Page < EventInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < EventInner > > > call ( ServiceResponse < Page < EventInner > > page ) { String...
public class ClassFile { /** * Add a static initializer to this class . */ public MethodInfo addInitializer ( ) { } }
MethodDesc md = MethodDesc . forArguments ( null , null , null ) ; Modifiers af = new Modifiers ( ) ; af . setStatic ( true ) ; MethodInfo mi = new MethodInfo ( this , af , "<clinit>" , md , null ) ; mMethods . add ( mi ) ; return mi ;
public class OperationsApi { /** * Put users . * putUsers * @ return ApiResponse & lt ; PutUsers & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < PutUsers > putUsersWithHttpInfo ( ) throws ApiException { } }
com . squareup . okhttp . Call call = putUsersValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PutUsers > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class DeviceAttributes { /** * < pre > * String representation of device _ type . * < / pre > * < code > optional string device _ type = 2 ; < / code > */ public java . lang . String getDeviceType ( ) { } }
java . lang . Object ref = deviceType_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; deviceType_ = s ; return s ; }
public class AsyncAppender { /** * Construct a new Counter , register it , and then return it . * @ param name String * @ return Counter */ private Counter initAndRegisterCounter ( String name ) { } }
BasicCounter counter = new BasicCounter ( MonitorConfig . builder ( name ) . build ( ) ) ; DefaultMonitorRegistry . getInstance ( ) . register ( counter ) ; return counter ;
public class CounterContext { /** * Creates a counter context with a single local shard . * For use by tests of compatibility with pre - 2.1 counters only . */ public ByteBuffer createLocal ( long count ) { } }
ContextState state = ContextState . allocate ( 0 , 1 , 0 ) ; state . writeLocal ( CounterId . getLocalId ( ) , 1L , count ) ; return state . context ;
public class OpenAPIFilter { /** * { @ inheritDoc } */ @ Override public Schema visitSchema ( Context context , Schema schema ) { } }
return filter . filterSchema ( schema ) ;
public class dnssoarec { /** * Use this API to unset the properties of dnssoarec resources . * Properties that need to be unset are specified in args array . */ public static base_responses unset ( nitro_service client , String domain [ ] , String args [ ] ) throws Exception { } }
base_responses result = null ; if ( domain != null && domain . length > 0 ) { dnssoarec unsetresources [ ] = new dnssoarec [ domain . length ] ; for ( int i = 0 ; i < domain . length ; i ++ ) { unsetresources [ i ] = new dnssoarec ( ) ; unsetresources [ i ] . domain = domain [ i ] ; } result = unset_bulk_request ( clie...
public class Index { /** * Find the set of IDs associated with a full name in the provided map . * @ param indexName the full name in index form * @ param names the map of full names to sets of IDs * @ return the set of ID strings */ private SortedSet < String > findIdsPerName ( final String indexName , final Sor...
if ( names . containsKey ( indexName ) ) { return names . get ( indexName ) ; } final TreeSet < String > idsPerName = new TreeSet < String > ( ) ; names . put ( indexName , idsPerName ) ; return idsPerName ;
public class Choice6 { /** * Static factory method for wrapping a value of type < code > E < / code > in a { @ link Choice6 } . * @ param e the value * @ param < A > the first possible type * @ param < B > the second possible type * @ param < C > the third possible type * @ param < D > the fourth possible typ...
return new _E < > ( e ) ;
public class Scanner { /** * Scan a single node . The current path is updated for the duration of the scan . */ @ Override public Void scan ( Tree tree , VisitorState state ) { } }
if ( tree == null ) { return null ; } SuppressionInfo prevSuppressionInfo = updateSuppressions ( tree , state ) ; try { return super . scan ( tree , state ) ; } finally { // Restore old suppression state . currentSuppressions = prevSuppressionInfo ; }
public class XMLProperties { /** * For testing only . */ public static void main ( String [ ] pArgs ) throws Exception { } }
// - - Print DTD System . out . println ( "DTD: \n" + DTD ) ; System . out . println ( "--" ) ; // - - Test load System . out . println ( "Reading properties from \"" + pArgs [ 0 ] + "\"..." ) ; XMLProperties props = new XMLProperties ( ) ; props . load ( new FileInputStream ( new File ( pArgs [ 0 ] ) ) ) ; props . lis...
public class SldUtilities { /** * Creates a color with the given alpha . * @ param color the color to use . * @ param alpha an alpha value between 0 and 255. * @ return the color with alpha . */ public static Color colorWithAlpha ( Color color , int alpha ) { } }
return new Color ( color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) , alpha ) ;
public class ViewPosition { /** * Restores ViewPosition from the string created by { @ link # pack ( ) } method . * @ param str Serialized position string * @ return De - serialized position */ @ SuppressWarnings ( "unused" ) // Public API public static ViewPosition unpack ( String str ) { } }
String [ ] parts = TextUtils . split ( str , SPLIT_PATTERN ) ; if ( parts . length != 4 ) { throw new IllegalArgumentException ( "Wrong ViewPosition string: " + str ) ; } Rect view = Rect . unflattenFromString ( parts [ 0 ] ) ; Rect viewport = Rect . unflattenFromString ( parts [ 1 ] ) ; Rect visible = Rect . unflatten...
public class Tile { /** * Defines if the second hand of the clock will be drawn . * @ param VISIBLE */ public void setSecondsVisible ( boolean VISIBLE ) { } }
if ( null == secondsVisible ) { _secondsVisible = VISIBLE ; fireTileEvent ( REDRAW_EVENT ) ; } else { secondsVisible . set ( VISIBLE ) ; }
public class MtasSolrStatus { /** * Update shard info . */ private final void updateShardInfo ( ) { } }
final long expirationTime = 1000 ; // don ' t update too much if ( shardKey == null || ( shardInfoUpdated && Objects . requireNonNull ( shardInfoUpdate , "update expire time not set" ) < System . currentTimeMillis ( ) ) ) { return ; } // and only if necessary if ( ! shardInfoUpdated || ! finished || shardInfoNeedUpdate...
public class TagUtils { /** * String - - > int * @ param value * @ return */ public static int getInteger ( Object value ) { } }
if ( value == null ) { return 0 ; } if ( value instanceof Number ) { return ( ( Number ) value ) . intValue ( ) ; } return Integer . valueOf ( value . toString ( ) ) . intValue ( ) ;
public class Task { /** * Counters to measure the usage of the different file systems . * Always return the String array with two elements . First one is the name of * BYTES _ READ counter and second one is of the BYTES _ WRITTEN counter . */ protected static String [ ] getFileSystemCounterNames ( String uriScheme ...
String scheme = uriScheme . toUpperCase ( ) ; return new String [ ] { scheme + "_BYTES_READ" , scheme + "_BYTES_WRITTEN" , scheme + "_FILES_CREATED" , scheme + "_BYTES_READ_LOCAL" , scheme + "_BYTES_READ_RACK" , scheme + "_READ_EXCEPTIONS" , scheme + "_WRITE_EXCEPTIONS" } ;
public class Positions { /** * Positions the owner above the other . * @ param other the other * @ param spacing the spacing * @ return the int supplier */ public static IntSupplier above ( ISized owner , IPositioned other , int spacing ) { } }
checkNotNull ( other ) ; return ( ) -> { return other . position ( ) . y ( ) - owner . size ( ) . height ( ) - spacing ; } ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Location } { @ code > } } */ @ XmlElementDecl ( namespace = PROV_NS , name = "location" ) public JAXBElement < Location > createLocation ( Location value ) { } }
return new JAXBElement < Location > ( _Location_QNAME , Location . class , null , value ) ;
public class JSONNavi { /** * get the current object value as String if the current Object is null * return null . */ public String asString ( ) { } }
if ( current == null ) return null ; if ( current instanceof String ) return ( String ) current ; return current . toString ( ) ;
public class HttpRequest { /** * Get the request port . The port is obtained either from an absolute URI , the HTTP Host header * field , the connection or the default . * @ return The port . 0 should be interpreted as the default port . */ public int getPort ( ) { } }
if ( _port > 0 ) return _port ; if ( _host != null ) return 0 ; if ( _uri . isAbsolute ( ) ) _port = _uri . getPort ( ) ; else if ( _connection != null ) _port = _connection . getServerPort ( ) ; return _port ;
public class HTMLUtils { /** * Remove the first element inside a parent element and copy the element ' s children in the parent . * @ param document the w3c document from which to remove the top level paragraph * @ param parentTagName the name of the parent tag to look under * @ param elementTagName the name of t...
NodeList parentNodes = document . getElementsByTagName ( parentTagName ) ; if ( parentNodes . getLength ( ) > 0 ) { Node parentNode = parentNodes . item ( 0 ) ; // Look for a p element below the first parent element Node pNode = parentNode . getFirstChild ( ) ; if ( elementTagName . equalsIgnoreCase ( pNode . getNodeNa...
public class ZipUtils { /** * Replaces the specified file in the provided ZIP file with the * provided content . * @ param zip The zip - file to process * @ param file The file to look for * @ param data The string - data to replace * @ param encoding The encoding that should be used when writing the string d...
// open the output side File zipOutFile = File . createTempFile ( "ZipReplace" , ".zip" ) ; try { FileOutputStream fos = new FileOutputStream ( zipOutFile ) ; try ( ZipOutputStream zos = new ZipOutputStream ( fos ) ) { // open the input side try ( ZipFile zipFile = new ZipFile ( zip ) ) { boolean found = false ; // wal...
public class JNDIObjectFactory { /** * The reference target is specified via metatype */ @ Reference ( name = REFERENCE_LIBRARY , service = Library . class ) protected void setLibrary ( ServiceReference < Library > ref ) { } }
libraryRef . setReference ( ref ) ;
public class TaskImpl { /** * 将任务添加到线程池 , 开始执行 * @ return TAG */ @ Override public String start ( ) { } }
if ( mConsumed ) { throw new IllegalStateException ( "task has been executed already" ) ; } if ( Config . DEBUG ) { Log . v ( TAG , "start() " + getName ( ) ) ; } mConsumed = true ; final Runnable runnable = new Runnable ( ) { @ Override public void run ( ) { execute ( ) ; } } ; final long delayMillis = mInfo . delayMi...
public class SimpleXmlWriter { /** * Writes ' > \ n ' . */ public void openElement ( String elementName ) throws IOException { } }
assert ( elementNames . size ( ) > 0 ) ; assert ( elementNames . get ( elementNames . size ( ) - 1 ) . equals ( elementName ) ) ; writer . write ( ">" ) ; if ( indent || noTextElement ) { writer . write ( "\n" ) ; }
public class EvaluationErrorPrinter { /** * Auxiliary method to print expected and predicted samples . * @ param referenceSample * the reference sample * @ param predictedSample * the predicted sample */ private < S > void printSamples ( final S referenceSample , final S predictedSample ) { } }
final String details = "Expected: {\n" + referenceSample + "}\nPredicted: {\n" + predictedSample + "}" ; this . printStream . println ( details ) ;
public class GVRRenderData { /** * Set the face to be culled * @ param cullFace * { @ code GVRCullFaceEnum . Back } Tells Graphics API to discard * back faces , { @ code GVRCullFaceEnum . Front } Tells Graphics API * to discard front faces , { @ code GVRCullFaceEnum . None } Tells * Graphics API to not discar...
if ( passIndex < mRenderPassList . size ( ) ) { mRenderPassList . get ( passIndex ) . setCullFace ( cullFace ) ; } else { Log . e ( TAG , "Trying to set cull face to a invalid pass. Pass " + passIndex + " was not created." ) ; } return this ;
public class DataTable { /** * Returns the parameter list of jQuery and other non - standard JS callbacks . If * there ' s no parameter list for a certain event , the default is simply " event " . * @ return A hash map containing the events . May be null . */ @ Override public Map < String , String > getJQueryEvent...
Map < String , String > result = new HashMap < String , String > ( ) ; result . put ( "select" , "event, datatable, typeOfSelection, indexes" ) ; result . put ( "deselect" , "event, datatable, typeOfSelection, indexes" ) ; return result ;
public class ObjectRange { /** * { @ inheritDoc } */ public void step ( int step , Closure closure ) { } }
if ( step == 0 ) { if ( compareTo ( from , to ) != 0 ) { throw new GroovyRuntimeException ( "Infinite loop detected due to step size of 0" ) ; } else { return ; // from = = to and step = = 0 , nothing to do , so return } } if ( reverse ) { step = - step ; } if ( step > 0 ) { Comparable first = from ; Comparable value =...
public class SoftwareModuleSpecification { /** * { @ link Specification } for retrieving { @ link SoftwareModule } s where its * DELETED attribute is false . * @ return the { @ link SoftwareModule } { @ link Specification } */ public static Specification < JpaSoftwareModule > isDeletedFalse ( ) { } }
return ( swRoot , query , cb ) -> cb . equal ( swRoot . < Boolean > get ( JpaSoftwareModule_ . deleted ) , Boolean . FALSE ) ;
public class ProjectApi { /** * Get a list of visible projects owned by the given user in the specified page range . * < pre > < code > GET / users / : user _ id / projects < / code > < / pre > * @ param userIdOrUsername the user ID , username of the user , or a User instance holding the user ID or username * @ p...
GitLabApiForm formData = filter . getQueryParams ( page , perPage ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , "users" , getUserIdOrUsername ( userIdOrUsername ) , "projects" ) ; return ( response . readEntity ( new GenericType < List < Project > > ( ) { } ) ) ;
public class XmlNode { /** * Adds the attribute * @ param _ name * the attribute name * @ param _ value * the attribute name */ public void addAttribute ( final String _name , final String _value ) { } }
this . attributes . put ( _name , new XmlNode ( ) { { this . name = _name ; this . value = _value ; this . valid = true ; this . type = XmlNode . ATTRIBUTE_NODE ; } } ) ;
public class MonetaryFunctions { /** * Returns the smaller of two { @ code MonetaryAmount } values . If the arguments * have the same value , the result is that same value . * @ param a an argument . * @ param b another argument . * @ return the smaller of { @ code a } and { @ code b } . */ static MonetaryAmoun...
MoneyUtils . checkAmountParameter ( Objects . requireNonNull ( a ) , Objects . requireNonNull ( b . getCurrency ( ) ) ) ; return a . isLessThan ( b ) ? a : b ;
public class AmazonDynamoDBAsyncClient { /** * Retrieves a set of Attributes for an item that matches the primary * key . * The < code > GetItem < / code > operation provides an eventually - consistent * read by default . If eventually - consistent reads are not acceptable for * your application , use < code > ...
return executorService . submit ( new Callable < GetItemResult > ( ) { public GetItemResult call ( ) throws Exception { GetItemResult result ; try { result = getItem ( getItemRequest ) ; } catch ( Exception ex ) { asyncHandler . onError ( ex ) ; throw ex ; } asyncHandler . onSuccess ( getItemRequest , result ) ; return...
public class NodeSequence { /** * Create a batch of nodes around the supplied iterable container . Note that the supplied iterator is accessed lazily only * when the batch is { @ link Batch # nextRow ( ) used } . * @ param keys the iterator over the keys of the nodes to be returned ; if null , an { @ link # emptySe...
if ( keys == null ) return emptyBatch ( workspaceName , 1 ) ; return batchOfKeys ( keys . iterator ( ) , keys . size ( ) , score , workspaceName , repository ) ;
public class BasicPIDGenerator { /** * Get a reference to the ConnectionPoolManager so we can give the instance * constructor a ConnectionPool later in initializeIfNeeded ( ) . */ @ Override public void postInitModule ( ) throws ModuleInitializationException { } }
ConnectionPoolManager mgr = ( ConnectionPoolManager ) getServer ( ) . getModule ( "org.fcrepo.server.storage.ConnectionPoolManager" ) ; if ( mgr == null ) { throw new ModuleInitializationException ( "ConnectionPoolManager module not loaded." , getRole ( ) ) ; } try { m_pidGenerator = new DBPIDGenerator ( mgr . getPool ...
public class FontSpec { /** * Converts the weight value to bold / not bold * @ param weight a CSS weight * @ return true if the given weight corresponds to bold */ public static boolean representsBold ( CSSProperty . FontWeight weight ) { } }
if ( weight == CSSProperty . FontWeight . BOLD || weight == CSSProperty . FontWeight . BOLDER || weight == CSSProperty . FontWeight . numeric_600 || weight == CSSProperty . FontWeight . numeric_700 || weight == CSSProperty . FontWeight . numeric_800 || weight == CSSProperty . FontWeight . numeric_900 ) { return true ; ...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcFireSuppressionTerminalType ( ) { } }
if ( ifcFireSuppressionTerminalTypeEClass == null ) { ifcFireSuppressionTerminalTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 274 ) ; } return ifcFireSuppressionTerminalTypeEClass ;
public class DatabaseStoreService { /** * Declarative Services method for unsetting the data source service reference * @ param ref reference to service object ; type of service object is verified */ protected void unsetDataSourceFactory ( ServiceReference < ResourceFactory > ref ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetDataSourceFactory" , "unsetting " + ref ) ; } dataSourceFactoryRef . unsetReference ( ref ) ;
public class NearCachePreloader { /** * Loads the values via a stored key file into the supplied { @ link DataStructureAdapter } . * @ param adapter the { @ link DataStructureAdapter } to load the values from */ public void loadKeys ( DataStructureAdapter < Object , ? > adapter ) { } }
if ( ! storeFile . exists ( ) ) { logger . info ( format ( "Skipped loading keys of Near Cache %s since storage file doesn't exist (%s)" , nearCacheName , storeFile . getAbsolutePath ( ) ) ) ; return ; } long startedNanos = System . nanoTime ( ) ; BufferingInputStream bis = null ; try { bis = new BufferingInputStream (...
public class BpmnParse { /** * Parses a receive task . */ public ActivityImpl parseReceiveTask ( Element receiveTaskElement , ScopeImpl scope ) { } }
ActivityImpl activity = createActivityOnScope ( receiveTaskElement , scope ) ; activity . setActivityBehavior ( new ReceiveTaskActivityBehavior ( ) ) ; parseAsynchronousContinuationForActivity ( receiveTaskElement , activity ) ; parseExecutionListenersOnScope ( receiveTaskElement , activity ) ; if ( receiveTaskElement ...
public class SmartShareActionProvider { /** * { @ inheritDoc } */ @ Override public View onCreateActionView ( ) { } }
// Create the view and set its data model . SmartActivityChooserModel dataModel = SmartActivityChooserModel . get ( mContext , mShareHistoryFileName ) ; SmartActivityChooserView activityChooserView = new SmartActivityChooserView ( mContext ) ; activityChooserView . setActivityChooserModel ( dataModel ) ; // Lookup and ...
public class MavenModelScannerPlugin { /** * Adds information about execution goals . * @ param executionDescriptor * The descriptor for the execution . * @ param pluginExecution * The PluginExecution . * @ param store * The database . */ private void addExecutionGoals ( MavenPluginExecutionDescriptor execu...
List < String > goals = pluginExecution . getGoals ( ) ; for ( String goal : goals ) { MavenExecutionGoalDescriptor goalDescriptor = store . create ( MavenExecutionGoalDescriptor . class ) ; goalDescriptor . setName ( goal ) ; executionDescriptor . getGoals ( ) . add ( goalDescriptor ) ; }
public class IntSets { /** * Returns an IntSet based on the ints in the iterator . This method will try to return the most performant IntSet * based on what ints are provided if any . The returned IntSet may or may not be immutable , so no guarantees are * provided from that respect . * @ param iterator values se...
boolean hasNext = iterator . hasNext ( ) ; if ( ! hasNext ) { return EmptyIntSet . getInstance ( ) ; } int firstValue = iterator . nextInt ( ) ; hasNext = iterator . hasNext ( ) ; if ( ! hasNext ) { return new SingletonIntSet ( firstValue ) ; } // We have 2 or more values so just set them in the SmallIntSet SmallIntSet...
public class DynamoDBTableMapper { /** * Loads an object with the hash and range key . * @ param hashKey The hash key value . * @ param rangeKey The range key value . * @ return The object . * @ see com . amazonaws . services . dynamodbv2 . datamodeling . DynamoDBMapper # load */ public T load ( H hashKey , R r...
return mapper . < T > load ( model . targetType ( ) , hashKey , rangeKey ) ;
public class CmsScheduleManager { /** * Initializes the OpenCms scheduler . < p > * @ param adminCms an OpenCms context object that must have been initialized with " Admin " permissions * @ throws CmsRoleViolationException if the user has insufficient role permissions */ public synchronized void initialize ( CmsObj...
if ( OpenCms . getRunLevel ( ) > OpenCms . RUNLEVEL_1_CORE_OBJECT ) { // simple unit tests will have runlevel 1 and no CmsObject OpenCms . getRoleManager ( ) . checkRole ( adminCms , CmsRole . WORKPLACE_MANAGER ) ; } // the list of job entries m_jobs = new ArrayList < CmsScheduledJobInfo > ( ) ; // save the admin cms m...
public class DB { /** * This factory method is the mechanism for constructing a new embedded database for use . This * method automatically installs the database and prepares it for use . * @ param config Configuration of the embedded instance * @ return a new DB instance * @ throws ManagedProcessException if s...
DB db = new DB ( config ) ; db . prepareDirectories ( ) ; db . unpackEmbeddedDb ( ) ; db . install ( ) ; return db ;
public class TEEJBInvocationInfo { /** * This is called by the EJB container server code to write a * EJB method call preinvoke exceptions record to the trace log , if enabled . */ public static void tracePreInvokeException ( EJSDeployedSupport s , EJSWrapperBase wrapper , Throwable t ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { StringBuffer sbuf = new StringBuffer ( ) ; sbuf . append ( MthdPreInvokeException_Type_Str ) . append ( DataDelimiter ) . append ( MthdPreInvokeException_Type ) . append ( DataDelimiter ) ; writeDeployedSupportInfo ( s , sbuf , wrapper , t ) ;...
public class ChunkFrequencyManager { /** * Aggregation function to compute the addition for the chunk values . * @ return */ public BiFunction < Integer , Integer , Short > addition ( ) { } }
return ( a , b ) -> ( short ) Math . min ( a , 255 ) ;
public class TryCatchBlockNode { /** * Updates the index of this try catch block in the method ' s list of try * catch block nodes . This index maybe stored in the ' target ' field of the * type annotations of this block . * @ param index * the new index of this try catch block in the method ' s list of * try...
int newTypeRef = 0x42000000 | ( index << 8 ) ; if ( visibleTypeAnnotations != null ) { for ( TypeAnnotationNode tan : visibleTypeAnnotations ) { tan . typeRef = newTypeRef ; } } if ( invisibleTypeAnnotations != null ) { for ( TypeAnnotationNode tan : invisibleTypeAnnotations ) { tan . typeRef = newTypeRef ; } }
public class TargetStreamManager { /** * Flush any existing streams and throw away any cached messages . * @ param streamID * @ throws SIResourceException * @ throws SIException */ public void forceFlush ( SIBUuid12 streamID ) throws SIResourceException , SIResourceException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "forceFlush" , new Object [ ] { streamID } ) ; // Synchronize to resolve racing messages . synchronized ( flushMap ) { FlushQueryRecord entry = flushMap . remove ( streamID ) ; // Remove the entry ( we may not have ev...
public class UserSettingRepository { /** * region > newString */ @ Programmatic public UserSettingJdo newString ( final String user , final String key , final String description , final String value ) { } }
return newSetting ( user , key , description , SettingType . STRING , value ) ;
public class SagaMessageStream { /** * { @ inheritDoc } */ @ Override public void handle ( @ Nonnull final Object message ) throws InvocationTargetException , IllegalAccessException { } }
checkNotNull ( message , "Message to handle must not be null." ) ; handle ( message , null , null ) ;
public class DataManager { /** * Log basic information about initialisation environment . */ private void logInfo ( @ NonNull final Logger log ) { } }
log . i ( "App ver. = " + deviceDAO . device ( ) . getAppVer ( ) ) ; log . i ( "Comapi device ID = " + deviceDAO . device ( ) . getDeviceId ( ) ) ; log . d ( "Firebase ID = " + deviceDAO . device ( ) . getInstanceId ( ) ) ;
public class SearchIO { /** * Guess factory class to be used using file extension . * It can be used both for read and for in write . * To be ResultFactory classes automatically available to this subsystem * they must be listed in the file org . biojava . nbio . core . search . io . ResultFactory * located in s...
if ( extensionFactoryAssociation == null ) { extensionFactoryAssociation = new HashMap < String , ResultFactory > ( ) ; ServiceLoader < ResultFactory > impl = ServiceLoader . load ( ResultFactory . class ) ; for ( ResultFactory loadedImpl : impl ) { List < String > fileExtensions = loadedImpl . getFileExtensions ( ) ; ...