signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class OperatorBufferCursor { /** * virtual bool IsRecycling ( ) OVERRIDE { return false ; } */ Geometry buffer ( Geometry geom , double distance ) { } }
return m_bufferer . buffer ( geom , distance , m_Spatial_reference , m_max_deviation , m_max_vertices_in_full_circle , m_progress_tracker ) ;
public class TransactionVisibilityFilter { /** * Determines the return code of TransactionVisibilityFilter based on sub - filter ' s return code . * Sub - filter can only exclude cells included by TransactionVisibilityFilter , i . e . , sub - filter ' s * INCLUDE will be ignored . This behavior makes sure that sub ...
// Return the more restrictive of the two filter responses switch ( subFilterCode ) { case INCLUDE : return txFilterCode ; case INCLUDE_AND_NEXT_COL : return ReturnCode . INCLUDE_AND_NEXT_COL ; case SKIP : return txFilterCode == ReturnCode . INCLUDE ? ReturnCode . SKIP : ReturnCode . NEXT_COL ; default : return subFilt...
public class ApiOvhClusterhadoop { /** * Add the Role to the Node * REST : POST / cluster / hadoop / { serviceName } / node / { hostname } / role * @ param type [ required ] Role name * @ param serviceName [ required ] The internal name of your cluster * @ param hostname [ required ] Hostname of the node */ pub...
String qPath = "/cluster/hadoop/{serviceName}/node/{hostname}/role" ; StringBuilder sb = path ( qPath , serviceName , hostname ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "type" , type ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp...
public class TextBoxEditorDecorator { /** * Set the widget that the EditorPanel will display . This method will automatically call { @ link # setEditor } . * @ param widget a { @ link ValueBoxBase } widget */ @ UiChild ( limit = 1 , tagname = "valuebox" ) public void setValueBox ( ValueBoxBase < T > widget ) { } }
contents . add ( widget ) ; setEditor ( widget . asEditor ( ) ) ;
public class AtomContainer { /** * { @ inheritDoc } */ @ Override public void removeLonePair ( ILonePair lonePair ) { } }
int pos = indexOf ( lonePair ) ; if ( pos != - 1 ) removeLonePair ( pos ) ;
public class L2Cache { /** * Retrieves an entity from the cache or the underlying repository . * @ param repository the underlying repository * @ param id the ID of the entity to retrieve * @ return the retrieved Entity , or null if the entity is not present . * @ throws com . google . common . util . concurren...
LoadingCache < Object , Optional < Map < String , Object > > > cache = getEntityCache ( repository ) ; EntityType entityType = repository . getEntityType ( ) ; return cache . getUnchecked ( id ) . map ( e -> entityHydration . hydrate ( e , entityType ) ) . orElse ( null ) ;
public class EventsHelper { /** * Bind a function to the mouseover event of each matched element . * @ param jsScope * Scope to use * @ return the jQuery code */ public static ChainableStatement mouseover ( JsScope jsScope ) { } }
return new DefaultChainableStatement ( MouseEvent . MOUSEOVER . getEventLabel ( ) , jsScope . render ( ) ) ;
public class RepositoryXmlHandler { /** * characters callback . */ public void characters ( char ch [ ] , int start , int length ) { } }
if ( m_CurrentString == null ) m_CurrentString = new String ( ch , start , length ) ; else m_CurrentString += new String ( ch , start , length ) ;
public class Pubsub { /** * Delete a Pub / Sub topic . * @ param project The Google Cloud project . * @ param topic The name of the topic to delete . * @ return A future that is completed when this request is completed . The future will be completed with { @ code null } * if the response is 404. */ public Pubsu...
return deleteTopic ( canonicalTopic ( project , topic ) ) ;
public class ParsingUtils { /** * Parses a string with a locale and returns the corresponding number * @ throws ParseException if number cannot be parsed */ public static double parseNumber ( String number , Locale locale ) throws ParseException { } }
if ( "" . equals ( number ) ) { return Double . NaN ; } return NumberFormat . getNumberInstance ( locale ) . parse ( number ) . doubleValue ( ) ;
public class MetaUtil { /** * 获得结果集的所有列名 * @ param rs 结果集 * @ return 列名数组 * @ throws DbRuntimeException SQL执行异常 */ public static String [ ] getColumnNames ( ResultSet rs ) throws DbRuntimeException { } }
try { ResultSetMetaData rsmd = rs . getMetaData ( ) ; int columnCount = rsmd . getColumnCount ( ) ; String [ ] labelNames = new String [ columnCount ] ; for ( int i = 0 ; i < labelNames . length ; i ++ ) { labelNames [ i ] = rsmd . getColumnLabel ( i + 1 ) ; } return labelNames ; } catch ( Exception e ) { throw new DbR...
public class UpdateFleetPortSettingsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateFleetPortSettingsRequest updateFleetPortSettingsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateFleetPortSettingsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateFleetPortSettingsRequest . getFleetId ( ) , FLEETID_BINDING ) ; protocolMarshaller . marshall ( updateFleetPortSettingsRequest . getInboundPermissio...
public class WebAppMutableDescriptorImpl { /** * TODO Add @ Override */ @ Override public FilterMutableType getOrCreateFilter ( ) { } }
final List < Node > nodeList = this . getRootNode ( ) . get ( "filter" ) ; if ( nodeList . size ( ) > 0 ) { return createNewFilterViewForModel ( nodeList . get ( 0 ) ) ; } return createFilter ( ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public FontFidelityStpFntEx createFontFidelityStpFntExFromString ( EDataType eDataType , String initialValue ) { } }
FontFidelityStpFntEx result = FontFidelityStpFntEx . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class DbgpXmlEntityParser { /** * $ NON - NLS - 1 $ */ public static IDbgpSessionInfo parseSession ( Element element ) { } }
String appId = element . getAttribute ( ATTR_APPID ) ; String ideKey = element . getAttribute ( ATTR_IDEKEY ) ; String session = element . getAttribute ( ATTR_SESSION ) ; String threadId = element . getAttribute ( ATTR_THREAD ) ; String parentId = element . getAttribute ( ATTR_PARENT ) ; String language = element . get...
public class AppRate { /** * End montoring */ public void endMonitoring ( ) { } }
if ( debug ) LogD ( "End monitoring" ) ; commitEditor ( ) ; long start = settings . getLong ( KEY_MONITOR_START , 0 ) ; if ( start == 0 ) { if ( debug ) LogD ( "Monitor error. End monitoring called before start." ) ; return ; } editor . putLong ( KEY_MONITOR_TOTAL , settings . getLong ( KEY_MONITOR_TOTAL , 0 ) + ( Syst...
public class BootstrapMojo { /** * Print the passed instruction in the console . */ private void printInstruction ( String instruction ) { } }
System . out . println ( StringUtils . repeat ( "-" , instruction . length ( ) ) ) ; System . out . println ( instruction ) ; System . out . println ( StringUtils . repeat ( "-" , instruction . length ( ) ) ) ;
public class ProcessorDef { /** * Creates an chain of objects which provide default values in descending * order of significance . * @ param baseDef * corresponding ProcessorDef from CCTask , will be last element * in array unless inherit = false * @ return default provider array */ protected final ProcessorD...
ProcessorDef extendsDef = getExtends ( ) ; final Vector chain = new Vector ( ) ; while ( extendsDef != null && ! chain . contains ( extendsDef ) ) { chain . addElement ( extendsDef ) ; extendsDef = extendsDef . getExtends ( ) ; } if ( baseDef != null && getInherit ( ) ) { chain . addElement ( baseDef ) ; } final Proces...
public class ActionPrototype { /** * Replies the string that permits to identify the action prototype according to the Java variable name . * @ return the identifier . */ public String toActionId ( ) { } }
final StringBuilder b = new StringBuilder ( ) ; b . append ( getActionName ( ) ) ; for ( final String type : this . signature ) { b . append ( "_" ) ; // $ NON - NLS - 1 $ for ( final char c : type . replaceAll ( "(\\[\\])|\\*" , "Array" ) . toCharArray ( ) ) { // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ if ( Character ...
public class Validators { /** * Determine if the input int parameter is it in a range . if yes , the check passes * @ param min input must be > min number * @ param max input must be < max number * @ return Validation */ public static Validation < Integer > range ( int min , int max ) { } }
return greaterThan ( min ) . and ( lowerThan ( max ) ) ;
public class DatePickerBase { /** * Convert GWT date format to bootstrap date format * @ param format date format using GWT notation * @ return date format using bootstrap notation */ private static String toBootstrapDateFormat ( final String format ) { } }
String bootstrap_format = format ; // Replace long day name " EEEE " with " DD " bootstrap_format = bootstrap_format . replace ( "EEEE" , "DD" ) ; // Replace short day name " EE " with " DD " bootstrap_format = bootstrap_format . replaceAll ( "E{1,3}" , "D" ) ; // If there are at least 3 Ms there is month name in wordi...
public class ArraySet { /** * Adds the specified object to this set . The set is not modified if it * already contains the object . * @ param value the object to add . * @ return { @ code true } if this set is modified , { @ code false } otherwise . * @ throws ClassCastException * when the class of the object...
final int hash ; int index ; if ( value == null ) { hash = 0 ; index = indexOfNull ( ) ; } else { hash = value . hashCode ( ) ; index = indexOf ( value , hash ) ; } if ( index >= 0 ) { return false ; } index = ~ index ; if ( mSize >= mHashes . length ) { final int n = mSize >= ( BASE_SIZE * 2 ) ? ( mSize + ( mSize >> 1...
public class CPRuleAssetCategoryRelUtil { /** * Returns the last cp rule asset category rel in the ordered set where CPRuleId = & # 63 ; . * @ param CPRuleId the cp rule ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp rule a...
return getPersistence ( ) . fetchByCPRuleId_Last ( CPRuleId , orderByComparator ) ;
public class TimestampInterval { /** * / * [ deutsch ] * Liefert einen Zufallszeitstempel innerhalb dieses Intervalls . < / p > * @ return random timestamp within this interval * @ throws IllegalStateException if this interval is infinite or empty or if there is no canonical form * @ see # toCanonical ( ) * @...
try { // use UTC - offset for internal conversion only MomentInterval interval = this . toCanonical ( ) . atUTC ( ) ; return interval . random ( ) . toZonalTimestamp ( ZonalOffset . UTC ) ; } catch ( IllegalStateException ise ) { throw new IllegalStateException ( "Cannot get random timestamp in an empty or infinite int...
public class GeneratedDConnectionDaoImpl { /** * query - by method for field profileUrl * @ param profileUrl the specified attribute * @ return an Iterable of DConnections for the specified profileUrl */ public Iterable < DConnection > queryByProfileUrl ( java . lang . String profileUrl ) { } }
return queryByField ( null , DConnectionMapper . Field . PROFILEURL . getFieldName ( ) , profileUrl ) ;
public class UriTemplate { /** * Returns the names of the variables discovered . * @ return */ public List < String > getVariableNames ( ) { } }
return variables . asList ( ) . stream ( ) . map ( TemplateVariable :: getName ) . collect ( Collectors . toList ( ) ) ;
public class GLINEImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GLINE__RG : getRg ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class Pickler { /** * Process a single object to be pickled . */ private boolean dispatch ( Class < ? > t , Object o ) throws IOException { } }
// is it a primitive array ? Class < ? > componentType = t . getComponentType ( ) ; if ( componentType != null ) { if ( componentType . isPrimitive ( ) ) { put_arrayOfPrimitives ( componentType , o ) ; } else { put_arrayOfObjects ( ( Object [ ] ) o ) ; } return true ; } // first the primitive types if ( o instanceof Bo...
public class MessageParser { /** * < pre > * the table def : * channel _ info varchar * channel _ id varchar * 每次解析时 , 每个事务首先获取 retl _ mark 下的 channel _ info 或 channel _ id 字段变更 。 * a . 如果存在 channel _ info 以 ' _ SYNC ' 结尾的字符串 , 则忽略本次事务的数据变更 ; * b . 如果不等于 , 则执行下面的判断 。 * i . 如果存在channel _ id = " xx " , 则检查对...
// 检查channel _ info字段 // 首先检查下after记录 , 从无变有的过程 , 一般出现在事务头 Column infokColumn = getColumnIgnoreCase ( rowData . getAfterColumnsList ( ) , pipeline . getParameters ( ) . getSystemMarkTableInfo ( ) ) ; // 匹配对应的channelInfo , 如果以 _ SYNC结尾 , 则认为需要忽略 if ( infokColumn != null && StringUtils . endsWithIgnoreCase ( infokColumn ...
public class EjbProcessApplication { /** * lookup a proxy object representing the invoked business view of this component . */ protected ProcessApplicationInterface lookupSelfReference ( ) { } }
try { InitialContext ic = new InitialContext ( ) ; SessionContext sctxLookup = ( SessionContext ) ic . lookup ( EJB_CONTEXT_PATH ) ; return sctxLookup . getBusinessObject ( getBusinessInterface ( ) ) ; } catch ( NamingException e ) { throw LOG . ejbPaCannotLookupSelfReference ( e ) ; }
public class OnlineUpdateUASparser { /** * Gets the current version from user - agent - string . info * @ return * @ throws IOException */ protected String getVersionFromServer ( ) throws IOException { } }
URL url = new URL ( VERSION_CHECK_URL ) ; InputStream is = url . openStream ( ) ; try { byte [ ] buff = new byte [ 4048 ] ; int len = is . read ( buff ) ; return new String ( buff , 0 , len ) ; } finally { is . close ( ) ; }
public class ArtifactManagingServiceImpl { /** * ( non - Javadoc ) * @ see org . exoplatform . services . jcr . ext . maven . ArtifactManagingService # exportArtifacts * ( org . exoplatform . services . jcr . ext . common . SessionProvider , * org . exoplatform . services . jcr . ext . maven . FolderDescriptor , ...
Session session = currentSession ( sp ) ; Node parentNode ; if ( rootNodePath . length ( ) > 1 ) { parentNode = ( Node ) session . getItem ( rootNodePath + "/" + parentFolder . getAsPath ( ) ) ; } else { parentNode = ( Node ) session . getItem ( "/" + parentFolder . getAsPath ( ) ) ; } LOG . info ( "Write repository to...
public class SpecificationAction { /** * < p > removeReference . < / p > * @ return a { @ link java . lang . String } object . */ public String removeReference ( ) { } }
isEditMode = true ; try { gpUtil . getGPServerService ( ) . removeReference ( instanceOfReference ( ) ) ; } catch ( GreenPepperServerException e ) { addActionError ( e . getId ( ) ) ; } return retrieveReferenceList ( ) ;
public class SelectBooleanCheckboxRenderer { /** * Renders the start of the input tag . This method is protected in order to * allow third - party frameworks to derive from it . * @ param rw * the response writer * @ param selectBooleanCheckbox * the component to render * @ throws IOException * may be thr...
rw . startElement ( "input" , selectBooleanCheckbox ) ; rw . writeAttribute ( "name" , clientId + "_helper" , null ) ; rw . writeAttribute ( "value" , "on" , "value" ) ; rw . writeAttribute ( "checked" , "true" , "checked" ) ; rw . writeAttribute ( "type" , "hidden" , "type" ) ; rw . writeAttribute ( "style" , "display...
public class MemoryReport { /** * Get a map of CacheMode with all keys associated with the specified value * @ param value Value for all keys * @ return Map */ public static Map < CacheMode , Long > cacheModeMapFor ( long value ) { } }
if ( value == 0 ) { return CACHE_MODE_ALL_ZEROS ; } Map < CacheMode , Long > m = new HashMap < > ( ) ; for ( CacheMode cm : CacheMode . values ( ) ) { m . put ( cm , value ) ; } return m ;
public class ByteArrayInput { /** * Attempt to read a field tag , returning zero if we have reached EOF . * Protocol message parsers use this to read tags , since a protocol message * may legally end wherever a tag occurs , and zero is not a valid tag * number . */ public int readTag ( ) throws IOException { } }
if ( offset == limit ) { lastTag = 0 ; return 0 ; } final int tag = readRawVarint32 ( ) ; if ( tag >>> WireFormat . TAG_TYPE_BITS == 0 ) { // If we actually read zero , that ' s not a valid tag . throw ProtobufException . invalidTag ( ) ; } lastTag = tag ; return tag ;
public class SomeNotAuditedObject { /** * region > updateNameAndNumber */ @ Action ( ) public SomeNotAuditedObject updateNameAndNumber ( @ ParameterLayout ( named = "Name" ) final String name , @ Parameter ( optionality = Optionality . OPTIONAL ) @ ParameterLayout ( named = "Number" ) final Integer number ) { } }
setName ( name ) ; setNumber ( number ) ; return this ;
public class GelfBootstrap { /** * Bootstrap the SLF4J root logger with a configured { @ link biz . paluch . logging . gelf . logback . GelfLogbackAppender } . * @ param name The facility to use in the GELF messages * @ param host The host of the Graylog2 server * @ param port The port of the Graylog2 server * ...
// initially configure for WARN + GELF logging final GelfAppenderFactory gelf = new GelfAppenderFactory ( ) ; gelf . setIncludeFullMDC ( true ) ; gelf . setThreshold ( "WARN" ) ; gelf . setHost ( host ) ; gelf . setPort ( port ) ; gelf . setOriginHost ( hostName ) ; final Logger root = ( Logger ) LoggerFactory . getLog...
public class LogbackMetrics { /** * Used by { @ link Counter # increment ( ) } implementations that may cause a logback logging event to occur . * Attempting to instrument that implementation would cause a { @ link StackOverflowError } . * @ param r Don ' t record metrics on logging statements that occur inside of ...
ignoreMetrics . set ( true ) ; r . run ( ) ; ignoreMetrics . remove ( ) ;
public class AddOn { /** * Tells whether or not this add - on can be loaded in the given { @ code zapVersion } . * @ param zapVersion the ZAP version that will be checked * @ return { @ code true } if the add - on can be loaded in the given { @ code zapVersion } , { @ code false } otherwise */ public boolean canLoa...
// Require add - ons to declare the version they implement if ( this . notBeforeVersion == null || this . notBeforeVersion . isEmpty ( ) ) { return false ; } ZapReleaseComparitor zrc = new ZapReleaseComparitor ( ) ; ZapRelease zr = new ZapRelease ( zapVersion ) ; ZapRelease notBeforeRelease = new ZapRelease ( this . no...
public class CompletionUtils { /** * Builds proposals from a map ( key = replacement , value = description ) . * @ param viewer the viewer * @ param candidates a non - null list of candidates * @ param prefix a non - null prefix * @ param offset the viewer ' s offset * @ return a non - null list of proposals ...
List < RoboconfCompletionProposal > result = new ArrayList < > ( ) ; for ( Map . Entry < String , String > entry : candidates . entrySet ( ) ) { // Matching candidate ? String candidate = entry . getKey ( ) ; if ( ! startsWith ( candidate , prefix ) ) continue ; // No description = > basic proposal if ( Utils . isEmpty...
public class AdminToolUtils { /** * Utility function that checks the execution state of the server by * checking the state of { @ link VoldemortState } < br > * This function checks if a node is in normal state ( * { @ link VoldemortState # NORMAL _ SERVER } ) . * @ param adminClient An instance of AdminClient ...
assertServerInNormalState ( adminClient , Lists . newArrayList ( new Integer [ ] { nodeId } ) ) ;
public class MicronautConsole { /** * Use in testing when System . out , System . err or System . in change . * @ param systemIn The system in * @ param systemOut The system out * @ param systemErr The system err * @ throws IOException if there is an error */ public void reinitialize ( InputStream systemIn , Pr...
if ( reader != null ) { reader . shutdown ( ) ; } initialize ( systemIn , systemOut , systemErr ) ;
public class GlobalForwardingRuleClient { /** * Returns the specified GlobalForwardingRule resource . Gets a list of available forwarding rules * by making a list ( ) request . * < p > Sample code : * < pre > < code > * try ( GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient . c...
GetGlobalForwardingRuleHttpRequest request = GetGlobalForwardingRuleHttpRequest . newBuilder ( ) . setForwardingRule ( forwardingRule ) . build ( ) ; return getGlobalForwardingRule ( request ) ;
public class I2b2UserResource { /** * Automatically creates user and role records in i2b2 ' s PM cell , if the * user is authorized for eurekaclinical - i2b2 - integration and is a member of * a group that has an associated i2b2 project . * @ param req the HTTP servlet request object . * @ return the response o...
AttributePrincipal userPrincipal = ( AttributePrincipal ) req . getUserPrincipal ( ) ; String username = userPrincipal . getName ( ) ; String fullName = username ; String email = ( String ) userPrincipal . getAttributes ( ) . get ( this . properties . getCasEmailAttribute ( ) ) ; Set < String > domainCache = new HashSe...
public class AMetaDataHandler { /** * Transfer factor information from ddf to this DDF * @ param ddf * @ param columns Columns to re - compute factors * @ throws DDFException */ public void copyFactor ( DDF ddf , List < String > columns ) throws DDFException { } }
// if there is no columns to recompute factor info if ( columns == null ) { columns = new ArrayList < String > ( ) ; } for ( Schema . Column col : ddf . getSchema ( ) . getColumns ( ) ) { if ( this . getDDF ( ) . getColumn ( col . getName ( ) ) != null && col . getColumnClass ( ) == Schema . ColumnClass . FACTOR ) { //...
public class TableSliceGroup { /** * For a subtable that is grouped by the values in more than one column , split the grouping column into separate * cols and return the revised view */ private Table splitGroupingColumn ( Table groupTable ) { } }
if ( splitColumnNames . length > 0 ) { List < Column < ? > > newColumns = new ArrayList < > ( ) ; List < Column < ? > > columns = sourceTable . columns ( splitColumnNames ) ; for ( Column < ? > column : columns ) { Column < ? > newColumn = column . emptyCopy ( ) ; newColumns . add ( newColumn ) ; } // iterate through t...
public class MBCRGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . MBCRG__RG_LENGTH : setRGLength ( RG_LENGTH_EDEFAULT ) ; return ; case AfplibPackage . MBCRG__TRIPLETS : getTriplets ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class SignerFactory { /** * Create an instance of the given signer type and initialize it with the * given parameters . * @ param signerType The signer type . * @ param params The parameters to intialize the signer with . * @ return The new signer instance . */ @ SdkProtectedApi public static Signer crea...
Signer signer = createSigner ( signerType ) ; if ( signer instanceof ServiceAwareSigner ) { ( ( ServiceAwareSigner ) signer ) . setServiceName ( params . getServiceName ( ) ) ; } if ( signer instanceof RegionAwareSigner ) { ( ( RegionAwareSigner ) signer ) . setRegionName ( params . getRegionName ( ) ) ; } return signe...
public class GearWearableDevice { /** * Calculate sensitivity based on distance from center * The farther from the center , the more sensitive the cursor should be ( linearly ) */ private float getSensitivity ( float x , float y ) { } }
double furthestDistance = MAX_DISTANCE ; double distance = Math . sqrt ( Math . pow ( x - CENTER_X , 2 ) + Math . pow ( y - CENTER_Y , 2 ) ) ; double sens = MAX_SENSITIVITY * distance / furthestDistance ; if ( sens > MAX_SENSITIVITY ) { sens = MAX_SENSITIVITY ; } return ( float ) sens ;
public class IntegerMap { /** * Adds the mapping from the provided key to the value . * @ param key * @ param value * @ throws NullPointerException if the key is { @ code null } * @ throws IllegalArgumentException if the key is not an instance of { @ link * Integer } */ @ SuppressWarnings ( "unchecked" ) publ...
int k = checkKey ( key ) ; int index = Arrays . binarySearch ( keyIndices , k ) ; if ( index >= 0 ) { V old = ( V ) ( values [ index ] ) ; values [ index ] = value ; return old ; } else { int newIndex = 0 - ( index + 1 ) ; Object [ ] newValues = Arrays . copyOf ( values , values . length + 1 ) ; int [ ] newIndices = Ar...
public class StreamCharBuffer { /** * resets the state of this buffer ( empties it ) * @ param resetChunkSize */ public final void reset ( boolean resetChunkSize ) { } }
markBufferChanged ( ) ; firstChunk = null ; lastChunk = null ; totalCharsInList = 0 ; totalCharsInDynamicChunks = - 1 ; sizeAtLeast = - 1 ; if ( resetChunkSize ) { chunkSize = firstChunkSize ; totalChunkSize = 0 ; } if ( allocBuffer == null ) { allocBuffer = new AllocatedBuffer ( chunkSize ) ; } else { allocBuffer . cl...
public class DatePickerNumberOfMonths { /** * Method setting the right parameter * @ param shortParam * Short parameter * @ param arrayParam * Array parameter */ private void setParam ( Short shortParam , ArrayItemOptions < IntegerItemOptions > arrayParam ) { } }
this . shortParam = shortParam ; this . arrayParam = arrayParam ;
public class VirtualConnectionImpl { /** * @ see VirtualConnection # requestPermissionToWrite ( ) */ @ Override public boolean requestPermissionToWrite ( ) { } }
boolean rc = false ; synchronized ( this ) { if ( ( currentState & WRITE_NOT_ALLOWED_MASK ) == 0 ) { currentState = ( currentState | WRITE_PENDING ) & WRITE_PENDING_CLEAR_OUT ; rc = true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "requestPermissionToWrite return...
public class UpdateSecurityGroupRuleDescriptionsEgressRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < UpdateSecurityGroupRuleDescriptionsEgressRequest > getDryRunRequest...
Request < UpdateSecurityGroupRuleDescriptionsEgressRequest > request = new UpdateSecurityGroupRuleDescriptionsEgressRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class Reader { /** * Skips characters . This method will block until some characters are * available , an I / O error occurs , or the end of the stream is reached . * @ param n The number of characters to skip * @ return The number of characters actually skipped * @ exception IllegalArgumentException If ...
if ( n < 0L ) throw new IllegalArgumentException ( "skip value is negative" ) ; int nn = ( int ) Math . min ( n , maxSkipBufferSize ) ; synchronized ( lock ) { if ( ( skipBuffer == null ) || ( skipBuffer . length < nn ) ) skipBuffer = new char [ nn ] ; long r = n ; while ( r > 0 ) { int nc = read ( skipBuffer , 0 , ( i...
public class FileWriter { /** * 获得一个带缓存的写入对象 * @ param isAppend 是否追加 * @ return BufferedReader对象 * @ throws IORuntimeException IO异常 */ public BufferedWriter getWriter ( boolean isAppend ) throws IORuntimeException { } }
try { return new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( FileUtil . touch ( file ) , isAppend ) , charset ) ) ; } catch ( Exception e ) { throw new IORuntimeException ( e ) ; }
public class RestClientUtil { /** * 批量创建索引 , 根据时间格式建立新的索引表 * @ param indexName * @ param indexType * @ param beans * @ return * @ throws ElasticSearchException */ public String addDateDocuments ( String indexName , String indexType , List < ? > beans ) throws ElasticSearchException { } }
return addDocuments ( this . indexNameBuilder . getIndexName ( indexName ) , indexType , beans ) ;
public class JsonMapper { /** * Sets a new object mapper , taking into account the original configuration parameters . */ private void setNewObjectMapper ( ) { } }
mapper = new ObjectMapper ( ) ; if ( ! serializeNullValues ) { mapper . setSerializationInclusion ( JsonInclude . Include . NON_NULL ) ; if ( ignoreUnknownProperties ) { mapper . configure ( DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , false ) ; } }
public class NwwUtilities { /** * Insert a layer before the compass layer . * @ param wwd the { @ link WorldWindow } . * @ param layer the layer to insert . */ public static void insertBeforeCompass ( WorldWindow wwd , Layer layer ) { } }
// Insert the layer into the layer list just before the compass . int compassPosition = 0 ; LayerList layers = wwd . getModel ( ) . getLayers ( ) ; for ( Layer l : layers ) { if ( l instanceof CompassLayer ) compassPosition = layers . indexOf ( l ) ; } layers . add ( compassPosition , layer ) ;
public class HDKeyDerivation { /** * Derives a key of the " extended " child number , ie . with the 0x800000 bit specifying whether to use * hardened derivation or not . If derivation fails , tries a next child . */ public static DeterministicKey deriveThisOrNextChildKey ( DeterministicKey parent , int childNumber ) ...
int nAttempts = 0 ; ChildNumber child = new ChildNumber ( childNumber ) ; boolean isHardened = child . isHardened ( ) ; while ( nAttempts < MAX_CHILD_DERIVATION_ATTEMPTS ) { try { child = new ChildNumber ( child . num ( ) + nAttempts , isHardened ) ; return deriveChildKey ( parent , child ) ; } catch ( HDDerivationExce...
public class MediaDefault { /** * Get the temporary path equivalent . * @ return The temporary path . */ private String getPathTemp ( ) { } }
return UtilFolder . getPathSeparator ( File . separator , getTempDir ( loader . get ( ) ) , path . replace ( separator , File . separator ) ) ;
public class StringUtil { /** * Gets the first substring between the given string boundaries . * @ param pSource The source string . * @ param pBeginBoundaryString The string that marks the beginning . * @ param pEndBoundaryString The string that marks the end . * @ param pOffset The index to start searching in...
// Check offset int offset = ( pOffset < 0 ) ? 0 : pOffset ; // Find the start index int startIndex = pSource . indexOf ( pBeginBoundaryString , offset ) + pBeginBoundaryString . length ( ) ; if ( startIndex < 0 ) { return null ; } // Find the end index int endIndex = pSource . indexOf ( pEndBoundaryString , startIndex...
public class Dictionary { /** * Gets content of the current object as an Map . The values contained in the returned * Map object are all JSON based values . * @ return the Map object representing the content of the current object in the JSON format . */ @ NonNull @ Override public Map < String , Object > toMap ( ) ...
synchronized ( lock ) { final Map < String , Object > result = new HashMap < > ( ) ; for ( String key : internalDict ) { result . put ( key , Fleece . toObject ( getMValue ( internalDict , key ) . asNative ( internalDict ) ) ) ; } return result ; }
public class sequenceIntervalImpl { /** * - - - - - Interface BioPAXElement - - - - - */ protected boolean semanticallyEquivalent ( BioPAXElement element ) { } }
if ( ! ( element instanceof sequenceInterval ) ) { return false ; } final sequenceInterval that = ( sequenceInterval ) element ; return ( SEQUENCE_INTERVAL_BEGIN != null ? SEQUENCE_INTERVAL_BEGIN . isEquivalent ( that . getSEQUENCE_INTERVAL_BEGIN ( ) ) : that . getSEQUENCE_INTERVAL_BEGIN ( ) == null ) && ( SEQUENCE_INT...
public class AbstractStoreResource { /** * Insert default values in the table . ( if necessary ) . * @ throws EFapsException on error */ protected void insertDefaults ( ) throws EFapsException { } }
if ( ! getExist ( ) [ 0 ] && getGeneralID ( ) != null ) { try { final ConnectionResource res = Context . getThreadContext ( ) . getConnectionResource ( ) ; Context . getDbType ( ) . newInsert ( AbstractStoreResource . TABLENAME_STORE , "ID" , false ) . column ( "ID" , getGeneralID ( ) ) . column ( AbstractStoreResource...
public class EbeanExprInvoker { /** * < p > getTransformer . < / p > * @ param transformerClass a { @ link java . lang . Class } object . * @ param < R > Result . * @ param < T > Transformer . * @ return a { @ link java . lang . Iterable } object . */ protected < R , T extends Transformer < Transformed < R > > ...
return Providers . getAllRankedSortedProviders ( manager , transformerClass ) ;
public class FindBugs { /** * Configure a baseline bug instance filter . * @ param bugReporter * a DelegatingBugReporter * @ param baselineFileName * filename of baseline Filter * @ throws java . io . IOException * @ throws org . dom4j . DocumentException */ public static BugReporter configureBaselineFilter...
return new ExcludingHashesBugReporter ( bugReporter , baselineFileName ) ;
public class DisambiguatedAlchemyEntity { /** * Set link to Geonames . Note : Provided only for entities that exist in this * that exist in this linked data - set . * @ param geonames link to Geonames */ public void setGeonames ( String geonames ) { } }
if ( geonames != null ) { geonames = geonames . trim ( ) ; } this . geonames = geonames ;
public class DefaultIfEmpty { /** * This operation checks if a string is blank or empty and if it ' s true a default value * will be assigned instead of the initial string . * @ param initialValue The initial string . * @ param defaultValue The default value used to replace the initial string . * @ param trim A...
@ Output ( value = RETURN_CODE , description = RETURN_CODE_DESC ) , @ Output ( value = RETURN_RESULT , description = RETURN_RESULT_DESC ) , @ Output ( value = EXCEPTION , description = EXCEPTION_DESC ) , } , responses = { @ Response ( text = SUCCESS , field = RETURN_CODE , value = ReturnCodes . SUCCESS , matchType = CO...
public class ConfigureForm { /** * Sets whether subscribers should be notified when the configuration changes . * @ param notify true if subscribers should be notified , false otherwise */ public void setNotifyConfig ( boolean notify ) { } }
addField ( ConfigureNodeFields . notify_config , FormField . Type . bool ) ; setAnswer ( ConfigureNodeFields . notify_config . getFieldName ( ) , notify ) ;
public class Schema { /** * private . Input fields get filled here , so must not be final . */ public S fillFrom ( Properties parms ) { } }
// Get passed - in fields , assign into Schema Class clz = getClass ( ) ; for ( String key : parms . stringPropertyNames ( ) ) { try { Field f = clz . getDeclaredField ( key ) ; // No such field error , if parm is junk int mods = f . getModifiers ( ) ; if ( Modifier . isTransient ( mods ) || Modifier . isStatic ( mods ...
public class SendBounceRequest { /** * A list of recipients of the bounced message , including the information required to create the Delivery Status * Notifications ( DSNs ) for the recipients . You must specify at least one < code > BouncedRecipientInfo < / code > in the * list . * @ return A list of recipients...
if ( bouncedRecipientInfoList == null ) { bouncedRecipientInfoList = new com . amazonaws . internal . SdkInternalList < BouncedRecipientInfo > ( ) ; } return bouncedRecipientInfoList ;
public class EmailExtensions { /** * Gets the string from the given { @ link DataHandler } . * @ param dataHandler * the data handler * @ return the string * @ throws IOException * Signals that an I / O exception has occurred . */ public static String getString ( final DataHandler dataHandler ) throws IOExcep...
if ( dataHandler != null ) { final InputStream input = dataHandler . getDataSource ( ) . getInputStream ( ) ; final byte [ ] data = ReadFileExtensions . toByteArray ( input ) ; // TODO check if the output is the same . . . return Base64 . getEncoder ( ) . encodeToString ( data ) ; } return "" ;
public class DRL5Parser { /** * Matches a conditional expression * @ return * @ throws RecognitionException */ public String conditionalExpression ( ) throws RecognitionException { } }
int first = input . index ( ) ; exprParser . conditionalExpression ( ) ; if ( state . failed ) return null ; if ( state . backtracking == 0 && input . index ( ) > first ) { // expression consumed something String expr = input . toString ( first , input . LT ( - 1 ) . getTokenIndex ( ) ) ; return expr ; } return null ;
public class JMXetricXmlConfigurationService { /** * The XML file may specify a processName to be used , which can be different * from the one used in the constructor . The name in XML takes priority . * @ throws XPathExpressionException */ private void configureProcessName ( ) throws XPathExpressionException { } }
if ( processName != null ) { return ; } processName = "" ; Node jvm = getXmlNode ( "/jmxetric-config/jvm" , inputSource ) ; if ( jvm != null ) { processName = jvm . getAttributes ( ) . getNamedItem ( "process" ) . getNodeValue ( ) ; }
public class MimeTypeParser { /** * Try to convert the string representation of a MIME type to an object . The * default quoting algorithm { @ link CMimeType # DEFAULT _ QUOTING } is used to * un - quote strings . * @ param sMimeType * The string representation to be converted . May be < code > null < / code > ...
ValueEnforcer . notNull ( eQuotingAlgorithm , "QuotingAlgorithm" ) ; // Trim final String sRealMimeType = StringHelper . trim ( sMimeType ) ; // No content - > no mime type if ( StringHelper . hasNoText ( sRealMimeType ) ) return null ; // Special case use sometimes from within browsers if ( sRealMimeType . equals ( "*...
public class RpcLookoutId { /** * create consumerId * @ return consumerId */ public Id fetchConsumerStatId ( ) { } }
if ( consumerId == null ) { synchronized ( consumerIdLock ) { if ( consumerId == null ) { consumerId = Lookout . registry ( ) . createId ( "rpc.consumer.service.stats" ) ; } } } return consumerId ;
public class ChunkableContent { /** * This method finds the maximum 1 - KB divisor of arg maxChunkSize that is * less than 8 - KB . * It also ensures that arg maxChunkSize is a multiple of 1 - KB , otherwise * the stream buffering would lose bytes if the maxChunkSize was not * divisible by the buffer size . *...
final int KB = 1000 ; // Ensure maxChunkSize falls on 1 - KB boundaries . if ( maxChunkSize % KB != 0 ) { String m = "MaxChunkSize must be multiple of " + KB + ": " + maxChunkSize ; log . error ( m ) ; throw new DuraCloudRuntimeException ( m ) ; } // Find maximum block factor less than or equal to 8 - KB . long size = ...
public class dbuser { /** * Use this API to fetch filtered set of dbuser resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static dbuser [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
dbuser obj = new dbuser ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; dbuser [ ] response = ( dbuser [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class ZipUtil { /** * Copies an existing ZIP file and transforms a given entry in it . * @ param is * a ZIP input stream . * @ param path * new ZIP entry path . * @ param transformer * transformer for the given ZIP entry . * @ param os * a ZIP output stream . * @ return < code > true < / code >...
return transformEntry ( is , new ZipEntryTransformerEntry ( path , transformer ) , os ) ;
public class cspolicylabel_binding { /** * Use this API to fetch cspolicylabel _ binding resource of given name . */ public static cspolicylabel_binding get ( nitro_service service , String labelname ) throws Exception { } }
cspolicylabel_binding obj = new cspolicylabel_binding ( ) ; obj . set_labelname ( labelname ) ; cspolicylabel_binding response = ( cspolicylabel_binding ) obj . get_resource ( service ) ; return response ;
public class ActionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case XtextPackage . ACTION__TYPE : setType ( ( TypeRef ) null ) ; return ; case XtextPackage . ACTION__FEATURE : setFeature ( FEATURE_EDEFAULT ) ; return ; case XtextPackage . ACTION__OPERATOR : setOperator ( OPERATOR_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class SAXiTextHandler { /** * This method deals with the starting tags . * @ param name * the name of the tag */ public void handleEndingTags ( String name ) { } }
// System . err . println ( " Stop : " + name ) ; if ( ElementTags . IGNORE . equals ( name ) ) { ignore = false ; return ; } if ( ignore ) return ; // tags that don ' t have any content if ( isNewpage ( name ) || ElementTags . ANNOTATION . equals ( name ) || ElementTags . IMAGE . equals ( name ) || isNewline ( name ) ...
public class PeerManager { /** * Called when a peer announces its intention to release a lock . */ protected void peerReleasingLock ( PeerNode peer , NodeObject . Lock lock ) { } }
// refuse to ratify if we don ' t believe they own the lock String owner = queryLock ( lock ) ; if ( ! peer . getNodeName ( ) . equals ( owner ) ) { log . warning ( "Refusing to ratify lock release." , "lock" , lock , "node" , peer . getNodeName ( ) , "owner" , owner ) ; return ; } // check for an existing handler Lock...
public class CudaDataBufferFactory { /** * Creates a half - precision data buffer * @ param offset * @ param data the data to create the buffer from * @ param copy * @ return the new buffer */ @ Override public DataBuffer createHalf ( long offset , byte [ ] data , boolean copy ) { } }
return new CudaHalfDataBuffer ( ArrayUtil . toFloatArray ( data ) , copy , offset ) ;
public class MediaClient { /** * Deletes a pipeline with the specified pipeline name . * @ param request The request object containing all options for deleting a pipelines . */ public void deletePipeline ( DeletePipelineRequest request ) { } }
checkNotNull ( request , "The parameter request should NOT be null." ) ; checkStringNotEmpty ( request . getPipelineName ( ) , "The parameter pipelineName should NOT be null or empty string." ) ; InternalRequest internalRequest = createRequest ( HttpMethodName . DELETE , request , PIPELINE , request . getPipelineName (...
public class VfsUtility { /** * Close the FileSystemManager . * @ param fsManager the file system to be closed . It can be null . */ static public void close ( FileSystemManager fsManager ) { } }
if ( fsManager != null ) { if ( fsManager instanceof DefaultFileSystemManager ) { ( ( DefaultFileSystemManager ) fsManager ) . close ( ) ; } else { throw new IllegalStateException ( "Only instance of DefaultFileSystemManager can be closed here." ) ; } }
public class DecodedBitStreamParser { /** * See ISO 16022:2006 , 5.2.9 and Annex B , B . 2 */ private static void decodeBase256Segment ( BitSource bits , StringBuilder result , Collection < byte [ ] > byteSegments ) throws FormatException { } }
// Figure out how long the Base 256 Segment is . int codewordPosition = 1 + bits . getByteOffset ( ) ; // position is 1 - indexed int d1 = unrandomize255State ( bits . readBits ( 8 ) , codewordPosition ++ ) ; int count ; if ( d1 == 0 ) { // Read the remainder of the symbol count = bits . available ( ) / 8 ; } else if (...
public class TIFFUtil { /** * Updates the given ImageIO metadata with Sun ' s custom TIFF tags , as described in * the < a href = " https : / / svn . apache . org / repos / asf / xmlgraphics / commons / tags / commons - 1_3_1 / src / java / org / apache / xmlgraphics / image / writer / imageio / ImageIOTIFFImageWrite...
String metaDataFormat = metadata . getNativeMetadataFormatName ( ) ; if ( metaDataFormat == null ) { logger . debug ( "TIFF image writer doesn't support any data format" ) ; return ; } debugLogMetadata ( metadata , metaDataFormat ) ; IIOMetadataNode root = new IIOMetadataNode ( metaDataFormat ) ; IIOMetadataNode ifd ; ...
public class CommonG { /** * Returns the information contained in file passed as parameter * @ param baseData path to file to be read * @ param type type of information , it can be : json | string * @ return String */ public String retrieveData ( String baseData , String type ) { } }
String result ; InputStream stream = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( baseData ) ; Writer writer = new StringWriter ( ) ; char [ ] buffer = new char [ 1024 ] ; Reader reader ; if ( stream == null ) { this . getLogger ( ) . error ( "File does not exist: {}" , baseData ) ; return "ERR! File not f...
public class AbstractAttributeCollection { /** * Fire the all attribute removal event . */ protected synchronized void fireAttributeClearedEvent ( ) { } }
if ( this . listenerList != null && isEventFirable ( ) ) { final AttributeChangeListener [ ] list = new AttributeChangeListener [ this . listenerList . size ( ) ] ; this . listenerList . toArray ( list ) ; final AttributeChangeEvent event = new AttributeChangeEvent ( this , Type . REMOVE_ALL , null , null , null , null...
public class SegmentClipper { /** * Gets the clip area corner which is the closest to the given segment * @ since 6.0.0 * We have a clip area and we have a segment with no intersection with this clip area . * The question is : how do we clip this segment ? * If we only clip both segment ends , we may end up wit...
double min = Double . MAX_VALUE ; int corner = 0 ; for ( int i = 0 ; i < cornerX . length ; i ++ ) { final double distance = Distance . getSquaredDistanceToSegment ( cornerX [ i ] , cornerY [ i ] , pX0 , pY0 , pX1 , pY1 ) ; if ( min > distance ) { min = distance ; corner = i ; } } return corner ;
public class ModuleMetadataDatabaseImpl { /** * { @ inheritDoc } */ public GetVideoInfoEpisodeOperation buildGetVideoInfoEpisodeOperation ( String databasePath , String videoId ) { } }
return new GetVideoInfoEpisodeOperation ( getOperationFactory ( ) , databasePath , videoId ) ;
public class GetSchemaAsJsonRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetSchemaAsJsonRequest getSchemaAsJsonRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getSchemaAsJsonRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getSchemaAsJsonRequest . getSchemaArn ( ) , SCHEMAARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " ...
public class AbstrStrMatcher { /** * Returns a new string that append the specified string * to the delegate string with specified separator * @ param join * @ return */ public String joinWith ( String separator , Object ... join ) { } }
return Joiner . on ( separator ) . join ( delegate . get ( ) , EMPTY , join ) ;
public class Category { /** * Delegates to { @ link org . slf4j . Logger # warn ( String , Throwable ) } method in * SLF4J . */ public void warn ( Object message , Throwable t ) { } }
differentiatedLog ( null , CATEGORY_FQCN , LocationAwareLogger . WARN_INT , message , t ) ;
public class CDI12ContainerConfig { /** * DS method to modify the configuration of this component * @ param compcontext the context of this component * @ param properties the updated configuration properties */ @ Modified protected void modified ( ComponentContext compcontext , Map < String , Object > properties ) ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Modifying " + this ) ; } this . updateConfiguration ( properties ) ;
public class PlayEngine { /** * Resume playback * @ param position * Resumes playback * @ throws IllegalStateException * If stream is stopped */ public void resume ( int position ) throws IllegalStateException { } }
// allow resume from pause switch ( subscriberStream . getState ( ) ) { case PAUSED : subscriberStream . setState ( StreamState . PLAYING ) ; sendReset ( ) ; sendResumeStatus ( currentItem . get ( ) ) ; if ( pullMode ) { sendVODSeekCM ( position ) ; subscriberStream . onChange ( StreamState . RESUMED , currentItem . ge...
public class FileSystemDeploymentService { /** * { @ inheritDoc } */ @ Override public synchronized void startScanner ( final DeploymentOperations deploymentOperations ) { } }
this . deploymentOperations = deploymentOperations ; final boolean scanEnabled = this . scanEnabled ; if ( scanEnabled ) { return ; } this . scanEnabled = true ; startScan ( ) ; ROOT_LOGGER . started ( getClass ( ) . getSimpleName ( ) , deploymentDir . getAbsolutePath ( ) ) ;