signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Pipe { /** * Stop piping data from input to output . */
public synchronized void stop ( ) { } } | if ( null != m_pump ) { // disconnect pump
m_pump . connect ( null ) ; m_pump . setName ( m_pump . getName ( ) + " (disconnected)" ) ; m_pump = null ; } |
public class SSLHelper { /** * Adds an SSL context to the HttpClient . No trust or client certificate is
* established and a trust - all policy is assumed .
* @ param client the HttpClient
* @ param port SSL port
* @ param server the LibertyServer */
public static void establishSSLContext ( HttpClient client , ... | establishSSLContext ( client , port , server , null , null , null , null , "TLSv1.2" ) ; |
public class AuthAPI { /** * Request a password reset for the given email and database connection . The response will always be successful even if
* there ' s no user associated to the given email for that database connection .
* i . e . :
* < pre >
* { @ code
* AuthAPI auth = new AuthAPI ( " me . auth0 . com... | Asserts . assertNotNull ( email , "email" ) ; Asserts . assertNotNull ( connection , "connection" ) ; String url = baseUrl . newBuilder ( ) . addPathSegment ( PATH_DBCONNECTIONS ) . addPathSegment ( "change_password" ) . build ( ) . toString ( ) ; VoidRequest request = new VoidRequest ( client , url , "POST" ) ; reques... |
public class GenerateReferenceParetoSetAndFrontFromDoubleSolutions { /** * The run ( ) method creates de output directory and compute the fronts */
@ Override public void run ( ) throws IOException { } } | String outputDirectoryName = experiment . getReferenceFrontDirectory ( ) ; createOutputDirectory ( outputDirectoryName ) ; List < String > referenceFrontFileNames = new LinkedList < > ( ) ; for ( ExperimentProblem < ? > problem : experiment . getProblemList ( ) ) { List < DoubleSolution > nonDominatedSolutions = getNon... |
public class DeleteHandlerV1 { /** * Get the GUIDs and vertices for all composite entities owned / contained by the specified root entity AtlasVertex .
* The graph is traversed from the root entity through to the leaf nodes of the containment graph .
* @ param entityVertex the root entity vertex
* @ return set of... | Set < GraphHelper . VertexInfo > result = new LinkedHashSet < > ( ) ; Stack < AtlasVertex > vertices = new Stack < > ( ) ; vertices . push ( entityVertex ) ; while ( vertices . size ( ) > 0 ) { AtlasVertex vertex = vertices . pop ( ) ; AtlasEntity . Status state = AtlasGraphUtilsV1 . getState ( vertex ) ; if ( state ==... |
public class InboundNatRulesInner { /** * Creates or updates a load balancer inbound nat rule .
* @ param resourceGroupName The name of the resource group .
* @ param loadBalancerName The name of the load balancer .
* @ param inboundNatRuleName The name of the inbound nat rule .
* @ param inboundNatRuleParamete... | return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , loadBalancerName , inboundNatRuleName , inboundNatRuleParameters ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class ConstantIntegerInfo { /** * Will return either a new ConstantIntegerInfo object or one already in
* the constant pool . If it is a new ConstantIntegerInfo , it will be
* inserted into the pool . */
static ConstantIntegerInfo make ( ConstantPool cp , int value ) { } } | ConstantInfo ci = new ConstantIntegerInfo ( value ) ; return ( ConstantIntegerInfo ) cp . addConstant ( ci ) ; |
public class JMessageClient { /** * Add or remove members from a group
* @ param gid The group id
* @ param addList If this parameter is null then send remove request
* @ param removeList If this parameter is null then send add request
* @ throws APIConnectionException connect exception
* @ throws APIRequestE... | Members add = Members . newBuilder ( ) . addMember ( addList ) . build ( ) ; Members remove = Members . newBuilder ( ) . addMember ( removeList ) . build ( ) ; _groupClient . addOrRemoveMembers ( gid , add , remove ) ; |
public class SVMLightParser { /** * Try to parse the bytes as svm light format , return a ParseSetupHandler with type
* SVMLight if the input is in svm light format , throw an exception otherwise . */
public static ParseSetup guessSetup ( byte [ ] bits ) { } } | int lastNewline = bits . length - 1 ; while ( lastNewline > 0 && ! CsvParser . isEOL ( bits [ lastNewline ] ) ) lastNewline -- ; if ( lastNewline > 0 ) bits = Arrays . copyOf ( bits , lastNewline + 1 ) ; SVMLightParser p = new SVMLightParser ( new ParseSetup ( SVMLight_INFO , ParseSetup . GUESS_SEP , false , ParseSetup... |
public class SourceStream { /** * This is used to set the sendWindow defined in Admin panels */
public synchronized void setDefinedSendWindow ( long newSendWindow ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setDefinedSendWindow" , Long . valueOf ( newSendWindow ) ) ; definedSendWindow = newSendWindow ; // PK41355 - Commenting out - should not be sending stuff at reconstitute
// updateAndPersistSendWindow ( ) ;
if ( Trac... |
public class AbstractRadial { /** * Enables / disables the usage of a transparent color for filling areas
* @ param TRANSPARENT _ AREAS _ ENABLED */
public void setTransparentAreasEnabled ( final boolean TRANSPARENT_AREAS_ENABLED ) { } } | transparentAreasEnabled = TRANSPARENT_AREAS_ENABLED ; init ( getInnerBounds ( ) . width , getInnerBounds ( ) . height ) ; repaint ( getInnerBounds ( ) ) ; |
public class KafkaPusher { /** * Actually creates the Kafka producer . */
protected ProducerCloseable < String , byte [ ] > createProducer ( ProducerConfig config ) { } } | return this . closer . register ( new ProducerCloseable < String , byte [ ] > ( config ) ) ; |
public class InboundTransmissionParser { /** * Invoked to parse a segmented transmission middle payload from the supplied buffer .
* May be invoked multiple times to incrementally parse the structure .
* Once the structure has been fully parsed , transitions the state machine
* into the appropriate next state bas... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "parseSegmentMiddlePayload" , contextBuffer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) JFapUtils . debugTraceWsByteBufferInfo ( this , tc , contextBuffer , "contextBuffer" ) ; WsByt... |
public class RedisClusterManagerFactory { /** * 根据配置构建一个RedissonClient
* @ param redisBaseConfig 配置文件
* @ return 构建的RedissonClient */
private static RedissonClient buildRedissonClient ( RedisBaseConfig redisBaseConfig ) { } } | Config config = new Config ( ) ; if ( redisBaseConfig instanceof RedisSingleServerConfig ) { RedisSingleServerConfig redisSingleServerConfig = ( RedisSingleServerConfig ) redisBaseConfig ; SingleServerConfig singleServerConfig = config . useSingleServer ( ) ; BeanUtils . copy ( singleServerConfig , redisSingleServerCon... |
public class ModbusMaster { /** * This function code is used to write a block of contiguous registers ( 1 to 123 registers ) in a
* remote device .
* The requested written values are specified in the request data field . Data is packed as two
* bytes per register .
* @ param serverAddress a slave address
* @ ... | processRequest ( ModbusRequestBuilder . getInstance ( ) . buildWriteMultipleRegisters ( serverAddress , startAddress , registers ) ) ; |
public class RestRequestHandler { /** * { @ inheritDoc } */
@ Override @ GET @ Path ( "/responses" ) public Collection < Response > getResponses ( @ QueryParam ( "earliest" ) String earliest ) throws NotAuthorizedException { } } | accessControlUtils . checkAuthorization ( Action . GET_RESPONSES , requestContext ) ; SearchCriteria criteria = new SearchCriteria ( ) . setDetectionSystemIds ( StringUtils . toCollection ( getClientApplicationName ( ) ) ) . setEarliest ( earliest ) ; return appSensorServer . getResponseStore ( ) . findResponses ( crit... |
public class SVGRenderer { private void writeHeader ( ) { } } | out . println ( "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>" ) ; out . println ( "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20010904//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">" ) ; out . println ( "<!-- Rendered by CSSBox http://cssbox.sourceforge.net -->" ) ; out . println ( "<s... |
public class MultiAssetResponsiveDisplayAd { /** * Gets the squareMarketingImages value for this MultiAssetResponsiveDisplayAd .
* @ return squareMarketingImages * Square marketing image to be used in the ad . This image may
* be used when a square aspect ratio
* is more appropriate than the aspect ratio of the
... | return squareMarketingImages ; |
public class JMXContext { /** * Get the { @ link MemoryPoolMXBean } with one of the given names . The first
* matching memory pool is returned . If no memory pool exists for the given
* names , then < code > null < / code > is returned .
* @ param names The names of the memory pools to search
* @ return The ass... | for ( String name : names ) { MemoryPoolMXBean bean = getMemoryPoolMXBean ( name ) ; if ( bean != null ) { return bean ; } } return null ; |
public class RtfDestinationMgr { /** * Adds a < CODE > RtfDestinationListener < / CODE > to the appropriate < CODE > RtfDestination < / CODE > .
* @ param destination the destination string for the listener
* @ param listener
* the new RtfDestinationListener . */
public static boolean addListener ( String destina... | RtfDestination dest = getDestination ( destination ) ; if ( dest != null ) { return dest . addListener ( listener ) ; } return false ; |
public class ShowcaseAd { /** * Get Custom Deserializer */
public static org . apache . axis . encoding . Deserializer getDeserializer ( java . lang . String mechType , java . lang . Class _javaType , javax . xml . namespace . QName _xmlType ) { } } | return new org . apache . axis . encoding . ser . BeanDeserializer ( _javaType , _xmlType , typeDesc ) ; |
public class ContainerDefinition { /** * The secrets to pass to the container . For more information , see < a
* href = " http : / / docs . aws . amazon . com / AmazonECS / latest / developerguide / specifying - sensitive - data . html " > Specifying
* Sensitive Data < / a > in the < i > Amazon Elastic Container Se... | if ( secrets == null ) { secrets = new com . amazonaws . internal . SdkInternalList < Secret > ( ) ; } return secrets ; |
public class FolderJob { /** * Get a list of all the defined jobs in this folder
* @ return list of defined jobs ( summary level , for details { @ link Job # details ( ) } . */
public Map < String , Job > getJobs ( ) { } } | // FIXME : Check for null of jobs ? Can that happen ?
return jobs . stream ( ) . map ( SET_CLIENT ( this . client ) ) . collect ( Collectors . toMap ( k -> k . getName ( ) , Function . identity ( ) ) ) ; |
public class DefaultUrlCreator { /** * Appends a URL token to the buffer */
private void appendUrlToken ( FastStringWriter actualUriBuf , Object token , String charset ) { } } | actualUriBuf . append ( SLASH ) . append ( urlEncode ( token , charset ) ) ; |
public class DataClient { /** * shorthand for getTable
* @ param name
* @ return */
@ CallerSideMethod public RealLiveTable tbl ( String name ) { } } | return ( RealLiveTable ) getActor ( ) . syncTableAccess . get ( name ) ; |
public class Vector { /** * Parses { @ link Vector } from the given Matrix Market .
* @ param is the input stream in Matrix Market format
* @ return a parsed vector
* @ exception IOException if an I / O error occurs . */
public static Vector fromMatrixMarket ( InputStream is ) throws IOException { } } | StreamTokenizer tokenizer = new StreamTokenizer ( new BufferedReader ( new InputStreamReader ( is ) ) ) ; tokenizer . wordChars ( '%' , '%' ) ; tokenizer . nextToken ( ) ; if ( ! "%%MatrixMarket" . equals ( tokenizer . sval ) ) { throw new IllegalArgumentException ( "Wrong input file format: can not read header '%%Matr... |
public class BackupManagerImpl { /** * { @ inheritDoc } */
public JobWorkspaceRestore getLastRestore ( String repositoryName , String workspaceName ) { } } | for ( int i = restoreJobs . size ( ) - 1 ; i >= 0 ; i -- ) { JobWorkspaceRestore job = restoreJobs . get ( i ) ; if ( repositoryName . equals ( job . getRepositoryName ( ) ) && workspaceName . equals ( job . getWorkspaceName ( ) ) ) { return job ; } } return null ; |
public class FastDateFormat { /** * < p > Formats a millisecond { @ code long } value into the
* supplied { @ code StringBuffer } . < / p >
* @ param millis the millisecond value to format
* @ param buf the buffer to format into
* @ return the specified string buffer
* @ since 2.1
* @ deprecated Use { { @ l... | return printer . format ( millis , buf ) ; |
public class DateCaster { /** * reads a offset definition at the end of a date string
* @ param timeZone
* @ param dt previous parsed date Object
* @ param ds DateString to parse
* @ param defaultValue
* @ return date Object with offset */
private static DateTime readOffset ( boolean isPlus , TimeZone timeZon... | // timeZone = ThreadLocalPageContext . getTimeZone ( timeZone ) ;
if ( timeZone == null ) return defaultValue ; // HOUR
int hourLength = ds . getPos ( ) ; int hour = ds . readDigits ( ) ; hourLength = ds . getPos ( ) - hourLength ; if ( hour == - 1 ) return defaultValue ; // MINUTE
int minute = 0 ; if ( ! ds . isAfterL... |
public class ControlBeanContextSupport { /** * Fire a BeanContextMembershipEvent .
* @ param bcme Event to fire .
* @ param childrenAdded True if add event , false if remove event . */
private void fireMembershipEvent ( BeanContextMembershipEvent bcme , boolean childrenAdded ) { } } | for ( BeanContextMembershipListener bcml : _bcMembershipListeners ) { if ( childrenAdded ) { bcml . childrenAdded ( bcme ) ; } else { bcml . childrenRemoved ( bcme ) ; } } |
public class Traversals { /** * Post - order traversal of all branching nodes in a suffix tree ( emulated using a
* suffix array and the LCP array ) . Post - order traversal is also called < i > bottom - up
* traversal < / i > that is child nodes are reported before parent nodes ( and the root is
* the last node ... | assert sequenceLength <= sa . length && sequenceLength <= lcp . length : "Input sequence length larger than suffix array or the LCP." ; final Deque < Integer > stack = new ArrayDeque < > ( ) ; final ArrayList < E > values = new ArrayList < > ( ) ; // Push the stack bottom marker ( sentinel ) .
stack . push ( - 1 ) ; st... |
public class OAuthCodec { /** * Encode the specified value .
* @ param value The value to encode .
* @ return The encoded value . */
public static String oauthEncode ( String value ) { } } | if ( value == null ) { return "" ; } try { return new String ( URLCodec . encodeUrl ( SAFE_CHARACTERS , value . getBytes ( "UTF-8" ) ) , "US-ASCII" ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } |
public class RetouchedBloomFilter { /** * Chooses the bit position that minimizes the number of false negative generated while maximizing .
* the number of false positive removed .
* @ param h The different bit positions .
* @ return The position that minimizes the number of false negative generated while maximiz... | computeRatio ( ) ; int minIndex = Integer . MAX_VALUE ; double minValue = Double . MAX_VALUE ; for ( int i = 0 ; i < nbHash ; i ++ ) { if ( ratio [ h [ i ] ] < minValue ) { minValue = ratio [ h [ i ] ] ; minIndex = h [ i ] ; } } return minIndex ; |
public class JavaZipFileSystem { /** * { @ inheritDoc } */
public InputStream openInputStream ( VirtualFile mountPoint , VirtualFile target ) throws IOException { } } | final ZipNode zipNode = getExistingZipNode ( mountPoint , target ) ; final File cachedFile = zipNode . cachedFile ; if ( cachedFile != null ) { return new FileInputStream ( cachedFile ) ; } if ( rootNode == zipNode ) { return new FileInputStream ( archiveFile ) ; } final JarEntry entry = zipNode . entry ; if ( entry ==... |
public class CarrierRefresher { /** * Helper method to transparently rearrange the node list based on the current global offset .
* @ param nodeList the list to shift . */
< T > void shiftNodeList ( List < T > nodeList ) { } } | int shiftBy = ( int ) ( nodeOffset ++ % nodeList . size ( ) ) ; for ( int i = 0 ; i < shiftBy ; i ++ ) { T element = nodeList . remove ( 0 ) ; nodeList . add ( element ) ; } |
public class JQLChecker { /** * Extract columns to insert or update .
* @ param jqlContext
* the jql context
* @ param jqlValue
* the jql value
* @ param entity
* the entity
* @ return the sets the */
public Set < String > extractColumnsToInsertOrUpdate ( final JQLContext jqlContext , String jqlValue , fi... | final Set < String > result = new LinkedHashSet < String > ( ) ; final One < Boolean > selectionOn = new One < Boolean > ( null ) ; final One < Boolean > insertOn = new One < Boolean > ( null ) ; // Column _ name _ set is needed for insert
// Columns _ to _ update is needed for update
analyzeInternal ( jqlContext , jql... |
public class OneShotSQLGeneratorEngine { /** * We look for the ID in the list of IDs , if it ' s not there , then we return - 2,
* which we know will never appear on the DB . This is correct because if a
* constant appears in a query , and that constant was never inserted in the
* DB , the query must be empty ( t... | Integer id = uriRefIds . getId ( uri ) ; if ( id != null ) return id ; return - 2 ; |
public class InmemoryNodeTypeRepository { /** * { @ inheritDoc } */
public void removeNodeType ( NodeTypeData nodeType ) { } } | InternalQName nodeTypeName = nodeType . getName ( ) ; // put supers
final Set < InternalQName > supers = hierarchy . getSubtypes ( nodeTypeName ) ; // remove from internal lists
hierarchy . removeNodeType ( nodeTypeName ) ; // remove supers
if ( supers != null ) { for ( final InternalQName superName : supers ) { defsHo... |
public class PhotosApi { /** * Returns next and previous photos for a photo in a photostream .
* < br >
* This method does not require authentication .
* @ param photoId Required . The id of the photo to fetch the context for .
* @ return object with the context of the photo .
* @ throws JinxException if the ... | JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.getContext" ) ; params . put ( "photo_id" , photoId ) ; return jinx . flickrGet ( params , Context . class ) ; |
public class SingleCouponMap { /** * Returns entryIndex if the given key is found . The coupon may be valid or contain a table index .
* If not found , returns one ' s complement entryIndex
* of an empty slot for insertion , which may be over a deleted key .
* @ param key the given key
* @ return the entryIndex... | final long [ ] hash = MurmurHash3 . hash ( key , SEED ) ; int entryIndex = getIndex ( hash [ 0 ] , tableEntries_ ) ; final int stride = getStride ( hash [ 1 ] , tableEntries_ ) ; final int loopIndex = entryIndex ; do { if ( couponsArr_ [ entryIndex ] == 0 ) { return ~ entryIndex ; // empty
} if ( Map . arraysEqual ( ke... |
public class ControllerHandler { /** * Configures the content - type suffixes
* @ param engines
* @ return acceptable content - type suffixes */
protected Set < String > configureContentTypeSuffixes ( ContentTypeEngines engines ) { } } | if ( null == ClassUtil . getAnnotation ( method , ContentTypeBySuffix . class ) ) { return Collections . emptySet ( ) ; } Set < String > suffixes = new TreeSet < > ( ) ; for ( String suffix : engines . getContentTypeSuffixes ( ) ) { String contentType = engines . getContentTypeEngine ( suffix ) . getContentType ( ) ; i... |
public class AsmUtils { /** * Changes the access level for the specified field for a class .
* @ param clazz the clazz
* @ param fieldName the field name
* @ param srgName the srg name
* @ param silenced the silenced
* @ return the field */
public static Field changeFieldAccess ( Class < ? > clazz , String fi... | try { Field f = clazz . getDeclaredField ( MalisisCore . isObfEnv ? srgName : fieldName ) ; f . setAccessible ( true ) ; Field modifiers = Field . class . getDeclaredField ( "modifiers" ) ; modifiers . setAccessible ( true ) ; modifiers . setInt ( f , f . getModifiers ( ) & ~ Modifier . FINAL ) ; return f ; } catch ( R... |
public class GoogleMapShapeConverter { /** * Convert a { @ link CurvePolygon } to a { @ link PolygonOptions }
* @ param curvePolygon curve polygon
* @ return polygon options
* @ since 1.4.1 */
public PolygonOptions toCurvePolygon ( CurvePolygon curvePolygon ) { } } | PolygonOptions polygonOptions = new PolygonOptions ( ) ; List < Curve > rings = curvePolygon . getRings ( ) ; if ( ! rings . isEmpty ( ) ) { Double z = null ; // Add the polygon points
Curve curve = rings . get ( 0 ) ; if ( curve instanceof CompoundCurve ) { CompoundCurve compoundCurve = ( CompoundCurve ) curve ; for (... |
public class ContextSerializerFactory { /** * Returns the serializer for a given class . */
public Serializer getSerializer ( String className ) { } } | Serializer serializer = _serializerClassMap . get ( className ) ; if ( serializer == AbstractSerializer . NULL ) return null ; else return serializer ; |
public class CodeGenerator { /** * If we ' re at the start of an arrow function body , we need parentheses around object literals and
* object patterns . We also must also pass the IN _ FOR _ INIT _ CLAUSE flag into subexpressions . */
private static Context getContextForArrowFunctionBody ( Context context ) { } } | return context . inForInInitClause ( ) ? Context . START_OF_ARROW_FN_IN_FOR_INIT : Context . START_OF_ARROW_FN_BODY ; |
public class MimeTypeUtils { /** * Parse the given , comma - separated string into a list of { @ code MimeType } objects .
* @ param mimeTypes the string to parse
* @ return the list of mime types
* @ throws IllegalArgumentException if the string cannot be parsed */
public static List < MimeType > parseMimeTypes ... | if ( ! Strings . isNullOrEmpty ( mimeTypes ) ) { return Collections . emptyList ( ) ; } String [ ] tokens = mimeTypes . split ( ",\\s*" ) ; List < MimeType > result = new ArrayList < MimeType > ( tokens . length ) ; for ( String token : tokens ) { result . add ( parseMimeType ( token ) ) ; } return result ; |
public class UserTransactionImpl { /** * Stop
* @ exception Throwable Thrown if an error occurs */
public void stop ( ) throws Throwable { } } | Context context = new InitialContext ( ) ; context . unbind ( JNDI_NAME ) ; context . close ( ) ; |
public class ResultSetUtility { /** * Convert all rows of the ResultSet to a Map . The keys of the Map are property names transformed from column names .
* @ param rs the result set
* @ param alreadyDeterminedMappingsthe mapping of column label / name and column meta data
* @ returnA list of Map representations o... | ResultSetMetaData rsmd = rs . getMetaData ( ) ; Map < String , ColumnMetaData > columnToPropertyMappings = alreadyDeterminedMappings ; if ( columnToPropertyMappings == null ) { columnToPropertyMappings = createColumnToPropertyMappings ( rsmd ) ; } List < Map < String , Object > > list = new LinkedList < Map < String , ... |
public class Misc { /** * in CBLMisc . m
* id CBLKeyForPrefixMatch ( id key , unsigned depth ) */
public static Object keyForPrefixMatch ( Object key , int depth ) { } } | if ( depth < 1 ) return key ; if ( key instanceof String ) { return ( key + "\uFFFF" ) ; } else if ( key instanceof List ) { ArrayList < Map < String , Object > > nuKey = new ArrayList < Map < String , Object > > ( ( List < Map < String , Object > > ) key ) ; if ( depth == 1 ) { nuKey . add ( new HashMap < String , Obj... |
public class ValueExpressionImpl { /** * ( non - Javadoc )
* @ see javax . el . ValueExpression # setValue ( javax . el . ELContext ,
* java . lang . Object ) */
@ Override public void setValue ( ELContext context , Object value ) throws PropertyNotFoundException , PropertyNotWritableException , ELException { } } | EvaluationContext ctx = new EvaluationContext ( context , this . fnMapper , this . varMapper ) ; context . notifyBeforeEvaluation ( getExpressionString ( ) ) ; this . getNode ( ) . setValue ( ctx , value ) ; context . notifyAfterEvaluation ( getExpressionString ( ) ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcValveType ( ) { } } | if ( ifcValveTypeEClass == null ) { ifcValveTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 748 ) ; } return ifcValveTypeEClass ; |
public class QueueEntryRow { /** * Extracts the queue name from the KeyValue row , which the row must be a queue entry . */
public static QueueName getQueueName ( String appName , String flowName , KeyValue keyValue ) { } } | return getQueueName ( appName , flowName , keyValue . getBuffer ( ) , keyValue . getRowOffset ( ) , keyValue . getRowLength ( ) ) ; |
public class CmsFileTable { /** * Updates all items with ids from the given list . < p >
* @ param ids the resource structure ids to update
* @ param remove true if the item should be removed only */
public void update ( Collection < CmsUUID > ids , boolean remove ) { } } | for ( CmsUUID id : ids ) { updateItem ( id , remove ) ; } rebuildMenu ( ) ; |
public class ParseContext { /** * Runs { @ code parser } with error recording suppressed . */
final boolean withErrorSuppressed ( Parser < ? > parser ) { } } | boolean oldValue = errorSuppressed ; errorSuppressed = true ; boolean ok = parser . apply ( this ) ; errorSuppressed = oldValue ; return ok ; |
public class MalisisInventoryContainer { /** * Called when this { @ link MalisisInventoryContainer } is closed .
* @ param owner the owner */
@ Override public void onContainerClosed ( EntityPlayer owner ) { } } | super . onContainerClosed ( owner ) ; getInventories ( ) . forEach ( i -> i . removeOpenedContainer ( this ) ) ; |
public class UNode { /** * Get the child node ( member ) of this UNode with the given name . If this UNode isn ' t
* a MAP or there is no child node with the given name , null is returned . Note : the
* UNode returned is not copied .
* @ param name Candidate name of a child member node .
* @ return Child UNode ... | if ( m_childNodeMap == null ) { return null ; } return m_childNodeMap . get ( name ) ; |
public class Helper { /** * obtains the internal JDO lifecycle state of the input StatemanagerInternal .
* This Method is helpful to display persistent objects internal state .
* @ param sm the StateManager to be inspected
* @ return the LifeCycleState of a StateManager instance */
static Object getLCState ( Stat... | // unfortunately the LifeCycleState classes are package private .
// so we have to do some dirty reflection hack to access them
try { Field myLC = sm . getClass ( ) . getDeclaredField ( "myLC" ) ; myLC . setAccessible ( true ) ; return myLC . get ( sm ) ; } catch ( NoSuchFieldException e ) { return e ; } catch ( Illega... |
public class ClassNode { /** * Finds a constructor matching the given parameters in this class .
* @ return the constructor matching the given parameters or null */
public ConstructorNode getDeclaredConstructor ( Parameter [ ] parameters ) { } } | for ( ConstructorNode method : getDeclaredConstructors ( ) ) { if ( parametersEqual ( method . getParameters ( ) , parameters ) ) { return method ; } } return null ; |
public class CmsListPrintDialog { /** * Generates the printable output for the given list . < p >
* @ return html code */
public String generateHtml ( ) { } } | StringBuffer result = new StringBuffer ( 2048 ) ; result . append ( htmlStart ( null ) ) ; result . append ( CmsListExplorerColumn . getExplorerStyleDef ( ) ) ; result . append ( bodyStart ( "dialog" , null ) ) ; result . append ( dialogStart ( ) ) ; result . append ( dialogContentStart ( getParamTitle ( ) ) ) ; result... |
public class OAuth20TokenAuthorizationResponseBuilder { /** * Build callback url response type string .
* @ param holder the holder
* @ param redirectUri the redirect uri
* @ param accessToken the access token
* @ param params the params
* @ param refreshToken the refresh token
* @ param context the context... | val attributes = holder . getAuthentication ( ) . getAttributes ( ) ; val state = attributes . get ( OAuth20Constants . STATE ) . get ( 0 ) . toString ( ) ; val nonce = attributes . get ( OAuth20Constants . NONCE ) . get ( 0 ) . toString ( ) ; val builder = new URIBuilder ( redirectUri ) ; val stringBuilder = new Strin... |
public class ClassIndex { /** * Retrieves names of classes from given package .
* The package must be annotated with { @ link IndexSubclasses } for the classes inside
* to be indexed at compile - time by { @ link org . atteo . classindex . processor . ClassIndexProcessor } .
* @ param packageName name of the pack... | return getPackageClassesNames ( packageName , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; |
public class BinaryUtil { /** * Pretty print byte [ ] with Ascii char and subscript of the array
* @ param array */
public static void print ( byte [ ] array ) { } } | String [ ] name = new String [ ] { "+0" , "+1" , "+2" , "+3" , "+4" , "+5" , "+6" , "+7" , "+8" , "+9" , "+a" , "+b" , "+c" , "+d" , "+e" , "+f" } ; for ( int i = 0 ; i < 16 ; i ++ ) { System . out . print ( name [ i ] + " " ) ; } System . out . println ( ) ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( i != 0 ... |
public class GeneratePluginForServer { /** * Parse < user > : < password > @ < host > : < port >
* @ return
* @ throws IllegalArgumentException */
protected ParseLoginAddress parseServerAddressValue ( ) throws IllegalArgumentException { } } | ParseLoginAddress serverAddress = new ParseLoginAddress ( this . inputAddress , this . commandConsole ) ; // parse < user > : < password > @ < host > : < port >
serverAddress . parseLoginAddressValue ( "--server" ) ; return serverAddress ; |
public class HAProxyMessageDecoder { /** * Returns the index in the buffer of the end of line found .
* Returns - 1 if no end of line was found in the buffer . */
private static int findEndOfLine ( final ByteBuf buffer ) { } } | final int n = buffer . writerIndex ( ) ; for ( int i = buffer . readerIndex ( ) ; i < n ; i ++ ) { final byte b = buffer . getByte ( i ) ; if ( b == '\r' && i < n - 1 && buffer . getByte ( i + 1 ) == '\n' ) { return i ; // \ r \ n
} } return - 1 ; // Not found . |
public class Models { /** * Summarize fields which are specific to hex . drf . DRF . DRFModel . */
private static void summarizeDRFModel ( ModelSummary summary , hex . drf . DRF . DRFModel model ) { } } | // add generic fields such as column names
summarizeModelCommonFields ( summary , model ) ; summary . model_algorithm = "BigData RF" ; JsonObject all_params = ( model . get_params ( ) ) . toJSON ( ) ; summary . critical_parameters = whitelistJsonObject ( all_params , DRF_critical_params ) ; summary . secondary_paramete... |
public class QuickSelect { /** * The usual swap method .
* @ param data Array
* @ param a First index
* @ param b Second index */
private static final void swap ( double [ ] data , int a , int b ) { } } | double tmp = data [ a ] ; data [ a ] = data [ b ] ; data [ b ] = tmp ; |
public class DisasterRecoveryConfigurationsInner { /** * Fails over from the current primary server to this server .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of ... | beginFailoverWithServiceResponseAsync ( resourceGroupName , serverName , disasterRecoveryConfigurationName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class KeyedStream { /** * Windows this { @ code KeyedStream } into sliding time windows .
* < p > This is a shortcut for either { @ code . window ( SlidingEventTimeWindows . of ( size , slide ) ) } or
* { @ code . window ( SlidingProcessingTimeWindows . of ( size , slide ) ) } depending on the time
* chara... | if ( environment . getStreamTimeCharacteristic ( ) == TimeCharacteristic . ProcessingTime ) { return window ( SlidingProcessingTimeWindows . of ( size , slide ) ) ; } else { return window ( SlidingEventTimeWindows . of ( size , slide ) ) ; } |
public class ReloadableSparkeyReader { /** * Load a new log file into this reader .
* @ param logFile the log file to load .
* @ return A future that resolves to the sparkey reader once it has loaded the new log file . */
public CompletionStage < ReloadableSparkeyReader > load ( final File logFile ) { } } | checkArgument ( isValidLogFile ( logFile ) ) ; CompletableFuture < ReloadableSparkeyReader > result = new CompletableFuture < > ( ) ; this . executorService . submit ( ( ) -> { switchReader ( logFile ) ; result . complete ( this ) ; } ) ; return result ; |
public class AmazonRDSClient { /** * Creates a DBSnapshot . The source DBInstance must be in " available " state .
* @ param createDBSnapshotRequest
* @ return Result of the CreateDBSnapshot operation returned by the service .
* @ throws DBSnapshotAlreadyExistsException
* < i > DBSnapshotIdentifier < / i > is a... | request = beforeClientExecution ( request ) ; return executeCreateDBSnapshot ( request ) ; |
public class HttpServlets { /** * 获取日期参数 。
* @ param request
* 请求
* @ param name
* 参数名
* @ param format
* 日期格式
* @ return 参数内容 */
public static Calendar getCalendarParameter ( final HttpServletRequest request , final String name , final String format ) { } } | String value = request . getParameter ( name ) ; if ( StringUtils . isBlank ( value ) ) { return null ; } return DateFormatHelper . parse ( value , format ) ; |
public class H2HandlerImpl { /** * Determines if a given request is an http2 upgrade request */
@ Override public boolean isH2Request ( HttpInboundConnection hic , ServletRequest request ) throws ServletException { } } | // first check if H2 is enabled for this channel / port
if ( ! ( ( Http2InboundConnection ) hic ) . isHTTP2UpgradeRequest ( null , true ) ) { return false ; } Map < String , String > headers = new HashMap < String , String > ( ) ; HttpServletRequest hsrt = ( HttpServletRequest ) request ; Enumeration < String > headerN... |
public class SubscriptionFlexHandler { public Object initResult ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initResult" ) ; Set theResults = new HashSet ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initResult" ) ; return theResults ; |
public class MessagePacker { /** * Writes a byte array to the output .
* This method is used with { @ link # packRawStringHeader ( int ) } or { @ link # packBinaryHeader ( int ) } methods .
* Unlike { @ link # writePayload ( byte [ ] , int , int ) } method , this method does not make a defensive copy of the
* giv... | if ( buffer == null || buffer . size ( ) - position < len || len > bufferFlushThreshold ) { flush ( ) ; // call flush before add
// Directly add the payload without using the buffer
out . add ( src , off , len ) ; totalFlushBytes += len ; } else { buffer . putBytes ( position , src , off , len ) ; position += len ; } r... |
public class ListUtil { /** * List分页函数 */
public static < T > List < List < T > > partition ( List < T > list , int size ) { } } | return Lists . partition ( list , size ) ; |
public class Ldif { /** * Return the next record in the input stream . */
public DirRecord nextRecord ( ) throws NamingException { } } | if ( inp == null ) { if ( in == null ) { throw new NamingException ( "No ldif input stream" ) ; } inp = new LdifRecord . Input ( ) ; inp . init ( new InputStreamReader ( in ) ) ; } else if ( inp . eof ) { return null ; } LdifRecord ldr = new LdifRecord ( ) ; if ( ! ldr . read ( inp ) ) { return null ; } return ldr ; |
public class PaymentIntent { /** * Capture the funds of an existing uncaptured PaymentIntent when its status is < code >
* requires _ capture < / code > .
* < p > Uncaptured PaymentIntents will be canceled exactly seven days after they are created .
* < p > Read the < a
* href = " / docs / payments / payment - ... | return capture ( ( Map < String , Object > ) null , ( RequestOptions ) null ) ; |
public class MultiHashTable { /** * version : key is used */
@ Nonnull public < B > HashTable < K , B > toHashTable ( @ Nonnull F2 < K , ImmutableList < V > , B > conversion ) { } } | return this . data . foldLeft ( ( acc , p ) -> acc . put ( p . left , conversion . apply ( p . left , p . right ) ) , HashTable . empty ( this . data . hasher ) ) ; |
public class SquareRegularClustersIntoGrids { /** * There are only two edges on target . Pick the edge which does not go to the provided child */
static SquareNode pickNot ( SquareNode target , SquareNode child ) { } } | for ( int i = 0 ; i < 4 ; i ++ ) { SquareEdge e = target . edges [ i ] ; if ( e == null ) continue ; SquareNode c = e . destination ( target ) ; if ( c != child ) return c ; } throw new RuntimeException ( "There was no odd one out some how" ) ; |
public class RestApiClient { /** * Delete roster entry .
* @ param username
* the username
* @ param jid
* the jid
* @ return the response */
public Response deleteRosterEntry ( String username , String jid ) { } } | return restClient . delete ( "users/" + username + "/roster/" + jid , new HashMap < String , String > ( ) ) ; |
public class UIMetricUtils { /** * get MetricSnapshot formatted value string */
public static String getMetricValue ( MetricSnapshot snapshot ) { } } | if ( snapshot == null ) return null ; MetricType type = MetricType . parse ( snapshot . get_metricType ( ) ) ; switch ( type ) { case COUNTER : return format ( snapshot . get_longValue ( ) ) ; case GAUGE : return format ( snapshot . get_doubleValue ( ) ) ; case METER : return format ( snapshot . get_m1 ( ) ) ; case HIS... |
public class JobCredentialsInner { /** * Gets a jobs credential .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .
* @ param jobAgentName The name of t... | return getWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName , credentialName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SeaGlassInternalFrameTitlePane { /** * Uninstall the defaults . */
public void uninstallDefaults ( ) { } } | SeaGlassContext context = getContext ( this , ENABLED ) ; style . uninstallDefaults ( context ) ; context . dispose ( ) ; style = null ; JInternalFrame . JDesktopIcon di = frame . getDesktopIcon ( ) ; if ( di != null && di . getComponentPopupMenu ( ) == systemPopupMenu ) { // Release link to systemMenu from the JIntern... |
public class SQLiteUpdateTaskHelper { /** * Execute SQL .
* @ param database
* the database
* @ param fileInputStream
* the file input stream */
public static void executeSQL ( final SQLiteDatabase database , InputStream fileInputStream ) { } } | List < String > commands = readSQLFromFile ( fileInputStream ) ; executeSQL ( database , commands ) ; |
public class Base64 { /** * base64解码
* @ param base64 被解码的base64字符串
* @ param out 写出到的流
* @ param isCloseOut 是否关闭输出流
* @ since 4.0.9 */
public static void decodeToStream ( String base64 , OutputStream out , boolean isCloseOut ) { } } | IoUtil . write ( out , isCloseOut , Base64Decoder . decode ( base64 ) ) ; |
public class ContainerOverrides { /** * The command to send to the container that overrides the default command from the Docker image or the job
* definition .
* @ param command
* The command to send to the container that overrides the default command from the Docker image or the job
* definition . */
public vo... | if ( command == null ) { this . command = null ; return ; } this . command = new java . util . ArrayList < String > ( command ) ; |
public class ConnectionImpl { /** * This method accepts the same arguments as the Core SPI equivalent
* and returns the same class objects . The difference is that this
* method will only work against MQLink destinations . If a non - mqlink
* destination is supplied an SIDestinationWrongTypeException is thrown . ... | if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIConnection . tc , "createMQLinkConsumerSession" , new Object [ ] { mqLinkUuidStr , criteria , unrecoverableReliability } ) ; MQLinkHandler mqLinkHandler = null ; boolean forwardScanning = false ; // See... |
public class SoftInputLayout { /** * 修改第一次打开表情之前 , 键盘没有弹出之前的BUG . */
private void fixContentLayoutHeight ( final int oldH , final int newH ) { } } | postDelayed ( new Runnable ( ) { @ Override public void run ( ) { LayoutParams params = ( LayoutParams ) mContentLayout . getLayoutParams ( ) ; params . height = newH ; params . weight = 0 ; requestLayout ( ) ; unlockContentLayoutHeight ( ) ; } } , 100 ) ; |
public class LegacyBehavior { /** * Remove all entries for legacy non - scopes given that the assigned scope execution is also responsible for another scope */
public static void removeLegacyNonScopesFromMapping ( Map < ScopeImpl , PvmExecutionImpl > mapping ) { } } | Map < PvmExecutionImpl , List < ScopeImpl > > scopesForExecutions = new HashMap < PvmExecutionImpl , List < ScopeImpl > > ( ) ; for ( Map . Entry < ScopeImpl , PvmExecutionImpl > mappingEntry : mapping . entrySet ( ) ) { List < ScopeImpl > scopesForExecution = scopesForExecutions . get ( mappingEntry . getValue ( ) ) ;... |
public class MiscUtils { /** * Get the " android : versionCode " value from the Manifest file .
* @ param context The current Context or Activity that this method is called from
* @ return the application version code , or - 999 if versionName cannot be found for the given context . */
public static int getVersionC... | int versionCode ; try { versionCode = context . getPackageManager ( ) . getPackageInfo ( context . getPackageName ( ) , 0 ) . versionCode ; } catch ( NameNotFoundException e ) { versionCode = - 999 ; } return versionCode ; |
public class TemplCommandOut { /** * Invoke the command execution method given at object creation time .
* This method is automtically called by the TANGO core classes when the
* associated command is requested by a client . It invokes the user supplied
* command execution method and packs the returned data into ... | // Execute the command associated method
Any returned_data = null ; try { // Execute the method
java . lang . Object [ ] meth_param = new java . lang . Object [ 0 ] ; java . lang . Object obj = exe_method . invoke ( dev , meth_param ) ; // Insert data into the any according to command parameter type
switch ( out_type )... |
public class GPXPoint { /** * Set the position dilution of precision of a point .
* @ param contentBuffer Contains the information to put in the table */
public final void setPdop ( StringBuilder contentBuffer ) { } } | ptValues [ GpxMetadata . PTPDOP ] = Double . parseDouble ( contentBuffer . toString ( ) ) ; |
public class FirstFitDecreasingPacking { /** * Sort the components in decreasing order based on their RAM requirements
* @ return The sorted list of components and their RAM requirements */
private List < ResourceRequirement > getSortedInstances ( Set < String > componentNames ) { } } | List < ResourceRequirement > resourceRequirements = new ArrayList < > ( ) ; for ( String componentName : componentNames ) { Resource requiredResource = this . componentResourceMap . getOrDefault ( componentName , defaultInstanceResources ) ; resourceRequirements . add ( new ResourceRequirement ( componentName , require... |
public class Link { /** * Create a ' curies ' link ( compact URI ) with name and a URI template for the link - relation type .
* Curies may be used for brevity for custom link - relation type URIs . Curiess are established within a HAL document
* via a set of Link Objects with the relation type " curies " on the ro... | if ( ! relTemplate . contains ( "{rel}" ) ) { throw new IllegalArgumentException ( "Not a CURI template. Template is required to contain a {rel} placeholder" ) ; } return new Link ( "curies" , relTemplate , null , null , null , name , null , null ) ; |
public class IO { /** * Load properties from a URL
* @ param url the URL of the properties file
* @ return
* the properties contains the content of the URL or an empty properties
* if the URL is invalid or null */
public static Properties loadProperties ( URL url ) { } } | if ( null == url ) { return new Properties ( ) ; } return loadProperties ( inputStream ( url ) ) ; |
public class Maps { /** * Check if the specified < code > Map < / code > contains the specified < code > Entry < / code >
* @ param map
* @ param entry
* @ return */
public static boolean contains ( final Map < ? , ? > map , final Map . Entry < ? , ? > entry ) { } } | return contains ( map , entry . getKey ( ) , entry . getValue ( ) ) ; |
public class JmxSecurity { /** * Example return encrypted ( . . . . . )
* @ param password String to be encrypted
* @ return String encrypted String */
public static char [ ] encrypt ( char [ ] password ) { } } | if ( password == null || password . length == 0 ) { return null ; } try { String encryptedString = null ; SecretKeySpec key = new SecretKeySpec ( init , "Blowfish" ) ; Cipher cipher = Cipher . getInstance ( CIPHER_INSTANCE ) ; cipher . init ( Cipher . ENCRYPT_MODE , key ) ; byte [ ] encrypted = cipher . doFinal ( Strin... |
public class RouteNotFound { /** * Service a request .
* @ param request the http request facade
* @ param response the http response facade */
@ Override public boolean service ( RequestBaratine request ) { } } | request . status ( HttpStatus . NOT_FOUND ) ; request . write ( "Not found: " + request . uri ( ) + "\n" ) ; request . ok ( ) ; return true ; |
public class ArrayDeque { /** * Returns { @ code true } if this deque contains the specified element .
* More formally , returns { @ code true } if and only if this deque contains
* at least one element { @ code e } such that { @ code o . equals ( e ) } .
* @ param o object to be checked for containment in this d... | if ( o != null ) { int mask = elements . length - 1 ; int i = head ; for ( Object x ; ( x = elements [ i ] ) != null ; i = ( i + 1 ) & mask ) { if ( o . equals ( x ) ) return true ; } } return false ; |
public class RandomVariableLowMemory { /** * / * ( non - Javadoc )
* @ see net . finmath . stochastic . RandomVariableInterface # expand ( ) */
public RandomVariableInterface expand ( int numberOfPaths ) { } } | if ( isDeterministic ( ) ) { // Expand random variable to a vector of path values
double [ ] clone = new double [ numberOfPaths ] ; java . util . Arrays . fill ( clone , valueIfNonStochastic ) ; return new RandomVariableLowMemory ( time , clone ) ; } return new RandomVariableLowMemory ( time , realizations . clone ( ) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.