signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CoreDefinitionVersion { /** * A list of cores in the core definition version .
* @ param cores
* A list of cores in the core definition version . */
public void setCores ( java . util . Collection < Core > cores ) { } } | if ( cores == null ) { this . cores = null ; return ; } this . cores = new java . util . ArrayList < Core > ( cores ) ; |
public class Selection { /** * Sort the int array in ascending order using this algorithm .
* @ param intArray the array of ints that we want to sort */
public static void sort ( int [ ] intArray ) { } } | int minIndex = 0 ; for ( int i = 0 ; i < intArray . length ; i ++ ) { minIndex = i ; for ( int j = minIndex ; j < intArray . length ; j ++ ) { if ( intArray [ j ] < intArray [ minIndex ] ) { minIndex = j ; } } XORSwap . swap ( intArray , i , minIndex ) ; } |
public class JSONObjectException { /** * Method that can be called to either create a new JsonMappingException
* ( if underlying exception is not a JsonMappingException ) , or augment
* given exception with given path / reference information . */
public static JSONObjectException wrapWithPath ( Throwable src , Refe... | JSONObjectException jme ; if ( src instanceof JSONObjectException ) { jme = ( JSONObjectException ) src ; } else { String msg = src . getMessage ( ) ; if ( msg == null || msg . length ( ) == 0 ) { msg = "(was " + src . getClass ( ) . getName ( ) + ")" ; } jme = new JSONObjectException ( msg , null , src ) ; } jme . pre... |
public class LucenePDFConfiguration { /** * Sets Field attributes that will be used when creating the Field object for the main text content of
* a PDF document . These attributes correspond to the < code > store < / code > ,
* < code > index < / code > , and < code > token < / code > parameters of the { @ link org... | indexBodyText = index ; storeBodyText = store ; tokenizeBodyText = token ; |
public class RequestCreator { /** * A placeholder drawable to be used while the image is being loaded . If the requested image is
* not immediately available in the memory cache then this resource will be set on the target
* { @ link ImageView } . */
@ NonNull public RequestCreator placeholder ( @ DrawableRes int p... | if ( ! setPlaceholder ) { throw new IllegalStateException ( "Already explicitly declared as no placeholder." ) ; } if ( placeholderResId == 0 ) { throw new IllegalArgumentException ( "Placeholder image resource invalid." ) ; } if ( placeholderDrawable != null ) { throw new IllegalStateException ( "Placeholder image alr... |
public class BeanUtils { /** * Helper method for getting a read method for a property .
* @ param clazz the type to get the method for .
* @ param propertyName the name of the property .
* @ return the method for reading the property . */
public static Method getReadMethod ( Class < ? > clazz , String propertyNam... | Method readMethod = null ; try { PropertyDescriptor [ ] thisProps = Introspector . getBeanInfo ( clazz ) . getPropertyDescriptors ( ) ; for ( PropertyDescriptor pd : thisProps ) { if ( pd . getName ( ) . equals ( propertyName ) && pd . getReadMethod ( ) != null ) { readMethod = pd . getReadMethod ( ) ; break ; } } } ca... |
public class NativeInterface { /** * an object WRITES a primitive field of another object */
public static void modify ( int calleeValKind , Object callee , String calleeClass , String fieldName , int callerValKind , Object caller , String callerClass ) { } } | System . err . println ( "modify( " + valAndValKindToString ( callee , calleeClass , calleeValKind ) + " . " + fieldName + ", " + // " calleeClass = " + calleeClass + " , " +
"caller=" + valAndValKindToString ( caller , callerClass , callerValKind ) + ", " + // " callerClass = " + callerClass + " , " +
")" ) ; |
public class UploadPartRequest { /** * Sets the optional progress listener for receiving updates about object
* upload status .
* @ param progressListener
* The legacy progress listener that is used exclusively for Amazon S3 client .
* @ deprecated use { @ link # setGeneralProgressListener ( ProgressListener ) ... | setGeneralProgressListener ( new LegacyS3ProgressListener ( progressListener ) ) ; |
public class TemplateReactionWrapper { /** * Binds to template and controllers . */
@ Override public void initUpstream ( ) { } } | NucleicAcid nuc = tempReac . getTemplate ( ) ; if ( nuc != null ) addToUpstream ( nuc , getGraph ( ) ) ; for ( Control cont : tempReac . getControlledOf ( ) ) { addToUpstream ( cont , graph ) ; } |
public class CmsLanguageCopySelectionList { /** * Fills a single item .
* @ param resource the corresponding resource .
* @ param item the item to fill .
* @ param id used for the ID column . */
private void fillItem ( final CmsResource resource , final CmsListItem item , final int id ) { } } | CmsObject cms = getCms ( ) ; CmsXmlContent xmlContent ; I_CmsResourceType type ; String iconPath ; // fill path column :
String sitePath = cms . getSitePath ( resource ) ; item . set ( LIST_COLUMN_PATH , sitePath ) ; // fill language node existence column :
item . set ( LIST_COLUMN_PATH , sitePath ) ; boolean languageN... |
public class Gauge { /** * The factor defines the length of the major tick mark .
* It can be in the range from 0 - 1.
* @ param FACTOR */
public void setMajorTickMarkLengthFactor ( final double FACTOR ) { } } | if ( null == majorTickMarkLengthFactor ) { _majorTickMarkLengthFactor = Helper . clamp ( 0.0 , 1.0 , FACTOR ) ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { majorTickMarkLengthFactor . set ( FACTOR ) ; } |
public class StrBuilder { /** * Replaces the search string with the replace string throughout the builder .
* @ param searchStr the search string , null causes no action to occur
* @ param replaceStr the replace string , null is equivalent to an empty string
* @ return this , to enable chaining */
public StrBuild... | final int searchLen = ( searchStr == null ? 0 : searchStr . length ( ) ) ; if ( searchLen > 0 ) { final int replaceLen = ( replaceStr == null ? 0 : replaceStr . length ( ) ) ; int index = indexOf ( searchStr , 0 ) ; while ( index >= 0 ) { replaceImpl ( index , index + searchLen , searchLen , replaceStr , replaceLen ) ;... |
public class RedisPubSubHub { /** * { @ inheritDoc } */
@ Override public void unsubscribe ( String channel , ISubscriber < ID , DATA > subscriber ) { } } | try { Set < ISubscriber < ID , DATA > > subs = subscriptions . get ( channel ) ; synchronized ( subs ) { subs . remove ( subscriber ) ; } } catch ( ExecutionException e ) { throw new RuntimeException ( e ) ; } |
public class WritableColumnVector { /** * Resets this column for writing . The currently stored values are no longer accessible . */
public void reset ( ) { } } | if ( isConstant ) return ; if ( childColumns != null ) { for ( ColumnVector c : childColumns ) { ( ( WritableColumnVector ) c ) . reset ( ) ; } } elementsAppended = 0 ; if ( numNulls > 0 ) { putNotNulls ( 0 , capacity ) ; numNulls = 0 ; } |
public class CmsGalleryService { /** * Helper method to construct a sitemap entry bean for the sitemap tab filter functionality . < p >
* @ param cms the CMS context
* @ param node the root node of the filtered tree
* @ param isRoot true if this is the root node
* @ return the sitemap entry bean */
private CmsS... | CmsSitemapEntryBean bean = null ; try { bean = prepareSitemapEntry ( cms , node . getNavElement ( ) , isRoot , false ) ; bean . setSearchMatch ( node . isMatch ( ) ) ; List < NavigationNode > children = node . getChildren ( ) ; List < CmsSitemapEntryBean > childBeans = Lists . newArrayList ( ) ; if ( children . size ( ... |
public class GeometryUtilities { /** * Calculates the 3d distance between two coordinates that have an elevation information .
* < p > Note that the { @ link Coordinate # distance ( Coordinate ) } method does only 2d .
* @ param c1 coordinate 1.
* @ param c2 coordinate 2.
* @ param geodeticCalculator If supplie... | if ( Double . isNaN ( c1 . z ) || Double . isNaN ( c2 . z ) ) { throw new IllegalArgumentException ( "Missing elevation information in the supplied coordinates." ) ; } double deltaElev = Math . abs ( c1 . z - c2 . z ) ; double projectedDistance ; if ( geodeticCalculator != null ) { geodeticCalculator . setStartingGeogr... |
public class AgentSession { /** * Invites a user or agent to an existing session support . The provided invitee ' s JID can be of
* a user , an agent , a queue or a workgroup . In the case of a queue or a workgroup the workgroup service
* will decide the best agent to receive the invitation . < p >
* This method ... | final RoomInvitation invitation = new RoomInvitation ( type , invitee , sessionID , reason ) ; IQ iq = new RoomInvitation . RoomInvitationIQ ( invitation ) ; iq . setType ( IQ . Type . set ) ; iq . setTo ( workgroupJID ) ; iq . setFrom ( connection . getUser ( ) ) ; connection . createStanzaCollectorAndSend ( iq ) . ne... |
public class PackagesScreen { /** * Add button ( s ) to the toolbar . */
public void addToolbarButtons ( ToolScreen toolScreen ) { } } | new SCannedBox ( toolScreen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , toolScreen , null , ScreenConstants . DEFAULT_DISPLAY , null , Packages . SCAN , MenuConstants . SELECT , Packages . SCAN , null ) ; |
public class FnJodaTimeUtils { /** * The function receives a { @ link Collection } of two { @ link Timestamp } elements used as the start and end of the
* { @ link Period } it creates . The { @ link Period } will be created using the
* specified { @ link Chronology }
* @ param chronology { @ link Chronology } to ... | return FnPeriod . timestampFieldCollectionToPeriod ( chronology ) ; |
public class AmazonPinpointEmailClient { /** * Enable or disable the Deliverability dashboard . When you enable the Deliverability dashboard , you gain access to
* reputation metrics for the domains that you use to send email using Amazon Pinpoint . You also gain the ability to
* perform predictive inbox placement ... | request = beforeClientExecution ( request ) ; return executePutDeliverabilityDashboardOption ( request ) ; |
public class ConfigureForm { /** * Set the JID ' s in the whitelist of users that can associate child nodes with the collection
* node . This is only relevant if { @ link # getChildrenAssociationPolicy ( ) } is set to
* { @ link ChildrenAssociationPolicy # whitelist } .
* @ param whitelist The list of JID ' s */
... | addField ( ConfigureNodeFields . children_association_whitelist , FormField . Type . jid_multi ) ; setAnswer ( ConfigureNodeFields . children_association_whitelist . getFieldName ( ) , whitelist ) ; |
public class ListRoleAliasesResult { /** * The role aliases .
* @ param roleAliases
* The role aliases . */
public void setRoleAliases ( java . util . Collection < String > roleAliases ) { } } | if ( roleAliases == null ) { this . roleAliases = null ; return ; } this . roleAliases = new java . util . ArrayList < String > ( roleAliases ) ; |
public class ObjectiveFactory { /** * This method retrieves all the values accessible through a getter (
* < code > getX ( ) < / code > method ) in order to build the corresponding set of
* { @ link Objective } s . At the opposite of { @ link # createFromGetters ( Class ) } ,
* an additional filter is used : we b... | Map < String , Method > getters = new HashMap < > ( ) ; Map < String , Method > setters = new HashMap < > ( ) ; for ( Method method : solutionClass . getMethods ( ) ) { if ( isGetter ( method ) ) { String name = method . getName ( ) . substring ( 3 ) ; getters . put ( name , method ) ; } else if ( isSetter ( method ) )... |
public class ProofObligation { /** * Generate an AApplyExp with varargs arguments */
protected AApplyExp getApplyExp ( PExp root , PExp ... arglist ) { } } | return getApplyExp ( root , Arrays . asList ( arglist ) ) ; |
public class PlatformDependent { /** * Raises an exception bypassing compiler checks for checked exceptions . */
public static void throwException ( Throwable t ) { } } | if ( hasUnsafe ( ) ) { PlatformDependent0 . throwException ( t ) ; } else { PlatformDependent . < RuntimeException > throwException0 ( t ) ; } |
public class LPAChangeParameter { /** * Change the parameter for a channel in both the ILF and PLF using the appropriate mechanisms
* for incorporated nodes versus owned nodes . */
@ Override public void perform ( ) throws PortalException { } } | // push the change into the PLF
if ( nodeId . startsWith ( Constants . FRAGMENT_ID_USER_PREFIX ) ) { // we are dealing with an incorporated node , adding will replace
// an existing one for the same target node id and name
ParameterEditManager . addParmEditDirective ( nodeId , name , value , person ) ; } else { // node... |
public class Request { /** * 获得GET请求参数 < br >
* 会根据浏览器类型自动识别GET请求的编码方式从而解码 < br >
* 考虑到Servlet容器中会首先解码 , 给定的charsetOfServlet就是Servlet设置的解码charset < br >
* charsetOfServlet为null则默认的ISO _ 8859_1
* @ param name 参数名
* @ param charsetOfServlet Servlet容器中的字符集
* @ return 获得请求参数 */
public static String getParam ( S... | return convertGetMethodParamValue ( getParam ( name ) , charsetOfServlet ) ; |
public class Exceptions { /** * TODO : was package - level initially */
public static RuntimeException launderCacheWriterException ( Exception e ) { } } | if ( ! ( e instanceof CacheWriterException ) ) return new CacheWriterException ( "Exception in CacheWriter" , e ) ; return new CacheException ( "Error in CacheWriter" , e ) ; |
public class StatisticsJDBCStorageConnection { /** * { @ inheritDoc } */
public void update ( NodeData data ) throws RepositoryException , UnsupportedOperationException , InvalidItemStateException , IllegalStateException { } } | Statistics s = ALL_STATISTICS . get ( UPDATE_NODE_DATA_DESCR ) ; try { s . begin ( ) ; wcs . update ( data ) ; } finally { s . end ( ) ; } |
public class MobileUrlNodeSyntaxHelper { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . url . IUrlNodeSyntaxHelper # getPortletForFolderName ( javax . servlet . http . HttpServletRequest , java . lang . String , java . lang . String ) */
@ Override public IPortletWindowId getPortletForFolderName ( HttpSe... | final IUserInstance userInstance = this . userInstanceManager . getUserInstance ( request ) ; final String fname ; final IPortletEntity portletEntity ; final int seperatorIndex = folderName . indexOf ( PORTLET_PATH_ELEMENT_SEPERATOR ) ; if ( seperatorIndex <= 0 || seperatorIndex + 1 == folderName . length ( ) ) { fname... |
public class StreamEx { /** * Creates a new { @ code EntryStream } whose keys are elements of current
* stream and corresponding values are supplied by given function . Each
* mapped stream is { @ link java . util . stream . BaseStream # close ( ) closed } after
* its contents have been placed into this stream . ... | return new EntryStream < > ( stream ( ) . flatMap ( a -> EntryStream . withKey ( a , mapper . apply ( a ) ) ) , context ) ; |
public class AbstractBean { /** * Notifies all VetoableChangeListeners of a property change event occurring on this Bean . The change to
* the property may potentially be vetoed by one of the VetoableChangeListeners listening to property changes
* on this Bean , resulting in preventing the value of the property to ... | if ( isEventDispatchEnabled ( ) ) { Assert . notNull ( event , "The PropertyChangeEvent cannot be null!" ) ; if ( vetoableChangeSupport . hasListeners ( event . getPropertyName ( ) ) ) { vetoableChangeSupport . fireVetoableChange ( event ) ; } } |
public class CheckSumUtils { /** * Return the checksum of the path given in parameter , if the resource is
* not found , null will b returned .
* @ param url
* the url path to the resource file
* @ param rsReader
* the resource reader handler
* @ param jawrConfig
* the jawrConfig
* @ return checksum of ... | String checksum = null ; InputStream is = null ; boolean generatedBinaryResource = jawrConfig . getGeneratorRegistry ( ) . isGeneratedBinaryResource ( url ) ; try { if ( ! generatedBinaryResource ) { url = PathNormalizer . asPath ( url ) ; } is = rsReader . getResourceAsStream ( url ) ; if ( is != null ) { checksum = C... |
public class HttpInboundChannel { /** * @ see
* com . ibm . wsspi . channelfw . Channel # getConnectionLink ( com . ibm . wsspi . channelfw
* . VirtualConnection ) */
public ConnectionLink getConnectionLink ( VirtualConnection vc ) { } } | HttpInboundLink link = ( HttpInboundLink ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPICL ) ; if ( null == link ) { link = new HttpInboundLink ( this , vc ) ; } return link ; |
public class AsmByteCodeUtils { /** * if分支调用String的equals方法 , 失败则跳转到指定位置
* @ param mv MethodVisitor
* @ param load 加载要比较的字符串
* @ param content 常量字符串
* @ param next 比较失败后跳转的位置
* @ param success 比较一致后执行的操作 */
public static void stringEquals ( MethodVisitor mv , Runnable load , String content , Label next , Runn... | // 加载String
load . run ( ) ; // 加载实际方法名
mv . visitLdcInsn ( content ) ; // 调用String的equals方法
mv . visitMethodInsn ( INVOKEVIRTUAL , convert ( String . class ) , "equals" , ByteCodeUtils . getMethodDesc ( MethodConst . EQUALAS_METHOD ) , false ) ; // 如果结果为false则跳转到下一个
mv . visitJumpInsn ( IFEQ , next ) ; success . run (... |
public class JQMHeader { /** * Sets the left button to be the given button . Any existing button is removed .
* @ param button - the button to set on the left slot */
@ UiChild ( tagname = "leftButton" , limit = 1 ) public void setLeftButton ( JQMButton button ) { } } | if ( left != null ) remove ( left ) ; button . setPosOnBand ( PosOnBand . LEFT ) ; left = button ; insert ( left , 0 ) ; |
public class StringUtil { /** * Strips any of a set of characters from the start and end of a String .
* This is similar to { @ link String # trim ( ) } but allows the characters to be
* stripped to be controlled .
* A { @ code null } input String returns { @ code null } . An empty string ( " " )
* input return... | if ( N . isNullOrEmpty ( str ) ) { return str ; } return stripEnd ( stripStart ( str , stripChars ) , stripChars ) ; |
public class TypesafeConfig { /** * Initialize JDBC drivers from config .
* @ throws InitializationException if driver could not be initialized */
static void initDrivers ( final Config config ) throws InitializationException { } } | for ( String driverName : uniquePrefixSet ( config ) ) { Config driverConfig = config . getObject ( driverName ) . toConfig ( ) ; if ( driverConfig . hasPath ( "class" ) ) { String className = driverConfig . getString ( "class" ) ; try { Class . forName ( className ) ; } catch ( Throwable t ) { throw new Initialization... |
public class NetworkConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( NetworkConfiguration networkConfiguration , ProtocolMarshaller protocolMarshaller ) { } } | if ( networkConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( networkConfiguration . getAwsvpcConfiguration ( ) , AWSVPCCONFIGURATION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall req... |
public class JSONConverter { /** * Encode a String value as JSON . An array is used to wrap the value :
* [ String ]
* @ param out The stream to write JSON to
* @ param value The String value to encode .
* @ throws IOException If an I / O error occurs
* @ see # readString ( InputStream ) */
public void writeS... | writeStartArray ( out ) ; writeStringInternal ( out , value ) ; writeEndArray ( out ) ; |
public class CompositeHandler { /** * Returns a new handler based on this one ,
* but with given update | handler | appended .
* @ param handler Update handler
* @ return a new composite handler with given update handler
* @ throws IllegalArgumentException if handler is null */
public CompositeHandler withUpdat... | if ( handler == null ) { throw new IllegalArgumentException ( ) ; } // end of if
return new CompositeHandler ( this . queryDetection , this . queryHandler , handler ) ; |
public class PropertyChangeUtils { /** * Tries to add the given PropertyChangeListener to the given target
* object .
* If the given target object does not
* { @ link # maintainsPropertyChangeListeners ( Class )
* maintain PropertyChangeListeners } , then nothing is done .
* @ param target The target object
... | Objects . requireNonNull ( target , "The target may not be null" ) ; Objects . requireNonNull ( propertyChangeListener , "The propertyChangeListener may not be null" ) ; if ( maintainsPropertyChangeListeners ( target . getClass ( ) ) ) { PropertyChangeUtils . addPropertyChangeListenerUnchecked ( target , propertyChange... |
public class CPDefinitionLinkPersistenceImpl { /** * Clears the cache for the cp definition link .
* The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */
@ Override public void clearCache ( CPDefinitionLink cpDefinitionLink ) { } } | entityCache . removeResult ( CPDefinitionLinkModelImpl . ENTITY_CACHE_ENABLED , CPDefinitionLinkImpl . class , cpDefinitionLink . getPrimaryKey ( ) ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; clearUniqueFindersCache (... |
public class Href { /** * Add this extra param .
* @ param key Key of the param
* @ param value The value
* @ return New HREF */
public Href with ( final Object key , final Object value ) { } } | final SortedMap < String , List < String > > map = new TreeMap < > ( this . params ) ; if ( ! map . containsKey ( key . toString ( ) ) ) { map . put ( key . toString ( ) , new LinkedList < > ( ) ) ; } map . get ( key . toString ( ) ) . add ( value . toString ( ) ) ; return new Href ( this . uri , map , this . fragment ... |
public class DNSSEC { /** * Creates a byte array containing the concatenation of the fields of the
* SIG record and the RRsets to be signed / verified . This does not perform
* a cryptographic digest .
* @ param rrsig The RRSIG record used to sign / verify the rrset .
* @ param rrset The data to be signed / ver... | DNSOutput out = new DNSOutput ( ) ; digestSIG ( out , rrsig ) ; int size = rrset . size ( ) ; Record [ ] records = new Record [ size ] ; Iterator it = rrset . rrs ( ) ; Name name = rrset . getName ( ) ; Name wild = null ; int sigLabels = rrsig . getLabels ( ) + 1 ; // Add the root label back .
if ( name . labels ( ) > ... |
public class LogRecordHandler { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . logging . hpel . WsHandler # processEvent ( java . util . logging . LogRecord ) */
public void processEvent ( LogRecord record ) { } } | byte [ ] bytes ; SerializationObject serializationObject = pool . getSerializationObject ( ) ; try { bytes = serializationObject . serialize ( record ) ; } finally { pool . returnSerializationObject ( serializationObject ) ; } synchronized ( this ) { if ( traceWriter != null && record . getLevel ( ) . intValue ( ) < tr... |
public class PrimaryRole { /** * Applies a heartbeat to the service to ensure timers can be triggered . */
private void heartbeat ( ) { } } | long index = context . nextIndex ( ) ; long timestamp = System . currentTimeMillis ( ) ; replicator . replicate ( new HeartbeatOperation ( index , timestamp ) ) . thenRun ( ( ) -> context . setTimestamp ( timestamp ) ) ; |
public class CouchDbChangeMonitorThread { /** * Converts the object " last _ seq " found in the change feed to a String .
* In CouchDB 1 . x , last _ seq is an integer . In CouchDB 2 . x , last _ seq is a string .
* @ param lastSeqObj Object retrieved from the change feed
* @ return A string representing the obje... | if ( null == lastSeqObj ) { return null ; } else if ( lastSeqObj instanceof String ) { return ( String ) lastSeqObj ; } else if ( lastSeqObj instanceof Number ) { // Convert to string
return "" + lastSeqObj ; } else { throw new Exception ( "Do not know how to handle parameter 'last_seq' in change feed: " + lastSeqObj .... |
public class NimbusSummary { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } } | if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case NIMBUS_MASTER : return is_set_nimbusMaster ( ) ; case NIMBUS_SLAVES : return is_set_nimbusSlaves ( ) ; case SUPERVISOR_NUM : return is_set_supervisorNum ( ) ; case TOTAL_PORT_NUM : return is_set_totalPortNum ( ) ; case USED_PORT_N... |
public class AiMesh { /** * Returns the vertex tangent as 3 - dimensional vector . < p >
* This method is part of the wrapped API ( see { @ link AiWrapperProvider }
* for details on wrappers ) . < p >
* The built - in behavior is to return a { @ link AiVector } .
* @ param vertex the vertex index
* @ param wr... | if ( ! hasTangentsAndBitangents ( ) ) { throw new IllegalStateException ( "mesh has no tangents" ) ; } checkVertexIndexBounds ( vertex ) ; return wrapperProvider . wrapVector3f ( m_tangents , vertex * 3 * SIZEOF_FLOAT , 3 ) ; |
public class Model { /** * Wrapper around the main predict call , including the signature and return value */
private SB toJavaPredict ( SB ccsb , SB fileCtxSb ) { } } | // ccsb = classContext
ccsb . nl ( ) ; ccsb . p ( " // Pass in data in a double[], pre-aligned to the Model's requirements." ) . nl ( ) ; ccsb . p ( " // Jam predictions into the preds[] array; preds[0] is reserved for the" ) . nl ( ) ; ccsb . p ( " // main prediction (class for classifiers or value for regression),... |
public class AsyncRequest { /** * Mark the record associated with this request
* @ param record buffered record
* @ param bytesWritten bytes of the record written into the request */
public void markRecord ( BufferedRecord < D > record , int bytesWritten ) { } } | synchronized ( this ) { thunks . add ( new Thunk < > ( record , bytesWritten ) ) ; byteSize += bytesWritten ; } |
public class TvdbParser { /** * Get a list of series from the URL
* @ param urlString
* @ return
* @ throws com . omertron . thetvdbapi . TvDbException */
public static List < Series > getSeriesList ( String urlString ) throws TvDbException { } } | List < Series > seriesList = new ArrayList < > ( ) ; Series series ; NodeList nlSeries ; Node nSeries ; Element eSeries ; Document doc = DOMHelper . getEventDocFromUrl ( urlString ) ; if ( doc == null ) { return Collections . emptyList ( ) ; } nlSeries = doc . getElementsByTagName ( SERIES ) ; for ( int loop = 0 ; loop... |
public class WarpExecutionInitializer { /** * Activates / deactivates { @ link WarpExecutionContext } .
* Provides { @ link WarpContext } instance .
* Provides { @ link SynchronizationPoint } instance .
* Setups / resets { @ link WarpContextStore } */
public void provideWarpContext ( @ Observes EventContext < Exe... | warpExecutionContext . get ( ) . activate ( ) ; try { WarpContext context = eventContext . getEvent ( ) . getWarpContext ( ) ; warpContext . set ( context ) ; WarpContextStore . set ( context ) ; synchronization . set ( eventContext . getEvent ( ) . getWarpContext ( ) . getSynchronization ( ) ) ; eventContext . proceed... |
public class AmazonSimpleEmailServiceClient { /** * Reorders the receipt rules within a receipt rule set .
* < note >
* All of the rules in the rule set must be represented in this request . That is , this API will return an error if
* the reorder request doesn ' t explicitly position all of the rules .
* < / n... | request = beforeClientExecution ( request ) ; return executeReorderReceiptRuleSet ( request ) ; |
public class Dependency { /** * Returns the file name to display in reports ; if no display file name has
* been set it will default to constructing a name based on the name and
* version fields , otherwise it will return the actual file name .
* @ return the file name to display */
public String getDisplayFileNa... | if ( displayName != null ) { return displayName ; } if ( ! isVirtual ) { return fileName ; } if ( name == null ) { return fileName ; } if ( version == null ) { return name ; } return name + ":" + version ; |
public class HBaseReader { /** * ( non - Javadoc )
* @ see
* com . impetus . client . hbase . Reader # scanRowKeys ( org . apache . hadoop . hbase . client
* . Table , org . apache . hadoop . hbase . filter . Filter , java . lang . String ,
* java . lang . String , java . lang . Class ) */
@ Override public Obj... | List < Object > rowKeys = new ArrayList < Object > ( ) ; if ( scanner == null ) { Scan s = new Scan ( ) ; s . setFilter ( filter ) ; s . addColumn ( Bytes . toBytes ( columnFamilyName ) , Bytes . toBytes ( columnName ) ) ; scanner = hTable . getScanner ( s ) ; resultsIter = scanner . iterator ( ) ; } if ( fetchSize == ... |
public class HBeanRowCollector { /** * Filter out the rows that we have not yet visited . */
public Set < HBeanRow > filterUnvisted ( Set < HBeanRow > rows ) { } } | Set < HBeanRow > unvisted = new HashSet < > ( ) ; for ( HBeanRow row : rows ) { if ( ! references . containsKey ( row ) && ! inital . containsKey ( row ) ) { unvisted . add ( row ) ; } } return unvisted ; |
public class GatewayConfigParser { /** * Get the root cause from a < code > Throwable < / code > stack
* @ param throwable
* @ return */
private static Throwable getRootCause ( Throwable throwable ) { } } | List < Throwable > list = new ArrayList < > ( ) ; while ( throwable != null && ! list . contains ( throwable ) ) { list . add ( throwable ) ; throwable = throwable . getCause ( ) ; } return list . get ( list . size ( ) - 1 ) ; |
public class TiffUtil { /** * Reads orientation information from TIFF data .
* @ param is the input stream of TIFF data
* @ param length length of the TIFF data
* @ return orientation information ( 1/3/6/8 on success , 0 if not found ) */
public static int readOrientationFromTIFF ( InputStream is , int length ) t... | // read tiff header
TiffHeader tiffHeader = new TiffHeader ( ) ; length = readTiffHeader ( is , length , tiffHeader ) ; // move to the first IFD
// offset is relative to the beginning of the TIFF data
// and we already consumed the first 8 bytes of header
int toSkip = tiffHeader . firstIfdOffset - 8 ; if ( length == 0 ... |
public class RelationalOperations { /** * Returns true if intersects and false if nothing can be determined . */
private static boolean checkVerticesForIntersection_ ( MultiVertexGeometryImpl geom , RasterizedGeometry2D rgeom ) { } } | // Do a quick raster test for each point . If any point is inside , then
// there is an intersection .
int pointCount = geom . getPointCount ( ) ; Point2D pt = new Point2D ( ) ; for ( int ipoint = 0 ; ipoint < pointCount ; ipoint ++ ) { geom . getXY ( ipoint , pt ) ; RasterizedGeometry2D . HitType hit = rgeom . queryPo... |
public class KeywordUtils { /** * Builds mapping of robot keywords to actual bean names in spring context .
* @ param context Spring application context .
* @ return mapping of robot keywords to bean names */
public static Map < String , String > getKeywordMap ( ApplicationContext context ) { } } | Map < String , String > keywordToBeanMap = new HashMap < String , String > ( ) ; // Retrieve beans implementing the Keyword interface .
String [ ] beanNames = context . getBeanNamesForType ( Keyword . class ) ; for ( String beanName : beanNames ) { Object bean = context . getBean ( beanName ) ; // Retrieve keyword info... |
public class PersistenceUnitMetadata { /** * Gets the client . In case client is not configure , it throws
* IllegalArgumentException .
* @ return the client */
public String getClient ( ) { } } | String client = null ; if ( this . properties != null ) { client = ( String ) this . properties . get ( PersistenceProperties . KUNDERA_CLIENT_FACTORY ) ; } if ( client == null ) { log . error ( "kundera.client property is missing for persistence unit:" + persistenceUnitName ) ; throw new IllegalArgumentException ( "ku... |
public class AbstractManagedType { /** * ( non - Javadoc )
* @ see
* javax . persistence . metamodel . ManagedType # getDeclaredSingularAttribute (
* java . lang . String , java . lang . Class ) */
@ Override public < Y > SingularAttribute < X , Y > getDeclaredSingularAttribute ( String paramString , Class < Y > ... | return getDeclaredSingularAttribute ( paramString , paramClass , true ) ; |
public class SortableIdAndNameListBox { /** * fill entries of the listbox .
* @ param pids list of entries */
public final void fillEntries ( final Collection < T > pids ) { } } | final List < IdAndNameBean < T > > entries = new ArrayList < > ( ) ; for ( final T proEnum : pids ) { entries . add ( new IdAndNameBean < > ( proEnum , this . messages . name ( proEnum ) ) ) ; } if ( this . sortOrder != null ) { switch ( this . sortOrder ) { case ID_ASC : Collections . sort ( entries , new IdAndNameIdC... |
public class WImageRenderer { /** * Builds the " open tag " part of the XML , that is the tagname and attributes .
* E . g . & lt ; ui : image src = " example . png " alt = " some alt txt "
* The caller may then append any additional attributes and then close the XML tag .
* @ param imageComponent The WImage to r... | // Check for alternative text on the image
String alternativeText = imageComponent . getAlternativeText ( ) ; if ( alternativeText == null ) { alternativeText = "" ; } else { alternativeText = I18nUtilities . format ( null , alternativeText ) ; } xml . appendTagOpen ( "img" ) ; xml . appendAttribute ( "id" , imageCompo... |
public class ReportUtil { /** * Get detail band subreports for a report layout
* @ param reportLayout current report layout
* @ return list of subreports from detail band */
public static List < Report > getDetailSubreports ( ReportLayout reportLayout ) { } } | List < Report > subreports = new ArrayList < Report > ( ) ; Band band = reportLayout . getDetailBand ( ) ; for ( int i = 0 , rows = band . getRowCount ( ) ; i < rows ; i ++ ) { List < BandElement > list = band . getRow ( i ) ; for ( int j = 0 , size = list . size ( ) ; j < size ; j ++ ) { BandElement be = list . get ( ... |
public class ChatProvider { /** * Broadcast with support for a customizable level or mode .
* @ param levelOrMode if from is null , it ' s an attentionLevel , else it ' s a mode code . */
public void broadcast ( Name from , byte levelOrMode , String bundle , String msg , boolean forward ) { } } | if ( _broadcastObject != null ) { broadcastTo ( _broadcastObject , from , levelOrMode , bundle , msg ) ; } else { for ( Iterator < PlaceObject > iter = _plreg . enumeratePlaces ( ) ; iter . hasNext ( ) ; ) { PlaceObject plobj = iter . next ( ) ; if ( plobj . shouldBroadcast ( ) ) { broadcastTo ( plobj , from , levelOrM... |
public class ThinTableModel { /** * Update the currently updated record if the row is different from this row .
* @ param iRowIndex Row to read . . . If different from current record , update current . If - 1 , update and don ' t read . */
public void updateIfNewRow ( int iRowIndex ) throws DBException { } } | if ( ( m_iCurrentLockedRowIndex != - 1 ) && ( m_iCurrentLockedRowIndex != iRowIndex ) ) if ( m_buffCurrentLockedData != null ) { { FieldList fieldList = this . makeRowCurrent ( m_iCurrentLockedRowIndex , false ) ; // Read this row if it isn ' t current
if ( this . isRecordChanged ( ) ) { // Only update if there are cha... |
public class GrapesClient { /** * Post a build info to the server
* @ param moduleName String
* @ param moduleVersion String
* @ param buildInfo Map < String , String >
* @ param user String
* @ param password String
* @ throws GrapesCommunicationException
* @ throws javax . naming . AuthenticationExcepti... | final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getBuildInfoPath ( moduleName , moduleVersion ) ) ; final ClientResponse response = resource . type ( MediaType . APPLICATION_JSON ) . post ( ClientResponse . class , buildInfo ) ; ... |
public class SVGParser { private void parseAttributesCore ( SvgElementBase obj , Attributes attributes ) throws SVGParseException { } } | for ( int i = 0 ; i < attributes . getLength ( ) ; i ++ ) { String qname = attributes . getQName ( i ) ; if ( qname . equals ( "id" ) || qname . equals ( "xml:id" ) ) { obj . id = attributes . getValue ( i ) . trim ( ) ; break ; } else if ( qname . equals ( "xml:space" ) ) { String val = attributes . getValue ( i ) . t... |
public class AnyValueMap { /** * Converts map element into an AnyValueMap or returns null if conversion is not
* possible .
* @ param key a key of element to get .
* @ return AnyValueMap value of the element or null if conversion is not
* supported .
* @ see # fromValue ( Object ) */
public AnyValueMap getAsN... | Object value = getAsObject ( key ) ; return value != null ? AnyValueMap . fromValue ( value ) : null ; |
public class QueryImpl { /** * Populate using lucene .
* @ param m
* the m
* @ param client
* the client
* @ param result
* the result
* @ param columnsToSelect
* List of column names to be selected ( rest should be ignored )
* @ return the list */
protected List < Object > populateUsingLucene ( Entit... | Set < Object > uniquePKs = null ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; if ( client . getIndexManager ( ) . getIndexer ( ) . getClass ( ) . getName ( ) . equals ( IndexingConstants . LUCENE_INDEXER ) ) { String luceneQ = ... |
public class Modifiers { /** * When set native , non - native - method settings are cleared . */
public static int setNative ( int modifier , boolean b ) { } } | if ( b ) { return ( modifier | NATIVE ) & ( ~ VOLATILE & ~ TRANSIENT & ~ INTERFACE & ~ ABSTRACT & ~ STRICT ) ; } else { return modifier & ~ NATIVE ; } |
public class GetSnapshotContentsTaskRunner { /** * Create URL to call bridge app */
protected String buildBridgeURL ( GetSnapshotContentsTaskParameters taskParams ) { } } | int pageNumber = taskParams . getPageNumber ( ) ; if ( pageNumber < SnapshotConstants . DEFAULT_CONTENT_PAGE_NUMBER ) { pageNumber = SnapshotConstants . DEFAULT_CONTENT_PAGE_NUMBER ; } int pageSize = taskParams . getPageSize ( ) ; if ( pageSize < SnapshotConstants . MIN_CONTENT_PAGE_SIZE || pageSize > SnapshotConstants... |
public class AdminParserUtils { /** * Checks if there ' s exactly one option that exists among all possible opts .
* @ param options OptionSet to checked
* @ param opt1 Possible required option to check
* @ param opt2 Possible required option to check
* @ throws VoldemortException */
public static void checkReq... | List < String > opts = Lists . newArrayList ( ) ; opts . add ( opt1 ) ; opts . add ( opt2 ) ; checkRequired ( options , opts ) ; |
public class QueryExecutorImpl { /** * Wait for a row of data to be received from server on an active copy operation
* Connection gets unlocked by processCopyResults ( ) at end of operation .
* @ param op the copy operation presumably currently holding lock on this connection
* @ param block whether to block wait... | if ( ! hasLock ( op ) ) { throw new PSQLException ( GT . tr ( "Tried to read from inactive copy" ) , PSQLState . OBJECT_NOT_IN_STATE ) ; } try { processCopyResults ( op , block ) ; // expect a call to handleCopydata ( ) to store the data
} catch ( IOException ioe ) { throw new PSQLException ( GT . tr ( "Database connec... |
public class ThroughputDistribution { /** * Calculate a z - score for the specified value from the current
* throughput data . The z - score helps to normalize a distribution
* to the < em > standard < / em > normal distribution required to use
* cumulative tables to determine probability .
* @ param value the ... | // Generate a random value between - 0.5 and 0.5 if we have no
// historical data . This will result in a score that is well
// within 1 standard deviation from the specified value and
// avoid divide - by - zero issues .
if ( ewmaVariance == Double . NEGATIVE_INFINITY ) { return Math . random ( ) - 0.5 ; } double scor... |
public class DomainsInner { /** * Generate a single sign - on request for the domain management portal .
* Generate a single sign - on request for the domain management portal .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the DomainControlCenterSsoRequ... | if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null.... |
public class RandomDateUtils { /** * Returns a random valid value for the given { @ link TemporalField } between < code >
* TemporalField . range ( ) . min ( ) < / code > and < code > TemporalField . range ( ) . max ( ) < / code > . For example ,
* < code > random ( { @ link ChronoField # HOUR _ OF _ DAY } ) < / co... | long max = Math . min ( field . range ( ) . getMaximum ( ) , Long . MAX_VALUE - 1 ) ; return randomLong ( field . range ( ) . getMinimum ( ) , max + 1 ) ; |
public class Lexer { /** * 多行注释 , 开始状态 200 , 关注结尾标记与 EOF */
boolean scanMultiLineComment ( ) { } } | while ( true ) { switch ( state ) { case 200 : if ( peek ( ) == '#' && next ( ) == '-' && next ( ) == '-' ) { state = 201 ; continue ; } return fail ( ) ; case 201 : for ( char c = next ( ) ; true ; c = next ( ) ) { if ( c == '-' && buf [ forward + 1 ] == '-' && buf [ forward + 2 ] == '#' ) { forward = forward + 3 ; if... |
public class ModbusTCPMaster { /** * Connects this < tt > ModbusTCPMaster < / tt > with the slave .
* @ throws Exception if the connection cannot be established . */
public void connect ( ) throws Exception { } } | if ( connection != null && ! connection . isConnected ( ) ) { connection . connect ( useRtuOverTcp ) ; transaction = connection . getModbusTransport ( ) . createTransaction ( ) ; ( ( ModbusTCPTransaction ) transaction ) . setReconnecting ( reconnecting ) ; setTransaction ( transaction ) ; } |
public class CmsSitemapController { /** * Returns the no edit reason or < code > null < / code > if editing is allowed . < p >
* @ param entry the entry to get the no edit reason for
* @ return the no edit reason */
public String getNoEditReason ( CmsClientSitemapEntry entry ) { } } | String reason = entry . getNoEditReason ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( reason ) ) { reason = null ; if ( ( entry . getLock ( ) != null ) && ( entry . getLock ( ) . getLockOwner ( ) != null ) && ! entry . getLock ( ) . isOwnedByUser ( ) ) { reason = Messages . get ( ) . key ( Messages . GUI_DISABLE... |
public class DomainsInner { /** * Lists domain ownership identifiers .
* Lists domain ownership identifiers .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param domainName Name of domain .
* @ throws IllegalArgumentException thrown if parameters fail the validation ... | return listOwnershipIdentifiersSinglePageAsync ( resourceGroupName , domainName ) . concatMap ( new Func1 < ServiceResponse < Page < DomainOwnershipIdentifierInner > > , Observable < ServiceResponse < Page < DomainOwnershipIdentifierInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DomainOwner... |
public class WVideoExample { /** * Set the video configuration options . */
private void setupVideo ( ) { } } | video . setAutoplay ( cbAutoPlay . isSelected ( ) ) ; video . setLoop ( cbLoop . isSelected ( ) ) ; video . setMuted ( ! cbMute . isDisabled ( ) && cbMute . isSelected ( ) ) ; video . setControls ( cbControls . isSelected ( ) ? WVideo . Controls . PLAY_PAUSE : WVideo . Controls . NATIVE ) ; video . setDisabled ( cbCont... |
public class ObjectSerialization { /** * Writes an object ot a file */
public static void serialize ( File file , SerializableObject object ) throws IOException { } } | AtomicFile atomicFile = new AtomicFile ( file ) ; FileOutputStream stream = null ; try { stream = atomicFile . startWrite ( ) ; DataOutputStream out = new DataOutputStream ( stream ) ; object . writeExternal ( out ) ; atomicFile . finishWrite ( stream ) ; // serialization was successful
} catch ( Exception e ) { atomic... |
public class ExtensionAuthentication { /** * Gets the authentication method type for a given identifier .
* @ param id the id
* @ return the authentication method type for identifier */
public AuthenticationMethodType getAuthenticationMethodTypeForIdentifier ( int id ) { } } | for ( AuthenticationMethodType t : getAuthenticationMethodTypes ( ) ) if ( t . getUniqueIdentifier ( ) == id ) return t ; return null ; |
public class AbstractContext { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . BinderContext # canPersist ( java . lang . Class ) */
public boolean canPersist ( Class < ? > cls ) { } } | Object mapper = OBJECT_MAPPERS . get ( cls ) ; if ( mapper == null ) { // The only way the mapper wouldn ' t already be loaded into
// OBJECT _ MAPPERS is if it was compiled separately , but let ' s handle
// it anyway
String beanClassName = cls . getName ( ) ; String mapperClassName = cls . getName ( ) + KriptonBinder... |
public class BytecodeUtils { /** * Implements the short circuiting logical or ( { @ code | | } ) operator over the list of boolean
* expressions . */
public static Expression logicalOr ( List < ? extends Expression > expressions ) { } } | return doShortCircuitingLogicalOperator ( ImmutableList . copyOf ( expressions ) , true ) ; |
public class ContractsApi { /** * Get contracts ( asynchronously ) Returns contracts available to a
* character , only if the character is issuer , acceptor or assignee . Only
* returns contracts no older than 30 days , or if the status is
* \ & quot ; in _ progress \ & quot ; . - - - This route is cached for up ... | com . squareup . okhttp . Call call = getCharactersCharacterIdContractsValidateBeforeCall ( characterId , datasource , ifNoneMatch , page , token , callback ) ; Type localVarReturnType = new TypeToken < List < CharacterContractsResponse > > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , ... |
public class TcpServer { /** * Setups a callback called when { @ link io . netty . channel . ServerChannel } is about to
* bind .
* @ param doOnBind a consumer observing server start event
* @ return a new { @ link TcpServer } */
public final TcpServer doOnBind ( Consumer < ? super ServerBootstrap > doOnBind ) { ... | Objects . requireNonNull ( doOnBind , "doOnBind" ) ; return new TcpServerDoOn ( this , doOnBind , null , null ) ; |
public class CommerceAccountLocalServiceBaseImpl { /** * Returns the commerce account with the matching external reference code and company .
* @ param companyId the primary key of the company
* @ param externalReferenceCode the commerce account ' s external reference code
* @ return the matching commerce account... | return commerceAccountPersistence . fetchByC_ERC ( companyId , null ) ; |
public class ExtractZooKeeperArbitrateEvent { /** * < pre >
* 算法 :
* 1 . 检查当前的Permit , 阻塞等待其授权 ( 解决Channel的pause状态处理 )
* 2 . 开始阻塞获取符合条件的processId
* 3 . 检查当前的即时Permit状态 ( 在阻塞获取processId过程会出现一些error信号 , process节点会被删除 )
* 4 . 获取Select传递的EventData数据 , 添加next node信息后直接返回
* < / pre >
* @ return */
public EtlEve... | Assert . notNull ( pipelineId ) ; PermitMonitor permitMonitor = ArbitrateFactory . getInstance ( pipelineId , PermitMonitor . class ) ; permitMonitor . waitForPermit ( ) ; // 阻塞等待授权
ExtractStageListener extractStageListener = ArbitrateFactory . getInstance ( pipelineId , ExtractStageListener . class ) ; Long processId ... |
public class SarlArtifactBuilderImpl { /** * Initialize the Ecore element when inside a script . */
public void eInit ( SarlScript script , String name , IJvmTypeProvider context ) { } } | setTypeResolutionContext ( context ) ; if ( this . sarlArtifact == null ) { this . sarlArtifact = SarlFactory . eINSTANCE . createSarlArtifact ( ) ; script . getXtendTypes ( ) . add ( this . sarlArtifact ) ; this . sarlArtifact . setAnnotationInfo ( XtendFactory . eINSTANCE . createXtendTypeDeclaration ( ) ) ; if ( ! S... |
public class CreateUserRequest { /** * The unique identifier of the security profile to assign to the user created .
* @ param securityProfileIds
* The unique identifier of the security profile to assign to the user created . */
public void setSecurityProfileIds ( java . util . Collection < String > securityProfile... | if ( securityProfileIds == null ) { this . securityProfileIds = null ; return ; } this . securityProfileIds = new java . util . ArrayList < String > ( securityProfileIds ) ; |
public class DoLock { /** * Executes the lock for a Mac OS Finder client */
private void doMacLockRequestWorkaround ( final ITransaction transaction , final WebdavRequest req , final WebdavResponse resp ) throws LockFailedException , IOException { } } | LockedObject lo ; final int depth = getDepth ( req ) ; int lockDuration = getTimeout ( transaction , req ) ; if ( lockDuration < 0 || lockDuration > MAX_TIMEOUT ) { lockDuration = DEFAULT_TIMEOUT ; } boolean lockSuccess = false ; lockSuccess = _resourceLocks . exclusiveLock ( transaction , _path , _lockOwner , depth , ... |
public class Probe { /** * Returns a mutable copy of the captured event information ( in reverse order - last added events go first ) .
* @ return mutable copy of the captured event information */
List < EventInfo > getEvents ( ) { } } | synchronized ( events ) { List < EventInfo > result = new ArrayList < > ( events . size ( ) ) ; for ( ListIterator < EventInfo > iterator = events . listIterator ( events . size ( ) ) ; iterator . hasPrevious ( ) ; ) { result . add ( iterator . previous ( ) ) ; } return result ; } |
public class DatadogHttpReporter { /** * Get tags from MetricGroup # getAllVariables ( ) , excluding ' host ' . */
private List < String > getTagsFromMetricGroup ( MetricGroup metricGroup ) { } } | List < String > tags = new ArrayList < > ( ) ; for ( Map . Entry < String , String > entry : metricGroup . getAllVariables ( ) . entrySet ( ) ) { if ( ! entry . getKey ( ) . equals ( HOST_VARIABLE ) ) { tags . add ( getVariableName ( entry . getKey ( ) ) + ":" + entry . getValue ( ) ) ; } } return tags ; |
public class Jenkins { /** * Gets the JDK installation of the given name , or returns null . */
public JDK getJDK ( String name ) { } } | if ( name == null ) { // if only one JDK is configured , " default JDK " should mean that JDK .
List < JDK > jdks = getJDKs ( ) ; if ( jdks . size ( ) == 1 ) return jdks . get ( 0 ) ; return null ; } for ( JDK j : getJDKs ( ) ) { if ( j . getName ( ) . equals ( name ) ) return j ; } return null ; |
public class ResultsPartitionsFactory { /** * Determine the correct ResultsPartitioner to use given the SearchResults
* search range , and use that to break the SearchResults into partitions .
* @ param results
* @ param wbRequest
* @ return ArrayList of ResultsPartition objects */
public static ArrayList < Res... | return get ( results , wbRequest , null ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.