signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CompositeColumnEntityMapper { /** * Iterate through the list and create a column for each element
* @ param clm
* @ param entity
* @ throws IllegalArgumentException
* @ throws IllegalAccessException */
public void fillMutationBatch ( ColumnListMutation < ByteBuffer > clm , Object entity ) throws Il... | List < ? > list = ( List < ? > ) containerField . get ( entity ) ; if ( list != null ) { for ( Object element : list ) { fillColumnMutation ( clm , element ) ; } } |
public class TaskSummaryQueryCriteriaUtil { /** * This method checks whether or not the query * already * contains a limiting criteria ( in short , a criteria that limits results
* of the query ) that refers to the user or ( the user ' s groups ) . If there is no user / group limiting criteria , then a
* { @ link Q... | List < String > groupIds = userGroupCallback . getGroupsForUser ( userId ) ; Set < String > userAndGroupIds = new HashSet < String > ( ) ; if ( groupIds != null ) { userAndGroupIds . addAll ( groupIds ) ; } userAndGroupIds . add ( userId ) ; if ( ! criteriaListForcesUserLimitation ( userAndGroupIds , queryWhere . getCr... |
public class XmlElementWrapperPlugin { /** * Delete all candidate classes together with setter / getter methods and helper methods from
* < code > ObjectFactory < / code > .
* @ return the number of deletions performed */
private int deleteCandidates ( Outline outline , Collection < Candidate > candidates ) { } } | int deletionCount = 0 ; writeSummary ( "Deletions:" ) ; // Visit all candidate classes .
for ( Candidate candidate : candidates ) { if ( ! candidate . canBeRemoved ( ) ) { continue ; } // Get the defined class for candidate class .
JDefinedClass candidateClass = candidate . getClazz ( ) ; deleteClass ( outline , candid... |
public class AbstractSREInstallPage { /** * Returns whether the name is already in use by an existing SRE .
* @ param name new name .
* @ return whether the name is already in use . */
private boolean isDuplicateName ( String name ) { } } | if ( this . existingNames != null ) { final String newName = Strings . nullToEmpty ( name ) ; for ( final String existingName : this . existingNames ) { if ( newName . equals ( existingName ) ) { return true ; } } } return false ; |
public class NavigationView { /** * Fired after the map is ready , this is our cue to finish
* setting up the rest of the plugins / location engine .
* Also , we check for launch data ( coordinates or route ) .
* @ param mapboxMap used for route , camera , and location UI
* @ since 0.6.0 */
@ Override public vo... | mapboxMap . setStyle ( ThemeSwitcher . retrieveMapStyle ( getContext ( ) ) , new Style . OnStyleLoaded ( ) { @ Override public void onStyleLoaded ( @ NonNull Style style ) { initializeNavigationMap ( mapView , mapboxMap ) ; initializeWayNameListener ( ) ; onNavigationReadyCallback . onNavigationReady ( navigationViewMo... |
public class ClassSourceImpl_MappedSimple { /** * < p > Open a stream for a named class which used a named resource . < / p >
* < p > Answer null if the provider does not contain the named resource .
* See { @ link # isProviderResource ( String ) } . < / p >
* @ param className The name of the class which mapped ... | String methodName = "openResourceStream" ; if ( ! isProviderResource ( resourceName ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] [ {1} ] ENTER/RETURN [ null ]: Provider does not contain [ {2} ]" , getHashText ( ) , methodName , resourceName ) ) ; } return null ; } InputStre... |
public class BlockchainImporter { /** * Gets the block .
* @ param blockNumber
* the block number
* @ return the block */
public Block getBlock ( BigInteger blockNumber ) { } } | return EtherObjectConverterUtil . convertEtherBlockToKunderaBlock ( client . getBlock ( blockNumber , false ) , false ) ; |
public class Util { /** * Stores { @ code string } to { @ code file } using { @ link # ENCODING _ UTF _ 8 } .
* @ param string the { @ link String } to store
* @ param file the file to store to
* @ throws IOException on IO errors */
public static void write ( String string , File file ) throws IOException { } } | try ( Writer w = new OutputStreamWriter ( new FileOutputStream ( file ) , ENCODING_UTF_8 ) ) { w . write ( string ) ; } |
public class GPXPoint { /** * Set the Magnetic variation ( in degrees ) of a point .
* @ param contentBuffer Contains the information to put in the table */
public final void setMagvar ( StringBuilder contentBuffer ) { } } | ptValues [ GpxMetadata . PTMAGVAR ] = Double . parseDouble ( contentBuffer . toString ( ) ) ; |
public class QueryValidator { /** * This method traverses the predicate map and once it reaches the last operator
* in the tree , it checks it for a shorthand representation . If one exists then
* that shorthand representation is replaced with its longhand version .
* For example : { " $ ne " : . . . }
* is rep... | Map < String , Object > accumulator = new HashMap < String , Object > ( ) ; if ( predicate == null || predicate . isEmpty ( ) ) { return predicate ; } String operator = ( String ) predicate . keySet ( ) . toArray ( ) [ 0 ] ; Object subPredicate = predicate . get ( operator ) ; if ( subPredicate instanceof Map ) { accum... |
public class LogRef { /** * * Log a warning level message . * *
* @ param msg
* Log message *
* @ param e
* The exception that reflects the condition . */
public void warn ( String msg , Throwable e ) { } } | doLog ( msg , LOG_WARNING , null , e ) ; |
public class CPInstancePersistenceImpl { /** * Removes all the cp instances where uuid = & # 63 ; from the database .
* @ param uuid the uuid */
@ Override public void removeByUuid ( String uuid ) { } } | for ( CPInstance cpInstance : findByUuid ( uuid , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpInstance ) ; } |
public class HlsSettings { /** * Gets the masterPlaylistSettings value for this HlsSettings .
* @ return masterPlaylistSettings * The settings for the master playlist . This field is optional
* and if it is not set will default
* to a { @ link MasterPlaylistSettings } with a refresh
* type of { @ link RefreshTy... | return masterPlaylistSettings ; |
public class RTMPMinaIoHandler { /** * { @ inheritDoc } */
@ Override public void exceptionCaught ( IoSession session , Throwable cause ) throws Exception { } } | log . warn ( "Exception caught {}" , cause . getMessage ( ) ) ; if ( log . isDebugEnabled ( ) ) { log . error ( "Exception detail" , cause ) ; } |
public class JobGraph { /** * Creates the { @ link JComponent } that shows the graph
* @ return */
private JComponent createJComponent ( final DirectedGraph < Object , JobGraphLink > graph ) { } } | final int vertexCount = graph . getVertexCount ( ) ; logger . debug ( "Rendering graph with {} vertices" , vertexCount ) ; final JobGraphLayoutTransformer layoutTransformer = new JobGraphLayoutTransformer ( _analysisJobBuilder , graph ) ; final Dimension preferredSize = layoutTransformer . getPreferredSize ( ) ; final ... |
public class ByteBuffer { /** * Returns the short at the specified index .
* < p > The 2 bytes starting at the specified index are composed into a short according to the
* current byte order and returned . The position is not changed . < / p >
* @ param index the index , must not be negative and equal or less tha... | short bytes = 0 ; if ( order == ByteOrder . BIG_ENDIAN ) { bytes = ( short ) ( byteArray . get ( baseOffset ) << 8 ) ; bytes |= ( byteArray . get ( baseOffset + 1 ) & 0xFF ) ; } else { bytes = ( short ) ( byteArray . get ( baseOffset + 1 ) << 8 ) ; bytes |= ( byteArray . get ( baseOffset ) & 0xFF ) ; } return bytes ; |
public class NormalizedKeySorter { /** * Gets an iterator over all records in this buffer in their logical order .
* @ return An iterator returning the records in their logical order . */
@ Override public final MutableObjectIterator < T > getIterator ( ) { } } | return new MutableObjectIterator < T > ( ) { private final int size = size ( ) ; private int current = 0 ; private int currentSegment = 0 ; private int currentOffset = 0 ; private MemorySegment currentIndexSegment = sortIndex . get ( 0 ) ; @ Override public T next ( T target ) { if ( this . current < this . size ) { th... |
public class MaterialSplitPanel { /** * Get the dock value . */
public Dock getDock ( ) { } } | return options . dock != null ? Dock . fromStyleName ( options . dock ) : null ; |
public class LeaderAppender { /** * Handles an append failure . */
protected void handleAppendRequestFailure ( MemberState member , AppendRequest request , Throwable error ) { } } | super . handleAppendRequestFailure ( member , request , error ) ; // Trigger commit futures if necessary .
updateHeartbeatTime ( member , error ) ; |
public class OpenCms { /** * Reads the requested resource from the OpenCms VFS ,
* and in case a directory name is requested , the default files of the
* directory will be looked up and the first match is returned . < p >
* The resource that is returned is always a < code > { @ link org . opencms . file . CmsFile... | return OpenCmsCore . getInstance ( ) . initResource ( cms , resourceName , req , res ) ; |
public class PairSet { /** * Creates a new { @ link PairSet } instance with only non - empty transactions
* and items .
* @ return the compacted { @ link PairSet } instance */
public PairSet < T , I > compacted ( ) { } } | // trivial case
if ( isEmpty ( ) ) return empty ( ) ; // compute the new universe
final Set < T > newAllTransactions = new LinkedHashSet < T > ( involvedTransactions ( ) ) ; final Set < I > newAllItems = new LinkedHashSet < I > ( involvedItems ( ) ) ; if ( newAllTransactions . size ( ) == allTransactions . size ( ) && ... |
public class JournalCreator { /** * Create a journal entry , add the arguments , and invoke the method . */
public Date purgeObject ( Context context , String pid , String logMessage ) throws ServerException { } } | try { CreatorJournalEntry cje = new CreatorJournalEntry ( METHOD_PURGE_OBJECT , context ) ; cje . addArgument ( ARGUMENT_NAME_PID , pid ) ; cje . addArgument ( ARGUMENT_NAME_LOG_MESSAGE , logMessage ) ; return ( Date ) cje . invokeAndClose ( delegate , writer ) ; } catch ( JournalException e ) { throw new GeneralExcept... |
public class MainMenuBar { /** * This method initializes this */
private void initialize ( ) { } } | this . add ( getMenuFile ( ) ) ; this . add ( getMenuEdit ( ) ) ; this . add ( getMenuView ( ) ) ; this . add ( getMenuAnalyse ( ) ) ; this . add ( getMenuReport ( ) ) ; this . add ( getMenuTools ( ) ) ; this . add ( getMenuImport ( ) ) ; this . add ( getMenuOnline ( ) ) ; this . add ( getMenuHelp ( ) ) ; |
public class ZRTPCache { /** * Updates the entry for the selected remote ZID .
* @ param retainedSecret
* the new retained secret .
* @ param expiryTime
* the expiry time , 0 means the entry should be erased .
* @ param keepRs2
* specifies whether the old rs2 should be kept rather than
* copying old rs1 i... | if ( platform . isVerboseLogging ( ) ) { platform . getLogger ( ) . log ( "ZRTPCache: updateEntry(" + expiryTime + ", " + trust + ", " + platform . getUtils ( ) . byteToHexString ( retainedSecret ) + ", " + platform . getUtils ( ) . byteToHexString ( rs2 ) + "," + number + ")" ) ; } if ( expiryTime == 0 ) { cache . rem... |
public class ELParser { /** * Assignment */
final public void Assignment ( ) throws ParseException { } } | if ( jj_2_2 ( 4 ) ) { LambdaExpression ( ) ; } else { switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case START_SET_OR_MAP : case INTEGER_LITERAL : case FLOATING_POINT_LITERAL : case STRING_LITERAL : case TRUE : case FALSE : case NULL : case LPAREN : case LBRACK : case NOT0 : case NOT1 : case EMPTY : case MINUS :... |
public class GitlabAPI { /** * Create a new deploy key for the project
* @ param targetProjectId The id of the Gitlab project
* @ param title The title of the ssh key
* @ param key The public key
* @ return The new GitlabSSHKey
* @ throws IOException on gitlab api call error */
public GitlabSSHKey createDeplo... | return createDeployKey ( targetProjectId , title , key , false ) ; |
public class UtilDecompositons_DDRM { /** * Creates a zeros matrix only if A does not already exist . If it does exist it will fill
* the lower triangular portion with zeros . */
public static DMatrixRMaj checkZerosLT ( DMatrixRMaj A , int numRows , int numCols ) { } } | if ( A == null ) { return new DMatrixRMaj ( numRows , numCols ) ; } else if ( numRows != A . numRows || numCols != A . numCols ) { A . reshape ( numRows , numCols ) ; A . zero ( ) ; } else { for ( int i = 0 ; i < A . numRows ; i ++ ) { int index = i * A . numCols ; int end = index + Math . min ( i , A . numCols ) ; ; w... |
public class responderpolicylabel_responderpolicy_binding { /** * Use this API to fetch responderpolicylabel _ responderpolicy _ binding resources of given name . */
public static responderpolicylabel_responderpolicy_binding [ ] get ( nitro_service service , String labelname ) throws Exception { } } | responderpolicylabel_responderpolicy_binding obj = new responderpolicylabel_responderpolicy_binding ( ) ; obj . set_labelname ( labelname ) ; responderpolicylabel_responderpolicy_binding response [ ] = ( responderpolicylabel_responderpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class ObjectProperty { /** * Sets the node type . Must be one of
* { @ link Token # COLON } , { @ link Token # GET } , or { @ link Token # SET } .
* @ throws IllegalArgumentException if { @ code nodeType } is invalid */
public void setNodeType ( int nodeType ) { } } | if ( nodeType != Token . COLON && nodeType != Token . GET && nodeType != Token . SET && nodeType != Token . METHOD ) throw new IllegalArgumentException ( "invalid node type: " + nodeType ) ; setType ( nodeType ) ; |
public class JiteClass { /** * Defines a new field on the target class
* @ param fieldName the field name
* @ param modifiers the modifier bitmask , made by OR ' ing constants from ASM ' s { @ link Opcodes } interface
* @ param signature the field signature , on standard JVM notation
* @ param value the default... | FieldDefinition field = new FieldDefinition ( fieldName , modifiers , signature , value ) ; this . fields . add ( field ) ; return field ; |
public class TaskUtil { /** * Run the given tasks until any exception happen
* @ param tasks
* @ return the exception */
@ SafeVarargs @ SuppressWarnings ( "unchecked" ) public static < T extends Exception > Optional < T > firstFail ( ActionE0 < T > ... tasks ) { } } | for ( ActionE0 < T > task : tasks ) { try { task . call ( ) ; } catch ( Exception t ) { return Optional . of ( ( T ) t ) ; } } return Optional . empty ( ) ; |
public class IsoJarClassLoader { /** * @ param className
* @ return String */
protected String formatClassName ( String className ) { } } | className = className . replace ( '/' , '~' ) ; if ( classNameReplacementChar == '\u0000' ) { // ' / ' is used to map the package to the path
className = className . replace ( '.' , '/' ) + ".class" ; } else { // Replace ' . ' with custom char , such as ' _ '
className = className . replace ( '.' , classNameReplacement... |
public class hqlParser { /** * hql . g : 659:1 : exprList : ( TRAILING | LEADING | BOTH ) ? ( expression ( ( COMMA ! expression ) + | f = FROM expression | AS ! identifier ) ? | f2 = FROM expression ) ? ; */
public final hqlParser . exprList_return exprList ( ) throws RecognitionException { } } | hqlParser . exprList_return retval = new hqlParser . exprList_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token f = null ; Token f2 = null ; Token TRAILING287 = null ; Token LEADING288 = null ; Token BOTH289 = null ; Token COMMA291 = null ; Token AS294 = null ; ParserRuleReturnScope expr... |
public class JaxRsFactoryImplicitBeanCDICustomizer { /** * ( non - Javadoc )
* @ see com . ibm . ws . jaxrs20 . api . JaxRsFactoryBeanCustomizer # onSingletonServiceInit ( java . lang . Object , java . lang . Object ) */
@ SuppressWarnings ( "unchecked" ) @ Override public < T > T onSingletonServiceInit ( T service ,... | if ( context == null ) { return null ; } Map < Class < ? > , ManagedObject < ? > > newContext = ( Map < Class < ? > , ManagedObject < ? > > ) ( context ) ; if ( newContext . isEmpty ( ) ) { return null ; } ManagedObject < ? > managedObject = newContext . get ( service . getClass ( ) ) ; Object newServiceObject = null ;... |
public class RestClusterClient { /** * Creates a { @ code CompletableFuture } that polls a { @ code AsynchronouslyCreatedResource } until
* its { @ link AsynchronouslyCreatedResource # queueStatus ( ) QueueStatus } becomes
* { @ link QueueStatus . Id # COMPLETED COMPLETED } . The future completes with the result of... | return pollResourceAsync ( resourceFutureSupplier , new CompletableFuture < > ( ) , 0 ) ; |
public class Constraint { /** * Builds a new constraint from the annotation data .
* @ param anno JSR - 303 annotation instance
* @ return a new constraint */
public static Constraint fromAnnotation ( Annotation anno ) { } } | if ( anno instanceof Min ) { return min ( ( ( Min ) anno ) . value ( ) ) ; } else if ( anno instanceof Max ) { return max ( ( ( Max ) anno ) . value ( ) ) ; } else if ( anno instanceof Size ) { return size ( ( ( Size ) anno ) . min ( ) , ( ( Size ) anno ) . max ( ) ) ; } else if ( anno instanceof Digits ) { return digi... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ReferenceSystemRefType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link ReferenceSystemRefType } ... | return new JAXBElement < ReferenceSystemRefType > ( _ReferenceSystemRef_QNAME , ReferenceSystemRefType . class , null , value ) ; |
public class BamUtils { /** * Utility to compute the coverage from a BAM file , and create a wig format file with the coverage values according
* to a window size ( i . e . , span in wig format specification ) .
* @ param bamPath BAM file
* @ param coveragePath Wig file name where to save coverage values
* @ pa... | SAMFileHeader fileHeader = BamUtils . getFileHeader ( bamPath ) ; AlignmentOptions options = new AlignmentOptions ( ) ; options . setContained ( false ) ; BamManager alignmentManager = new BamManager ( bamPath ) ; Iterator < SAMSequenceRecord > iterator = fileHeader . getSequenceDictionary ( ) . getSequences ( ) . iter... |
public class MemoryReport { /** * Get the memory estimate ( in bytes ) for the specified type of memory , using the current ND4J data type
* @ param memoryType Type of memory to get the estimate for invites
* @ param minibatchSize Mini batch size to estimate the memory for
* @ param memoryUseMode The memory use m... | return getMemoryBytes ( memoryType , minibatchSize , memoryUseMode , cacheMode , DataTypeUtil . getDtypeFromContext ( ) ) ; |
public class ListServersResult { /** * An array of servers that were listed .
* @ param servers
* An array of servers that were listed . */
public void setServers ( java . util . Collection < ListedServer > servers ) { } } | if ( servers == null ) { this . servers = null ; return ; } this . servers = new java . util . ArrayList < ListedServer > ( servers ) ; |
public class FSSpecStore { /** * For multiple { @ link FlowSpec } s to be loaded , catch Exceptions when one of them failed to be loaded and
* continue with the rest .
* The { @ link IOException } thrown from standard FileSystem call will be propagated , while the file - specific
* exception will be caught to ens... | FileStatus [ ] fileStatuses = fs . listStatus ( directory ) ; for ( FileStatus fileStatus : fileStatuses ) { if ( fileStatus . isDirectory ( ) ) { getSpecs ( fileStatus . getPath ( ) , specs ) ; } else { try { specs . add ( readSpecFromFile ( fileStatus . getPath ( ) ) ) ; } catch ( Exception e ) { log . warn ( String ... |
public class AWSKMSClient { /** * Returns a random byte string that is cryptographically secure .
* By default , the random byte string is generated in AWS KMS . To generate the byte string in the AWS CloudHSM
* cluster that is associated with a < a
* href = " http : / / docs . aws . amazon . com / kms / latest /... | request = beforeClientExecution ( request ) ; return executeGenerateRandom ( request ) ; |
public class TraceMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Trace trace , ProtocolMarshaller protocolMarshaller ) { } } | if ( trace == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( trace . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( trace . getDuration ( ) , DURATION_BINDING ) ; protocolMarshaller . marshall ( trace . getSegments ( ) , SEGMENT... |
public class JCalValue { /** * Creates a multi - valued value .
* @ param values the values
* @ return the jCal value */
public static JCalValue multi ( List < ? > values ) { } } | List < JsonValue > multiValues = new ArrayList < JsonValue > ( values . size ( ) ) ; for ( Object value : values ) { multiValues . add ( new JsonValue ( value ) ) ; } return new JCalValue ( multiValues ) ; |
public class AVIMConversation { /** * lastMessage 的来源 :
* 1 . sqlite conversation 表中的 lastMessage , conversation query 后存储下来的
* 2 . sqlite message 表中存储的最新的消息
* 3 . 实时通讯推送过来的消息也要及时更新 lastMessage
* @ param lastMessage */
void setLastMessage ( AVIMMessage lastMessage ) { } } | if ( null != lastMessage ) { if ( null == this . lastMessage ) { this . lastMessage = lastMessage ; } else { if ( this . lastMessage . getTimestamp ( ) <= lastMessage . getTimestamp ( ) ) { this . lastMessage = lastMessage ; } } } |
public class ThreadLocalStack { /** * Pop and return the top element of the stack for this thread
* @ return The previously top element of the stack for this thread
* @ throws EmptyStackException is thrown if the stack for this thread is empty */
public E pop ( ) throws EmptyStackException { } } | E answer = peek ( ) ; // Throws EmptyStackException if there ' s nothing there
_elements . get ( ) . remove ( _elements . get ( ) . size ( ) - 1 ) ; return answer ; |
public class Matrices { /** * Creates a mul function that multiplies given { @ code value } by it ' s argument .
* @ param arg a value to be multiplied by function ' s argument
* @ return a closure that does { @ code _ * _ } */
public static MatrixFunction asMulFunction ( final double arg ) { } } | return new MatrixFunction ( ) { @ Override public double evaluate ( int i , int j , double value ) { return value * arg ; } } ; |
public class NIORestClient { /** * HEAD */
public CompletableFuture < HttpHeaders > headForHeaders ( String url , Object ... uriVariables ) throws RestClientException { } } | return toCompletableFuture ( template . headForHeaders ( url , uriVariables ) ) ; |
public class RoseStringUtil { /** * 支持 ' * ' 前后的匹配
* @ param array
* @ param value
* @ return */
public static boolean matches ( String [ ] patterns , String value ) { } } | for ( int i = 0 ; i < patterns . length ; i ++ ) { String pattern = patterns [ i ] ; if ( pattern . equals ( value ) ) { return true ; } if ( pattern . endsWith ( "*" ) ) { if ( value . startsWith ( pattern . substring ( 0 , pattern . length ( ) - 1 ) ) ) { return true ; } } if ( pattern . startsWith ( "*" ) ) { if ( v... |
public class MemoryFileSystem { /** * { @ inheritDoc } */
public synchronized FileEntry put ( DirectoryEntry parent , String name , InputStream content ) throws IOException { } } | parent . getClass ( ) ; parent = getNormalizedParent ( parent ) ; List < Entry > entries = getEntriesList ( parent ) ; for ( Iterator < Entry > i = entries . iterator ( ) ; i . hasNext ( ) ; ) { Entry entry = ( Entry ) i . next ( ) ; if ( name . equals ( entry . getName ( ) ) ) { if ( entry instanceof FileEntry ) { i .... |
public class WorkbookWriter { /** * Turns this { @ link WorkbookWriter } to certain sheet . Sheet names can be
* found by { @ link # getAllSheetNames } .
* @ param index
* of a sheet
* @ return this { @ link WorkbookWriter } */
public WorkbookWriter turnToSheet ( int index ) { } } | checkElementIndex ( index , workbook . getNumberOfSheets ( ) ) ; sheet = workbook . getSheetAt ( index ) ; return this ; |
public class CmsUserEditDialog { /** * Initializes the site combo box . < p >
* @ param settings user settings */
void iniSite ( CmsUserSettings settings ) { } } | List < CmsSite > sitesList = OpenCms . getSiteManager ( ) . getAvailableSites ( m_cms , false , false , m_ou . getValue ( ) ) ; IndexedContainer container = new IndexedContainer ( ) ; container . addContainerProperty ( "caption" , String . class , "" ) ; CmsSite firstNoRootSite = null ; for ( CmsSite site : sitesList )... |
public class CriteriaReader { /** * Main entry point to read criteria data .
* @ param properties project properties
* @ param data criteria data block
* @ param dataOffset offset of the data start within the larger data block
* @ param entryOffset offset of start node for walking the tree
* @ param prompts o... | m_properties = properties ; m_prompts = prompts ; m_fields = fields ; m_criteriaType = criteriaType ; m_dataOffset = dataOffset ; if ( m_criteriaType != null ) { m_criteriaType [ 0 ] = true ; m_criteriaType [ 1 ] = true ; } m_criteriaBlockMap . clear ( ) ; m_criteriaData = data ; m_criteriaTextStart = MPPUtility . getS... |
public class SendGrid { /** * Remove a request header .
* @ param key the header key to remove .
* @ return the new set of request headers . */
public Map < String , String > removeRequestHeader ( String key ) { } } | this . requestHeaders . remove ( key ) ; return getRequestHeaders ( ) ; |
public class JsfFaceletScannerPlugin { /** * Tries to find a { @ link JsfFaceletDescriptor } in the store with the given
* fullFilePath . Creates a new one if no descriptor could be found .
* @ param fullFilePath
* the file path of the wanted file
* @ param context
* The scanner context .
* @ return a { @ l... | // can ' t handle EL - expressions
if ( isElExpression ( fullFilePath ) ) { return null ; } return context . peek ( FileResolver . class ) . require ( fullFilePath , JsfFaceletDescriptor . class , context ) ; |
public class CmsPublishGroupPanel { /** * Updates the check box state for this group . < p >
* @ param value the state to use for updating the check box */
public void updateCheckboxState ( CmsPublishItemStateSummary value ) { } } | CheckBoxUpdate update = CmsPublishSelectPanel . updateCheckbox ( value ) ; m_selectGroup . setTitle ( update . getAction ( ) ) ; m_selectGroup . setState ( update . getState ( ) , false ) ; |
public class Vector2f { /** * Set the value of the specified component of this vector .
* @ param component
* the component whose value to set , within < code > [ 0 . . 1 ] < / code >
* @ param value
* the value to set
* @ return this
* @ throws IllegalArgumentException if < code > component < / code > is n... | switch ( component ) { case 0 : x = value ; break ; case 1 : y = value ; break ; default : throw new IllegalArgumentException ( ) ; } return this ; |
public class SerialImpl { /** * Get the RTS ( request - to - send ) pin state .
* @ throws IllegalStateException thrown if the serial port is not already open .
* @ throws IOException thrown on any error . */
public boolean getRTS ( ) throws IllegalStateException , IOException { } } | // validate state
if ( isClosed ( ) ) throw new IllegalStateException ( "Serial connection is not open; cannot 'getRTS()'." ) ; // get pin state
return com . pi4j . jni . Serial . getRTS ( fileDescriptor ) ; |
public class MwsXmlWriter { /** * Output escaped value .
* @ param value */
private void escape ( String value ) { } } | int n = value . length ( ) ; int i = 0 ; for ( int j = 0 ; j < n ; ++ j ) { int k = ESCAPED_CHARS . indexOf ( value . charAt ( j ) ) ; if ( k >= 0 ) { if ( i < j ) { append ( value , i , j ) ; } append ( ESCAPE_SEQ [ k ] ) ; i = j + 1 ; } } if ( i < n ) { append ( value , i , n ) ; } |
public class RTMEventHandler { /** * Returns the Class object of the Event implementation . */
public Class < E > getEventClass ( ) { } } | if ( cachedClazz != null ) { return cachedClazz ; } Class < ? > clazz = this . getClass ( ) ; while ( clazz != Object . class ) { try { Type mySuperclass = clazz . getGenericSuperclass ( ) ; Type tType = ( ( ParameterizedType ) mySuperclass ) . getActualTypeArguments ( ) [ 0 ] ; cachedClazz = ( Class < E > ) Class . fo... |
public class RDBMetadataExtractionTools { /** * Retrieves the unique attributes ( s )
* @ param md
* @ return
* @ throws SQLException */
private static void getUniqueAttributes ( DatabaseMetaData md , DatabaseRelationDefinition relation , QuotedIDFactory idfac ) throws SQLException { } } | RelationID id = relation . getID ( ) ; // extracting unique
try ( ResultSet rs = md . getIndexInfo ( null , id . getSchemaName ( ) , id . getTableName ( ) , true , true ) ) { extractUniqueAttributes ( relation , idfac , rs ) ; } catch ( Exception e ) { // Workaround for MySQL - connector > = 8.0
try ( ResultSet rs = md... |
public class RawXJC2Mojo { /** * Returns array of command line arguments for XJC . These arguments are based on
* the configured arguments ( see { @ link # getArgs ( ) } ) but also include episode
* arguments .
* @ return String array of XJC command line options . */
protected List < String > getArguments ( ) { }... | final List < String > arguments = new ArrayList < String > ( getArgs ( ) ) ; final String httpproxy = getHttpproxy ( ) ; if ( httpproxy != null ) { arguments . add ( "-httpproxy" ) ; arguments . add ( httpproxy ) ; } if ( getEpisode ( ) && getEpisodeFile ( ) != null ) { arguments . add ( "-episode" ) ; arguments . add ... |
public class TieredBlockStore { /** * Increases the temp block size only if this temp block ' s parent dir has enough available space .
* @ param blockId block id
* @ param additionalBytes additional bytes to request for this block
* @ return a pair of boolean and { @ link BlockStoreLocation } . The boolean indic... | // NOTE : a temp block is supposed to be visible for its own writer , unnecessary to acquire
// block lock here since no sharing
try ( LockResource r = new LockResource ( mMetadataWriteLock ) ) { TempBlockMeta tempBlockMeta = mMetaManager . getTempBlockMeta ( blockId ) ; if ( tempBlockMeta . getParentDir ( ) . getAvail... |
public class InterfacedEventManager { /** * { @ inheritDoc }
* @ throws IllegalArgumentException
* If the provided listener does not implement { @ link net . dv8tion . jda . core . hooks . EventListener EventListener } */
@ Override public void register ( Object listener ) { } } | if ( ! ( listener instanceof EventListener ) ) { throw new IllegalArgumentException ( "Listener must implement EventListener" ) ; } listeners . add ( ( ( EventListener ) listener ) ) ; |
public class ExceptionUtil { /** * Returns the ' base ' message text of any exception , stripping off all
* nested exception text ( " nested exception is : etc . " ) . < p >
* The getMessage ( ) method of both RemoteException and EJBException have
* the helpful / annoying behavior of including the message text / ... | String message = null ; // RemoteException contains a ' detail ' field that holds the ' cause ' ,
// instead of the normal cause defined by Throwable . When detail is
// set , getMessage ( ) will include the text and stack of the detail ,
// which may ends up duplicating the message text .
// To avoid this , ' detail '... |
public class ApiOvhTelephony { /** * Check if security deposit transfer is possible between two billing accounts
* REST : POST / telephony / { billingAccount } / canTransferSecurityDeposit
* @ param billingAccountDestination [ required ] The destination billing account
* @ param billingAccount [ required ] The na... | String qPath = "/telephony/{billingAccount}/canTransferSecurityDeposit" ; StringBuilder sb = path ( qPath , billingAccount ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "billingAccountDestination" , billingAccountDestination ) ; String resp = exec ( qPath , "POST" , sb . toStri... |
public class ZooKeeperClient { /** * 从当前的node信息中获取对应的zk集群信息 */
private static List < String > getServerAddrs ( ) { } } | List < String > result = ArbitrateConfigUtils . getServerAddrs ( ) ; if ( result == null || result . size ( ) == 0 ) { result = Arrays . asList ( cluster ) ; } return result ; |
public class Ucode { /** * Set the ucode .
* @ param ucode
* The string representation of the ucode . It must consist
* of 32 hex letters .
* @ throws IllegalArgumentException
* { @ code ucode } is { @ code null } or it does not consist of
* 32 hex letters . */
public void setUcode ( String ucode ) { } } | if ( ucode == null ) { throw new IllegalArgumentException ( "'ucode' is null." ) ; } if ( UCODE_PATTERN . matcher ( ucode ) . matches ( ) == false ) { throw new IllegalArgumentException ( "The format of 'ucode' is wrong: " + ucode ) ; } mUcode = ucode ; byte [ ] data = getData ( ) ; for ( int i = 0 ; i < 32 ; i += 2 ) ... |
public class LoginHandler { /** * This method adds the player session to the
* { @ link SessionRegistryService } . The key being the remote udp address of
* the client and the session being the value .
* @ param playerSession
* @ param buffer
* Used to read the remote address of the client which is
* attemp... | InetSocketAddress remoteAdress = NettyUtils . readSocketAddress ( buffer ) ; if ( null != remoteAdress ) { udpSessionRegistry . putSession ( remoteAdress , playerSession ) ; } |
public class ControllerLinkBuilderFactory { /** * ( non - Javadoc )
* @ see org . springframework . hateoas . MethodLinkBuilderFactory # linkTo ( java . lang . Object ) */
@ Override public ControllerLinkBuilder linkTo ( Object invocationValue ) { } } | return WebHandler . linkTo ( invocationValue , ControllerLinkBuilder :: new , ( builder , invocation ) -> { MethodParameters parameters = MethodParameters . of ( invocation . getMethod ( ) ) ; Iterator < Object > parameterValues = Arrays . asList ( invocation . getArguments ( ) ) . iterator ( ) ; for ( MethodParameter ... |
public class BaseMonetaryAmountFormat { /** * Formats the given { @ link javax . money . MonetaryAmount } to a String .
* @ param amount the amount to format , not { @ code null }
* @ return the string printed using the settings of this formatter
* @ throws UnsupportedOperationException if the formatter is unable... | StringBuilder b = new StringBuilder ( ) ; try { print ( b , amount ) ; } catch ( IOException e ) { throw new IllegalStateException ( "Formatting error." , e ) ; } return b . toString ( ) ; |
public class MtasDataDoubleAdvanced { /** * ( non - Javadoc )
* @ see mtas . codec . util . DataCollector . MtasDataCollector # boundaryForSegment ( ) */
@ Override protected Double boundaryForSegment ( String segmentName ) throws IOException { } } | if ( segmentRegistration . equals ( SEGMENT_SORT_ASC ) || segmentRegistration . equals ( SEGMENT_SORT_DESC ) ) { Double thisLast = segmentValueTopListLast . get ( segmentName ) ; if ( thisLast == null ) { return null ; } else if ( segmentRegistration . equals ( SEGMENT_SORT_ASC ) ) { return thisLast * segmentNumber ; }... |
public class CmsScrollPanelImpl { /** * Update the position of the scrollbars . < p >
* If only the vertical scrollbar is present , it takes up the entire height of
* the right side . If only the horizontal scrollbar is present , it takes up
* the entire width of the bottom . If both scrollbars are present , the ... | if ( ! isAttached ( ) ) { return ; } /* * Measure the height and width of the content directly . Note that measuring
* the height and width of the container element ( which should be the same )
* doesn ' t work correctly in IE . */
Widget w = getWidget ( ) ; int contentHeight = ( w == null ) ? 0 : w . getOffsetHeig... |
public class CoNLLDocumentReaderAndWriter { /** * end class CoNLLIterator */
private static Iterator < String > splitIntoDocs ( Reader r ) { } } | if ( TREAT_FILE_AS_ONE_DOCUMENT ) { return Collections . singleton ( IOUtils . slurpReader ( r ) ) . iterator ( ) ; } else { Collection < String > docs = new ArrayList < String > ( ) ; ObjectBank < String > ob = ObjectBank . getLineIterator ( r ) ; StringBuilder current = new StringBuilder ( ) ; for ( String line : ob ... |
public class BuildMetrics { /** * Get the profiling container for the specified project
* @ param projectPath to look up */
public ProjectMetrics getProjectProfile ( String projectPath ) { } } | ProjectMetrics result = projects . get ( projectPath ) ; if ( result == null ) { result = new ProjectMetrics ( projectPath ) ; projects . put ( projectPath , result ) ; } return result ; |
public class SetUtil { /** * set1 , set2的差集 ( 在set1 , 不在set2中的对象 ) 的只读view , 不复制产生新的Set对象 .
* 如果尝试写入该View会抛出UnsupportedOperationException */
public static < E > Set < E > differenceView ( final Set < E > set1 , final Set < ? > set2 ) { } } | return Sets . difference ( set1 , set2 ) ; |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object createFromString ( EDataType eDataType , String initialValue ) { } } | switch ( eDataType . getClassifierID ( ) ) { case Ifc4Package . TRISTATE : return createTristateFromString ( eDataType , initialValue ) ; case Ifc4Package . IFC_ACTION_REQUEST_TYPE_ENUM : return createIfcActionRequestTypeEnumFromString ( eDataType , initialValue ) ; case Ifc4Package . IFC_ACTION_SOURCE_TYPE_ENUM : retu... |
public class RegxCriteria { /** * { @ inheritDoc } */
@ Override public void asDefinitionText ( final StringBuilder sb ) { } } | sb . append ( " --matches '" ) ; sb . append ( patternParm ) ; sb . append ( "'" ) ; |
public class GetAggregateConfigRuleComplianceSummaryResult { /** * Returns a list of AggregateComplianceCounts object .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAggregateComplianceCounts ( java . util . Collection ) } or
* { @ link # withAggregate... | if ( this . aggregateComplianceCounts == null ) { setAggregateComplianceCounts ( new com . amazonaws . internal . SdkInternalList < AggregateComplianceCount > ( aggregateComplianceCounts . length ) ) ; } for ( AggregateComplianceCount ele : aggregateComplianceCounts ) { this . aggregateComplianceCounts . add ( ele ) ; ... |
public class ElevationUtil { /** * Returns the alpha value of a shadow by interpolating between a minimum and maximum alpha
* value , depending on a specific elevation .
* @ param elevation
* The elevation , which should be emulated , in dp as an { @ link Integer } value . The
* elevation must be at least 0 and... | float ratio = ( float ) elevation / ( float ) MAX_ELEVATION ; int range = maxTransparency - minTransparency ; return Math . round ( minTransparency + ratio * range ) ; |
public class AgentPoolsInner { /** * Deletes an agent pool .
* Deletes the agent pool in the specified managed cluster .
* @ param resourceGroupName The name of the resource group .
* @ param managedClusterName The name of the managed cluster resource .
* @ param agentPoolName The name of the agent pool .
* @... | beginDeleteWithServiceResponseAsync ( resourceGroupName , managedClusterName , agentPoolName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class MavenJDOMWriter { /** * Method updateDependencyManagement .
* @ param value
* @ param element
* @ param counter
* @ param xmlTag */
protected void updateDependencyManagement ( DependencyManagement value , String xmlTag , Counter counter , Element element ) { } } | boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; iterateDependency ( innerCount , root , value . getDependencies ( ) , "dependencies" , "dependency" ) ; } |
public class ListSelectionValueModelAdapter { /** * See if two arrays are different . */
private boolean hasChanged ( int [ ] oldValue , int [ ] newValue ) { } } | if ( oldValue . length == newValue . length ) { for ( int i = 0 ; i < newValue . length ; i ++ ) { if ( oldValue [ i ] != newValue [ i ] ) { return true ; } } return false ; } return true ; |
public class Instrumentator { private void addTraceReturn ( ) { } } | InsnList il = this . mn . instructions ; Iterator < AbstractInsnNode > it = il . iterator ( ) ; while ( it . hasNext ( ) ) { AbstractInsnNode abstractInsnNode = it . next ( ) ; switch ( abstractInsnNode . getOpcode ( ) ) { case Opcodes . RETURN : il . insertBefore ( abstractInsnNode , getVoidReturnTraceInstructions ( )... |
public class Headers { /** * Returns the last value corresponding to the specified field parsed as an HTTP date , or null if
* either the field is absent or cannot be parsed as a date . */
public Date getDate ( String name ) { } } | String value = get ( name ) ; return value != null ? HttpDate . parse ( value ) : null ; |
public class JavacState { /** * Compare the javac _ state recorded public apis of packages on the classpath
* with the actual public apis on the classpath . */
public void taintPackagesDependingOnChangedClasspathPackages ( ) throws IOException { } } | // 1 . Collect fully qualified names of all interesting classpath dependencies
Set < String > fqDependencies = new HashSet < > ( ) ; for ( Package pkg : prev . packages ( ) . values ( ) ) { // Check if this package was compiled . If it ' s presence is recorded
// because it was on the class path and we needed to save i... |
public class MultipartStream { /** * Returns a read attribute from the multipart mime . */
public String getAttribute ( String key ) { } } | List < String > values = _headers . get ( key . toLowerCase ( Locale . ENGLISH ) ) ; if ( values != null && values . size ( ) > 0 ) return values . get ( 0 ) ; return null ; |
public class JSONObject { /** * Accumulate values under a key . It is similar to the put method except
* that if there is already an object stored under the key then a JSONArray
* is stored under the key to hold all of the accumulated values . If there
* is already a JSONArray , then the new value is appended to ... | testValidity ( value ) ; Object object = this . opt ( key ) ; if ( object == null ) { this . put ( key , value instanceof JSONArray ? new JSONArray ( ) . put ( value ) : value ) ; } else if ( object instanceof JSONArray ) { ( ( JSONArray ) object ) . put ( value ) ; } else { this . put ( key , new JSONArray ( ) . put (... |
public class Whitelist { /** * Updates whitelist if there ' s any change . If it needs to update whitelist , it enforces writelock
* to make sure
* there ' s an exclusive access on shared variables . */
@ VisibleForTesting Set < String > retrieveWhitelist ( FileSystem fs , Path path ) { } } | try { Preconditions . checkArgument ( fs . exists ( path ) , "File does not exist at " + path ) ; Preconditions . checkArgument ( fs . isFile ( path ) , "Whitelist path is not a file. " + path ) ; Set < String > result = Sets . newHashSet ( ) ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( fs .... |
public class JSON { /** * / * Internal methods , writing */
protected final void _writeAndClose ( Object value , JsonGenerator g ) throws IOException { } } | boolean closed = false ; try { _config ( g ) ; _writerForOperation ( g ) . writeValue ( value ) ; closed = true ; g . close ( ) ; } finally { if ( ! closed ) { // need to catch possible failure , so as not to mask problem
try { g . close ( ) ; } catch ( IOException ioe ) { } } } |
public class BitUtilBig { /** * Touches only the specified bits - it does not zero out the higher bits ( like reverse does ) . */
final long reversePart ( long v , int maxBits ) { } } | long rest = v & ( ~ ( ( 1L << maxBits ) - 1 ) ) ; return rest | reverse ( v , maxBits ) ; |
public class ExecutorsUtils { /** * Get a new { @ link ThreadFactory } that uses a { @ link LoggingUncaughtExceptionHandler }
* to handle uncaught exceptions , uses the given thread name format , and produces daemon threads .
* @ param logger an { @ link Optional } wrapping the { @ link Logger } that the
* { @ li... | return newThreadFactory ( new ThreadFactoryBuilder ( ) . setDaemon ( true ) , logger , nameFormat ) ; |
public class BlobKey { /** * Decode base64 ' d getDigest into a byte array that is suitable for use
* as a blob key .
* @ param base64Digest string with base64 ' d getDigest , with leading " sha1 - " attached .
* eg , " sha1 - LKJ32423JK . . . "
* @ return a byte [ ] blob key */
private static byte [ ] decodeBa... | String expectedPrefix = "sha1-" ; if ( ! base64Digest . startsWith ( expectedPrefix ) ) { throw new IllegalArgumentException ( base64Digest + " did not start with " + expectedPrefix ) ; } base64Digest = base64Digest . replaceFirst ( expectedPrefix , "" ) ; byte [ ] bytes = new byte [ 0 ] ; try { bytes = Base64 . decode... |
public class PECImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . PEC__TRIPLETS : return triplets != null && ! triplets . isEmpty ( ) ; } return super . eIsSet ( featureID ) ; |
public class A_CmsTreeTabDataPreloader { /** * Gets the children of a resource . < p >
* @ param resource the resource for which the children should be read
* @ return the children of the resource
* @ throws CmsException if something goes wrong */
protected List < CmsResource > getChildren ( CmsResource resource ... | return m_cms . getSubFolders ( resource . getRootPath ( ) , m_filter ) ; |
public class JsonGwtJacksonGenerator { /** * Create the serdes and return the field name . */
private String generateSerdes ( SourceWriter w , JClassType type , Json annotation ) { } } | final String qualifiedSourceName = type . getQualifiedSourceName ( ) ; final String qualifiedCamelCaseFieldName = replaceDotByUpperCase ( qualifiedSourceName ) ; final String qualifiedCamelCaseTypeName = Character . toUpperCase ( qualifiedCamelCaseFieldName . charAt ( 0 ) ) + qualifiedCamelCaseFieldName . substring ( 1... |
public class XmlParserHelper { /** * Returns an input stream for the specified resource . First an attempt is made to load the resource
* via the { @ code Filer } API and if that fails { @ link Class # getResourceAsStream } is used .
* @ param resource the resource to load
* @ return an input stream for the speci... | // METAGEN - 75
if ( ! resource . startsWith ( RESOURCE_PATH_SEPARATOR ) ) { resource = RESOURCE_PATH_SEPARATOR + resource ; } String pkg = getPackage ( resource ) ; String name = getRelativeName ( resource ) ; InputStream ormStream ; try { FileObject fileObject = context . getProcessingEnvironment ( ) . getFiler ( ) .... |
public class Container { /** * Returns assembled component instance corresponding to the specified injectee
* ( Component type and qualifiers ) .
* < b > NOTE : This method is designed for an internal use . < / b >
* If the component is not found or duplicated , this method returns
* < code > null < / code > . ... | logger . debug ( "Component is requested with target: Target [" + target + "]" ) ; Collection < Descriptor < ? > > descriptors = new ArrayList < > ( ) ; Class < ? > deployment = deployment ( ) ; Type type = target . type ( ) ; for ( Descriptor < ? > descriptor : components . get ( ( type instanceof ParameterizedType ) ... |
public class SpringContainerPool { /** * This method gets the { @ link IocContainer } for the given { @ code xmlClasspath } .
* @ param xmlClasspath is the classpath to the XML configuration .
* @ return the requested container . */
public static IocContainer getInstance ( String xmlClasspath ) { } } | if ( xml2containerMap == null ) { xml2containerMap = new HashMap < > ( ) ; } SpringContainer container = xml2containerMap . get ( xmlClasspath ) ; if ( container == null ) { container = new SpringContainer ( new ClassPathXmlApplicationContext ( xmlClasspath ) ) ; xml2containerMap . put ( xmlClasspath , container ) ; } ... |
public class ProgressStyle { /** * Set the progress of the progress bar
* @ param value the progress out of the max
* @ return self for chaining */
public ProgressStyle setProgress ( int value ) { } } | if ( mProgressStyle == HORIZONTAL ) { if ( mProgress . isIndeterminate ( ) ) mProgress . setIndeterminate ( false ) ; if ( mProgress . getMax ( ) <= value ) mProgress . setMax ( value ) ; mProgress . setProgress ( value ) ; if ( ! mIsPercentageMode ) { mProgressText . setText ( String . format ( "%d %s" , value , mSuff... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.