signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class HivePurgerQueryTemplate { /** * This method builds the where clause for the insertion query .
* If prefix is a , then it builds a . datepartition = ' 2016-01-01-00 ' AND a . size = ' 12345 ' from [ datepartition : ' 2016-01-01-00 ' , size : ' 12345 ' ] */
public static String getWhereClauseForPartition (... | StringBuilder sb = new StringBuilder ( ) ; for ( Map . Entry < String , String > entry : spec . entrySet ( ) ) { if ( ! sb . toString ( ) . isEmpty ( ) ) { sb . append ( " AND " ) ; } sb . append ( prefix + entry . getKey ( ) ) ; sb . append ( "=" ) ; sb . append ( PartitionUtils . getQuotedString ( entry . getValue ( ... |
public class CmsSitemapController { /** * Sets the editor mode in the user session . < p >
* @ param editorMode the editor mode */
public void setEditorModeInSession ( final EditorMode editorMode ) { } } | CmsRpcAction < Void > action = new CmsRpcAction < Void > ( ) { @ Override public void execute ( ) { getService ( ) . setEditorMode ( editorMode , this ) ; } @ Override protected void onResponse ( Void result ) { // nothing to do
} } ; action . execute ( ) ; |
public class ManagementClientImpl { /** * / * ( non - Javadoc )
* @ see tuwien . auto . calimero . mgmt . ManagementClient # writeMemory
* ( tuwien . auto . calimero . mgmt . Destination , int , byte [ ] ) */
public void writeMemory ( Destination dst , int startAddr , byte [ ] data ) throws KNXDisconnectException ,... | if ( startAddr < 0 || startAddr > 0xFFFF || data . length == 0 || data . length > 63 ) throw new KNXIllegalArgumentException ( "argument value out of range" ) ; final byte [ ] asdu = new byte [ data . length + 3 ] ; asdu [ 0 ] = ( byte ) data . length ; asdu [ 1 ] = ( byte ) ( startAddr >> 8 ) ; asdu [ 2 ] = ( byte ) s... |
public class EventReader { /** * Retrieve S3 object URL from source then downloads the object processes each event through
* call back functions .
* @ param source { @ link CloudTrailSource } to process . */
public void processSource ( CloudTrailSource source ) { } } | boolean filterSourceOut = false ; boolean downloadLogSuccess = true ; boolean processSourceSuccess = false ; ProgressStatus processSourceStatus = new ProgressStatus ( ProgressState . processSource , new BasicProcessSourceInfo ( source , processSourceSuccess ) ) ; final Object processSourceReportObject = progressReporte... |
public class ToStringStyle { /** * Unregisters the given object .
* Used by the reflection methods to avoid infinite loops .
* @ param value The object to unregister . */
static void unregister ( Object value ) { } } | if ( value != null ) { Map < Object , Object > m = getRegistry ( ) ; if ( m != null ) { m . remove ( value ) ; if ( m . isEmpty ( ) ) { REGISTRY . remove ( ) ; } } } |
public class AbstractFilteredDataStream { /** * Add many filters .
* @ param newFilters The filters to add . */
public final void addFilters ( final List < IDataFilter > newFilters ) { } } | assertFilterListExists ( ) ; for ( IDataFilter filter : newFilters ) { addFilter ( filter ) ; } |
public class ModbusSerialTransport { /** * Reads the specified number of bytes from the input stream
* @ param buffer Buffer to put data into
* @ param bytesToRead Number of bytes to read
* @ throws IOException If the port is invalid or if the number of bytes returned is not equal to that asked for */
void readBy... | if ( commPort != null && commPort . isOpen ( ) ) { int cnt = commPort . readBytes ( buffer , bytesToRead ) ; if ( cnt != bytesToRead ) { throw new IOException ( "Cannot read from serial port - truncated" ) ; } } else { throw new IOException ( "Comm port is not valid or not open" ) ; } |
public class CmsCategoryWidget { /** * Generates the right height for the view . < p > */
protected void setHeight ( ) { } } | if ( m_categoryField . getValuesSet ( ) > 0 ) { m_height = ( m_categoryField . getValuesSet ( ) * 26 ) + 4 ; if ( m_height > MAX_HEIGHT ) { m_height = MAX_HEIGHT ; m_categoryField . getScrollPanel ( ) . setResizable ( true ) ; } else { m_categoryField . getScrollPanel ( ) . setResizable ( false ) ; } } else { m_height ... |
public class Wizard { /** * Same as { @ link # open ( String ) } with the ability to pass a different width and height . */
public void open ( String title , int width , int height ) { } } | assertSteps ( ) ; if ( window == null ) { window = new DefaultWindow ( title ) ; window . setWidth ( width ) ; window . setHeight ( height ) ; window . trapWidget ( asWidget ( ) ) ; window . setGlassEnabled ( true ) ; window . addCloseHandler ( closeEvent -> { // calls the cancel ( ) to remove the datasource as the use... |
public class AnnotationMetadataWriter { /** * Writes annotation attributes to the given generator .
* @ param declaringClassWriter The declaring class
* @ param generatorAdapter The generator adapter
* @ param annotationData The annotation data
* @ param loadTypeMethods Generated methods that load types */
@ In... | int totalSize = annotationData . size ( ) * 2 ; // start a new array
pushNewArray ( generatorAdapter , Object . class , totalSize ) ; int i = 0 ; for ( Map . Entry < ? extends CharSequence , Object > entry : annotationData . entrySet ( ) ) { // use the property name as the key
String memberName = entry . getKey ( ) . t... |
public class GPixelMath { /** * Performs pixel - wise addition < br >
* d ( x , y ) = inputA ( x , y ) + inputB ( x , y )
* @ param inputA Input image . Not modified .
* @ param inputB Input image . Not modified .
* @ param output Output image . Modified . */
public static < T extends ImageBase < T > , O extend... | if ( inputA instanceof ImageGray ) { if ( GrayU8 . class == inputA . getClass ( ) ) { PixelMath . add ( ( GrayU8 ) inputA , ( GrayU8 ) inputB , ( GrayU16 ) output ) ; } else if ( GrayS8 . class == inputA . getClass ( ) ) { PixelMath . add ( ( GrayS8 ) inputA , ( GrayS8 ) inputB , ( GrayS16 ) output ) ; } else if ( Gray... |
public class AuthorInfo { /** * setter for lastName - sets The last name of the author .
* @ generated
* @ param v value to set into the feature */
public void setLastName ( String v ) { } } | if ( AuthorInfo_Type . featOkTst && ( ( AuthorInfo_Type ) jcasType ) . casFeat_lastName == null ) jcasType . jcas . throwFeatMissing ( "lastName" , "de.julielab.jules.types.AuthorInfo" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( AuthorInfo_Type ) jcasType ) . casFeatCode_lastName , v ) ; |
public class MultiImplementationSender { /** * Register a new possible implementation with the associated condition . The
* implementation is added at the end so any other possible implementation
* will be used before this one if the associated condition allow it .
* @ param condition
* the condition that indic... | implementations . add ( new Implementation ( condition , implementation ) ) ; return this ; |
public class MyfacesLogger { /** * Log a SEVERE message , with an array of object arguments .
* The message is forwarded to appropriate Java Logger objects .
* @ param sourceClass the name of the class that issued the logging request
* @ param sourceMethod the name of the method that issued the logging request
... | logp ( Level . SEVERE , sourceClass , sourceMethod , msg , params ) ; |
public class Main { /** * This function flips the case of all characters in a provided string .
* @ param inputStr A string containing alphabetic characters .
* @ return A string where the case of every character is switched .
* Examples :
* invertCase ( ' Python ' )
* ' pYTHON '
* invertCase ( ' Pangram ' ... | String result = "" ; for ( int i = 0 ; i < inputStr . length ( ) ; i ++ ) { char currentChar = inputStr . charAt ( i ) ; if ( Character . isUpperCase ( currentChar ) ) { result = result + Character . toLowerCase ( currentChar ) ; } else { result = result + Character . toUpperCase ( currentChar ) ; } } return result ; |
public class InterconnectLocationClient { /** * Retrieves the list of interconnect locations available to the specified project .
* < p > Sample code :
* < pre > < code >
* try ( InterconnectLocationClient interconnectLocationClient = InterconnectLocationClient . create ( ) ) {
* ProjectName project = ProjectNa... | ListInterconnectLocationsHttpRequest request = ListInterconnectLocationsHttpRequest . newBuilder ( ) . setProject ( project == null ? null : project . toString ( ) ) . build ( ) ; return listInterconnectLocations ( request ) ; |
public class JsMessageVisitor { /** * Initializes the meta data in a message builder given a node that may
* contain JsDoc properties .
* @ param builder the message builder whose meta data will be initialized
* @ param node the node with the message ' s JSDoc properties
* @ return true if message has JsDoc wit... | boolean messageHasDesc = false ; JSDocInfo info = node . getJSDocInfo ( ) ; if ( info != null ) { String desc = info . getDescription ( ) ; if ( desc != null ) { builder . setDesc ( desc ) ; messageHasDesc = true ; } if ( info . isHidden ( ) ) { builder . setIsHidden ( true ) ; } if ( info . getMeaning ( ) != null ) { ... |
public class CreateDiskResult { /** * An object describing the API operations .
* @ param operations
* An object describing the API operations . */
public void setOperations ( java . util . Collection < Operation > operations ) { } } | if ( operations == null ) { this . operations = null ; return ; } this . operations = new java . util . ArrayList < Operation > ( operations ) ; |
public class ObjectAccessor { /** * Creates a copy of the wrapped object , where the copy ' s type is a
* specified subclass of the wrapped object ' s class .
* Note : it does a " shallow " copy . Reference fields are not copied
* recursively .
* @ param subclass A subclass of the wrapped object ' s class .
*... | S copy = Instantiator . of ( subclass ) . instantiate ( ) ; return copyInto ( copy ) ; |
public class PoolManager { /** * Change the pool of a particular job */
public synchronized void setPool ( JobInProgress job , String pool ) { } } | removeJob ( job ) ; job . getJobConf ( ) . set ( EXPLICIT_POOL_PROPERTY , pool ) ; addJob ( job ) ; |
public class ServerUrl { /** * Decode a cloudId to a Node representation . This helps when using
* official elasticsearch as a service : https : / / cloud . elastic . co
* The cloudId can be found from the cloud console .
* @ param cloudId The cloud ID to decode .
* @ return A Node running on https : / / addres... | // 1 . Ignore anything before ` : ` .
String id = cloudId . substring ( cloudId . indexOf ( ':' ) + 1 ) ; // 2 . base64 decode
String decoded = new String ( Base64 . getDecoder ( ) . decode ( id ) ) ; // 3 . separate based on ` $ `
String [ ] words = decoded . split ( "\\$" ) ; // 4 . form the URLs
return "https://" + ... |
public class CPDefinitionPersistenceImpl { /** * Caches the cp definitions in the entity cache if it is enabled .
* @ param cpDefinitions the cp definitions */
@ Override public void cacheResult ( List < CPDefinition > cpDefinitions ) { } } | for ( CPDefinition cpDefinition : cpDefinitions ) { if ( entityCache . getResult ( CPDefinitionModelImpl . ENTITY_CACHE_ENABLED , CPDefinitionImpl . class , cpDefinition . getPrimaryKey ( ) ) == null ) { cacheResult ( cpDefinition ) ; } else { cpDefinition . resetOriginalValues ( ) ; } } |
public class ArrowConverter { /** * Convert a set of input strings to arrow columns
* @ param bufferAllocator the buffer allocator to use
* @ param schema the schema to use
* @ param dataVecRecord the collection of input strings to process
* @ return the created vectors */
public static List < FieldVector > toA... | return toArrowColumnsString ( bufferAllocator , schema , Arrays . asList ( dataVecRecord ) ) ; |
public class DefaultGroovyMethods { /** * Bitwise OR together two BitSets . Called when the ' | ' operator is used
* between two bit sets .
* @ param left a BitSet
* @ param right another BitSet to bitwise AND
* @ return the bitwise OR of both BitSets
* @ since 1.5.0 */
public static BitSet or ( BitSet left ,... | BitSet result = ( BitSet ) left . clone ( ) ; result . or ( right ) ; return result ; |
public class SearchApi { /** * Search on a string Search for entities that match a given sub - string . - - -
* This route is cached for up to 3600 seconds SSO Scope :
* esi - search . search _ structures . v1
* @ param categories
* Type of entities to search for ( required )
* @ param characterId
* An EVE ... | com . squareup . okhttp . Call call = getCharactersCharacterIdSearchValidateBeforeCall ( categories , characterId , search , acceptLanguage , datasource , ifNoneMatch , language , strict , token , null ) ; Type localVarReturnType = new TypeToken < CharacterSearchResponse > ( ) { } . getType ( ) ; return apiClient . exe... |
public class PinotAuditCountHttpClient { /** * A thread - safe method which fetches a tier - to - count mapping .
* The returned json object from Pinot contains below information
* " aggregationResults " : [
* " groupByResult " : [
* " value " : " 172765137.00000 " ,
* " group " : [
* " kafka - 08 - trackin... | Map < String , Long > map = new HashMap < > ( ) ; String query = "select tier, sum(count) from kafkaAudit where " + "eventType=\"" + datasetName + "\" and " + "beginTimestamp >= \"" + start + "\" and " + "beginTimestamp < \"" + end + "\" group by tier" ; String fullURL = targetUrl + URLEncoder . encode ( query , Charse... |
public class ForeignKey { /** * TableA as property name in TableB */
public String getReverseRelationshipName ( ) { } } | String ret = "" ; if ( tableAB == null ) { if ( multipleRelationsBetweenTables ) // foreignKey will be non - null since it applies only to one - to - X relation
{ ret = concatenateColumnNames ( this ) ; ret = ret . substring ( 1 ) + "_" ; // remove leading _ and add trailing _ .
} ret += StringUtility . firstLetterToLo... |
public class Participant { /** * Create a ParticipantDeleter to execute delete .
* @ param pathAccountSid The SID of the Account that created the resources to
* delete
* @ param pathConferenceSid The SID of the conference with the participants to
* delete
* @ param pathCallSid The Call SID of the resources to... | return new ParticipantDeleter ( pathAccountSid , pathConferenceSid , pathCallSid ) ; |
public class StorableIntrospector { /** * Create a representation of the signature which includes the method name .
* This uniquely identifies the method .
* @ param m method to describe */
private static String createSig ( Method m ) { } } | return m . getName ( ) + ':' + MethodDesc . forMethod ( m ) . getDescriptor ( ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcExternallyDefinedTextFont ( ) { } } | if ( ifcExternallyDefinedTextFontEClass == null ) { ifcExternallyDefinedTextFontEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 250 ) ; } return ifcExternallyDefinedTextFontEClass ; |
public class StyleUtil { /** * Creates a mark with the specified parameters .
* @ param wellKnownName the well known name
* @ param fill the fill
* @ param stroke the stroke
* @ return the mark */
public static MarkInfo createMark ( String wellKnownName , FillInfo fill , StrokeInfo stroke ) { } } | MarkInfo mark = new MarkInfo ( ) ; mark . setFill ( fill ) ; mark . setStroke ( stroke ) ; WellKnownNameInfo wellKnownNameInfo = new WellKnownNameInfo ( ) ; wellKnownNameInfo . setWellKnownName ( wellKnownName ) ; mark . setWellKnownName ( wellKnownNameInfo ) ; return mark ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcSpaceProgram ( ) { } } | if ( ifcSpaceProgramEClass == null ) { ifcSpaceProgramEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 524 ) ; } return ifcSpaceProgramEClass ; |
public class PCA { /** * Takes a set of data on each row , with the same number of features as the constructing data
* and returns the data in the coordinates of the basis set about the mean .
* @ param data Data of the same features used to construct the PCA object
* @ return The record in terms of the principal... | INDArray dx = data . subRowVector ( mean ) ; return Nd4j . tensorMmul ( eigenvectors . transpose ( ) , dx , new int [ ] [ ] { { 1 } , { 1 } } ) . transposei ( ) ; |
public class Range { /** * Returns the smallest range that includes this range and
* the { @ code value } .
* See { @ link # extend ( Range ) } for more details , as this method is
* equivalent to { @ code extend ( Range . create ( value , value ) ) } . < / p >
* @ param value a non - { @ code null } { @ code T... | if ( value == null ) throw new IllegalArgumentException ( "value must not be null" ) ; return extend ( value , value ) ; |
public class KeyStoreSecurity { /** * Creates a new Message Authentication Code
* @ param alias algorithm to use e . g . : HmacSHA256
* @ return Mac implementation */
public Mac getMac ( final @ NotNull String alias ) { } } | try { final Key secretKey = keys . get ( alias ) ; Mac mac = Mac . getInstance ( secretKey . getAlgorithm ( ) ) ; mac . init ( secretKey ) ; return mac ; } catch ( NoSuchAlgorithmException | InvalidKeyException e ) { throw new RuntimeException ( e ) ; } |
public class JavacTypes { /** * Returns an object cast to the specified type .
* @ throws NullPointerException if the object is { @ code null }
* @ throws IllegalArgumentException if the object is of the wrong type */
private static < T > T cast ( Class < T > clazz , Object o ) { } } | if ( ! clazz . isInstance ( o ) ) throw new IllegalArgumentException ( o . toString ( ) ) ; return clazz . cast ( o ) ; |
public class Update { /** * < pre >
* { $ append : { path : value } }
* < / pre > */
public static AppendInsert append ( String field , AppendInsertLiteral value ) { } } | return new AppendInsert ( "$append" , field ) . more ( value ) ; |
public class BProgram { /** * Runs the passed code in the passed scope .
* @ param script Code to evaluate
* @ param scriptName For error reporting purposes .
* @ return Result of code evaluation . */
protected Object evaluate ( String script , String scriptName ) { } } | try { Context curCtx = Context . getCurrentContext ( ) ; curCtx . setLanguageVersion ( Context . VERSION_1_8 ) ; return curCtx . evaluateString ( programScope , script , scriptName , 1 , null ) ; } catch ( EcmaError rerr ) { throw new BPjsCodeEvaluationException ( rerr ) ; } catch ( WrappedException wrapped ) { try { t... |
public class ThemeManager { /** * Apply theme from intent . Only system use , don ' t call it ! */
public static void applyTheme ( Activity activity , boolean force ) { } } | if ( force || ThemeManager . hasSpecifiedTheme ( activity ) ) { activity . setTheme ( ThemeManager . getTheme ( activity ) ) ; } |
public class HistogramAggregationIterator { /** * Puts the next data point of an iterator in the internal buffer .
* @ param i The index in { @ link # iterators } of the iterator .
* @ param dp The last data point returned by that iterator . */
private void putDataPoint ( final int i , final HistogramDataPoint dp )... | timestamps [ i ] = dp . timestamp ( ) ; values [ i ] = dp . clone ( ) ; |
public class AbstractAnnotationMetadataBuilder { /** * Build the meta data for the given method element excluding any class metadata .
* @ param element The element
* @ return The { @ link AnnotationMetadata } */
public AnnotationMetadata buildForMethod ( T element ) { } } | final AnnotationMetadata existing = MUTATED_ANNOTATION_METADATA . get ( element ) ; if ( existing != null ) { return existing ; } else { DefaultAnnotationMetadata annotationMetadata = new DefaultAnnotationMetadata ( ) ; return buildInternal ( null , element , annotationMetadata , false , false ) ; } |
public class PojoTask { /** * Sets the < code > context < / code > URL from which a relative
* < code > location < / code > URL should be evaluated . If < code > location < / code >
* is not relative then < code > context < / code > has no effect . The default is
* the location of the < code > PojoTask . class < ... | // Assertions .
if ( context == null ) { String msg = "Argument 'context' cannot be null." ; throw new IllegalArgumentException ( msg ) ; } if ( this . context != null ) { String msg = "Property 'context' may only be set once." ; throw new RuntimeException ( msg ) ; } this . context = context ; |
public class ModelMigration { /** * < p > diff . < / p >
* @ return a { @ link io . ebeaninternal . dbmigration . model . ModelDiff } object . */
public ModelDiff diff ( ) { } } | if ( diff != null ) return diff ; setOffline ( ) ; setDefaults ( ) ; try { migrationModel = new MigrationModel ( server ) ; ModelContainer migrated = migrationModel . read ( ) ; currentModel = new CurrentModel ( server , constraintNaming ) ; ModelContainer current = currentModel . read ( ) ; diff = new ModelDiff ( migr... |
public class JdbcTemp { /** * this method can used for insert / update / delete for database
* In insertParams the parameter type only supports : String Integer Float or
* Long Double Bye Short if you need operate other types , you must use JDBC
* directly replacing this method .
* @ param insertParams
* the ... | Debug . logVerbose ( "[JdonFramework]--> enter getSingleObject " , module ) ; Connection c = null ; PreparedStatement ps = null ; try { c = dataSource . getConnection ( ) ; ps = c . prepareStatement ( sql ) ; Debug . logVerbose ( sql , module ) ; jdbcUtil . setQueryParams ( insertParams , ps ) ; ps . executeUpdate ( ) ... |
public class ProductPartitionTreeImpl { /** * Returns a new empty tree .
* @ param adGroupId the ID of the ad group
* @ param biddingStrategyConfig the bidding strategy configuration of the ad group */
private static ProductPartitionTreeImpl createEmptyAdGroupTree ( Long adGroupId , BiddingStrategyConfiguration bid... | Preconditions . checkNotNull ( adGroupId , "Null ad group ID" ) ; Preconditions . checkNotNull ( biddingStrategyConfig , "Null bidding strategy configuration" ) ; ProductPartitionNode rootNode = new ProductPartitionNode ( null , null , - 1L , new ProductDimensionComparator ( ) ) ; return new ProductPartitionTreeImpl ( ... |
public class ServerService { /** * Modify servers by filter
* @ param serverFilter server filter
* @ param modifyServerConfig server config
* @ return OperationFuture wrapper for list of Servers */
public OperationFuture < List < Server > > modify ( ServerFilter serverFilter , ModifyServerConfig modifyServerConfi... | List < Server > serverList = find ( serverFilter ) . stream ( ) . map ( ServerMetadata :: asRefById ) . collect ( toList ( ) ) ; return modify ( serverList , modifyServerConfig ) ; |
public class Transforms { /** * Sin function
* @ param in
* @ param copy
* @ return */
public static INDArray atanh ( INDArray in , boolean copy ) { } } | return Nd4j . getExecutioner ( ) . exec ( new ATanh ( in , ( copy ? in . ulike ( ) : in ) ) ) ; |
public class DruidRunner { /** * Stops the server and removes the index
* @ throws Exception */
public void stop ( ) throws Exception { } } | DruidIndices . getInstance ( ) . remove ( String . valueOf ( port ) ) ; server . stop ( ) ; |
public class ControllableQueue { /** * Adds a new node into the queue .
* @ param delay the delay in milliseconds
* @ param value the value */
public void add ( long delay , T value ) { } } | mQueue . add ( new DelayNode < > ( value , delay + mPastTime ) ) ; |
public class FeaturesImpl { /** * Gets phraselist feature info .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param phraselistId The ID of the feature to be retrieved .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to th... | if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgu... |
public class BackendUser { /** * Synchronously sign up using credentials provided via constructor or setters .
* @ return boolean indicating sign up success */
public boolean signUp ( ) { } } | SignUpCredentials creds = new SignUpCredentials ( getUsername ( ) , getEmailAddress ( ) , getPassword ( ) ) ; SignUpResponse response = getAM ( ) . signUp ( creds ) ; if ( response . getStatus ( ) . isSuccess ( ) ) { this . initFrom ( response . get ( ) ) ; return true ; } else return false ; |
public class ResourceARNDetailMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ResourceARNDetail resourceARNDetail , ProtocolMarshaller protocolMarshaller ) { } } | if ( resourceARNDetail == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resourceARNDetail . getARN ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) ,... |
public class StringHelper { /** * Generates a root alias by truncating the " root name " defined by
* the incoming decription and removing / modifying any non - valid
* alias characters .
* @ param description The root name from which to generate a root alias .
* @ return The generated root alias . */
private s... | String result = truncate ( unqualifyEntityName ( description ) , ALIAS_TRUNCATE_LENGTH ) // Important to use Locale . ENGLISH . See HHH - 8579 . # toLowerCase ( ) uses the default Locale . Certain DBs
// do not like non - ascii characters in aliases , etc . , so ensure consistency / portability here .
. toLowerCase ( L... |
public class CmsSetupXmlHelper { /** * Returns a file from a given filename . < p >
* @ param xmlFilename the file name
* @ return the file */
private File getFile ( String xmlFilename ) { } } | File file = new File ( m_basePath + xmlFilename ) ; if ( ! file . exists ( ) || ! file . canRead ( ) ) { file = new File ( xmlFilename ) ; } return file ; |
public class StreamRemoteConnector { /** * Reads the next available byte from the input buffer provided , waiting if data is not
* available .
* @ param inputBuffer the buffer to read from
* @ return one byte of data from the stream
* @ throws IOException if there are problems reading data . */
private byte nex... | getAtLeastBytes ( inputBuffer , 1 , ReadMode . ONLY_WHEN_EMPTY ) ; return inputBuffer . get ( ) ; |
public class LogbackHelper { /** * Creates a new { @ link ConsoleAppender } to { @ code System . out } with the specified name and log pattern .
* @ see # buildLogPattern ( RootLoggerConfig ) */
public ConsoleAppender < ILoggingEvent > newConsoleAppender ( Context loggerContext , String name , String logPattern ) { }... | PatternLayoutEncoder consoleEncoder = new PatternLayoutEncoder ( ) ; consoleEncoder . setContext ( loggerContext ) ; consoleEncoder . setPattern ( logPattern ) ; consoleEncoder . start ( ) ; ConsoleAppender < ILoggingEvent > consoleAppender = new ConsoleAppender < > ( ) ; consoleAppender . setContext ( loggerContext ) ... |
public class Blueprint { /** * Serialisiert den Blueprint */
private static byte [ ] persist ( String description , Directory rootDir , Blob icon ) { } } | ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream ( ) ; DataOutputStream dataOutputStream = new DataOutputStream ( arrayOutputStream ) ; try { // Immer erster Stelle die aktuelle Version schreiben
dataOutputStream . writeByte ( CURRENT_BINARY_VERSION ) ; // Die Reihenfolge der Felder darf sich aus Gru... |
public class JDBC4Connection { /** * Check if the createStatement ( ) options are supported
* See http : / / docs . oracle . com / javase / 7 / docs / api / index . html ? java / sql / DatabaseMetaData . html
* The following flags are supported :
* - The type must either be TYPE _ SCROLL _ INSENSITIVE or TYPE _ F... | if ( ( ( resultSetType != ResultSet . TYPE_SCROLL_INSENSITIVE && resultSetType != ResultSet . TYPE_FORWARD_ONLY ) ) || resultSetConcurrency != ResultSet . CONCUR_READ_ONLY || resultSetHoldability != ResultSet . CLOSE_CURSORS_AT_COMMIT ) { throw SQLError . noSupport ( ) ; } |
public class BaseTableLayout { /** * Turns on debug lines . */
public BaseTableLayout < C , T > debug ( Debug debug ) { } } | this . debug = debug ; if ( debug == Debug . none ) toolkit . clearDebugRectangles ( this ) ; else invalidate ( ) ; return this ; |
public class KernelResolverRepository { /** * Find the preferred version of a feature from the list of features
* The decision is made by consulting { @ link # symbolicNameToPreferredVersion } to find out whether the user has configured a preferred version . If so , look for a feature with
* that version .
* If n... | Version preferredVersion = symbolicNameToPreferredVersion . get ( symbolicName ) ; ProvisioningFeatureDefinition result = null ; if ( preferredVersion != null ) { for ( ProvisioningFeatureDefinition feature : featureList ) { if ( preferredVersion . equals ( feature . getVersion ( ) ) ) { result = feature ; break ; } } ... |
public class SpendMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Spend spend , ProtocolMarshaller protocolMarshaller ) { } } | if ( spend == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( spend . getAmount ( ) , AMOUNT_BINDING ) ; protocolMarshaller . marshall ( spend . getUnit ( ) , UNIT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable ... |
public class CorrelationDistance { /** * Pearson correlation distance between the two arrays of type int . */
public static double pearson ( int [ ] x , int [ ] y ) { } } | if ( x . length != y . length ) throw new IllegalArgumentException ( String . format ( "Arrays have different length: x[%d], y[%d]" , x . length , y . length ) ) ; return 1 - Math . cor ( x , y ) ; |
public class MyfacesLogRecord { /** * Private method to infer the caller ' s class and method names */
private void _inferCaller ( ) { } } | _needToInferCaller = false ; // Get the stack trace .
StackTraceElement stack [ ] = ( new Throwable ( ) ) . getStackTrace ( ) ; // First , search back to a method in the Logger class .
int i = 0 ; while ( i < stack . length ) { StackTraceElement frame = stack [ i ] ; String cname = frame . getClassName ( ) ; if ( cname... |
public class PropertyHelper { /** * Converts a value to the type of the given field .
* @ param value
* @ param field
* @ return */
public static Object convertToClass ( String value , Class < ? > clazz ) { } } | Object propertyValue ; if ( clazz . isAssignableFrom ( int . class ) ) { propertyValue = Integer . parseInt ( value ) ; } else if ( clazz . isAssignableFrom ( long . class ) ) { propertyValue = Long . parseLong ( value ) ; } else if ( clazz . isAssignableFrom ( float . class ) ) { propertyValue = Float . parseFloat ( v... |
public class SpeechToText { /** * Reset a custom acoustic model .
* Resets a custom acoustic model by removing all audio resources from the model . Resetting a custom acoustic model
* initializes the model to its state when it was first created . Metadata such as the name and language of the model
* are preserved... | Validator . notNull ( resetAcousticModelOptions , "resetAcousticModelOptions cannot be null" ) ; String [ ] pathSegments = { "v1/acoustic_customizations" , "reset" } ; String [ ] pathParameters = { resetAcousticModelOptions . customizationId ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . cons... |
public class GridPanel { /** * returns if a grid contains a certain element
* @ param searchElement the searchElement of the grid element on which the search is done
* @ return true or false */
public boolean isRowPresent ( String searchElement ) { } } | ready ( ) ; boolean found ; GridCell cell = getCell ( searchElement ) ; // scrollTop ( ) ; / / make sure always start from top then scroll down till the end of the page
// do {
// if the row is not in visible ( need to scroll down - errors when used BufferView in grid )
found = cell . isElementPresent ( ) ; // } while ... |
public class ListUtils { /** * Applies a binary function between each element of the given list .
* @ param list list of elements
* @ param init initial value for the accumulator
* @ param f accumulator expression to apply
* @ param < Accumulator > binary function
* @ param < Value > element type
* @ return... | Accumulator accumulator = init ; for ( Value value : list ) { accumulator = f . eval ( accumulator , value ) ; } return accumulator ; |
public class EntityStatisticsProcessor { /** * Counts additional occurrences of a property as qualifier property of
* statements .
* @ param usageStatistics
* statistics object where count is stored
* @ param property
* the property to count
* @ param count
* the number of times to count the property */
p... | addPropertyCounters ( usageStatistics , property ) ; usageStatistics . propertyCountsQualifier . put ( property , usageStatistics . propertyCountsQualifier . get ( property ) + count ) ; |
public class Matrix { /** * Rotates matrix m by angle a ( in degrees ) around the axis ( x , y , z )
* @ param rm returns the result
* @ param rmOffset index into rm where the result matrix starts
* @ param a angle to rotate in degrees
* @ param x scale factor x
* @ param y scale factor y
* @ param z scale ... | rm [ rmOffset + 3 ] = 0 ; rm [ rmOffset + 7 ] = 0 ; rm [ rmOffset + 11 ] = 0 ; rm [ rmOffset + 12 ] = 0 ; rm [ rmOffset + 13 ] = 0 ; rm [ rmOffset + 14 ] = 0 ; rm [ rmOffset + 15 ] = 1 ; a *= ( float ) ( Math . PI / 180.0f ) ; float s = ( float ) Math . sin ( a ) ; float c = ( float ) Math . cos ( a ) ; if ( 1.0f == x ... |
public class ErrorHandler { /** * Invoked on a log writer error event .
* The default behavior used here prints the logging source and the error message to
* the system standard error stream ( System . err ) . If an exception object is given , the
* exception and the last method calls of the log writer leading to... | if ( invocations >= maxInvocations ) return ; ++ invocations ; String out = source + ": " + msg ; StackTraceElement [ ] trace = null ; if ( e != null ) { out += " (" + e . getMessage ( ) + ")" ; trace = e . getStackTrace ( ) ; } synchronized ( System . err ) { System . err . println ( out ) ; final String srcName = sou... |
public class Bundler { /** * Inserts a SparceArray of Parcelable values into the mapping of this
* Bundle , replacing any existing value for the given key . Either key
* or value may be null .
* @ param key a String , or null
* @ param value a SparseArray of Parcelable objects , or null
* @ return this */
pub... | bundle . putSparseParcelableArray ( key , value ) ; return this ; |
public class Utils { /** * Add element to start of list */
public static < T > List < T > addFirst ( List < T > to , T what ) { } } | List < T > data = safeList ( to ) ; data . add ( 0 , what ) ; return data ; |
public class MutableDateTime { /** * Set the time from another instant .
* The date part of this object will be unaffected .
* @ param instant an instant to copy the time from , date part ignored
* @ throws IllegalArgumentException if the object is invalid */
public void setTime ( final ReadableInstant instant ) ... | long instantMillis = DateTimeUtils . getInstantMillis ( instant ) ; Chronology instantChrono = DateTimeUtils . getInstantChronology ( instant ) ; DateTimeZone zone = instantChrono . getZone ( ) ; if ( zone != null ) { instantMillis = zone . getMillisKeepLocal ( DateTimeZone . UTC , instantMillis ) ; } setTime ( instant... |
public class ProcessEngineDriver { /** * Starting a regular process .
* @ param processId ID of the process to be started
* @ param masterRequestId
* @ param ownerType
* @ param ownerId
* @ param vars Input parameter bindings for the process instance to be created
* @ return Process instance ID */
public Lo... | Process procdef = getProcessDefinition ( processId ) ; int performance_level = procdef . getPerformanceLevel ( ) ; if ( performance_level <= 0 ) performance_level = default_performance_level_regular ; EngineDataAccess edao = EngineDataAccessCache . getInstance ( false , performance_level ) ; InternalMessenger msgBroker... |
public class SslRefInfoImpl { /** * { @ inheritDoc }
* @ throws SocialLoginException */
@ Override public HashMap < String , PublicKey > getPublicKeys ( ) throws SocialLoginException { } } | if ( this . jsseHelper == null ) { init ( ) ; } // TODO due to dynamic changes on keyStore , we have to load the public
// keys everytime .
HashMap < String , PublicKey > publicKeys = new HashMap < String , PublicKey > ( ) ; if ( this . sslTrustStoreName != null ) { KeyStoreService keyStoreService = keyStoreServiceRef ... |
public class BigDecimalMath { /** * Calculates the arc hyperbolic cotangens ( inverse hyperbolic cotangens ) of { @ link BigDecimal } x .
* < p > See : < a href = " https : / / en . wikipedia . org / wiki / Hyperbolic _ function " > Wikipedia : Hyperbolic function < / a > < / p >
* @ param x the { @ link BigDecimal... | checkMathContext ( mathContext ) ; MathContext mc = new MathContext ( mathContext . getPrecision ( ) + 6 , mathContext . getRoundingMode ( ) ) ; BigDecimal result = log ( x . add ( ONE , mc ) . divide ( x . subtract ( ONE , mc ) , mc ) , mc ) . divide ( TWO , mc ) ; return round ( result , mathContext ) ; |
public class AppServicePlansInner { /** * Get the send key name and value of a Hybrid Connection .
* Get the send key name and value of a Hybrid Connection .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service plan .
* @ param namespaceNa... | return listHybridConnectionKeysWithServiceResponseAsync ( resourceGroupName , name , namespaceName , relayName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class PropertiesManager { /** * Retrieve the value of the given property as an integer . If the current
* value of the specified property cannot be converted to an integer , the
* default value will be retrieved .
* @ param property
* the property to retrieve
* @ return the integer value of the given p... | try { return getIntegerProperty ( property ) ; } catch ( NumberFormatException e ) { return Integer . parseInt ( getDefaultProperty ( property ) ) ; } |
public class AbstractQuery { /** * Returns the providers and their ordering to be considered . This information typically must be interpreted by the
* singleton SPI implementations , which are backing the singleton accessors .
* If the list returned is empty , the default provider list ,
* determined by methods l... | @ SuppressWarnings ( "unchecked" ) List < String > result = get ( KEY_QUERY_PROVIDERS , List . class ) ; if ( result == null ) { return Collections . emptyList ( ) ; } return result ; |
public class StringSerializer { /** * ( non - Javadoc )
* @ see Serializer # deserialize ( byte [ ] , java . lang . Class ) */
@ SuppressWarnings ( "unchecked" ) @ Override public < T > T deserialize ( byte [ ] content , Class < T > clazz ) throws SerializerException { } } | validateString ( clazz ) ; return ( T ) new String ( content , Charsets . UTF_8 ) ; |
public class LoggerFactory { /** * Resort to reflection to make any FileHandler that is currently active roll - over
* the current logfile and start a new one , e . g . this may be useful before a big
* batch - job starts to have a clean start of log - entries .
* @ throws IllegalStateException If there is a prob... | Logger log = Logger . getLogger ( "" ) ; // NOSONAR - local logger used on purpose here
for ( Handler handler : log . getHandlers ( ) ) { if ( handler instanceof FileHandler ) { try { Method m = FileHandler . class . getDeclaredMethod ( "rotate" ) ; m . setAccessible ( true ) ; if ( ! Level . OFF . equals ( handler . g... |
public class ProvisionerImpl { /** * Set the start level of the framework , and listen for framework events to
* ensure we wait until the start level operation is complete before
* continuing ( due to timing , this translates into waiting until the next
* start level event is fired . . we don ' t necessarily know... | BundleStartStatus startStatus = null ; if ( frameworkStartLevel != null ) { // The framework listener passed as a paramter will be notified with a
// FrameworkEvent ( START _ LEVEL _ CHANGED or ERROR ) when the setStartLevel
// operation completes .
StartLevelFrameworkListener slfw = new StartLevelFrameworkListener ( t... |
public class JQMRadioset { /** * Returns the value of the button that has the given id
* @ return the value of the button with the given id */
private String getValueForId ( String id ) { } } | for ( int k = 0 ; k < fieldset . getWidgetCount ( ) ; k ++ ) { Widget widget = fieldset . getWidget ( k ) ; if ( id . equals ( widget . getElement ( ) . getAttribute ( "id" ) ) ) return widget . getElement ( ) . getAttribute ( "value" ) ; } return null ; |
public class HtmlGL20 { /** * The content of non - VBO buffers may be changed between the glVertexAttribPointer call
* and the glDrawXxx call . Thus , we need to defer copying them to a VBO buffer until just
* before the actual glDrawXxx call . */
protected void prepareDraw ( ) { } } | VertexAttribArrayState previousNio = null ; int previousElementSize = 0 ; if ( useNioBuffer == 0 && enabledArrays == previouslyEnabledArrays ) { return ; } for ( int i = 0 ; i < VERTEX_ATTRIB_ARRAY_COUNT ; i ++ ) { int mask = 1 << i ; int enabled = enabledArrays & mask ; if ( enabled != ( previouslyEnabledArrays & mask... |
public class AuthorizationImpl { /** * Converts an < code > IGroupMember < / code > into an < code > IAuthorizationPrincipal < / code > .
* @ return org . apereo . portal . security . IAuthorizationPrincipal
* @ param groupMember org . apereo . portal . groups . IGroupMember */
@ Override public IAuthorizationPrinc... | String key = groupMember . getKey ( ) ; Class type = groupMember . getType ( ) ; logger . debug ( "AuthorizationImpl.newPrincipal(): for {} ({})" , type , key ) ; return newPrincipal ( key , type ) ; |
public class Configuration { /** * Override multiple numeric bindings , both begin and end are inclusive
* @ param beginTotal inclusive start of range
* @ param endTotal inclusive end of range
* @ param beginDecimal inclusive start of range
* @ param endDecimal inclusive end of range
* @ param javaType java t... | for ( int total = beginTotal ; total <= endTotal ; total ++ ) { for ( int decimal = beginDecimal ; decimal <= endDecimal ; decimal ++ ) { registerNumeric ( total , decimal , javaType ) ; } } |
public class TableInfo { /** * Returns a builder for a { @ code TableInfo } object given table identity and definition . Use
* { @ link StandardTableDefinition } to create simple BigQuery table . Use { @ link ViewDefinition } to
* create a BigQuery view . Use { @ link ExternalTableDefinition } to create a BigQuery ... | return new BuilderImpl ( ) . setTableId ( tableId ) . setDefinition ( definition ) ; |
public class DefaultLoginWebflowConfigurer { /** * Create authentication warning messages view .
* @ param flow the flow */
protected void createAuthenticationWarningMessagesView ( final Flow flow ) { } } | val state = createViewState ( flow , CasWebflowConstants . STATE_ID_SHOW_AUTHN_WARNING_MSGS , "casLoginMessageView" ) ; val setAction = createSetAction ( "requestScope.messages" , "messageContext.allMessages" ) ; state . getEntryActionList ( ) . add ( setAction ) ; createTransitionForState ( state , CasWebflowConstants... |
public class Job { /** * / * package */
final Result runJob ( ) { } } | try { // daily jobs check the requirements manually
if ( this instanceof DailyJob || meetsRequirements ( true ) ) { mResult = onRunJob ( getParams ( ) ) ; } else { mResult = getParams ( ) . isPeriodic ( ) ? Result . FAILURE : Result . RESCHEDULE ; } return mResult ; } finally { mFinishedTimeStamp = System . currentTime... |
public class HybridJPAObjectFactory { /** * Checks access to the specified JPA reference and returns true if the
* current call to { @ link # getObjectInstance } is in the context of a
* Stateful Session bean . < p >
* By default , this method will return what is stored in the info object as
* passed by the isS... | ComponentMetaData cmd = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) . getComponentMetaData ( ) ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "checkSFSBAccess: " + info + ", " + ( cmd == null ? null : cmd . getJ2E... |
public class AssociateMemberAccountRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AssociateMemberAccountRequest associateMemberAccountRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( associateMemberAccountRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( associateMemberAccountRequest . getMemberAccountId ( ) , MEMBERACCOUNTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to ma... |
public class AbstractFramedChannel { /** * Flushes all ready stream sink conduits to the channel .
* Frames will be batched up , to allow them all to be written out via a gathering
* write . The { @ link # framePriority } implementation will be invoked to decide which
* frames are eligible for sending and in what... | if ( flushingSenders ) { throw UndertowMessages . MESSAGES . recursiveCallToFlushingSenders ( ) ; } flushingSenders = true ; try { int toSend = 0 ; while ( ! newFrames . isEmpty ( ) ) { S frame = newFrames . poll ( ) ; frame . preWrite ( ) ; if ( framePriority . insertFrame ( frame , pendingFrames ) ) { if ( ! heldFram... |
public class AbstractCounterFactory { /** * { @ inheritDoc } */
@ Override public ICounter getCounter ( String name ) { } } | try { return counterCache . get ( name ) ; } catch ( ExecutionException e ) { throw new RuntimeException ( e ) ; } |
public class VaultsInner { /** * Creates or updates a Recovery Services vault .
* @ param resourceGroupName The name of the resource group where the recovery services vault is present .
* @ param vaultName The name of the recovery services vault .
* @ param vault Recovery Services Vault to be created .
* @ thro... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , vaultName , vault ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SmbComTransactionResponse { /** * { @ inheritDoc }
* @ see jcifs . internal . smb1 . ServerMessageBlock # decode ( byte [ ] , int ) */
@ Override public int decode ( byte [ ] buffer , int bufferIndex ) throws SMBProtocolDecodingException { } } | int len = super . decode ( buffer , bufferIndex ) ; if ( this . byteCount == 0 ) { // otherwise hasMore may not be correctly set
readBytesWireFormat ( buffer , len + bufferIndex ) ; } nextElement ( ) ; return len ; |
public class HandlerSocketCache { /** * Opens a connection and a session to a HandlerSocket server . Specify the table ' s index to
* hit as well as the columns you want . A common index is PRIMRY - for the primary
* key . You may also have a multi - column key named NAME _ EMAIL with columns ( ` name ` , ` email `... | IndexSession session = null ; String sessionKey = index + Arrays . hashCode ( columns ) ; // both index and columns play a role in opening a session
try { if ( hsClient == null ) { hsClient = new HSClientImpl ( handlerSocketHost , port , poolSize ) ; } session = indexSessions . get ( sessionKey ) ; if ( session == null... |
public class IntStreamEx { /** * Returns a sequential { @ link IntStreamEx } with the specified range of the
* specified array as its source .
* @ param array the array , assumed to be unmodified during use
* @ param startInclusive the first index to cover , inclusive
* @ param endExclusive index immediately pa... | return of ( Arrays . spliterator ( array , startInclusive , endExclusive ) ) ; |
public class JsAdminFactoryImpl { @ Override public BaseDestinationDefinition createBaseDestinationDefinition ( DestinationType type , String name ) { } } | return new BaseDestinationDefinitionImpl ( type , name ) ; |
public class URIUtils { /** * Helper method for modifying URI port
* @ param uri
* @ param newPort
* @ return */
public static String modifyURIPort ( String uri , int newPort ) { } } | try { URI uriObj = new URI ( uri ) ; return uriToString ( URLUtils . modifyURIPort ( uriObj , newPort ) ) ; } catch ( URISyntaxException e ) { try { return ( new NetworkInterfaceURI ( uri ) ) . modifyURIPort ( newPort ) ; } catch ( IllegalArgumentException ne ) { throw new IllegalArgumentException ( ne . getMessage ( )... |
public class GVRPicker { /** * Gets the pick ray in world coordinates .
* World coordinates are defined as the coordinate system at the
* root of the scene graph before any camera viewing transformation
* is applied .
* You can get the pick ray relative to the scene object that
* owns the picker ( or the came... | GVRSceneObject owner = getOwnerObject ( ) ; if ( owner == null ) // should never come here , picker always
{ // owned by GVRGearCursorController pivot
owner = mScene . getMainCameraRig ( ) . getHeadTransformObject ( ) ; } Matrix4f mtx = owner . getTransform ( ) . getModelMatrix4f ( ) ; origin . set ( mRayOrigin ) ; dir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.