signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AlertResources { /** * Return both owners and shared alerts ( if the shared flag is true ) . * @ return The list of shared alerts . */ private List < Alert > getAlertsObj ( String alertname , PrincipalUser owner , boolean shared , boolean populateMetaFieldsOnly , Integer limit ) { } }
Set < Alert > result = new HashSet < > ( ) ; result . addAll ( _getAlertsByOwner ( alertname , owner , populateMetaFieldsOnly ) ) ; if ( shared ) { result . addAll ( populateMetaFieldsOnly ? alertService . findSharedAlerts ( true , null , limit ) : alertService . findSharedAlerts ( false , null , limit ) ) ; } return n...
public class LObjDblFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < T , R > LObjDblFunctionBuilder < T , R > objDblFunction ( Consumer < LObjDblFuncti...
return new LObjDblFunctionBuilder ( consumer ) ;
public class MainActivity { /** * Set the ButtonMenuVM implementation to the ButtonMenu custom view and initialize it . */ private void initializeButtonMenu ( ) { } }
button_menu = ( ButtonMenu ) findViewById ( R . id . button_menu ) ; button_menu . setButtonMenuVM ( buttonMenuVM ) ; button_menu . initialize ( ) ;
public class Client { /** * Perform a query of the users collection within the specified distance of * the specified location and optionally using the provided query command . * For example : " name contains ' ed ' " . * @ param distance * @ param location * @ param ql * @ return */ public Query queryUsersW...
Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "ql" , this . makeLocationQL ( distance , lattitude , longitude , ql ) ) ; Query q = queryEntitiesRequest ( HttpMethod . GET , params , null , organizationId , applicationId , "users" ) ; return q ;
public class FluoConfigurationImpl { /** * Gets the specified number of entries the cache can contain , this gets the value of * { @ value # TRANSACTOR _ MAX _ CACHE _ SIZE } if set , the default * { @ value # TRANSACTOR _ CACHE _ TIMEOUT _ DEFAULT } otherwise * @ param conf The FluoConfiguration * @ return The...
long size = conf . getLong ( TRANSACTOR_MAX_CACHE_SIZE , TRANSACTOR_MAX_CACHE_SIZE_DEFAULT ) ; if ( size <= 0 ) { throw new IllegalArgumentException ( "Cache size must be positive for " + TRANSACTOR_MAX_CACHE_SIZE ) ; } return size ;
public class CorsUtil { /** * Determine the default origin , to allow for local access . * @ param exchange the current HttpExchange . * @ return the default origin ( aka current server ) . */ public static String defaultOrigin ( HttpServerExchange exchange ) { } }
String host = NetworkUtils . formatPossibleIpv6Address ( exchange . getHostName ( ) ) ; String protocol = exchange . getRequestScheme ( ) ; int port = exchange . getHostPort ( ) ; // This browser set header should not need IPv6 escaping StringBuilder allowedOrigin = new StringBuilder ( 256 ) ; allowedOrigin . append ( ...
public class LoggingDecoratorBuilder { /** * Sets the { @ link Function } to use to sanitize request headers before logging . It is common to have the * { @ link Function } that removes sensitive headers , like { @ code Cookie } , before logging . If unset , will use * { @ link Function # identity ( ) } . */ public...
this . requestHeadersSanitizer = requireNonNull ( requestHeadersSanitizer , "requestHeadersSanitizer" ) ; return self ( ) ;
public class A_CmsStaticExportHandler { /** * Scrubs all files from the export folder that might have been changed , * so that the export is newly created after the next request to the resource . < p > * @ param publishHistoryId id of the last published project * @ return the list of { @ link CmsPublishedResource...
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SCRUBBING_EXPORT_FOLDERS_1 , publishHistoryId ) ) ; } Set < String > scrubbedFolders = new HashSet < String > ( ) ; Set < String > scrubbedFiles = new HashSet < String > ( ) ; // get a export user cms context CmsOb...
public class ServicesInner { /** * Get services in subscription . * The services resource is the top - level resource that represents the Data Migration Service . This method returns a list of service resources in a subscription . * @ param nextPageLink The NextLink from the previous successful call to List operati...
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < DataMigrationServiceInner > > , Page < DataMigrationServiceInner > > ( ) { @ Override public Page < DataMigrationServiceInner > call ( ServiceResponse < Page < DataMigrationServiceInner > > response ) { return response...
public class NodeSelectorMarkupHandler { /** * Comment events */ @ Override public void handleComment ( final char [ ] buffer , final int contentOffset , final int contentLen , final int outerOffset , final int outerLen , final int line , final int col ) throws ParseException { } }
this . someSelectorsMatch = false ; for ( int i = 0 ; i < this . selectorsLen ; i ++ ) { this . selectorMatches [ i ] = this . selectorFilters [ i ] . matchComment ( false , this . markupLevel , this . markupBlocks [ this . markupLevel ] ) ; if ( this . selectorMatches [ i ] ) { this . someSelectorsMatch = true ; } } i...
public class NameSpace { /** * Import a compiled Java object ' s methods and variables into this * namespace . When no scripted method / command or variable is found locally * in this namespace method / fields of the object will be checked . Objects * are checked in the order of import with later imports taking p...
this . importedObjects . remove ( obj ) ; this . importedObjects . add ( 0 , obj ) ; this . nameSpaceChanged ( ) ;
public class RepositoryServiceV1 { /** * POST / projects / { projectName } / repos * < p > Creates a new repository . */ @ Post ( "/projects/{projectName}/repos" ) @ StatusCode ( 201 ) @ ResponseConverter ( CreateApiResponseConverter . class ) @ RequiresRole ( roles = ProjectRole . OWNER ) public CompletableFuture < ...
if ( Project . isReservedRepoName ( request . name ( ) ) ) { return HttpApiUtil . throwResponse ( ctx , HttpStatus . FORBIDDEN , "A reserved repository cannot be created." ) ; } return execute ( Command . createRepository ( author , project . name ( ) , request . name ( ) ) ) . thenCompose ( unused -> mds . addRepo ( a...
public class DDataSource { /** * Query and return the Json response . * @ param sqlQuery * @ param reqHeaders * @ return */ public Either < String , Either < Joiner4All , Mapper4All > > query ( String sqlQuery , Map < String , String > reqHeaders ) { } }
return query ( sqlQuery , null , reqHeaders , false , "sql" ) ;
public class SecurityAcl { /** * ( non - Javadoc ) * @ see nyla . solutions . core . security . data . Acl # checkPermission ( java . util . Set , * nyla . solutions . core . security . data . Permission ) */ @ Override public boolean checkPermission ( Set < SecurityGroup > groups , Permission permission ) { } }
if ( groups == null || groups . isEmpty ( ) ) return false ; for ( SecurityGroup group : groups ) { if ( checkPermission ( group , permission ) ) return true ; } return false ;
public class GraphvizConfigVisitor { /** * Process current edge of the configuration graph . * @ param nodeFrom Current configuration node . * @ param nodeTo Destination configuration node . * @ return true to proceed with the next node , false to cancel . */ @ Override public boolean visit ( final Node nodeFrom ...
if ( ! nodeFrom . getName ( ) . isEmpty ( ) ) { this . graphStr . append ( " " ) . append ( nodeFrom . getName ( ) ) . append ( " -> " ) . append ( nodeTo . getName ( ) ) . append ( " [style=solid, dir=back, arrowtail=diamond];\n" ) ; } return true ;
public class GenMapAndTopicListModule { /** * Process results from parsing a single topic or map * @ param currentFile absolute URI processes files */ private void processParseResult ( final URI currentFile ) { } }
// Category non - copyto result and update uplevels accordingly for ( final Reference file : listFilter . getNonCopytoResult ( ) ) { categorizeReferenceFile ( file ) ; updateUplevels ( file . filename ) ; } for ( final Map . Entry < URI , URI > e : listFilter . getCopytoMap ( ) . entrySet ( ) ) { final URI source = e ....
public class CmsGalleryFactory { /** * Deserializes the prefetched gallery data . < p > * @ return the gallery data * @ throws SerializationException in case deserialization fails */ private static CmsGalleryDataBean getGalleryDataFromDict ( ) throws SerializationException { } }
return ( CmsGalleryDataBean ) CmsRpcPrefetcher . getSerializedObjectFromDictionary ( CmsGalleryController . getGalleryService ( ) , CmsGalleryDataBean . DICT_NAME ) ;
public class RtpChannel { /** * Modifies the map between format and RTP payload number * @ param rtpFormats the format map */ public void setFormatMap ( RTPFormats rtpFormats ) { } }
flush ( ) ; this . rtpHandler . setFormatMap ( rtpFormats ) ; this . transmitter . setFormatMap ( rtpFormats ) ;
public class Helper { /** * This will percent encode Jersey template argument braces ( enclosed in * " { . . . } " ) and the percent character . Both would not be esccaped by jersey * and / or would cause an error when this is not a valid template . * @ param v * @ return */ public static String encodeJersey ( ...
String encoded = jerseyExtraEscape . escape ( v ) ; return encoded ;
public class ClassSourceImpl { /** * Attempt to read the Jandex index . * If Jandex is not enabled , immediately answer null . * If no Jandex index is available , or if it cannot be read , answer null . * @ return The read Jandex index . */ protected Index getJandexIndex ( ) { } }
String methodName = "getJandexIndex" ; boolean doLog = tc . isDebugEnabled ( ) ; boolean doJandexLog = JandexLogger . doLog ( ) ; boolean useJandex = getUseJandex ( ) ; if ( ! useJandex ) { // Figuring out if there is a Jandex index is mildly expensive , // and is to be avoided when logging is disabled . if ( doLog || ...
public class LObjLongPredicateBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < T > LObjLongPredicateBuilder < T > objLongPredicate ( Consumer < LObjLongPredica...
return new LObjLongPredicateBuilder ( consumer ) ;
public class SmartLdapGroupStore { /** * Returns a < code > String [ ] < / code > containing the keys of < code > IEntityGroups < / code > that are * members of this < code > IEntityGroup < / code > . In a composite group system , a group may contain a * member group from a different service . This is called a fore...
if ( isTreeRefreshRequired ( ) ) { refreshTree ( ) ; } log . debug ( "Invoking findMemberGroupKeys() for group: {}" , group . getLocalKey ( ) ) ; List < String > rslt = new ArrayList < > ( ) ; for ( Iterator it = findMemberGroups ( group ) ; it . hasNext ( ) ; ) { IEntityGroup g = ( IEntityGroup ) it . next ( ) ; // R...
public class CacheUnitImpl { /** * This implements the method in the CacheUnit interface . * This is called to remove alias ids from cache id . * @ param cacheName The cache name * @ param alias The alias ids */ public void removeAlias ( String cacheName , Object alias ) { } }
if ( alias != null ) { DCache cache = ServerCache . getCache ( cacheName ) ; if ( cache != null ) { try { cache . removeAlias ( alias , false , false ) ; } catch ( IllegalArgumentException e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Removing alias " + alias + " failure: " + e . getMessage ( ) ) ; } } } }
public class ChangesKey { /** * { @ inheritDoc } */ @ Override public void writeExternal ( ObjectOutput out ) throws IOException { } }
super . writeExternal ( out ) ; byte [ ] buf = wsId . getBytes ( Constants . DEFAULT_ENCODING ) ; out . writeInt ( buf . length ) ; out . write ( buf ) ;
public class ArrowButtonPainter { /** * Paint the arrow in enabled state . * @ param g the Graphics2D context to paint with . * @ param width the width . * @ param height the height . */ private void paintForegroundEnabled ( Graphics2D g , int width , int height ) { } }
Shape s = decodeArrowPath ( width , height ) ; g . setPaint ( enabledColor ) ; g . fill ( s ) ;
public class SizeUtils { /** * - Xmx to MByte * @ param xmx * @ return MByte */ public static int xmx2MB ( String xmx ) { } }
int size = 200 ; if ( xmx == null || xmx . isEmpty ( ) ) { return size ; } String s = xmx . substring ( xmx . length ( ) - 1 , xmx . length ( ) ) ; int unit = - 1 ; int localSize = - 1 ; if ( unitMap . get ( s ) == null ) { localSize = Integer . valueOf ( xmx . substring ( 4 , xmx . length ( ) ) ) ; return localSize / ...
public class Assert { /** * Asserts that an argument is valid . * The assertion holds if and only if { @ code valid } is { @ literal true } . * For example , application code might assert that : * < pre > * < code > * Assert . argument ( age & gt ; = 21 , " Person must be 21 years of age to enter " ) ; * < ...
if ( isNotValid ( valid ) ) { throw new IllegalArgumentException ( message . get ( ) ) ; }
public class Output { private void write ( String str ) { } }
if ( muted ) { return ; } try { dest . write ( str ) ; } catch ( IOException e ) { exceptions . add ( e ) ; }
public class AmazonApiGatewayClient { /** * Deletes the specified API . * @ param deleteRestApiRequest * Request to delete the specified API from your collection . * @ return Result of the DeleteRestApi operation returned by the service . * @ throws UnauthorizedException * The request is denied because the ca...
request = beforeClientExecution ( request ) ; return executeDeleteRestApi ( request ) ;
public class MetricConfig { /** * Searches for the property with the specified key in this property list . * If the key is not found in this property list , the default property list , * and its defaults , recursively , are then checked . The method returns the * default value argument if the property is not foun...
String argument = getProperty ( key , null ) ; return argument == null ? defaultValue : Float . parseFloat ( argument ) ;
public class CommentProcessorRegistry { /** * Takes the first comment on the specified paragraph and tries to evaluate * the string within the comment against all registered * { @ link ICommentProcessor } s . * @ param document the word document . * @ param comments the comments within the document . * @ para...
Comments . Comment comment = CommentUtil . getCommentFor ( paragraphCoordinates . getParagraph ( ) , document ) ; if ( comment == null ) { // no comment to process return ; } String commentString = CommentUtil . getCommentString ( comment ) ; for ( final ICommentProcessor processor : commentProcessors ) { Class < ? > c...
public class EventHubConnectionsInner { /** * Creates or updates a Event Hub connection . * @ param resourceGroupName The name of the resource group containing the Kusto cluster . * @ param clusterName The name of the Kusto cluster . * @ param databaseName The name of the database in the Kusto cluster . * @ par...
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , clusterName , databaseName , eventHubConnectionName , parameters ) , serviceCallback ) ;
public class ParserUtils { /** * method used to parse float and double * @ param inputStream * - stream to get value * @ param size * - size of the value in bytes * @ return - parsed value as double * @ throws IOException * - in case of IO error */ public static double parseFloat ( InputStream inputStream...
byte [ ] buffer = new byte [ size ] ; int numberOfReadsBytes = inputStream . read ( buffer , 0 , size ) ; assert numberOfReadsBytes == size ; ByteBuffer byteBuffer = ByteBuffer . wrap ( buffer ) . order ( ByteOrder . BIG_ENDIAN ) ; if ( 8 == size ) { return byteBuffer . getDouble ( ) ; } return byteBuffer . getFloat ( ...
public class AsmUtils { /** * Gets the { @ link MethodNode } as string . * @ param methodNode the method node * @ return the method node as string */ public static String getMethodNodeAsString ( MethodNode methodNode ) { } }
Printer printer = new Textifier ( ) ; TraceMethodVisitor methodPrinter = new TraceMethodVisitor ( printer ) ; methodNode . accept ( methodPrinter ) ; StringWriter sw = new StringWriter ( ) ; printer . print ( new PrintWriter ( sw ) ) ; printer . getText ( ) . clear ( ) ; return sw . toString ( ) ;
public class NoClientBindSSLProtocolSocketFactory { /** * Attempts to get a new socket connection to the given host within the given time limit . * This method employs several techniques to circumvent the limitations of older JREs that * do not support connect timeout . When running in JRE 1.4 or above reflection i...
if ( params == null ) { throw new IllegalArgumentException ( "Parameters may not be null" ) ; } int timeout = params . getConnectionTimeout ( ) ; if ( timeout == 0 ) { return createSocket ( host , port ) ; } else { // To be eventually deprecated when migrated to Java 1.4 or above Socket socket = ReflectionSocketFactory...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > } */ @ XmlElement...
return new JAXBElement < CodeType > ( _AnchorPoint_QNAME , CodeType . class , null , value ) ;
public class OperationHandler { /** * This method defines the destination structure for this operation . * If destination class is an interface , a relative implementation will be found . * @ param destination destination field * @ param source source field */ private Class < ? > defineStructure ( Field destinati...
Class < ? > destinationClass = destination . getType ( ) ; Class < ? > sourceClass = source . getType ( ) ; Class < ? > result = null ; // if destination is an interface if ( destinationClass . isInterface ( ) ) // if source is an interface if ( sourceClass . isInterface ( ) ) // retrieves the implementation of the des...
public class SSLComponent { /** * Method will be called for each RepertoireConfigService that is unregistered * in the OSGi service registry . We must remove this instance from our * internal map . * @ param config RepertoireConfigService */ protected synchronized void unsetRepertoire ( RepertoireConfigService co...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Removing repertoire: " + config . getAlias ( ) ) ; } repertoireMap . remove ( config . getAlias ( ) ) ; repertoirePIDMap . remove ( config . getPID ( ) ) ; repertoirePropertiesMap . remove ( config . getAlias ( ) ) ; process...
public class ObjectEnvelopeTable { /** * retrieve an objects ObjectEnvelope state from the hashtable . * If no ObjectEnvelope is found , a new one is created and returned . * @ return the resulting ObjectEnvelope */ public ObjectEnvelope get ( Identity oid , Object pKey , boolean isNew ) { } }
ObjectEnvelope result = getByIdentity ( oid ) ; if ( result == null ) { result = new ObjectEnvelope ( this , oid , pKey , isNew ) ; mhtObjectEnvelopes . put ( oid , result ) ; mvOrderOfIds . add ( oid ) ; if ( log . isDebugEnabled ( ) ) log . debug ( "register: " + result ) ; } return result ;
public class LazyBoundCurrencyConversion { /** * Get the exchange rate type that this provider instance is providing data * for . * @ return the exchange rate type if this instance . */ @ Override public ExchangeRate getExchangeRate ( MonetaryAmount amount ) { } }
return this . rateProvider . getExchangeRate ( ConversionQueryBuilder . of ( conversionQuery ) . setBaseCurrency ( amount . getCurrency ( ) ) . build ( ) ) ; // return this . rateProvider . getExchangeRate ( amount . getCurrency ( ) , // getCurrency ( ) ) ;
public class WstxValidationException { /** * Internal methods : */ protected String getLocationDesc ( ) { } }
Location loc = getLocation ( ) ; return ( loc == null ) ? null : loc . toString ( ) ;
public class IoSessionFactory { /** * Rotates via list of currently established sessions * @ return an IO session */ public IoSession getSession ( ) { } }
synchronized ( lock ) { if ( sessions . isEmpty ( ) ) { return null ; } else { final Object [ ] keys = sessions . keySet ( ) . toArray ( ) ; for ( int i = 0 ; i < sessions . size ( ) ; i ++ ) { counter ++ ; final int pos = Math . abs ( counter % sessions . size ( ) ) ; final IoSession session = sessions . get ( keys [ ...
public class BucketWriteTrx { /** * { @ inheritDoc } */ @ Override public boolean close ( ) throws TTIOException { } }
mCommitInProgress . shutdown ( ) ; mDelegate . mSession . waitForRunningCommit ( ) ; if ( ! mDelegate . isClosed ( ) ) { mDelegate . close ( ) ; try { // Try to close the log . // It may already be closed if a commit // was the last operation . mLog . close ( ) ; mBackendWriter . close ( ) ; } catch ( IllegalStateExcep...
public class ServersResource { /** * Evacuates the server to a new host . The caller can supply the host name or id . * @ param serverId * The server to be evacuated * @ param host * The host name or ID of the target host ( where the server is to be moved to ) . * @ return The action to be performed * @ see...
return evacuate ( serverId , host , null , null ) ;
public class ConfigClient { /** * use serviceLoader to load configStoreFactories */ @ SuppressWarnings ( "unchecked" ) private ConfigStoreFactory < ConfigStore > getConfigStoreFactory ( URI configKeyUri ) throws ConfigStoreFactoryDoesNotExistsException { } }
@ SuppressWarnings ( "rawtypes" ) ConfigStoreFactory csf = this . configStoreFactoryRegister . getConfigStoreFactory ( configKeyUri . getScheme ( ) ) ; if ( csf == null ) { throw new ConfigStoreFactoryDoesNotExistsException ( configKeyUri . getScheme ( ) , "scheme name does not exists" ) ; } return csf ;
public class ContentProvider { public < T > ParcelFileDescriptor openPipeHelper ( Uri uri , String mimeType , Bundle opts , T args , PipeDataWriter < T > func ) throws FileNotFoundException { } }
throw new RuntimeException ( "Stub!" ) ;
public class BoundedInputStream { /** * region InputStream Implementation */ @ Override public void close ( ) throws IOException { } }
// Skip over the remaining bytes . Do not close the underlying InputStream . if ( this . remaining > 0 ) { int toSkip = this . remaining ; long skipped = skip ( toSkip ) ; if ( skipped != toSkip ) { throw new SerializationException ( String . format ( "Read %d fewer byte(s) than expected only able to skip %d." , toSkip...
public class QualificationRequirement { /** * The integer value to compare against the Qualification ' s value . IntegerValue must not be present if Comparator is * Exists or DoesNotExist . IntegerValue can only be used if the Qualification type has an integer value ; it cannot * be used with the Worker _ Locale Qu...
if ( integerValues == null ) { this . integerValues = null ; return ; } this . integerValues = new java . util . ArrayList < Integer > ( integerValues ) ;
public class ListPoliciesGrantingServiceAccessRequest { /** * The service namespace for the AWS services whose policies you want to list . * To learn the service namespace for a service , go to < a * href = " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / reference _ policies _ actions - resourc...
if ( serviceNamespaces == null ) { this . serviceNamespaces = null ; return ; } this . serviceNamespaces = new com . amazonaws . internal . SdkInternalList < String > ( serviceNamespaces ) ;
public class RepositoryApi { /** * Get a list of repository tags from a project , sorted by name in reverse alphabetical order . * < pre > < code > GitLab Endpoint : GET / projects / : id / repository / tags < / code > < / pre > * @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ...
Response response = get ( Response . Status . OK , getDefaultPerPageParam ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "tags" ) ; return ( response . readEntity ( new GenericType < List < Tag > > ( ) { } ) ) ;
public class FleetsApi { /** * Update fleet Update settings about a fleet - - - SSO Scope : * esi - fleets . write _ fleet . v1 * @ param fleetId * ID for a fleet ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param token * Access...
com . squareup . okhttp . Call call = putFleetsFleetIdValidateBeforeCall ( fleetId , datasource , token , fleetNewSettings , null ) ; return apiClient . execute ( call ) ;
public class DefaultFeatureForm { /** * Apply a short attribute value on the form , with the given name . * @ param name attribute name * @ param attribute attribute value * @ since 1.11.1 */ @ Api public void setValue ( String name , ShortAttribute attribute ) { } }
FormItem item = formWidget . getField ( name ) ; if ( item != null ) { item . setValue ( attribute . getValue ( ) ) ; }
public class SipServletRequestImpl { /** * { @ inheritDoc } */ public javax . servlet . RequestDispatcher getRequestDispatcher ( String handler ) { } }
MobicentsSipServlet sipServletImpl = ( MobicentsSipServlet ) getSipSession ( ) . getSipApplicationSession ( ) . getSipContext ( ) . findSipServletByName ( handler ) ; if ( sipServletImpl == null ) { throw new IllegalArgumentException ( handler + " is not a valid servlet name" ) ; } return new SipRequestDispatcher ( sip...
public class GetAdGroups { /** * Runs the example . * @ param adWordsServices the services factory . * @ param session the session . * @ param campaignId the ID of the campaign to use to find ad groups . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteExcep...
// Get the AdGroupService . AdGroupServiceInterface adGroupService = adWordsServices . get ( session , AdGroupServiceInterface . class ) ; int offset = 0 ; boolean morePages = true ; // Create selector . SelectorBuilder builder = new SelectorBuilder ( ) ; Selector selector = builder . fields ( AdGroupField . Id , AdGro...
public class TrueTypeFontUnicode { /** * The method used to sort the metrics array . * @ param o1 the first element * @ param o2 the second element * @ return the comparison */ public int compare ( Object o1 , Object o2 ) { } }
int m1 = ( ( int [ ] ) o1 ) [ 0 ] ; int m2 = ( ( int [ ] ) o2 ) [ 0 ] ; if ( m1 < m2 ) return - 1 ; if ( m1 == m2 ) return 0 ; return 1 ;
public class AbstractRedBlackTree { /** * TODO : Refactor into LEFT . balance - method */ private static < K , N extends Node < K , N > > N balanceLeft ( UpdateContext < ? super N > currentContext , N node , N left , N right ) { } }
if ( isRed ( left ) && isRed ( left . left ) ) { N newRight = node . edit ( currentContext , BLACK , left . right , right ) ; return left . edit ( currentContext , RED , left . left . blacken ( currentContext ) , newRight ) ; } else if ( isRed ( left ) && isRed ( left . right ) ) { N leftRight = left . right ; N newLef...
public class Document { /** * Gets the value of the statementOrBundle property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE...
CascadeType . ALL } ) @ JoinTable ( name = "DOCUMENT_STATEMENT_JOIN" , joinColumns = { @ JoinColumn ( name = "DOCUMENT" ) } , inverseJoinColumns = { @ JoinColumn ( name = "STATEMENT" ) } ) public List < StatementOrBundle > getStatementOrBundle ( ) { if ( statementOrBundle == null ) { statementOrBundle = new ArrayList <...
public class TransformJobDefinition { /** * The environment variables to set in the Docker container . We support up to 16 key and values entries in the map . * @ param environment * The environment variables to set in the Docker container . We support up to 16 key and values entries in * the map . * @ return R...
setEnvironment ( environment ) ; return this ;
public class APPIOSApplication { /** * the list of resources to publish via http . */ public Map < String , String > getResources ( ) { } }
Map < String , String > resourceByResourceName = new HashMap < > ( ) ; String metadata = getMetadata ( ICON ) ; if ( metadata . equals ( "" ) ) { metadata = getFirstIconFile ( BUNDLE_ICONS ) ; } resourceByResourceName . put ( ICON , metadata ) ; return resourceByResourceName ;
public class RLogPanel { /** * GEN - LAST : event _ _ delActionPerformed */ private void _saveActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ _ saveActionPerformed JFileChooser fc = new JFileChooser ( new File ( "R.log" ) ) ; if ( fc . showSaveDialog ( this ) == JFileChooser . APPROVE_OPTION && fc . getSelectedFile ( ) != null ) { FileOutputStream os = null ; try { os = new FileOutputStream ( fc . getSelectedFile ( ) ) ; os . write (...
public class ICUResourceBundle { /** * and returns the data in a different form . */ private static final void addLocaleIDsFromIndexBundle ( String baseName , ClassLoader root , Set < String > locales ) { } }
ICUResourceBundle bundle ; try { bundle = ( ICUResourceBundle ) UResourceBundle . instantiateBundle ( baseName , ICU_RESOURCE_INDEX , root , true ) ; bundle = ( ICUResourceBundle ) bundle . get ( INSTALLED_LOCALES ) ; } catch ( MissingResourceException e ) { if ( DEBUG ) { System . out . println ( "couldn't find " + ba...
public class MonitoringConfigurationDescriptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( MonitoringConfigurationDescription monitoringConfigurationDescription , ProtocolMarshaller protocolMarshaller ) { } }
if ( monitoringConfigurationDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( monitoringConfigurationDescription . getConfigurationType ( ) , CONFIGURATIONTYPE_BINDING ) ; protocolMarshaller . marshall ( monitoringConfigurationD...
public class Ramp { /** * Returns the direction of the ramp * @ return the direction of the ramp */ public Direction direction ( ) { } }
double range = this . end - this . start ; if ( ! Op . isFinite ( range ) || Op . isEq ( range , 0.0 ) ) { return Direction . Zero ; } if ( Op . isGt ( range , 0.0 ) ) { return Direction . Positive ; } return Direction . Negative ;
public class TcpRouteMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TcpRoute tcpRoute , ProtocolMarshaller protocolMarshaller ) { } }
if ( tcpRoute == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( tcpRoute . getAction ( ) , ACTION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Handler { /** * Set the character encoding used by this < tt > Handler < / tt > . * The encoding should be set before any < tt > LogRecords < / tt > are written * to the < tt > Handler < / tt > . * @ param encoding The name of a supported character encoding . * May be null , to indicate the default...
checkPermission ( ) ; if ( encoding != null ) { try { if ( ! java . nio . charset . Charset . isSupported ( encoding ) ) { throw new UnsupportedEncodingException ( encoding ) ; } } catch ( java . nio . charset . IllegalCharsetNameException e ) { throw new UnsupportedEncodingException ( encoding ) ; } } this . encoding ...
public class BlogApi { /** * Get a list of configured blogs for the calling user . * < br > * This method requires authentication with ' read ' permission . * @ param service ( Optional ) only return blogs for a given service id . You can get a list of from { @ link net . jeremybrooks . jinx . api . BlogApi # get...
Map < String , String > params = new TreeMap < String , String > ( ) ; params . put ( "method" , "flickr.blogs.getList" ) ; if ( service != null ) { params . put ( "service" , service ) ; } return jinx . flickrGet ( params , BlogList . class ) ;
public class GeomUtil { /** * Calculate the intersection of two lines . Either line may be considered as a line segment , * and the intersecting point is only considered valid if it lies upon the segment . Note that * Point extends Point2D . * @ param p1 and p2 the coordinates of the first line . * @ param seg1...
// see http : / / astronomy . swin . edu . au / ~ pbourke / geometry / lineline2d / double y43 = p4 . getY ( ) - p3 . getY ( ) ; double x21 = p2 . getX ( ) - p1 . getX ( ) ; double x43 = p4 . getX ( ) - p3 . getX ( ) ; double y21 = p2 . getY ( ) - p1 . getY ( ) ; double denom = y43 * x21 - x43 * y21 ; if ( denom == 0 )...
public class IconResource { /** * NOTE : These also needs a mask , if there ' s an alpha channel */ private static int typeFromWidthNative ( final int width ) { } }
switch ( width ) { case 16 : return ICNS . is32 ; case 32 : return ICNS . il32 ; case 48 : return ICNS . ih32 ; case 128 : return ICNS . it32 ; default : throw new IllegalArgumentException ( String . format ( "Unsupported dimensions for ICNS, only 16, 32, 48 and 128 supported: %dx%d" , width , width ) ) ; }
public class DefaultLmlParser { /** * Found an argument opening sign . Have to find argument ' s name and replace it in the template . */ private void processArgument ( ) { } }
final StringBuilder argumentBuilder = new StringBuilder ( ) ; while ( templateReader . hasNextCharacter ( ) ) { final char argumentCharacter = templateReader . nextCharacter ( ) ; if ( argumentCharacter == syntax . getArgumentClosing ( ) ) { final String argument = argumentBuilder . toString ( ) . trim ( ) ; // Getting...
public class JDBCPersistenceManagerImpl { /** * / * ( non - Javadoc ) * @ see com . ibm . jbatch . container . services . impl . AbstractPersistenceManagerImpl # getCheckpointData ( com . ibm . ws . batch . container . checkpoint . CheckpointDataKey ) */ @ Override public CheckpointData getCheckpointData ( Checkpoint...
logger . entering ( CLASSNAME , "getCheckpointData" , key == null ? "<null>" : key ) ; CheckpointData checkpointData = queryCheckpointData ( key . getCommaSeparatedKey ( ) ) ; logger . exiting ( CLASSNAME , "getCheckpointData" , checkpointData == null ? "<null>" : checkpointData ) ; return checkpointData ;
public class BooleanColumn { /** * fillWith methods */ @ Override public BooleanColumn fillWith ( BooleanIterator iterator ) { } }
for ( int r = 0 ; r < size ( ) ; r ++ ) { if ( ! iterator . hasNext ( ) ) { break ; } set ( r , iterator . nextBoolean ( ) ) ; } return this ;
public class BasePropertyTaglet { /** * Given the < code > Tag < / code > representation of this custom * tag , return its string representation , which is output * to the generated page . * @ param tag the < code > Tag < / code > representation of this custom tag . * @ param tagletWriter the taglet writer for ...
return tagletWriter . propertyTagOutput ( tag , getText ( tagletWriter ) ) ;
public class CertificateReader { /** * Read the certificate from a pem file as base64 encoded { @ link String } value . * @ param file * the file in pem format that contains the public key . * @ return the base64 encoded { @ link String } value . * @ throws IOException * Signals that an I / O exception has oc...
final byte [ ] keyBytes = Files . readAllBytes ( file . toPath ( ) ) ; final String publicKeyAsBase64String = new String ( keyBytes ) . replace ( BEGIN_CERTIFICATE_PREFIX , "" ) . replace ( END_CERTIFICATE_SUFFIX , "" ) ; return publicKeyAsBase64String ;
public class DOMUtil { /** * / * - - - - - [ Misc ] - - - - - */ public static void toSAX ( Node root , SAXDelegate handler ) throws SAXException { } }
DOMLocator locator = new DOMLocator ( ) ; switch ( root . getNodeType ( ) ) { case Node . DOCUMENT_NODE : break ; case Node . ELEMENT_NODE : handler . setDocumentLocator ( locator ) ; handler . startDocument ( ) ; if ( root . getParentNode ( ) != null ) { DOMNamespaceContext . Iterator iter = new DOMNamespaceContext . ...
public class LocalQueuePoint { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPLocalQueuePointControllable # deleteAllQueuedMessages ( boolean ) */ public void moveMessages ( boolean discard ) throws SIMPRuntimeOperationFailedException , SIMPControllableNotFoundException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteAllQueuedMessages" , new Boolean ( discard ) ) ; assertValidControllable ( ) ; SIMPRuntimeOperationFailedException runtimeException = null ; SIMPIterator msgItr = getQueuedMessageIterator ( ) ; while ( msgItr . hasNex...
public class Util { /** * Returns a string for { @ code type } . Primitive types are always boxed . */ public static TypeName injectableType ( TypeMirror type ) { } }
return type . accept ( new SimpleTypeVisitor6 < TypeName , Void > ( ) { @ Override public TypeName visitPrimitive ( PrimitiveType primitiveType , Void v ) { return box ( primitiveType ) ; } @ Override public TypeName visitError ( ErrorType errorType , Void v ) { // Error type found , a type may not yet have been genera...
public class UTFUtil { /** * Reads a string from input stream saved as a sequence of UTF chunks . * @ param stream stream to read from . * @ return output string * @ throws IOException if something went wrong */ @ Nullable public static String readUTF ( @ NotNull final InputStream stream ) throws IOException { } ...
final DataInputStream dataInput = new DataInputStream ( stream ) ; if ( stream instanceof ByteArraySizedInputStream ) { final ByteArraySizedInputStream sizedStream = ( ByteArraySizedInputStream ) stream ; final int streamSize = sizedStream . size ( ) ; if ( streamSize >= 2 ) { sizedStream . mark ( Integer . MAX_VALUE )...
public class JCudaDriver { /** * Returns a graph ' s dependency edges . < br > * < br > * Returns a list of \ p hGraph ' s dependency edges . Edges are returned via corresponding * indices in \ p from and \ p to ; that is , the node in \ p to [ i ] has a dependency on the * node in \ p from [ i ] . \ p from and...
return checkResult ( cuGraphGetEdgesNative ( hGraph , from , to , numEdges ) ) ;
public class JpaHelper { /** * Build a query based on the original query to count results * @ param query * @ return */ public static String createResultCountQuery ( String query ) { } }
String resultCountQueryString = null ; int select = query . toLowerCase ( ) . indexOf ( "select" ) ; int from = query . toLowerCase ( ) . indexOf ( "from" ) ; if ( select == - 1 || from == - 1 ) { return null ; } resultCountQueryString = "select count(" + query . substring ( select + 6 , from ) . trim ( ) + ") " + quer...
public class JmesPathCodeGenVisitor { /** * Generates the code for a new JmesPathFunction . * @ param function JmesPath function type * @ param aVoid void * @ return String that represents a call to * the new function expression * @ throws InvalidTypeException */ @ Override public String visit ( final JmesPat...
final String prefix = "new " + function . getClass ( ) . getSimpleName ( ) + "( " ; return function . getExpressions ( ) . stream ( ) . map ( a -> a . accept ( this , aVoid ) ) . collect ( Collectors . joining ( "," , prefix , ")" ) ) ;
public class ProtoHead { /** * 读取输入流创建报文头 * @ param ins * @ return * @ throws IOException */ public static ProtoHead createFromInputStream ( InputStream ins ) throws IOException { } }
byte [ ] header = new byte [ HEAD_LENGTH ] ; int bytes ; // 读取HEAD _ LENGTH长度的输入流 if ( ( bytes = ins . read ( header ) ) != header . length ) { throw new IOException ( "recv package size " + bytes + " != " + header . length ) ; } long returnContentLength = BytesUtil . buff2long ( header , 0 ) ; byte returnCmd = header ...
public class CMAEntry { /** * Sets a map of fields for this Entry . * @ param fields the fields to be set * @ return this { @ code CMAEntry } instance */ public CMAEntry setFields ( LinkedHashMap < String , LinkedHashMap < String , Object > > fields ) { } }
this . fields = fields ; return this ;
public class CommerceShippingFixedOptionRelLocalServiceWrapper { /** * Returns the commerce shipping fixed option rel with the primary key . * @ param commerceShippingFixedOptionRelId the primary key of the commerce shipping fixed option rel * @ return the commerce shipping fixed option rel * @ throws PortalExcep...
return _commerceShippingFixedOptionRelLocalService . getCommerceShippingFixedOptionRel ( commerceShippingFixedOptionRelId ) ;
public class NameSpace { /** * Resolve name to an object through this namespace . * @ param name the name * @ param interpreter the interpreter * @ return the object * @ throws UtilEvalError the util eval error */ public Object get ( final String name , final Interpreter interpreter ) throws UtilEvalError { } }
final CallStack callstack = new CallStack ( this ) ; return this . getNameResolver ( name ) . toObject ( callstack , interpreter ) ;
public class HttpClientNIOResourceAdaptor { /** * Receives an Event from the HTTP client and sends it to the SLEE . * @ param event * @ param activity */ public void processResponseEvent ( HttpClientNIOResponseEvent event , HttpClientNIORequestActivityImpl activity ) { } }
HttpClientNIORequestActivityHandle ah = new HttpClientNIORequestActivityHandle ( activity . getId ( ) ) ; if ( tracer . isFineEnabled ( ) ) tracer . fine ( "==== FIRING ResponseEvent EVENT TO LOCAL SLEE, Event: " + event + " ====" ) ; try { resourceAdaptorContext . getSleeEndpoint ( ) . fireEvent ( ah , fireableEventTy...
public class JvmTypesBuilder { /** * / * @ Nullable */ public JvmTypeReference cloneWithProxies ( /* @ Nullable */ JvmTypeReference typeRef ) { } }
if ( typeRef == null ) return null ; if ( typeRef instanceof JvmParameterizedTypeReference && ! typeRef . eIsProxy ( ) && ! typeRef . eIsSet ( TypesPackage . Literals . JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE ) ) { JvmUnknownTypeReference unknownTypeReference = typesFactory . createJvmUnknownTypeReference ( ) ; return u...
public class HttpSessionContextImpl { /** * Get the session . Look for existing session only in cache if cacheOnly is * true . Only called this way from sessionPreInvoke as a performance * optimization . Won ' t create session on this call either . If create is true * ( called from app ) , we ' ll create the sess...
// create local variable - JIT performance improvement final boolean isTraceOn = com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . entering ( methodClassName , methodNames [ GET_IHT...
public class NodeCountryUnmarshaller { /** * { @ inheritDoc } */ protected void processElementContent ( XMLObject samlObject , String elementContent ) { } }
NodeCountry nodeCountry = ( NodeCountry ) samlObject ; nodeCountry . setNodeCountry ( elementContent ) ;
public class SamlIdPObjectSigner { /** * Gets signature signing configuration . * @ param roleDescriptor the role descriptor * @ param service the service * @ return the signature signing configuration * @ throws Exception the exception */ protected SignatureSigningConfiguration getSignatureSigningConfiguration...
val config = DefaultSecurityConfigurationBootstrap . buildDefaultSignatureSigningConfiguration ( ) ; val samlIdp = casProperties . getAuthn ( ) . getSamlIdp ( ) ; val algs = samlIdp . getAlgs ( ) ; val overrideSignatureReferenceDigestMethods = algs . getOverrideSignatureReferenceDigestMethods ( ) ; val overrideSignatur...
public class BlockDataHandler { /** * Unloads the data for the { @ link Chunk } . < br > * Does the process client side only because unloading happens before saving on the server . * @ param event the event */ @ SubscribeEvent public void onDataUnload ( ChunkEvent . Unload event ) { } }
// only unload on client , server unloads on save if ( ! event . getWorld ( ) . isRemote ) return ; for ( HandlerInfo < ? > handlerInfo : handlerInfos . values ( ) ) { datas . get ( ) . remove ( handlerInfo . identifier , event . getChunk ( ) ) ; }
public class BezierCurve { /** * Create first derivative function for fixed control points . * @ param controlPoints * @ return */ private ParameterizedOperator derivative ( double ... controlPoints ) { } }
if ( controlPoints . length != 2 * length ) { throw new IllegalArgumentException ( "control-points length not " + length ) ; } return derivative ( controlPoints , 0 ) ;
public class LoopingRandomMethod { /** * Entry point to the Example . * @ param args unused */ public static void main ( String [ ] args ) { } }
Stopwatch stopwatch = SimonManager . getStopwatch ( "stopwatch" ) ; for ( int i = 1 ; i <= 10 ; i ++ ) { try ( Split ignored = SimonManager . getStopwatch ( "stopwatch" ) . start ( ) ) { ExampleUtils . waitRandomlySquared ( 50 ) ; } System . out . println ( "Stopwatch after round " + i + ": " + stopwatch ) ; } System ....
public class MessageQueue { /** * Add the passed in message to the queue of messages to be processed . * Also offer the message for persisting . * @ param delayableImmutableMessage the message to add . */ public void put ( DelayableImmutableMessage delayableImmutableMessage ) { } }
if ( messagePersister . persist ( messageQueueId , delayableImmutableMessage ) ) { logger . trace ( "Message {} was persisted for messageQueueId {}" , delayableImmutableMessage . getMessage ( ) , messageQueueId ) ; } else { logger . trace ( "Message {} was not persisted for messageQueueId {}" , delayableImmutableMessag...
public class GeoPackageCoreImpl { /** * { @ inheritDoc } */ @ Override public GeometryColumns createFeatureTableWithMetadata ( GeometryColumns geometryColumns , List < FeatureColumn > additionalColumns , BoundingBox boundingBox , long srsId ) { } }
return createFeatureTableWithMetadata ( geometryColumns , null , additionalColumns , boundingBox , srsId ) ;
public class CmsResourceUtil { /** * Returns the layout style for the current time window state . < p > * < ul > * < li > < code > { @ link CmsResourceUtil # LAYOUTSTYLE _ INRANGE } < / code > : The time window is in range * < li > < code > { @ link CmsResourceUtil # LAYOUTSTYLE _ BEFORERELEASE } < / code > : The...
int layoutstyle = CmsResourceUtil . LAYOUTSTYLE_INRANGE ; if ( ! m_resource . isReleased ( getCms ( ) . getRequestContext ( ) . getRequestTime ( ) ) ) { layoutstyle = CmsResourceUtil . LAYOUTSTYLE_BEFORERELEASE ; } else if ( m_resource . isExpired ( getCms ( ) . getRequestContext ( ) . getRequestTime ( ) ) ) { layoutst...
public class MultiMap { /** * Merge the values in the specified map with the values in this map and return the results in a new map . * @ param multiMap The map to merge * @ return A new map containing the merged values */ public MultiMap merge ( MultiMap multiMap ) { } }
MultiMap result = new MultiMap ( ) ; result . map . putAll ( this . map ) ; result . map . putAll ( multiMap . map ) ; return result ;
public class Config { /** * Returns a read - only scheduled executor configuration for the given name . * The name is matched by pattern to the configuration and by stripping the * partition ID qualifier from the given { @ code name } . * If there is no config found by the name , it will return the configuration ...
name = getBaseName ( name ) ; ScheduledExecutorConfig config = lookupByPattern ( configPatternMatcher , scheduledExecutorConfigs , name ) ; if ( config != null ) { return config . getAsReadOnly ( ) ; } return getScheduledExecutorConfig ( "default" ) . getAsReadOnly ( ) ;
public class Messages { /** * Retrieve a string from the bundle * @ param resourceBundleName * the package - qualified name of the ResourceBundle . Must NOT be * null * @ param msgKey * the key to lookup in the bundle , if null rawMessage will be * returned * @ param tmpLocale * Locale to use for the bu...
return getStringFromBundle ( null , resourceBundleName , msgKey , tmpLocale , rawMessage ) ;
public class JFXAnimationTimer { /** * this method will pause the timer and reverse the animation if the timer already * started otherwise it will start the animation . */ public void reverseAndContinue ( ) { } }
if ( isRunning ( ) ) { super . stop ( ) ; for ( AnimationHandler handler : animationHandlers ) { handler . reverse ( totalElapsedMilliseconds ) ; } startTime = - 1 ; super . start ( ) ; } else { start ( ) ; }
public class N { /** * { @ link Collections # binarySearch ( List , Object ) } * @ param items * @ param key * @ return */ public static < T extends Comparable < ? super T > > int binarySearch ( final List < ? extends T > c , final T key ) { } }
return Array . binarySearch ( c , key ) ;