signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DefaultGroovyMethods { /** * Selects the item in the iterable which when passed as a parameter to the supplied closure returns the
* maximum value . A null return value represents the least possible return value , so any item for which
* the supplied closure returns null , won ' t be selected ( unless ... | int params = closure . getMaximumNumberOfParameters ( ) ; if ( params != 1 ) { return max ( self , new ClosureComparator < T > ( closure ) ) ; } boolean first = true ; T answer = null ; Object answerValue = null ; for ( T item : self ) { Object value = closure . call ( item ) ; if ( first ) { first = false ; answer = i... |
public class Validate { /** * Method without varargs to increase performance */
public static < T > Class < T > isAssignableFrom ( final Class < ? > superType , final Class < T > type , final String message ) { } } | return INSTANCE . isAssignableFrom ( superType , type , message ) ; |
public class NoteEditor { /** * GEN - LAST : event _ labelWrapModeMouseClicked */
private void updateWrapping ( ) { } } | this . editorPane . setWrapStyleWord ( this . wrapping != Wrapping . CHAR_WRAP ) ; this . editorPane . setLineWrap ( this . wrapping != Wrapping . NONE ) ; updateBottomPanel ( ) ; |
public class SenderManager { /** * Mark the message as sent
* @ param messageID the message ID
* @ return return true if * this * member is in destination set */
public boolean markSent ( MessageID messageID ) { } } | MessageInfo messageInfo = sentMessages . remove ( messageID ) ; return messageInfo != null && messageInfo . toSelfDeliver ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */
@ XmlElementDecl... | return new JAXBElement < Object > ( __GenericApplicationPropertyOfRailway_QNAME , Object . class , null , value ) ; |
public class DataFramePrinter { /** * Returns a whitespace string of the length specified
* @ param length the length for whitespace */
private static void whitespace ( StringBuilder text , int length ) { } } | IntStream . range ( 0 , length ) . forEach ( i -> text . append ( " " ) ) ; |
public class CmsWorkplace { /** * Sends a http redirect to the specified URI in the OpenCms VFS . < p >
* @ param location the location the response is redirected to
* @ throws IOException in case redirection fails */
public void sendCmsRedirect ( String location ) throws IOException { } } | // TOOD : IBM Websphere v5 has problems here , use forward instead ( which has other problems )
getJsp ( ) . getResponse ( ) . sendRedirect ( OpenCms . getSystemInfo ( ) . getOpenCmsContext ( ) + location ) ; |
public class Validate { /** * Checks if the given file exists and is not a directory .
* @ param file The file to validate .
* @ return The validated file reference .
* @ throws ParameterException if the file exists or is a directory . */
public static File noDirectory ( File file ) { } } | Validate . exists ( file ) ; if ( file . isDirectory ( ) ) throw new ParameterException ( "\"" + file + "\" is a directory!" ) ; return file ; |
public class SingleTermDocs { /** * { @ inheritDoc } */
public int read ( int [ ] docs , int [ ] freqs ) throws IOException { } } | if ( next && docs . length > 0 ) { docs [ 0 ] = doc ; freqs [ 0 ] = 1 ; next = false ; return 1 ; } return 0 ; |
public class TypeUtils { /** * < p > Gets the type arguments of a class / interface based on a subtype . For
* instance , this method will determine that both of the parameters for the
* interface { @ link Map } are { @ link Object } for the subtype
* { @ link java . util . Properties Properties } even though the... | return getTypeArguments ( type , toClass , null ) ; |
public class CommandInterceptor { /** * The default behaviour of the visitXXX methods , which is to ignore the call and pass the call up to the next
* interceptor in the chain .
* @ param ctx invocation context
* @ param command command to invoke
* @ return return value
* @ throws Throwable in the event of pr... | return invokeNextInterceptor ( ctx , command ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcDirectionSenseEnum createIfcDirectionSenseEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcDirectionSenseEnum result = IfcDirectionSenseEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class IteratorPool { /** * Get an instance of the given object in this pool
* @ return An instance of the given object */
public synchronized DTMIterator getInstanceOrThrow ( ) throws CloneNotSupportedException { } } | // Check if the pool is empty .
if ( m_freeStack . isEmpty ( ) ) { // Create a new object if so .
return ( DTMIterator ) m_orig . clone ( ) ; } else { // Remove object from end of free pool .
DTMIterator result = ( DTMIterator ) m_freeStack . remove ( m_freeStack . size ( ) - 1 ) ; return result ; } |
public class URLRewriterService { /** * This method will return two bits of information that are used by components that want run through
* the AJAX facilities . The < code > AjaxUrlInfo < / code > class is returned and specifies this information . Unlike
* the other URLRewriter method , this is a true Chain of Res... | ArrayList /* < URLRewriter > */
rewriters = getRewriters ( request ) ; if ( rewriters != null ) { for ( Iterator i = rewriters . iterator ( ) ; i . hasNext ( ) ; ) { URLRewriter rewriter = ( URLRewriter ) i . next ( ) ; AjaxUrlInfo info = rewriter . getAjaxUrl ( servletContext , request , nameable ) ; if ( info != null... |
public class TrellisHttpResource { /** * Perform an OPTIONS operation on an LDP Resource .
* @ param response the async response
* @ param uriInfo the URI info
* @ param headers the HTTP headers
* @ param request the request */
@ OPTIONS @ Timed public void options ( @ Suspended final AsyncResponse response , @... | final TrellisRequest req = new TrellisRequest ( request , uriInfo , headers ) ; final String urlBase = getBaseUrl ( req ) ; final IRI identifier = rdf . createIRI ( TRELLIS_DATA_PREFIX + req . getPath ( ) ) ; final OptionsHandler optionsHandler = new OptionsHandler ( req , trellis , req . getVersion ( ) != null , urlBa... |
public class Configuration { /** * Creates a configuration with the same content as this instance , but
* with the specified identifier .
* @ param identifier the new identifier
* @ return a new configuration */
Configuration copyWithIdentifier ( String identifier ) { } } | return new Configuration ( details . builder ( ) . identifier ( identifier ) . build ( ) , new HashMap < > ( config ) ) ; |
public class GoogleHadoopFileSystem { /** * Sets and validates the root bucket . */
@ Override @ VisibleForTesting protected void configureBuckets ( GoogleCloudStorageFileSystem gcsFs ) throws IOException { } } | rootBucket = initUri . getAuthority ( ) ; checkArgument ( rootBucket != null , "No bucket specified in GCS URI: %s" , initUri ) ; // Validate root bucket name
pathCodec . getPath ( rootBucket , /* objectName = */
null , /* allowEmptyObjectName = */
true ) ; logger . atFine ( ) . log ( "GHFS.configureBuckets: GoogleHado... |
public class LambdaDataSourceConfigMarshaller { /** * Marshall the given parameter object . */
public void marshall ( LambdaDataSourceConfig lambdaDataSourceConfig , ProtocolMarshaller protocolMarshaller ) { } } | if ( lambdaDataSourceConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( lambdaDataSourceConfig . getLambdaFunctionArn ( ) , LAMBDAFUNCTIONARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall req... |
public class ObjectMappableAnnotatedClass { /** * Scans the class for annotated fields . Also scans inheritance hierarchy .
* @ throws ProcessingException */
public void scanForAnnotatedFields ( Types typeUtils , Elements elementUtils ) throws ProcessingException { } } | // Scan inheritance hierarchy recursively to find all annotated fields
TypeElement currentClass = typeElement ; TypeMirror superClassType ; Column annotation = null ; PackageElement originPackage = elementUtils . getPackageOf ( typeElement ) ; PackageElement superClassPackage ; Set < VariableElement > annotatedFields =... |
public class ReentrantLock { /** * Returns a collection containing those threads that may be
* waiting on the given condition associated with this lock .
* Because the actual set of threads may change dynamically while
* constructing this result , the returned collection is only a
* best - effort estimate . The... | if ( condition == null ) throw new NullPointerException ( ) ; if ( ! ( condition instanceof AbstractQueuedSynchronizer . ConditionObject ) ) throw new IllegalArgumentException ( "not owner" ) ; return sync . getWaitingThreads ( ( AbstractQueuedSynchronizer . ConditionObject ) condition ) ; |
public class ParosTableContext { /** * / * ( non - Javadoc )
* @ see org . parosproxy . paros . db . paros . TableContext # getAllData ( ) */
@ Override public List < RecordContext > getAllData ( ) throws DatabaseException { } } | try { List < RecordContext > result = new ArrayList < > ( ) ; try ( ResultSet rs = psGetAllData . executeQuery ( ) ) { while ( rs . next ( ) ) { result . add ( new RecordContext ( rs . getLong ( DATAID ) , rs . getInt ( CONTEXTID ) , rs . getInt ( TYPE ) , rs . getString ( DATA ) ) ) ; } } return result ; } catch ( SQL... |
public class MaterialAPI { /** * 获取素材列表
* @ param type 素材类型
* @ param offset 从全部素材的该偏移位置开始返回 , 0表示从第一个素材 返回
* @ param count 返回素材的数量 , 取值在1到20之间
* @ return 素材列表结果 */
public GetMaterialListResponse batchGetMaterial ( MaterialType type , int offset , int count ) { } } | if ( offset < 0 ) offset = 0 ; if ( count > 20 ) count = 20 ; if ( count < 1 ) count = 1 ; GetMaterialListResponse response = null ; String url = BASE_API_URL + "cgi-bin/material/batchget_material?access_token=#" ; final Map < String , Object > params = new HashMap < String , Object > ( 4 , 1 ) ; params . put ( "type" ... |
public class CmsResourceTypeJsp { /** * Returns a set of root paths of files that are including the given resource using the ' link . strong ' macro . < p >
* @ param cms the current cms context
* @ param resource the resource to check
* @ return the set of referencing paths
* @ throws CmsException if something... | Set < String > references = new HashSet < String > ( ) ; if ( m_jspLoader == null ) { return references ; } m_jspLoader . getReferencingStrongLinks ( cms , resource , references ) ; return references ; |
public class JsonRequestLog { /** * Provides a hook whereby an alternate source can be provided for grabbing the requestId */
protected UUID getRequestIdFrom ( Request request , Response response ) { } } | return optUuid ( response . getHeader ( OTHeaders . REQUEST_ID ) ) ; |
public class Get { /** * A map of attribute names to < code > AttributeValue < / code > objects that specifies the primary key of the item to
* retrieve .
* @ param key
* A map of attribute names to < code > AttributeValue < / code > objects that specifies the primary key of the item
* to retrieve .
* @ retur... | setKey ( key ) ; return this ; |
public class BackupController { /** * Set client server configuration and overrides according to backup
* @ param fileData File containing profile overrides and server configuration
* @ param profileIdentifier Profile to update for client
* @ param clientUUID Client to apply overrides to
* @ param odoImport Par... | int profileID = ControllerUtils . convertProfileIdentifier ( profileIdentifier ) ; if ( ! fileData . isEmpty ( ) ) { try { // Read in file
InputStream inputStream = fileData . getInputStream ( ) ; BufferedReader bufferedReader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; String singleLine ; String f... |
public class Journal { /** * Recover the local journal storage . */
private void recoverJournal ( StartupOption startOpt ) throws IOException { } } | LOG . info ( "Recovering journal " + this . getJournalId ( ) ) ; journalStorage . recover ( startOpt ) ; |
public class FastDateFormat { /** * 获得 { @ link FastDateFormat } 实例 < br >
* 支持缓存
* @ param style time style : FULL , LONG , MEDIUM , or SHORT
* @ param timeZone optional time zone , overrides time zone of formatted time
* @ return 本地化 { @ link FastDateFormat } */
public static FastDateFormat getTimeInstance ( ... | return cache . getTimeInstance ( style , timeZone , null ) ; |
public class ClusterSampling { /** * Calculate the mean from the sample
* @ param sampleDataCollection
* @ return */
public static double mean ( TransposeDataCollection sampleDataCollection ) { } } | double mean = 0.0 ; int totalSampleN = 0 ; for ( Map . Entry < Object , FlatDataCollection > entry : sampleDataCollection . entrySet ( ) ) { mean += Descriptives . sum ( entry . getValue ( ) ) ; totalSampleN += entry . getValue ( ) . size ( ) ; } mean /= totalSampleN ; return mean ; |
public class NetworkClient { /** * Patches the specified network with the data included in the request . Only the following fields
* can be modified : routingConfig . routingMode .
* < p > Sample code :
* < pre > < code >
* try ( NetworkClient networkClient = NetworkClient . create ( ) ) {
* ProjectGlobalNetw... | PatchNetworkHttpRequest request = PatchNetworkHttpRequest . newBuilder ( ) . setNetwork ( network == null ? null : network . toString ( ) ) . setNetworkResource ( networkResource ) . addAllFieldMask ( fieldMask ) . build ( ) ; return patchNetwork ( request ) ; |
public class EmoTableAllTablesReportDAO { /** * Updates the metadata associated with the report . */
@ Override public void updateReport ( AllTablesReportDelta delta ) { } } | checkNotNull ( delta , "delta" ) ; updateMetadata ( delta ) ; if ( delta . getTable ( ) . isPresent ( ) ) { updateTableData ( delta , delta . getTable ( ) . get ( ) ) ; } |
public class OidcAuthorizationRequestSupport { /** * Is authentication profile available ? .
* @ param context the context
* @ return the optional user profile */
public static Optional < CommonProfile > isAuthenticationProfileAvailable ( final J2EContext context ) { } } | val manager = new ProfileManager < > ( context , context . getSessionStore ( ) ) ; return manager . get ( true ) ; |
public class ConfigClient { /** * Gets a sink .
* < p > Sample code :
* < pre > < code >
* try ( ConfigClient configClient = ConfigClient . create ( ) ) {
* SinkName sinkName = ProjectSinkName . of ( " [ PROJECT ] " , " [ SINK ] " ) ;
* LogSink response = configClient . getSink ( sinkName ) ;
* < / code > <... | GetSinkRequest request = GetSinkRequest . newBuilder ( ) . setSinkName ( sinkName == null ? null : sinkName . toString ( ) ) . build ( ) ; return getSink ( request ) ; |
public class PipelineApi { /** * Get single pipelines in a project .
* < pre > < code > GitLab Endpoint : GET / projects / : id / pipelines / : pipeline _ id < / code > < / pre >
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
* @ param pipelineId the... | Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "pipelines" , pipelineId ) ; return ( response . readEntity ( Pipeline . class ) ) ; |
public class StaticFieldELResolver { /** * < p > Inquires whether the static field is writable . < / p >
* < p > If the base object is an instance of < code > ELClass < / code > and the
* property is a String ,
* the < code > propertyResolved < / code > property of the
* < code > ELContext < / code > object mus... | if ( context == null ) { throw new NullPointerException ( ) ; } if ( base instanceof ELClass && property instanceof String ) { Class < ? > klass = ( ( ELClass ) base ) . getKlass ( ) ; context . setPropertyResolved ( true ) ; } return true ; |
public class LBiObjDblConsumerBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < T1 , T2 > LBiObjDblConsumerBuilder < T1 , T2 > biObjDblConsumer ( Consumer < LBi... | return new LBiObjDblConsumerBuilder ( consumer ) ; |
public class FrameDataflowAnalysis { /** * Get the dataflow fact representing the point just before given Location .
* Note " before " is meant in the logical sense , so for backward analyses ,
* before means after the location in the control flow sense .
* @ return the fact at the point just before the location ... | FrameType result = createFact ( ) ; makeFactTop ( result ) ; for ( Location loc : cfg . getLocationsContainingInstructionWithOffset ( pc ) ) { BasicBlock b = loc . getBasicBlock ( ) ; BasicBlock b2 = null ; if ( b . getFirstInstruction ( ) != null && b . getFirstInstruction ( ) . getPosition ( ) == pc ) { b2 = cfg . ge... |
public class AtomicBiInteger { /** * Sets the hi value into the given encoded value .
* @ param encoded the encoded value
* @ param hi the hi value
* @ return the new encoded value */
public static long encodeHi ( long encoded , int hi ) { } } | long h = ( ( long ) hi ) & 0xFFFF_FFFFL ; long l = encoded & 0xFFFF_FFFFL ; return ( h << 32 ) + l ; |
public class SelfExtractor { /** * Release the jar file and null instance so that it can be deleted */
public String close ( ) { } } | if ( instance == null ) { return null ; } try { container . close ( ) ; instance = null ; } catch ( IOException e ) { return e . getMessage ( ) ; } return null ; |
public class RaygunClient { /** * Sends an exception - type object to Raygun with a list of tags you specify , and a set of
* custom data .
* @ param throwable The Throwable object that occurred in your application that will be sent to Raygun .
* @ param tags A list of data that will be attached to the Raygun mes... | RaygunMessage msg = buildMessage ( throwable ) ; if ( msg == null ) { RaygunLogger . e ( "Failed to send RaygunMessage - due to invalid message being built" ) ; return ; } msg . getDetails ( ) . setTags ( RaygunUtils . mergeLists ( RaygunClient . tags , tags ) ) ; msg . getDetails ( ) . setUserCustomData ( RaygunUtils ... |
public class SimpleBeanBoundTableDataModel { /** * { @ inheritDoc } */
@ Override public Object getValueAt ( final int row , final int col ) { } } | Object data = getBean ( ) ; Object bean = null ; if ( data instanceof Object [ ] ) { bean = ( ( Object [ ] ) data ) [ row ] ; } else if ( data instanceof List ) { bean = ( ( List ) data ) . get ( row ) ; } String property = properties [ col ] ; if ( bean != null ) { if ( "." . equals ( property ) ) { return bean ; } el... |
public class DwgArc { /** * Read an Arc in the DWG format Version 15
* @ param data Array of unsigned bytes obtained from the DWG binary file
* @ param offset The current bit offset where the value begins
* @ throws Exception If an unexpected bit value is found in the DWG file . Occurs
* when we are looking for... | // System . out . println ( " readDwgArc ( ) executed . . . " ) ;
int bitPos = offset ; bitPos = readObjectHeaderV15 ( data , bitPos ) ; Vector v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double x = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; v = DwgUtil .... |
public class FragmentBuilder { /** * This method returns the data associated with the out
* buffer and resets the buffer to be inactive .
* @ param hashCode The hash code , or - 1 to ignore the hash code
* @ return The data */
public byte [ ] getOutData ( int hashCode ) { } } | if ( outStream != null && ( hashCode == - 1 || hashCode == outHashCode ) ) { try { outStream . close ( ) ; } catch ( IOException e ) { log . severe ( "Failed to close out data stream: " + e ) ; } byte [ ] b = outStream . toByteArray ( ) ; outStream = null ; return b ; } return null ; |
public class BaseWindowedBolt { /** * define a sliding count window
* @ param size count size
* @ param slide slide size */
public BaseWindowedBolt < T > countWindow ( long size , long slide ) { } } | ensurePositiveTime ( size , slide ) ; ensureSizeGreaterThanSlide ( size , slide ) ; setSizeAndSlide ( size , slide ) ; this . windowAssigner = SlidingCountWindows . create ( size , slide ) ; return this ; |
public class TemplatingManager { /** * Updates the template watcher after a change in the templating manager configuration . */
private void resetWatcher ( ) { } } | // Stop the current watcher .
stopWatcher ( ) ; // Update the template & target directories , based on the provided configuration directory .
if ( this . templatesDIR == null ) { this . logger . warning ( "The templates directory was not specified. DM templating is temporarily disabled." ) ; } else if ( this . outputDI... |
public class JDlgDBConnection { /** * GEN - LAST : event _ pbCancelActionPerformed */
private void pbConnectActionPerformed ( java . awt . event . ActionEvent evt ) // GEN - FIRST : event _ pbConnectActionPerformed
{ } } | // GEN - HEADEREND : event _ pbConnectActionPerformed
// Add your handling code here :
mainFrame . setProperty ( JFrmMainFrame . JDBC_DRIVER , tfJDBCDriver . getText ( ) ) ; mainFrame . setProperty ( JFrmMainFrame . JDBC_URL , tfJDBCURL . getText ( ) ) ; mainFrame . setProperty ( JFrmMainFrame . JDBC_USER , tfUsername ... |
public class JsJmsMapMessageImpl { /** * Provide an estimate of encoded length of the payload */
int guessPayloadLength ( ) { } } | int length = 0 ; // Total guess at average size of map entry
try { Map < String , Object > payload = getBodyMap ( ) ; length = payload . size ( ) * 60 ; } catch ( UnsupportedEncodingException e ) { // No FFDC code needed
// hmm . . . how do we figure out a reasonable length
} return length ; |
public class JobConfigurationUtils { /** * Put all configuration properties in a given { @ link Properties } object into a given
* { @ link Configuration } object .
* @ param properties the given { @ link Properties } object
* @ param configuration the given { @ link Configuration } object */
public static void p... | for ( String name : properties . stringPropertyNames ( ) ) { configuration . set ( name , properties . getProperty ( name ) ) ; } |
public class ClientEntry { /** * Convenience method to get first content object in content collection . Atom 1.0 allows only
* one content element per entry . */
public Content getContent ( ) { } } | if ( getContents ( ) != null && ! getContents ( ) . isEmpty ( ) ) { final Content c = getContents ( ) . get ( 0 ) ; return c ; } return null ; |
public class WhiteboxImpl { /** * Create a new instance of a class without invoking its constructor .
* No byte - code manipulation is needed to perform this operation and thus
* it ' s not necessary use the { @ code PowerMockRunner } or
* { @ code PrepareForTest } annotation to use this functionality .
* @ par... | int modifiers = classToInstantiate . getModifiers ( ) ; final Object object ; if ( Modifier . isInterface ( modifiers ) ) { object = Proxy . newProxyInstance ( WhiteboxImpl . class . getClassLoader ( ) , new Class < ? > [ ] { classToInstantiate } , new InvocationHandler ( ) { @ Override public Object invoke ( Object pr... |
public class PluralRulesLoader { /** * Returns the plural rules for the the locale . If we don ' t have data ,
* android . icu . text . PluralRules . DEFAULT is returned . */
public PluralRules forLocale ( ULocale locale , PluralRules . PluralType type ) { } } | String rulesId = getRulesIdForLocale ( locale , type ) ; if ( rulesId == null || rulesId . trim ( ) . length ( ) == 0 ) { return PluralRules . DEFAULT ; } PluralRules rules = getRulesForRulesId ( rulesId ) ; if ( rules == null ) { rules = PluralRules . DEFAULT ; } return rules ; |
public class FSAConfiguration { /** * check validation for appPath property , first check if the path is exist and then if this path is not a directory */
private boolean checkAppPathsForVia ( Set < String > keySet , List < String > errors ) { } } | for ( String key : keySet ) { if ( ! key . equals ( "defaultKey" ) ) { File file = new File ( key ) ; if ( ! file . exists ( ) ) { errors . add ( "Effective Usage Analysis will not run if the -appPath parameter references an invalid file path. Check that the -appPath parameter specifies a valid path" ) ; return false ;... |
public class FeatureScopes { /** * Create a composite scope that returns description from multiple other scopes without applying shadowing semantics to then . */
protected CompositeScope createCompositeScope ( EObject featureCall , IScope parent , IFeatureScopeSession session ) { } } | return new CompositeScope ( parent , session , asAbstractFeatureCall ( featureCall ) ) ; |
public class A_CmsListDialog { /** * A convenient method to throw a list unsupported
* action runtime exception . < p >
* Should be triggered if your list implementation does not
* support the < code > { @ link # getParamListAction ( ) } < / code >
* action . < p >
* @ throws CmsRuntimeException always to sig... | throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_LIST_UNSUPPORTED_ACTION_2 , getList ( ) . getName ( ) . key ( getLocale ( ) ) , getParamListAction ( ) ) ) ; |
public class Preconditions { /** * Tests the supplied object to see if it is not a type of the supplied class .
* @ param type the type that is not of the supplied class .
* @ param object the object tested against the type .
* @ param errorMessage the errorMessage
* @ return the object argument .
* @ throws ... | isNotNull ( type , "type" ) ; if ( type . isInstance ( object ) ) { throw new IllegalArgumentException ( errorMessage ) ; } return object ; |
public class ReadFileExtFunction { /** * / * ( non - Javadoc )
* @ see com . ibm . jaggr . core . config . IConfigListener # configLoaded ( com . ibm . jaggr . core . config . IConfig , long ) */
@ Override public void configLoaded ( IConfig config , long sequence ) { } } | final String sourceMethod = "configLoaded" ; // $ NON - NLS - 1 $
final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { aggregator } ) ; } // update the config property
isIncludeAMDPaths = TypeUtil . asBoolean ( config ... |
public class TracerFactory { /** * Takes the tracer from the head of the deque . If the deque is empty the methods blocks until a tracer will become available . By default a
* QueueTracer wrapping a NullTracer will be ( non - blocking ) delivered .
* @ return the tracer from the head of the deque */
public QueueTra... | this . queueReadLock . lock ( ) ; try { QueueTracer < ? > tracer ; if ( this . queueConfig . enabled ) { try { tracer = this . queueConfig . blockingTracerDeque . takeFirst ( ) ; // this . queueConfig . tracerMap . put ( Thread . currentThread ( ) , tracer ) ;
this . queueConfig . currentTracer . set ( tracer ) ; } cat... |
public class BoundingBox { /** * give max rectangle */
public Rectangle getMaxRectabgle ( ) { } } | return new Rectangle ( ( int ) xLB . max , ( int ) yLB . max , ( int ) ( xUB . max - xLB . max ) , ( int ) ( yUB . max - yLB . max ) ) ; |
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 533:1 : entryRuleXAdditiveExpression : ruleXAdditiveExpression EOF ; */
public final void entryRuleXAdditiveExpression ( ) throws RecognitionException { } } | try { // InternalXbaseWithAnnotations . g : 534:1 : ( ruleXAdditiveExpression EOF )
// InternalXbaseWithAnnotations . g : 535:1 : ruleXAdditiveExpression EOF
{ if ( state . backtracking == 0 ) { before ( grammarAccess . getXAdditiveExpressionRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; ruleXAdditiveExpression ( ) ; state .... |
public class DDLStatement { /** * Is DDL statement .
* @ param primaryTokenType primary token type
* @ param secondaryTokenType secondary token type
* @ return is DDL or not */
public static boolean isDDL ( final TokenType primaryTokenType , final TokenType secondaryTokenType ) { } } | return PRIMARY_STATEMENT_PREFIX . contains ( primaryTokenType ) && ! NOT_SECONDARY_STATEMENT_PREFIX . contains ( secondaryTokenType ) ; |
public class Searcher { /** * Links the given listener to the Searcher , which will forward new search results to it .
* @ param resultListener an object implementing { @ link AlgoliaResultsListener } . */
public Searcher registerResultListener ( @ NonNull AlgoliaResultsListener resultListener ) { } } | if ( ! resultListeners . contains ( resultListener ) ) { resultListeners . add ( resultListener ) ; } return this ; |
public class LayoutInflater { /** * Resolve ids for given name in each package ( android and application ) and then call { @ link # register ( int , int ) } */
public static void register ( Context context , String name ) { } } | final Resources res = context . getResources ( ) ; int androidId = res . getIdentifier ( name , "layout" , "android" ) ; int appId = res . getIdentifier ( name , "layout" , context . getPackageName ( ) ) ; if ( androidId != 0 && appId != 0 ) { register ( androidId , appId ) ; } else { HoloEverywhere . warn ( "Failed to... |
public class AjaxBehavior { /** * a String [ ] ( multiple elements . */
private static Object saveList ( List < String > list ) { } } | if ( ( list == null ) || list . isEmpty ( ) ) { return null ; } int size = list . size ( ) ; if ( size == 1 ) { return list . get ( 0 ) ; } return list . toArray ( new String [ size ] ) ; |
public class PreferenceActivity { /** * Returns a listener , which allows to finish the last step , when the activity is used as a
* wizard .
* @ return The listener , which has been created , as an instance of the type { @ link
* View . OnClickListener } . The listener may not be null */
@ NonNull private View .... | return new View . OnClickListener ( ) { @ Override public void onClick ( final View v ) { notifyOnFinish ( ) ; } } ; |
public class CheckSideEffects { /** * Protect side - effect free nodes by making them parameters
* to a extern function call . This call will be removed
* after all the optimizations passes have run . */
private void protectSideEffects ( ) { } } | if ( ! problemNodes . isEmpty ( ) ) { if ( ! preserveFunctionInjected ) { addExtern ( compiler ) ; } for ( Node n : problemNodes ) { Node name = IR . name ( PROTECTOR_FN ) . srcref ( n ) ; name . putBooleanProp ( Node . IS_CONSTANT_NAME , true ) ; Node replacement = IR . call ( name ) . srcref ( n ) ; replacement . put... |
public class GeneratorRegistry { /** * Returns the variant types for a generated resource
* @ param path
* the path
* @ return he variant types for a generated resource */
public Set < String > getGeneratedResourceVariantTypes ( String path ) { } } | Set < String > variantTypes = new HashSet < > ( ) ; ResourceGenerator generator = resolveResourceGenerator ( path ) ; if ( generator != null ) { if ( generator instanceof VariantResourceGenerator ) { Set < String > tempResult = ( ( VariantResourceGenerator ) generator ) . getAvailableVariants ( generator . getResolver ... |
public class HazelcastClient { /** * Shuts down all the client HazelcastInstance created in this JVM .
* To be more precise it shuts down the HazelcastInstances loaded using the same classloader this HazelcastClient has been
* loaded with .
* This method is mostly used for testing purposes .
* @ see # getAllHaz... | for ( HazelcastClientProxy proxy : CLIENTS . values ( ) ) { HazelcastClientInstanceImpl client = proxy . client ; if ( client == null ) { continue ; } proxy . client = null ; try { client . shutdown ( ) ; } catch ( Throwable ignored ) { EmptyStatement . ignore ( ignored ) ; } } OutOfMemoryErrorDispatcher . clearClients... |
public class SymbolizerFilterVisitor { /** * Overridden to skip some symbolizers . */
@ Override public void visit ( Rule rule ) { } } | Rule copy = null ; Filter filterCopy = null ; if ( rule . getFilter ( ) != null ) { Filter filter = rule . getFilter ( ) ; filterCopy = copy ( filter ) ; } List < Symbolizer > symsCopy = new ArrayList < Symbolizer > ( ) ; for ( Symbolizer sym : rule . symbolizers ( ) ) { if ( ! skipSymbolizer ( sym ) ) { Symbolizer sym... |
public class VisibleMemberMap { /** * Return the visible members of the class being mapped . Also append at the
* end of the list members that are inherited by inaccessible parents . We
* document these members in the child because the parent is not documented .
* @ param configuration the current configuration o... | List < ProgramElementDoc > result = getMembersFor ( classdoc ) ; result . addAll ( getInheritedPackagePrivateMethods ( configuration ) ) ; return result ; |
public class WindowedStream { /** * Applies the given window function to each window . The window function is called for each
* evaluation of the window for each key individually . The output of the window function is
* interpreted as a regular non - windowed stream .
* < p > Arriving data is incrementally aggreg... | TypeInformation < ACC > foldAccumulatorType = TypeExtractor . getFoldReturnTypes ( foldFunction , input . getType ( ) , Utils . getCallLocationName ( ) , true ) ; TypeInformation < R > resultType = getWindowFunctionReturnType ( function , foldAccumulatorType ) ; return fold ( initialValue , foldFunction , function , fo... |
public class AppServiceEnvironmentsInner { /** * Get all worker pools of an App Service Environment .
* Get all worker pools of an App Service Environment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service Environment .
* @ throws Ille... | return listWorkerPoolsSinglePageAsync ( resourceGroupName , name ) . concatMap ( new Func1 < ServiceResponse < Page < WorkerPoolResourceInner > > , Observable < ServiceResponse < Page < WorkerPoolResourceInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < WorkerPoolResourceInner > > > call ( Ser... |
public class SM2 { /** * 设置加密类型
* @ param mode { @ link SM2Mode }
* @ return this */
public SM2 setMode ( SM2Mode mode ) { } } | this . mode = mode ; if ( null != this . engine ) { this . engine . setMode ( mode ) ; } return this ; |
public class GenClassCompiler { /** * Handles initializer , constructor and other common annotation compilations .
* < p > Common handled annotations are : @ GenRegex
* @ throws IOException */
@ Override public void compile ( ) throws IOException { } } | compileInitializers ( ) ; compileConstructors ( ) ; for ( ExecutableElement method : ElementFilter . methodsIn ( El . getAllMembers ( superClass ) ) ) { MathExpression mathExpression = method . getAnnotation ( MathExpression . class ) ; if ( mathExpression != null ) { compileMathExpression ( method , mathExpression ) ;... |
public class ExtendedProperties { /** * Looks up a property . Recursively checks the defaults if necessary . Internally ,
* { @ code get ( key , true ) } is called to look up the value .
* @ param key
* The property key
* @ param defaultValue
* The value returned if the property is not found
* @ return The ... | String val = get ( key , true ) ; return val == null ? defaultValue : val ; |
public class ClosableBlockingQueue { /** * Gets all the elements found in the list , or blocks until at least one element
* was added . If the queue is empty when this method is called , it blocks until
* at least one element is added .
* < p > This method always returns a list with at least one element .
* < p... | lock . lock ( ) ; try { while ( open && elements . isEmpty ( ) ) { nonEmpty . await ( ) ; } if ( open ) { ArrayList < E > result = new ArrayList < > ( elements ) ; elements . clear ( ) ; return result ; } else { throw new IllegalStateException ( "queue is closed" ) ; } } finally { lock . unlock ( ) ; } |
public class Matrix4d { /** * / * ( non - Javadoc )
* @ see org . joml . Matrix4dc # invertFrustum ( org . joml . Matrix4d ) */
public Matrix4d invertFrustum ( Matrix4d dest ) { } } | double invM00 = 1.0 / m00 ; double invM11 = 1.0 / m11 ; double invM23 = 1.0 / m23 ; double invM32 = 1.0 / m32 ; dest . set ( invM00 , 0 , 0 , 0 , 0 , invM11 , 0 , 0 , 0 , 0 , 0 , invM32 , - m20 * invM00 * invM23 , - m21 * invM11 * invM23 , invM23 , - m22 * invM23 * invM32 ) ; return dest ; |
public class NgramsExtractor { /** * This method gets as input a string and returns as output a map with the
* extracted keywords along with the number of their scores in the text . Their
* scores are a combination of occurrences and proximity metrics .
* @ param text
* @ return */
@ Override public Map < Strin... | Map < Integer , String > ID2word = new HashMap < > ( ) ; // ID = > Kwd
Map < Integer , Double > ID2occurrences = new HashMap < > ( ) ; // ID = > counts / scores
Map < Integer , Integer > position2ID = new LinkedHashMap < > ( ) ; // word position = > ID maintain the order of insertation
int numberOfWordsInDoc = buildInt... |
public class LeaderCache { /** * Update a modified child and republish a new snapshot . This may indicate
* a deleted child or a child with modified data . */
private void processChildEvent ( WatchedEvent event ) throws Exception { } } | HashMap < Integer , LeaderCallBackInfo > cacheCopy = new HashMap < Integer , LeaderCallBackInfo > ( m_publicCache ) ; ByteArrayCallback cb = new ByteArrayCallback ( ) ; m_zk . getData ( event . getPath ( ) , m_childWatch , cb , null ) ; try { // cb . getData ( ) and cb . getPath ( ) throw KeeperException
byte payload [... |
public class ListBillingGroupsResult { /** * The list of billing groups .
* @ param billingGroups
* The list of billing groups . */
public void setBillingGroups ( java . util . Collection < GroupNameAndArn > billingGroups ) { } } | if ( billingGroups == null ) { this . billingGroups = null ; return ; } this . billingGroups = new java . util . ArrayList < GroupNameAndArn > ( billingGroups ) ; |
public class Sentence { /** * Adds a { @ link Token } to this { @ link Sentence } . Normally called by instances of { @ link Tokenizer } .
* @ param token */
public void addToken ( Token token ) { } } | // Add verification of no token overlap
if ( ! token . getSentence ( ) . equals ( this ) ) throw new IllegalArgumentException ( ) ; tokens . add ( token ) ; |
public class DualPivotQuicksort { /** * Sorts the specified range of the array .
* @ param a the array to be sorted
* @ param left the index of the first element , inclusive , to be sorted
* @ param right the index of the last element , inclusive , to be sorted */
static void sort ( byte [ ] a , int left , int ri... | // Use counting sort on large arrays
if ( right - left > COUNTING_SORT_THRESHOLD_FOR_BYTE ) { int [ ] count = new int [ NUM_BYTE_VALUES ] ; for ( int i = left - 1 ; ++ i <= right ; count [ a [ i ] - Byte . MIN_VALUE ] ++ ) ; for ( int i = NUM_BYTE_VALUES , k = right + 1 ; k > left ; ) { while ( count [ -- i ] == 0 ) ; ... |
public class Slider { /** * An EL expression referring to a server side UIComponent instance in a backing bean . < P >
* @ return Returns the value of the attribute , or null , if it hasn ' t been set by the JSF file . */
public javax . faces . component . UIComponent getBinding ( ) { } } | return ( javax . faces . component . UIComponent ) getStateHelper ( ) . eval ( PropertyKeys . binding ) ; |
public class SubscriptionUsagesInner { /** * Gets a subscription usage metric .
* @ param locationName The name of the region where the resource is located .
* @ param usageName Name of usage metric to return .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observabl... | return getWithServiceResponseAsync ( locationName , usageName ) . map ( new Func1 < ServiceResponse < SubscriptionUsageInner > , SubscriptionUsageInner > ( ) { @ Override public SubscriptionUsageInner call ( ServiceResponse < SubscriptionUsageInner > response ) { return response . body ( ) ; } } ) ; |
public class CmsObjectWrapper { /** * Delegate method for { @ link CmsObject # readResource ( CmsUUID , CmsResourceFilter ) } . < p >
* @ see CmsObject # readResource ( CmsUUID , CmsResourceFilter )
* @ param structureID the ID of the structure to read
* @ param filter the resource filter to use while reading
*... | return m_cms . readResource ( structureID , filter ) ; |
public class ServiceRegistry { /** * Returns a Set of all property name String ( s ) in { @ link ServicePropertyNames }
* @ return a set of all { @ link ServicePropertyNames } String values */
protected static Set < String > getAllServicePropertyNames ( ) { } } | /* Not clear it adds value to expose this publicly , especially with the odd
* J2SE _ MODE in here . */
HashSet < String > retVal = new HashSet < String > ( ) ; retVal . add ( ServicePropertyNames . BATCH_THREADPOOL_SERVICE ) ; retVal . add ( ServicePropertyNames . CONTAINER_ARTIFACT_FACTORY_SERVICE ) ; retVal . add ... |
public class WRepeater { /** * Retrieves the row id for the given row .
* @ param rowBean the row ' s data .
* @ return the id for the given row . Defaults to the row data . */
protected Object getRowId ( final Object rowBean ) { } } | String rowIdProperty = getComponentModel ( ) . rowIdProperty ; if ( rowIdProperty == null || rowBean == null ) { return rowBean ; } try { return PropertyUtils . getProperty ( rowBean , rowIdProperty ) ; } catch ( Exception e ) { LOG . error ( "Failed to read row property \"" + rowIdProperty + "\" on " + rowBean , e ) ;... |
public class GRLINERGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GRLINERG__XOSSF : return XOSSF_EDEFAULT == null ? xossf != null : ! XOSSF_EDEFAULT . equals ( xossf ) ; case AfplibPackage . GRLINERG__YOFFS : return YOFFS_EDEFAULT == null ? yoffs != null : ! YOFFS_EDEFAULT . equals ( yoffs ) ; } return super . eIsSet ( featureID ) ; |
public class UsersWriter { /** * Append the core fields of the user to the string .
* @ param builder the string builder
* @ param user the user whose core fields we ' ll add to the string */
private void appendUserInfoFields ( final StringBuilder builder , final User user ) { } } | append ( builder , user . getUsername ( ) , "," ) ; append ( builder , user . getFirstname ( ) , "," ) ; append ( builder , user . getLastname ( ) , "," ) ; append ( builder , user . getEmail ( ) , "," ) ; append ( builder , user . getPassword ( ) , "" ) ; |
public class SocketFactory { /** * Set the server socket configuration to our required
* QOS values .
* A small experiment shows that setting either ( want , need ) parameter to either true or false sets the
* other parameter to false .
* @ param serverSocket
* The newly created SSLServerSocket .
* @ param ... | try { String [ ] cipherSuites = sslConfig . getCipherSuites ( sslConfigName , serverSocketFactory . getSupportedCipherSuites ( ) ) ; serverSocket . setEnabledCipherSuites ( cipherSuites ) ; // set the SSL protocol on the server socket
String protocol = sslConfig . getSSLProtocol ( sslConfigName ) ; if ( protocol != nul... |
public class ImageClient { /** * Retrieves the list of custom images available to the specified project . Custom images are
* images you create that belong to your project . This method does not get any images that belong
* to other projects , including publicly - available images , like Debian 8 . If you want to g... | ListImagesHttpRequest request = ListImagesHttpRequest . newBuilder ( ) . setProject ( project ) . build ( ) ; return listImages ( request ) ; |
public class VecmathUtil { /** * Sum the components of two vectors , the input is not modified .
* @ param a first vector
* @ param b second vector
* @ return scaled vector */
static Vector2d sum ( final Tuple2d a , final Tuple2d b ) { } } | return new Vector2d ( a . x + b . x , a . y + b . y ) ; |
public class AstFactory { /** * Creates a statement declaring a const alias for " this " to be used in the given function node .
* < p > e . g . ` const aliasName = this ; ` */
Node createThisAliasDeclarationForFunction ( String aliasName , Node functionNode ) { } } | return createSingleConstNameDeclaration ( aliasName , createThis ( getTypeOfThisForFunctionNode ( functionNode ) ) ) ; |
public class FileUtil { /** * Copy FileSystem files to local files . */
public static boolean copy ( FileSystem srcFS , Path src , File dst , boolean deleteSource , Configuration conf ) throws IOException { } } | return copy ( srcFS , src , dst , deleteSource , conf , false , 0L ) ; |
public class Compiler { /** * Compiles multiple sources file and loads the classes .
* @ param sourceFiles the source files to compile .
* @ param parentLoader the parent class loader to use when loading classes .
* @ return a map of compiled classes . This maps class names to
* Class objects .
* @ throws Exc... | List < MemorySourceJavaFileObject > compUnits = new ArrayList < MemorySourceJavaFileObject > ( 1 ) ; compUnits . add ( new MemorySourceJavaFileObject ( className + ".java" , sourceCode ) ) ; DiagnosticCollector < JavaFileObject > diag = new DiagnosticCollector < JavaFileObject > ( ) ; Boolean result = compiler . getTas... |
public class ClassServiceUtility { /** * Create this object given the class name .
* @ param className
* @ return */
public Object makeObjectFromClassName ( String className , String version , boolean bErrorIfNotFound ) throws RuntimeException { } } | if ( className == null ) return null ; className = ClassServiceUtility . getFullClassName ( className ) ; Class < ? > clazz = null ; try { clazz = Class . forName ( className ) ; } catch ( ClassNotFoundException e ) { if ( this . getClassFinder ( null ) != null ) clazz = this . getClassFinder ( null ) . findClass ( cla... |
public class ResourceServlet { /** * Reconfigures default welcome pages with ones provided externally
* @ param welcomePages */
public void configureWelcomeFiles ( List < String > welcomePages ) { } } | this . welcomePages = welcomePages ; ( ( ResourceHandler ) handler ) . setWelcomeFiles ( ) ; ( ( ResourceHandler ) handler ) . addWelcomeFiles ( welcomePages . toArray ( new String [ welcomePages . size ( ) ] ) ) ; |
public class ESIndexer { /** * Builds the result map .
* @ param esResponseReader
* the es response reader
* @ param response
* the response
* @ param query
* the query
* @ param m
* the m
* @ param metaModel
* the meta model
* @ return the map */
private Map < String , Object > buildResultMap ( S... | Map < String , Object > map = new LinkedHashMap < > ( ) ; ESResponseWrapper esResponseReader = new ESResponseWrapper ( ) ; for ( SearchHit hit : response . getHits ( ) ) { Object id = PropertyAccessorHelper . fromSourceToTargetClass ( ( ( AbstractAttribute ) m . getIdAttribute ( ) ) . getBindableJavaType ( ) , String .... |
public class IslamicChronology { /** * Serialization singleton . */
private Object readResolve ( ) { } } | Chronology base = getBase ( ) ; return base == null ? getInstanceUTC ( ) : getInstance ( base . getZone ( ) ) ; |
public class RecordingReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return Recording ResourceSet */
@ Override public ResourceSet < Recording > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class BasicWebsite { /** * Remove the ' / ' at the beginning and ending .
* @ param target target string .
* @ return rule result . */
protected String trimSlash ( @ NonNull String target ) { } } | target = trimStartSlash ( target ) ; target = trimEndSlash ( target ) ; return target ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.