signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class PreprocessorContext { /** * Check that there is a local variable with such name .
* @ param variableName a name to be checked , can be null
* @ return false if there is not such variable or it is null , true if such local variable exists */
public boolean isLocalVariable ( @ Nullable final String varia... | boolean result = false ; if ( variableName != null ) { final String normalized = PreprocessorUtils . normalizeVariableName ( variableName ) ; result = this . localVarTable . containsKey ( normalized ) ; } return result ; |
public class TreeInfo { /** * Find the declaration for a symbol , where
* that symbol is defined somewhere in the given tree . */
public static JCTree declarationFor ( final Symbol sym , final JCTree tree ) { } } | class DeclScanner extends TreeScanner { JCTree result = null ; public void scan ( JCTree tree ) { if ( tree != null && result == null ) tree . accept ( this ) ; } public void visitTopLevel ( JCCompilationUnit that ) { if ( that . packge == sym ) result = that ; else super . visitTopLevel ( that ) ; } public void visitC... |
public class Conversation { /** * Returns < code > true < / code > if conversation is in one of the given states */
public boolean hasState ( ConversationState ... states ) { } } | for ( ConversationState s : states ) { if ( s . equals ( state ) ) { return true ; } } return false ; |
public class nspbr { /** * Use this API to update nspbr resources . */
public static base_responses update ( nitro_service client , nspbr resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { nspbr updateresources [ ] = new nspbr [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new nspbr ( ) ; updateresources [ i ] . name = resources [ i ] . name ; updateresources [ i ] . a... |
public class FinalParameters { /** * overrides the visitor to find the source lines for the method header , to find non final parameters
* @ param obj
* the code object for the currently parsed method */
@ Override public void visitCode ( final Code obj ) { } } | if ( sourceLines == null ) { return ; } if ( isAbstract ) { return ; } if ( Values . STATIC_INITIALIZER . equals ( methodName ) || Values . CONSTRUCTOR . equals ( methodName ) ) { return ; } int methodStart = srcLineAnnotation . getStartLine ( ) - 2 ; int methodLine = methodStart ; String line ; while ( ( methodLine >=... |
public class PreferenceFragment { /** * Initializes the edit text dialog . */
private void initializeEditTextDialog ( ) { } } | EditTextDialog . Builder builder = new EditTextDialog . Builder ( getActivity ( ) ) . setHint ( R . string . edit_text_dialog_hint ) . setText ( getContext ( ) . getString ( R . string . edit_text_dialog_text ) ) . addValidator ( Validators . notEmpty ( getContext ( ) ) ) ; configureHeaderDialogBuilder ( builder ) ; co... |
public class JSDocInfo { /** * Gets the @ template type names .
* < p > Excludes @ template types from TTL ; get those with { @ link # getTypeTransformations ( ) } */
public ImmutableList < String > getTemplateTypeNames ( ) { } } | if ( info == null || info . templateTypeNames == null ) { return ImmutableList . of ( ) ; } return ImmutableList . copyOf ( info . templateTypeNames ) ; |
public class CmsPublishProject { /** * Returns the project name . < p >
* @ return the project name */
private String getProjectname ( ) { } } | CmsUUID id = new CmsUUID ( getParamProjectid ( ) ) ; try { return getCms ( ) . readProject ( id ) . getName ( ) ; } catch ( CmsException e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SET_PROJECT_NAME_FAILED_0 ) , e ) ; } return "-error-" ; |
public class StringAccessor { /** * ( non - Javadoc )
* @ see
* com . impetus . kundera . property . PropertyAccessor # toBytes ( java . lang . Object ) */
@ Override public final byte [ ] toBytes ( Object s ) throws PropertyAccessException { } } | try { return s != null ? ( ( String ) s ) . getBytes ( Constants . CHARSET_UTF8 ) : null ; } catch ( UnsupportedEncodingException e ) { log . error ( "Unsupported encoding exception, Caused by {}." , e ) ; throw new PropertyAccessException ( e ) ; } |
public class ProgressTableModel { /** * / * ( non - Javadoc )
* @ see javax . swing . table . TableModel # getValueAt ( int , int ) */
public synchronized Object getValueAt ( int rowIndex , int columnIndex ) { } } | TableRowProgressMonitor monitor = monitors . get ( rowIndex ) ; switch ( columnIndex ) { case TITLE_COLUMN : return monitor . getTitle ( ) ; case PROGRESS_COLUMN : return monitor . getProgressBar ( ) ; case STATUS_COLUMN : return monitor . getStatus ( ) ; default : throw new IndexOutOfBoundsException ( ) ; } |
public class CharacterBasedSegment { /** * 将中间结果转换为词网顶点 ,
* 这样就可以利用基于Vertex开发的功能 , 如词性标注 、 NER等
* @ param wordList
* @ param appendStart
* @ return */
protected List < Vertex > toVertexList ( List < Term > wordList , boolean appendStart ) { } } | ArrayList < Vertex > vertexList = new ArrayList < Vertex > ( wordList . size ( ) + 2 ) ; if ( appendStart ) vertexList . add ( Vertex . newB ( ) ) ; for ( Term word : wordList ) { CoreDictionary . Attribute attribute = guessAttribute ( word ) ; Vertex vertex = new Vertex ( word . word , attribute ) ; vertexList . add (... |
public class BeanPropertyTypeProvider { /** * set the property destination type for given property
* @ param propertyName
* @ param destinationType */
public void setPropertyDestinationType ( Class < ? > clazz , String propertyName , TypeReference < ? > destinationType ) { } } | propertiesDestinationTypes . put ( new ClassProperty ( clazz , propertyName ) , destinationType ) ; |
public class ServiceTrxMessageIn { /** * Get the SOAP message body as a DOM node .
* @ param message the SOAP message .
* @ param bReturnCopy Return a copy of the message node , instead of the actual node .
* @ return The DOM node containing the message body . */
public org . w3c . dom . Node getMessageBody ( Obj... | return super . getMessageBody ( rawData , bReturnCopy ) ; |
public class OrmWriter { private static PreparedStatement createStatementForInsert ( final Connection connection , final Introspected introspected , final FieldColumnInfo [ ] fcInfos ) throws SQLException { } } | final String sql = createStatementCache . computeIfAbsent ( introspected , key -> { final String tableName = introspected . getTableName ( ) ; final StringBuilder sqlSB = new StringBuilder ( "INSERT INTO " ) . append ( tableName ) . append ( '(' ) ; final StringBuilder sqlValues = new StringBuilder ( ") VALUES (" ) ; f... |
public class FastAdapterDialog { /** * Define the OnClickListener which will be used for a single item
* @ param onClickListener the OnClickListener which will be used for a single item
* @ return this */
public FastAdapterDialog < Item > withOnClickListener ( com . mikepenz . fastadapter . listeners . OnClickListe... | this . mFastAdapter . withOnClickListener ( onClickListener ) ; return this ; |
public class CPDefinitionUtil { /** * Returns the cp definition where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache .
* @ param uuid the uuid
* @ param groupId the group ID
* @ param retrieveFromCache whether to retrieve fro... | return getPersistence ( ) . fetchByUUID_G ( uuid , groupId , retrieveFromCache ) ; |
public class PassiveRole { /** * Handles an AppendRequest . */
protected CompletableFuture < AppendResponse > handleAppend ( final AppendRequest request ) { } } | CompletableFuture < AppendResponse > future = new CompletableFuture < > ( ) ; // Check that the term of the given request matches the local term or update the term .
if ( ! checkTerm ( request , future ) ) { return future ; } // Check that the previous index / term matches the local log ' s last entry .
if ( ! checkPre... |
public class Caffeine { /** * Constructs a new { @ code Caffeine } instance with the settings specified in { @ code spec } .
* @ param spec a String in the format specified by { @ link CaffeineSpec }
* @ return a new instance with the specification ' s settings */
@ NonNull public static Caffeine < Object , Object ... | return from ( CaffeineSpec . parse ( spec ) ) ; |
public class ApptentiveNestedScrollView { /** * < p > The scroll range of a scroll view is the overall height of all of its
* children . < / p >
* @ hide */
@ Override public int computeVerticalScrollRange ( ) { } } | final int count = getChildCount ( ) ; final int contentHeight = getHeight ( ) - getPaddingBottom ( ) - getPaddingTop ( ) ; if ( count == 0 ) { return contentHeight ; } int scrollRange = getChildAt ( 0 ) . getBottom ( ) ; final int scrollY = getScrollY ( ) ; final int overscrollBottom = Math . max ( 0 , scrollRange - co... |
public class OutboundHandler { /** * Initializes the dst ByteBuffer with the configured size .
* The buffer created is reading mode .
* @ param sizeBytes the size of the dst ByteBuffer .
* @ param bytes the bytes added to the buffer . Can be null if nothing
* should be added .
* @ throws IllegalArgumentExcept... | if ( bytes != null && bytes . length > sizeBytes ) { throw new IllegalArgumentException ( "Buffer overflow. Can't initialize dstBuffer for " + this + " and channel" + channel + " because too many bytes, sizeBytes " + sizeBytes + ". bytes.length " + bytes . length ) ; } ChannelOptions config = channel . options ( ) ; By... |
public class OpenCms { /** * Notify all event listeners that a particular event has occurred . < p >
* The event will be given to all registered < code > { @ link I _ CmsEventListener } < / code > objects . < p >
* @ param type event type
* @ param data event data */
public static void fireCmsEvent ( int type , M... | OpenCmsCore . getInstance ( ) . getEventManager ( ) . fireEvent ( type , data ) ; |
public class OperationsInner { /** * Lists all of the available Azure Container Registry REST API operations .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the Pag... | return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < OperationDefinitionInner > > , Page < OperationDefinitionInner > > ( ) { @ Override public Page < OperationDefinitionInner > call ( ServiceResponse < Page < OperationDefinitionInner > > response ) { return response . b... |
public class HashAlgorithmRegistry { /** * Registers provided { @ link HashAlgorithm } instance with the given name . Name
* is not case sensitive . Any registered algorithm with the same name will be
* substituted
* @ param name name of the algorithm
* @ param alg algorithm instance to register */
public stati... | validateName ( name ) ; validateAlgorithm ( alg ) ; REGISTRY . put ( name . toLowerCase ( ) , alg ) ; |
public class GcsConfiguration { private static String defaultProject ( ) { } } | try { File configFile ; if ( getEnvironment ( ) . containsKey ( "CLOUDSDK_CONFIG" ) ) { configFile = new File ( getEnvironment ( ) . get ( "CLOUDSDK_CONFIG" ) , "properties" ) ; } else if ( isWindows ( ) && getEnvironment ( ) . containsKey ( "APPDATA" ) ) { configFile = new File ( getEnvironment ( ) . get ( "APPDATA" )... |
public class TypeVariables { /** * Returns a map from methods to return types , where the return types are not necessarily the
* original return types of the methods . Consider this example :
* < pre >
* & # 64 ; AutoValue class { @ code Foo < T > } {
* abstract T getFoo ( ) ;
* & # 64 ; AutoValue . Builder
... | List < ? extends TypeParameterElement > sourceTypeParameters = sourceType . getTypeParameters ( ) ; List < ? extends TypeParameterElement > targetTypeParameters = targetType . getTypeParameters ( ) ; Preconditions . checkArgument ( sourceTypeParameters . toString ( ) . equals ( targetTypeParameters . toString ( ) ) , "... |
public class StorageClientFactory { /** * Creates a SnowflakeAzureClientObject which encapsulates
* the Azure Storage client
* @ param stage Stage information
* @ param encMat encryption material for the client
* @ return the SnowflakeS3Client instance created */
private SnowflakeAzureClient createAzureClient (... | logger . debug ( "createAzureClient encryption={}" , ( encMat == null ? "no" : "yes" ) ) ; // TODO : implement support for encryption SNOW - 33042
SnowflakeAzureClient azureClient ; try { azureClient = SnowflakeAzureClient . createSnowflakeAzureClient ( stage , encMat ) ; } catch ( Exception ex ) { logger . debug ( "Ex... |
public class JCloudsStorage { /** * { @ inheritDoc } */
@ Override public IBackendReader getReader ( ) throws TTException { } } | // setup the container name used by the provider ( like bucket in S3)
return new JCloudsReader ( mBlobStore , mFac , mByteHandler , mProperties . getProperty ( ConstructorProps . RESOURCE ) ) ; |
public class aaagroup_auditsyslogpolicy_binding { /** * Use this API to fetch aaagroup _ auditsyslogpolicy _ binding resources of given name . */
public static aaagroup_auditsyslogpolicy_binding [ ] get ( nitro_service service , String groupname ) throws Exception { } } | aaagroup_auditsyslogpolicy_binding obj = new aaagroup_auditsyslogpolicy_binding ( ) ; obj . set_groupname ( groupname ) ; aaagroup_auditsyslogpolicy_binding response [ ] = ( aaagroup_auditsyslogpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class JsonSerializationContext { /** * Trace an error with current writer state and returns a corresponding exception .
* @ param value current value
* @ param cause cause of the error
* @ param writer current writer
* @ return a { @ link JsonSerializationException } if we wrap the exceptions , the cause... | RuntimeException exception = traceError ( value , cause ) ; traceWriterInfo ( value , writer ) ; return exception ; |
public class ServiceAdmin { @ GET @ Path ( "node" ) @ Produces ( MediaType . APPLICATION_JSON ) @ HttpCache ( "public, max-age=60" ) public List < NodeDto > getNodes ( ) { } } | DbConn cnx = null ; try { cnx = Helpers . getDbSession ( ) ; return MetaService . getNodes ( cnx ) ; } finally { Helpers . closeQuietly ( cnx ) ; } |
public class MouseHeadless { /** * Updatable */
@ Override public void update ( double extrp ) { } } | mx = x - oldX ; my = y - oldY ; oldX = x ; oldY = y ; |
public class SDVariable { /** * The gradient variable is the variable that represents the derivative of the loss function with respect
* to the output of this variable . I . e . , if this variable is X and loss function is L , then gradient ( ) returns the
* variable representing dL / dX < br >
* Note that only f... | Preconditions . checkState ( dataType ( ) . isFPType ( ) , "Cannot get gradient of %s variable \"%s\": only floating" + " point variables have gradients" , getVarName ( ) , dataType ( ) ) ; return sameDiff . getGradForVariable ( getVarName ( ) ) ; |
public class ZipUtils { /** * Encodes the given byte array and then GZIP compresses it .
* @ param value byte array input
* @ return compressed byte array output
* @ throws IOException */
public static byte [ ] compressBytesNonBase64 ( byte [ ] value ) throws IOException { } } | ByteArrayOutputStream baos = new ByteArrayOutputStream ( value . length ) ; try ( GZIPOutputStream gos = new GZIPOutputStream ( baos ) ) { gos . write ( value ) ; } byte [ ] compressed = baos . toByteArray ( ) ; baos . close ( ) ; return compressed ; |
public class FilesystemIterator { /** * Determines if a path is a possible file system root */
protected boolean isFilesystemRoot ( String filename ) throws IOException { } } | String [ ] roots = getFilesystemRoots ( ) ; for ( int c = 0 , len = roots . length ; c < len ; c ++ ) { if ( roots [ c ] . equals ( filename ) ) return true ; } return false ; |
public class EventRegister { /** * Register event bus for views . */
void registerEventBuses ( ) { } } | if ( ! eventsRegistered ) { Mvc . graph ( ) . inject ( this ) ; eventBusV . register ( androidComponent ) ; eventsRegistered = true ; logger . trace ( "+Event2V bus registered for view - '{}'." , androidComponent . getClass ( ) . getSimpleName ( ) ) ; } else { logger . trace ( "!Event2V bus already registered for view ... |
public class TripleGeneratorBase { /** * Helper methods for adding triples */
protected void add ( SubjectNode subject , RDFName predicate , ObjectNode object , Set < Triple > set ) throws ResourceIndexException { } } | set . add ( new SimpleTriple ( subject , predicate , object ) ) ; |
public class AppendBlockHeader { public void write ( DataOutput out ) throws IOException { } } | if ( getDataTransferVersion ( ) >= DataTransferProtocol . FEDERATION_VERSION ) { out . writeInt ( namespaceId ) ; } out . writeLong ( blockId ) ; out . writeLong ( numBytes ) ; out . writeLong ( genStamp ) ; out . writeInt ( pipelineDepth ) ; getWritePipelineInfo ( ) . write ( getDataTransferVersion ( ) , out ) ; |
public class ipset { /** * Use this API to add ipset . */
public static base_response add ( nitro_service client , ipset resource ) throws Exception { } } | ipset addresource = new ipset ( ) ; addresource . name = resource . name ; addresource . td = resource . td ; return addresource . add_resource ( client ) ; |
public class CmsVfsSitemapService { /** * Returns the sitemap children for the given path with all descendants up to the given level or to the given target path , ie .
* < dl > < dt > levels = 1 < dd > only children < dt > levels = 2 < dd > children and great children < / dl >
* and so on . < p >
* @ param root t... | List < CmsClientSitemapEntry > children = new ArrayList < CmsClientSitemapEntry > ( ) ; int i = 0 ; for ( CmsJspNavElement navElement : getNavBuilder ( ) . getNavigationForFolder ( root , Visibility . all , CmsResourceFilter . ONLY_VISIBLE_NO_DELETED ) ) { try { CmsClientSitemapEntry child = toClientEntry ( navElement ... |
public class ChisquareSelect { /** * { @ inheritDoc } */
@ Override protected void estimateFeatureScores ( Map < Object , Double > featureScores , int N , Map < Object , Integer > classCounts , Map < List < Object > , Integer > featureClassCounts , Map < Object , Double > featureCounts ) { } } | logger . debug ( "estimateFeatureScores()" ) ; double criticalValue = ContinuousDistributions . chisquareInverseCdf ( knowledgeBase . getTrainingParameters ( ) . getALevel ( ) , 1 ) ; // one degree of freedom because the tables below are 2x2
streamExecutor . forEach ( StreamMethods . stream ( featureCounts . entrySet (... |
public class CloudFile { /** * 保存文件到云上 , 阻塞直到保存成功返回
* @ param path 文件相对路径
* @ param data 文件内容
* @ return successful / unsuccessful unit response */
@ SuppressWarnings ( "unused" ) public static Completable save ( String path , String data ) { } } | Map < String , Object > map = new HashMap < String , Object > ( ) { { put ( "path" , path ) ; put ( "data" , data ) ; } } ; return SingleRxXian . call ( "cosService" , "cosWrite" , map ) . toCompletable ( ) ; |
public class HashUserRealm { public void dump ( PrintStream out ) { } } | out . println ( this + ":" ) ; out . println ( super . toString ( ) ) ; out . println ( _roles ) ; |
public class FbBotMillNetworkController { /** * POSTs a messenger code as a JSON string to Facebook .
* @ param input
* the JSON data to send .
* @ return the uploaded attachment ID . */
public static MessengerCode postMessengerCode ( Object input ) { } } | StringEntity stringEntity = toStringEntity ( input ) ; return postMessengerCode ( stringEntity ) ; |
public class ZipUtil { /** * Reads the given ZIP file and executes the given action for each given entry .
* For each given entry the corresponding input stream is also passed to the action . If you want to stop the loop then throw a ZipBreakException .
* @ param zip
* input ZIP file .
* @ param entryNames
* ... | ZipFile zf = null ; try { if ( charset == null ) { zf = new ZipFile ( zip ) ; } else { zf = new ZipFile ( zip , charset ) ; } for ( int i = 0 ; i < entryNames . length ; i ++ ) { ZipEntry e = zf . getEntry ( entryNames [ i ] ) ; if ( e == null ) { continue ; } InputStream is = zf . getInputStream ( e ) ; try { action .... |
public class JobConfig { /** * < b > WARNING : < / b > You shouldn ' t call this method . It only exists for testing and debugging
* purposes . The { @ link JobManager } automatically decides which API suits best for a { @ link Job } .
* @ param api The { @ link JobApi } which will be used for future scheduled JobR... | for ( JobApi jobApi : JobApi . values ( ) ) { ENABLED_APIS . put ( jobApi , jobApi == api ) ; } CAT . w ( "forceApi - %s" , api ) ; |
public class DescribeConditionalForwardersRequest { /** * The fully qualified domain names ( FQDN ) of the remote domains for which to get the list of associated conditional
* forwarders . If this member is null , all conditional forwarders are returned .
* < b > NOTE : < / b > This method appends the values to the... | if ( this . remoteDomainNames == null ) { setRemoteDomainNames ( new com . amazonaws . internal . SdkInternalList < String > ( remoteDomainNames . length ) ) ; } for ( String ele : remoteDomainNames ) { this . remoteDomainNames . add ( ele ) ; } return this ; |
public class AbstractZKClient { /** * Returns both the data as a byte [ ] as well as the stat */
@ Override public ZKData < byte [ ] > getZKByteData ( String path ) throws InterruptedException , KeeperException { } } | return getZKByteData ( path , null ) ; |
public class DependencyFinder { /** * Parses all class files from the given archive stream and returns
* all target locations . */
public Set < Location > parse ( Stream < ? extends Archive > archiveStream ) { } } | archiveStream . forEach ( archive -> parse ( archive , CLASS_FINDER ) ) ; return waitForTasksCompleted ( ) ; |
public class CoverageDataCore { /** * Get the coverage data value for the unsigned short pixel value
* @ param griddedTile
* gridded tile
* @ param unsignedPixelValue
* pixel value as an unsigned 16 bit integer
* @ return coverage data value */
public Double getValue ( GriddedTile griddedTile , int unsignedPi... | Double value = null ; if ( ! isDataNull ( unsignedPixelValue ) ) { value = pixelValueToValue ( griddedTile , new Double ( unsignedPixelValue ) ) ; } return value ; |
public class Encoder { /** * Re - encode a multimedia file .
* This method is not reentrant , instead create multiple object instances
* @ param multimediaObject The source multimedia file . It cannot be null . Be
* sure this file can be decoded ( see null null null null { @ link Encoder # getSupportedDecodingFor... | String formatAttribute = attributes . getFormat ( ) ; Float offsetAttribute = attributes . getOffset ( ) ; Float durationAttribute = attributes . getDuration ( ) ; AudioAttributes audioAttributes = attributes . getAudioAttributes ( ) ; VideoAttributes videoAttributes = attributes . getVideoAttributes ( ) ; if ( audioAt... |
public class XMLSystemProperties { /** * The same as { @ link # setXMLMaxOccur ( int ) } but just that the value is only
* set , if the limit is increased !
* @ param nMaxOccur
* A positive integer . Values & le ; 0 are treated as no limit .
* @ since 8.6.2
* @ see # setXMLMaxOccur ( int ) */
public static vo... | final int nOldValue = getXMLMaxOccur ( ) ; if ( nOldValue > 0 ) { // Current value is limited
if ( nMaxOccur <= 0 || nMaxOccur > nOldValue ) { // New value is unlimited or higher
setXMLMaxOccur ( nMaxOccur ) ; } } // else - > cannot be increased |
public class SnowflakeUtil { /** * Check the error in the JSON node and generate an exception based on
* information extracted from the node .
* @ param rootNode json object contains error information
* @ param raiseReauthenticateError raises SnowflakeReauthenticationRequest
* if true
* @ throws SnowflakeSQLE... | // no need to throw exception if success
if ( rootNode . path ( "success" ) . asBoolean ( ) ) { return ; } String errorMessage ; String sqlState ; int errorCode ; String queryId = "unknown" ; // if we have sqlstate in data , it ' s a sql error
if ( ! rootNode . path ( "data" ) . path ( "sqlState" ) . isMissingNode ( ) ... |
public class ConcurrentHashMap { /** * Retrieve an object from the map based on its key .
* @ param key for the Object to be removed .
* @ return Object matching the key . */
public final Object get ( Object key ) { } } | if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "get" , "key=" + key + "Object" ) ; java . util . Map subMap = getSubMap ( key ) ; Object returnValue ; synchronized ( subMap ) { returnValue = subMap . get ( key ) ; } // synchronized ( subMap ) .
if ( Tracing . isAn... |
public class CmsSitemapController { /** * Returns the parent entry of a sitemap entry , or null if it is the root entry . < p >
* @ param entry a sitemap entry
* @ return the parent entry or null */
public CmsClientSitemapEntry getParentEntry ( CmsClientSitemapEntry entry ) { } } | String path = entry . getSitePath ( ) ; String parentPath = CmsResource . getParentFolder ( path ) ; if ( parentPath == null ) { return null ; } return getEntry ( parentPath ) ; |
public class AccessibilityNodeInfoUtils { /** * Determines if the current item is at the edge of a list by checking the
* scrollable predecessors of the items on either or both sides .
* @ param context The parent context .
* @ param node The node to check .
* @ param direction The direction in which to check ,... | if ( node == null ) { return false ; } if ( ( direction <= 0 ) && isMatchingEdgeListItem ( context , node , NodeFocusFinder . SEARCH_BACKWARD , FILTER_SCROLL_BACKWARD . and ( filter ) ) ) { return true ; } if ( ( direction >= 0 ) && isMatchingEdgeListItem ( context , node , NodeFocusFinder . SEARCH_FORWARD , FILTER_SCR... |
public class DeploymentNode { /** * Adds a container instance to this deployment node , optionally replicating all of the container - container relationships .
* @ param container the Container to add an instance of
* @ param replicateContainerRelationships true if the container - container relationships should be ... | ContainerInstance containerInstance = getModel ( ) . addContainerInstance ( this , container , replicateContainerRelationships ) ; this . containerInstances . add ( containerInstance ) ; return containerInstance ; |
public class Resources { /** * Gets the int .
* @ param key the key
* @ return the int */
public int getInt ( String key ) { } } | try { return Integer . parseInt ( resource . getString ( key ) ) ; } catch ( NumberFormatException e ) { return - 1 ; // modify here if you need to throw a Exception here
} |
public class CountStatisticImpl { /** * Non - Synchronizable : counter is " replaced " with the input value . Caller should synchronize . */
public void set ( long count , long startTime , long lastSampleTime ) { } } | this . count = count ; this . startTime = startTime ; this . lastSampleTime = lastSampleTime ; |
public class BizwifiAPI { /** * Wi - Fi数据统计
* 查询一定时间范围内的WiFi连接总人数 、 微信方式连Wi - Fi人数 、 商家主页访问人数 、 连网后消息发送人数 、 新增公众号关注人数和累计公众号关注人数 。
* 查询的最长时间跨度为30天 。
* @ param accessToken accessToken
* @ param statisticsList statisticsList
* @ return StatisticsListResult */
public static StatisticsListResult statisticsList ( S... | return statisticsList ( accessToken , JsonUtil . toJSONString ( statisticsList ) ) ; |
public class BaseJsonBo { /** * Get a sub - attribute using d - path .
* @ param attrName
* @ param dPath
* @ param clazz
* @ return
* @ see DPathUtils */
public < T > T getSubAttr ( String attrName , String dPath , Class < T > clazz ) { } } | Lock lock = lockForRead ( ) ; try { return JacksonUtils . getValue ( getAttribute ( attrName ) , dPath , clazz ) ; } finally { lock . unlock ( ) ; } |
public class PropertiesBasedGreenMailConfigurationBuilder { /** * Builds a configuration object based on given properties .
* @ param properties the properties .
* @ return a configuration and never null . */
public GreenMailConfiguration build ( Properties properties ) { } } | GreenMailConfiguration configuration = new GreenMailConfiguration ( ) ; String usersParam = properties . getProperty ( GREENMAIL_USERS ) ; if ( null != usersParam ) { String [ ] usersArray = usersParam . split ( "," ) ; for ( String user : usersArray ) { extractAndAddUser ( configuration , user ) ; } } String disabledA... |
public class GetTagValuesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetTagValuesRequest getTagValuesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getTagValuesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getTagValuesRequest . getPaginationToken ( ) , PAGINATIONTOKEN_BINDING ) ; protocolMarshaller . marshall ( getTagValuesRequest . getKey ( ) , KEY_BINDING ) ; } catch... |
public class BinaryValue { /** * Update with < code > length < / code > bytes from the specified InputStream < code > stream < / code > to
* this binary value at < code > position < / code >
* @ param stream
* the data .
* @ param length
* the number of bytes from buffer to write .
* @ param position
* po... | if ( ! changed ) { internalData = createEditableCopy ( this . getInternalData ( ) ) ; } ( ( EditableValueData ) internalData ) . update ( stream , length , position ) ; invalidateStream ( ) ; |
public class JFeatureSpec { /** * Java wrapper for { @ link FeatureSpec # extractWithSettings ( String , FeatureBuilder , ClassTag ) . */
public JRecordExtractor < T , SparseLabeledPoint > extractWithSettingsSparseLabeledPoint ( String settings ) { } } | return new JRecordExtractor < > ( JavaOps . extractWithSettingsSparseLabeledPoint ( self , settings ) ) ; |
public class StackInspector { /** * Inspect the given { @ link Class } for all { @ link Facet } types from all { @ link FacetConstraint } declarations . This
* method inspects the entire constraint tree . */
public static < FACETTYPE extends Facet < ? > > Set < Class < FACETTYPE > > getAllRelatedFacets ( final Class ... | Set < Class < FACETTYPE > > seen = new LinkedHashSet < Class < FACETTYPE > > ( ) ; return getAllRelatedFacets ( seen , inspectedType ) ; |
public class Event { /** * setter for causes _ event - sets
* @ generated
* @ param v value to set into the feature */
public void setCauses_event ( FSArray v ) { } } | if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_causes_event == null ) jcasType . jcas . throwFeatMissing ( "causes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_event , jcasType . ll_cas . ll_getFSRef ( v ) ... |
public class HpelFormatter { /** * Sets the formatter locale and the dateFormat that will be used to localize a log record being formatted . The formatter locale will be used
* when { @ link # formatRecord ( RepositoryLogRecord ) } is invoked . It is possible to format a log record with a locale other than
* one se... | this . locale = locale ; if ( null == locale ) { dateFormat = FormatSet . customizeDateFormat ( DateFormat . getDateTimeInstance ( DateFormat . SHORT , DateFormat . MEDIUM ) , isoDateFormat ) ; } else { dateFormat = FormatSet . customizeDateFormat ( DateFormat . getDateTimeInstance ( DateFormat . SHORT , DateFormat . M... |
public class StateTransferInterceptor { /** * For non - tx write commands , we retry the command locally if the topology changed .
* But we only retry on the originator , and only if the command doesn ' t have
* the { @ code CACHE _ MODE _ LOCAL } flag . */
private Object handleNonTxWriteCommand ( InvocationContext... | if ( trace ) log . tracef ( "handleNonTxWriteCommand for command %s, topology id %d" , command , command . getTopologyId ( ) ) ; updateTopologyId ( command ) ; // Only catch OutdatedTopologyExceptions on the originator
if ( ! ctx . isOriginLocal ( ) ) { return invokeNext ( ctx , command ) ; } return invokeNextAndHandle... |
public class StandardMultipartFile { /** * Determine whether the multipart content is still available . If a temporary file has been moved , the content is no
* longer available . */
protected boolean isAvailable ( ) { } } | // If in memory , it ' s available .
if ( fileItem . isInMemory ( ) ) { return true ; } // Check actual existence of temporary file .
if ( fileItem instanceof DiskFileItem ) { return ( ( DiskFileItem ) fileItem ) . getStoreLocation ( ) . exists ( ) ; } // Check whether current file size is different than original one .... |
public class BaseDestinationHandler { /** * Create a new PtoPMessageItemStream and add it to this Destination ' s Localisations .
* In addition to creating and adding it , this function also performs all the
* necessary updates to make it a recognized part of the Destination .
* @ param localisationIsRemote shoul... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addNewPtoPLocalization" , new Object [ ] { Boolean . valueOf ( localisationIsRemote ) , transaction , messagingEngineUuid , destinationLocalizationDefinition , Boolean . valueOf ( queuePoint ) } ) ; if ( _ptoPRealization ==... |
public class ClassFileImporter { /** * Converts the supplied { @ link URL URLs } to { @ link Location locations } and delegates to
* { @ link # importLocations ( Collection ) } */
@ PublicAPI ( usage = ACCESS ) public JavaClasses importUrls ( Collection < URL > urls ) { } } | return importLocations ( Locations . of ( urls ) ) ; |
public class Base64 { /** * Low - level access to decoding ASCII characters in the form of a byte array .
* < strong > Ignores GUNZIP option , if it ' s set . < / strong > This is not generally
* a recommended method , although it is used internally as part of the
* decoding process . Special case : if len = 0 , ... | return decode ( source , 0 , source . length , options ) ; |
public class Configuration { /** * Set the value of the < code > name < / code > property to the given type . This
* is equivalent to < code > set ( & lt ; name & gt ; , value . toString ( ) ) < / code > .
* @ param name property name
* @ param value new value */
public < T extends Enum < T > > void setEnum ( Str... | set ( name , value . toString ( ) ) ; |
public class Period { /** * Constructs a Period representing a duration more than
* count units extending into the past .
* @ param count the number of units . must be non - negative
* @ param unit the unit
* @ return the new Period */
public static Period moreThan ( float count , TimeUnit unit ) { } } | checkCount ( count ) ; return new Period ( ETimeLimit . MT , false , count , unit ) ; |
public class MapMarkerBuilder { /** * Final build method of the builder , called once all parameters are setup for the Generic Marker
* @ param markerContext the marker context is intended to hold a reference to the record set backing the marker ,
* this used later in pop up panel and hover label construction to ai... | this . map = mapWidget ; validateRequiredParameters ( ) ; if ( map instanceof GoogleV3MapWidget ) { return new GoogleV3Marker < T > ( this , markerContext ) ; } if ( map instanceof OfflineMapWidget ) { return new OfflineMapMarker < T > ( this , markerContext ) ; } throw new UnsupportedOperationException ( ) ; |
public class Client { /** * Closes the connection to the dbserver . This instance can no longer be used after this action . */
void close ( ) { } } | try { performTeardownExchange ( ) ; } catch ( IOException e ) { logger . warn ( "Problem reporting our intention to close the dbserver connection" , e ) ; } try { channel . close ( ) ; } catch ( IOException e ) { logger . warn ( "Problem closing dbserver client output channel" , e ) ; } try { os . close ( ) ; } catch (... |
public class DatabaseContentReader { /** * Parse metadata from the sequence , store it into the DocumentMetadata
* object passed in
* @ param metadata
* @ return uri of the document with this metadata
* @ throws IOException */
private String parseMetadata ( DocumentMetadata metadata ) throws IOException { } } | ResultItem item = result . next ( ) ; String uri = item . asString ( ) ; if ( uri == null ) { throw new IOException ( "Missing document URI for metadata." ) ; } item = result . next ( ) ; // node - kind , must exist
String nKind = item . asString ( ) ; metadata . setFormat ( nKind ) ; item = result . next ( ) ; // hand... |
public class ForkJoinPool { /** * Pushes a possibly - external submission . */
private < T > ForkJoinTask < T > externalSubmit ( ForkJoinTask < T > task ) { } } | Thread t ; ForkJoinWorkerThread w ; WorkQueue q ; if ( task == null ) throw new NullPointerException ( ) ; if ( ( ( t = Thread . currentThread ( ) ) instanceof ForkJoinWorkerThread ) && ( w = ( ForkJoinWorkerThread ) t ) . pool == this && ( q = w . workQueue ) != null ) q . push ( task ) ; else externalPush ( task ) ; ... |
public class AbstractResourceAdapterDeployer { /** * Verify deployment against bean validation
* @ param deployment The deployment
* @ exception DeployException Thrown in case of a violation */
@ SuppressWarnings ( "unchecked" ) private void verifyBeanValidation ( Deployment deployment ) throws DeployException { } ... | if ( beanValidation != null ) { ValidatorFactory vf = null ; try { vf = beanValidation . getValidatorFactory ( ) ; javax . validation . Validator v = vf . getValidator ( ) ; Collection < String > l = deployment . getActivation ( ) . getBeanValidationGroups ( ) ; if ( l == null || l . isEmpty ( ) ) l = Arrays . asList (... |
public class Cache { /** * BLPOP 是列表的阻塞式 ( blocking ) 弹出原语 。
* 它是 LPOP 命令的阻塞版本 , 当给定列表内没有任何元素可供弹出的时候 , 连接将被 BLPOP 命令阻塞 , 直到等待超时或发现可弹出元素为止 。
* 当给定多个 key 参数时 , 按参数 key 的先后顺序依次检查各个列表 , 弹出第一个非空列表的头元素 。
* 参考 : http : / / redisdoc . com / list / blpop . html
* 命令行 : BLPOP key [ key . . . ] timeout */
@ SuppressWarnin... | Jedis jedis = getJedis ( ) ; try { List < byte [ ] > data = jedis . blpop ( timeout , keysToBytesArray ( keys ) ) ; return keyValueListFromBytesList ( data ) ; } finally { close ( jedis ) ; } |
public class IosCertificateFactory { /** * Test whether array is a Base64 - encoded certificate . If so , return
* the decoded content instead of the specified array .
* @ see CertificateFactorySpi # engineGenerateCertificate ( InputStream ) */
private byte [ ] maybeDecodeBase64 ( byte [ ] byteArray ) { } } | try { String pem = new String ( byteArray ) ; // Remove required begin / end lines .
pem = pem . substring ( BEGIN_CERT_LINE_LENGTH , pem . length ( ) - END_CERT_LINE_LENGTH ) ; return Base64 . getDecoder ( ) . decode ( pem ) ; } catch ( Exception e ) { // Not a valid PEM encoded certificate , return original array .
r... |
public class SQLiteDatabase { /** * Registers a CustomFunction callback as a function that can be called from
* SQLite database triggers .
* @ param name the name of the sqlite3 function
* @ param numArgs the number of arguments for the function
* @ param function callback to call when the function is executed ... | // Create wrapper ( also validates arguments ) .
SQLiteCustomFunction wrapper = new SQLiteCustomFunction ( name , numArgs , function ) ; synchronized ( mLock ) { throwIfNotOpenLocked ( ) ; mConfigurationLocked . customFunctions . add ( wrapper ) ; try { mConnectionPoolLocked . reconfigure ( mConfigurationLocked ) ; } c... |
public class NameUtil { /** * Translate the input ejbname to be used by ejbdeploy generated file name
* according to the following rules .
* 1 . Leading and trailing white spaces are trimmed .
* 2 . All non - alphanumeric characters are replaced by " _ " to avoid invalid
* file name character since < ejb - name... | // trim leading and trailing blanks
ejbName = ejbName . trim ( ) ; // limits to the first Max _ EjbName _ Size characters
int len = ejbName . length ( ) ; if ( len > Max_EjbName_Size ) { len = Max_EjbName_Size ; } // translate non - alphanumeric characters to " _ "
char translated [ ] = new char [ len ] ; for ( int i =... |
public class Choice6 { /** * { @ inheritDoc } */
@ Override public < G > Choice6 < A , B , C , D , E , G > pure ( G g ) { } } | return f ( g ) ; |
public class SpiderService { /** * Verify that all ColumnFamilies needed for the given application exist . */
private void verifyApplicationCFs ( ApplicationDefinition oldAppDef , ApplicationDefinition appDef ) { } } | // Add new table - level CFs :
Tenant tenant = Tenant . getTenant ( appDef ) ; DBService dbService = DBService . instance ( tenant ) ; for ( TableDefinition tableDef : appDef . getTableDefinitions ( ) . values ( ) ) { dbService . createStoreIfAbsent ( objectsStoreName ( tableDef ) , true ) ; dbService . createStoreIfAb... |
public class PathUtils { /** * Answer the path with the last file name removed , using forward
* slash ( ' / ' ) as the path separator character .
* Answer null for a path which contains no slashes .
* Answer null for a path which is a single slash character .
* Answer the path which is a single slash character... | String parent = null ; int lastIndex = path . lastIndexOf ( '/' ) ; if ( lastIndex != - 1 ) { if ( path . length ( ) == 1 ) { parent = null ; } else if ( lastIndex == 0 ) { parent = "/" ; } else { parent = path . substring ( 0 , lastIndex ) ; } } return parent ; |
public class NotifierBase { /** * Call a service method by using a task worker .
* The same service will be retrieved each time this method is called .
* This method is called from the JIT ( JRebirth Internal Thread ) < br / >
* @ param wave the wave that contains all informations */
@ SuppressWarnings ( "uncheck... | // Use only the Service class to retrieve the same instance each time
final Service service = globalFacade ( ) . serviceFacade ( ) . retrieve ( ( Class < Service > ) wave . componentClass ( ) ) ; if ( service == null ) { LOGGER . error ( SERVICE_NOT_FOUND_ERROR , wave . toString ( ) ) ; // When developer mode is activa... |
public class DRL6Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 209:1 : annotationElementValuePair [ AnnotationDescr descr , AnnotatedDescrBuilder inDescrBuilder ] : key = ID EQUALS _ ASSIGN val = annotationValue [ inDescrBuilder ] ; */
public final void annotationEl... | Token key = null ; Object val = null ; try { // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 210:3 : ( key = ID EQUALS _ ASSIGN val = annotationValue [ inDescrBuilder ] )
// src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 210:5 : key = ID EQUALS _ ASSIG... |
public class PolyLabel { /** * Signed distance from point to polygon outline ( negative if point is outside ) */
private static float pointToPolygonDist ( double x , double y , Polygon polygon ) { } } | boolean inside = false ; double minDistSq = Double . POSITIVE_INFINITY ; // External ring
LineString exterior = polygon . getExteriorRing ( ) ; for ( int i = 0 , n = exterior . getNumPoints ( ) - 1 , j = n - 1 ; i < n ; j = i , i ++ ) { Coordinate a = exterior . getCoordinateN ( i ) ; Coordinate b = exterior . getCoord... |
public class InternalServerErrorException { /** * Details about the error .
* @ param errorDetails
* Details about the error . */
@ com . fasterxml . jackson . annotation . JsonProperty ( "ErrorDetails" ) public void setErrorDetails ( java . util . Collection < ErrorDetail > errorDetails ) { } } | if ( errorDetails == null ) { this . errorDetails = null ; return ; } this . errorDetails = new java . util . ArrayList < ErrorDetail > ( errorDetails ) ; |
public class WidgetUtil { /** * Gets the pre - made HTML Widget for the specified guild using the specified
* settings . The widget will only display correctly if the guild in question
* has the Widget enabled . Additionally , this method can be used independently
* of being on the guild in question .
* @ param... | Checks . notNull ( guildId , "GuildId" ) ; Checks . notNull ( theme , "WidgetTheme" ) ; Checks . notNegative ( width , "Width" ) ; Checks . notNegative ( height , "Height" ) ; return String . format ( WIDGET_HTML , guildId , theme . name ( ) . toLowerCase ( ) , width , height ) ; |
public class IdStrategy { /** * Generates a schema from the given class . If this strategy is part of a group ,
* the existing fields of that group ' s schema will be re - used . */
protected < T > Schema < T > newSchema ( Class < T > typeClass ) { } } | // check if this is part of a group
if ( primaryGroup != null ) { // only pojos created by runtime schema support groups
final Schema < T > s = primaryGroup . getSchemaWrapper ( typeClass , true ) . getSchema ( ) ; if ( s instanceof RuntimeSchema ) { final RuntimeSchema < T > rs = ( RuntimeSchema < T > ) s ; final Arra... |
public class ANNISUserConfigurationManager { /** * Writes the user to the disk
* @ param user
* @ return True if successful . */
public boolean writeUser ( User user ) { } } | // save user info to file
if ( resourcePath != null ) { lock . writeLock ( ) . lock ( ) ; try { File userDir = new File ( resourcePath , "users" ) ; if ( userDir . isDirectory ( ) ) { // get the file which corresponds to the user
File userFile = new File ( userDir . getAbsolutePath ( ) , user . getName ( ) ) ; Properti... |
public class CmsSynchronizeSettingsDialog { /** * Commits the edited synchronize settings to the user settings . < p > */
@ Override public void actionCommit ( ) { } } | List < Throwable > errors = new ArrayList < Throwable > ( ) ; try { // set the synchronize settings
CmsUserSettings userSettings = new CmsUserSettings ( getCms ( ) ) ; m_synchronizeSettings . checkValues ( getCms ( ) ) ; userSettings . setSynchronizeSettings ( m_synchronizeSettings ) ; userSettings . save ( getCms ( ) ... |
public class TopLevelGedDocumentMongoToGedObjectVisitor { /** * { @ inheritDoc } */
@ Override public final void visit ( final FamilyDocumentMongo document ) { } } | gedObject = new Family ( parent , new ObjectId ( document . getString ( ) ) ) ; |
public class ServiceContext { /** * Returns the service request . */
public static ServletResponse getContextResponse ( ) { } } | ServiceContext context = ( ServiceContext ) _localContext . get ( ) ; if ( context != null ) return context . _response ; else return null ; |
public class MemorySegment { /** * Equals two memory segment regions .
* @ param seg2 Segment to equal this segment with
* @ param offset1 Offset of this segment to start equaling
* @ param offset2 Offset of seg2 to start equaling
* @ param length Length of the equaled memory region
* @ return true if equal ,... | int i = 0 ; // we assume unaligned accesses are supported .
// Compare 8 bytes at a time .
while ( i <= length - 8 ) { if ( getLong ( offset1 + i ) != seg2 . getLong ( offset2 + i ) ) { return false ; } i += 8 ; } // cover the last ( length % 8 ) elements .
while ( i < length ) { if ( get ( offset1 + i ) != seg2 . get ... |
public class Tracer { /** * Return connection listener
* @ param poolName The name of the pool
* @ param mcp The managed connection pool
* @ param cl The connection listener
* @ param kill Kill the listener
* @ param interleaving Interleaving flag
* @ param callstack The call stack */
public static synchron... | if ( ! interleaving ) { if ( ! kill ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . RETURN_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : ""... |
public class LaJobRunner { protected void logJobException ( LaJobRuntime runtime , String bigMsg , Throwable cause ) { } } | // bigMsg contains stack - trace
if ( isBusinessStoppedException ( cause ) ) { JobNoticeLog . log ( runtime . getNoticeLogLevel ( ) , ( ) -> bigMsg ) ; if ( noticeLogHook != null ) { noticeLogHook . hookStopped ( runtime , bigMsg , OptionalThing . of ( cause ) ) ; } } else { if ( errorLogHook != null ) { final Optional... |
public class ScoreBuildHistogram { /** * giving it an improved prediction ) . */
private void score_decide ( Chunk chks [ ] , Chunk nids , Chunk wrks , Chunk tree , int nnids [ ] ) { } } | for ( int row = 0 ; row < nids . _len ; row ++ ) { // Over all rows
int nid = ( int ) nids . at80 ( row ) ; // Get Node to decide from
if ( isDecidedRow ( nid ) ) { // already done
nnids [ row ] = ( nid - _leaf ) ; continue ; } // Score row against current decisions & assign new split
boolean oob = isOOBRow ( nid ) ; i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.