signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Joining { /** * Returns a { @ code Collector } which behaves like this collector , but uses * the specified ellipsis { @ code CharSequence } instead of default * { @ code " . . . " } when the string limit ( if specified ) is reached . * @ param ellipsis the sequence of characters to be used at the en...
return new Joining ( delimiter , ellipsis . toString ( ) , prefix , suffix , cutStrategy , lenStrategy , maxLength ) ;
public class JSONObject { /** * Get the long value associated with a key . If the number value is too * long for a long , it will be clipped . * @ param key A key string . * @ return The long value . * @ throws JSONException if the key is not found or if the value cannot * be converted to a long . */ public l...
Object o = get ( key ) ; return o instanceof Number ? ( ( Number ) o ) . longValue ( ) : ( long ) getDouble ( key ) ;
public class MultiPath { /** * Appends all paths from another multipath . * @ param src * The multipath to append to this multipath . * @ param bReversePaths * TRUE if the multipath is added should be added with its paths * reversed . */ public void add ( MultiPath src , boolean bReversePaths ) { } }
m_impl . add ( ( MultiPathImpl ) src . _getImpl ( ) , bReversePaths ) ;
public class AbstractConfigFile { /** * Loads xml - content from url / file * @ throws IOException * @ throws JAXBException */ public void load ( ) throws IOException , JAXBException { } }
Unmarshaller unmarshaller = jaxbCtx . createUnmarshaller ( ) ; content = ( JAXBElement < T > ) unmarshaller . unmarshal ( url ) ;
public class QueueContainer { /** * Removes a reserved item with the given { @ code itemId } . * @ param itemId the ID of the reserved item to be removed * @ return if an item was reserved with the given { @ code itemId } */ public boolean txnRollbackOfferBackup ( long itemId ) { } }
QueueItem item = txMap . remove ( itemId ) ; if ( item == null ) { logger . warning ( "txnRollbackOffer operation-> No txn item for itemId: " + itemId ) ; return false ; } return true ;
public class AbstractConnectionListener { /** * { @ inheritDoc } */ public void clearConnections ( ) { } }
if ( Tracer . isEnabled ( ) ) { for ( Object c : connectionHandles ) Tracer . returnConnection ( cm . getPool ( ) . getConfiguration ( ) . getId ( ) , mcp , this , c ) ; } if ( connectionTraces != null ) connectionTraces . clear ( ) ; connectionHandles . clear ( ) ;
public class Authorizations { /** * Sets the roles assigned to the Account . * @ param roles the roles assigned to the Account . */ public Authorizations setRoles ( Set < Role > roles ) { } }
this . roles . clear ( ) ; this . aggregatePermissions = null ; addRoles ( roles ) ; return this ;
public class ConfusionMatrix { /** * Return recall for single label * @ param label label * @ return double */ public double getRecallForLabel ( String label ) { } }
int fnAndTp = 0 ; double recall = 0 ; int tp = 0 ; if ( map . containsKey ( label ) && map . get ( label ) . containsKey ( label ) ) { tp = this . map . get ( label ) . get ( label ) ; fnAndTp = getRowSum ( label ) ; } if ( fnAndTp > 0 ) { recall = ( double ) tp / ( double ) ( fnAndTp ) ; } return recall ;
public class Tile { /** * Defines the number format that will be used to format the value * in the gauge ( NOT USED AT THE MOMENT ) * @ param FORMAT */ public void setNumberFormat ( final NumberFormat FORMAT ) { } }
if ( null == numberFormat ) { _numberFormat = null == FORMAT ? NumberFormat . getInstance ( getLocale ( ) ) : FORMAT ; fireTileEvent ( RESIZE_EVENT ) ; } else { numberFormat . set ( FORMAT ) ; }
public class DiscountCurveInterpolation { /** * Create a discount curve from forwards given by a LIBORMonteCarloModel . If the model uses multiple curves , return its discount curve . * @ param forwardCurveName name of the forward curve . * @ param model Monte Carlo model providing the forwards . * @ param startT...
// Check if the LMM uses a discount curve which is created from a forward curve if ( model . getModel ( ) . getDiscountCurve ( ) == null || model . getModel ( ) . getDiscountCurve ( ) . getName ( ) . toLowerCase ( ) . contains ( "DiscountCurveFromForwardCurve" . toLowerCase ( ) ) ) { return new DiscountCurveFromForward...
public class ELParser { /** * 149852 - Ignore this generated FFDC because we expect it */ @ FFDCIgnore ( { } }
LookaheadSuccess . class } ) private boolean jj_2_8 ( int xla ) { jj_la = xla ; jj_lastpos = jj_scanpos = token ; try { return ! jj_3_8 ( ) ; } catch ( LookaheadSuccess ls ) { return true ; } finally { jj_save ( 7 , xla ) ; }
public class ApiOvhCloud { /** * Get planned migrations * REST : GET / cloud / project / { serviceName } / migration * @ param serviceName [ required ] Service name * API beta */ public ArrayList < OvhMigration > project_serviceName_migration_GET ( String serviceName ) throws IOException { } }
String qPath = "/cloud/project/{serviceName}/migration" ; StringBuilder sb = path ( qPath , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t10 ) ;
public class TenantService { /** * Returns true if a tenant with the specified name exists , otherwise false . * @ since 4.3 */ public boolean nameExists ( final String name ) { } }
boolean rslt = false ; // default try { final ITenant tenant = this . tenantDao . getTenantByName ( name ) ; rslt = tenant != null ; } catch ( IllegalArgumentException iae ) { // This exception is completely fine ; it simply // means there is no tenant with this name . rslt = false ; } return rslt ;
public class AttachDiskRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AttachDiskRequest attachDiskRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( attachDiskRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attachDiskRequest . getDiskName ( ) , DISKNAME_BINDING ) ; protocolMarshaller . marshall ( attachDiskRequest . getInstanceName ( ) , INSTANCENAME_BINDING ) ; protocolM...
public class NetworkUtils { /** * Set the learning rate for a single layer in the network to the specified value . Note that if any learning rate * schedules are currently present , these will be removed in favor of the new ( fixed ) learning rate . < br > * < br > * < b > Note < / b > : < i > This method not fre...
setLearningRate ( net , layerNumber , newLr , null , true ) ;
public class QEmuIdAllocator { /** * Returns a comma - separated list of new PCI addresses . * @ param count How many addresses to return . * @ param separator The separator to use between addresses . * @ return A separated String of new PCI addresses . */ @ Nonnull public String newPciAddresses ( @ Nonnegative i...
StringBuilder buf = new StringBuilder ( ) ; for ( int i = 0 ; i < count ; i ++ ) { if ( i > 0 ) buf . append ( separator ) ; buf . append ( newPciAddress ( ) ) ; } return buf . toString ( ) ;
public class AppServiceEnvironmentsInner { /** * Create or update an App Service Environment . * Create or update an App Service Environment . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ param hostingEnvironmentE...
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , name , hostingEnvironmentEnvelope ) , serviceCallback ) ;
public class AbcGrammar { /** * chord - or - text : : = % x22 ( chord / text - expression ) * * ( chord - newline ( chord / text - expression ) ) % x22 < p > * < tt > " . . " < / tt > */ Rule ChordOrText ( ) { } }
return Sequence ( String ( "\"" ) , OptionalS ( FirstOfS ( Chord ( ) , TextExpression ( ) ) ) , ZeroOrMoreS ( SequenceS ( ChordOrTextNewline ( ) , FirstOfS ( Chord ( ) , TextExpression ( ) ) ) ) , String ( "\"" ) ) . label ( ChordOrText ) ;
public class CompoundActivity { /** * Adds an activity to the list of sub - activities . * @ param activity * the sub - activity to add . * @ return * the activity itself , to enable method chaining . */ public CompoundActivity addActivity ( Activity activity ) { } }
if ( activity != null ) { logger . trace ( "adding sub-activity '{}' to list" , activity . getId ( ) ) ; activities . add ( activity ) ; } return this ;
public class PdfDocument { /** * Implements an action in an area . * @ param action the < CODE > PdfAction < / CODE > * @ param llx the lower left x corner of the activation area * @ param lly the lower left y corner of the activation area * @ param urx the upper right x corner of the activation area * @ para...
addAnnotation ( new PdfAnnotation ( writer , llx , lly , urx , ury , action ) ) ;
public class ClientProxyImpl { /** * For JDK 9 + , we could use MethodHandles . privateLookupIn , which is not * available in JDK 8. */ private static Object invokeDefaultMethodUsingPrivateLookup ( Class < ? > declaringClass , Object o , Method m , Object [ ] params ) throws WrappedException , NoSuchMethodException {...
try { final Method privateLookup = MethodHandles . class . getDeclaredMethod ( "privateLookupIn" , Class . class , MethodHandles . Lookup . class ) ; return ( ( MethodHandles . Lookup ) privateLookup . invoke ( null , declaringClass , MethodHandles . lookup ( ) ) ) . unreflectSpecial ( m , declaringClass ) . bindTo ( o...
public class MetricResolver { /** * http : / / bugs . java . com / view _ bug . do ? bug _ id = 6294399 */ private String memberName ( Member member ) { } }
if ( member instanceof Constructor ) return member . getDeclaringClass ( ) . getSimpleName ( ) ; else return member . getName ( ) ;
public class CheerleaderClient { /** * Define the log policy . * Note : some log configuration can increase memory foot print and / or reduce the performance . * Use them with caution . * { @ link CheerleaderClient # LOG _ NONE } * { @ link CheerleaderClient # LOG _ RETROFIT } * { @ link CheerleaderClient # L...
checkState ( ) ; if ( ( logLevel & LOG_RETROFIT ) != 0 ) { mHttpLoggingInterceptor . setLevel ( HttpLoggingInterceptor . Level . BODY ) ; } else { mHttpLoggingInterceptor . setLevel ( HttpLoggingInterceptor . Level . NONE ) ; } mOffliner . debug ( ( logLevel & LOG_OFFLINER ) != 0 ) ;
public class AbstractOperationHandler { /** * Obtains a map of resource Attributes . * @ param context * the message context * @ return map of resource Attributes * @ throws OperationHandlerException * @ throws URISyntaxException */ protected Map < URI , AttributeValue > getResources ( SOAPMessageContext cont...
Object oMap = null ; String pid = null ; try { oMap = getSOAPRequestObjects ( context ) ; logger . debug ( "Retrieved SOAP Request Objects" ) ; } catch ( SoapFault af ) { logger . error ( "Error obtaining SOAP Request Objects" , af ) ; throw new OperationHandlerException ( "Error obtaining SOAP Request Objects" , af ) ...
public class DescribeByoipCidrsResult { /** * Information about your address ranges . * @ return Information about your address ranges . */ public java . util . List < ByoipCidr > getByoipCidrs ( ) { } }
if ( byoipCidrs == null ) { byoipCidrs = new com . amazonaws . internal . SdkInternalList < ByoipCidr > ( ) ; } return byoipCidrs ;
public class ZipFileHandleImpl { /** * Answer an input stream for an entry of a zip file . When the entry is a * class entry which has 8K or fewer bytes , read all of the entry bytes immediately * and cache the bytes in this handle . Subsequent input stream requests which * locate cached bytes will answer a strea...
String methodName = "getInputStream" ; String entryName = zipEntry . getName ( ) ; if ( zipEntry . isDirectory ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { debug ( methodName , "Entry [ " + entryName + " ] [ null ] (Not using cache: Directory entry)" ) ; } return null ; } long en...
public class BitReserve { /** * Rewind N bytes in Stream . */ public void rewindNbytes ( int N ) { } }
int bits = ( N << 3 ) ; totbit -= bits ; buf_byte_idx -= bits ; if ( buf_byte_idx < 0 ) buf_byte_idx += BUFSIZE ;
public class HCSWFObject { /** * Add a < code > param < / code > tag to the created < code > object < / code > tag * @ param sName * Parameter name * @ param sValue * Parameter value * @ return this */ @ Nonnull public final HCSWFObject addObjectParam ( @ Nonnull final String sName , final String sValue ) { }...
if ( ! JSMarshaller . isJSIdentifier ( sName ) ) throw new IllegalArgumentException ( "The name '" + sName + "' is not a legal JS identifier!" ) ; if ( m_aObjectParams == null ) m_aObjectParams = new CommonsLinkedHashMap < > ( ) ; m_aObjectParams . put ( sName , sValue ) ; return this ;
public class DevicesManagementApi { /** * Deletes a device & # 39 ; s properties . * Deletes a device & # 39 ; s properties . * @ param did Device ID . ( required ) * @ return MetadataEnvelope * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ publi...
ApiResponse < MetadataEnvelope > resp = deleteServerPropertiesWithHttpInfo ( did ) ; return resp . getData ( ) ;
public class QrcodeAPI { /** * 下载二维码 * @ param ticket 内部自动 UrlEncode * @ return BufferedImage */ public static BufferedImage showqrcode ( String ticket ) { } }
HttpUriRequest httpUriRequest = RequestBuilder . get ( ) . setUri ( MP_URI + "/cgi-bin/showqrcode" ) . addParameter ( "ticket" , ticket ) . build ( ) ; CloseableHttpResponse httpResponse = LocalHttpClient . execute ( httpUriRequest ) ; return getImage ( httpResponse ) ;
public class LoadBalancersInner { /** * Creates or updates a load balancer . * @ param resourceGroupName The name of the resource group . * @ param loadBalancerName The name of the load balancer . * @ param parameters Parameters supplied to the create or update load balancer operation . * @ throws IllegalArgume...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , loadBalancerName , parameters ) . map ( new Func1 < ServiceResponse < LoadBalancerInner > , LoadBalancerInner > ( ) { @ Override public LoadBalancerInner call ( ServiceResponse < LoadBalancerInner > response ) { return response . body ( ) ; } } ) ;
public class WorkerNetAddress { /** * < code > optional string domainSocketPath = 5 ; < / code > */ public java . lang . String getDomainSocketPath ( ) { } }
java . lang . Object ref = domainSocketPath_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; if ( bs . isValidUtf8 ( ) ) { domainSocketP...
public class ICUHumanize { /** * Wraps the given operation on a context with the specified locale . * @ param operation * Operation to be performed * @ param locale * Target locale * @ return Result of the operation */ private static < T > T withinLocale ( final Callable < T > operation , final Locale locale ...
DefaultICUContext ctx = context . get ( ) ; Locale oldLocale = ctx . getLocale ( ) ; try { ctx . setLocale ( locale ) ; return operation . call ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } finally { ctx . setLocale ( oldLocale ) ; context . set ( ctx ) ; }
public class BuiltinProducersConfig { /** * this method is for unit - test . */ public void disableAll ( ) { } }
javaMemoryProducers = javaMemoryPoolProducers = javaThreadingProducers = osProducer = runtimeProducer = mbeanProducers = gcProducer = errorProducer = false ;
public class CPDefinitionOptionValueRelUtil { /** * Returns the first cp definition option value rel in the ordered set where key = & # 63 ; . * @ param key the key * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp definition op...
return getPersistence ( ) . fetchByKey_First ( key , orderByComparator ) ;
public class EventHandler { /** * Function to remove old Snowflake Dump files to make room for new ones . * @ param deleteOldest if true , always deletes the oldest file found if max * number of dump files has been reached */ protected void cleanupSfDumps ( boolean deleteOldest ) { } }
// Check what the maximum number of dumpfiles and the max allowable // aggregate dump file size is . int maxDumpFiles = System . getProperty ( MAX_NUM_DUMP_FILES_PROP ) != null ? Integer . valueOf ( System . getProperty ( MAX_NUM_DUMP_FILES_PROP ) ) : DEFAULT_MAX_DUMP_FILES ; int maxDumpDirSizeMB = System . getProperty...
public class AbstractBlockBasedDataStore { /** * Run an integrity check on the store files and fix them as necessary * @ throws DataStoreException if the files could not be fixed */ protected void integrityCheck ( ) throws DataStoreException { } }
try { // 1 - Check files sizes // - - Allocation table long atFileSize = allocationTableRandomAccessFile . length ( ) ; if ( atFileSize < AT_HEADER_SIZE + AT_BLOCK_SIZE ) /* Should have at least one entry */ throw new DataStoreException ( "Allocation table is truncated : " + allocationTableFile . getAbsolutePath ( ) ) ...
public class TileSet { /** * Creates a { @ link Tile } object from this tileset corresponding to the specified tile id and * returns that tile . A null tile will never be returned , but one with an error image may be * returned if a problem occurs loading the underlying tileset image . * @ param tileIndex the ind...
return getTile ( tileIndex , getColorizations ( tileIndex , rizer ) ) ;
public class ConnectorImpl { /** * { @ inheritDoc } */ public List < String > getRequiredWorkContexts ( ) { } }
List < String > result = new ArrayList < String > ( requiredWorkContexts . size ( ) ) ; for ( XsdString wc : requiredWorkContexts ) result . add ( wc . getValue ( ) ) ; return Collections . unmodifiableList ( result ) ;
public class ClassGraph { /** * Annotate an field / argument with its type t */ private String typeAnnotation ( Options opt , Type t ) { } }
if ( t . typeName ( ) . equals ( "void" ) ) return "" ; return " : " + type ( opt , t , false ) + t . dimension ( ) ;
public class Session { /** * Closes this Session . */ @ Override public synchronized void close ( ) { } }
if ( isClosed ) { return ; } rollback ( false ) ; try { database . logger . writeToLog ( this , Tokens . T_DISCONNECT ) ; } catch ( HsqlException e ) { } sessionData . closeAllNavigators ( ) ; sessionData . persistentStoreCollection . clearAllTables ( ) ; sessionData . closeResultCache ( ) ; database . compiledStatemen...
public class AbstractMaterialDialogBuilder { /** * Obtains the boolean value , which specified whether the dialog should be shown fullscreen , or * not , from a specific theme . * @ param themeResourceId * The resource id of the theme , the boolean value should be obtained from , as an { @ link * Integer } valu...
TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogFullscreen } ) ; setFullscreen ( typedArray . getBoolean ( 0 , false ) ) ;
public class TransactionIdManager { /** * Given a transaction id , return the time of its creation * by examining the embedded timestamp . * @ param txnId The transaction id value to examine . * @ return The Date object representing the time this transaction * id was created . */ public static Date getDateFromT...
long time = txnId >> ( COUNTER_BITS + INITIATORID_BITS ) ; time += VOLT_EPOCH ; return new Date ( time ) ;
public class CommerceShipmentItemPersistenceImpl { /** * Returns all the commerce shipment items where commerceShipmentId = & # 63 ; . * @ param commerceShipmentId the commerce shipment ID * @ return the matching commerce shipment items */ @ Override public List < CommerceShipmentItem > findByCommerceShipment ( lon...
return findByCommerceShipment ( commerceShipmentId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class AWSSdkClient { /** * Get list of EC2 { @ link Instance } s for a auto scaling group * @ param groupName Auto scaling group name * @ param status Instance status ( eg . running ) * @ return List of EC2 instances found for the input auto scaling group */ public List < Instance > getInstancesForGroup ( ...
final AmazonEC2 amazonEC2 = getEc2Client ( ) ; final DescribeInstancesResult instancesResult = amazonEC2 . describeInstances ( new DescribeInstancesRequest ( ) . withFilters ( new Filter ( ) . withName ( "tag:aws:autoscaling:groupName" ) . withValues ( groupName ) ) ) ; final List < Instance > instances = new ArrayList...
public class FirefoxBinary { /** * Locates the firefox binary from a system property . Will throw an exception if the binary cannot * be found . */ private static Executable locateFirefoxBinaryFromSystemProperty ( ) { } }
String binaryName = System . getProperty ( FirefoxDriver . SystemProperty . BROWSER_BINARY ) ; if ( binaryName == null ) return null ; File binary = new File ( binaryName ) ; if ( binary . exists ( ) && ! binary . isDirectory ( ) ) return new Executable ( binary ) ; Platform current = Platform . getCurrent ( ) ; if ( c...
public class SourceMapResolver { /** * For a given / / # sourceMappingUrl , this locates the appropriate sourcemap on disk . This is use * for sourcemap merging ( - - apply _ input _ source _ maps ) and for error resolution . * @ param parseInlineSourceMaps Whether to parse Base64 encoded source maps . */ static So...
if ( parseInlineSourceMaps && sourceMapURL . startsWith ( BASE64_URL_PREFIX ) ) { String extractedString = extractBase64String ( sourceMapURL ) ; if ( extractedString != null ) { return SourceFile . fromCode ( jsFile . getName ( ) + ".inline.map" , extractedString ) ; } return null ; } // TODO ( tdeegan ) : Handle abso...
public class CPFriendlyURLEntryUtil { /** * Returns the number of cp friendly url entries where groupId = & # 63 ; and classNameId = & # 63 ; and languageId = & # 63 ; and urlTitle = & # 63 ; . * @ param groupId the group ID * @ param classNameId the class name ID * @ param languageId the language ID * @ param ...
return getPersistence ( ) . countByG_C_L_U ( groupId , classNameId , languageId , urlTitle ) ;
public class PortletCookieServiceImpl { /** * Locate the existing { @ link IPortalCookie } with the request , or create a new one . * @ param request * @ return the { @ link IPortalCookie } - never null */ protected IPortalCookie getOrCreatePortalCookie ( HttpServletRequest request ) { } }
IPortalCookie result = null ; // first check in request final Cookie cookie = this . getCookieFromRequest ( this . cookieName , request ) ; if ( cookie != null ) { // found a potential cookie , call off to the dao final String value = cookie . getValue ( ) ; result = this . portletCookieDao . getPortalCookie ( value ) ...
public class CreateCertificateFromCsrRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateCertificateFromCsrRequest createCertificateFromCsrRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createCertificateFromCsrRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createCertificateFromCsrRequest . getCertificateSigningRequest ( ) , CERTIFICATESIGNINGREQUEST_BINDING ) ; protocolMarshaller . marshall ( createCertific...
public class DefaultEmailModel { /** * sets the reply to address * @ param address a valid email address * @ param personal the real world name of the sender ( can be null ) * @ throws AddressException in case of an invalid email address */ public void setReplyTo ( String address , String personal ) throws Addres...
replyTo = toInternetAddress ( address , personal ) ;
public class RegionInstanceGroupManagerClient { /** * Sets the instance template to use when creating new instances or recreating instances in this * group . Existing instances are not affected . * < p > Sample code : * < pre > < code > * try ( RegionInstanceGroupManagerClient regionInstanceGroupManagerClient =...
SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest . newBuilder ( ) . setInstanceGroupManager ( instanceGroupManager == null ? null : instanceGroupManager . toString ( ) ) . setRegionInstanceGroupManagersSetTemplateRequestResource ( regionInstance...
public class ImageUtil { /** * Appends rightImage to the right side of leftImage . * The resulting image type is one of leftImage . * @ param leftImage * first image , must not be null * @ param rightImage * second image that is appended to the right side of leftImage , * must not be null * @ return appen...
Preconditions . checkNotNull ( leftImage ) ; Preconditions . checkNotNull ( rightImage ) ; int width = leftImage . getWidth ( ) + rightImage . getWidth ( ) ; int height = Math . max ( leftImage . getHeight ( ) , rightImage . getHeight ( ) ) ; BufferedImage result = new BufferedImage ( width , height , leftImage . getTy...
public class SimonConsoleFilter { /** * Wraps the HTTP request with Simon measuring . Separate Simons are created for different URIs ( parameters * ignored ) . * @ param servletRequest HTTP servlet request * @ param servletResponse HTTP servlet response * @ param filterChain filter chain * @ throws java . io ...
HttpServletRequest request = ( HttpServletRequest ) servletRequest ; HttpServletResponse response = ( HttpServletResponse ) servletResponse ; String localPath = request . getRequestURI ( ) . substring ( request . getContextPath ( ) . length ( ) ) ; if ( localPath . startsWith ( requestProcessor . getUrlPrefix ( ) ) ) {...
public class OfferingManager { /** * Remove an offering * @ param offeringName the name of the offering to remove * @ return */ public boolean removeOffering ( String offeringName ) { } }
if ( offeringName == null ) throw new NullPointerException ( "The parameter \"cloudOfferingId\" cannot be null." ) ; BasicDBObject query = new BasicDBObject ( "offering_name" , offeringName ) ; Document removedOffering = this . offeringsCollection . findOneAndDelete ( query ) ; return removedOffering != null ;
public class TypeLord { /** * ArrayList < Foo > List < Foo > ArrayList < Z > */ public static IType findParameterizedType_Reverse ( IType sourceType , IType targetType ) { } }
if ( sourceType == null || targetType == null ) { return null ; } if ( ! sourceType . isParameterizedType ( ) ) { return null ; } // List < Z > IType sourceTypeInHier = findParameterizedType ( targetType , getPureGenericType ( sourceType ) ) ; if ( sourceTypeInHier == null || ! sourceTypeInHier . isParameterizedType ( ...
public class RandomSearch { /** * Part of init common to all initialization types . */ protected void initCommon ( ) { } }
this . fitness = problem . getDefaultFitness ( ) ; this . bestConfiguration = this . activeConfiguration ; this . bestFitness = this . fitness . getValue ( this . activeConfiguration ) ; // calculate fitness this . activeFitness = this . fitness . getValue ( this . activeConfiguration ) ; this . activeNormalizedFitness...
public class PluginXmlParser { /** * Returns the ResourceType enum value corresponding to the resource tag . * @ param resourceTag Tag name of resource * @ return ResourceType enum . Returns an enum of unknown if tag is not a supported resource * type . */ private ResourceType getResourceType ( String resourceTag...
if ( resourceTag == null || ! resourceTag . endsWith ( "-resource" ) ) { return ResourceType . unknown ; } try { return ResourceType . valueOf ( resourceTag . substring ( 0 , resourceTag . length ( ) - 9 ) ) ; } catch ( Exception e ) { return ResourceType . unknown ; }
public class SliceUtf8 { /** * Removes all white space characters from the left side of the string . * Note : Invalid UTF - 8 sequences are not trimmed . */ public static Slice leftTrim ( Slice utf8 ) { } }
int length = utf8 . length ( ) ; int position = firstNonWhitespacePosition ( utf8 ) ; return utf8 . slice ( position , length - position ) ;
public class ZookeeperDependency { /** * Function that will replace the placeholder * { @ link ZookeeperDependency # VERSION _ PLACEHOLDER _ REGEX } from the * { @ link ZookeeperDependency # contentTypeTemplate } with value from * { @ link ZookeeperDependency # version } . * e . g . having : * < li > contentT...
if ( ! StringUtils . hasText ( this . contentTypeTemplate ) || ! StringUtils . hasText ( this . version ) ) { return "" ; } return this . contentTypeTemplate . replaceAll ( VERSION_PLACEHOLDER_REGEX , this . version ) ;
public class MersenneTwisterFast { /** * Reads the entire state of the MersenneTwister RNG from the stream * @ param stream * @ throws IOException */ public void readState ( DataInputStream stream ) throws IOException { } }
int len = mt . length ; for ( int x = 0 ; x < len ; x ++ ) mt [ x ] = stream . readInt ( ) ; len = mag01 . length ; for ( int x = 0 ; x < len ; x ++ ) mag01 [ x ] = stream . readInt ( ) ; mti = stream . readInt ( ) ; __nextNextGaussian = stream . readDouble ( ) ; __haveNextNextGaussian = stream . readBoolean ( ) ;
public class JQLBuilder { /** * For each fields . * @ param fields * the fields * @ param listener * the listener * @ return the string */ private static String forEachFields ( final Set < String > fields , OnFieldListener listener ) { } }
StringBuilder builder = new StringBuilder ( ) ; { String comma = "" ; for ( String item : fields ) { builder . append ( comma + listener . onField ( item ) ) ; comma = ", " ; } } return builder . toString ( ) ;
public class PredefinedValidationStampController { /** * Gets the list of predefined validation stamps . */ @ RequestMapping ( value = "predefinedValidationStamps" , method = RequestMethod . GET ) public Resources < PredefinedValidationStamp > getPredefinedValidationStampList ( ) { } }
return Resources . of ( predefinedValidationStampService . getPredefinedValidationStamps ( ) , uri ( on ( getClass ( ) ) . getPredefinedValidationStampList ( ) ) ) . with ( Link . CREATE , uri ( on ( getClass ( ) ) . getPredefinedValidationStampCreationForm ( ) ) ) ;
public class ClassCacheManager { /** * Builds completely initialized list of callbacks for given context . * @ param ctx contextual data given by execution service * @ return */ public List < CommandCallback > buildCommandCallback ( CommandContext ctx , ClassLoader cl ) { } }
List < CommandCallback > callbackList = new ArrayList < CommandCallback > ( ) ; if ( ctx != null && ctx . getData ( "callbacks" ) != null ) { logger . debug ( "Callback: {}" , ctx . getData ( "callbacks" ) ) ; String [ ] callbacksArray = ( ( String ) ctx . getData ( "callbacks" ) ) . split ( "," ) ; List < String > cal...
public class ChromeCast { /** * < p > If no application is running at the moment then exception is thrown . < / p > * @ return current media status , state , time , playback rate , etc . * @ throws IOException */ public final MediaStatus getMediaStatus ( ) throws IOException { } }
Application runningApp = getRunningApp ( ) ; if ( runningApp == null ) { throw new ChromeCastException ( "No application is running in ChromeCast" ) ; } return channel ( ) . getMediaStatus ( getTransportId ( runningApp ) ) ;
public class CmsToolManager { /** * Configures a whole tool root with all its tools . < p > * @ param cms the cms context * @ param toolRoot the tool root to configure * @ throws CmsException if something goes wrong */ private void configureToolRoot ( CmsObject cms , CmsToolRootHandler toolRoot ) throws CmsExcept...
List < I_CmsToolHandler > handlers = new ArrayList < I_CmsToolHandler > ( ) ; // add tool root handler handlers . add ( toolRoot ) ; // look in every file under the root uri for valid // admin tools and register them List < CmsResource > resources = cms . readResourcesWithProperty ( toolRoot . getUri ( ) , HANDLERCLASS...
public class RecordEventsSpanImpl { /** * Returns an immutable representation of all the data from this { @ code Span } . * @ return an immutable representation of all the data from this { @ code Span } . * @ throws IllegalStateException if the Span doesn ' t have RECORD _ EVENTS option . */ public SpanData toSpanD...
synchronized ( this ) { SpanData . Attributes attributesSpanData = attributes == null ? SpanData . Attributes . create ( Collections . < String , AttributeValue > emptyMap ( ) , 0 ) : SpanData . Attributes . create ( attributes , attributes . getNumberOfDroppedAttributes ( ) ) ; SpanData . TimedEvents < Annotation > an...
public class MetadataDao { /** * Delete the Metadata matching the prepared query , cascading * @ param preparedDelete * prepared delete query * @ return deleted count * @ throws SQLException * upon failure */ public int deleteCascade ( PreparedQuery < Metadata > preparedDelete ) throws SQLException { } }
int count = 0 ; if ( preparedDelete != null ) { List < Metadata > metadataList = query ( preparedDelete ) ; count = deleteCascade ( metadataList ) ; } return count ;
public class KeyStoreUtils { /** * Adds a private key to the specified key store from the passed private key file and certificate chain . * @ param keyStore * The key store to receive the private key . * @ param pemKeyFile * A PEM format file containing the private key . * @ param passwordChars * The passwo...
final String methodName = "addPrivateKey" ; logger . entry ( methodName , pemKeyFile , certChain ) ; PrivateKey privateKey = createPrivateKey ( pemKeyFile , passwordChars ) ; keyStore . setKeyEntry ( "key" , privateKey , passwordChars , certChain . toArray ( new Certificate [ certChain . size ( ) ] ) ) ; logger . exit ...
public class CmsSitemapDNDController { /** * Handles the drop for a sitemap item which was dragged to a different position . < p > * @ param sitemapEntry the dropped item * @ param target the drop target * @ param parent the parent sitemap entry */ private void handleDropSitemapEntry ( final CmsSitemapTreeItem si...
if ( isChangedPosition ( sitemapEntry , target , true ) ) { // moving a tree entry around final CmsClientSitemapEntry entry = sitemapEntry . getSitemapEntry ( ) ; m_controller . ensureUniqueName ( parent , entry . getName ( ) , new I_CmsSimpleCallback < String > ( ) { public void execute ( String uniqueName ) { if ( ! ...
public class CatalogUtil { /** * Check if a catalog compiled with the given version of VoltDB is * compatible with the current version of VoltDB . * @ param catalogVersionStr * The version string of the VoltDB that compiled the catalog . * @ return true if it ' s compatible , false otherwise . */ public static ...
if ( catalogVersionStr == null || catalogVersionStr . isEmpty ( ) ) { return false ; } // Check that it is a properly formed verstion string Object [ ] catalogVersion = MiscUtils . parseVersionString ( catalogVersionStr ) ; if ( catalogVersion == null ) { throw new IllegalArgumentException ( "Invalid version string " +...
public class AuditUtils { /** * Creates an audit entry for the ' contract broken ' event . * @ param bean the bean * @ param securityContext the security context * @ return the audit entry */ public static AuditEntryBean contractBrokenFromClient ( ContractBean bean , ISecurityContext securityContext ) { } }
AuditEntryBean entry = newEntry ( bean . getClient ( ) . getClient ( ) . getOrganization ( ) . getId ( ) , AuditEntityType . Client , securityContext ) ; entry . setWhat ( AuditEntryType . BreakContract ) ; entry . setEntityId ( bean . getClient ( ) . getClient ( ) . getId ( ) ) ; entry . setEntityVersion ( bean . getC...
public class VariableNames { /** * Replies the name of an environment variable that corresponds to the name of a bootique variable . * @ param bootiqueVariable the name of the bootique variable . * @ return the name of the environment variable . */ public static String toEnvironmentVariableName ( String bootiqueVar...
if ( Strings . isNullOrEmpty ( bootiqueVariable ) ) { return null ; } final StringBuilder name = new StringBuilder ( ) ; final Pattern pattern = Pattern . compile ( "((?:[a-z0_9_]+)|(?:[A-Z]+[^A-Z]*))" ) ; // $ NON - NLS - 1 $ for ( final String component : bootiqueVariable . split ( "[^a-zA-Z0_9_]+" ) ) { // $ NON - N...
public class Bindings { /** * Associates the given source to the given handler . * @ param source the source , must not be { @ code null } * @ param handler the handler , must not be { @ code null } */ public static void bind ( Source source , RouteParameterHandler handler ) { } }
if ( BINDINGS . containsKey ( source ) ) { LoggerFactory . getLogger ( Bindings . class ) . warn ( "Replacing a route parameter binding for {} by {}" , source . name ( ) , handler ) ; } BINDINGS . put ( source , handler ) ;
public class DOT { /** * Reads a DOT description from a reader and returns the PNG rendering result as a { @ link BufferedImage } . * @ param dotReader * the reader from which to read the description * @ return the rendering result * @ throws IOException * if reading from the reader fails , or the pipe to the...
InputStream pngIs = runDOT ( dotReader , "png" ) ; BufferedImage img = ImageIO . read ( pngIs ) ; pngIs . close ( ) ; return img ;
public class AWSResourceGroupsClient { /** * Adds tags to a resource group with the specified ARN . Existing tags on a resource group are not changed if they * are not specified in the request parameters . * @ param tagRequest * @ return Result of the Tag operation returned by the service . * @ throws BadReques...
request = beforeClientExecution ( request ) ; return executeTag ( request ) ;
public class CmsSecurityManager { /** * Checks if the current user has the permissions to publish the given publish list * ( which contains the information about the resources / project to publish ) . < p > * @ param dbc the current OpenCms users database context * @ param publishList the publish list to check ( ...
// is the current project an " offline " project ? checkOfflineProject ( dbc ) ; // check if this is a " direct publish " attempt if ( ! publishList . isDirectPublish ( ) ) { // check if the user is a manager of the current project , in this case he has publish permissions checkManagerOfProjectRole ( dbc , dbc . getReq...
public class OWLExistentialReasonerImpl { /** * Gets the fillers of the existential restrictions that are entailed to be superclasses the specified class * expression and act along the specified property chain . In essence , this finds bindings for ? x with respect to * the following template : < code > SubClassOf ...
Set < Node < OWLClass > > result = new HashSet < Node < OWLClass > > ( ) ; entailmentCheckCount = 0 ; computeExistentialFillers ( ce , propertyList , getDataFactory ( ) . getOWLThing ( ) , result , new HashSet < OWLClass > ( ) ) ; NodeSet < OWLClass > nodeSetResult = new OWLClassNodeSet ( result ) ; if ( fillerTreatmen...
public class RemoveBrownPtoN_F64 { /** * Removes radial distortion * @ param x Distorted x - coordinate pixel * @ param y Distorted y - coordinate pixel * @ param out Undistorted normalized coordinate . */ @ Override public void compute ( double x , double y , Point2D_F64 out ) { } }
// initial estimate of undistorted point out . x = a11 * x + a12 * y + a13 ; out . y = a22 * y + a23 ; removeRadial ( out . x , out . y , params . radial , params . t1 , params . t2 , out , tol ) ;
public class IniFile { /** * Sets the specified long property . * @ param pstrSection the INI section name . * @ param pstrProp the property to be set . * @ param plngVal the long value to be persisted . */ public void setLongProperty ( String pstrSection , String pstrProp , long plngVal , String pstrComments ) {...
INISection objSec = null ; objSec = ( INISection ) this . mhmapSections . get ( pstrSection ) ; if ( objSec == null ) { objSec = new INISection ( pstrSection ) ; this . mhmapSections . put ( pstrSection , objSec ) ; } objSec . setProperty ( pstrProp , Long . toString ( plngVal ) , pstrComments ) ;
public class CompareToBuilder { /** * < p > Compares two < code > Object < / code > s via reflection . < / p > * < p > Fields can be private , thus < code > AccessibleObject . setAccessible < / code > * is used to bypass normal access control checks . This will fail under a * security manager unless the appropria...
return reflectionCompare ( lhs , rhs , ReflectionToStringBuilder . toNoNullStringArray ( excludeFields ) ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcMassMeasure ( ) { } }
if ( ifcMassMeasureEClass == null ) { ifcMassMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 836 ) ; } return ifcMassMeasureEClass ;
public class SelectList { /** * Selects an option using optionLocator . Locator must be prefixed with one of the following : < li > label = < li > value = * < li > index = < li > id = * @ param optionLocator * the select list option locator */ public void select ( String optionLocator ) { } }
getDispatcher ( ) . beforeSelect ( this , optionLocator ) ; if ( StringUtils . isBlank ( optionLocator ) ) { throw new IllegalArgumentException ( "Locator cannot be null or empty." ) ; } if ( optionLocator . split ( "=" ) . length != 2 ) { StringBuilder errMsg = new StringBuilder ( "Invalid locator specified :" ) ; err...
public class BuildStepsInner { /** * List the build arguments for a step including the secret arguments . * ServiceResponse < PageImpl < BuildArgumentInner > > * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the ...
if ( nextPageLink == null ) { throw new IllegalArgumentException ( "Parameter nextPageLink is required and cannot be null." ) ; } String nextUrl = String . format ( "%s" , nextPageLink ) ; return service . listBuildArgumentsNext ( nextUrl , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ...
public class systemuser_systemgroup_binding { /** * Use this API to fetch systemuser _ systemgroup _ binding resources of given name . */ public static systemuser_systemgroup_binding [ ] get ( nitro_service service , String username ) throws Exception { } }
systemuser_systemgroup_binding obj = new systemuser_systemgroup_binding ( ) ; obj . set_username ( username ) ; systemuser_systemgroup_binding response [ ] = ( systemuser_systemgroup_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class MoskitoHttpServlet { /** * Override this method to react on http head method . */ protected void moskitoDoHead ( HttpServletRequest req , HttpServletResponse res ) throws ServletException , IOException { } }
super . doHead ( req , res ) ;
public class RepositoryManagerImpl { /** * Get a JCR Session for the named workspace in the named repository , using the supplied HTTP servlet request for * authentication information . * @ param request the servlet request ; may not be null or unauthenticated * @ param repositoryName the name of the repository i...
// Go through all the RepositoryFactory instances and try to create one . . . Repository repository = getRepository ( repositoryName ) ; // If there ' s no authenticated user , try an anonymous login if ( request == null || request . username ( ) == null ) { return repository . login ( workspaceName ) ; } return reposi...
public class TrieIterator { /** * Finds the next supplementary element . * For each entry in the trie , the value to be delivered is passed through * extract ( ) . * We always store the next element before it is requested . * Called after calculateNextBMP ( ) completes its round of BMP characters . * There is...
int currentValue = m_nextValue_ ; m_nextCodepoint_ ++ ; m_nextBlockIndex_ ++ ; if ( UTF16 . getTrailSurrogate ( m_nextCodepoint_ ) != UTF16 . TRAIL_SURROGATE_MIN_VALUE ) { // this piece is only called when we are in the middle of a lead // surrogate block if ( ! checkNullNextTrailIndex ( ) && ! checkBlockDetail ( curre...
public class AsynchronousRequest { /** * For more info on event detail API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 1 / event _ details " > here < / a > < br / > * @ param id event id * @ param callback callback that is going to be used for { @ link Call # enqueue ( Callback ) } * @ thro...
isParamValid ( new ParamChecker ( ParamType . ID , id ) ) ; gw2API . getEventDetailedInfo ( id , GuildWars2 . lang . getValue ( ) ) . enqueue ( callback ) ;
public class DocClient { /** * read a Document , get document reader infomation . * @ param documentId The document id . * @ param expireInSeconds The expire time * @ return A ReadDocumentResponse object containing the information returned by Document . */ public ReadDocumentResponse readDocument ( String documen...
ReadDocumentRequest request = new ReadDocumentRequest ( ) ; request . setDocumentId ( documentId ) ; request . setExpireInSeconds ( expireInSeconds ) ; return this . readDocument ( request ) ;
public class RankingQualityHistogram { /** * Process a database * @ param database Database to process * @ param relation Relation to process * @ return Histogram of ranking qualities */ public HistogramResult run ( Database database , Relation < O > relation ) { } }
final DistanceQuery < O > distanceQuery = database . getDistanceQuery ( relation , getDistanceFunction ( ) ) ; final KNNQuery < O > knnQuery = database . getKNNQuery ( distanceQuery , relation . size ( ) ) ; if ( LOG . isVerbose ( ) ) { LOG . verbose ( "Preprocessing clusters..." ) ; } // Cluster by labels Collection <...
public class JdbcCpoAdapter { /** * Updates a collection of Objects in the datasource . The assumption is that the objects contained in the collection * exist in the datasource . This method stores the object in the datasource . The objects in the collection will be * treated as one transaction , meaning that if on...
return processUpdateGroup ( coll , JdbcCpoAdapter . UPDATE_GROUP , null , null , null , null ) ;
public class DefaultGroovyMethods { /** * Counts the number of occurrences which satisfy the given closure from the * items within this Iterator . * The iterator will become exhausted of elements after determining the count value . * Example usage : * < pre class = " groovyTestCase " > assert [ 2,4,2,1,3,5,2,4,...
long answer = 0 ; BooleanClosureWrapper bcw = new BooleanClosureWrapper ( closure ) ; while ( self . hasNext ( ) ) { if ( bcw . call ( self . next ( ) ) ) { ++ answer ; } } // for b / c with Java return an int if we can if ( answer <= Integer . MAX_VALUE ) return ( int ) answer ; return answer ;
public class ChronicleMapBuilder { /** * Configures the marshallers , used to serialize / deserialize values to / from off - heap memory in * maps , created by this builder . * @ param valueReader the new bytes & rarr ; value object reader strategy * @ param valueWriter the new value object & rarr ; bytes writer ...
valueBuilder . reader ( valueReader ) ; valueBuilder . writer ( valueWriter ) ; return this ;
public class Iterators { /** * Returns the single element contained in { @ code iterator } . * @ throws NoSuchElementException if the iterator is empty * @ throws IllegalArgumentException if the iterator contains multiple * elements . The state of the iterator is unspecified . */ @ CanIgnoreReturnValue // TODO ( ...
T first = iterator . next ( ) ; if ( ! iterator . hasNext ( ) ) { return first ; } StringBuilder sb = new StringBuilder ( ) . append ( "expected one element but was: <" ) . append ( first ) ; for ( int i = 0 ; i < 4 && iterator . hasNext ( ) ; i ++ ) { sb . append ( ", " ) . append ( iterator . next ( ) ) ; } if ( iter...
public class WindowsJNIFaxClientSpi { /** * This function is invoked before any native call to set the * native layer debug mode . */ protected void preNativeCall ( ) { } }
// get logger Logger logger = this . getLogger ( ) ; // get log level LogLevel logLevel = logger . getLogLevel ( ) ; boolean debugMode = false ; if ( logLevel . equals ( LogLevel . DEBUG ) ) { debugMode = true ; } // set debug mode WindowsJNIFaxClientSpi . setDebugModeNative ( debugMode ) ;
public class IntegrationAccountsInner { /** * Logs the integration account ' s tracking events . * @ param resourceGroupName The resource group name . * @ param integrationAccountName The integration account name . * @ param logTrackingEvents The callback URL parameters . * @ throws IllegalArgumentException thr...
return logTrackingEventsWithServiceResponseAsync ( resourceGroupName , integrationAccountName , logTrackingEvents ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class Discovery { /** * List configurations . * Lists existing configurations for the service instance . * @ param listConfigurationsOptions the { @ link ListConfigurationsOptions } containing the options for the call * @ return a { @ link ServiceCall } with a response type of { @ link ListConfigurationsRe...
Validator . notNull ( listConfigurationsOptions , "listConfigurationsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "configurations" } ; String [ ] pathParameters = { listConfigurationsOptions . environmentId ( ) } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . construct...
public class PropertyInfoRegistry { /** * Returns a FieldPropertyInfo instance for the given field . */ static synchronized FieldPropertyInfo fieldPropertyFor ( Class < ? > type , Field field , Configuration configuration , String name ) { } }
PropertyInfoKey key = new PropertyInfoKey ( type , name , configuration ) ; FieldPropertyInfo fieldPropertyInfo = FIELD_CACHE . get ( key ) ; if ( fieldPropertyInfo == null ) { fieldPropertyInfo = new FieldPropertyInfo ( type , field , name ) ; FIELD_CACHE . put ( key , fieldPropertyInfo ) ; } return fieldPropertyInfo ...
public class DefaultGroovyMethods { /** * Selects the maximum value found from the Iterator * using the closure to determine the correct ordering . * The iterator will become exhausted of elements after this operation . * If the closure has two parameters * it is used like a traditional Comparator . I . e . it ...
return max ( ( Iterable < T > ) toList ( self ) , closure ) ;