signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Env { /** * Set the current declaration and its doc comment . */
void setCurrent ( TreePath path , DocCommentTree comment ) { } } | currPath = path ; currDocComment = comment ; currElement = trees . getElement ( currPath ) ; currOverriddenMethods = ( ( JavacTypes ) types ) . getOverriddenMethods ( currElement ) ; AccessKind ak = AccessKind . PUBLIC ; for ( TreePath p = path ; p != null ; p = p . getParentPath ( ) ) { Element e = trees . getElement ... |
public class XlsWorksheet { /** * Returns the sheets from the given Excel XLS file .
* @ param stream The input stream with the XLS file
* @ return The sheet names from the XLS file
* @ throws IOException if the file cannot be opened
* @ throws jxl . read . biff . BiffException if there is a format error with t... | XlsWorkbook workbook = XlsWorkbook . getWorkbook ( stream ) ; String [ ] sheets = workbook . getSheetNames ( ) ; workbook . close ( ) ; return sheets ; |
public class CircularImageView { /** * Set the placeholder text and colors .
* @ param text
* @ param backgroundColor
* @ param textColor */
public final void setPlaceholder ( String text , @ ColorInt int backgroundColor , @ ColorInt int textColor ) { } } | boolean invalidate = false ; // Set the placeholder background color
if ( backgroundColor != mBackgroundColor ) { mBackgroundColor = backgroundColor ; if ( null != mBackgroundPaint ) { mBackgroundPaint . setColor ( backgroundColor ) ; invalidate = true ; } } // Set the placeholder text color
if ( ! text . equalsIgnoreC... |
public class AFPChainXMLConverter { /** * Convert an afpChain to a simple XML representation
* @ param afpChain
* @ return XML representation of the AFPCHain */
public synchronized static String toXML ( AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 ) throws IOException { } } | StringWriter result = new StringWriter ( ) ; toXML ( afpChain , result , ca1 , ca2 ) ; return result . toString ( ) ; |
public class BeanUtils { /** * Populates the specified bean with data from the specified map .
* @ param bean The object to populate .
* @ param params The map to populate the bean with . */
public static void populateBean ( final Object bean , final Map < String , String > params ) { } } | final Method [ ] methods = bean . getClass ( ) . getMethods ( ) ; for ( final Method method : methods ) { final Class < ? > [ ] types = method . getParameterTypes ( ) ; final int length = types . length ; if ( length != 1 ) { continue ; } final String name = method . getName ( ) ; if ( ! name . startsWith ( "set" ) ) {... |
public class BigDecimalExtensions { /** * The < code > power < / code > operator .
* @ param a
* a BigDecimal . May not be < code > null < / code > .
* @ param exponent
* the exponent .
* @ return < code > a . pow ( b ) < / code >
* @ throws NullPointerException
* if { @ code a } is < code > null < / code... | return a . pow ( exponent ) ; |
public class SarlCapacityImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } } | switch ( featureID ) { case SarlPackage . SARL_CAPACITY__EXTENDS : return ( ( InternalEList < ? > ) getExtends ( ) ) . basicRemove ( otherEnd , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ; |
public class CPOptionCategoryPersistenceImpl { /** * Removes all the cp option categories where companyId = & # 63 ; from the database .
* @ param companyId the company ID */
@ Override public void removeByCompanyId ( long companyId ) { } } | for ( CPOptionCategory cpOptionCategory : findByCompanyId ( companyId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpOptionCategory ) ; } |
public class ArrayHelper { /** * Wrapper that allows vararg arguments and returns the array . < br >
* Note : this implementation is not available for basic types , because the
* Eclipse compiler seems to have difficulties resolving vararg types
* correctly .
* @ param < ELEMENTTYPE >
* Type of element
* @ ... | ValueEnforcer . notNull ( aArray , "Array" ) ; return aArray ; |
public class URIToServletWrapperCache { /** * / * ( non - Javadoc )
* @ see java . util . Map # put ( java . lang . Object , java . lang . Object ) */
public Object put ( Object key , Object value ) { } } | synchronized ( this ) { // 253010 , Do not check size since we do so in WebContainer
Object obj = super . put ( key , value ) ; if ( obj == null ) // Object was added or value previously added was null
size = super . size ( ) ; return obj ; } |
public class BinaryImageOps { /** * Several blob rending functions take in an array of colors so that the random blobs can be drawn
* with the same color each time . This function selects a random color for each blob and returns it
* in an array .
* @ param numBlobs Number of blobs found .
* @ param rand Random... | int colors [ ] = new int [ numBlobs + 1 ] ; colors [ 0 ] = 0 ; // black
int B = 100 ; for ( int i = 1 ; i < colors . length ; i ++ ) { int c ; while ( true ) { c = rand . nextInt ( 0xFFFFFF ) ; // make sure its not too dark and can ' t be distriquished from the background
if ( ( c & 0xFF ) > B || ( ( c >> 8 ) & 0xFF ) ... |
public class User { /** * Returns a user object for a given identifier .
* @ param u a user having a valid identifier set .
* @ return a user or null if no user is found for this identifier */
public static final User readUserForIdentifier ( final User u ) { } } | if ( u == null || StringUtils . isBlank ( u . getIdentifier ( ) ) ) { return null ; } User user = null ; String password = null ; String identifier = u . getIdentifier ( ) ; // Try to read the identifier object first , then read the user object linked to it .
Sysprop s = CoreUtils . getInstance ( ) . getDao ( ) . read ... |
public class Vacuum { /** * Get the vacuums serial number .
* @ return The vacuums serial number .
* @ throws CommandExecutionException When there has been a error during the communication or the response was invalid . */
public String getSerialnumber ( ) throws CommandExecutionException { } } | JSONArray ret = sendToArray ( "get_serial_number" ) ; if ( ret == null ) return null ; return ret . optJSONObject ( 0 ) . optString ( "serial_number" ) ; |
public class Job { /** * Get file info objects that pass the filter
* @ param filter filter file info object must pass
* @ return collection of file info objects that pass the filter , may be empty */
public Collection < FileInfo > getFileInfo ( final Predicate < FileInfo > filter ) { } } | return files . values ( ) . stream ( ) . filter ( filter ) . collect ( Collectors . toList ( ) ) ; |
public class EntityComparator { /** * Sort the entities .
* @ param entities The set of { @ link Entity entities } .
* @ param sortingBy The sorting method .
* @ return A set of sorted { @ link Entity entities } . */
public static Set < Entity > sort ( Set < Entity > entities , Order sortingBy ) { } } | EntityComparator comparator = new EntityComparator ( sortingBy ) ; List < Entity > list = new ArrayList < Entity > ( entities ) ; Collections . sort ( list , comparator ) ; Set < Entity > sortedEntities = new LinkedHashSet < > ( list ) ; return sortedEntities ; |
public class StereoTool { /** * Checks these four atoms for square planarity .
* @ param atomA an atom in the plane
* @ param atomB an atom in the plane
* @ param atomC an atom in the plane
* @ param atomD an atom in the plane
* @ return true if all the atoms are in the same plane */
public static boolean isS... | Point3d pointA = atomA . getPoint3d ( ) ; Point3d pointB = atomB . getPoint3d ( ) ; Point3d pointC = atomC . getPoint3d ( ) ; Point3d pointD = atomD . getPoint3d ( ) ; return isSquarePlanar ( pointA , pointB , pointC , pointD ) ; |
public class AndroidExportFilter { /** * { @ inheritDoc } */
@ Override public void filter ( IKeyValuePair keyValuePair ) { } } | keyValuePair . setKey ( escapeKeyName ( keyValuePair . getKey ( ) ) ) ; if ( keyValuePair . getValue ( ) != null ) { keyValuePair . setValue ( escapeXmlSpecialCharacters ( keyValuePair . getValue ( ) ) ) ; } |
public class CassandraDataTranslator { /** * Marshal collection .
* @ param cassandraTypeClazz
* the cassandra type clazz
* @ param result
* the result
* @ param clazz
* the clazz
* @ return the collection */
public static Collection marshalCollection ( Class cassandraTypeClazz , Collection result , Class... | Collection mappedCollection = result ; if ( cassandraTypeClazz . isAssignableFrom ( BytesType . class ) ) { mappedCollection = ( Collection ) PropertyAccessorHelper . getObject ( resultTypeClass ) ; for ( Object value : result ) { byte [ ] valueAsBytes = new byte [ ( ( ByteBuffer ) value ) . remaining ( ) ] ; ( ( ByteB... |
public class ChunkedIntArray { /** * Overwrite the integer found at a specific record and column .
* Used to back - patch existing records , most often changing their
* " next sibling " reference from 0 ( unknown ) to something meaningful
* @ param position int Record number
* @ param offset int Column number
... | /* try
fastArray [ ( position * slotsize ) + offset ] = value ;
catch ( ArrayIndexOutOfBoundsException aioobe ) */
{ if ( offset >= slotsize ) throw new ArrayIndexOutOfBoundsException ( XMLMessages . createXMLMessage ( XMLErrorResources . ER_OFFSET_BIGGER_THAN_SLOT , null ) ) ; // " Offset bigger than slot " ) ;
po... |
public class Timeline { /** * Obtains q ( t ) for the given t . */
private int at ( long t ) { } } | SortedMap < Long , int [ ] > head = data . subMap ( t , Long . MAX_VALUE ) ; if ( head . isEmpty ( ) ) return 0 ; return data . get ( head . firstKey ( ) ) [ 0 ] ; |
public class MetaClassRegistryImpl { /** * Returns an iterator to iterate over all constant meta classes .
* This iterator can be seen as making a snapshot of the current state
* of the registry . The snapshot will include all meta classes that has
* been used unless they are already collected . Collected meta cl... | final MetaClass [ ] refs = metaClassInfo . toArray ( EMPTY_METACLASS_ARRAY ) ; return new Iterator ( ) { // index in the ref array
private int index = 0 ; // the current meta class
private MetaClass currentMeta ; // used to ensure that hasNext has been called
private boolean hasNextCalled = false ; // the cached hasNex... |
public class DoubleTuples { /** * Creates a new tuple that is a < i > view < / i >
* on the specified portion of the given parent . Changes in the
* parent will be visible in the returned tuple .
* @ param parent The parent tuple
* @ param fromIndex The start index in the parent , inclusive
* @ param toIndex ... | return new SubDoubleTuple ( parent , fromIndex , toIndex ) ; |
public class StartQueryRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StartQueryRequest startQueryRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( startQueryRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startQueryRequest . getLogGroupName ( ) , LOGGROUPNAME_BINDING ) ; protocolMarshaller . marshall ( startQueryRequest . getStartTime ( ) , STARTTIME_BINDING ) ; protoco... |
public class OverrideService { /** * Get the ordinal value for the last of a particular override on a path
* @ param overrideId Id of the override to check
* @ param pathId Path the override is on
* @ param clientUUID UUID of the client
* @ param filters If supplied , only endpoints ending with values in filter... | int currentOrdinal = 0 ; List < EnabledEndpoint > enabledEndpoints = getEnabledEndpoints ( pathId , clientUUID , filters ) ; for ( EnabledEndpoint enabledEndpoint : enabledEndpoints ) { if ( enabledEndpoint . getOverrideId ( ) == overrideId ) { currentOrdinal ++ ; } } return currentOrdinal ; |
public class CmsPathTree { /** * Tries to traverse the descendants of this node along the given path ,
* and returns the last existing node along that path . < p >
* The given path is modified so that only the part of the path for which no nodes can be found
* remains . < p >
* @ param pathToConsume the path to... | Iterator < P > iter = pathToConsume . iterator ( ) ; CmsPathTree < P , V > currentNode = this ; while ( iter . hasNext ( ) ) { CmsPathTree < P , V > child = currentNode . getChild ( iter . next ( ) ) ; if ( child != null ) { iter . remove ( ) ; currentNode = child ; } else { return currentNode ; } } return currentNode ... |
public class Tile { /** * Adds the given TimeSection to the list of sections .
* Sections in the Medusa library usually are less eye - catching
* than Areas .
* @ param SECTION */
public void addTimeSection ( final TimeSection SECTION ) { } } | if ( null == SECTION ) return ; getTimeSections ( ) . add ( SECTION ) ; getTimeSections ( ) . sort ( new TimeSectionComparator ( ) ) ; fireTileEvent ( SECTION_EVENT ) ; |
public class PicoContainerWrapper { /** * This method will usually create a new instance each time it is called
* @ param name
* component name
* @ return object new instance */
public Object getComponentNewInstance ( String name ) { } } | Debug . logVerbose ( "[JdonFramework]getComponentNewInstance: name=" + name , module ) ; ComponentAdapter componentAdapter = container . getComponentAdapter ( name ) ; if ( componentAdapter == null ) { Debug . logWarning ( "[JdonFramework]Not find the component in container :" + name , module ) ; return null ; } return... |
public class AvailabilityForecastOptions { /** * Sets the breakdown value for this AvailabilityForecastOptions .
* @ param breakdown */
public void setBreakdown ( com . google . api . ads . admanager . axis . v201902 . ForecastBreakdownOptions breakdown ) { } } | this . breakdown = breakdown ; |
public class JmsSysEventListener { /** * For asynch we do the onMessage listener style . Otherwise we wait
* synchronously for incoming messages .
* @ param asynch true if we just want to set the listener
* @ throws NotificationException */
public void process ( final boolean asynch ) throws NotificationException... | if ( asynch ) { try { consumer . setMessageListener ( this ) ; return ; } catch ( final JMSException je ) { throw new NotificationException ( je ) ; } } while ( running ) { final Message m = conn . receive ( ) ; if ( m == null ) { running = false ; return ; } onMessage ( m ) ; } |
public class Logger { /** * Logs recoverable application error .
* @ param correlationId ( optional ) transaction id to trace execution through
* call chain .
* @ param message a human - readable message to log .
* @ param args arguments to parameterize the message . */
public void error ( String correlationId ... | formatAndWrite ( LogLevel . Error , correlationId , null , message , args ) ; |
public class SSEDescriptionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SSEDescription sSEDescription , ProtocolMarshaller protocolMarshaller ) { } } | if ( sSEDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sSEDescription . getStatus ( ) , STATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) ,... |
public class EnvironmentLogger { /** * Sets the logger ' s parent . This should only be called by the LogManager
* code . */
@ Override public void setParent ( Logger parent ) { } } | if ( parent . equals ( _parent ) ) return ; super . setParent ( parent ) ; if ( parent instanceof EnvironmentLogger ) { _parent = ( EnvironmentLogger ) parent ; _parent . addChild ( this ) ; } updateEffectiveLevel ( _systemClassLoader ) ; |
public class DeleteQueryAction { /** * Create filters based on
* the Where clause .
* @ param where the ' WHERE ' part of the SQL query .
* @ throws SqlParseException */
private void setWhere ( Where where ) throws SqlParseException { } } | if ( where != null ) { QueryBuilder whereQuery = QueryMaker . explan ( where ) ; request . filter ( whereQuery ) ; } else { request . filter ( QueryBuilders . matchAllQuery ( ) ) ; } |
public class Client { /** * Perform a query request and return a query object . The Query object
* provides a simple way of dealing with result sets that need to be
* iterated or paged through .
* @ param method
* @ param params
* @ param data
* @ param segments
* @ return */
public Query queryEntitiesReq... | ApiResponse response = apiRequest ( method , params , data , segments ) ; return new EntityQuery ( response , method , params , data , segments ) ; |
public class MessageHistory { /** * Returns a List of Messages , sorted starting from newest to oldest , of all message that have already been retrieved
* from Discord with this MessageHistory object using the { @ link # retrievePast ( int ) } , { @ link # retrieveFuture ( int ) } , and
* { @ link net . dv8tion . j... | int size = size ( ) ; if ( size == 0 ) return Collections . emptyList ( ) ; else if ( size == 1 ) return Collections . singletonList ( history . getValue ( 0 ) ) ; return Collections . unmodifiableList ( new ArrayList < > ( history . values ( ) ) ) ; |
public class PaxLoggingServiceImpl { /** * This method is used by the FrameworkHandler to log framework events .
* @ param bundle The bundle that caused the event .
* @ param level The level to be logged as .
* @ param message The message .
* @ param exception The exception , if any otherwise null . */
void log... | logImpl ( bundle , level , message , exception , m_fqcn ) ; |
public class EventDispatcher { /** * Broadcasts the event to all of the interested listener ' s dispatch queues . */
private void publish ( Cache < K , V > cache , EventType eventType , K key , @ Nullable V oldValue , @ Nullable V newValue , boolean quiet ) { } } | if ( dispatchQueues . isEmpty ( ) ) { return ; } JCacheEntryEvent < K , V > event = null ; for ( Registration < K , V > registration : dispatchQueues . keySet ( ) ) { if ( ! registration . getCacheEntryListener ( ) . isCompatible ( eventType ) ) { continue ; } if ( event == null ) { event = new JCacheEntryEvent < > ( c... |
public class PaneDiagramSwing { /** * Set current diagram maker
* e . g . ClassDiagramMaker or ActivityDiagramMaker
* @ param controllerDiagramUml
* @ param palletteDiagram */
public void setDiagramControllerAndPalettes ( IControllerDiagramUml < ? , ? > controllerDiagramUml , Component palletteDiagram , Component... | this . activeControllerDiagramUml = controllerDiagramUml ; if ( currentPaletteDiagram != null ) { this . actionPropertiesPane . remove ( currentPaletteDiagram ) ; } this . actionPropertiesPane . add ( palletteDiagram , BorderLayout . CENTER ) ; currentPaletteDiagram = palletteDiagram ; if ( ! isZoomPalletteAdded ) { th... |
public class SchedulingSupport { /** * Determines the exact time the next interval starts based on a time within the current interval .
* @ param time time in millis
* @ param intervalInMinutes
* @ param offsetInMinutes
* @ return the exact time in milliseconds the interval begins local time */
public static lo... | long interval = MINUTE_IN_MS * intervalInMinutes ; return getPreviousIntervalStart ( time , intervalInMinutes , offsetInMinutes ) + interval ; |
public class ProcessDefinitionResourceImpl { /** * Determines an IANA media type based on the file suffix .
* Hint : as of Java 7 the method Files . probeContentType ( ) provides an implementation based on file type detection .
* @ param fileName
* @ return content type , defaults to octet - stream */
public stat... | String mediaType = "application/octet-stream" ; // default
if ( fileName != null ) { fileName = fileName . toLowerCase ( ) ; if ( fileName . endsWith ( ".png" ) ) { mediaType = "image/png" ; } else if ( fileName . endsWith ( ".svg" ) ) { mediaType = "image/svg+xml" ; } else if ( fileName . endsWith ( ".jpg" ) || fileNa... |
public class PyExpressionGenerator { /** * Generate the given object .
* @ param castOperator the cast operator .
* @ param it the target for the generated content .
* @ param context the context .
* @ return the expression . */
protected XExpression _generate ( XCastedExpression castOperator , IAppendable it ,... | return generate ( castOperator . getTarget ( ) , context . getExpectedExpressionType ( ) , it , context ) ; |
public class ApiOvhIpLoadbalancing { /** * Add a new rule to your route
* REST : POST / ipLoadbalancing / { serviceName } / tcp / route / { routeId } / rule
* @ param field [ required ] Name of the field to match like " protocol " or " host " . See " / ipLoadbalancing / { serviceName } / availableRouteRules " for a... | String qPath = "/ipLoadbalancing/{serviceName}/tcp/route/{routeId}/rule" ; StringBuilder sb = path ( qPath , serviceName , routeId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "displayName" , displayName ) ; addBody ( o , "field" , field ) ; addBody ( o , "match" , match ) ; a... |
public class CmsInheritanceReferenceParser { /** * Gets the parsed reference for a locale . < p >
* Gets the reference object for the locale , and uses the reference for the English language as a fallback . < p >
* @ param locale the locale to get the reference for
* @ return the reference for the locale */
publi... | CmsInheritanceReference ref = m_references . get ( locale ) ; if ( ref == null ) { ref = m_references . get ( Locale . ENGLISH ) ; } return ref ; |
public class NodeTypes { /** * Determine if either the primary type or any of the mixin types allows SNS .
* @ param primaryType the primary type name ; may not be null
* @ param mixinTypes the mixin type names ; may be null or empty
* @ return { @ code true } if either the primary type or any of the mixin types ... | if ( isUnorderedCollection ( primaryType , mixinTypes ) ) { // regardless of the actual types , if at least one of them is an unordered collection , SNS are not allowed
return false ; } if ( nodeTypeNamesThatAllowSameNameSiblings . contains ( primaryType ) ) return true ; if ( mixinTypes != null && ! mixinTypes . isEmp... |
public class ConfigValueImpl { /** * X @ Override */
public < N > ConfigValueImpl < N > as ( Class < N > clazz ) { } } | configEntryType = clazz ; return ( ConfigValueImpl < N > ) this ; |
public class CSTNode { /** * Returns true if the node and it ' s first and second child match the
* specified types . Missing nodes are Token . NULL . */
boolean matches ( int type , int child1 , int child2 ) { } } | return matches ( type , child1 ) && get ( 2 , true ) . isA ( child2 ) ; |
public class ReviewsImpl { /** * The reviews created would show up for Reviewers on your team . As Reviewers complete reviewing , results of the Review would be POSTED ( i . e . HTTP POST ) on the specified CallBackEndpoint .
* & lt ; h3 & gt ; CallBack Schemas & lt ; / h3 & gt ;
* & lt ; h4 & gt ; Review Completio... | return ServiceFuture . fromResponse ( createVideoReviewsWithServiceResponseAsync ( teamName , contentType , createVideoReviewsBody , createVideoReviewsOptionalParameter ) , serviceCallback ) ; |
public class SearchContactsResult { /** * The contacts that meet the specified set of filter criteria , in sort order .
* @ param contacts
* The contacts that meet the specified set of filter criteria , in sort order . */
public void setContacts ( java . util . Collection < ContactData > contacts ) { } } | if ( contacts == null ) { this . contacts = null ; return ; } this . contacts = new java . util . ArrayList < ContactData > ( contacts ) ; |
public class appqoeparameter { /** * Use this API to fetch all the appqoeparameter resources that are configured on netscaler . */
public static appqoeparameter get ( nitro_service service ) throws Exception { } } | appqoeparameter obj = new appqoeparameter ( ) ; appqoeparameter [ ] response = ( appqoeparameter [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; |
public class EffectiveAssignmentInsnFinder { /** * Static factory method .
* @ param targetVariable
* the variable to find the effective { @ code putfield } or
* { @ code putstatic } instruction for .
* @ param controlFlowBlocks
* all control flow blocks of an initialising constructor or
* method .
* @ re... | return new EffectiveAssignmentInsnFinder ( checkNotNull ( targetVariable ) , checkNotNull ( controlFlowBlocks ) ) ; |
public class StorageAccountsInner { /** * Updates the Data Lake Analytics account to replace Azure Storage blob account details , such as the access key and / or suffix .
* @ param resourceGroupName The name of the Azure resource group .
* @ param accountName The name of the Data Lake Analytics account .
* @ para... | return updateWithServiceResponseAsync ( resourceGroupName , accountName , storageAccountName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class OgmEntityPersister { /** * Re - reads the given entity , refreshing any properties updated on the server - side during insert or update . */
private void processGeneratedProperties ( Serializable id , Object entity , Object [ ] state , SharedSessionContractImplementor session , GenerationTiming matchTiming... | Tuple tuple = getFreshTuple ( EntityKeyBuilder . fromPersister ( this , id , session ) , session ) ; saveSharedTuple ( entity , tuple , session ) ; if ( tuple == null || tuple . getSnapshot ( ) . isEmpty ( ) ) { throw log . couldNotRetrieveEntityForRetrievalOfGeneratedProperties ( getEntityName ( ) , id ) ; } int prope... |
public class FileMetadata { /** * Compute a MD5 hash of each line of the file after removing of all blank chars */
public static void computeLineHashesForIssueTracking ( InputFile f , LineHashConsumer consumer ) { } } | try { readFile ( f . inputStream ( ) , f . charset ( ) , f . absolutePath ( ) , new CharHandler [ ] { new LineHashComputer ( consumer , f . file ( ) ) } ) ; } catch ( IOException e ) { throw new IllegalStateException ( "Failed to compute line hashes for " + f . absolutePath ( ) , e ) ; } |
public class GetCaCapsResponseHandler { /** * { @ inheritDoc }
* @ throws InvalidContentTypeException if the response is invalid */
@ Override public Capabilities getResponse ( final byte [ ] content , final String mimeType ) throws ContentException { } } | if ( mimeType == null || ! mimeType . startsWith ( TEXT_PLAIN ) ) { LOGGER . warn ( "Content-Type mismatch: was '{}', expected 'text/plain'" , mimeType ) ; } final EnumSet < Capability > caps = EnumSet . noneOf ( Capability . class ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "CA capabilities:" ) ; } Buffe... |
public class NamedEntityGraphImpl { /** * If not already created , a new < code > subclass - subgraph < / code > element will be created and returned .
* Otherwise , the first existing < code > subclass - subgraph < / code > element will be returned .
* @ return the instance defined for the element < code > subclas... | List < Node > nodeList = childNode . get ( "subclass-subgraph" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new NamedSubgraphImpl < NamedEntityGraph < T > > ( this , "subclass-subgraph" , childNode , nodeList . get ( 0 ) ) ; } return createSubclassSubgraph ( ) ; |
public class OGraphDatabase { /** * Returns all the edges between the vertexes iVertex1 and iVertex2 with label between the array of labels passed as iLabels and
* with class between the array of class names passed as iClassNames .
* @ param iVertex1
* First Vertex
* @ param iVertex2
* Second Vertex
* @ par... | final Set < ODocument > result = new HashSet < ODocument > ( ) ; if ( iVertex1 != null && iVertex2 != null ) { // CHECK OUT EDGES
for ( OIdentifiable e : getOutEdges ( iVertex1 ) ) { final ODocument edge = ( ODocument ) e ; if ( checkEdge ( edge , iLabels , iClassNames ) ) { if ( edge . < ODocument > field ( "in" ) . e... |
public class GalleryImagesInner { /** * Get gallery image .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ param galleryImageName The name of the gallery Image .
* @ throws IllegalArgumentException thrown if parameters fail the validation ... | return getWithServiceResponseAsync ( resourceGroupName , labAccountName , galleryImageName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class MultiUserChat { /** * Changes the occupant ' s availability status within the room . The presence type
* will remain available but with a new status that describes the presence update and
* a new presence mode ( e . g . Extended away ) .
* @ param status a text message describing the presence update ... | final EntityFullJid myRoomJid = this . myRoomJid ; if ( myRoomJid == null ) { throw new MucNotJoinedException ( this ) ; } // Check that we already have joined the room before attempting to change the
// availability status .
if ( ! joined ) { throw new MucNotJoinedException ( this ) ; } // We change the availability s... |
public class ExpressionSpecBuilder { /** * Returns an < code > IfNotExists < / code > object which represents an < a href =
* " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . Modifying . html "
* > if _ not _ exists ( path , operand ) < / a > function call ; used for... | return if_not_exists ( new PathOperand ( path ) , new LiteralOperand ( defaultValue ) ) ; |
public class EnumFormat { /** * Add annotations { @ link EnumString } to each of your < code > enum < / code > constants .
* If this annotation is not present , make sure you added corresponding < code > string < / code >
* to < code > res < / code > folder with the same name ( lower case ) as your < code > enum < ... | return format ( ( Object ) e ) ; |
public class ProjectCalendar { /** * Method indicating whether a day is a working or non - working day .
* @ param day required day
* @ return true if this is a working day */
public boolean isWorkingDay ( Day day ) { } } | DayType value = getWorkingDay ( day ) ; boolean result ; if ( value == DayType . DEFAULT ) { ProjectCalendar cal = getParent ( ) ; if ( cal != null ) { result = cal . isWorkingDay ( day ) ; } else { result = ( day != Day . SATURDAY && day != Day . SUNDAY ) ; } } else { result = ( value == DayType . WORKING ) ; } return... |
public class Strings { /** * mergeSeq .
* @ param first
* a { @ link java . lang . String } object .
* @ param second
* a { @ link java . lang . String } object .
* @ return a { @ link java . lang . String } object . */
public static String mergeSeq ( final String first , final String second ) { } } | return mergeSeq ( first , second , DELIMITER ) ; |
public class InmemQueue { /** * { @ inheritDoc }
* @ throws QueueException . QueueIsFull
* if queue buffer is full */
@ Override public boolean requeueSilent ( IQueueMessage < ID , DATA > _msg ) throws QueueException . QueueIsFull { } } | IQueueMessage < ID , DATA > msg = _msg . clone ( ) ; putToQueue ( msg ) ; if ( ! isEphemeralDisabled ( ) ) { ephemeralStorage . remove ( msg . getId ( ) ) ; } return true ; |
public class InverseGaussianDistribution { /** * Probability density function of the Wald distribution .
* @ param x The value .
* @ param mu The mean .
* @ param shape Shape parameter
* @ return log PDF of the given Wald distribution at x . */
public static double logpdf ( double x , double mu , double shape )... | if ( ! ( x > 0 ) || x == Double . POSITIVE_INFINITY ) { return x == x ? Double . NEGATIVE_INFINITY : Double . NaN ; } final double v = ( x - mu ) / mu ; return v < Double . MAX_VALUE ? 0.5 * FastMath . log ( shape / ( MathUtil . TWOPI * x * x * x ) ) - shape * v * v / ( 2. * x ) : Double . NEGATIVE_INFINITY ; |
public class Locale { /** * Decode the bytes from the specified input stream
* according to a charset selection . This function tries
* to decode a string from the given byte array
* with the following charsets ( in preferred order ) :
* < ul >
* < li > the current charset returned by { @ link Charset # defau... | // Read the complete file
byte [ ] completeBuffer = new byte [ 0 ] ; final byte [ ] buffer = new byte [ BUFFER_SIZE ] ; int read ; while ( ( read = stream . read ( buffer ) ) > 0 ) { final byte [ ] tmp = new byte [ completeBuffer . length + read ] ; System . arraycopy ( completeBuffer , 0 , tmp , 0 , completeBuffer . l... |
public class WeiXinQYService { /** * 删除解密后明文的补位字符
* @ param decrypted 解密后的明文
* @ return 删除补位字符后的明文 */
private static byte [ ] decodePKCS7 ( byte [ ] decrypted ) { } } | int pad = ( int ) decrypted [ decrypted . length - 1 ] ; if ( pad < 1 || pad > 32 ) pad = 0 ; return Arrays . copyOfRange ( decrypted , 0 , decrypted . length - pad ) ; |
public class JSDocInfo { /** * This is used to get all nodes + the description , excluding the param nodes . Used to help in an
* ES5 to ES6 class converter only . */
public JSDocInfo cloneClassDoc ( ) { } } | JSDocInfo other = new JSDocInfo ( ) ; other . info = this . info == null ? null : this . info . cloneClassDoc ( ) ; other . documentation = this . documentation ; other . visibility = this . visibility ; other . bitset = this . bitset ; other . type = cloneType ( this . type , false ) ; other . thisType = cloneType ( t... |
public class ThrottlingService { /** * Invoked when { @ code req } is not throttled . By default , this method delegates the specified { @ code req } to
* the { @ link # delegate ( ) } of this service . */
protected O onSuccess ( ServiceRequestContext ctx , I req ) throws Exception { } } | return delegate ( ) . serve ( ctx , req ) ; |
public class WritableUtils { /** * Get the encoded length if an integer is stored in a variable - length format
* @ return the encoded length */
public static int getVIntSize ( long i ) { } } | if ( i >= - 112 && i <= 127 ) { return 1 ; } if ( i < 0 ) { i ^= - 1L ; // take one ' s complement '
} // find the number of bytes with non - leading zeros
int dataBits = Long . SIZE - Long . numberOfLeadingZeros ( i ) ; // find the number of data bytes + length byte
return ( dataBits + 7 ) / 8 + 1 ; |
public class BaseCollectionStatsStorage { /** * - - - - - Listeners - - - - - */
@ Override public void registerStatsStorageListener ( StatsStorageListener listener ) { } } | if ( ! this . listeners . contains ( listener ) ) { this . listeners . add ( listener ) ; } |
public class MetaWeblogBlog { /** * { @ inheritDoc } */
@ Override public Blog . Collection getCollection ( final String token ) throws BlogClientException { } } | return collections . get ( token ) ; |
public class ExecutionGroupEdge { /** * Changes the channel type for this edge .
* @ param newChannelType
* the channel type for this edge
* @ throws GraphConversionException
* thrown if the new channel type violates a user setting */
void changeChannelType ( final ChannelType newChannelType ) throws GraphConve... | if ( ! this . channelType . equals ( newChannelType ) && this . userDefinedChannelType ) { throw new GraphConversionException ( "Cannot overwrite user defined channel type" ) ; } this . channelType = newChannelType ; |
public class JvmFloatAnnotationValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case TypesPackage . JVM_FLOAT_ANNOTATION_VALUE__VALUES : return values != null && ! values . isEmpty ( ) ; } return super . eIsSet ( featureID ) ; |
public class PackageSummaryBuilder { /** * Build the summary for the errors in this package .
* @ param node the XML element that specifies which components to document
* @ param summaryContentTree the summary tree to which the error summary will
* be added */
public void buildErrorSummary ( XMLNode node , Conten... | String errorTableSummary = configuration . getText ( "doclet.Member_Table_Summary" , configuration . getText ( "doclet.Error_Summary" ) , configuration . getText ( "doclet.errors" ) ) ; List < String > errorTableHeader = Arrays . asList ( configuration . getText ( "doclet.Error" ) , configuration . getText ( "doclet.De... |
public class ZipkinEmitter { /** * Emits a pre - populated storage of annotations to Zipkin .
* @ param zipkinAnnotationsStore Zipkin annotations storage representing the entire list of annotations to emit */
public void emitAnnotations ( @ Nonnull ZipkinAnnotationsStore zipkinAnnotationsStore ) { } } | Objects . requireNonNull ( zipkinAnnotationsStore ) ; zipkinSpanCollector . collect ( zipkinAnnotationsStore . generate ( ) ) ; |
public class FileDownloader { /** * still has issues . . .
* @ param inputUrl
* @ param outputFile
* @ return */
@ Deprecated public File downloadFileNew ( File inputUrl , File outputFile ) { } } | OutputStream out = null ; InputStream fis = null ; HttpParams httpParameters = new BasicHttpParams ( ) ; int timeoutConnection = 2500 ; HttpConnectionParams . setConnectionTimeout ( httpParameters , timeoutConnection ) ; int timeoutSocket = 2500 ; HttpConnectionParams . setSoTimeout ( httpParameters , timeoutSocket ) ;... |
public class BaseDestinationHandler { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . impl . interfaces . DestinationHandler # getSourceProtocolItemStream ( ) */
@ Override public SourceProtocolItemStream getSourceProtocolItemStream ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getSourceProtocolItemStream" ) ; SourceProtocolItemStream sourceProtocolItemStream = _protoRealization . getRemoteSupport ( ) . getSourceProtocolItemStream ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntry... |
public class SignatureGenerator { /** * Create a class signature string for a specified type .
* @ return the signature if class is generic , else null . */
public String createClassSignature ( TypeElement type ) { } } | if ( ! hasGenericSignature ( type ) ) { return null ; } StringBuilder sb = new StringBuilder ( ) ; genClassSignature ( type , sb ) ; return sb . toString ( ) ; |
public class Timestamp { /** * Performs a comparison of the two points in time represented by two
* Timestamps .
* If the point in time represented by this Timestamp precedes that of
* { @ code t } , then { @ code - 1 } is returned .
* If { @ code t } precedes this Timestamp then { @ code 1 } is returned .
* ... | // Test at millisecond precision first .
long this_millis = this . getMillis ( ) ; long arg_millis = t . getMillis ( ) ; if ( this_millis != arg_millis ) { return ( this_millis < arg_millis ) ? - 1 : 1 ; } // Values are equivalent at millisecond precision , so compare fraction
BigDecimal this_fraction = ( ( this . _fra... |
public class PyGenerator { /** * Generate the given object .
* @ param constructor the constructor .
* @ param it the target for the generated content .
* @ param context the context . */
protected void _generate ( SarlConstructor constructor , PyAppendable it , IExtraLanguageGeneratorContext context ) { } } | if ( constructor . isStatic ( ) ) { generateExecutable ( "___static_init___" , constructor , false , false , null , // $ NON - NLS - 1 $
getTypeBuilder ( ) . getDocumentation ( constructor ) , it , context ) ; it . newLine ( ) . append ( "___static_init___()" ) ; // $ NON - NLS - 1 $
} else { generateExecutable ( "__in... |
public class UniqueKeyHandler { /** * Called when a error happens on a file operation , return the errorcode , or fix the problem .
* @ param iErrorCode The error code from the previous listener .
* @ return The new error code . */
public int doErrorReturn ( int iChangeType , int iErrorCode ) // init this field ove... | if ( iChangeType == DBConstants . AFTER_ADD_TYPE ) if ( iErrorCode == DBConstants . DUPLICATE_KEY ) { // First , find the first unique key that is not a counter
Record record = this . getOwner ( ) ; for ( int iKeySeq = 0 ; iKeySeq < record . getKeyAreaCount ( ) ; iKeySeq ++ ) { KeyArea keyArea = record . getKeyArea ( i... |
public class CompiledFEELSemanticMappings { /** * FEEL spec Table 41 : Specific semantics of equality
* Delegates to { @ link EvalHelper } except evaluationcontext */
public static Boolean eq ( Object left , Object right ) { } } | return EvalHelper . isEqual ( left , right , null ) ; |
public class Quaterniond { /** * / * ( non - Javadoc )
* @ see org . joml . Quaterniondc # rotateTo ( org . joml . Vector3dc , org . joml . Vector3dc , org . joml . Quaterniond ) */
public Quaterniond rotateTo ( Vector3dc fromDir , Vector3dc toDir , Quaterniond dest ) { } } | return rotateTo ( fromDir . x ( ) , fromDir . y ( ) , fromDir . z ( ) , toDir . x ( ) , toDir . y ( ) , toDir . z ( ) , dest ) ; |
public class Sort { /** * Check if the short array is reverse sorted . It loops through the entire short
* array once , checking that the elements are reverse sorted .
* < br >
* < br >
* < i > Runtime : < / i > O ( n )
* @ param shortArray the short array to check
* @ return < i > true < / i > if the short... | for ( int i = 0 ; i < shortArray . length - 1 ; i ++ ) { if ( shortArray [ i ] < shortArray [ i + 1 ] ) { return false ; } } return true ; |
public class JCudaDriver { /** * Finds a cloned version of a node . < br >
* < br >
* This function returns the node in \ p hClonedGraph corresponding to \ p hOriginalNode
* in the original graph . < br >
* < br >
* \ p hClonedGraph must have been cloned from \ p hOriginalGraph via : : cuGraphClone .
* \ p ... | return checkResult ( cuGraphNodeFindInCloneNative ( phNode , hOriginalNode , hClonedGraph ) ) ; |
public class Xdr { /** * Get a long from the buffer
* @ return long */
public long getLong ( ) { } } | return ( ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 56 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 48 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 40 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 32 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 24 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 16 | ( lon... |
public class RedisCacheSource { /** * - - - - - get - - - - - */
@ Override public CompletableFuture < V > getAsync ( String key ) { } } | return ( CompletableFuture ) send ( "GET" , CacheEntryType . OBJECT , ( Type ) null , key , key . getBytes ( UTF8 ) ) ; |
public class IntStreamEx { /** * Returns the maximum element of this stream according to the provided key
* extractor function .
* This is a terminal operation .
* @ param keyExtractor a non - interfering , stateless function
* @ return an { @ code OptionalInt } describing the first element of this
* stream f... | return collect ( PrimitiveBox :: new , ( box , i ) -> { double key = keyExtractor . applyAsDouble ( i ) ; if ( ! box . b || Double . compare ( box . d , key ) < 0 ) { box . b = true ; box . d = key ; box . i = i ; } } , PrimitiveBox . MAX_DOUBLE ) . asInt ( ) ; |
public class HostStatusTracker { /** * Helper method to check that there is no overlap b / w hosts up and down .
* @ param A
* @ param B */
private void verifyMutuallyExclusive ( Collection < Host > A , Collection < Host > B ) { } } | Set < Host > left = new HashSet < Host > ( A ) ; Set < Host > right = new HashSet < Host > ( B ) ; boolean modified = left . removeAll ( right ) ; if ( modified ) { throw new RuntimeException ( "Host up and down sets are not mutually exclusive!" ) ; } |
public class ns_doc_image { /** * < pre >
* Use this operation to get NetScaler Documentation file .
* < / pre > */
public static ns_doc_image [ ] get ( nitro_service client ) throws Exception { } } | ns_doc_image resource = new ns_doc_image ( ) ; resource . validate ( "get" ) ; return ( ns_doc_image [ ] ) resource . get_resources ( client ) ; |
public class SemEvalReporter { /** * { @ inheritDoc } */
public void assignContextToKey ( String primaryKey , String secondaryKey , int contextId ) { } } | // Get the mapping from primarykeys to context descriptors .
List < Assignment > primaryAssignments = assignmentMap . get ( primaryKey ) ; if ( primaryAssignments == null ) { synchronized ( this ) { primaryAssignments = assignmentMap . get ( primaryKey ) ; if ( primaryAssignments == null ) { primaryAssignments = Collec... |
public class TextUtil { /** * Remove the mnemonic char from the specified string .
* @ param text is the text to scan .
* @ return the given text without the mnemonic character . */
@ Pure public static String removeMnemonicChar ( String text ) { } } | if ( text == null ) { return text ; } return text . replaceFirst ( "&" , "" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ |
public class Interpreter { /** * Get the value of the name .
* name may be any value . e . g . a variable or field */
public Object get ( String name ) throws EvalError { } } | try { Object ret = globalNameSpace . get ( name , this ) ; return Primitive . unwrap ( ret ) ; } catch ( UtilEvalError e ) { throw e . toEvalError ( SimpleNode . JAVACODE , new CallStack ( ) ) ; } |
public class ImageLoaderCurrent { /** * / * ( non - Javadoc )
* @ see ImageLoader # processImage ( java . io . DataInputStream , ImageVisitor , boolean ) */
@ Override public void loadImage ( DataInputStream in , ImageVisitor v , boolean skipBlocks ) throws IOException { } } | try { InjectionHandler . processEvent ( InjectionEvent . IMAGE_LOADER_CURRENT_START ) ; v . start ( ) ; v . visitEnclosingElement ( ImageElement . FS_IMAGE ) ; imageVersion = in . readInt ( ) ; if ( ! canLoadVersion ( imageVersion ) ) throw new IOException ( "Cannot process fslayout version " + imageVersion ) ; v . vis... |
public class SeekBarStateDrawable { /** * Set the Scrubber ColorStateList
* @ param stateList ColorStateList */
public void setScrubberColor ( ColorStateList stateList ) { } } | mScrubberStateList = stateList ; mScrubberColor = mScrubberStateList . getDefaultColor ( ) ; if ( mAlpha < 255 ) { mCurScrubberColor = Ui . modulateColorAlpha ( mScrubberColor , mAlpha ) ; } else { mCurScrubberColor = mScrubberColor ; } |
public class ArgumentsBuilder { /** * Returns a collection of default Pax Runner arguments .
* @ return collection of default arguments */
private Collection < String > defaultArguments ( ) { } } | final List < String > arguments = new ArrayList < String > ( ) ; arguments . add ( "--noConsole" ) ; arguments . add ( "--noDownloadFeedback" ) ; if ( ! argsSetManually ) { arguments . add ( "--noArgs" ) ; } String folder = System . getProperty ( "java.io.tmpdir" ) + "/paxexam_runner_" + System . getProperty ( "user.na... |
public class Bbox { /** * Does this bounding box contain the given point ( coordinate ) ?
* @ param coord
* Coordinate of point to test .
* @ return true if the point lies in the bounding box . */
public boolean contains ( Coordinate coord ) { } } | if ( coord . getX ( ) < this . getX ( ) ) { return false ; } if ( coord . getY ( ) < this . getY ( ) ) { return false ; } if ( coord . getX ( ) > this . getEndPoint ( ) . getX ( ) ) { return false ; } if ( coord . getY ( ) > this . getEndPoint ( ) . getY ( ) ) { return false ; } return true ; |
public class AnyValueMap { /** * Converts map element into an integer or returns null if conversion is not
* possible .
* @ param key a key of element to get .
* @ return integer value of the element or null if conversion is not supported .
* @ see IntegerConverter # toNullableInteger ( Object ) */
public Integ... | Object value = getAsObject ( key ) ; return IntegerConverter . toNullableInteger ( value ) ; |
public class EventSubscriptionsInner { /** * Create or update an event subscription .
* Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope .
* @ param scope The identifier of the resource to which the event subscription needs to be created or updat... | if ( scope == null ) { throw new IllegalArgumentException ( "Parameter scope is required and cannot be null." ) ; } if ( eventSubscriptionName == null ) { throw new IllegalArgumentException ( "Parameter eventSubscriptionName is required and cannot be null." ) ; } if ( eventSubscriptionInfo == null ) { throw new Illegal... |
public class DescribeFleetEventsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeFleetEventsRequest describeFleetEventsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeFleetEventsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeFleetEventsRequest . getFleetId ( ) , FLEETID_BINDING ) ; protocolMarshaller . marshall ( describeFleetEventsRequest . getStartTime ( ) , STARTTIME_BI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.