signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TreeGenerator { /** * / < returns > < / returns > */
public static Primitive anyPrimitive ( Program program , int allowableDepth , TGPInitializationStrategy method , RandEngine randEngine ) { } } | int terminal_count = ( program . getVariableSet ( ) . size ( ) + program . getConstantSet ( ) . size ( ) ) ; int function_count = program . getOperatorSet ( ) . size ( ) ; double terminal_prob = ( double ) terminal_count / ( terminal_count + function_count ) ; if ( allowableDepth <= 0 || ( method == TGPInitializationSt... |
public class MutableURI { /** * Sets the host .
* @ param host host */
public void setHost ( String host ) { } } | _host = null ; if ( host != null && host . length ( ) > 0 ) { // Here ' s some very minimal support for IPv6 addresses .
// If the literal IPv6 address is not enclosed in square brackets
// then add them .
boolean needBrackets = ( ( host . indexOf ( ':' ) >= 0 ) && ! host . startsWith ( "[" ) && ! host . endsWith ( "]"... |
public class InstantiateOperation { /** * Tries to initiate an object of the target class through a constructor with the given object as parameter . */
private Object initiateByConstructor ( Class < ? > targetClass , List < Object > objects ) throws Exception { } } | Constructor < ? > constr = targetClass . getConstructor ( getClassList ( objects ) ) ; return constr . newInstance ( objects . toArray ( ) ) ; |
public class CmsBrokenLinkRenderer { /** * Renders the source of a broken link as a list of CmsBrokenLinkBean instances . < p >
* @ param target the broken link target
* @ param source the broken link source
* @ return the list of broken link beans to display to the user
* @ throws CmsException if something goe... | I_CmsResourceType resType = OpenCms . getResourceManager ( ) . getResourceType ( source ) ; String typeName = resType . getTypeName ( ) ; if ( typeName . equals ( CmsResourceTypeXmlContainerPage . INHERIT_CONTAINER_CONFIG_TYPE_NAME ) ) { return renderBrokenLinkInheritanceGroup ( target , source ) ; } else if ( CmsResou... |
public class ClientAuthInterceptor { /** * Generate a JWT - specific service URI . The URI is simply an identifier with enough information
* for a service to know that the JWT was intended for it . The URI will commonly be verified with
* a simple string equality check . */
private URI serviceUri ( Channel channel ... | String authority = channel . authority ( ) ; if ( authority == null ) { throw Status . UNAUTHENTICATED . withDescription ( "Channel has no authority" ) . asException ( ) ; } // Always use HTTPS , by definition .
final String scheme = "https" ; final int defaultPort = 443 ; String path = "/" + method . getServiceName ( ... |
public class DiscriminatorJdbcBuilder { /** * Add a discriminator matching predicate with its associated type .
* @ param predicate the predicate
* @ param type the type
* @ return the current builder */
public DiscriminatorJdbcSubBuilder when ( Predicate < String > predicate , Type type ) { } } | final DiscriminatorJdbcSubBuilder subBuilder = new DiscriminatorJdbcSubBuilder ( predicate , type ) ; builders . add ( subBuilder ) ; return subBuilder ; |
public class RDFStructureParser { /** * ( non - Javadoc )
* @ see
* io . redlink . sdk . impl . analysis . model . EnhancementsParser # parseEntity ( java
* . lang . String ) */
public Entity parseEntity ( String entityUri , String dataset ) throws EnhancementParserException { } } | try { RepositoryConnection conn = repository . getConnection ( ) ; conn . begin ( ) ; Entity result = parseEntity ( conn , entityUri , dataset ) ; conn . close ( ) ; return result ; } catch ( RepositoryException e ) { throw new EnhancementParserException ( "Error querying the RDF Model obtained as Service Response" , e... |
public class AbstractPropertyAccessStrategy { /** * Returns the index of the last nested property separator in the given
* property path , ignoring dots in keys ( like " map [ my . key ] " ) . */
protected int getLastPropertySeparatorIndex ( String propertyPath ) { } } | boolean inKey = false ; for ( int i = propertyPath . length ( ) - 1 ; i >= 0 ; i -- ) { switch ( propertyPath . charAt ( i ) ) { case PropertyAccessor . PROPERTY_KEY_SUFFIX_CHAR : inKey = true ; break ; case PropertyAccessor . PROPERTY_KEY_PREFIX_CHAR : return i ; case PropertyAccessor . NESTED_PROPERTY_SEPARATOR_CHAR ... |
public class JMStream { /** * Build reversed stream stream .
* @ param < T > the type parameter
* @ param collection the collection
* @ return the stream */
public static < T > Stream < T > buildReversedStream ( Collection < T > collection ) { } } | return JMCollections . getReversed ( collection ) . stream ( ) ; |
public class VerticalRecordsProcessor { /** * 表の見出しから 、 レコードのJavaクラスの定義にあるカラムの定義で初めて見つかるリストのインデックスを取得する 。
* < p > カラムの定義とは 、 アノテーション 「 @ XlsColumn 」 が付与されたもの 。
* @ param headers 表の見出し情報 。
* @ param recordClass アノテーション 「 @ XlsColumn 」 が定義されたフィールドを持つレコード用のクラス 。
* @ param annoReader { @ link AnnotationReade... | // レコードクラスが不明の場合 、 0を返す 。
if ( ( recordClass == null || recordClass . equals ( Object . class ) ) ) { return 0 ; } for ( int i = 0 ; i < headers . size ( ) ; i ++ ) { RecordHeader headerInfo = headers . get ( i ) ; final List < FieldAccessor > propeties = FieldAccessorUtils . getColumnPropertiesByName ( recordClass ,... |
public class PluginClassloaderFactory { /** * A plugin can export some resources to other plugins */
private void exportResources ( PluginClassLoaderDef def , ClassloaderBuilder builder , Collection < PluginClassLoaderDef > allPlugins ) { } } | // export the resources to all other plugins
builder . setExportMask ( def . getBasePluginKey ( ) , def . getExportMask ( ) ) ; for ( PluginClassLoaderDef other : allPlugins ) { if ( ! other . getBasePluginKey ( ) . equals ( def . getBasePluginKey ( ) ) ) { builder . addSibling ( def . getBasePluginKey ( ) , other . ge... |
public class TrustedAdvisorResourceDetail { /** * Additional information about the identified resource . The exact metadata and its order can be obtained by
* inspecting the < a > TrustedAdvisorCheckDescription < / a > object returned by the call to
* < a > DescribeTrustedAdvisorChecks < / a > . < b > Metadata < / ... | if ( metadata == null ) { metadata = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return metadata ; |
public class EventEngineImpl { /** * Activate the EventEngine implementation . This method will be called by
* OSGi Declarative Services implementation when the component is initially
* activated and when changes to our configuration have occurred .
* @ param componentContext
* the OSGi DS context */
@ Activate... | this . componentContext = componentContext ; // / / Parse the configuration that we ' ve been provided
// Dictionary < ? , ? > configProperties = componentContext . getProperties ( ) ;
// processConfigProperties ( configProperties ) ;
// Hold a reference to the bundle context
bundleContext = componentContext . getBundl... |
public class ListExclusionsResult { /** * A list of exclusions ' ARNs returned by the action .
* @ param exclusionArns
* A list of exclusions ' ARNs returned by the action . */
public void setExclusionArns ( java . util . Collection < String > exclusionArns ) { } } | if ( exclusionArns == null ) { this . exclusionArns = null ; return ; } this . exclusionArns = new java . util . ArrayList < String > ( exclusionArns ) ; |
public class RepositoryFileApi { /** * Get file from repository . Allows you to receive information about file in repository like name , size , content .
* Note that file content is Base64 encoded .
* < pre > < code > GitLab Endpoint : GET / projects / : id / repository / files < / code > < / pre >
* @ param file... | if ( isApiVersion ( ApiVersion . V3 ) ) { return ( getFileV3 ( filePath , projectId , ref ) ) ; } else { return ( getFile ( projectId , filePath , ref , true ) ) ; } |
public class FormattedStringBuilder { /** * Appends the stack trace of the Throwable argument to this sequence .
* @ param t Exception to print .
* @ return The updated instance of FormattedStringBuilder . */
public FormattedStringBuilder append ( Throwable t ) { } } | ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; PrintStream p = new PrintStream ( os ) ; t . printStackTrace ( p ) ; p . close ( ) ; return append ( os . toString ( ) ) ; |
public class GeoPackageCoreImpl { /** * { @ inheritDoc } */
@ Override public GeometryColumnsSqlMmDao getGeometryColumnsSqlMmDao ( ) { } } | GeometryColumnsSqlMmDao dao = createDao ( GeometryColumnsSqlMm . class ) ; verifyTableExists ( dao ) ; return dao ; |
public class MaskedCardView { /** * Set the card data displayed using a { @ link Card } object . Note that
* the full number will not be accessed here .
* @ param card the { @ link Card } to be partially displayed */
void setCard ( @ NonNull Card card ) { } } | mCardBrand = card . getBrand ( ) ; mLast4 = card . getLast4 ( ) ; updateBrandIcon ( ) ; updateCardInformation ( ) ; |
public class Session { /** * Adds a value to the session , overwriting an existing value
* @ param key The key to store the value
* @ param value The value to store */
public void put ( String key , String value ) { } } | if ( INVALID_CHRACTERTS . contains ( key ) || INVALID_CHRACTERTS . contains ( value ) ) { LOG . error ( "Session key or value can not contain the following characters: spaces, |, & or :" ) ; } else { this . changed = true ; this . values . put ( key , value ) ; } |
public class SheetBindingErrors { /** * フィールドエラーのビルダーを作成します 。
* @ param field フィールドパス 。
* @ param errorCode エラーコード
* @ return { @ link FieldError } のインスタンスを組み立てるビルダクラス 。 */
public InternalFieldErrorBuilder createFieldError ( final String field , final String errorCode ) { } } | return createFieldError ( field , new String [ ] { errorCode } ) ; |
public class EvaluatorImpl { /** * Multiply two values */
private static Number times ( Number a , Number b ) { } } | int aType = getType ( a ) ; int bType = getType ( b ) ; int compType = ( aType >= bType ) ? aType : bType ; switch ( compType ) { case INT : return new Integer ( a . intValue ( ) * b . intValue ( ) ) ; case LONG : return new Long ( a . longValue ( ) * b . longValue ( ) ) ; case FLOAT : return new Float ( a . floatValue... |
public class ChainedCollectorMapDriver { @ Override public void setup ( AbstractInvokable parent ) { } } | @ SuppressWarnings ( "unchecked" ) final GenericCollectorMap < IT , OT > mapper = RegularPactTask . instantiateUserCode ( this . config , userCodeClassLoader , GenericCollectorMap . class ) ; this . mapper = mapper ; mapper . setRuntimeContext ( getUdfRuntimeContext ( ) ) ; |
public class MessageAction { /** * Sets the { @ link net . dv8tion . jda . core . entities . MessageEmbed MessageEmbed }
* that should be used for this Message .
* Refer to { @ link net . dv8tion . jda . core . EmbedBuilder EmbedBuilder } for more information .
* @ param embed
* The { @ link net . dv8tion . jda... | if ( embed != null ) { final AccountType type = getJDA ( ) . getAccountType ( ) ; Checks . check ( embed . isSendable ( type ) , "Provided Message contains an empty embed or an embed with a length greater than %d characters, which is the max for %s accounts!" , type == AccountType . BOT ? MessageEmbed . EMBED_MAX_LENGT... |
public class ApiOvhTelephony { /** * Compatible rate codes related to this value added service
* REST : GET / telephony / { billingAccount } / rsva / { serviceName } / allowedRateCodes
* @ param billingAccount [ required ] The name of your billingAccount
* @ param serviceName [ required ] */
public ArrayList < Ov... | String qPath = "/telephony/{billingAccount}/rsva/{serviceName}/allowedRateCodes" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t18 ) ; |
public class Cache { /** * Return element for the given key but do not pin the element . In addition ,
* if object is found , add adjustPinCount to the pinned state . < p >
* Note : This method is added to support the scenario in the activation
* strategy classes that multiple cache . unpin ( ) are called immedia... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "findDontPinNAdjustPinCount" , key + ", adujust pin count=" + adjustPinCount ) ; Bucket bucket = getBucketForKey ( key ) ; Object object = null ; if ( bucket != null ) // d739870
{ synchronized ( bucket ) { Element element = bu... |
public class SecurityActions { /** * WARNING : Calling this method in non modular context has the side effect to load the Module class .
* This is problematic , the system packages required to properly execute an embedded - server will not
* be correct . */
static < T > T loadAndInstantiateFromModule ( final String... | if ( ! WildFlySecurityManager . isChecking ( ) ) { return internalLoadAndInstantiateFromModule ( moduleId , iface , name ) ; } else { try { return doPrivileged ( new PrivilegedExceptionAction < T > ( ) { @ Override public T run ( ) throws Exception { return internalLoadAndInstantiateFromModule ( moduleId , iface , name... |
public class BpmnParse { /** * Removes a job declaration which belongs to the given activity and has the given job configuration .
* @ param activity the activity of the job declaration
* @ param jobConfiguration the job configuration of the declaration */
protected void removeMessageJobDeclarationWithJobConfigurat... | List < MessageJobDeclaration > messageJobDeclarations = ( List < MessageJobDeclaration > ) activity . getProperty ( PROPERTYNAME_MESSAGE_JOB_DECLARATION ) ; if ( messageJobDeclarations != null ) { Iterator < MessageJobDeclaration > iter = messageJobDeclarations . iterator ( ) ; while ( iter . hasNext ( ) ) { MessageJob... |
public class ExtensionsHolder { /** * Order extension according to { @ link ru . vyarus . dropwizard . guice . module . installer . order . Order } annotation .
* Installer must implement { @ link ru . vyarus . dropwizard . guice . module . installer . order . Ordered } otherwise
* no order appear . */
public void ... | final OrderComparator comparator = new OrderComparator ( ) ; for ( Class < ? extends FeatureInstaller > installer : installerTypes ) { if ( Ordered . class . isAssignableFrom ( installer ) ) { final List < Class < ? > > extensions = this . extensions . get ( installer ) ; if ( extensions == null || extensions . size ( ... |
public class GeneralizedLogisticDistribution { /** * log Cumulative density function .
* TODO : untested .
* @ param val Value
* @ param loc Location
* @ param scale Scale
* @ param shape Shape
* @ return log PDF */
public static double logcdf ( double val , double loc , double scale , double shape ) { } } | val = ( val - loc ) / scale ; return FastMath . log1p ( FastMath . exp ( - val ) ) * - shape ; |
public class CommercePriceEntryPersistenceImpl { /** * Removes all the commerce price entries where companyId = & # 63 ; from the database .
* @ param companyId the company ID */
@ Override public void removeByCompanyId ( long companyId ) { } } | for ( CommercePriceEntry commercePriceEntry : findByCompanyId ( companyId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commercePriceEntry ) ; } |
public class AmazonApiGatewayClient { /** * Creates a new < a > RestApi < / a > resource .
* @ param createRestApiRequest
* The POST Request to add a new < a > RestApi < / a > resource to your collection .
* @ return Result of the CreateRestApi operation returned by the service .
* @ throws UnauthorizedExceptio... | request = beforeClientExecution ( request ) ; return executeCreateRestApi ( request ) ; |
public class AbcGrammar { /** * midi - program : : = " program " 1 * WSP [ midi - channel - number 1 * WSP ] midi - program - number */
Rule MidiProgram ( ) { } } | return Sequence ( String ( "program" ) , OneOrMore ( WSP ( ) ) , Optional ( Sequence ( MidiChannelNumber ( ) , OneOrMore ( WSP ( ) ) ) ) , MidiProgramNumber ( ) ) . label ( MidiProgram ) ; |
public class StateDescriptor { /** * Returns the default value . */
public T getDefaultValue ( ) { } } | if ( defaultValue != null ) { if ( serializer != null ) { return serializer . copy ( defaultValue ) ; } else { throw new IllegalStateException ( "Serializer not yet initialized." ) ; } } else { return null ; } |
public class GuidCompressor { /** * Converts a Guid - object into a uncompressed String representation of a GUID
* @ param guid the Guid - object to be converted
* @ return the uncompressed String representation of a GUID */
public static String getUncompressedStringFromGuid ( Guid guid ) { } } | String result = new String ( ) ; result += String . format ( "%1$08x" , guid . Data1 ) ; result += "-" ; result += String . format ( "%1$04x" , guid . Data2 ) ; result += "-" ; result += String . format ( "%1$04x" , guid . Data3 ) ; result += "-" ; result += String . format ( "%1$02x%2$02x" , ( int ) guid . Data4 [ 0 ]... |
public class DateTimeUtil { /** * Check Date is " yyyyMMdd "
* @ param val String to check
* @ return boolean
* @ throws BadDateException on format error */
public static boolean isISODate ( final String val ) throws BadDateException { } } | try { if ( val . length ( ) != 8 ) { return false ; } fromISODate ( val ) ; return true ; } catch ( Throwable t ) { return false ; } |
public class Record { /** * Writes the column ' s buffer byte array data into the { @ code column }
* contained by the record buffer .
* @ param colBuffer Column buffer data
* @ param column Column to write
* @ param recBuffer Record buffer
* @ throws InvalidArgument Thrown if either buffer or column is inval... | if ( colBuffer == null ) { throw new InvalidArgument ( "colBuffer may not be null" ) ; } else if ( recBuffer == null ) { throw new InvalidArgument ( "recBuffer may not be null" ) ; } else if ( column < 0 || column >= columns . length ) { final String fmt = "invalid column: %d" ; final String msg = format ( fmt , column... |
public class ServiceDirectoryImpl { /** * Shutdown the ServiceDirectory and the ServiceDirectoryManagerFactory . */
public void shutdown ( ) { } } | synchronized ( this ) { if ( ! isShutdown ) { if ( directoryManagerFactory != null ) { if ( directoryManagerFactory instanceof Closable ) { ( ( Closable ) directoryManagerFactory ) . stop ( ) ; } directoryManagerFactory = null ; } if ( client != null ) { client . close ( ) ; client = null ; } this . isShutdown = true ;... |
public class AbstractCsiv2SubsystemFactory { /** * { @ inheritDoc } */
@ Override public void register ( ReadyListener listener , Map < String , Object > properties , List < IIOPEndpoint > endpoints ) { } } | String timeoutValue = ( String ) properties . get ( "orbSSLInitTimeout" ) ; if ( timeoutValue != null & timeoutValue . length ( ) > 0 ) { TIMEOUT_SECONDS = Long . valueOf ( timeoutValue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "TIMEOUT_SECONDS = " + TIMEOUT_SECO... |
public class NetworkEndpointGroupClient { /** * Creates a network endpoint group in the specified project using the parameters that are
* included in the request .
* < p > Sample code :
* < pre > < code >
* try ( NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient . create ( ) ) {... | InsertNetworkEndpointGroupHttpRequest request = InsertNetworkEndpointGroupHttpRequest . newBuilder ( ) . setZone ( zone ) . setNetworkEndpointGroupResource ( networkEndpointGroupResource ) . build ( ) ; return insertNetworkEndpointGroup ( request ) ; |
public class StochasticUtils { /** * - - - - - MOMENTS - - - - - */
public static double getMoment ( Collection < Double > values , int degree ) { } } | return getMoments ( values , Arrays . asList ( degree ) ) . get ( degree ) ; |
public class ConnectionResolver { /** * Resolves a single component connection . If connections are configured to be
* retrieved from Discovery service it finds a IDiscovery and resolves the
* connection there .
* @ param correlationId ( optional ) transaction id to trace execution through
* call chain .
* @ ... | if ( _connections . size ( ) == 0 ) return null ; // Return connection that doesn ' t require discovery
for ( ConnectionParams connection : _connections ) { if ( ! connection . useDiscovery ( ) ) return connection ; } // Return connection that require discovery
for ( ConnectionParams connection : _connections ) { if ( ... |
public class Type { /** * Returns the name of the class corresponding to this type .
* @ return the fully qualified name of the class corresponding to this type . */
public String getClassName ( ) { } } | switch ( sort ) { case VOID : return "void" ; case BOOLEAN : return "boolean" ; case CHAR : return "char" ; case BYTE : return "byte" ; case SHORT : return "short" ; case INT : return "int" ; case FLOAT : return "float" ; case LONG : return "long" ; case DOUBLE : return "double" ; case ARRAY : StringBuffer b = new Stri... |
public class DescribeSuggestersResult { /** * The suggesters configured for the domain specified in the request .
* @ return The suggesters configured for the domain specified in the request . */
public java . util . List < SuggesterStatus > getSuggesters ( ) { } } | if ( suggesters == null ) { suggesters = new com . amazonaws . internal . SdkInternalList < SuggesterStatus > ( ) ; } return suggesters ; |
public class GetScheduleRequest { /** * check the parameters for validation .
* @ throws OpsGenieClientValidationException when api key is null ! */
@ Override public void validate ( ) throws OpsGenieClientValidationException { } } | super . validate ( ) ; if ( name == null && id == null ) throw OpsGenieClientValidationException . missingMultipleMandatoryProperty ( OpsGenieClientConstants . API . NAME , OpsGenieClientConstants . API . ID ) ; |
public class JavascriptEngine { /** * ( non - Javadoc )
* @ see javax . script . Invocable # invokeFunction ( java . lang . String ,
* java . lang . Object [ ] ) */
@ Override public Object invokeFunction ( String name , Object ... args ) throws ScriptException , NoSuchMethodException { } } | return ( ( Invocable ) scriptEngine ) . invokeFunction ( name , args ) ; |
public class DeleteFleetRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteFleetRequest deleteFleetRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteFleetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteFleetRequest . getFleetArn ( ) , FLEETARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getM... |
public class UserNameStrValidator { /** * Check that a given string is a well - formed user id .
* @ param value
* Value to check .
* @ return Returns < code > true < / code > if it ' s a valid user id else < code > false < / code > is returned . */
public static final boolean isValid ( final String value ) { } } | if ( value == null ) { return true ; } if ( ( value . length ( ) < 3 ) || ( value . length ( ) > 20 ) ) { return false ; } return PATTERN . matcher ( value . toString ( ) ) . matches ( ) ; |
public class PassthroughResourcesImpl { /** * Issue an HTTP POST request .
* @ param endpoint the API endpoint
* @ param payload a JSON payload string
* @ param parameters optional list of resource parameters
* @ return a JSON response string
* @ throws IllegalArgumentException if any argument is null or empt... | Util . throwIfNull ( payload ) ; return passthroughRequest ( HttpMethod . POST , endpoint , payload , parameters ) ; |
public class ConfigurationAsyncClientBuilder { /** * Sets the credentials to use when authenticating HTTP requests . Also , sets the
* { @ link ConfigurationAsyncClientBuilder # serviceEndpoint ( String ) serviceEndpoint } for this ConfigurationAsyncClientBuilder .
* @ param credentials The credentials to use for a... | Objects . requireNonNull ( credentials ) ; this . credentials = credentials ; this . serviceEndpoint = credentials . baseUri ( ) ; return this ; |
public class AppServiceEnvironmentsInner { /** * Create or update an App Service Environment .
* Create or update an App Service Environment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service Environment .
* @ param hostingEnvironmentE... | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , name , hostingEnvironmentEnvelope ) , serviceCallback ) ; |
public class DateHelper { /** * Creates a timestamp from the equivalent long value . This conversion
* takes account of the time zone and any daylight savings time .
* @ param timestamp timestamp expressed as a long integer
* @ return new Date instance */
public static Date getTimestampFromLong ( long timestamp )... | TimeZone tz = TimeZone . getDefault ( ) ; Date result = new Date ( timestamp - tz . getRawOffset ( ) ) ; if ( tz . inDaylightTime ( result ) == true ) { int savings ; if ( HAS_DST_SAVINGS == true ) { savings = tz . getDSTSavings ( ) ; } else { savings = DEFAULT_DST_SAVINGS ; } result = new Date ( result . getTime ( ) -... |
public class QYWeixinControllerSupport { /** * 绑定微信服务器
* @ param request 请求
* @ return 结果 */
@ RequestMapping ( method = RequestMethod . GET ) @ ResponseBody protected final String bind ( HttpServletRequest request ) { } } | return legalStr ( request ) ; |
public class CommerceOrderNotePersistenceImpl { /** * Returns all the commerce order notes where commerceOrderId = & # 63 ; .
* @ param commerceOrderId the commerce order ID
* @ return the matching commerce order notes */
@ Override public List < CommerceOrderNote > findByCommerceOrderId ( long commerceOrderId ) { ... | return findByCommerceOrderId ( commerceOrderId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class Model { /** * Fires an state change event every time the data model changes */
protected void fireStateChanged ( ) { } } | Object [ ] listeners = LISTENER_LIST . getListenerList ( ) ; // Process the listeners last to first , notifying
// those that are interested in this event
for ( int i = listeners . length - 2 ; i >= 0 ; i -= 2 ) { if ( listeners [ i ] == javax . swing . event . ChangeListener . class ) { if ( changeEvent == null ) { ch... |
public class StreamingJobsInner { /** * Updates an existing streaming job . This can be used to partially update ( ie . update one or two properties ) a streaming job without affecting the rest the job definition .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain ... | return updateWithServiceResponseAsync ( resourceGroupName , jobName , streamingJob , ifMatch ) . map ( new Func1 < ServiceResponseWithHeaders < StreamingJobInner , StreamingJobsUpdateHeaders > , StreamingJobInner > ( ) { @ Override public StreamingJobInner call ( ServiceResponseWithHeaders < StreamingJobInner , Streami... |
public class SamplingRuleMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SamplingRule samplingRule , ProtocolMarshaller protocolMarshaller ) { } } | if ( samplingRule == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( samplingRule . getRuleName ( ) , RULENAME_BINDING ) ; protocolMarshaller . marshall ( samplingRule . getRuleARN ( ) , RULEARN_BINDING ) ; protocolMarshaller . marshall ( sa... |
public class DataDirEntry { /** * Returns the section table entry of the section that the data directory
* entry is pointing to .
* @ param table
* @ return the section table entry of the section that the data directory
* entry is pointing to
* @ throws IllegalStateException
* if data dir entry is not in a ... | Optional < SectionHeader > entry = maybeGetSectionTableEntry ( table ) ; if ( entry . isPresent ( ) ) { return entry . get ( ) ; } throw new IllegalStateException ( "there is no section for this data directory entry" ) ; |
public class VertxCompletableFuture { /** * Creates a new { @ link VertxCompletableFuture } from the given { @ link Vertx } instance and given
* { @ link CompletableFuture } . The returned future uses the current Vert . x context , or creates a new one .
* The created { @ link VertxCompletableFuture } is completed ... | return from ( vertx . getOrCreateContext ( ) , future ) ; |
public class KTypeArrayList { /** * { @ inheritDoc } */
@ Override public int indexOf ( KType e1 ) { } } | for ( int i = 0 ; i < elementsCount ; i ++ ) { if ( Intrinsics . equals ( this , e1 , buffer [ i ] ) ) { return i ; } } return - 1 ; |
public class FullDTDReader { /** * Handling of PE matching problems is actually intricate ; one type
* will be a WFC ( " PE Between Declarations " , which refers to PEs that
* start from outside declarations ) , and another just a VC
* ( " Proper Declaration / PE Nesting " , when PE is contained within
* declar... | // Did it start outside of declaration ?
if ( closing . getScopeId ( ) == 0 ) { // yup
// and being WFC , need not be validating
_reportWFCViolation ( entityDesc ( closing ) + ": " + "Incomplete PE: has to fully contain a declaration (as per xml 1.0.3, section 2.8, WFC 'PE Between Declarations')" ) ; } else { // wherea... |
public class SAMLCredentialPersonAttributeDao { /** * Per AbstractQueryPersonAttributeDao , this method returns " unmapped
* attributes " which are transformed using the resultAttributeMapping
* collection . Use Attribute . name ( rather than Attribute . friendlyName ) in
* these mapping definitions . */
@ Overri... | final String currentUserName = currentUserProvider . getCurrentUserName ( ) ; ; if ( currentUserName == null ) { this . logger . warn ( "A null name was returned by the currentUserProvider, returning null." ) ; return Collections . emptyList ( ) ; } if ( currentUserName . equals ( queryUserName ) ) { if ( this . logger... |
public class SRTServletResponse { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . webcontainer . core . Response # initForNextResponse ( com . ibm . ws . webcontainer . channel . IWCCResponse ) */
public void initForNextResponse ( IResponse resp ) { } } | if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) // 306998.15
logger . entering ( CLASS_NAME , "initForNextResponse" , "resp = " + resp + " [" + this + "]" ) ; if ( resp == null ) { _rawOut . init ( null ) ; _bufferedWriter . clean ( ) ; if ( com . ibm . ej... |
public class GlobalSuffixFinders { /** * Returns the suffix ( plus all of its suffixes , if { @ code allSuffixes } is true ) found by the binary search access
* sequence transformation .
* @ param ceQuery
* the counterexample query
* @ param asTransformer
* the access sequence transformer
* @ param hypOutpu... | int idx = LocalSuffixFinders . findRivestSchapire ( ceQuery , asTransformer , hypOutput , oracle ) ; return suffixesForLocalOutput ( ceQuery , idx , allSuffixes ) ; |
public class Events { /** * Returns this object as a list of common event objects .
* @ param ctx
* In case the XML JAXB unmarshalling is used , you have to pass
* the JAXB context here .
* @ return Converted list . */
public List < CommonEvent > asCommonEvents ( final JAXBContext ctx ) { } } | final List < CommonEvent > list = new ArrayList < CommonEvent > ( ) ; for ( final Event event : events ) { list . add ( event . asCommonEvent ( ctx ) ) ; } return list ; |
public class ConnectionPoolManagerImpl { /** * Gets a named connection pool .
* @ param poolName
* The name of the connection pool .
* @ return The named connection pool .
* @ throws ConnectionPoolNotFoundException
* If the specified connection pool cannot be found . */
public ConnectionPool getPool ( String ... | ConnectionPool connectionPool = null ; try { if ( h_ConnectionPools . containsKey ( poolName ) ) { connectionPool = h_ConnectionPools . get ( poolName ) ; } else { // Error : pool was never initialized or name could not be found
throw new ConnectionPoolNotFoundException ( "Connection pool " + "not found: " + poolName )... |
public class FileSource { /** * { @ inheritDoc } */
@ Override public InputStream stream ( ) { } } | InputStream stream ; try { stream = new FileInputStream ( file ) ; } catch ( FileNotFoundException e ) { stream = new ByteArrayInputStream ( new byte [ 0 ] ) ; } // create buffered stream
stream = new BufferedInputStream ( stream ) ; return stream ; |
public class Cluster { /** * Get all the supervisors on the specified < code > host < / code > .
* @ param host hostname of the supervisor
* @ return the < code > SupervisorDetails < / code > object . */
public List < SupervisorDetails > getSupervisorsByHost ( String host ) { } } | List < String > nodeIds = this . hostToId . get ( host ) ; List < SupervisorDetails > ret = new ArrayList < > ( ) ; if ( nodeIds != null ) { for ( String nodeId : nodeIds ) { ret . add ( this . getSupervisorById ( nodeId ) ) ; } } return ret ; |
public class DOMConfigurator { /** * Used internally to parse a filter element . */
protected void parseFilters ( Element element , Appender appender ) { } } | String clazz = subst ( element . getAttribute ( CLASS_ATTR ) ) ; Filter filter = ( Filter ) OptionConverter . instantiateByClassName ( clazz , Filter . class , null ) ; if ( filter != null ) { PropertySetter propSetter = new PropertySetter ( filter ) ; NodeList children = element . getChildNodes ( ) ; final int length ... |
public class Neighbour { /** * checkForeignSecurityAttributesChanged is called in order to determine
* whether security attributes have changed .
* @ param sub The stored subscription
* @ param foreignSecuredProxy Flag to indicate whether the new proxy sub
* originated from a foreign bus where the home
* bus ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkForeignSecurityAttributesChanged" , new Object [ ] { sub , new Boolean ( foreignSecuredProxy ) , MESubUserId } ) ; boolean attrChanged = false ; if ( foreignSecuredProxy ) { if ( sub . isForeignSecuredProxy ( ) ) { // ... |
public class Handler { /** * Update the add list . Prepare features , add to main list and notify listeners . */
private void updateAdd ( ) { } } | if ( willAdd ) { for ( final Featurable featurable : toAdd ) { featurables . add ( featurable ) ; for ( final HandlerListener listener : listeners ) { listener . notifyHandlableAdded ( featurable ) ; } if ( featurable . hasFeature ( Transformable . class ) ) { final Transformable transformable = featurable . getFeature... |
public class Table { /** * Returns a pivot on this table , where :
* The first column contains unique values from the index column1
* There are n additional columns , one for each unique value in column2
* The values in each of the cells in these new columns are the result of applying the given AggregateFunction ... | return PivotTable . pivot ( this , column1 , column2 , column3 , aggregateFunction ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getEFM ( ) { } } | if ( efmEClass == null ) { efmEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 244 ) ; } return efmEClass ; |
public class ExecutorsUtils { /** * Shutdown an { @ link ExecutorService } gradually , first disabling new task submissions and
* later cancelling existing tasks .
* This method calls { @ link # shutdownExecutorService ( ExecutorService , Optional , long , TimeUnit ) }
* with default timeout time { @ link # EXECU... | shutdownExecutorService ( executorService , logger , EXECUTOR_SERVICE_SHUTDOWN_TIMEOUT , EXECUTOR_SERVICE_SHUTDOWN_TIMEOUT_TIMEUNIT ) ; |
public class CodeBook { /** * returns the number of bits */
int encode ( int a , Buffer b ) { } } | b . write ( codelist [ a ] , c . lengthlist [ a ] ) ; return ( c . lengthlist [ a ] ) ; |
public class DescriptionBuilder { /** * Add a Boolean property
* @ param name name
* @ param defaultValue default
* @ param required true if required
* @ param propTitle optional title
* @ param propDescription optional description
* @ return this builder */
public DescriptionBuilder booleanProperty ( final... | properties . add ( PropertyUtil . bool ( name , propTitle , propDescription , required , defaultValue ) ) ; return this ; |
public class ImageRetinaApiImpl { /** * { @ inheritDoc } */
@ Override public ByteArrayInputStream getImage ( Integer scalar , ImagePlotShape shape , ImageEncoding imageEncoding , Double sparsity , Model model ) throws JsonProcessingException , ApiException { } } | validateRequiredModels ( model ) ; return getImage ( scalar , shape , imageEncoding , sparsity , model . toJson ( ) ) ; |
public class HandleGetter { /** * Generates a getter on the stated field .
* Used by { @ link HandleData } .
* The difference between this call and the handle method is as follows :
* If there is a { @ code lombok . Getter } annotation on the field , it is used and the
* same rules apply ( e . g . warning if th... | if ( hasAnnotation ( Getter . class , fieldNode ) ) { // The annotation will make it happen , so we can skip it .
return ; } createGetterForField ( level , fieldNode , fieldNode , false , lazy , onMethod ) ; |
public class Transfer { /** * Method declaration */
private void saveTable ( ) { } } | if ( tCurrent == null ) { return ; } TransferTable t = tCurrent ; t . Stmts . sSourceTable = tSourceTable . getText ( ) ; t . Stmts . sDestTable = tDestTable . getText ( ) ; t . Stmts . sDestDrop = tDestDrop . getText ( ) ; t . Stmts . sDestCreateIndex = tDestCreateIndex . getText ( ) ; t . Stmts . sDestDropIndex = tDe... |
public class Requests { /** * Create a { @ link SubscribeRequest } with one { @ link SubscribeElement } .
* @ param el the { @ link SubscribeElement } that is added to the new
* { @ link SubscribeRequest } . This can either be { @ link SubscribeUpdate } or
* { @ link SubscribeDelete } .
* @ return the new { @ l... | if ( el == null ) { throw new NullPointerException ( "el is not allowed to be null" ) ; } SubscribeRequest ret = createSubscribeReq ( ) ; ret . addSubscribeElement ( el ) ; return ret ; |
public class SparkStream { /** * Maps the objects in the stream by block using the given function
* @ param < R > the component type of the returning stream
* @ param function the function to use to map objects
* @ return the new stream */
public < R > SparkStream < R > mapPartitions ( @ NonNull SerializableFunct... | return new SparkStream < > ( rdd . mapPartitions ( iterator -> { Configurator . INSTANCE . configure ( configBroadcast . value ( ) ) ; return Cast . as ( function . apply ( iterator ) ) ; } ) ) ; |
public class CorporationApi { /** * Get alliance history Get a list of all the alliances a corporation has
* been a member of - - - This route is cached for up to 3600 seconds
* @ param corporationId
* An EVE corporation ID ( required )
* @ param datasource
* The server name you would like data from ( optiona... | com . squareup . okhttp . Call call = getCorporationsCorporationIdAlliancehistoryValidateBeforeCall ( corporationId , datasource , ifNoneMatch , null ) ; Type localVarReturnType = new TypeToken < List < CorporationAlliancesHistoryResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnTyp... |
public class AnalysisPass { /** * Instantiate all of the detectors in this pass as objects implementing the
* BCEL - only Detector interface . Detectors that do not support this
* interface will not be created . Therefore , new code should use the
* instantiateDetector2sInPass ( ) method , which can support all d... | int count ; count = 0 ; for ( DetectorFactory factory : orderedFactoryList ) { if ( factory . isDetectorClassSubtypeOf ( Detector . class ) ) { count ++ ; } } Detector [ ] detectorList = new Detector [ count ] ; count = 0 ; for ( DetectorFactory factory : orderedFactoryList ) { if ( factory . isDetectorClassSubtypeOf (... |
public class Queue { /** * Return first element of the underlying list and remove it . If no element exists , wait ( max . timeout milliseconds )
* until the queue is filled again .
* @ param timeout
* 0 to disable timeout
* @ return the first queue element
* @ throws TimeoutException
* Thrown if timeout is... | return list . remove ( timeout == 0 ? this . timeout : timeout ) ; |
public class NetWorkCenter { /** * 处理HTTP请求
* 基于org . apache . http . client包做了简单的二次封装
* @ param method HTTP请求类型
* @ param url 请求对应的URL地址
* @ param paramData 请求所带参数 , 目前支持JSON格式的参数
* @ param fileList 需要一起发送的文件列表
* @ param callback 请求收到响应后回调函数 , 参数有2个 , 第一个为resultCode , 即响应码 , 比如200为成功 , 404为不存在 , 500为服务器发生错... | // 如果url没有传入 , 则直接返回
if ( null == url || url . isEmpty ( ) ) { LOG . warn ( "The url is null or empty!!You must give it to me!OK?" ) ; return ; } // 默认期望调用者传入callback函数
boolean haveCallback = true ; /* * 支持不传回调函数 , 只输出一个警告 , 并改变haveCallback标识
* 用于一些不需要后续处理的请求 , 比如只是发送一个心跳包等等 */
if ( null == callback ) { LOG . warn ( ... |
public class SslHandler { /** * Encrypt provided buffer . Encrypted data returned by getOutNetBuffer ( ) .
* @ param src data to encrypt
* @ throws SSLException on errors */
public void encrypt ( ByteBuffer src ) throws SSLException { } } | if ( ! handshakeComplete ) { throw new IllegalStateException ( ) ; } if ( ! src . hasRemaining ( ) ) { if ( outNetBuffer == null ) { outNetBuffer = emptyBuffer ; } return ; } createOutNetBuffer ( src . remaining ( ) ) ; // Loop until there is no more data in src
while ( src . hasRemaining ( ) ) { SSLEngineResult result... |
public class SmartBinder { /** * Cast the named argument to the given type .
* @ param name the name of the argument to cast
* @ param type the type to which that argument will be cast
* @ return a new SmartBinder with the cast applied */
public SmartBinder castArg ( String name , Class < ? > type ) { } } | Signature newSig = signature ( ) . replaceArg ( name , name , type ) ; return new SmartBinder ( this , newSig , binder . cast ( newSig . type ( ) ) ) ; |
public class Timer { /** * toc .
* @ return a long . */
public long toc ( ) { } } | Date end = new Date ( ) ; difference = end . getTime ( ) - start . getTime ( ) ; return difference ; |
public class GetDeploymentRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetDeploymentRequest getDeploymentRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getDeploymentRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getDeploymentRequest . getDeploymentId ( ) , DEPLOYMENTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: ... |
public class SnippetsApi { /** * Removes Snippet .
* < pre > < code > GitLab Endpoint : DELETE / snippets / : id < / code > < / pre >
* @ param snippetId the snippet ID to remove
* @ throws GitLabApiException if any exception occurs */
public void deleteSnippet ( Integer snippetId ) throws GitLabApiException { } ... | if ( snippetId == null ) { throw new RuntimeException ( "snippetId can't be null" ) ; } delete ( Response . Status . NO_CONTENT , null , "snippets" , snippetId ) ; |
public class ArtifactorySearch { /** * Process the Artifactory response .
* @ param dependency the dependency
* @ param conn the HTTP URL Connection
* @ return a list of the Maven Artifact information
* @ throws IOException thrown if there is an I / O error */
protected List < MavenArtifact > processResponse ( ... | final JsonObject asJsonObject ; try ( final InputStreamReader streamReader = new InputStreamReader ( conn . getInputStream ( ) , StandardCharsets . UTF_8 ) ) { asJsonObject = new JsonParser ( ) . parse ( streamReader ) . getAsJsonObject ( ) ; } final JsonArray results = asJsonObject . getAsJsonArray ( "results" ) ; fin... |
public class GeoPackageExtensions { /** * Delete all table extensions for the table within the GeoPackage
* @ param geoPackage
* GeoPackage
* @ param table
* table name */
public static void deleteTableExtensions ( GeoPackageCore geoPackage , String table ) { } } | // Handle deleting any extensions with extra tables here
NGAExtensions . deleteTableExtensions ( geoPackage , table ) ; deleteRTreeSpatialIndex ( geoPackage , table ) ; deleteRelatedTables ( geoPackage , table ) ; deleteGriddedCoverage ( geoPackage , table ) ; deleteSchema ( geoPackage , table ) ; deleteMetadata ( geoP... |
public class JQMWidget { /** * Complimentary to setDataFilter ( ) . Sets filter search text of associated JQMFilterable widget . */
public void setFilterSearchText ( String value ) { } } | Element elt = getFilterSearchElt ( ) ; if ( elt == null ) return ; refreshFilterSearch ( elt , value ) ; |
public class MBeanGroup { /** * Extract a metric group name from a JMX ObjectName .
* @ param obj _ name a JMX object name from which to derive a metric name .
* @ param resolvedMap a resolver map to use when generating the group name .
* @ return A metric name for the given ObjectName , with tags . */
private st... | String name = obj_name . getKeyProperty ( "name" ) ; String type = obj_name . getKeyProperty ( "type" ) ; String domain = obj_name . getDomain ( ) ; Map < String , MetricValue > tags = obj_name . getKeyPropertyList ( ) . entrySet ( ) . stream ( ) . filter ( ( entry ) -> ! entry . getKey ( ) . equals ( "name" ) ) . filt... |
public class Tokenizer { /** * Gets the next token from a tokenizer and parses it as if it were a TTL .
* @ return The next token in the stream , as an unsigned 32 bit integer .
* @ throws TextParseException The input was not valid .
* @ throws IOException An I / O error occurred .
* @ see TTL */
public long ge... | String next = _getIdentifier ( "a TTL-like value" ) ; try { return TTL . parse ( next , false ) ; } catch ( NumberFormatException e ) { throw exception ( "expected a TTL-like value" ) ; } |
public class Database { /** * Finds a unique result from database , converting the database row to given class using default mechanisms .
* @ throws NonUniqueResultException if there is more then one row
* @ throws EmptyResultException if there are no rows */
public < T > T findUnique ( @ NotNull Class < T > cl , @... | return executeQuery ( rowMapperForClass ( cl ) . unique ( ) , query ) ; |
public class UPropertyAliases { /** * " pnam " */
private void load ( ByteBuffer bytes ) throws IOException { } } | // dataVersion = ICUBinary . readHeaderAndDataVersion ( bytes , DATA _ FORMAT , IS _ ACCEPTABLE ) ;
ICUBinary . readHeader ( bytes , DATA_FORMAT , IS_ACCEPTABLE ) ; int indexesLength = bytes . getInt ( ) / 4 ; // inIndexes [ IX _ VALUE _ MAPS _ OFFSET ] / 4
if ( indexesLength < 8 ) { // formatVersion 2 initially has 8 ... |
public class ActionBuilderImpl { /** * Converts the first character to lower case .
* @ param s the string to convert .
* @ return the converted string . */
private static String lcFirst ( String s ) { } } | if ( s == null || s . isEmpty ( ) ) { return s ; } return Character . toLowerCase ( s . charAt ( 0 ) ) + ( s . length ( ) == 1 ? "" : s . substring ( 1 ) ) ; |
public class PixelTools { /** * Returns true if the colors of all pixels in the array are within the given tolerance
* compared to the referenced color */
public static boolean colorMatches ( Color color , int tolerance , Pixel [ ] pixels ) { } } | if ( tolerance < 0 || tolerance > 255 ) throw new RuntimeException ( "Tolerance value must be between 0 and 255 inclusive" ) ; if ( tolerance == 0 ) return uniform ( color , pixels ) ; else return approx ( color , tolerance , pixels ) ; |
public class GenerateDataKeyWithoutPlaintextRequest { /** * A set of key - value pairs that represents additional authenticated data .
* For more information , see < a
* href = " http : / / docs . aws . amazon . com / kms / latest / developerguide / encryption - context . html " > Encryption Context < / a > in the ... | setEncryptionContext ( encryptionContext ) ; return this ; |
public class TextClassifier { /** * Generates a Dataframe with the predictions for the provided data file .
* The data file should contain the text of one observation per row .
* @ param datasetURI
* @ return */
public Dataframe predict ( URI datasetURI ) { } } | // create a dummy dataset map
Map < Object , URI > dataset = new HashMap < > ( ) ; dataset . put ( null , datasetURI ) ; TrainingParameters trainingParameters = ( TrainingParameters ) knowledgeBase . getTrainingParameters ( ) ; Dataframe testDataset = Dataframe . Builder . parseTextFiles ( dataset , AbstractTextExtract... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.