signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class WeekView { /** * Draw all the events of a particular day . * @ param date The day . * @ param startFromPixel The left position of the day area . The events will never go any left from this value . * @ param canvas The canvas to draw upon . */ private void drawEvents ( Calendar date , float startFromP...
if ( mEventRects != null && mEventRects . size ( ) > 0 ) { for ( int i = 0 ; i < mEventRects . size ( ) ; i ++ ) { if ( isSameDay ( mEventRects . get ( i ) . event . getStartTime ( ) , date ) && ! mEventRects . get ( i ) . event . isAllDay ( ) ) { // Calculate top . float top = mHourHeight * 24 * mEventRects . get ( i ...
public class RequestFromVertx { /** * Same like { @ link # parameter ( String ) } , but converts the parameter to * Boolean if found . * The parameter is decoded by default . * @ param name The name of the post or query parameter * @ param defaultValue A default value if parameter not found . * @ return The v...
// We have to check if the map contains the key , as the retrieval method returns false on missing key . if ( ! request . params ( ) . contains ( name ) ) { return defaultValue ; } Boolean parameter = parameterAsBoolean ( name ) ; if ( parameter == null ) { return defaultValue ; } return parameter ;
public class LdapServices { /** * Get the { @ link ILdapServer } from the portal spring context with the specified name . * @ param name The name of the ILdapServer to return . * @ return An { @ link ILdapServer } with the specified name , < code > null < / code > if there is no * connection with the specified na...
final ApplicationContext applicationContext = PortalApplicationContextLocator . getApplicationContext ( ) ; ILdapServer ldapServer = null ; try { ldapServer = ( ILdapServer ) applicationContext . getBean ( name , ILdapServer . class ) ; } catch ( NoSuchBeanDefinitionException nsbde ) { // Ignore the exception for not f...
public class AjaxExceptionHandlerImpl { /** * { @ inheritDoc } */ @ Override public Iterable < ExceptionQueuedEvent > getHandledExceptionQueuedEvents ( ) { } }
return handled == null ? Collections . < ExceptionQueuedEvent > emptyList ( ) : handled ;
public class TitanVertexDeserializer { /** * The neighboring vertices are represented by DetachedVertex instances */ public TinkerVertex readHadoopVertex ( final StaticBuffer key , Iterable < Entry > entries ) { } }
// Convert key to a vertex ID final long vertexId = idManager . getKeyID ( key ) ; Preconditions . checkArgument ( vertexId > 0 ) ; // Partitioned vertex handling if ( idManager . isPartitionedVertex ( vertexId ) ) { Preconditions . checkState ( setup . getFilterPartitionedVertices ( ) , "Read partitioned vertex (ID=%s...
public class FragmentBuilder { /** * This method determines whether the supplied node matches the specified class * and optional URI . * @ param node The node * @ param cls The class * @ param uri The optional URI * @ return Whether the node is of the correct type and matches the optional URI */ protected boo...
if ( node . getClass ( ) == cls ) { return uri == null || NodeUtil . isOriginalURI ( node , uri ) ; } return false ;
public class DatanodeProtocols { /** * { @ inheritDoc } */ public long getProtocolVersion ( String protocol , long clientVersion ) throws IOException { } }
IOException last = new IOException ( "No DatanodeProtocol found." ) ; long lastProt = - 1 ; for ( int i = 0 ; i < numProtocol ; i ++ ) { try { if ( node [ i ] != null ) { long prot = node [ i ] . getProtocolVersion ( protocol , clientVersion ) ; if ( lastProt != - 1 ) { if ( prot != lastProt ) { throw new IOException (...
public class CommandLine { /** * Registers a subcommand with the specified name . For example : * < pre > * CommandLine commandLine = new CommandLine ( new Git ( ) ) * . addSubcommand ( " status " , new GitStatus ( ) ) * . addSubcommand ( " commit " , new GitCommit ( ) ; * . addSubcommand ( " add " , new GitA...
return addSubcommand ( name , command , new String [ 0 ] ) ;
public class DeviceManager { /** * Push a DATA _ READY event if some client had registered it * @ param attributeName The attribute name * @ param counter * @ throws DevFailed */ public void pushDataReadyEvent ( final String attributeName , final int counter ) throws DevFailed { } }
EventManager . getInstance ( ) . pushAttributeDataReadyEvent ( name , attributeName , counter ) ;
public class CmsHtmlConverterJTidy { /** * Parses the htmlInput with regular expressions for cleanup purposes . < p > * @ param htmlInput the HTML input * @ return the processed HTML */ private String regExp ( String htmlInput ) { } }
String parsedHtml = htmlInput . trim ( ) ; if ( m_modeWord ) { // process all cleanup regular expressions for ( int i = 0 ; i < m_cleanupPatterns . length ; i ++ ) { parsedHtml = m_clearStyle [ i ] . matcher ( parsedHtml ) . replaceAll ( "" ) ; } } // process all replace regular expressions for ( int i = 0 ; i < m_repl...
public class JavaInfoImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < String > getJavaClasspath ( ) { } }
return ( EList < String > ) eGet ( StorePackage . Literals . JAVA_INFO__JAVA_CLASSPATH , true ) ;
public class Base64 { /** * base64解码 * @ param base64 被解码的base64字符串 * @ param destFile 目标文件 * @ return 目标文件 * @ since 4.0.9 */ public static File decodeToFile ( String base64 , File destFile ) { } }
return FileUtil . writeBytes ( Base64Decoder . decode ( base64 ) , destFile ) ;
public class Transloadit { /** * Returns a single template . * @ param id id of the template to retrieve . * @ return { @ link Response } * @ throws RequestException if request to transloadit server fails . * @ throws LocalOperationException if something goes wrong while running non - http operations . */ publi...
Request request = new Request ( this ) ; return new Response ( request . get ( "/templates/" + id ) ) ;
public class SourceMapGenerator { /** * Externalize the source map . */ public SourceMap toJSON ( ) { } }
SourceMap map = new SourceMap ( ) ; map . version = this . _version ; map . sources = this . _sources . toArray ( ) ; map . names = this . _names . toArray ( ) ; map . mappings = serializeMappings ( ) ; map . file = this . _file ; map . sourceRoot = this . _sourceRoot ; if ( this . _sourcesContents != null ) { map . so...
public class UploadObjectObserver { /** * Notified from * { @ link AmazonS3EncryptionClient # uploadObject ( UploadObjectRequest ) } when * failed to upload any part . This method is responsible for cancelling * ongoing uploads and aborting the multi - part upload request . */ public void onAbort ( ) { } }
for ( Future < ? > future : getFutures ( ) ) { future . cancel ( true ) ; } if ( uploadId != null ) { try { s3 . abortMultipartUpload ( new AbortMultipartUploadRequest ( req . getBucketName ( ) , req . getKey ( ) , uploadId ) ) ; } catch ( Exception e ) { LogFactory . getLog ( getClass ( ) ) . debug ( "Failed to abort ...
public class VertxCompletableFuture { /** * Returns a new CompletableFuture that is asynchronously completed by a action running in the worker thread pool of * Vert . x * This method is different from { @ link CompletableFuture # runAsync ( Runnable ) } as it does not use a fork join * executor , but the worker t...
Objects . requireNonNull ( runnable ) ; VertxCompletableFuture < Void > future = new VertxCompletableFuture < > ( Objects . requireNonNull ( context ) ) ; context . < Void > executeBlocking ( fut -> { try { runnable . run ( ) ; fut . complete ( null ) ; } catch ( Throwable e ) { fut . fail ( e ) ; } } , false , ar -> {...
public class JDBC4PreparedStatement { /** * Sets the value of the designated parameter using the given object . */ @ Override public void setObject ( int parameterIndex , Object x ) throws SQLException { } }
checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ;
public class ExtendedJTATransactionImpl { /** * which can still be called otherwise false . */ public static boolean callbacksRegistered ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "callbacksRegistered" ) ; if ( _syncLevel < 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "callbacksRegistered" , Boolean . FALSE ) ; return false ; } final int maxLevels = _s...
public class RecencyDimensionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RecencyDimension recencyDimension , ProtocolMarshaller protocolMarshaller ) { } }
if ( recencyDimension == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( recencyDimension . getDuration ( ) , DURATION_BINDING ) ; protocolMarshaller . marshall ( recencyDimension . getRecencyType ( ) , RECENCYTYPE_BINDING ) ; } catch ( Exce...
public class PrintfFormat { /** * Return a substring starting at * < code > start < / code > and ending at either the end * of the String < code > s < / code > , the next unpaired * percent sign , or at the end of the String if the * last character is a percent sign . * @ param s Control string . * @ param ...
String ret = "" ; cPos = s . indexOf ( "%" , start ) ; if ( cPos == - 1 ) cPos = s . length ( ) ; return s . substring ( start , cPos ) ;
public class CommsUtils { /** * This method will get a runtime property from the sib . properties file as a boolean . * @ param property The property key used to look up in the file . * @ param defaultValue The default value if the property is not in the file . * @ return Returns the property value . */ public st...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRuntimeBooleanProperty" , new Object [ ] { property , defaultValue } ) ; boolean runtimeProp = Boolean . valueOf ( RuntimeInfo . getPropertyWithMsg ( property , defaultValue ) ) . booleanValue ( ) ; if ( TraceComponent ....
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcDiscreteAccessoryType ( ) { } }
if ( ifcDiscreteAccessoryTypeEClass == null ) { ifcDiscreteAccessoryTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 177 ) ; } return ifcDiscreteAccessoryTypeEClass ;
public class Utils { /** * Helper method that deserializes and unmarshalls the message from the given stream . This * method has been adapted from { @ code org . opensaml . ws . message . decoder . BaseMessageDecoder } . * @ param messageStream * input stream containing the message * @ return the inbound messag...
try { Document messageDoc = parserPool . parse ( messageStream ) ; Element messageElem = messageDoc . getDocumentElement ( ) ; Unmarshaller unmarshaller = Configuration . getUnmarshallerFactory ( ) . getUnmarshaller ( messageElem ) ; if ( unmarshaller == null ) { throw new ClientProtocolException ( "Unable to unmarshal...
public class MultiEntityImporter { /** * addEntity . * @ param alias a { @ link java . lang . String } object . * @ param entityClass a { @ link java . lang . Class } object . */ public void addEntity ( String alias , Class < ? > entityClass ) { } }
EntityType entityType = Model . getType ( entityClass ) ; if ( null == entityType ) { throw new RuntimeException ( "cannot find entity type for " + entityClass ) ; } entityTypes . put ( alias , entityType ) ;
public class DFSLocationsRoot { /** * Recompute the map of Hadoop locations */ private synchronized void reloadLocations ( ) { } }
map . clear ( ) ; for ( HadoopServer location : ServerRegistry . getInstance ( ) . getServers ( ) ) map . put ( location , new DFSLocation ( provider , location ) ) ;
public class InternalDebugControl { /** * Tests if any of the specified debug flags are enabled . * @ param state the JShell instance * @ param flag the { @ code DBG _ * } bits to check * @ return true if any of the flags are enabled */ public static boolean isDebugEnabled ( JShell state , int flag ) { } }
if ( debugMap == null ) { return false ; } Integer flags = debugMap . get ( state ) ; if ( flags == null ) { return false ; } return ( flags & flag ) != 0 ;
public class AbstractClientOptionsBuilder { /** * Adds the specified { @ code decorator } . * @ param requestType the type of the { @ link Request } that the { @ code decorator } is interested in * @ param responseType the type of the { @ link Response } that the { @ code decorator } is interested in * @ param de...
decoration . add ( requestType , responseType , decorator ) ; return self ( ) ;
public class BindingManager { /** * Returns a { @ link Element } for the given class */ Element getElement ( String className ) { } }
int templateStart = className . indexOf ( '<' ) ; if ( templateStart != - 1 ) { className = className . substring ( 0 , templateStart ) . trim ( ) ; } return elementUtils . getTypeElement ( className ) ;
public class LLERGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . LLERG__RG_LENGTH : return getRGLength ( ) ; case AfplibPackage . LLERG__RG_FUNCT : return getRGFunct ( ) ; case AfplibPackage . LLERG__TRIPLETS : return getTriplets ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class MessageFormat { /** * Finds the " other " sub - message . * @ param partIndex the index of the first PluralFormat argument style part . * @ return the " other " sub - message start part index . */ private int findOtherSubMessage ( int partIndex ) { } }
int count = msgPattern . countParts ( ) ; MessagePattern . Part part = msgPattern . getPart ( partIndex ) ; if ( part . getType ( ) . hasNumericValue ( ) ) { ++ partIndex ; } // Iterate over ( ARG _ SELECTOR [ ARG _ INT | ARG _ DOUBLE ] message ) tuples // until ARG _ LIMIT or end of plural - only pattern . do { part =...
public class AbstractJaxbMojo { /** * Convenience method to invoke when some plugin configuration is incorrect . * Will output the problem as a warning with some degree of log formatting . * @ param propertyName The name of the problematic property . * @ param description The problem description . */ @ SuppressWa...
final StringBuilder builder = new StringBuilder ( ) ; builder . append ( "\n+=================== [Incorrect Plugin Configuration Detected]\n" ) ; builder . append ( "|\n" ) ; builder . append ( "| Property : " + propertyName + "\n" ) ; builder . append ( "| Problem : " + description + "\n" ) ; builder . append ( "|\n"...
public class ESVersion { /** * Returns the version given its string representation , current version if the argument is null or empty */ public static ESVersion fromString ( String version ) { } }
String lVersion = version ; final boolean snapshot = lVersion . endsWith ( "-SNAPSHOT" ) ; if ( snapshot ) { lVersion = lVersion . substring ( 0 , lVersion . length ( ) - 9 ) ; } String [ ] parts = lVersion . split ( "[.-]" ) ; if ( parts . length < 3 || parts . length > 4 ) { throw new IllegalArgumentException ( "the ...
public class Validator { /** * Validates to fields to ( case - insensitive ) match * @ param name The field to check * @ param anotherName The field to check against * @ param message A custom error message instead of the default one */ public void expectMatch ( String name , String anotherName , String message )...
String value = Optional . ofNullable ( get ( name ) ) . orElse ( "" ) ; String anotherValue = Optional . ofNullable ( get ( anotherName ) ) . orElse ( "" ) ; if ( ( StringUtils . isBlank ( value ) && StringUtils . isBlank ( anotherValue ) ) || ( StringUtils . isNotBlank ( value ) && ! value . equalsIgnoreCase ( another...
public class AWSOpsWorksClient { /** * Updates a user ' s SSH public key . * < b > Required Permissions < / b > : To use this action , an IAM user must have self - management enabled or an attached * policy that explicitly grants permissions . For more information about user permissions , see < a * href = " http ...
request = beforeClientExecution ( request ) ; return executeUpdateMyUserProfile ( request ) ;
public class CharArrayBuffer { /** * Appends chars of the given string to this buffer . The capacity of the * buffer is increased , if necessary , to accommodate all chars . * @ param str the string . */ public void append ( final String str ) { } }
final String s = str != null ? str : "null" ; final int strlen = s . length ( ) ; final int newlen = this . len + strlen ; if ( newlen > this . array . length ) { expand ( newlen ) ; } s . getChars ( 0 , strlen , this . array , this . len ) ; this . len = newlen ;
public class IIMFile { /** * Gets combined date / time value from two data sets . * @ param dateDataSet * data set containing date value * @ param timeDataSet * data set containing time value * @ return date / time instance * @ throws SerializationException * if data sets can ' t be deserialized from bina...
DataSet dateDS = null ; DataSet timeDS = null ; for ( Iterator < DataSet > i = dataSets . iterator ( ) ; ( dateDS == null || timeDS == null ) && i . hasNext ( ) ; ) { DataSet ds = i . next ( ) ; DataSetInfo info = ds . getInfo ( ) ; if ( info . getDataSetNumber ( ) == dateDataSet ) { dateDS = ds ; } else if ( info . ge...
public class SmoothieMap { /** * If the specified key is not already associated with a value or is associated with null , * associates it with the given non - null value . Otherwise , replaces the associated value with * the results of the given remapping function , or removes if the result is { @ code null } . Thi...
if ( value == null ) throw new NullPointerException ( ) ; if ( remappingFunction == null ) throw new NullPointerException ( ) ; long hash ; return segment ( segmentIndex ( hash = keyHashCode ( key ) ) ) . merge ( this , hash , key , value , remappingFunction ) ;
public class KAMStoreImpl { /** * { @ inheritDoc } */ @ Override public List < Namespace > getNamespaces ( Kam kam ) { } }
if ( kam == null ) throw new InvalidArgument ( "kam" , kam ) ; if ( ! exists ( kam ) ) return null ; return getNamespaces ( kam . getKamInfo ( ) ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getGSBMX ( ) { } }
if ( gsbmxEClass == null ) { gsbmxEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 465 ) ; } return gsbmxEClass ;
public class PTBConstituent { /** * getter for adv - gets Adverbials are generally VP adjuncts . * @ generated * @ return value of the feature */ public String getAdv ( ) { } }
if ( PTBConstituent_Type . featOkTst && ( ( PTBConstituent_Type ) jcasType ) . casFeat_adv == null ) jcasType . jcas . throwFeatMissing ( "adv" , "de.julielab.jules.types.PTBConstituent" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( PTBConstituent_Type ) jcasType ) . casFeatCode_adv ) ;
public class SIMPUtils { /** * The key we use to lookup / insert a streamInfo object is based off the remoteMEuuid + * the gatheringTargetDestUuid . This second value is null for standard consumer and set * to a destinationUuid ( which could be an alias ) for gathering consumers . In this way * we have seperate s...
String key = null ; if ( gatheringTargetDestUuid != null ) key = remoteUuid . toString ( ) + gatheringTargetDestUuid . toString ( ) ; else key = remoteUuid . toString ( ) + SIMPConstants . DEFAULT_CONSUMER_SET ; return key ;
public class SingleThreadBlockingQpsBenchmark { /** * Setup with direct executors , small payloads and the default flow control window . */ @ Setup ( Level . Trial ) public void setup ( ) throws Exception { } }
super . setup ( ExecutorType . DIRECT , ExecutorType . DIRECT , MessageSize . SMALL , MessageSize . SMALL , FlowWindowSize . MEDIUM , ChannelType . NIO , 1 , 1 ) ;
public class CmsDefaultXmlContentHandler { /** * Initializes the element mappings for this content handler . < p > * Element mappings allow storing values from the XML content in other locations . * For example , if you have an element called " Title " , it ' s likely a good idea to * store the value of this elem...
Iterator < Element > i = CmsXmlGenericWrapper . elementIterator ( root , APPINFO_MAPPING ) ; while ( i . hasNext ( ) ) { // iterate all " mapping " elements in the " mappings " node Element element = i . next ( ) ; // this is a mapping node String elementName = element . attributeValue ( APPINFO_ATTR_ELEMENT ) ; String...
public class DynamicObjectStoreFactory { /** * Create an instance of { @ link ObjectStore } for mapping keys to values . * The underlying store is backed by { @ link krati . store . DynamicDataStore DynamicDataStore } . * @ param config - the configuration * @ param keySerializer - the serializer for keys * @ p...
try { DataStore < byte [ ] , byte [ ] > base = StoreFactory . createDynamicDataStore ( config ) ; return new SerializableObjectStore < K , V > ( base , keySerializer , valueSerializer ) ; } catch ( Exception e ) { if ( e instanceof IOException ) { throw ( IOException ) e ; } else { throw new IOException ( e ) ; } }
public class Reservation { /** * Create a ReservationFetcher to execute fetch . * @ param pathWorkspaceSid The workspace _ sid * @ param pathTaskSid The task _ sid * @ param pathSid The sid * @ return ReservationFetcher capable of executing the fetch */ public static ReservationFetcher fetcher ( final String pa...
return new ReservationFetcher ( pathWorkspaceSid , pathTaskSid , pathSid ) ;
public class XmlIOUtil { /** * Parses the { @ code messages } from the { @ link InputStream } using the given { @ code schema } . */ public static < T > List < T > parseListFrom ( InputStream in , Schema < T > schema ) throws IOException { } }
return parseListFrom ( in , schema , DEFAULT_INPUT_FACTORY ) ;
public class CPDefinitionLinkUtil { /** * Returns a range of all the cp definition links where CPDefinitionId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes i...
return getPersistence ( ) . findByCPDefinitionId ( CPDefinitionId , start , end ) ;
public class GeoUtils { /** * Computes which tiles on the given base zoom level need to include the given way ( which may be a polygon ) . * @ param way the way that is mapped to tiles * @ param baseZoomLevel the base zoom level which is used in the mapping * @ param enlargementInMeter amount of pixels that is us...
if ( way == null ) { LOGGER . fine ( "way is null in mapping to tiles" ) ; return Collections . emptySet ( ) ; } HashSet < TileCoordinate > matchedTiles = new HashSet < > ( ) ; Geometry wayGeometry = JTSUtils . toJTSGeometry ( way ) ; if ( wayGeometry == null ) { way . setInvalid ( true ) ; LOGGER . fine ( "unable to c...
public class JcrIndexSearcher { /** * Evaluates the query and returns the hits that match the query . * @ param query the query to execute . * @ param sort the sort criteria . * @ param resultFetchHint a hint on how many results should be fetched . * @ return the query hits . * @ throws IOException if an erro...
return SecurityHelper . doPrivilegedIOExceptionAction ( new PrivilegedExceptionAction < QueryHits > ( ) { public QueryHits run ( ) throws Exception { Query localQuery = query . rewrite ( reader ) ; QueryHits hits = null ; if ( localQuery instanceof JcrQuery ) { hits = ( ( JcrQuery ) localQuery ) . execute ( JcrIndexSea...
public class IOUtils { /** * Writes all the contents of a byte array to an OutputStream . * @ param byteArray * the input to read from * @ param out * the output stream to write to * @ throws java . io . IOException * if an IOExcption occurs */ public static void write ( byte [ ] byteArray , OutputStream ou...
if ( byteArray != null ) { out . write ( byteArray ) ; }
public class Input { /** * xhash属性视图 */ @ JSONField ( serialize = false ) public boolean isXhash ( ) { } }
if ( getList ( ) != null ) { for ( Obj obj : getList ( ) ) { if ( obj . isXhash ( ) ) return true ; } } return false ;
public class NodeUtil { /** * Returns whether this is a target of a call or new . */ static boolean isInvocationTarget ( Node n ) { } }
Node parent = n . getParent ( ) ; return parent != null && ( isCallOrNew ( parent ) || parent . isTaggedTemplateLit ( ) ) && parent . getFirstChild ( ) == n ;
public class RegularFile { /** * Writes all available bytes from buffer { @ code buf } to this file starting at position { @ code * pos } . { @ code pos } may be greater than the current size of this file , in which case this file is * resized and all bytes between the current size and { @ code pos } are set to 0 ....
int len = buf . remaining ( ) ; prepareForWrite ( pos , len ) ; if ( len == 0 ) { return 0 ; } int blockIndex = blockIndex ( pos ) ; byte [ ] block = blocks [ blockIndex ] ; int off = offsetInBlock ( pos ) ; put ( block , off , buf ) ; while ( buf . hasRemaining ( ) ) { block = blocks [ ++ blockIndex ] ; put ( block , ...
public class ApiOvhSms { /** * Describe SMS offers available . * REST : GET / sms / { serviceName } / seeOffers * @ param countryCurrencyPrice [ required ] Filter to have the currency country prices * @ param countryDestination [ required ] Filter to have the country destination * @ param quantity [ required ] ...
String qPath = "/sms/{serviceName}/seeOffers" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "countryCurrencyPrice" , countryCurrencyPrice ) ; query ( sb , "countryDestination" , countryDestination ) ; query ( sb , "quantity" , quantity ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null...
public class Client { /** * Create an { @ link ApplicationSession } for the given application name on the Doradus * server , creating a new connection the given REST API host , port , and TLS / SSL * parameters . This static method allows an application session to be created without * creating a Client object and...
Utils . require ( ! Utils . isEmpty ( appName ) , "appName" ) ; Utils . require ( ! Utils . isEmpty ( host ) , "host" ) ; try ( Client client = new Client ( host , port , sslParams ) ) { client . setCredentials ( credentials ) ; ApplicationDefinition appDef = client . getAppDef ( appName ) ; Utils . require ( appDef !=...
public class FDistort { /** * Applies a distortion which will rotate the input image by the specified amount . */ public FDistort rotate ( double angleInputToOutput ) { } }
PixelTransform < Point2D_F32 > outputToInput = DistortSupport . transformRotate ( input . width / 2 , input . height / 2 , output . width / 2 , output . height / 2 , ( float ) angleInputToOutput ) ; return transform ( outputToInput ) ;
public class CodedInputStream { /** * Read a { @ code bytes } field value from the stream . */ public ByteString readBytes ( ) throws IOException { } }
final int size = readRawVarint32 ( ) ; if ( size == 0 ) { return ByteString . EMPTY ; } else if ( size <= ( bufferSize - bufferPos ) && size > 0 ) { // Fast path : We already have the bytes in a contiguous buffer , so // just copy directly from it . final ByteString result = ByteString . copyFrom ( buffer , bufferPos ,...
public class ArgumentUtils { /** * Adds a check that the given number is positive . * @ param name The name of the argument * @ param value The value * @ throws IllegalArgumentException if the argument is not positive * @ return The value */ public static @ Nonnull Number requirePositive ( String name , Number ...
requireNonNull ( name , value ) ; requirePositive ( name , value . intValue ( ) ) ; return value ;
public class ScannerImpl { /** * Checks whether a plugin accepts an item . * @ param selectedPlugin * The plugin . * @ param item * The item . * @ param path * The path . * @ param scope * The scope . * @ param < I > * The item type . * @ return < code > true < / code > if the plugin accepts the i...
boolean accepted = false ; try { accepted = selectedPlugin . accepts ( item , path , scope ) ; } catch ( IOException e ) { LOGGER . error ( "Plugin " + selectedPlugin + " failed to check whether it can accept item " + path , e ) ; } return accepted ;
public class PortletCookieServiceImpl { /** * ( non - Javadoc ) * @ see * org . apereo . portal . portlet . container . services . IPortletCookieService # updatePortalCookie ( javax . servlet . http . HttpServletRequest , * javax . servlet . http . HttpServletResponse ) */ @ Override public void updatePortalCooki...
// Get the portal cookie object final IPortalCookie portalCookie = this . getOrCreatePortalCookie ( request ) ; // Create the browser cookie final Cookie cookie = this . convertToCookie ( portalCookie , this . portalCookieAlwaysSecure || request . isSecure ( ) ) ; // Update the expiration date of the portal cookie stor...
public class ThreadPoolTaskScheduler { /** * Set the ScheduledExecutorService ' s pool size . Default is 1. * < b > This setting can be modified at runtime , for example through JMX . < / b > * @ param poolSize the new pool size */ public void setPoolSize ( int poolSize ) { } }
// Assert . isTrue ( poolSize > 0 , " ' poolSize ' must be 1 or higher " ) ; this . poolSize = poolSize ; if ( this . scheduledExecutor instanceof ScheduledThreadPoolExecutor ) { ( ( ScheduledThreadPoolExecutor ) this . scheduledExecutor ) . setCorePoolSize ( poolSize ) ; }
public class ServerBuilder { /** * Binds the specified annotated service object under the specified path prefix . * @ param exceptionHandlersAndConverters an iterable object of { @ link ExceptionHandlerFunction } , * { @ link RequestConverterFunction } and / or * { @ link ResponseConverterFunction } */ public Ser...
return annotatedService ( pathPrefix , service , Function . identity ( ) , exceptionHandlersAndConverters ) ;
public class PhoenixReader { /** * Utility method . In some cases older compressed PPX files only have a name ( or other string attribute ) * but no UUID . This method ensures that we either use the UUID supplied , or if it is missing , we * generate a UUID from the name . * @ param uuid uuid from object * @ pa...
return uuid == null ? UUID . nameUUIDFromBytes ( name . getBytes ( ) ) : uuid ;
public class TypeMaker { /** * Like the above version , but use and return the array given . */ public static com . sun . javadoc . Type [ ] getTypes ( DocEnv env , List < Type > ts , com . sun . javadoc . Type res [ ] ) { } }
int i = 0 ; for ( Type t : ts ) { res [ i ++ ] = getType ( env , t ) ; } return res ;
public class Command { /** * Create a CORBA Any object and insert a short in it ( special case for the * DevUShort Tango type ) * @ param data The int array to be inserted into the Any object * @ exception DevFailed If the Any object creation failed . * Click < a href = " . . / . . / tango _ basic / idl _ html ...
Any out_any = alloc_any ( ) ; out_any . insert_ushort ( data ) ; return out_any ;
public class CertificatesImpl { /** * Deletes a certificate from the specified account . * You cannot delete a certificate if a resource ( pool or compute node ) is using it . Before you can delete a certificate , you must therefore make sure that the certificate is not associated with any existing pools , the certif...
return deleteWithServiceResponseAsync ( thumbprintAlgorithm , thumbprint ) . map ( new Func1 < ServiceResponseWithHeaders < Void , CertificateDeleteHeaders > , Void > ( ) { @ Override public Void call ( ServiceResponseWithHeaders < Void , CertificateDeleteHeaders > response ) { return response . body ( ) ; } } ) ;
public class ReflectiveInterceptor { /** * Access and return the ReloadableType field on a specified class . * @ param clazz the class for which to discover the reloadable type * @ return the reloadable type for the class , or null if not reloadable */ public static ReloadableType getRType ( Class < ? > clazz ) { }...
// ReloadableType rtype = null ; WeakReference < ReloadableType > ref = classToRType . get ( clazz ) ; ReloadableType rtype = null ; if ( ref != null ) { rtype = ref . get ( ) ; } if ( rtype == null ) { if ( ! theOldWay ) { // ' theOldWay ' attempts to grab the field from the type via reflection . This usually works ex...
public class StringHelper { /** * Sanitizes a string so it can be used as an identifier * @ param s the string to sanitize * @ return the sanitized string */ public static String sanitize ( String s ) { } }
StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < s . length ( ) ; ++ i ) { char c = s . charAt ( i ) ; switch ( c ) { case '\u00c0' : case '\u00c1' : case '\u00c3' : case '\u00c4' : sb . append ( 'A' ) ; break ; case '\u00c8' : case '\u00c9' : case '\u00cb' : sb . append ( 'E' ) ; break ; case '\u00cc' ...
public class TreeRpc { /** * Handles requests to replace or delete all of the rules in the given tree . * It ' s an efficiency helper for cases where folks don ' t want to make a single * call per rule when updating many rules at once . * @ param tsdb The TSDB to which we belong * @ param query The HTTP query t...
int tree_id = 0 ; List < TreeRule > rules = null ; if ( query . hasContent ( ) ) { rules = query . serializer ( ) . parseTreeRulesV1 ( ) ; if ( rules == null || rules . isEmpty ( ) ) { throw new BadRequestException ( "Missing tree rules" ) ; } // validate that they all belong to the same tree tree_id = rules . get ( 0 ...
public class VmServerAddressMarshaller { /** * Marshall the given parameter object . */ public void marshall ( VmServerAddress vmServerAddress , ProtocolMarshaller protocolMarshaller ) { } }
if ( vmServerAddress == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( vmServerAddress . getVmManagerId ( ) , VMMANAGERID_BINDING ) ; protocolMarshaller . marshall ( vmServerAddress . getVmId ( ) , VMID_BINDING ) ; } catch ( Exception e ) {...
public class FileUtils { /** * Removes the given file or directory recursively . * < p > If the file or directory does not exist , this does not throw an exception , but simply does nothing . * It considers the fact that a file - to - be - deleted is not present a success . * < p > This method is safe against oth...
checkNotNull ( file , "file" ) ; guardIfWindows ( FileUtils :: deleteFileOrDirectoryInternal , file ) ;
public class LinuxParameters { /** * Any host devices to expose to the container . This parameter maps to < code > Devices < / code > in the < a * href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > section of the * < a href = " https : / / ...
if ( devices == null ) { devices = new com . amazonaws . internal . SdkInternalList < Device > ( ) ; } return devices ;
public class ElementUtil { /** * Similar to the above but matches against a pattern . */ public static boolean hasNamedAnnotation ( AnnotatedConstruct ac , Pattern pattern ) { } }
for ( AnnotationMirror annotation : ac . getAnnotationMirrors ( ) ) { if ( pattern . matcher ( getName ( annotation . getAnnotationType ( ) . asElement ( ) ) ) . matches ( ) ) { return true ; } } return false ;
public class OutboundMsgHolder { /** * Adds a { @ link Http2PushPromise } message . * @ param pushPromise push promise message */ public void addPromise ( Http2PushPromise pushPromise ) { } }
promises . add ( pushPromise ) ; responseFuture . notifyPromiseAvailability ( ) ; responseFuture . notifyPushPromise ( ) ;
public class Subscription { /** * Removes the client method handler represented by this subscription . */ public void unsubscribe ( ) { } }
List < InvocationHandler > handler = this . handlers . get ( target ) ; if ( handler != null ) { handler . remove ( this . handler ) ; }
public class Edge { /** * Retrieves an iterator that steps over the items in this edge . * @ return An iterator that walks this edge up to the end or terminating * node . */ public Iterator < T > iterator ( ) { } }
return new Iterator < T > ( ) { private int currentPosition = start ; private boolean hasNext = true ; public boolean hasNext ( ) { return hasNext ; } @ SuppressWarnings ( "unchecked" ) public T next ( ) { if ( end == - 1 ) hasNext = ! sequence . getItem ( currentPosition ) . getClass ( ) . equals ( SequenceTerminal . ...
public class DeclarationTransformerImpl { /** * Core function . Parses CSS declaration into structure applicable to * DataNodeImpl * @ param d * Declaration * @ param properties * Wrap of parsed declaration ' s properties * @ param values * Wrap of parsed declaration ' s value * @ return < code > true <...
final String propertyName = d . getProperty ( ) ; // no such declaration is supported or declaration is empty if ( ! css . isSupportedCSSProperty ( propertyName ) || d . isEmpty ( ) ) return false ; try { Method m = methods . get ( propertyName ) ; if ( m != null ) { boolean result = ( Boolean ) m . invoke ( this , d ,...
public class Layout { /** * Measure the children from container until the layout is full ( if ViewPort is enabled ) * @ param centerDataIndex of the item in center * @ param measuredChildren the list of measured children * measuredChildren list can be passed as null if it ' s not needed to * create the list of ...
if ( centerDataIndex == - 1 ) { centerDataIndex = 0 ; } boolean firstChildInBoundsFound = false ; Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "measureUntilFull: centerDataIndex view = %d mContainer.size() = %d" , centerDataIndex , mContainer . size ( ) ) ; for ( int i = centerDataIndex ; i >= 0 && i < mContainer . size ...
public class ZaurusTableForm { /** * delete current row , answer special action codes , see comment below */ public int deleteRow ( ) { } }
// build the delete string String deleteString = "DELETE FROM " + tableName + this . generatePKWhere ( ) ; PreparedStatement ps = null ; // System . out . println ( " delete string " + deleteString ) ; try { // fill the question marks ps = cConn . prepareStatement ( deleteString ) ; ps . clearParameters ( ) ; int i ; f...
public class VersionHistoryImpl { /** * { @ inheritDoc } */ public boolean hasVersionLabel ( Version version , String label ) throws VersionException , RepositoryException { } }
checkValid ( ) ; NodeData versionData = getVersionDataByLabel ( label ) ; if ( versionData != null && version . getUUID ( ) . equals ( versionData . getIdentifier ( ) ) ) { return true ; } return false ;
public class AbstractResource { /** * Gets the object with the given unique identifier . * @ param inId the unique identifier . Cannot be < code > null < / code > . * @ param req the HTTP servlet request . * @ return the object with the given unique identifier . Guaranteed not * < code > null < / code > . * @...
E entity = this . dao . retrieve ( inId ) ; if ( entity == null ) { throw new HttpStatusException ( Response . Status . NOT_FOUND ) ; } else if ( isAuthorizedEntity ( entity , req ) && ( ! isRestricted ( ) || req . isUserInRole ( "admin" ) ) ) { return toComm ( entity , req ) ; } else { throw new HttpStatusException ( ...
public class Validate { /** * < p > Validate that the specified argument collection is neither * < code > null < / code > nor contains any elements that are < code > null < / code > ; * otherwise throwing an exception with the specified message . * < pre > Validate . noNullElements ( myCollection , " The collecti...
Validate . notNull ( collection ) ; for ( Object element : collection ) { if ( element == null ) { throw new IllegalArgumentException ( message ) ; } }
public class EntityTypeValidator { /** * Validates the entity ID : - Validates that the entity ID does not contain illegal characters and * validates the name length * @ param entityType entity meta data * @ throws MolgenisValidationException if the entity simple name content is invalid or the fully * qualified...
// validate entity name ( e . g . illegal characters , length ) String id = entityType . getId ( ) ; if ( ! id . equals ( ATTRIBUTE_META_DATA ) && ! id . equals ( ENTITY_TYPE_META_DATA ) && ! id . equals ( PACKAGE ) ) { try { NameValidator . validateEntityName ( entityType . getId ( ) ) ; } catch ( MolgenisDataExceptio...
public class IntHashMap { /** * Returns a collection view of the mappings contained in this map . Each * element in the returned collection is a < tt > Map . Entry < / tt > . The * collection is backed by the map , so changes to the map are reflected in * the collection , and vice - versa . The collection support...
if ( entrySet == null ) { entrySet = new AbstractSet < Map . Entry < Integer , V > > ( ) { public Iterator iterator ( ) { return ( Iterator ) new IntHashIterator ( ENTRIES ) ; } public boolean contains ( Object o ) { if ( ! ( o instanceof Map . Entry ) ) { return false ; } Map . Entry entry = ( Map . Entry ) o ; Intege...
public class ComputerVisionImpl { /** * Optical Character Recognition ( OCR ) detects printed text in an image and extracts the recognized characters into a machine - usable character stream . Upon success , the OCR results will be returned . Upon failure , the error code together with an error message will be returned...
return ServiceFuture . fromResponse ( recognizePrintedTextInStreamWithServiceResponseAsync ( detectOrientation , image , recognizePrintedTextInStreamOptionalParameter ) , serviceCallback ) ;
public class DelegateView { /** * Provides a mapping from the view coordinate space to the logical * coordinate space of the model . * @ param x * x coordinate of the view location to convert * @ param y * y coordinate of the view location to convert * @ param a * the allocated region to render into * @...
if ( view != null ) { int retValue = view . viewToModel ( x , y , a , bias ) ; return retValue ; } return - 1 ;
public class PersistentExecutorImpl { /** * { @ inheritDoc } */ @ Override public boolean createProperty ( String name , String value ) { } }
if ( name == null || name . length ( ) == 0 ) throw new IllegalArgumentException ( "name: " + name ) ; if ( value == null || value . length ( ) == 0 ) throw new IllegalArgumentException ( "value: " + value ) ; boolean created = false ; TransactionController tranController = new TransactionController ( ) ; try { tranCon...
public class CATBifurcatedConsumer { /** * This overrides the default close method in < code > CATConsumer < / code > as the consumer session * is saved with us , and not in the main consumer . * @ param requestNumber The request number to send replies with . */ @ Override public void close ( int requestNumber ) { ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , requestNumber ) ; try { bifSession . close ( ) ; try { getConversation ( ) . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_CLOSE_CONSUMER_SESS_R , requestNumber , JFapChannelConstants . PRIO...
public class StreamGraphHasherV2 { /** * Generates a hash from a user - specified ID . */ private byte [ ] generateUserSpecifiedHash ( StreamNode node , Hasher hasher ) { } }
hasher . putString ( node . getTransformationUID ( ) , Charset . forName ( "UTF-8" ) ) ; return hasher . hash ( ) . asBytes ( ) ;
public class PersistentExecutorImpl { /** * { @ inheritDoc } */ @ Override public int removeTimers ( String appName , String pattern , Character escape , TaskState state , boolean inState ) throws Exception { } }
pattern = pattern == null ? null : Utils . normalizeString ( pattern ) ; int updateCount = 0 ; TransactionController tranController = new TransactionController ( ) ; try { tranController . preInvoke ( ) ; updateCount = taskStore . remove ( pattern , escape , state , inState , appName ) ; } catch ( Throwable x ) { tranC...
public class IfcCompositeCurveSegmentImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcCompositeCurve > getUsingCurves ( ) { } }
return ( EList < IfcCompositeCurve > ) eGet ( Ifc2x3tc1Package . Literals . IFC_COMPOSITE_CURVE_SEGMENT__USING_CURVES , true ) ;
public class AnimatedLabel { /** * Advances the animated label to the next frame . You normally don ' t need to call this manually as it will be done * by the animation thread . */ public synchronized void nextFrame ( ) { } }
currentFrame ++ ; if ( currentFrame >= frames . size ( ) ) { currentFrame = 0 ; } super . setLines ( frames . get ( currentFrame ) ) ; invalidate ( ) ;
public class SourceParams { /** * Create parameters necessary for creating an EPS source . * @ param amount A positive integer in the smallest currency unit representing the amount to * charge the customer ( e . g . , 1099 for a € 10.99 payment ) . * @ param name The full name of the account holder . * @ param ...
final SourceParams params = new SourceParams ( ) . setType ( Source . EPS ) . setCurrency ( Source . EURO ) . setAmount ( amount ) . setOwner ( createSimpleMap ( FIELD_NAME , name ) ) . setRedirect ( createSimpleMap ( FIELD_RETURN_URL , returnUrl ) ) ; if ( statementDescriptor != null ) { Map < String , Object > additi...
public class MessageControl { /** * GetVersionFromSchemaLocation Method . */ public String getVersionFromSchemaLocation ( String schemaLocation ) { } }
MessageVersion recMessageVersion = this . getMessageVersion ( ) ; recMessageVersion . close ( ) ; try { while ( recMessageVersion . hasNext ( ) ) { recMessageVersion . next ( ) ; String messageSchemaLocation = this . getSchemaLocation ( recMessageVersion , DBConstants . BLANK ) ; if ( schemaLocation . startsWith ( mess...
public class RoutesInner { /** * Creates or updates a route in the specified route table . * @ param resourceGroupName The name of the resource group . * @ param routeTableName The name of the route table . * @ param routeName The name of the route . * @ param routeParameters Parameters supplied to the create o...
return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , routeTableName , routeName , routeParameters ) , serviceCallback ) ;
public class Gen { /** * Sort ( int ) arrays of keys and values */ static void qsort2 ( int [ ] keys , int [ ] values , int lo , int hi ) { } }
int i = lo ; int j = hi ; int pivot = keys [ ( i + j ) / 2 ] ; do { while ( keys [ i ] < pivot ) i ++ ; while ( pivot < keys [ j ] ) j -- ; if ( i <= j ) { int temp1 = keys [ i ] ; keys [ i ] = keys [ j ] ; keys [ j ] = temp1 ; int temp2 = values [ i ] ; values [ i ] = values [ j ] ; values [ j ] = temp2 ; i ++ ; j -- ...
public class TypeAnnotationPosition { /** * Create a { @ code TypeAnnotationPosition } for a method type * parameter bound . * @ param location The type path . * @ param onLambda The lambda for this variable . * @ param parameter _ index The index of the type parameter . * @ param bound _ index The index of t...
return new TypeAnnotationPosition ( TargetType . METHOD_TYPE_PARAMETER_BOUND , pos , parameter_index , onLambda , Integer . MIN_VALUE , bound_index , location ) ;
public class HButtonBox { /** * Get the current string value in HTML . * @ param out The html out stream . * @ exception DBException File exception . */ public void printDisplayControl ( PrintWriter out ) { } }
if ( this . getScreenField ( ) . getConverter ( ) != null ) { String strFieldName = this . getScreenField ( ) . getConverter ( ) . getField ( ) . getFieldName ( false , false ) ; this . printInputControl ( out , null , strFieldName , null , null , null , HtmlConstants . BUTTON , 0 ) ; // Button that does nothing ? } el...
public class ColumnDefinition { /** * Deserialize columns from storage - level representation * @ param serializedColumns storage - level partition containing the column definitions * @ return the list of processed ColumnDefinitions */ public static List < ColumnDefinition > fromSchema ( UntypedResultSet serialized...
List < ColumnDefinition > cds = new ArrayList < > ( ) ; for ( UntypedResultSet . Row row : serializedColumns ) { Kind kind = row . has ( KIND ) ? Kind . deserialize ( row . getString ( KIND ) ) : Kind . REGULAR ; Integer componentIndex = null ; if ( row . has ( COMPONENT_INDEX ) ) componentIndex = row . getInt ( COMPON...
public class InstallOptions { /** * Get the indicated option from the console . Continue prompting until the * value is valid , or the user has indicated they want to cancel the * installation . */ private void inputOption ( String optionId ) throws InstallationCancelledException { } }
OptionDefinition opt = OptionDefinition . get ( optionId , this ) ; if ( opt . getLabel ( ) == null || opt . getLabel ( ) . length ( ) == 0 ) { throw new InstallationCancelledException ( optionId + " is missing label (check OptionDefinition.properties?)" ) ; } System . out . println ( opt . getLabel ( ) ) ; System . ou...