signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class CreateIdentityPoolResult { /** * An array of Amazon Resource Names ( ARNs ) of the SAML provider for your identity pool .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSamlProviderARNs ( java . util . Collection ) } or { @ link # withSamlProviderARNs ( java . util . Collection ) } if you
* want to override the existing values .
* @ param samlProviderARNs
* An array of Amazon Resource Names ( ARNs ) of the SAML provider for your identity pool .
* @ return Returns a reference to this object so that method calls can be chained together . */
public CreateIdentityPoolResult withSamlProviderARNs ( String ... samlProviderARNs ) { } }
|
if ( this . samlProviderARNs == null ) { setSamlProviderARNs ( new java . util . ArrayList < String > ( samlProviderARNs . length ) ) ; } for ( String ele : samlProviderARNs ) { this . samlProviderARNs . add ( ele ) ; } return this ;
|
public class BuildsInner { /** * Patch the build properties .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param buildId The build ID .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable for the request */
public Observable < BuildInner > updateAsync ( String resourceGroupName , String registryName , String buildId ) { } }
|
return updateWithServiceResponseAsync ( resourceGroupName , registryName , buildId ) . map ( new Func1 < ServiceResponse < BuildInner > , BuildInner > ( ) { @ Override public BuildInner call ( ServiceResponse < BuildInner > response ) { return response . body ( ) ; } } ) ;
|
public class MaterialStepper { /** * Called when a step title is clicked . */
@ Override public void onSelection ( SelectionEvent < MaterialStep > event ) { } }
|
if ( stepSkippingAllowed ) { if ( event . getSelectedItem ( ) . getState ( ) == State . SUCCESS ) { goToStep ( event . getSelectedItem ( ) ) ; } }
|
public class BigComplexMath { /** * Calculates the { @ link BigDecimal } n ' th root of { @ link BigComplex } x ( < sup > n < / sup > √ x ) .
* < p > See < a href = " http : / / en . wikipedia . org / wiki / Square _ root " > Wikipedia : Square root < / a > < / p >
* @ param x the { @ link BigComplex } value to calculate the n ' th root
* @ param n the { @ link BigDecimal } defining the root
* @ param mathContext the { @ link MathContext } used for the result
* @ return the calculated n ' th root of x with the precision specified in the < code > mathContext < / code > */
public static BigComplex root ( BigComplex x , BigDecimal n , MathContext mathContext ) { } }
|
MathContext mc = new MathContext ( mathContext . getPrecision ( ) + 4 , mathContext . getRoundingMode ( ) ) ; return pow ( x , BigDecimal . ONE . divide ( n , mc ) , mc ) . round ( mathContext ) ;
|
public class Resolver { /** * Resolves the value of the current Promise with the given date .
* @ param value
* the value of the Promise */
public final void resolve ( Date value ) { } }
|
future . complete ( new Tree ( ( Tree ) null , null , value ) ) ;
|
public class BehaviorUnitComparator { /** * Compare two Xtext expressions .
* @ param e1 the first expression to compare .
* @ param e2 the second expression to compare .
* @ return A negative value if < code > e1 < / code > is
* lower than < code > e2 < / code > , a positive value if
* < code > e1 < / code > is greater than < code > e2 < / code > ,
* otherwise < code > 0 < / code > . */
public static int compare ( XExpression e1 , XExpression e2 ) { } }
|
if ( e1 == e2 ) { return 0 ; } if ( e1 == null ) { return Integer . MIN_VALUE ; } if ( e2 == null ) { return Integer . MAX_VALUE ; } return e1 . toString ( ) . compareTo ( e2 . toString ( ) ) ;
|
public class DocBookBuilder { /** * Builds the revision history for the book . The revision history used will be determined in the following order : < br / >
* < br / >
* 1 . Revision History Override < br / >
* 2 . Content Spec Revision History Topic < br / >
* 3 . Revision History Template
* @ param buildData Information and data structures for the build .
* @ param overrides The overrides to use for the build .
* @ throws BuildProcessingException */
protected void buildRevisionHistory ( final BuildData buildData , final Map < String , String > overrides ) throws BuildProcessingException { } }
|
final ContentSpec contentSpec = buildData . getContentSpec ( ) ; // Replace the basic injection data inside the revision history
final String revisionHistoryXml = stringConstantProvider . getStringConstant ( buildData . getServerEntities ( ) . getRevisionHistoryStringConstantId ( ) ) . getValue ( ) ; // DocBook 5 shouldn ' t have the < revhistory > wrapped in a < simpara >
final String fixedRevisionHistoryXml ; if ( buildData . getDocBookVersion ( ) == DocBookVersion . DOCBOOK_50 ) { fixedRevisionHistoryXml = revisionHistoryXml . replaceAll ( BuilderConstants . ESCAPED_TITLE_REGEX , buildData . getEscapedBookTitle ( ) ) . replace ( "<simpara>" , "" ) . replace ( "</simpara>" , "" ) ; } else { fixedRevisionHistoryXml = revisionHistoryXml . replaceAll ( BuilderConstants . ESCAPED_TITLE_REGEX , buildData . getEscapedBookTitle ( ) ) ; } // Setup Revision _ History . xml
if ( overrides . containsKey ( CSConstants . REVISION_HISTORY_OVERRIDE ) && buildData . getOverrideFiles ( ) . containsKey ( CSConstants . REVISION_HISTORY_OVERRIDE ) ) { byte [ ] revHistory = buildData . getOverrideFiles ( ) . get ( CSConstants . REVISION_HISTORY_OVERRIDE ) ; if ( buildData . getBuildOptions ( ) . getRevisionMessages ( ) != null && ! buildData . getBuildOptions ( ) . getRevisionMessages ( ) . isEmpty ( ) ) { try { // Parse the Revision History and add the new entry / entries
final ByteArrayInputStream bais = new ByteArrayInputStream ( revHistory ) ; final BufferedReader reader = new BufferedReader ( new InputStreamReader ( bais ) ) ; final StringBuilder buffer = new StringBuilder ( ) ; String line = "" ; while ( ( line = reader . readLine ( ) ) != null ) { buffer . append ( line + "\n" ) ; } if ( buildData . getBuildOptions ( ) . getRevisionMessages ( ) != null && ! buildData . getBuildOptions ( ) . getRevisionMessages ( ) . isEmpty ( ) ) { // Add a revision message to the Revision _ History . xml
final String revHistoryOverride = buffer . toString ( ) ; final String docType = XMLUtilities . findDocumentType ( revHistoryOverride ) ; if ( docType != null ) { buildRevisionHistoryFromTemplate ( buildData , revHistoryOverride . replace ( docType , "" ) ) ; } else { buildRevisionHistoryFromTemplate ( buildData , revHistoryOverride ) ; } } else { addToZip ( buildData . getBookLocaleFolder ( ) + "Revision_History.xml" , buffer . toString ( ) , buildData ) ; } } catch ( Exception e ) { log . error ( e . getMessage ( ) ) ; buildRevisionHistoryFromTemplate ( buildData , fixedRevisionHistoryXml ) ; } } else { // Add the revision history directly to the book
buildData . getOutputFiles ( ) . put ( buildData . getBookLocaleFolder ( ) + REVISION_HISTORY_FILE_NAME , revHistory ) ; } } else if ( contentSpec . getRevisionHistory ( ) != null ) { final TopicErrorData errorData = buildData . getErrorDatabase ( ) . getErrorData ( contentSpec . getRevisionHistory ( ) . getTopic ( ) ) ; final String revisionHistoryXML = DocBookBuildUtilities . convertDocumentToDocBookFormattedString ( buildData . getDocBookVersion ( ) , contentSpec . getRevisionHistory ( ) . getXMLDocument ( ) , "appendix" , buildData . getEntityFileName ( ) , getXMLFormatProperties ( ) ) ; if ( buildData . getBuildOptions ( ) . getRevisionMessages ( ) != null && ! buildData . getBuildOptions ( ) . getRevisionMessages ( ) . isEmpty ( ) ) { buildRevisionHistoryFromTemplate ( buildData , revisionHistoryXML ) ; } else if ( errorData != null && errorData . hasFatalErrors ( ) ) { buildRevisionHistoryFromTemplate ( buildData , revisionHistoryXML ) ; } else { // Add the revision history directly to the book
addToZip ( buildData . getBookLocaleFolder ( ) + REVISION_HISTORY_FILE_NAME , revisionHistoryXML , buildData ) ; } } else { buildRevisionHistoryFromTemplate ( buildData , fixedRevisionHistoryXml ) ; }
|
public class SphinxLinks { /** * Takes a string and replaces occurrences of rst / sphinx with kurento domain markup with javadoc
* and jsdoc equivalents .
* @ param arguments
* A list of arguments as Strings from the call . The first one is the rst / sphinx text ,
* and the second optional one defines the current class full name .
* @ see freemarker . template . TemplateMethodModelEx # exec ( java . util . List ) */
@ SuppressWarnings ( "rawtypes" ) @ Override public Object exec ( List arguments ) throws TemplateModelException { } }
|
// Classes
String typeName = arguments . get ( 0 ) . toString ( ) ; String res = translate ( typeName , toReplace ) ; // Instance properties
String classNamePath = arguments . size ( ) > 1 ? "module:" + arguments . get ( 1 ) . toString ( ) : "" ; String instanceProperty = "{@link " + classNamePath + "#$1}" ; String instancePropertyAlt = "{@link " + classNamePath + "#$2 $1}" ; res = translate ( res , Arrays . asList ( new String [ ] [ ] { { ":rom:meth:`([^`]*?)<([^`]*?)>`" , instancePropertyAlt } , { ":rom:meth:`([^`]*?)`" , instanceProperty } , { ":rom:attr:`([^`]*?)<([^`]*?)>`" , instancePropertyAlt } , { ":rom:attr:`([^`]*?)`" , instanceProperty } , } ) ) ; // Glosaries
Matcher m2 = glossary_term_2 . matcher ( res ) ; while ( m2 . find ( ) ) { res = res . substring ( 0 , m2 . start ( ) - 1 ) + String . format ( glossary_href , make_id ( m2 . group ( 2 ) ) , m2 . group ( 1 ) ) + res . substring ( m2 . end ( ) + 1 ) ; } m2 = glossary_term_1 . matcher ( res ) ; while ( m2 . find ( ) ) { res = res . substring ( 0 , m2 . start ( ) ) + String . format ( glossary_href , make_id ( m2 . group ( 1 ) ) , m2 . group ( 1 ) ) + res . substring ( m2 . end ( ) ) ; } return res ;
|
public class UploadObjectObserver { /** * Used to initialized this observer . This method is an SPI ( service
* provider interface ) that is called from
* < code > AmazonS3EncryptionClient < / code > .
* Implementation of this method should never block .
* @ param req
* the upload object request
* @ param s3direct
* used to perform non - encrypting s3 operation via the current
* instance of s3 ( encryption ) client
* @ param s3
* the current instance of s3 ( encryption ) client
* @ param es
* the executor service to be used for concurrent uploads
* @ return this object */
public UploadObjectObserver init ( UploadObjectRequest req , S3DirectSpi s3direct , AmazonS3 s3 , ExecutorService es ) { } }
|
this . req = req ; this . s3direct = s3direct ; this . s3 = s3 ; this . es = es ; return this ;
|
public class SimpleInterval { /** * / * [ deutsch ]
* < p > Formatiert dieses Intervall in einem benutzerdefinierten Format . < / p >
* @ param printer format object for printing start and end components
* @ param intervalPattern interval pattern containing placeholders { 0 } and { 1 } ( for start and end )
* @ return formatted string in given pattern format */
public String print ( ChronoPrinter < T > printer , String intervalPattern ) { } }
|
AttributeQuery attrs = printer . getAttributes ( ) ; StringBuilder sb = new StringBuilder ( 32 ) ; int i = 0 ; int n = intervalPattern . length ( ) ; while ( i < n ) { char c = intervalPattern . charAt ( i ) ; if ( ( c == '{' ) && ( i + 2 < n ) && ( intervalPattern . charAt ( i + 2 ) == '}' ) ) { char next = intervalPattern . charAt ( i + 1 ) ; if ( next == '0' ) { if ( this . start . isInfinite ( ) ) { sb . append ( "-\u221E" ) ; } else { printer . print ( this . start . getTemporal ( ) , sb , attrs ) ; } i += 3 ; continue ; } else if ( next == '1' ) { if ( this . end . isInfinite ( ) ) { sb . append ( "+\u221E" ) ; } else { printer . print ( this . end . getTemporal ( ) , sb , attrs ) ; } i += 3 ; continue ; } } sb . append ( c ) ; i ++ ; } return sb . toString ( ) ;
|
public class Logger { /** * Issue a log message with parameters and a throwable with a level of FATAL .
* @ param loggerFqcn the logger class name
* @ param message the message
* @ param params the message parameters
* @ param t the throwable */
public void fatal ( String loggerFqcn , Object message , Object [ ] params , Throwable t ) { } }
|
doLog ( Level . FATAL , loggerFqcn , message , params , t ) ;
|
public class lbroute6 { /** * Use this API to fetch lbroute6 resources of given names . */
public static lbroute6 [ ] get ( nitro_service service , String network [ ] ) throws Exception { } }
|
if ( network != null && network . length > 0 ) { lbroute6 response [ ] = new lbroute6 [ network . length ] ; lbroute6 obj [ ] = new lbroute6 [ network . length ] ; for ( int i = 0 ; i < network . length ; i ++ ) { obj [ i ] = new lbroute6 ( ) ; obj [ i ] . set_network ( network [ i ] ) ; response [ i ] = ( lbroute6 ) obj [ i ] . get_resource ( service ) ; } return response ; } return null ;
|
public class AssociationPersister { /** * Returns an { @ link AssociationContext } to be passed to { @ link GridDialect } operations targeting the association
* managed by this persister . */
public AssociationContext getAssociationContext ( ) { } }
|
if ( associationContext == null ) { associationContext = new AssociationContextImpl ( associationTypeContext , hostingEntity != null ? OgmEntityEntryState . getStateFor ( session , hostingEntity ) . getTuplePointer ( ) : new TuplePointer ( ) , transactionContext ( session ) ) ; } return associationContext ;
|
public class LinkedList { /** * Replaces the element at the specified position in this list with the
* specified element .
* @ param index index of the element to replace
* @ param element element to be stored at the specified position
* @ return the element previously at the specified position
* @ throws IndexOutOfBoundsException { @ inheritDoc } */
public E set ( int index , E element ) { } }
|
checkElementIndex ( index ) ; Node < E > x = node ( index ) ; E oldVal = x . item ; x . item = element ; return oldVal ;
|
public class ClientFactory { /** * Asynchronously creates a new message receiver to the entity on the messagingFactory .
* @ param messagingFactory messaging factory ( which represents a connection ) on which receiver needs to be created .
* @ param entityPath path of entity
* @ return a CompletableFuture representing the pending creation of message receiver */
public static CompletableFuture < IMessageReceiver > createMessageReceiverFromEntityPathAsync ( MessagingFactory messagingFactory , String entityPath ) { } }
|
return createMessageReceiverFromEntityPathAsync ( messagingFactory , entityPath , DEFAULTRECEIVEMODE ) ;
|
public class Iterators { /** * Wraps the given Iterator into an Iterable .
* @ param it The Iterator to wrap .
* @ return An { @ link Iterable } which returns the given Iterator . */
public static < T > Iterable < T > iterableOf ( Iterator < T > it ) { } }
|
final Iterator < T > theIt = Require . nonNull ( it , "it" ) ; return new Iterable < T > ( ) { @ Override public Iterator < T > iterator ( ) { return theIt ; } } ;
|
public class DefaultGroovyMethods { /** * A convenience method for creating an immutable list
* @ param self a List
* @ return an immutable List
* @ see java . util . Collections # unmodifiableList ( java . util . List )
* @ since 1.0 */
public static < T > List < T > asImmutable ( List < ? extends T > self ) { } }
|
return Collections . unmodifiableList ( self ) ;
|
public class LifecycleQueryInstalledChaincodeProposalResponse { /** * The lable used by this chaincode . This is defined by the installed chaincode . See label parameter in { @ link LifecycleChaincodePackage # fromSource ( String , Path , TransactionRequest . Type , String , Path ) }
* @ return the label
* @ throws ProposalException */
public String getLabel ( ) throws ProposalException { } }
|
Lifecycle . QueryInstalledChaincodeResult queryInstalledChaincodeResult = parsePayload ( ) ; if ( queryInstalledChaincodeResult == null ) { return null ; } return queryInstalledChaincodeResult . getLabel ( ) ;
|
public class JawrBinaryResourceRequestHandler { /** * ( non - Javadoc )
* @ see
* net . jawr . web . servlet . JawrRequestHandler # writeContent ( java . lang . String ,
* javax . servlet . http . HttpServletRequest ,
* javax . servlet . http . HttpServletResponse ) */
@ Override protected void writeContent ( String requestedPath , HttpServletRequest request , HttpServletResponse response ) throws IOException , ResourceNotFoundException { } }
|
String resourceName = requestedPath ; if ( ! jawrConfig . getGeneratorRegistry ( ) . isGeneratedBinaryResource ( resourceName ) && ! resourceName . startsWith ( URL_SEPARATOR ) ) { resourceName = URL_SEPARATOR + resourceName ; } try ( InputStream is = rsReaderHandler . getResourceAsStream ( resourceName ) ; OutputStream os = response . getOutputStream ( ) ) { IOUtils . copy ( is , os ) ; } catch ( EOFException eofex ) { LOGGER . debug ( "Browser cut off response" , eofex ) ; } catch ( IOException e ) { if ( ClientAbortExceptionResolver . isClientAbortException ( e ) ) { LOGGER . debug ( "Browser cut off response" , e ) ; } else { throw e ; } }
|
public class StorageBuilder { /** * Builds a provider - specific storage implementation , by passing this builder in constructor . Each implementation
* gets its required information from builder .
* @ return The storage builder */
public IStorageProvider build ( ) { } }
|
if ( appInfoRepo == null ) { throw new IllegalStateException ( "Undefined application information repository" ) ; } if ( userCredentialsRepo == null ) { throw new IllegalStateException ( "Undefined user credentials repository" ) ; } try { Constructor providerConstructor = providerClass . getConstructor ( StorageBuilder . class ) ; StorageProvider providerInstance = ( StorageProvider ) providerConstructor . newInstance ( this ) ; return providerInstance ; } catch ( InvocationTargetException itex ) { Throwable cause = itex . getCause ( ) ; if ( cause instanceof RuntimeException ) { throw ( RuntimeException ) cause ; } // should not happen , providers constructors do not throw checked exceptions :
throw new UnsupportedOperationException ( "Error instantiating the provider " + providerClass . getSimpleName ( ) , itex ) ; } catch ( Exception ex ) { throw new UnsupportedOperationException ( "Error instantiating the provider " + providerClass . getSimpleName ( ) , ex ) ; }
|
public class BundleDelegatingComponentInstanciationListener { /** * { @ inheritDoc } */
public void inject ( Object toInject , Class < ? > toHandle ) { } }
|
synchronized ( listeners ) { Collection < BundleAnalysingComponentInstantiationListener > values = listeners . values ( ) ; for ( BundleAnalysingComponentInstantiationListener analyser : values ) { if ( analyser . injectionPossible ( toHandle ) ) { analyser . inject ( toInject , toHandle ) ; return ; } } } throw new IllegalStateException ( "no source for injection found" ) ;
|
public class BeanMapper { /** * 简单的复制出新类型对象 . */
public static < S , D > D map ( S source , Class < D > destinationClass ) { } }
|
return mapper . map ( source , destinationClass ) ;
|
public class StringBuffer { /** * readObject is called to restore the state of the StringBuffer from
* a stream . */
private void readObject ( java . io . ObjectInputStream s ) throws java . io . IOException , ClassNotFoundException { } }
|
java . io . ObjectInputStream . GetField fields = s . readFields ( ) ; char [ ] value = ( char [ ] ) fields . get ( "value" , null ) ; int count = fields . get ( "count" , 0 ) ; append ( value , 0 , count ) ;
|
public class PatchSchedulesInner { /** * Gets all patch schedules in the specified redis cache ( there is only one ) .
* @ 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 ; RedisPatchScheduleInner & gt ; object */
public Observable < ServiceResponse < Page < RedisPatchScheduleInner > > > listByRedisResourceNextWithServiceResponseAsync ( final String nextPageLink ) { } }
|
return listByRedisResourceNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < RedisPatchScheduleInner > > , Observable < ServiceResponse < Page < RedisPatchScheduleInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < RedisPatchScheduleInner > > > call ( ServiceResponse < Page < RedisPatchScheduleInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listByRedisResourceNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
|
public class AbstractMultiDataSetNormalizer { /** * Fit an iterator
* @ param iterator for the data to iterate over */
public void fit ( @ NonNull MultiDataSetIterator iterator ) { } }
|
List < S . Builder > featureNormBuilders = new ArrayList < > ( ) ; List < S . Builder > labelNormBuilders = new ArrayList < > ( ) ; iterator . reset ( ) ; while ( iterator . hasNext ( ) ) { MultiDataSet next = iterator . next ( ) ; fitPartial ( next , featureNormBuilders , labelNormBuilders ) ; } featureStats = buildList ( featureNormBuilders ) ; if ( isFitLabel ( ) ) { labelStats = buildList ( labelNormBuilders ) ; }
|
public class ViewPortHandler { /** * Load the windows resize handler with initial view port detection . */
protected ViewPort load ( ) { } }
|
resize = Window . addResizeHandler ( event -> { execute ( event . getWidth ( ) , event . getHeight ( ) ) ; } ) ; execute ( window ( ) . width ( ) , ( int ) window ( ) . height ( ) ) ; return viewPort ;
|
public class TimeZoneFormat { /** * Private method returning the instance of TimeZoneGenericNames
* used by this object . The instance of TimeZoneGenericNames might
* not be available until the first use ( lazy instantiation ) because
* it is only required for handling generic names ( that are not used
* by DateFormat ' s default patterns ) and it requires relatively heavy
* one time initialization .
* @ return the instance of TimeZoneGenericNames used by this object . */
private TimeZoneGenericNames getTimeZoneGenericNames ( ) { } }
|
if ( _gnames == null ) { // _ gnames is volatile
synchronized ( this ) { if ( _gnames == null ) { _gnames = TimeZoneGenericNames . getInstance ( _locale ) ; } } } return _gnames ;
|
public class Fishbowl { /** * Executes the given statement and encloses any checked exception
* thrown with an unchecked { @ link WrappedException } , that
* is thrown instead . Returns the statement ' s return value if no
* exception is thrown .
* < pre >
* public void doSomething ( ) {
* URL url = wrapCheckedException ( ( ) - & gt ; new URL ( " http : / / something / " ) ) ;
* < / pre >
* < p > This avoids adding { @ code throws MalformedURLException } to the
* method ' s signature and is a replacement for the common
* try - catch - throw - RuntimeException pattern :
* < pre >
* public void doSomething ( ) {
* URL url ;
* try {
* url = new URL ( " http : / / something / " ) ;
* } catch ( MalformedURLException e ) {
* throw new RuntimeException ( e ) ;
* < / pre >
* @ param statement The statement that is executed .
* @ param < V > type of the value that is returned by the statement .
* @ return the return value of the statement .
* @ see # wrapCheckedException ( Statement ) */
public static < V > V wrapCheckedException ( StatementWithReturnValue < V > statement ) { } }
|
try { return statement . evaluate ( ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Error e ) { throw e ; } catch ( Throwable e ) { throw new WrappedException ( e ) ; }
|
public class CPDefinitionLinkPersistenceImpl { /** * Returns the cp definition links before and after the current cp definition link in the ordered set where CProductId = & # 63 ; and type = & # 63 ; .
* @ param CPDefinitionLinkId the primary key of the current cp definition link
* @ param CProductId the c product ID
* @ param type the type
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the previous , current , and next cp definition link
* @ throws NoSuchCPDefinitionLinkException if a cp definition link with the primary key could not be found */
@ Override public CPDefinitionLink [ ] findByCP_T_PrevAndNext ( long CPDefinitionLinkId , long CProductId , String type , OrderByComparator < CPDefinitionLink > orderByComparator ) throws NoSuchCPDefinitionLinkException { } }
|
CPDefinitionLink cpDefinitionLink = findByPrimaryKey ( CPDefinitionLinkId ) ; Session session = null ; try { session = openSession ( ) ; CPDefinitionLink [ ] array = new CPDefinitionLinkImpl [ 3 ] ; array [ 0 ] = getByCP_T_PrevAndNext ( session , cpDefinitionLink , CProductId , type , orderByComparator , true ) ; array [ 1 ] = cpDefinitionLink ; array [ 2 ] = getByCP_T_PrevAndNext ( session , cpDefinitionLink , CProductId , type , orderByComparator , false ) ; return array ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; }
|
public class AeroGearFCMPushRegistrar { /** * Send a confirmation the message was opened
* @ param metricsMessage The id of the message received
* @ param callback a callback . */
@ Override public void sendMetrics ( final UnifiedPushMetricsMessage metricsMessage , final Callback < UnifiedPushMetricsMessage > callback ) { } }
|
new AsyncTask < Void , Void , Exception > ( ) { @ Override protected Exception doInBackground ( Void ... params ) { try { if ( ( metricsMessage . getMessageId ( ) == null ) || ( metricsMessage . getMessageId ( ) . trim ( ) . equals ( "" ) ) ) { throw new IllegalStateException ( "Message ID cannot be null or blank" ) ; } HttpProvider provider = httpProviderProvider . get ( metricsURL , TIMEOUT ) ; setPasswordAuthentication ( variantId , secret , provider ) ; try { provider . put ( metricsMessage . getMessageId ( ) , "" ) ; return null ; } catch ( HttpException ex ) { return ex ; } } catch ( Exception ex ) { return ex ; } } @ SuppressWarnings ( "unchecked" ) @ Override protected void onPostExecute ( Exception result ) { if ( result == null ) { callback . onSuccess ( metricsMessage ) ; } else { callback . onFailure ( result ) ; } } } . execute ( ( Void ) null ) ;
|
public class EvalVisitor { /** * Implementations for functions . */
@ Override protected SoyValue visitFunctionNode ( FunctionNode node ) { } }
|
Object soyFunction = node . getSoyFunction ( ) ; // Handle nonplugin functions .
if ( soyFunction instanceof BuiltinFunction ) { BuiltinFunction nonpluginFn = ( BuiltinFunction ) soyFunction ; switch ( nonpluginFn ) { case IS_FIRST : return visitIsFirstFunction ( node ) ; case IS_LAST : return visitIsLastFunction ( node ) ; case INDEX : return visitIndexFunction ( node ) ; case CHECK_NOT_NULL : return visitCheckNotNullFunction ( node . getChild ( 0 ) ) ; case CSS : return visitCssFunction ( node ) ; case XID : return visitXidFunction ( node ) ; case IS_PRIMARY_MSG_IN_USE : return visitIsPrimaryMsgInUseFunction ( node ) ; case V1_EXPRESSION : throw new UnsupportedOperationException ( "the v1Expression function can't be used in templates compiled to Java" ) ; case TO_FLOAT : return visitToFloatFunction ( node ) ; case DEBUG_SOY_TEMPLATE_INFO : return BooleanData . forValue ( debugSoyTemplateInfo ) ; case VE_DATA : return NullData . INSTANCE ; case MSG_WITH_ID : case REMAINDER : // should have been removed earlier in the compiler
throw new AssertionError ( ) ; } throw new AssertionError ( ) ; } else if ( soyFunction instanceof SoyJavaFunction ) { List < SoyValue > args = this . visitChildren ( node ) ; SoyJavaFunction fn = ( SoyJavaFunction ) soyFunction ; // Note : Arity has already been checked by CheckFunctionCallsVisitor .
return computeFunctionHelper ( fn , args , node ) ; } else if ( soyFunction instanceof SoyJavaSourceFunction ) { List < SoyValue > args = this . visitChildren ( node ) ; SoyJavaSourceFunction fn = ( SoyJavaSourceFunction ) soyFunction ; // Note : Arity has already been checked by CheckFunctionCallsVisitor .
return computeFunctionHelper ( fn , args , node ) ; } else if ( soyFunction instanceof LoggingFunction ) { return StringData . forValue ( ( ( LoggingFunction ) soyFunction ) . getPlaceholder ( ) ) ; } else { throw RenderException . create ( "Failed to find Soy function with name '" + node . getFunctionName ( ) + "'" + " (function call \"" + node . toSourceString ( ) + "\")." ) ; }
|
public class AWSStorageGatewayClient { /** * Returns information about the cache of a gateway . This operation is only supported in the cached volume , tape and
* file gateway types .
* The response includes disk IDs that are configured as cache , and it includes the amount of cache allocated and
* used .
* @ param describeCacheRequest
* @ return Result of the DescribeCache operation returned by the service .
* @ throws InvalidGatewayRequestException
* An exception occurred because an invalid gateway request was issued to the service . For more information ,
* see the error and message fields .
* @ throws InternalServerErrorException
* An internal server error has occurred during the request . For more information , see the error and message
* fields .
* @ sample AWSStorageGateway . DescribeCache
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / storagegateway - 2013-06-30 / DescribeCache " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DescribeCacheResult describeCache ( DescribeCacheRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeCache ( request ) ;
|
public class ConfigClientWatch { /** * / * for testing */
boolean stateChanged ( String oldState , String newState ) { } }
|
return ( ! hasText ( oldState ) && hasText ( newState ) ) || ( hasText ( oldState ) && ! oldState . equals ( newState ) ) ;
|
public class PropertiesUtil { /** * Generate java code by the specified xml .
* @ param is
* @ param srcPath
* @ param packageName
* @ param className
* @ param isPublicField */
public static void xml2Java ( InputStream is , String srcPath , String packageName , String className , boolean isPublicField ) { } }
|
DocumentBuilder docBuilder = XMLUtil . createDOMParser ( true , true ) ; Writer writer = null ; try { Document doc = docBuilder . parse ( is ) ; Node root = doc . getFirstChild ( ) ; // TODO it ' s difficult to support duplicated property and may be misused .
if ( hasDuplicatedPropName ( root ) ) { throw new AbacusException ( "The source xml document contains duplicated properties which has same node tag name in the same root." ) ; } if ( className == null ) { className = StringUtil . capitalize ( root . getNodeName ( ) ) ; } String classFilePath = ClassUtil . makePackageFolder ( srcPath , packageName ) ; File classFile = new File ( classFilePath + className + ".java" ) ; if ( classFile . exists ( ) ) { classFile . delete ( ) ; } classFile . createNewFile ( ) ; writer = new OutputStreamWriter ( new FileOutputStream ( classFile ) , Charsets . UTF_8 ) ; writer . write ( "package " + packageName + ";" + IOUtil . LINE_SEPARATOR ) ; writer . write ( IOUtil . LINE_SEPARATOR ) ; writer . write ( IOUtil . LINE_SEPARATOR ) ; Set < String > importType = getImportType ( root ) ; if ( hasDuplicatedPropName ( root ) ) { importType . add ( List . class . getCanonicalName ( ) ) ; importType . add ( java . util . ArrayList . class . getCanonicalName ( ) ) ; importType . add ( java . util . Collections . class . getCanonicalName ( ) ) ; } importType . add ( Map . class . getCanonicalName ( ) ) ; for ( String clsName : importType ) { writer . write ( "import " + clsName + ";" + IOUtil . LINE_SEPARATOR ) ; } writer . write ( IOUtil . LINE_SEPARATOR ) ; writer . write ( "import " + Properties . class . getCanonicalName ( ) + ";" + IOUtil . LINE_SEPARATOR ) ; writer . write ( IOUtil . LINE_SEPARATOR ) ; xmlProperties2Java ( root , writer , className , isPublicField , "" , true ) ; writer . flush ( ) ; } catch ( Exception e ) { throw N . toRuntimeException ( e ) ; } finally { IOUtil . close ( writer ) ; }
|
public class EDBUtils { /** * Converts a list of EDBObjects into a list of JPAObjects */
public static List < JPAObject > convertEDBObjectsToJPAObjects ( List < EDBObject > objects ) { } }
|
List < JPAObject > result = new ArrayList < JPAObject > ( ) ; for ( EDBObject object : objects ) { result . add ( convertEDBObjectToJPAObject ( object ) ) ; } return result ;
|
public class ChainLight { /** * Attaches light to specified body with relative direction offset
* @ param body
* that will be automatically followed , note that the body
* rotation angle is taken into account for the light offset
* and direction calculations
* @ param degrees
* directional relative offset in degrees */
public void attachToBody ( Body body , float degrees ) { } }
|
this . body = body ; this . bodyPosition . set ( body . getPosition ( ) ) ; bodyAngleOffset = MathUtils . degreesToRadians * degrees ; bodyAngle = body . getAngle ( ) ; applyAttachment ( ) ; if ( staticLight ) dirty = true ;
|
public class WsHandshakeValidator { /** * Facade method to validate an HttpMessageRequest .
* @ param request the request to validate
* @ return true iff the appropriate handshake for websocket protocol is contained
* within the provided request . */
public boolean validate ( HttpRequestMessage request , boolean isPostMethodAllowed ) { } }
|
WebSocketWireProtocol wireProtocolVersion = guessWireProtocolVersion ( request ) ; if ( wireProtocolVersion == null ) { return false ; } final WsHandshakeValidator validator = handshakeValidatorsByWireProtocolVersion . get ( wireProtocolVersion ) ; return validator != null && validator . doValidate ( request , isPostMethodAllowed ) ;
|
public class GVRAndroidResource { /** * Returns the full path of the resource file with extension .
* @ return path of the GVRAndroidResource . May return null if the
* resource is not associated with any file */
public String getResourcePath ( ) { } }
|
switch ( resourceType ) { case ANDROID_ASSETS : return assetPath ; case ANDROID_RESOURCE : return resourceFilePath ; case LINUX_FILESYSTEM : return filePath ; case NETWORK : return url . getPath ( ) ; case INPUT_STREAM : return inputStreamName ; default : return null ; }
|
public class LTPAToken2Factory { /** * { @ inheritDoc } */
@ Override public Token createToken ( Map tokenData ) throws TokenCreationFailedException { } }
|
String userUniqueId = getUniqueId ( tokenData ) ; return new LTPAToken2 ( userUniqueId , expirationInMinutes , sharedKey , privateKey , publicKey ) ;
|
public class QueryParserBase { /** * Get the mapped field name using meta information derived from the given domain type .
* @ param fieldName
* @ param domainType
* @ return
* @ since 4.0 */
protected String getMappedFieldName ( String fieldName , @ Nullable Class < ? > domainType ) { } }
|
if ( domainType == null || mappingContext == null ) { return fieldName ; } SolrPersistentEntity entity = mappingContext . getPersistentEntity ( domainType ) ; if ( entity == null ) { return fieldName ; } SolrPersistentProperty property = entity . getPersistentProperty ( fieldName ) ; return property != null ? property . getFieldName ( ) : fieldName ;
|
public class PropertyAccessorHelper { /** * Gets the declared fields .
* @ param relationalField
* the relational field
* @ return the declared fields */
public static Field [ ] getDeclaredFields ( Field relationalField ) { } }
|
Field [ ] fields ; if ( isCollection ( relationalField . getType ( ) ) ) { fields = PropertyAccessorHelper . getGenericClass ( relationalField ) . getDeclaredFields ( ) ; } else { fields = relationalField . getType ( ) . getDeclaredFields ( ) ; } return fields ;
|
public class AmazonSimpleWorkflowClient { /** * Returns information about the specified domain , including description and status .
* < b > Access Control < / b >
* You can use IAM policies to control this action ' s access to Amazon SWF resources as follows :
* < ul >
* < li >
* Use a < code > Resource < / code > element with the domain name to limit the action to only specified domains .
* < / li >
* < li >
* Use an < code > Action < / code > element to allow or deny permission to call this action .
* < / li >
* < li >
* You cannot use an IAM policy to constrain this action ' s parameters .
* < / li >
* < / ul >
* If the caller doesn ' t have sufficient permissions to invoke the action , or the parameter values fall outside the
* specified constraints , the action fails . The associated event attribute ' s < code > cause < / code > parameter is set to
* < code > OPERATION _ NOT _ PERMITTED < / code > . For details and example IAM policies , see < a
* href = " http : / / docs . aws . amazon . com / amazonswf / latest / developerguide / swf - dev - iam . html " > Using IAM to Manage Access to
* Amazon SWF Workflows < / a > in the < i > Amazon SWF Developer Guide < / i > .
* @ param describeDomainRequest
* @ return Result of the DescribeDomain operation returned by the service .
* @ throws UnknownResourceException
* Returned when the named resource cannot be found with in the scope of this operation ( region or domain ) .
* This could happen if the named resource was never created or is no longer available for this operation .
* @ throws OperationNotPermittedException
* Returned when the caller doesn ' t have sufficient permissions to invoke the action .
* @ sample AmazonSimpleWorkflow . DescribeDomain
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / swf - 2012-01-25 / DescribeDomain " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public DomainDetail describeDomain ( DescribeDomainRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeDomain ( request ) ;
|
public class DefaultClusterEventService { /** * Handles a collection of subscription updates received via the gossip protocol .
* @ param subscriptions a collection of subscriptions provided by the sender */
private void update ( Collection < InternalSubscriptionInfo > subscriptions ) { } }
|
for ( InternalSubscriptionInfo subscription : subscriptions ) { InternalTopic topic = topics . computeIfAbsent ( subscription . topic , InternalTopic :: new ) ; InternalSubscriptionInfo matchingSubscription = topic . remoteSubscriptions ( ) . stream ( ) . filter ( s -> s . memberId ( ) . equals ( subscription . memberId ( ) ) && s . logicalTimestamp ( ) . equals ( subscription . logicalTimestamp ( ) ) ) . findFirst ( ) . orElse ( null ) ; if ( matchingSubscription == null ) { topic . addRemoteSubscription ( subscription ) ; } else if ( subscription . isTombstone ( ) ) { topic . removeRemoteSubscription ( subscription ) ; } }
|
public class Constraints { /** * / / / / / pre - defined extra constraints / / / / / */
public static < T extends Comparable < T > > ExtraConstraint < T > min ( T minVal ) { } }
|
return min ( minVal , true ) ;
|
public class NvdCveParser { /** * Parses the NVD JSON file and inserts / updates data into the database .
* @ param file the NVD JSON file to parse
* @ throws UpdateException thrown if the file could not be read */
public void parse ( File file ) throws UpdateException { } }
|
LOGGER . debug ( "Parsing " + file . getName ( ) ) ; try ( InputStream fin = new FileInputStream ( file ) ; InputStream in = new GZIPInputStream ( fin ) ; InputStreamReader isr = new InputStreamReader ( in , UTF_8 ) ; JsonReader reader = new JsonReader ( isr ) ) { final Gson gson = new GsonBuilder ( ) . create ( ) ; reader . beginObject ( ) ; while ( reader . hasNext ( ) && ! JsonToken . BEGIN_ARRAY . equals ( reader . peek ( ) ) ) { reader . skipValue ( ) ; } reader . beginArray ( ) ; while ( reader . hasNext ( ) ) { final DefCveItem cve = gson . fromJson ( reader , DefCveItem . class ) ; // cve . getCve ( ) . getCVEDataMeta ( ) . getSTATE ( ) ;
if ( testCveCpeStartWithFilter ( cve ) ) { cveDB . updateVulnerability ( cve ) ; } } } catch ( FileNotFoundException ex ) { LOGGER . error ( ex . getMessage ( ) ) ; throw new UpdateException ( "Unable to find the NVD CPE file, `" + file + "`, to parse" , ex ) ; } catch ( IOException ex ) { LOGGER . error ( "Error reading NVD JSON data: {}" , file ) ; LOGGER . debug ( "Error extracting the NVD JSON data from: " + file . toString ( ) , ex ) ; throw new UpdateException ( "Unable to find the NVD CPE file to parse" , ex ) ; }
|
public class ElasticSearchPropertiesFilePlugin { /** * 直接从map中装载初始化话es所需要的属性 , 用于从zookeeper / consul / etcd / Eureka动态加载es配置
* @ param configProperties */
public static void init ( Map configProperties ) { } }
|
if ( configProperties != null && configProperties . size ( ) > 0 ) { ElasticSearchPropertiesFilePlugin . configProperties = configProperties ; initType = 1 ; }
|
public class CompareUtil { /** * Checks if any of the passed in objects is null .
* @ param _ objects array of objects , may be null
* @ return true if null found , false otherwise */
public static boolean isAnyNull ( Object ... _objects ) { } }
|
if ( _objects == null ) { return true ; } for ( Object obj : _objects ) { if ( obj == null ) { return true ; } } return false ;
|
public class SqlDateTimeUtils { /** * Converts the internal representation of a SQL DATE ( int ) to the Java
* type used for UDF parameters ( { @ link java . sql . Date } ) with the given TimeZone .
* < p > The internal int represents the days since January 1 , 1970 . When we convert it
* to { @ link java . sql . Date } ( time milliseconds since January 1 , 1970 , 00:00:00 GMT ) ,
* we need a TimeZone . */
public static java . sql . Date internalToDate ( int v , TimeZone tz ) { } }
|
// note that , in this case , can ' t handle Daylight Saving Time
final long t = v * MILLIS_PER_DAY ; return new java . sql . Date ( t - tz . getOffset ( t ) ) ;
|
public class CustomTopicXMLValidator { /** * Checks to make sure that a topics xml content is valid for the specific topic . This involves checking the following :
* < ul >
* < li > Table row entries match the cols attribute . < / li >
* < li > The root XML Element matches the topic type . < / li >
* < li > The topic has no invalid content for the specific topic type . < / li >
* < / ul >
* @ param serverSettings The server settings .
* @ param topic The topic to check for invalid content .
* @ param topicDoc The topics XML DOM Document .
* @ param skipNestedSectionValidation Whether or not nested section validation should be performed .
* @ return A list of error messages for any invalid content found , otherwise an empty list . */
public static List < String > checkTopicForInvalidContent ( final ServerSettingsWrapper serverSettings , final BaseTopicWrapper < ? > topic , final Document topicDoc , boolean skipNestedSectionValidation ) { } }
|
final List < String > xmlErrors = new ArrayList < String > ( ) ; // Check to ensure that if the topic has a table , that the table isn ' t missing any entries
if ( ! DocBookUtilities . validateTables ( topicDoc ) ) { xmlErrors . add ( "Table column declaration doesn't match the number of entry elements." ) ; } // Check that the root element matches the topic type
xmlErrors . addAll ( checkTopicRootElement ( serverSettings , topic , topicDoc ) ) ; // Check that the content matches the topic type
xmlErrors . addAll ( checkTopicContentBasedOnType ( serverSettings , topic , topicDoc , skipNestedSectionValidation ) ) ; return xmlErrors ;
|
public class RabinKarpHash { /** * Find the shortest of all patterns .
* @ param patterns
* @ return */
private static int minLen ( String ... patterns ) { } }
|
int minLen = patterns [ 0 ] . length ( ) ; for ( String str : patterns ) { if ( str . length ( ) < minLen ) { minLen = str . length ( ) ; } } return minLen ;
|
public class BaseListener { /** * Remove a specific listener from the chain .
* @ param listener The listener to remove .
* @ param bDeleteFlag If true , free the listener . */
public void removeListener ( BaseListener listener , boolean bFreeFlag ) { } }
|
if ( m_nextListener != null ) { if ( m_nextListener == listener ) { m_nextListener = listener . getNextListener ( ) ; listener . unlink ( bFreeFlag ) ; // remove theBehavior from the linked list
} else m_nextListener . removeListener ( listener , bFreeFlag ) ; } // Remember to free the listener after removing it !
|
public class ApiInvoker { /** * Serialize an Object .
* @ param obj the Object to serialize
* @ throws APIException if an exception occurs during serialization */
public static String serialize ( Object obj ) throws ApiException { } }
|
try { if ( obj != null ) if ( obj instanceof String ) { // This assumes that we receive json as a string
return ( String ) obj ; } else { return JsonUtil . getJsonMapper ( ) . writeValueAsString ( obj ) ; } else return null ; } catch ( Exception e ) { throw new ApiException ( 500 , e . getMessage ( ) ) ; }
|
public class WriteOnChangeHandler { /** * Set this cloned listener to the same state at this listener .
* @ param field The field this new listener will be added to .
* @ param The new listener to sync to this .
* @ param Has the init method been called ?
* @ return True if I called init . */
public boolean syncClonedListener ( BaseField field , FieldListener listener , boolean bInitCalled ) { } }
|
if ( ! bInitCalled ) ( ( WriteOnChangeHandler ) listener ) . init ( null , m_bRefreshAfterWrite ) ; return super . syncClonedListener ( field , listener , true ) ;
|
public class SeleniumSelectField { /** * this private method try to search the value of the select for n seconds
* specified by TIMEOUT static variable . The coerence if the data passed is
* or isn ' t the correct value is responsability of the test developer .
* @ param type
* values defined by the Type private enumeration
* @ param value
* value to be selected */
private void select ( Type type , Object value ) { } }
|
assert value != null ; reloadElement ( ) ; this . selectByType ( type , value ) ;
|
public class JivePropertiesExtensionProvider { /** * Parse a properties sub - packet . If any errors occur while de - serializing Java object
* properties , an exception will be printed and not thrown since a thrown exception will shut
* down the entire connection . ClassCastExceptions will occur when both the sender and receiver
* of the stanza don ' t have identical versions of the same class .
* Note that you have to explicitly enabled Java object deserialization with @ { link
* { @ link JivePropertiesManager # setJavaObjectEnabled ( boolean ) }
* @ param parser the XML parser , positioned at the start of a properties sub - packet .
* @ return a map of the properties .
* @ throws IOException
* @ throws XmlPullParserException */
@ Override public JivePropertiesExtension parse ( XmlPullParser parser , int initialDepth , XmlEnvironment xmlEnvironment ) throws XmlPullParserException , IOException { } }
|
Map < String , Object > properties = new HashMap < > ( ) ; while ( true ) { int eventType = parser . next ( ) ; if ( eventType == XmlPullParser . START_TAG && parser . getName ( ) . equals ( "property" ) ) { // Parse a property
boolean done = false ; String name = null ; String type = null ; String valueText = null ; Object value = null ; while ( ! done ) { eventType = parser . next ( ) ; if ( eventType == XmlPullParser . START_TAG ) { String elementName = parser . getName ( ) ; if ( elementName . equals ( "name" ) ) { name = parser . nextText ( ) ; } else if ( elementName . equals ( "value" ) ) { type = parser . getAttributeValue ( "" , "type" ) ; valueText = parser . nextText ( ) ; } } else if ( eventType == XmlPullParser . END_TAG ) { if ( parser . getName ( ) . equals ( "property" ) ) { if ( "integer" . equals ( type ) ) { value = Integer . valueOf ( valueText ) ; } else if ( "long" . equals ( type ) ) { value = Long . valueOf ( valueText ) ; } else if ( "float" . equals ( type ) ) { value = Float . valueOf ( valueText ) ; } else if ( "double" . equals ( type ) ) { value = Double . valueOf ( valueText ) ; } else if ( "boolean" . equals ( type ) ) { // CHECKSTYLE : OFF
value = Boolean . valueOf ( valueText ) ; // CHECKSTYLE : ON
} else if ( "string" . equals ( type ) ) { value = valueText ; } else if ( "java-object" . equals ( type ) ) { if ( JivePropertiesManager . isJavaObjectEnabled ( ) ) { try { byte [ ] bytes = Base64 . decode ( valueText ) ; ObjectInputStream in = new ObjectInputStream ( new ByteArrayInputStream ( bytes ) ) ; value = in . readObject ( ) ; } catch ( Exception e ) { LOGGER . log ( Level . SEVERE , "Error parsing java object" , e ) ; } } else { LOGGER . severe ( "JavaObject is not enabled. Enable with JivePropertiesManager.setJavaObjectEnabled(true)" ) ; } } if ( name != null && value != null ) { properties . put ( name , value ) ; } done = true ; } } } } else if ( eventType == XmlPullParser . END_TAG ) { if ( parser . getName ( ) . equals ( JivePropertiesExtension . ELEMENT ) ) { break ; } } } return new JivePropertiesExtension ( properties ) ;
|
public class GeometryPath { /** * Add a new sub - path to the path . A path can have multiple sub - paths . Sub - paths may be disconnected lines or rings
* but , thanks to even - odd rule , holes can be added as well .
* @ param coordinates
* @ param closed */
public void addSubPath ( Coordinate [ ] coordinates , boolean closed ) { } }
|
subPaths . add ( new SubPath ( coordinates , closed ) ) ; updateCoordinates ( ) ;
|
public class LocalLauncher { /** * Launch the topology */
@ Override public boolean launch ( PackingPlan packing ) { } }
|
LOG . log ( Level . FINE , "Launching topology for local cluster {0}" , LocalContext . cluster ( config ) ) ; // setup the working directory
// mainly it downloads and extracts the heron - core - release and topology package
if ( ! setupWorkingDirectoryAndExtractPackages ( ) ) { LOG . severe ( "Failed to setup working directory" ) ; return false ; } String [ ] schedulerCmd = getSchedulerCommand ( ) ; Process p = startScheduler ( schedulerCmd ) ; if ( p == null ) { LOG . severe ( "Failed to start SchedulerMain using: " + Arrays . toString ( schedulerCmd ) ) ; return false ; } LOG . log ( Level . FINE , String . format ( "To check the status and logs of the topology, use the working directory %s" , LocalContext . workingDirectory ( config ) ) ) ; return true ;
|
public class EventCountCircuitBreaker { /** * Creates the map with strategy objects . It allows access for a strategy for a given
* state .
* @ return the strategy map */
private static Map < State , StateStrategy > createStrategyMap ( ) { } }
|
final Map < State , StateStrategy > map = new EnumMap < > ( State . class ) ; map . put ( State . CLOSED , new StateStrategyClosed ( ) ) ; map . put ( State . OPEN , new StateStrategyOpen ( ) ) ; return map ;
|
public class AWSOpsWorksClient { /** * Describes load - based auto scaling configurations for specified layers .
* < note >
* You must specify at least one of the parameters .
* < / note >
* < b > Required Permissions < / b > : To use this action , an IAM user must have a Show , Deploy , or Manage permissions
* level for the stack , or an attached policy that explicitly grants permissions . For more information about user
* permissions , see < a
* href = " http : / / docs . aws . amazon . com / opsworks / latest / userguide / opsworks - security - users . html " > Managing User
* Permissions < / a > .
* @ param describeLoadBasedAutoScalingRequest
* @ return Result of the DescribeLoadBasedAutoScaling operation returned by the service .
* @ throws ValidationException
* Indicates that a request was not valid .
* @ throws ResourceNotFoundException
* Indicates that a resource was not found .
* @ sample AWSOpsWorks . DescribeLoadBasedAutoScaling
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / opsworks - 2013-02-18 / DescribeLoadBasedAutoScaling "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeLoadBasedAutoScalingResult describeLoadBasedAutoScaling ( DescribeLoadBasedAutoScalingRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeLoadBasedAutoScaling ( request ) ;
|
public class OgmLoader { /** * The entity instance is not in the session cache
* Copied from Loader # instanceNotYetLoaded */
private Object instanceNotYetLoaded ( final Tuple resultset , final int i , final Loadable persister , final String rowIdAlias , final org . hibernate . engine . spi . EntityKey key , final LockMode lockMode , final org . hibernate . engine . spi . EntityKey optionalObjectKey , final Object optionalObject , final List hydratedObjects , final SharedSessionContractImplementor session ) throws HibernateException { } }
|
final String instanceClass = getInstanceClass ( resultset , i , persister , key . getIdentifier ( ) , session ) ; final Object object ; if ( optionalObjectKey != null && key . equals ( optionalObjectKey ) ) { // its the given optional object
object = optionalObject ; } else { // instantiate a new instance
object = session . instantiate ( instanceClass , key . getIdentifier ( ) ) ; } // need to hydrate it .
// grab its state from the ResultSet and keep it in the Session
// ( but don ' t yet initialize the object itself )
// note that we acquire LockMode . READ even if it was not requested
LockMode acquiredLockMode = lockMode == LockMode . NONE ? LockMode . READ : lockMode ; loadFromResultSet ( resultset , i , object , instanceClass , key , rowIdAlias , acquiredLockMode , persister , session ) ; // materialize associations ( and initialize the object ) later
hydratedObjects . add ( object ) ; return object ;
|
public class Provider { /** * Notify the instance with the given type is < b > FULLY < / b > injected which means all of its
* nested injectable fields are injected and ready < b > RECURSIVELY < / b > .
* < p > This method should get called every time the instance is injected , no matter if it ' s a
* newly created instance or it ' s a reused cached instance . < / p >
* @ param instance The instance . Its own injectable members should have been injected recursively as well . */
void notifyReferenced ( Provider provider , T instance ) { } }
|
notifyInstanceCreationWhenNeeded ( ) ; if ( referencedListeners != null ) { int len = referencedListeners . size ( ) ; for ( int i = 0 ; i < len ; i ++ ) { referencedListeners . get ( i ) . onReferenced ( provider , instance ) ; } }
|
public class RequestMessage { /** * In certain cases , the URL will contain query string information and the
* POST body will as well . This method merges the two maps together .
* @ param urlParams */
private void mergeQueryParams ( Map < String , String [ ] > urlParams ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "mergeQueryParams: " + urlParams ) ; } for ( Entry < String , String [ ] > entry : urlParams . entrySet ( ) ) { String key = entry . getKey ( ) ; // prepend to postdata values if necessary
String [ ] post = this . queryParameters . get ( key ) ; String [ ] url = entry . getValue ( ) ; if ( null != post ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "map already contains key " + key ) ; } String [ ] newVals = new String [ post . length + url . length ] ; System . arraycopy ( url , 0 , newVals , 0 , url . length ) ; System . arraycopy ( post , 0 , newVals , url . length , post . length ) ; this . queryParameters . put ( key , newVals ) ; } else { this . queryParameters . put ( key , url ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "put key " + key + " into map." ) ; } }
|
public class ProgressiveJpegParser { /** * Not every marker is followed by associated segment */
private static boolean doesMarkerStartSegment ( int markerSecondByte ) { } }
|
if ( markerSecondByte == JfifUtil . MARKER_TEM ) { return false ; } if ( markerSecondByte >= JfifUtil . MARKER_RST0 && markerSecondByte <= JfifUtil . MARKER_RST7 ) { return false ; } return markerSecondByte != JfifUtil . MARKER_EOI && markerSecondByte != JfifUtil . MARKER_SOI ;
|
public class ModeShapeEngine { /** * Start this engine to make it available for use . This method does nothing if the engine is already running .
* @ see # shutdown ( ) */
public void start ( ) { } }
|
if ( state == State . RUNNING ) return ; final Lock lock = this . lock . writeLock ( ) ; try { lock . lock ( ) ; this . state = State . STARTING ; // Create an executor service that we ' ll use to start the repositories . . .
ThreadFactory threadFactory = new NamedThreadFactory ( "modeshape-start-repo" ) ; repositoryStarterService = Executors . newCachedThreadPool ( threadFactory ) ; state = State . RUNNING ; } catch ( RuntimeException e ) { state = State . NOT_RUNNING ; throw e ; } finally { lock . unlock ( ) ; }
|
public class MutablePropertySources { /** * Replace the property source with the given name with the given property
* source object .
* @ param name the name of the property source to find and replace
* @ param propertySource the replacement property source
* @ throws IllegalArgumentException if no property source with the given name is
* present
* @ see # contains */
public void replace ( String name , PropertySource < ? > propertySource ) { } }
|
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Replacing PropertySource '" + name + "' with '" + propertySource . getName ( ) + "'" ) ; } int index = assertPresentAndGetIndex ( name ) ; this . propertySourceList . set ( index , propertySource ) ;
|
public class AWSCloudHSMClient { /** * This is documentation for < b > AWS CloudHSM Classic < / b > . For more information , see < a
* href = " http : / / aws . amazon . com / cloudhsm / faqs - classic / " > AWS CloudHSM Classic FAQs < / a > , the < a
* href = " http : / / docs . aws . amazon . com / cloudhsm / classic / userguide / " > AWS CloudHSM Classic User Guide < / a > , and the < a
* href = " http : / / docs . aws . amazon . com / cloudhsm / classic / APIReference / " > AWS CloudHSM Classic API Reference < / a > .
* < b > For information about the current version of AWS CloudHSM < / b > , see < a
* href = " http : / / aws . amazon . com / cloudhsm / " > AWS CloudHSM < / a > , the < a
* href = " http : / / docs . aws . amazon . com / cloudhsm / latest / userguide / " > AWS CloudHSM User Guide < / a > , and the < a
* href = " http : / / docs . aws . amazon . com / cloudhsm / latest / APIReference / " > AWS CloudHSM API Reference < / a > .
* Deletes a client .
* @ param deleteLunaClientRequest
* @ return Result of the DeleteLunaClient operation returned by the service .
* @ throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service .
* @ throws CloudHsmInternalException
* Indicates that an internal error occurred .
* @ throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid .
* @ sample AWSCloudHSM . DeleteLunaClient
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cloudhsm - 2014-05-30 / DeleteLunaClient " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public DeleteLunaClientResult deleteLunaClient ( DeleteLunaClientRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDeleteLunaClient ( request ) ;
|
public class EventManager { /** * Fire a new event and run all the listeners .
* @ param eventDefinition
* @ param eventDetails */
public void fire ( EventDefinition eventDefinition , Event eventDetails ) { } }
|
if ( eventDefinition . getType ( ) == EventDefinition . TYPE_POST ) { fire ( listenersPost , eventDefinition , eventDetails ) ; } else { fire ( listeners , eventDefinition , eventDetails ) ; }
|
public class SDKUtils { /** * used asn1 and get hash
* @ param blockNumber
* @ param previousHash
* @ param dataHash
* @ return byte [ ]
* @ throws IOException
* @ throws InvalidArgumentException */
public static byte [ ] calculateBlockHash ( HFClient client , long blockNumber , byte [ ] previousHash , byte [ ] dataHash ) throws IOException , InvalidArgumentException { } }
|
if ( previousHash == null ) { throw new InvalidArgumentException ( "previousHash parameter is null." ) ; } if ( dataHash == null ) { throw new InvalidArgumentException ( "dataHash parameter is null." ) ; } if ( null == client ) { throw new InvalidArgumentException ( "client parameter is null." ) ; } CryptoSuite cryptoSuite = client . getCryptoSuite ( ) ; if ( null == cryptoSuite ) { throw new InvalidArgumentException ( "Client crypto suite has not been set." ) ; } ByteArrayOutputStream s = new ByteArrayOutputStream ( ) ; DERSequenceGenerator seq = new DERSequenceGenerator ( s ) ; seq . addObject ( new ASN1Integer ( blockNumber ) ) ; seq . addObject ( new DEROctetString ( previousHash ) ) ; seq . addObject ( new DEROctetString ( dataHash ) ) ; seq . close ( ) ; return cryptoSuite . hash ( s . toByteArray ( ) ) ;
|
public class TrieNode { /** * Visit first trie node .
* @ param visitor the visitor
* @ return the trie node */
public TrieNode visitFirst ( Consumer < ? super TrieNode > visitor ) { } }
|
visitor . accept ( this ) ; TrieNode refresh = refresh ( ) ; refresh . getChildren ( ) . forEach ( n -> n . visitFirst ( visitor ) ) ; return refresh ;
|
public class Clustering { /** * Check if clustering is active for this cache manager */
public static boolean isAvailable ( ServiceProvider < Service > serviceProvider ) { } }
|
return ENTITY_SERVICE_CLASS != null && serviceProvider . getService ( ENTITY_SERVICE_CLASS ) != null ;
|
public class GvmClusters { /** * assumes pairs are contiguous */
private void addPairs ( ) { } }
|
GvmCluster < S , K > cj = clusters [ count ] ; int c = count - 1 ; // index at which new pairs registered for existing clusters
for ( int i = 0 ; i < count ; i ++ ) { GvmCluster < S , K > ci = clusters [ i ] ; GvmClusterPair < S , K > pair = new GvmClusterPair < S , K > ( ci , cj ) ; ci . pairs [ c ] = pair ; cj . pairs [ i ] = pair ; pairs . add ( pair ) ; }
|
public class sslvserver_sslcipher_binding { /** * Use this API to fetch sslvserver _ sslcipher _ binding resources of given name . */
public static sslvserver_sslcipher_binding [ ] get ( nitro_service service , String vservername ) throws Exception { } }
|
sslvserver_sslcipher_binding obj = new sslvserver_sslcipher_binding ( ) ; obj . set_vservername ( vservername ) ; sslvserver_sslcipher_binding response [ ] = ( sslvserver_sslcipher_binding [ ] ) obj . get_resources ( service ) ; return response ;
|
public class VarOptItemsSketch { /** * Returns a byte array representation of this sketch . May fail for polymorphic item types .
* @ param serDe An instance of ArrayOfItemsSerDe
* @ return a byte array representation of this sketch */
public byte [ ] toByteArray ( final ArrayOfItemsSerDe < ? super T > serDe ) { } }
|
if ( ( r_ == 0 ) && ( h_ == 0 ) ) { // null class is ok since empty - - no need to call serDe
return toByteArray ( serDe , null ) ; } else { final int validIndex = ( h_ == 0 ? 1 : 0 ) ; final Class < ? > clazz = data_ . get ( validIndex ) . getClass ( ) ; return toByteArray ( serDe , clazz ) ; }
|
public class XPathQueryBuilder { /** * Creates a < code > LocationStepQueryNode < / code > at the current position
* in parent .
* @ param node the current node in the xpath syntax tree .
* @ param parent the parent < code > PathQueryNode < / code > .
* @ return the created < code > LocationStepQueryNode < / code > . */
private LocationStepQueryNode createLocationStep ( SimpleNode node , NAryQueryNode parent ) { } }
|
LocationStepQueryNode queryNode = null ; boolean descendant = false ; Node p = node . jjtGetParent ( ) ; for ( int i = 0 ; i < p . jjtGetNumChildren ( ) ; i ++ ) { SimpleNode c = ( SimpleNode ) p . jjtGetChild ( i ) ; if ( c == node ) { // NOSONAR
queryNode = factory . createLocationStepQueryNode ( parent ) ; queryNode . setNameTest ( null ) ; queryNode . setIncludeDescendants ( descendant ) ; parent . addOperand ( queryNode ) ; break ; } descendant = ( c . getId ( ) == JJTSLASHSLASH || c . getId ( ) == JJTROOTDESCENDANTS ) ; } node . childrenAccept ( this , queryNode ) ; return queryNode ;
|
public class Checks { /** * - - - Input validating methods . - - - */
public static void checkFileToBeRead ( File archive , String fileDesc ) throws IllegalArgumentException { } }
|
if ( archive == null ) throw new IllegalArgumentException ( fileDesc + " must not be null." ) ; if ( ! archive . exists ( ) ) throw new IllegalArgumentException ( fileDesc + " does not exist: " + archive . getAbsolutePath ( ) ) ; if ( archive . isDirectory ( ) ) throw new IllegalArgumentException ( fileDesc + " is a directory, expected a file: " + archive . getPath ( ) ) ;
|
public class ExtensionLoader { /** * Initialize a specific Extension
* @ param ext the Extension that need to be initialized
* @ throws DatabaseUnsupportedException
* @ throws DatabaseException */
public void startLifeCycle ( Extension ext ) throws DatabaseException , DatabaseUnsupportedException { } }
|
ext . init ( ) ; ext . databaseOpen ( model . getDb ( ) ) ; ext . initModel ( model ) ; ext . initXML ( model . getSession ( ) , model . getOptionsParam ( ) ) ; ext . initView ( view ) ; ExtensionHook extHook = new ExtensionHook ( model , view ) ; extensionHooks . put ( ext , extHook ) ; try { ext . hook ( extHook ) ; hookContextDataFactories ( ext , extHook ) ; hookApiImplementors ( ext , extHook ) ; if ( view != null ) { // no need to hook view if no GUI
hookView ( ext , view , extHook ) ; hookMenu ( view , extHook ) ; } hookOptions ( extHook ) ; hookProxies ( extHook ) ; ext . optionsLoaded ( ) ; ext . postInit ( ) ; } catch ( Exception e ) { logExtensionInitError ( ext , e ) ; } ext . start ( ) ; Proxy proxy = Control . getSingleton ( ) . getProxy ( ) ; hookProxyListeners ( proxy , extHook . getProxyListenerList ( ) ) ; hookOverrideMessageProxyListeners ( proxy , extHook . getOverrideMessageProxyListenerList ( ) ) ; hookPersistentConnectionListeners ( proxy , extHook . getPersistentConnectionListener ( ) ) ; hookConnectRequestProxyListeners ( proxy , extHook . getConnectRequestProxyListeners ( ) ) ; if ( view != null ) { hookSiteMapListeners ( view . getSiteTreePanel ( ) , extHook . getSiteMapListenerList ( ) ) ; }
|
public class Communications { /** * Returns minute UTC as per 1371-4 . pdf .
* @ param extractor
* @ param slotTimeout
* @ param startIndex
* @ return */
private static Integer getMinuteUtc ( AisExtractor extractor , int slotTimeout , int startIndex ) { } }
|
if ( slotTimeout == 1 ) { // skip the msb bit
int minutes = extractor . getValue ( startIndex + 10 , startIndex + 17 ) ; return minutes ; } else return null ;
|
public class OrderQueryBond { /** * ( non - Javadoc )
* @ see
* org . openscience . cdk . isomorphism . matchers . smarts . SMARTSBond # matches ( org
* . openscience . cdk . interfaces . IBond ) */
@ Override public boolean matches ( IBond bond ) { } }
|
if ( bond . isAromatic ( ) ^ isAromatic ( ) ) return false ; // we check for both bonds being aromatic - but the query will
// never come in as aromatic ( since there is a separate aromatic
// query bond ) . But no harm in checking
return bond . isAromatic ( ) || bond . getOrder ( ) == getOrder ( ) ;
|
public class Bot { /** * Invoke the appropriate method in a conversation .
* @ param event received from facebook */
private void invokeChainedMethod ( Event event ) { } }
|
Queue < MethodWrapper > queue = conversationQueueMap . get ( event . getSender ( ) . getId ( ) ) ; if ( queue != null && ! queue . isEmpty ( ) ) { MethodWrapper methodWrapper = queue . peek ( ) ; try { EventType [ ] eventTypes = methodWrapper . getMethod ( ) . getAnnotation ( Controller . class ) . events ( ) ; for ( EventType eventType : eventTypes ) { if ( eventType . name ( ) . equalsIgnoreCase ( event . getType ( ) . name ( ) ) ) { methodWrapper . getMethod ( ) . invoke ( this , event ) ; return ; } } } catch ( Exception e ) { logger . error ( "Error invoking chained method: " , e ) ; } }
|
public class PasswordMaker { /** * This performs the actual hashing . It obtains an instance of the hashing algorithm
* and feeds in the necessary data .
* @ param masterPassword The master password to use as a key .
* @ param data The data to be hashed .
* @ param account The account with the hash settings to use .
* @ return A SecureCharArray of the hash .
* @ throws Exception if something bad happened . */
private SecureUTF8String runAlgorithm ( SecureUTF8String masterPassword , SecureUTF8String data , Account account ) throws Exception { } }
|
SecureUTF8String output = null ; SecureCharArray digestChars = null ; SecureByteArray masterPasswordBytes = null ; SecureByteArray dataBytes = null ; try { masterPasswordBytes = new SecureByteArray ( masterPassword ) ; dataBytes = new SecureByteArray ( data ) ; if ( ! account . isHmac ( ) ) { dataBytes . prepend ( masterPasswordBytes ) ; } if ( account . isHmac ( ) ) { Mac mac ; String algoName = "HMAC" + account . getAlgorithm ( ) . getName ( ) ; mac = Mac . getInstance ( algoName , CRYPTO_PROVIDER ) ; mac . init ( new SecretKeySpec ( masterPasswordBytes . getData ( ) , algoName ) ) ; mac . reset ( ) ; mac . update ( dataBytes . getData ( ) ) ; digestChars = new SecureCharArray ( mac . doFinal ( ) ) ; } else { MessageDigest md = MessageDigest . getInstance ( account . getAlgorithm ( ) . getName ( ) , CRYPTO_PROVIDER ) ; digestChars = new SecureCharArray ( md . digest ( dataBytes . getData ( ) ) ) ; } output = rstr2any ( digestChars . getData ( ) , account . getCharacterSet ( ) , account . isTrim ( ) ) ; } catch ( Exception e ) { if ( output != null ) output . erase ( ) ; throw e ; } finally { if ( masterPasswordBytes != null ) masterPasswordBytes . erase ( ) ; if ( dataBytes != null ) dataBytes . erase ( ) ; if ( digestChars != null ) digestChars . erase ( ) ; } return output ;
|
public class ClassUtils { /** * Given an input class object , return a string which consists of the
* class ' s package name as a pathname , i . e . , all dots ( ' . ' ) are replaced by
* slashes ( ' / ' ) . Neither a leading nor trailing slash is added . The result
* could be concatenated with a slash and the name of a resource and fed
* directly to { @ code ClassLoader . getResource ( ) } . For it to be fed to
* { @ code Class . getResource } instead , a leading slash would also have
* to be prepended to the returned value .
* @ param clazz the input class . A { @ code null } value or the default
* ( empty ) package will result in an empty string ( " " ) being returned .
* @ return a path which represents the package name
* @ see ClassLoader # getResource
* @ see Class # getResource */
public static String classPackageAsResourcePath ( Class < ? > clazz ) { } }
|
if ( clazz == null ) { return "" ; } String className = clazz . getName ( ) ; int packageEndIndex = className . lastIndexOf ( PACKAGE_SEPARATOR ) ; if ( packageEndIndex == - 1 ) { return "" ; } String packageName = className . substring ( 0 , packageEndIndex ) ; return packageName . replace ( PACKAGE_SEPARATOR , PATH_SEPARATOR ) ;
|
public class XMLChecker { /** * Determines if the specified string matches the < em > SystemLiteral < / em > production .
* See : < a href = " http : / / www . w3 . org / TR / REC - xml # NT - SystemLiteral " > Definition of SystemLiteral < / a > .
* @ param s the character string to check , cannot be < code > null < / code > .
* @ return < code > true < / code > if the { @ link String } matches the production , or < code > false < / code >
* otherwise .
* @ throws NullPointerException if < code > s = = null < / code > . */
public static final boolean isSystemLiteral ( String s ) throws NullPointerException { } }
|
try { checkSystemLiteral ( s ) ; return true ; } catch ( InvalidXMLException exception ) { return false ; }
|
public class SFSession { /** * Performs a sanity check on properties . Sanity checking includes :
* - verifying that a server url is present
* - verifying various combinations of properties given the authenticator
* @ throws SFException */
private void performSanityCheckOnProperties ( ) throws SFException { } }
|
for ( SFSessionProperty property : SFSessionProperty . values ( ) ) { if ( property . isRequired ( ) && ! connectionPropertiesMap . containsKey ( property ) ) { switch ( property ) { case SERVER_URL : throw new SFException ( ErrorCode . MISSING_SERVER_URL ) ; default : throw new SFException ( ErrorCode . MISSING_CONNECTION_PROPERTY , property . getPropertyKey ( ) ) ; } } } String authenticator = ( String ) connectionPropertiesMap . get ( SFSessionProperty . AUTHENTICATOR ) ; if ( isSnowflakeAuthenticator ( ) || ClientAuthnDTO . AuthenticatorType . OKTA . name ( ) . equalsIgnoreCase ( authenticator ) ) { // userName and password are expected for both Snowflake and Okta .
String userName = ( String ) connectionPropertiesMap . get ( SFSessionProperty . USER ) ; if ( userName == null || userName . isEmpty ( ) ) { throw new SFException ( ErrorCode . MISSING_USERNAME ) ; } String password = ( String ) connectionPropertiesMap . get ( SFSessionProperty . PASSWORD ) ; if ( password == null || password . isEmpty ( ) ) { throw new SFException ( ErrorCode . MISSING_PASSWORD ) ; } } // perform sanity check on proxy settings
boolean useProxy = ( boolean ) connectionPropertiesMap . getOrDefault ( SFSessionProperty . USE_PROXY , false ) ; if ( useProxy ) { if ( ! connectionPropertiesMap . containsKey ( SFSessionProperty . PROXY_HOST ) || ! connectionPropertiesMap . containsKey ( SFSessionProperty . PROXY_PORT ) ) { throw new SFException ( ErrorCode . INVALID_PROXY_PROPERTIES ) ; } }
|
public class PartitionedLeaderService { /** * Returns the underlying leader services for each partition . The services are guaranteed to be returned
* ordered by partition number . */
public List < LeaderService > getPartitionLeaderServices ( ) { } }
|
return _partitionLeaders . stream ( ) . map ( PartitionLeader :: getLeaderService ) . collect ( Collectors . toList ( ) ) ;
|
public class DateIteratorFactory { /** * given a block of RRULE , EXRULE , RDATE , and EXDATE content lines , parse
* them into a single date iterable .
* @ param rdata RRULE , EXRULE , RDATE , and EXDATE lines .
* @ param start the first occurrence of the series .
* @ param tzid the local timezone - - used to interpret start and any dates in
* RDATE and EXDATE lines that don ' t have TZID params .
* @ param strict true if any failure to parse should result in a
* ParseException . false causes bad content lines to be logged and ignored . */
public static DateIterable createDateIterable ( String rdata , Date start , TimeZone tzid , boolean strict ) throws ParseException { } }
|
return new RecurrenceIterableWrapper ( RecurrenceIteratorFactory . createRecurrenceIterable ( rdata , dateToDateValue ( start , true ) , tzid , strict ) ) ;
|
public class GithubRenderer { /** * Create the HTML markup for the DOM . */
private void encodeMarkup ( final FacesContext context , final Github github ) throws IOException { } }
|
final ResponseWriter writer = context . getResponseWriter ( ) ; final String clientId = github . getClientId ( context ) ; final String widgetVar = github . resolveWidgetVar ( ) ; writer . startElement ( "div" , github ) ; writer . writeAttribute ( "id" , clientId , "id" ) ; writer . writeAttribute ( HTML . WIDGET_VAR , widgetVar , null ) ; writer . writeAttribute ( "data-repo" , github . getRepository ( ) , "data-repo" ) ; if ( github . getStyleClass ( ) != null ) { writer . writeAttribute ( "class" , github . getStyleClass ( ) , "styleClass" ) ; } if ( github . getStyle ( ) != null ) { writer . writeAttribute ( "style" , github . getStyle ( ) , "style" ) ; } writer . endElement ( "div" ) ;
|
public class MwsJsonWriter { /** * Output escaped value .
* @ param value */
private void escape ( String value ) { } }
|
int n = value . length ( ) ; int i = 0 ; for ( int j = 0 ; j < n ; ++ j ) { char c = value . charAt ( j ) ; int k = ESCAPED_CHARS . indexOf ( c ) ; if ( k >= 0 || c < ' ' ) { if ( i < j ) { append ( value , i , j ) ; } if ( k >= 0 ) { append ( ESCAPE_SEQ [ k ] ) ; } else { append ( "\\u" ) ; append ( String . format ( "%04x" , Integer . valueOf ( c ) ) ) ; } i = j + 1 ; } } if ( i < n ) { append ( value , i , n ) ; }
|
public class HtmlElementTables { /** * Elements in order which are implicitly opened when a descendant tag is
* lexically nested within an ancestor . */
int [ ] impliedElements ( int anc , int desc ) { } }
|
// < style > and < script > are allowed anywhere .
if ( desc == SCRIPT_TAG || desc == STYLE_TAG ) { return ZERO_INTS ; } // It ' s dangerous to allow free < li > tags because of the way an < li >
// implies a < / li > if there is an < li > on the parse stack without a
// LIST _ SCOPE element in the middle .
// Since we don ' t control the context in which sanitized HTML is embedded ,
// we can ' t assume that there isn ' t a containing < li > tag before parsing
// starts , so we make sure we never produce an < li > or < td > without a
// corresponding LIST or TABLE scope element on the stack .
// < select > is not a scope for < option > elements , but we do that too for
// symmetry and as an extra degree of safety against future spec changes .
FreeWrapper wrapper = desc != TEXT_NODE && desc < FREE_WRAPPERS . length ? FREE_WRAPPERS [ desc ] : null ; if ( wrapper != null ) { if ( anc < wrapper . allowedContainers . length && ! wrapper . allowedContainers [ anc ] ) { return wrapper . implied ; } } if ( desc != TEXT_NODE ) { int [ ] implied = impliedElements . getElementIndexList ( anc , desc ) ; // This handles the table case at least
if ( implied . length != 0 ) { return implied ; } } // If we require above that all < li > s appear in a < ul > or < ol > then
// for symmetry , we require here that all content of a < ul > or < ol > appear
// nested in a < li > .
// This does not have the same security implications as the above , but is
// symmetric .
int [ ] oneImplied = null ; if ( anc == OL_TAG || anc == UL_TAG ) { oneImplied = LI_TAG_ARR ; } else if ( anc == SELECT_TAG ) { oneImplied = OPTION_TAG_ARR ; } if ( oneImplied != null ) { if ( desc != oneImplied [ 0 ] ) { return LI_TAG_ARR ; } } // TODO : why are we dropping OPTION _ AG _ ARR ?
return ZERO_INTS ;
|
public class SceneStructureCommon { /** * Specifies the location of a point in 3D space
* @ param which Which point is being specified
* @ param x coordinate along x - axis
* @ param y coordinate along y - axis
* @ param z coordinate along z - axis */
public void setPoint ( int which , double x , double y , double z ) { } }
|
points [ which ] . set ( x , y , z ) ;
|
public class CPMeasurementUnitLocalServiceBaseImpl { /** * Returns the cp measurement unit matching the UUID and group .
* @ param uuid the cp measurement unit ' s UUID
* @ param groupId the primary key of the group
* @ return the matching cp measurement unit
* @ throws PortalException if a matching cp measurement unit could not be found */
@ Override public CPMeasurementUnit getCPMeasurementUnitByUuidAndGroupId ( String uuid , long groupId ) throws PortalException { } }
|
return cpMeasurementUnitPersistence . findByUUID_G ( uuid , groupId ) ;
|
public class Debouncer { /** * This must be called on eventExecutor too . */
public void receive ( IncomingT element ) { } }
|
assert adminExecutor . inEventLoop ( ) ; if ( stopped ) { return ; } if ( window . isZero ( ) || maxEvents == 1 ) { LOG . debug ( "Received {}, flushing immediately (window = {}, maxEvents = {})" , element , window , maxEvents ) ; onFlush . accept ( coalescer . apply ( ImmutableList . of ( element ) ) ) ; } else { currentBatch . add ( element ) ; if ( currentBatch . size ( ) == maxEvents ) { LOG . debug ( "Received {}, flushing immediately (because {} accumulated events)" , element , maxEvents ) ; flushNow ( ) ; } else { LOG . debug ( "Received {}, scheduling next flush in {}" , element , window ) ; scheduleFlush ( ) ; } }
|
public class CmisConnector { /** * Converts CMIS object ' s properties to JCR node properties .
* @ param object CMIS object
* @ param writer JCR node representation . */
private void cmisProperties ( CmisObject object , DocumentWriter writer ) { } }
|
// convert properties
List < Property < ? > > list = object . getProperties ( ) ; for ( Property < ? > property : list ) { String pname = properties . findJcrName ( property . getId ( ) ) ; if ( pname != null ) { writer . addProperty ( pname , properties . jcrValues ( property ) ) ; } }
|
public class Normalizer2Impl { /** * Decomposes s [ src , limit [ and writes the result to dest .
* limit can be NULL if src is NUL - terminated .
* destLengthEstimate is the initial dest buffer capacity and can be - 1. */
public void decompose ( CharSequence s , int src , int limit , StringBuilder dest , int destLengthEstimate ) { } }
|
if ( destLengthEstimate < 0 ) { destLengthEstimate = limit - src ; } dest . setLength ( 0 ) ; ReorderingBuffer buffer = new ReorderingBuffer ( this , dest , destLengthEstimate ) ; decompose ( s , src , limit , buffer ) ;
|
public class AmazonCloudDirectoryClient { /** * Deletes a < a > TypedLinkFacet < / a > . For more information , see < a href =
* " https : / / docs . aws . amazon . com / clouddirectory / latest / developerguide / directory _ objects _ links . html # directory _ objects _ links _ typedlink "
* > Typed Links < / a > .
* @ param deleteTypedLinkFacetRequest
* @ return Result of the DeleteTypedLinkFacet operation returned by the service .
* @ throws InternalServiceException
* Indicates a problem that must be resolved by Amazon Web Services . This might be a transient error in
* which case you can retry your request until it succeeds . Otherwise , go to the < a
* href = " http : / / status . aws . amazon . com / " > AWS Service Health Dashboard < / a > site to see if there are any
* operational issues with the service .
* @ throws InvalidArnException
* Indicates that the provided ARN value is not valid .
* @ throws RetryableConflictException
* Occurs when a conflict with a previous successful write is detected . For example , if a write operation
* occurs on an object and then an attempt is made to read the object using “ SERIALIZABLE ” consistency , this
* exception may result . This generally occurs when the previous write did not have time to propagate to the
* host serving the current request . A retry ( with appropriate backoff logic ) is the recommended response to
* this exception .
* @ throws ValidationException
* Indicates that your request is malformed in some manner . See the exception message .
* @ throws LimitExceededException
* Indicates that limits are exceeded . See < a
* href = " https : / / docs . aws . amazon . com / clouddirectory / latest / developerguide / limits . html " > Limits < / a > for more
* information .
* @ throws AccessDeniedException
* Access denied . Check your permissions .
* @ throws ResourceNotFoundException
* The specified resource could not be found .
* @ throws FacetNotFoundException
* The specified < a > Facet < / a > could not be found .
* @ sample AmazonCloudDirectory . DeleteTypedLinkFacet
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / clouddirectory - 2017-01-11 / DeleteTypedLinkFacet "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DeleteTypedLinkFacetResult deleteTypedLinkFacet ( DeleteTypedLinkFacetRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDeleteTypedLinkFacet ( request ) ;
|
public class BiDirectionalAssociationHelper { /** * Checks whether table name and key column names of the given joinable and inverse collection persister match . */
private static boolean isCollectionMatching ( Joinable mainSideJoinable , OgmCollectionPersister inverseSidePersister ) { } }
|
boolean isSameTable = mainSideJoinable . getTableName ( ) . equals ( inverseSidePersister . getTableName ( ) ) ; if ( ! isSameTable ) { return false ; } return Arrays . equals ( mainSideJoinable . getKeyColumnNames ( ) , inverseSidePersister . getElementColumnNames ( ) ) ;
|
public class PngOptimizerTask { private String makeDirs ( String path ) { } }
|
try { File out = new File ( path ) ; if ( ! out . exists ( ) ) { if ( ! out . mkdirs ( ) ) { throw new IOException ( "Couldn't create path: " + path ) ; } } path = out . getCanonicalPath ( ) ; } catch ( IOException e ) { throw new BuildException ( "Bad path: " + path ) ; } return path ;
|
public class Matrix4x3f { /** * Store the values of the given matrix < code > m < / code > into < code > this < / code > matrix .
* @ see # Matrix4x3f ( Matrix4x3fc )
* @ see # get ( Matrix4x3f )
* @ param m
* the matrix to copy the values from
* @ return this */
public Matrix4x3f set ( Matrix4x3fc m ) { } }
|
if ( m instanceof Matrix4x3f ) { MemUtil . INSTANCE . copy ( ( Matrix4x3f ) m , this ) ; } else { setMatrix4x3fc ( m ) ; } properties = m . properties ( ) ; return this ;
|
public class TransactionLocalMap { /** * Set the value associated with key .
* @ param key the thread local object
* @ param value the value to be set */
public void put ( TransactionLocal key , Object value ) { } }
|
// We don ' t use a fast path as with get ( ) because it is at
// least as common to use set ( ) to create new entries as
// it is to replace existing ones , in which case , a fast
// path would fail more often than not .
Entry [ ] tab = table ; int len = tab . length ; int i = key . hashCode & ( len - 1 ) ; for ( Entry e = tab [ i ] ; e != null ; e = tab [ i = nextIndex ( i , len ) ] ) { if ( e . key == key ) { e . value = value ; return ; } } tab [ i ] = new Entry ( key , value ) ; int sz = ++ size ; if ( sz >= threshold ) rehash ( ) ;
|
public class ShortBuffer { /** * Creates a short buffer based on a newly allocated short array .
* @ param capacity the capacity of the new buffer .
* @ return the created short buffer .
* @ throws IllegalArgumentException if { @ code capacity } is less than zero . */
public static ShortBuffer allocate ( int capacity ) { } }
|
if ( capacity < 0 ) { throw new IllegalArgumentException ( ) ; } ByteBuffer bb = ByteBuffer . allocateDirect ( capacity * 2 ) ; bb . order ( ByteOrder . nativeOrder ( ) ) ; return bb . asShortBuffer ( ) ;
|
public class HerokuAPI { /** * Lists the formation info for an app
* @ param appName See { @ link # listApps } for a list of apps that can be used . */
public List < Formation > listFormation ( String appName ) { } }
|
return connection . execute ( new FormationList ( appName ) , apiKey ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.