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 new ArrayList < > ( result ) ;
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 < LObjDblFunction < T , R > > consumer ) { } }
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 queryUsersWithinLocation ( float distance , float lattitude , float longitude , String ql ) { } }
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 maximum number of entries permitted in this cache */ public static long getTransactorMaxCacheSize ( FluoConfiguration conf ) { } }
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 ( protocol ) . append ( "://" ) . append ( host ) ; if ( ! isDefaultPort ( port , protocol ) ) { allowedOrigin . append ( ':' ) . append ( port ) ; } return allowedOrigin . toString ( ) ;
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 T requestHeadersSanitizer ( Function < ? super HttpHeaders , ? extends HttpHeaders > requestHeadersSanitizer ) { } }
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 } objects to export */ public List < CmsPublishedResource > scrubExportFolders ( CmsUUID publishHistoryId ) { } }
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 CmsObject cms ; try { // this will always use the root site cms = OpenCms . initCmsObject ( OpenCms . getDefaultUsers ( ) . getUserExport ( ) ) ; } catch ( CmsException e ) { // this should never happen LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_INIT_FAILED_0 ) , e ) ; return Collections . emptyList ( ) ; } List < CmsPublishedResource > publishedResources ; try { publishedResources = cms . readPublishedResources ( publishHistoryId ) ; } catch ( CmsException e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_READING_CHANGED_RESOURCES_FAILED_1 , publishHistoryId ) , e ) ; return Collections . emptyList ( ) ; } publishedResources = addMovedLinkSources ( cms , publishedResources ) ; // now iterate the actual resources to be exported Iterator < CmsPublishedResource > itPubRes = publishedResources . iterator ( ) ; while ( itPubRes . hasNext ( ) ) { CmsPublishedResource res = itPubRes . next ( ) ; if ( res . getState ( ) . isUnchanged ( ) ) { // unchanged resources don ' t need to be deleted continue ; } scrubResource ( cms , res , scrubbedFolders , scrubbedFiles ) ; } return publishedResources ;
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 operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; DataMigrationServiceInner & gt ; object */ public Observable < Page < DataMigrationServiceInner > > listNextAsync ( final String nextPageLink ) { } }
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < DataMigrationServiceInner > > , Page < DataMigrationServiceInner > > ( ) { @ Override public Page < DataMigrationServiceInner > call ( ServiceResponse < Page < DataMigrationServiceInner > > response ) { return response . body ( ) ; } } ) ;
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 ; } } if ( this . someSelectorsMatch ) { markCurrentSelection ( ) ; this . selectedHandler . handleComment ( buffer , contentOffset , contentLen , outerOffset , outerLen , line , col ) ; unmarkCurrentSelection ( ) ; return ; } unmarkCurrentSelection ( ) ; this . nonSelectedHandler . handleComment ( buffer , contentOffset , contentLen , outerOffset , outerLen , line , col ) ;
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 precedence . * @ param obj the obj Note : this impor pattern is becoming common . . . could * factor it out into an importedObject List < String > class . */ public void importObject ( final Object obj ) { } }
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 < RepositoryDto > createRepository ( ServiceRequestContext ctx , Project project , CreateRepositoryRequest request , Author author ) { } }
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 ( author , project . name ( ) , request . name ( ) ) ) . handle ( returnOrThrow ( ( ) -> DtoConverter . convert ( project . repos ( ) . get ( request . name ( ) ) ) ) ) ;
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 , final Node nodeTo ) { } }
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 . getValue ( ) ; final URI target = e . getKey ( ) ; copyTo . put ( target , source ) ; updateUplevels ( target ) ; } schemeSet . addAll ( listFilter . getSchemeRefSet ( ) ) ; // collect key definitions for ( final Map . Entry < String , KeyDef > e : keydefFilter . getKeysDMap ( ) . entrySet ( ) ) { // key and value . keys will differ when keydef is a redirect to another keydef final String key = e . getKey ( ) ; final KeyDef value = e . getValue ( ) ; if ( schemeSet . contains ( currentFile ) ) { schemekeydefMap . put ( key , new KeyDef ( key , value . href , value . scope , value . format , currentFile , null ) ) ; } } hrefTargetSet . addAll ( listFilter . getHrefTargets ( ) ) ; conrefTargetSet . addAll ( listFilter . getConrefTargets ( ) ) ; nonConrefCopytoTargetSet . addAll ( listFilter . getNonConrefCopytoTargets ( ) ) ; coderefTargetSet . addAll ( listFilter . getCoderefTargets ( ) ) ; outDitaFilesSet . addAll ( listFilter . getOutFilesSet ( ) ) ; // Generate topic - scheme dictionary final Set < URI > schemeSet = listFilter . getSchemeSet ( ) ; if ( schemeSet != null && ! schemeSet . isEmpty ( ) ) { Set < URI > children = schemeDictionary . get ( currentFile ) ; if ( children == null ) { children = new HashSet < > ( ) ; } children . addAll ( schemeSet ) ; schemeDictionary . put ( currentFile , children ) ; final Set < URI > hrfSet = listFilter . getHrefTargets ( ) ; for ( final URI filename : hrfSet ) { children = schemeDictionary . get ( filename ) ; if ( children == null ) { children = new HashSet < > ( ) ; } children . addAll ( schemeSet ) ; schemeDictionary . put ( filename , children ) ; } }
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 v ) { } }
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 || doJandexLog ) { boolean haveJandex = basicHasJandexIndex ( ) ; String msg ; if ( haveJandex ) { msg = MessageFormat . format ( "[ {0} ] Jandex disabled; Jandex index [ {1} ] found" , getHashText ( ) , getJandexIndexPath ( ) ) ; } else { msg = MessageFormat . format ( "[ {0} ] Jandex disabled; Jandex index [ {1} ] not found" , getHashText ( ) , getJandexIndexPath ( ) ) ; } if ( doLog ) { Tr . debug ( tc , msg ) ; } if ( doJandexLog ) { JandexLogger . log ( CLASS_NAME , methodName , msg ) ; } } return null ; } else { Index jandexIndex = basicGetJandexIndex ( ) ; if ( doLog || doJandexLog ) { String msg ; if ( jandexIndex != null ) { msg = MessageFormat . format ( "[ {0} ] Jandex enabled; Jandex index [ {1} ] found" , getHashText ( ) , getJandexIndexPath ( ) ) ; } else { msg = MessageFormat . format ( "[ {0} ] Jandex enabled; Jandex index [ {1} ] not found" , getHashText ( ) , getJandexIndexPath ( ) ) ; } if ( doLog ) { Tr . debug ( tc , msg ) ; } if ( doJandexLog ) { JandexLogger . log ( CLASS_NAME , methodName , msg ) ; } } return jandexIndex ; }
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 < LObjLongPredicate < T > > consumer ) { } }
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 foreign membership , and is only * possible in an internally - managed service . A group store in such a service can return the key * of a foreign member group , but not the group itself , which can only be returned by its local * store . * @ return String [ ] * @ param group org . apereo . portal . groups . IEntityGroup */ @ Override public String [ ] findMemberGroupKeys ( IEntityGroup group ) throws GroupsException { } }
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 ( ) ; // Return composite keys here . . . rslt . add ( g . getKey ( ) ) ; } return rslt . toArray ( new String [ rslt . size ( ) ] ) ;
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 / 1024 / 1024 ; } else { unit = unitMap . get ( s ) ; localSize = Integer . valueOf ( xmx . substring ( 4 , xmx . length ( ) - 1 ) ) ; } switch ( unit ) { case K : size = localSize / 1024 ; break ; case M : size = localSize ; break ; case G : size = localSize * 1024 ; break ; } return size ;
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 " ) ; * < / code > * < / pre > * @ param valid { @ link Boolean } value resulting from the evaluation of the criteria used by the application * to determine the validity of the argument . * @ param message { @ link Supplier } containing the message for the { @ link IllegalArgumentException } thrown * if the assertion fails . * @ throws java . lang . IllegalArgumentException if the argument is invalid . * @ see java . util . function . Supplier */ public static void argument ( Boolean valid , Supplier < String > message ) { } }
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 caller has insufficient permissions . * @ throws NotFoundException * The requested resource is not found . Make sure that the request URI is correct . * @ throws TooManyRequestsException * The request has reached its throttling limit . Retry after the specified time period . * @ throws BadRequestException * The submitted request is not valid , for example , the input is incomplete or incorrect . See the * accompanying error message for details . * @ sample AmazonApiGateway . DeleteRestApi */ @ Override public DeleteRestApiResult deleteRestApi ( DeleteRestApiRequest request ) { } }
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 found . * @ param key the hashtable key . * @ param defaultValue a default value . * @ return the value in this property list with the specified key value parsed as a float . */ public float getFloat ( String key , float defaultValue ) { } }
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 . * @ param proxyBuilder a builder for a proxy around the context root object to customize its interface * @ param paragraphCoordinates the paragraph whose comments to evaluate . * @ param < T > the type of the context root object . */ private < T > void runProcessorsOnParagraphComment ( final WordprocessingMLPackage document , final Map < BigInteger , CommentWrapper > comments , ProxyBuilder < T > proxyBuilder , ParagraphCoordinates paragraphCoordinates ) { } }
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 < ? > commentProcessorInterface = commentProcessorInterfaces . get ( processor ) ; proxyBuilder . withInterface ( commentProcessorInterface , processor ) ; processor . setCurrentParagraphCoordinates ( paragraphCoordinates ) ; } CommentWrapper commentWrapper = comments . get ( comment . getId ( ) ) ; try { T contextRootProxy = proxyBuilder . build ( ) ; expressionResolver . resolveExpression ( commentString , contextRootProxy ) ; CommentUtil . deleteComment ( commentWrapper ) ; logger . debug ( String . format ( "Comment '%s' has been successfully processed by a comment processor." , commentString ) ) ; } catch ( SpelEvaluationException | SpelParseException e ) { if ( failOnInvalidExpression ) { throw new UnresolvedExpressionException ( commentString , e ) ; } else { logger . warn ( String . format ( "Skipping comment expression '%s' because it can not be resolved by any comment processor. Reason: %s. Set log level to TRACE to view Stacktrace." , commentString , e . getMessage ( ) ) ) ; logger . trace ( "Reason for skipping comment: " , e ) ; } } catch ( ProxyException e ) { throw new DocxStamperException ( "Could not create a proxy around context root object" , e ) ; }
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 . * @ param eventHubConnectionName The name of the event hub connection . * @ param parameters The Event Hub connection parameters supplied to the CreateOrUpdate operation . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < EventHubConnectionInner > createOrUpdateAsync ( String resourceGroupName , String clusterName , String databaseName , String eventHubConnectionName , EventHubConnectionInner parameters , final ServiceCallback < EventHubConnectionInner > serviceCallback ) { } }
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 , final int size ) throws IOException { } }
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 is used to * call Socket # connect ( SocketAddress endpoint , int timeout ) method . When executing in older * JREs a controller thread is executed . The controller thread attempts to create a new socket * within the given limit of time . If socket constructor does not return until the timeout * expires , the controller terminates and throws an { @ link ConnectTimeoutException } * @ param host the host name / IP * @ param port the port on the host * @ param localAddress the local host name / IP to bind the socket to , ignored . * @ param localPort the port on the local machine , ignored . * @ param params { @ link HttpConnectionParams Http connection parameters } * @ return Socket a new socket * @ throws IOException if an I / O error occurs while creating the socket * @ throws UnknownHostException if the IP address of the host cannot be * determined * @ since 3.0 */ public Socket createSocket ( final String host , final int port , final InetAddress localAddress , final int localPort , final HttpConnectionParams params ) throws IOException , UnknownHostException , ConnectTimeoutException { } }
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 . createSocket ( "javax.net.ssl.SSLSocketFactory" , host , port , null , 0 , timeout ) ; if ( socket == null ) { socket = ControllerThreadSocketFactory . createSocket ( this , host , port , null , 0 , timeout ) ; } return socket ; }
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 > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "anchorPoint" ) public JAXBElement < CodeType > createAnchorPoint ( CodeType value ) { } }
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 destination , Field source ) { } }
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 destination interface result = ( Class < ? > ) implementationClass . get ( destinationClass . getName ( ) ) ; // if source is an implementation else { // retrieves source interface Class < ? > sourceInterface = sourceClass . getInterfaces ( ) [ 0 ] ; // if the destination and source interfaces are equal if ( destinationClass . equals ( sourceInterface ) ) // assigns implementation to destination result = sourceClass ; // if they are different else // destination gets the implementation of his interface result = ( Class < ? > ) implementationClass . get ( destinationClass . getName ( ) ) ; } // if destination is an implementation else result = destinationClass ; return result ;
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 config ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Removing repertoire: " + config . getAlias ( ) ) ; } repertoireMap . remove ( config . getAlias ( ) ) ; repertoirePIDMap . remove ( config . getPID ( ) ) ; repertoirePropertiesMap . remove ( config . getAlias ( ) ) ; processConfig ( repertoirePropertiesMap . remove ( config . getAlias ( ) ) != null ) ;
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 [ pos ] ) ; if ( isAvailable ( session ) ) { return session ; } } return null ; } }
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 ( IllegalStateException e ) { // Do nothing } mDelegate . mSession . deregisterBucketTrx ( this ) ; return true ; } else { return false ; }
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 # evacuate ( String , String , String , Boolean ) */ public EvacuateAction evacuate ( String serverId , String host ) { } }
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 , skipped ) ) ; } } else if ( this . remaining < 0 ) { throw new SerializationException ( String . format ( "Read more bytes than expected (%d)." , - this . remaining ) ) ; }
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 QualificationType ID . When performing a set comparison by using the In or the * NotIn comparator , you can use up to 15 IntegerValue elements in a QualificationRequirement data structure . * @ param integerValues * 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 QualificationType ID . When performing a set * comparison by using the In or the NotIn comparator , you can use up to 15 IntegerValue elements in a * QualificationRequirement data structure . */ public void setIntegerValues ( java . util . Collection < Integer > integerValues ) { } }
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 - resources - contextkeys . html " * > Actions , Resources , and Condition Keys for AWS Services < / a > in the < i > IAM User Guide < / i > . Choose the name of the * service to view details for that service . In the first paragraph , find the service prefix . For example , * < code > ( service prefix : a4b ) < / code > . For more information about service namespaces , see < a * href = " https : / / docs . aws . amazon . com / general / latest / gr / aws - arns - and - namespaces . html # genref - aws - service - namespaces " * > AWS Service Namespaces < / a > in the < i > AWS General Reference < / i > . * @ param serviceNamespaces * The service namespace for the AWS services whose policies you want to list . < / p > * To learn the service namespace for a service , go to < a href = * " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / reference _ policies _ actions - resources - contextkeys . html " * > Actions , Resources , and Condition Keys for AWS Services < / a > in the < i > IAM User Guide < / i > . Choose the name * of the service to view details for that service . In the first paragraph , find the service prefix . For * example , < code > ( service prefix : a4b ) < / code > . For more information about service namespaces , see < a * href = " https : / / docs . aws . amazon . com / general / latest / gr / aws - arns - and - namespaces . html # genref - aws - service - namespaces " * > AWS Service Namespaces < / a > in the < i > AWS General Reference < / i > . */ public void setServiceNamespaces ( java . util . Collection < String > serviceNamespaces ) { } }
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 ) , or Project instance * @ return the list of tags for the specified project ID * @ throws GitLabApiException if any exception occurs * @ deprecated Replaced by TagsApi . getTags ( Object ) */ @ Deprecated public List < Tag > getTags ( Object projectIdOrPath ) throws GitLabApiException { } }
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 token to use if unable to set a header ( optional ) * @ param fleetNewSettings * ( optional ) * @ return ApiResponse & lt ; Void & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public ApiResponse < Void > putFleetsFleetIdWithHttpInfo ( Long fleetId , String datasource , String token , FleetNewSettings fleetNewSettings ) throws ApiException { } }
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 ( sipServletImpl ) ;
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 RemoteException if the API request failed due to other errors . */ public static void runExample ( AdWordsServicesInterface adWordsServices , AdWordsSession session , Long campaignId ) throws RemoteException { } }
// 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 , AdGroupField . Name ) . orderAscBy ( AdGroupField . Name ) . offset ( offset ) . limit ( PAGE_SIZE ) . equals ( AdGroupField . CampaignId , campaignId . toString ( ) ) . build ( ) ; while ( morePages ) { // Get all ad groups . AdGroupPage page = adGroupService . get ( selector ) ; // Display ad groups . if ( page . getEntries ( ) != null ) { for ( AdGroup adGroup : page . getEntries ( ) ) { System . out . printf ( "Ad group with name '%s' and ID %d was found.%n" , adGroup . getName ( ) , adGroup . getId ( ) ) ; } } else { System . out . println ( "No ad groups were found." ) ; } offset += PAGE_SIZE ; selector = builder . increaseOffsetBy ( PAGE_SIZE ) . build ( ) ; morePages = offset < page . getTotalNumEntries ( ) ; }
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 newLeft = left . edit ( currentContext , BLACK , left . left , leftRight . left ) ; N newRight = node . edit ( currentContext , BLACK , leftRight . right , right ) ; return leftRight . edit ( currentContext , RED , newLeft , newRight ) ; } else { return node . edit ( currentContext , BLACK , left , right ) ; }
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 > method for the statementOrBundle property . * For example , to add a new item , do as follows : * < pre > * getStatementOrBundle ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link org . openprovenance . prov . sql . Entity } * { @ link Activity } * { @ link WasGeneratedBy } * { @ link Used } * { @ link WasInformedBy } * { @ link WasStartedBy } * { @ link WasEndedBy } * { @ link WasInvalidatedBy } * { @ link WasDerivedFrom } * { @ link Agent } * { @ link WasAttributedTo } * { @ link WasAssociatedWith } * { @ link ActedOnBehalfOf } * { @ link WasInfluencedBy } * { @ link SpecializationOf } * { @ link AlternateOf } * { @ link Collection } * { @ link EmptyCollection } * { @ link HadMember } * { @ link MentionOf } * { @ link Bundle } */ @ ManyToMany ( targetEntity = AStatement . class , cascade = { } }
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 < StatementOrBundle > ( ) ; } return this . statementOrBundle ;
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 Returns a reference to this object so that method calls can be chained together . */ public TransformJobDefinition withEnvironment ( java . util . Map < String , String > environment ) { } }
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 ( jTextPane1 . getText ( ) . getBytes ( ) ) ; os . flush ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { try { os . close ( ) ; } catch ( Exception ee ) { ee . printStackTrace ( ) ; } } }
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 " + baseName + '/' + ICU_RESOURCE_INDEX + ".res" ) ; Thread . dumpStack ( ) ; } return ; } UResourceBundleIterator iter = bundle . getIterator ( ) ; iter . reset ( ) ; while ( iter . hasNext ( ) ) { String locstr = iter . next ( ) . getKey ( ) ; locales . add ( locstr ) ; }
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 ( monitoringConfigurationDescription . getMetricsLevel ( ) , METRICSLEVEL_BINDING ) ; protocolMarshaller . marshall ( monitoringConfigurationDescription . getLogLevel ( ) , LOGLEVEL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 platform encoding . * @ exception SecurityException if a security manager exists and if * the caller does not have < tt > LoggingPermission ( " control " ) < / tt > . * @ exception UnsupportedEncodingException if the named encoding is * not supported . */ public synchronized void setEncoding ( String encoding ) throws SecurityException , java . io . UnsupportedEncodingException { } }
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 = 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 # getServices ( ) } * @ return list of blogs for the calling user . * @ throws JinxException if there are any errors . * @ see < a href = " https : / / www . flickr . com / services / api / flickr . blogs . getList . html " > flickr . blogs . getList < / a > */ public BlogList getBlogList ( String service ) throws JinxException { } }
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 if the first line should be considered a segment . * @ param p3 and p4 the coordinates of the second line . * @ param seg2 if the second line should be considered a segment . * @ param result the point that will be filled in with the intersecting point . * @ return true if result was filled in , or false if the lines are parallel or the point of * intersection lies outside of a segment . */ public static boolean lineIntersection ( Point2D p1 , Point2D p2 , boolean seg1 , Point2D p3 , Point2D p4 , boolean seg2 , Point2D result ) { } }
// 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 ) { return false ; } double y13 = p1 . getY ( ) - p3 . getY ( ) ; double x13 = p1 . getX ( ) - p3 . getX ( ) ; double ua = ( x43 * y13 - y43 * x13 ) / denom ; if ( seg1 && ( ( ua < 0 ) || ( ua > 1 ) ) ) { return false ; } if ( seg2 ) { double ub = ( x21 * y13 - y21 * x13 ) / denom ; if ( ( ub < 0 ) || ( ub > 1 ) ) { return false ; } } double x = p1 . getX ( ) + ua * x21 ; double y = p1 . getY ( ) + ua * y21 ; result . setLocation ( x , y ) ; return true ;
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 actual argument name . if ( Strings . startsWith ( argument , syntax . getEquationMarker ( ) ) ) { // Starts with an equation sign . Evaluating . final String equation = LmlUtilities . stripMarker ( argument ) ; templateReader . append ( newEquation ( ) . getResult ( equation ) , equation + " equation" ) ; } else if ( Strings . startsWith ( argument , syntax . getConditionMarker ( ) ) ) { // Condition / ternary operator . Evaluating . processConditionArgument ( argument , argumentBuilder ) ; } else { // Regular argument . Looking for value mapped to the selected key . templateReader . append ( Nullables . toString ( data . getArgument ( argument ) ) , argument + " argument" ) ; } return ; } argumentBuilder . append ( argumentCharacter ) ; }
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 ( CheckpointDataKey key ) { } }
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 output . * @ return the TagletOutput representation of this < code > Tag < / code > . */ public Content getTagletOutput ( Tag tag , TagletWriter tagletWriter ) { } }
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 occurred . */ public static String readPemFileAsBase64 ( final File file ) throws IOException { } }
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 . Iterator ( root . getParentNode ( ) ) ; while ( iter . hasNext ( ) ) handler . startPrefixMapping ( iter . next ( ) , iter . getNamespaceURI ( ) ) ; } break ; default : throw new IllegalArgumentException ( "Node must be Document or Element" ) ; } Node node = root ; AttributesImpl attrs = new AttributesImpl ( ) ; while ( node != null ) { locator . node = node ; switch ( node . getNodeType ( ) ) { case Node . DOCUMENT_NODE : handler . setDocumentLocator ( locator ) ; handler . startDocument ( ) ; break ; case Node . DOCUMENT_TYPE_NODE : DocumentType docType = ( DocumentType ) node ; handler . startDTD ( docType . getName ( ) , docType . getPublicId ( ) , docType . getSystemId ( ) ) ; break ; case Node . ELEMENT_NODE : attrs . clear ( ) ; NamedNodeMap nodeAttrs = node . getAttributes ( ) ; if ( nodeAttrs != null ) { for ( int i = nodeAttrs . getLength ( ) - 1 ; i >= 0 ; i -- ) { Node attr = nodeAttrs . item ( i ) ; if ( XMLNS_ATTRIBUTE . equals ( attr . getNodeName ( ) ) ) handler . startPrefixMapping ( "" , attr . getNodeValue ( ) ) ; else if ( XMLNS_ATTRIBUTE . equals ( attr . getPrefix ( ) ) ) handler . startPrefixMapping ( attr . getLocalName ( ) , attr . getNodeValue ( ) ) ; else attrs . addAttribute ( attr . getNamespaceURI ( ) , attr . getLocalName ( ) , attr . getNodeName ( ) , "CDATA" , attr . getNodeValue ( ) ) ; } } handler . startElement ( node . getNamespaceURI ( ) , node . getLocalName ( ) , node . getNodeName ( ) , attrs ) ; break ; case Node . TEXT_NODE : char chars [ ] = node . getNodeValue ( ) . toCharArray ( ) ; handler . characters ( chars , 0 , chars . length ) ; break ; case Node . CDATA_SECTION_NODE : chars = node . getNodeValue ( ) . toCharArray ( ) ; handler . startCDATA ( ) ; handler . characters ( chars , 0 , chars . length ) ; handler . endCDATA ( ) ; break ; case Node . PROCESSING_INSTRUCTION_NODE : ProcessingInstruction pi = ( ProcessingInstruction ) node ; handler . processingInstruction ( pi . getTarget ( ) , pi . getData ( ) ) ; break ; case Node . COMMENT_NODE : chars = node . getNodeValue ( ) . toCharArray ( ) ; handler . comment ( chars , 0 , chars . length ) ; } NodeList children = node . getChildNodes ( ) ; if ( children != null && children . getLength ( ) > 0 ) node = children . item ( 0 ) ; else { while ( true ) { locator . node = node ; switch ( node . getNodeType ( ) ) { case Node . ELEMENT_NODE : handler . endElement ( node . getNamespaceURI ( ) , node . getLocalName ( ) , node . getNodeName ( ) ) ; NamedNodeMap nodeAttrs = node . getAttributes ( ) ; if ( nodeAttrs != null ) { for ( int i = nodeAttrs . getLength ( ) - 1 ; i >= 0 ; i -- ) { Node attr = nodeAttrs . item ( i ) ; if ( XMLNS_ATTRIBUTE . equals ( attr . getNodeName ( ) ) ) handler . endPrefixMapping ( "" ) ; else if ( XMLNS_ATTRIBUTE . equals ( attr . getPrefix ( ) ) ) handler . endPrefixMapping ( attr . getLocalName ( ) ) ; } } break ; case Node . DOCUMENT_TYPE_NODE : handler . endDTD ( ) ; break ; } if ( node == root ) { if ( root . getNodeType ( ) == Node . ELEMENT_NODE && root . getParentNode ( ) != null ) { DOMNamespaceContext . Iterator iter = new DOMNamespaceContext . Iterator ( root . getParentNode ( ) ) ; while ( iter . hasNext ( ) ) handler . endPrefixMapping ( iter . next ( ) ) ; } handler . endDocument ( ) ; return ; } if ( node . getNextSibling ( ) != null ) { node = node . getNextSibling ( ) ; break ; } else node = node . getParentNode ( ) ; } } }
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 . hasNext ( ) ) { QueuedMessage msg = ( QueuedMessage ) msgItr . next ( ) ; try { msg . moveMessage ( discard ) ; } catch ( SIMPControllableNotFoundException e ) { // this probably means the message was already deleted while we were // busy . . . we ' ll log the exception and move on FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.runtime.LocalQueuePoint.deleteAllQueuedMessages" , "1:311:1.58" , this ) ; SibTr . exception ( tc , e ) ; } catch ( SIMPRuntimeOperationFailedException e ) { // this could happen for a number of reasons . We will remember the first // one of these and carry on trying to delete the rest of the messages . FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.runtime.LocalQueuePoint.deleteAllQueuedMessages" , "1:324:1.58" , this ) ; SibTr . exception ( tc , e ) ; if ( runtimeException == null ) runtimeException = e ; } } if ( runtimeException != null ) { SIMPRuntimeOperationFailedException finalE = new SIMPRuntimeOperationFailedException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0003" , new Object [ ] { "QueuedMessage.removeMessage" , "1:340:1.58" , runtimeException , id } , null ) , runtimeException ) ; SibTr . exception ( tc , finalE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeMessage" , finalE ) ; throw finalE ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteAllQueuedMessages" ) ;
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 generated , but we need the type // so we can generate the correct code in anticipation of the type being available // to the compiler . // Paramterized types which don ' t exist are returned as an error type whose name is " < any > " if ( "<any>" . equals ( errorType . toString ( ) ) ) { throw new CodeGenerationIncompleteException ( "Type reported as <any> is likely a not-yet generated parameterized type." ) ; } return ClassName . bestGuess ( errorType . toString ( ) ) ; } @ Override protected TypeName defaultAction ( TypeMirror typeMirror , Void v ) { return TypeName . get ( typeMirror ) ; } } , null ) ;
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 ) ; final int utfLen = dataInput . readUnsignedShort ( ) ; if ( utfLen == streamSize - 2 ) { boolean isAscii = true ; final byte [ ] bytes = sizedStream . toByteArray ( ) ; for ( int i = 0 ; i < utfLen ; ++ i ) { if ( ( bytes [ i + 2 ] & 0xff ) > 127 ) { isAscii = false ; break ; } } if ( isAscii ) { return fromAsciiByteArray ( bytes , 2 , utfLen ) ; } } sizedStream . reset ( ) ; } } try { String result = null ; StringBuilder builder = null ; for ( ; ; ) { final String temp ; try { temp = dataInput . readUTF ( ) ; if ( result != null && result . length ( ) == 0 && builder != null && builder . length ( ) == 0 && temp . length ( ) == 0 ) { break ; } } catch ( EOFException e ) { break ; } if ( result == null ) { result = temp ; } else { if ( builder == null ) { builder = new StringBuilder ( ) ; builder . append ( result ) ; } builder . append ( temp ) ; } } return ( builder != null ) ? builder . toString ( ) : result ; } finally { dataInput . close ( ) ; }
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 \ p to may both be NULL , in which * case this function only returns the number of edges in \ p numEdges . Otherwise , * \ p numEdges entries will be filled in . If \ p numEdges is higher than the actual * number of edges , the remaining entries in \ p from and \ p to will be set to NULL , and * the number of edges actually returned will be written to \ p numEdges . * @ param hGraph - Graph to get the edges from * @ param from - Location to return edge endpoints * @ param to - Location to return edge endpoints * @ param numEdges - See description * @ return * CUDA _ SUCCESS , * CUDA _ ERROR _ DEINITIALIZED , * CUDA _ ERROR _ NOT _ INITIALIZED , * CUDA _ ERROR _ INVALID _ VALUE * @ see * JCudaDriver # cuGraphGetNodes * JCudaDriver # cuGraphGetRootNodes * JCudaDriver # cuGraphAddDependencies * JCudaDriver # cuGraphRemoveDependencies * JCudaDriver # cuGraphNodeGetDependencies * JCudaDriver # cuGraphNodeGetDependentNodes */ public static int cuGraphGetEdges ( CUgraph hGraph , CUgraphNode from [ ] , CUgraphNode to [ ] , long numEdges [ ] ) { } }
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 ( ) + ") " + query . substring ( from ) ; // remove order by // TODO : remove more parts if ( resultCountQueryString . toLowerCase ( ) . contains ( "order by" ) ) { resultCountQueryString = resultCountQueryString . substring ( 0 , resultCountQueryString . toLowerCase ( ) . indexOf ( "order by" ) ) ; } log . debug ( "Created query for counting results '{}'" , resultCountQueryString ) ; return resultCountQueryString ;
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 JmesPathFunction function , final Void aVoid ) throws InvalidTypeException { } }
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 [ OtherConstants . PROTO_HEADER_CMD_INDEX ] ; byte returnStatus = header [ OtherConstants . PROTO_HEADER_STATUS_INDEX ] ; // 返回解析出来的ProtoHead return new ProtoHead ( returnContentLength , returnCmd , returnStatus ) ;
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 PortalException if a commerce shipping fixed option rel with the primary key could not be found */ @ Override public com . liferay . commerce . shipping . engine . fixed . model . CommerceShippingFixedOptionRel getCommerceShippingFixedOptionRel ( long commerceShippingFixedOptionRelId ) throws com . liferay . portal . kernel . exception . PortalException { } }
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 , fireableEventType , event , null , null , EVENT_FLAGS ) ; } catch ( Throwable e ) { tracer . severe ( e . getMessage ( ) , e ) ; }
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 unknownTypeReference ; } return cloneAndAssociate ( typeRef ) ;
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 session if it doesn ' t exist . */ protected HttpSession getIHttpSession ( HttpServletRequest _request , HttpServletResponse _response , boolean create , boolean cacheOnly ) { } }
// 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_IHTTP_SESSION ] , "createIfAbsent = " + create ) ; } HttpSession session = null ; SessionAffinityContext sac = getSessionAffinityContext ( _request ) ; if ( ! sac . isFirstSessionIdValid ( ) && ! sac . isAllSessionIdsSetViaSet ( ) ) { // PM89885 List allSessionIds = _sam . getAllCookieValues ( _request ) ; sac . setAllSessionIds ( allSessionIds ) ; _sam . setNextId ( sac ) ; // we got rid of the first one in setAllSessionIds , get the next one so that we have an id to work with } String id = _sam . getInUseSessionID ( _request , sac ) ; /* * PK68691 retrieve header $ WSFO set by Plugin . This header indicates the * failover request . Session manager will drop the in - memory session and * retrieves the latest session copy from the backend if the incoming * request is the failover one . */ if ( ( id != null ) && ( Boolean . valueOf ( _request . getHeader ( "$WSFO" ) ) . booleanValue ( ) ) ) { IStore iStore = _coreHttpSessionManager . getIStore ( ) ; iStore . removeFromMemory ( id ) ; } if ( id != null ) { if ( ( ! cacheOnly ) || ( _coreHttpSessionManager . getIStore ( ) . getFromMemory ( id ) != null ) ) { session = ( HttpSession ) _coreHttpSessionManager . getSession ( _request , _response , sac , false ) ; // don ' t create here } } if ( session != null ) { // we got existing session id = _sam . getInUseSessionID ( _request , sac ) ; // cmd 408029 - id may have // changed if we received // multiple session cookies if ( session . getMaxInactiveInterval ( ) == 0 ) { // Max Inact of 0 implies session is invalid - - set by remote // invalidateAll processing // we expect invalidator thread to clean it up , but if app requests the // session before that // happens , invalidate it here so it isn ' t given back out to app . session . invalidate ( ) ; session = null ; } else if ( ! id . equals ( session . getId ( ) ) ) { // always do basic crossover check Object parms [ ] = new Object [ ] { getAppName ( ) , session . getId ( ) , id } ; // Needed to create a LogRecord so we could have parameters and a // throwable in the same log LoggingUtil . logParamsAndException ( LoggingUtil . SESSION_LOGGER_CORE , Level . SEVERE , methodClassName , methodNames [ GET_IHTTP_SESSION ] , "SessionContext.CrossoverOnRetrieve" , parms , new SessionCrossoverStackTrace ( ) ) ; session = null ; // don ' t give out wrong session , but if create // is true , we ' ll continue to create new session } else if ( _smc . isDebugSessionCrossover ( ) && ( crossoverCheck ( _request , session ) ) ) { // crossover detection // must be enabled by DebugSessionCrossover property Object parms [ ] = new Object [ ] { _sap . getAppName ( ) , session . getId ( ) , getCurrentSessionId ( ) } ; // Needed to create a LogRecord so we could have parameters and a // throwable in the same log LoggingUtil . logParamsAndException ( LoggingUtil . SESSION_LOGGER_CORE , Level . SEVERE , methodClassName , methodNames [ GET_IHTTP_SESSION ] , "SessionContext.CrossoverOnRetrieve" , parms , new SessionCrossoverStackTrace ( ) ) ; session = null ; } } boolean createdOnThisRequest = false ; if ( ( session == null ) && create ) { // PK80439 : Validate that session id meets length requirements boolean reuseId = shouldReuseId ( _request , sac ) && checkSessionIdIsRightLength ( _sam . getInUseSessionID ( _request , sac ) ) ; session = ( HttpSession ) _coreHttpSessionManager . createSession ( _request , _response , sac , reuseId ) ; createdOnThisRequest = true ; } SessionData sd = ( SessionData ) session ; if ( sd != null ) { // security integration stuff if ( _smc . getIntegrateSecurity ( ) ) { SecurityCheckObject securityCheckObject = doSecurityCheck ( sd , _request , create ) ; if ( securityCheckObject . isDoSecurityCheckAgain ( ) ) { boolean reuseId = shouldReuseId ( _request , sac ) && checkSessionIdIsRightLength ( _sam . getInUseSessionID ( _request , sac ) ) ; session = ( HttpSession ) _coreHttpSessionManager . createSession ( _request , _response , sac , reuseId ) ; sd = ( SessionData ) session ; createdOnThisRequest = true ; securityCheckObject = doSecurityCheck ( sd , _request , create ) ; // shouldn ' t have an issue with the session being owned by someone else since we invalidated the previous session and created a brand new session } sd = securityCheckObject . getSessionObject ( ) ; } // cmd 372189 save pathinfo in case it contains ibmappid ( for SIP ) and app // calls sess . getIBMApplicationSession ( ) // Note : concurrent requests should have same ibmappid encoded so we // should be ok even with concurrent requests if ( isSIPApplication ) { sd . setSIPCookieInfo ( _request ) ; sd . setPathInfo ( _request . getPathInfo ( ) ) ; // this needs to be called here after the pathInfo has been set up // only want to call this when we create a session since the logicalname // won ' t change // changed " if ( createdOnThisRequest ) { " to // " if ( ! _ response . isCommitted ( ) ) { " // if the server shuts down , the logicalname does change , and we may // retrieve the session from the backend . // Therefore , we should always create the sip cookie ( although , we don ' t // want to throw an exception if the response is committed ) if ( ! _response . isCommitted ( ) ) { setSIPCookieIfApplicable ( _request , _response , sd ) ; } } } if ( _sap . getAllowDispatchRemoteInclude ( ) ) { ( ( SessionAffinityManager ) _sam ) . setSessionId ( _request , sac ) ; // sets the // full // session id // ( includes // cacheid / cloneids ) // on the // request // for RRD } if ( isTraceOn && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . exiting ( methodClassName , methodNames [ GET_IHTTP_SESSION ] ) ; } return sd ;
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 ( final RoleDescriptor roleDescriptor , final SamlRegisteredService service ) throws Exception { } }
val config = DefaultSecurityConfigurationBootstrap . buildDefaultSignatureSigningConfiguration ( ) ; val samlIdp = casProperties . getAuthn ( ) . getSamlIdp ( ) ; val algs = samlIdp . getAlgs ( ) ; val overrideSignatureReferenceDigestMethods = algs . getOverrideSignatureReferenceDigestMethods ( ) ; val overrideSignatureAlgorithms = algs . getOverrideSignatureAlgorithms ( ) ; val overrideBlackListedSignatureAlgorithms = algs . getOverrideBlackListedSignatureSigningAlgorithms ( ) ; val overrideWhiteListedAlgorithms = algs . getOverrideWhiteListedSignatureSigningAlgorithms ( ) ; if ( overrideBlackListedSignatureAlgorithms != null && ! overrideBlackListedSignatureAlgorithms . isEmpty ( ) ) { config . setBlacklistedAlgorithms ( overrideBlackListedSignatureAlgorithms ) ; } if ( overrideSignatureAlgorithms != null && ! overrideSignatureAlgorithms . isEmpty ( ) ) { config . setSignatureAlgorithms ( overrideSignatureAlgorithms ) ; } if ( overrideSignatureReferenceDigestMethods != null && ! overrideSignatureReferenceDigestMethods . isEmpty ( ) ) { config . setSignatureReferenceDigestMethods ( overrideSignatureReferenceDigestMethods ) ; } if ( overrideWhiteListedAlgorithms != null && ! overrideWhiteListedAlgorithms . isEmpty ( ) ) { config . setWhitelistedAlgorithms ( overrideWhiteListedAlgorithms ) ; } if ( StringUtils . isNotBlank ( algs . getOverrideSignatureCanonicalizationAlgorithm ( ) ) ) { config . setSignatureCanonicalizationAlgorithm ( algs . getOverrideSignatureCanonicalizationAlgorithm ( ) ) ; } LOGGER . trace ( "Signature signing blacklisted algorithms: [{}]" , config . getBlacklistedAlgorithms ( ) ) ; LOGGER . trace ( "Signature signing signature algorithms: [{}]" , config . getSignatureAlgorithms ( ) ) ; LOGGER . trace ( "Signature signing signature canonicalization algorithm: [{}]" , config . getSignatureCanonicalizationAlgorithm ( ) ) ; LOGGER . trace ( "Signature signing whitelisted algorithms: [{}]" , config . getWhitelistedAlgorithms ( ) ) ; LOGGER . trace ( "Signature signing reference digest methods: [{}]" , config . getSignatureReferenceDigestMethods ( ) ) ; val privateKey = getSigningPrivateKey ( ) ; val kekCredentialResolver = new MetadataCredentialResolver ( ) ; val roleDescriptorResolver = SamlIdPUtils . getRoleDescriptorResolver ( casSamlIdPMetadataResolver , samlIdp . getMetadata ( ) . isRequireValidMetadata ( ) ) ; kekCredentialResolver . setRoleDescriptorResolver ( roleDescriptorResolver ) ; kekCredentialResolver . setKeyInfoCredentialResolver ( DefaultSecurityConfigurationBootstrap . buildBasicInlineKeyInfoCredentialResolver ( ) ) ; kekCredentialResolver . initialize ( ) ; val criteriaSet = new CriteriaSet ( ) ; criteriaSet . add ( new SignatureSigningConfigurationCriterion ( config ) ) ; criteriaSet . add ( new UsageCriterion ( UsageType . SIGNING ) ) ; criteriaSet . add ( new EntityIdCriterion ( samlIdp . getEntityId ( ) ) ) ; criteriaSet . add ( new EntityRoleCriterion ( IDPSSODescriptor . DEFAULT_ELEMENT_NAME ) ) ; val credentials = Sets . < Credential > newLinkedHashSet ( kekCredentialResolver . resolve ( criteriaSet ) ) ; val creds = new ArrayList < Credential > ( ) ; credentials . forEach ( c -> { val cred = getResolvedSigningCredential ( c , privateKey , service ) ; if ( cred != null ) { if ( doesCredentialFingerprintMatch ( cred , service ) ) { creds . add ( cred ) ; } } } ) ; if ( creds . isEmpty ( ) ) { LOGGER . error ( "Unable to locate any signing credentials for service [{}]" , service . getName ( ) ) ; throw new IllegalArgumentException ( "Unable to locate signing credentials" ) ; } config . setSigningCredentials ( creds ) ; LOGGER . trace ( "Signature signing credentials configured with [{}] credentials" , creds . size ( ) ) ; return config ;
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 . out . println ( "stopwatch.sample() = " + stopwatch . sample ( ) ) ;
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 {}" , delayableImmutableMessage . getMessage ( ) , messageQueueId ) ; } delayableImmutableMessages . put ( delayableImmutableMessage ) ;
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 resource is not yet released * < li > < code > { @ link CmsResourceUtil # LAYOUTSTYLE _ AFTEREXPIRE } < / code > : The resource has already expired * < / ul > * @ return the layout style for the current time window state * @ see # getTimeWindowLayoutStyle ( ) */ public int getTimeWindowLayoutType ( ) { } }
int layoutstyle = CmsResourceUtil . LAYOUTSTYLE_INRANGE ; if ( ! m_resource . isReleased ( getCms ( ) . getRequestContext ( ) . getRequestTime ( ) ) ) { layoutstyle = CmsResourceUtil . LAYOUTSTYLE_BEFORERELEASE ; } else if ( m_resource . isExpired ( getCms ( ) . getRequestContext ( ) . getRequestTime ( ) ) ) { layoutstyle = CmsResourceUtil . LAYOUTSTYLE_AFTEREXPIRE ; } return layoutstyle ;
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 * with the name { @ code default } . * @ param name name of the scheduled executor config * @ return the scheduled executor configuration * @ throws ConfigurationException if ambiguous configurations are found * @ see StringPartitioningStrategy # getBaseName ( java . lang . String ) * @ see # setConfigPatternMatcher ( ConfigPatternMatcher ) * @ see # getConfigPatternMatcher ( ) * @ see EvictionConfig # setSize ( int ) */ public ScheduledExecutorConfig findScheduledExecutorConfig ( String name ) { } }
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 bundle , can be null * @ param rawMessage * The default message to use if the message key is not found * @ return The value of msg key lookup , or the value of raw message */ public static String getStringFromBundle ( String resourceBundleName , String msgKey , Locale tmpLocale , String rawMessage ) { } }
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 ) ;