signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CommonMBeanConnection { /** * Get the MBeanServerConnection for the target controller host and port .
* @ param controllerHost
* @ param controllerPort
* @ param environment
* @ return
* @ throws MalformedURLException
* @ throws IOException */
private JMXConnector getMBeanServerConnection ( Str... | JMXServiceURL serviceURL = new JMXServiceURL ( "REST" , controllerHost , controllerPort , "/IBMJMXConnectorREST" ) ; return new ClientProvider ( ) . newJMXConnector ( serviceURL , environment ) ; |
public class Request { /** * Hostname getter , if user has defined a specific hostname through
* java system properties then it will be used . Otherwise the default
* hostname ( https : / / code . google . com ) will be returned .
* @ return Hostname to use for performing request . */
public static String getHost... | final String hostname = System . getProperty ( HOSTNAME_PROPERTY ) ; // TODO : Ensure hostname format is valid .
return ( hostname == null ? DEFAULT_HOSTNAME : hostname ) ; |
public class Verjson { /** * Serializes the given object to a String */
public String write ( T obj ) throws JsonProcessingException { } } | Date ts = includeTimestamp ? Date . from ( now ( ) ) : null ; MetaWrapper wrapper = new MetaWrapper ( getHighestSourceVersion ( ) , getNamespace ( ) , obj , ts ) ; return mapper . writeValueAsString ( wrapper ) ; |
public class PGStream { /** * Copy data from an input stream to the connection .
* @ param inStream the stream to read data from
* @ param remaining the number of bytes to copy
* @ throws IOException if a data I / O error occurs */
public void sendStream ( InputStream inStream , int remaining ) throws IOException... | int expectedLength = remaining ; if ( streamBuffer == null ) { streamBuffer = new byte [ 8192 ] ; } while ( remaining > 0 ) { int count = ( remaining > streamBuffer . length ? streamBuffer . length : remaining ) ; int readCount ; try { readCount = inStream . read ( streamBuffer , 0 , count ) ; if ( readCount < 0 ) { th... |
public class Transporter { /** * - - - IS NODE ONLINE ? - - - */
public boolean isOnline ( String nodeID ) { } } | if ( this . nodeID . equals ( nodeID ) ) { return true ; } NodeDescriptor node = nodes . get ( nodeID ) ; if ( node == null ) { return false ; } node . readLock . lock ( ) ; try { return node . offlineSince == 0 && node . seq > 0 ; } finally { node . readLock . unlock ( ) ; } |
public class ClasspathElementDir { /** * Recursively scan a directory for file path patterns matching the scan spec .
* @ param dir
* the directory
* @ param log
* the log */
private void scanDirRecursively ( final File dir , final LogNode log ) { } } | if ( skipClasspathElement ) { return ; } // See if this canonical path has been scanned before , so that recursive scanning doesn ' t get stuck in an
// infinite loop due to symlinks
String canonicalPath ; try { canonicalPath = dir . getCanonicalPath ( ) ; if ( ! scannedCanonicalPaths . add ( canonicalPath ) ) { if ( l... |
public class Job { /** * Set the { @ link OutputFormat } for the job .
* @ param cls the < code > OutputFormat < / code > to use
* @ throws IllegalStateException if the job is submitted */
public void setOutputFormatClass ( Class < ? extends OutputFormat > cls ) throws IllegalStateException { } } | ensureState ( JobState . DEFINE ) ; conf . setClass ( OUTPUT_FORMAT_CLASS_ATTR , cls , OutputFormat . class ) ; |
public class CSRFServiceImpl { /** * Compares to token .
* @ param a the first token
* @ param b the second token
* @ return { @ code true } if the token are equal , { @ code false } otherwise */
@ Override public boolean compareTokens ( String a , String b ) { } } | if ( isSignedToken ( ) ) { return crypto . compareSignedTokens ( a , b ) ; } else { return crypto . constantTimeEquals ( a , b ) ; } |
public class JSONObject { /** * Get the value object associated with a key .
* @ param key
* A key string .
* @ return The object associated with the key .
* @ throws JSONException
* if the key is not found . */
public Object get ( String key ) throws JSONException { } } | Object o = opt ( key ) ; if ( o == null ) { throw new JSONException ( "JSONObject[" + quote ( key ) + "] not found." ) ; } return o ; |
public class X509CRLEntryImpl { /** * Utility method to convert an arbitrary instance of X509CRLEntry
* to a X509CRLEntryImpl . Does a cast if possible , otherwise reparses
* the encoding . */
public static X509CRLEntryImpl toImpl ( X509CRLEntry entry ) throws CRLException { } } | if ( entry instanceof X509CRLEntryImpl ) { return ( X509CRLEntryImpl ) entry ; } else { return new X509CRLEntryImpl ( entry . getEncoded ( ) ) ; } |
public class Camera { /** * Check horizontal limit on move .
* @ param extrp The extrapolation value .
* @ param vx The horizontal movement . */
private void checkHorizontalLimit ( double extrp , double vx ) { } } | // Inside interval
if ( mover . getX ( ) >= limitLeft && mover . getX ( ) <= limitRight && limitLeft != Integer . MIN_VALUE && limitRight != Integer . MAX_VALUE ) { offset . moveLocation ( extrp , vx , 0 ) ; // Block offset on its limits
if ( offset . getX ( ) < - intervalHorizontal ) { offset . teleportX ( - intervalH... |
public class JsScopeUiDatePickerOnChangeEvent { /** * Creates a default { @ link JsScopeUiDatePickerOnChangeEvent } to execute the given
* statement .
* @ param javascriptCode
* the JavaScript statement to execute with the scope .
* @ return the created { @ link JsScopeUiDatePickerDateTextEvent } . */
public st... | return new JsScopeUiDatePickerOnChangeEvent ( ) { private static final long serialVersionUID = 1L ; @ Override protected void execute ( JsScopeContext scopeContext ) { scopeContext . append ( javascriptCode ) ; } } ; |
public class CollectionPrefetcher { /** * Build the multiple queries for one relationship because of limitation of IN ( . . . )
* @ param owners Collection containing all objects of the ONE side */
protected Query [ ] buildPrefetchQueries ( Collection owners , Collection children ) { } } | ClassDescriptor cld = getOwnerClassDescriptor ( ) ; Class topLevelClass = getBroker ( ) . getTopLevelClass ( cld . getClassOfObject ( ) ) ; BrokerHelper helper = getBroker ( ) . serviceBrokerHelper ( ) ; Collection queries = new ArrayList ( owners . size ( ) ) ; Collection idsSubset = new HashSet ( owners . size ( ) ) ... |
public class SharedSymbolTable { /** * Collects the necessary symbols from { @ code priorSymtab } and
* { @ code symbols } , and load them into the passed - in { @ code symbolsList } and
* { @ code symbolsMap } . */
private static void prepSymbolsListAndMap ( SymbolTable priorSymtab , Iterator < String > symbols , ... | int sid = 1 ; // Collect from passed - in priorSymtab
if ( priorSymtab != null ) { Iterator < String > priorSymbols = priorSymtab . iterateDeclaredSymbolNames ( ) ; while ( priorSymbols . hasNext ( ) ) { String text = priorSymbols . next ( ) ; if ( text != null ) { assert text . length ( ) > 0 ; putToMapIfNotThere ( sy... |
public class I18nChooseableSpecifics { /** * < p > Setter for lang . < / p >
* @ param pLang reference */
@ Override public final void setLang ( final Languages pLang ) { } } | this . lang = pLang ; if ( this . itsId == null ) { this . itsId = new IdI18nChooseableSpecifics ( ) ; } this . itsId . setLang ( this . lang ) ; |
public class ContentSpecBuilder { /** * Builds a book into a zip file for the passed Content Specification .
* @ param contentSpec The content specification that is to be built . It should have already been validated , if not errors may occur .
* @ param requester The user who requested the book to be built .
* @... | return buildTranslatedBook ( contentSpec , requester , builderOptions , new HashMap < String , byte [ ] > ( ) , zanataDetails , buildType ) ; |
public class ChildrenOrderAnalyzer { /** * Check the order of one child against the previous dated child .
* @ param child the child
* @ param prevChild the previous child
* @ return the current child if dated */
private Person analyzeChild ( final Person child , final Person prevChild ) { } } | Person retChild = prevChild ; if ( retChild == null ) { return child ; } final LocalDate birthDate = getNearBirthEventDate ( child ) ; if ( birthDate == null ) { return retChild ; } final LocalDate prevDate = getNearBirthEventDate ( prevChild ) ; if ( prevDate == null ) { return child ; } if ( birthDate . isBefore ( pr... |
public class ColumnPrefixDistributedRowLock { /** * Release the lock by releasing this and any other stale lock columns */
@ Override public void release ( ) throws Exception { } } | if ( ! locksToDelete . isEmpty ( ) || lockColumn != null ) { MutationBatch m = keyspace . prepareMutationBatch ( ) . setConsistencyLevel ( consistencyLevel ) ; fillReleaseMutation ( m , false ) ; m . execute ( ) ; } |
public class Emoji { /** * Method to replace String . join , since it was only introduced in java8
* @ param array the array to be concatenated
* @ return concatenated String */
private String stringJoin ( String [ ] array , int count ) { } } | String joined = "" ; for ( int i = 0 ; i < count ; i ++ ) joined += array [ i ] ; return joined ; |
public class Variable { /** * Get a hedged member .
* @ param hedgeName is the hedge name
* @ param memberName is the member name
* @ return the member */
public Member getMember ( String hedgeName , String memberName ) { } } | String fullName = hedgeName + "$" + memberName ; return getMember ( fullName ) ; |
public class MapBuilder { /** * Puts the given { @ link KEY key } and { @ link VALUE value } into the { @ link Map } being built
* by this { @ link MapBuilder builder } .
* @ param key { @ link KEY key } to put .
* @ param value { @ link VALUE value } to put mapped to the given { @ link KEY key } .
* @ return t... | getMap ( ) . put ( key , value ) ; return this ; |
public class OpentracingService { /** * Check the configuration for filters of a particular type .
* @ param filters The resulting list of filters .
* @ param map Configuration properties .
* @ param configAdmin Service to get child configurations .
* @ param childNames The name of the configuration element to ... | final String methodName = "processFilters" ; try { SpanFilterType type = SpanFilterType . INCOMING ; boolean ignoreCase = false ; boolean regex = true ; SpanFilter filter = ( SpanFilter ) Class . forName ( impl . getName ( ) ) . getConstructor ( String . class , SpanFilterType . class , boolean . class , boolean . clas... |
public class JpaStylesheetUserPreferencesDao { /** * Add the needed fetches to a critera query */
protected void addFetches ( final Root < StylesheetUserPreferencesImpl > descriptorRoot ) { } } | descriptorRoot . fetch ( StylesheetUserPreferencesImpl_ . layoutAttributes , JoinType . LEFT ) ; descriptorRoot . fetch ( StylesheetUserPreferencesImpl_ . outputProperties , JoinType . LEFT ) ; descriptorRoot . fetch ( StylesheetUserPreferencesImpl_ . parameters , JoinType . LEFT ) ; |
public class RowAction { /** * Rollback actions for a session including and after the given timestamp */
synchronized void rollback ( Session session , long timestamp ) { } } | RowActionBase action = this ; do { if ( action . session == session && action . commitTimestamp == 0 ) { if ( action . actionTimestamp >= timestamp || action . actionTimestamp == 0 ) { action . commitTimestamp = session . actionTimestamp ; action . rolledback = true ; action . prepared = false ; } } action = action . n... |
public class MathActivityMarshaller { /** * Marshall the given parameter object . */
public void marshall ( MathActivity mathActivity , ProtocolMarshaller protocolMarshaller ) { } } | if ( mathActivity == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( mathActivity . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( mathActivity . getAttribute ( ) , ATTRIBUTE_BINDING ) ; protocolMarshaller . marshall ( mathAc... |
public class SVGMorph { /** * Update the morph time index by the amount specified
* @ param delta The amount to update the morph by */
public void updateMorphTime ( float delta ) { } } | for ( int i = 0 ; i < figures . size ( ) ; i ++ ) { Figure figure = ( Figure ) figures . get ( i ) ; MorphShape shape = ( MorphShape ) figure . getShape ( ) ; shape . updateMorphTime ( delta ) ; } |
public class XML { /** * See ECMA 357 , 11_2_2_1 , Semantics , 3 _ f . */
@ Override public Scriptable getExtraMethodSource ( Context cx ) { } } | if ( hasSimpleContent ( ) ) { String src = toString ( ) ; return ScriptRuntime . toObjectOrNull ( cx , src ) ; } return null ; |
public class MiriamLink { /** * Retrieves the resource by id ( for example : " MIR : 00100008 " ( bind ) ) .
* @ param resourceId - resource identifier ( similar to , but not a data type identifier ! )
* @ return MIRIAM Resource bean */
public static Resource getResource ( String resourceId ) { } } | for ( Datatype datatype : miriam . getDatatype ( ) ) { for ( Resource resource : getResources ( datatype ) ) { if ( resource . getId ( ) . equalsIgnoreCase ( resourceId ) ) return resource ; } } throw new IllegalArgumentException ( "Resource not found : " + resourceId ) ; |
public class MimeUtil { /** * Parse the magic . mime file */
private static void parse ( final Reader r ) throws IOException { } } | final BufferedReader br = new BufferedReader ( r ) ; String line ; final ArrayList < String > sequence = new ArrayList < String > ( ) ; line = br . readLine ( ) ; while ( true ) { if ( line == null ) { break ; } line = line . trim ( ) ; if ( line . length ( ) == 0 || line . charAt ( 0 ) == '#' ) { line = br . readLine ... |
public class AbstractCommonService { /** * 添加一条空记录
* @ return */
@ Override public String save ( Object pData ) { } } | String id = GUID . newGUID ( ) ; if ( pData instanceof TemplateModel ) { TemplateModel entity = ( TemplateModel ) pData ; entity . setId ( id ) ; entity . setRev ( System . currentTimeMillis ( ) ) ; } else if ( pData instanceof CommonModel ) { CommonModel entity = ( CommonModel ) pData ; entity . setId ( id ) ; } mDao ... |
public class CircuitBreakerStatus { /** * Copy the current immutable object by setting a value for the { @ link AbstractCircuitBreakerStatus # getFailedThroughputOneMinute ( ) failedThroughputOneMinute } attribute .
* @ param value A new value for failedThroughputOneMinute
* @ return A modified copy of the { @ code... | double newValue = value ; return new CircuitBreakerStatus ( this . id , this . timestamp , this . state , this . totalSuccessCount , this . totalFailureCount , this . latencyMicros , this . throughputOneMinute , newValue ) ; |
public class BaseStreamWriter { /** * StAX2 , other accessors , mutators */
@ Override public XMLStreamLocation2 getLocation ( ) { } } | return new WstxInputLocation ( null , // no parent
null , ( String ) null , // pub / sys ids not yet known
mWriter . getAbsOffset ( ) , mWriter . getRow ( ) , mWriter . getColumn ( ) ) ; |
public class A_CmsTreeTabDataPreloader { /** * Creates the beans for the loaded resources , and returns the root bean . < p >
* @ return the root bean
* @ throws CmsException if something goes wrong */
private T createBeans ( ) throws CmsException { } } | // create the beans for the resources
Map < CmsResource , T > beans = new HashMap < CmsResource , T > ( ) ; for ( CmsResource resource : m_knownResources ) { T bean = createEntry ( m_cms , resource ) ; if ( bean != null ) { beans . put ( resource , bean ) ; } } // attach beans for child resources to the beans for their... |
public class AbstractApplication { /** * Initialize the properties of the scene .
* 800x600 with transparent background and a Region as Parent Node
* @ return the scene built
* @ throws CoreException if build fails */
protected final Scene buildScene ( ) throws CoreException { } } | final Scene scene = new Scene ( buildRootPane ( ) , StageParameters . APPLICATION_SCENE_WIDTH . get ( ) , StageParameters . APPLICATION_SCENE_HEIGHT . get ( ) , JRebirthColors . SCENE_BG_COLOR . get ( ) ) ; return scene ; |
public class HashUtil { /** * A function that calculates the index ( e . g . to be used in an array / list ) for a given hash . The returned value will always
* be equal or larger than 0 and will always be smaller than ' length ' .
* The reason this function exists is to deal correctly with negative and especially ... | checkPositive ( length , "length must be larger than 0" ) ; if ( hash == Integer . MIN_VALUE ) { return 0 ; } return abs ( hash ) % length ; |
public class XPathEvaluator { /** * { @ inheritDoc } */
@ Override public XPathSelector call ( ) throws Exception { } } | final Processor proc = new Processor ( false ) ; final Configuration config = proc . getUnderlyingConfiguration ( ) ; final NodeInfo doc = new DocumentWrapper ( mSession , config ) ; final XPathCompiler xpath = proc . newXPathCompiler ( ) ; final DocumentBuilder builder = proc . newDocumentBuilder ( ) ; XPathSelector s... |
public class JumboCyclicVertexSearch { /** * { @ inheritDoc } */
@ Override public int [ ] [ ] fused ( ) { } } | List < int [ ] > fused = new ArrayList < int [ ] > ( cycles . size ( ) ) ; for ( int i = 0 ; i < cycles . size ( ) ; i ++ ) { if ( this . fused . get ( i ) ) fused . add ( toArray ( cycles . get ( i ) ) ) ; } return fused . toArray ( new int [ fused . size ( ) ] [ ] ) ; |
public class AddOn { /** * Tells whether or not the given file name matches the name of a ZAP add - on .
* The file name must have the format " { @ code < id > - < status > - < version > . zap } " . The { @ code id } is a string , the { @ code status }
* must be a value from { @ link Status } and the { @ code versi... | if ( ! isAddOnFileName ( fileName ) ) { return false ; } if ( fileName . substring ( 0 , fileName . indexOf ( "." ) ) . split ( "-" ) . length < 3 ) { return false ; } String [ ] strArray = fileName . substring ( 0 , fileName . indexOf ( "." ) ) . split ( "-" ) ; try { Status . valueOf ( strArray [ 1 ] ) ; Integer . pa... |
public class CommercePriceEntryPersistenceImpl { /** * Returns the commerce price entries before and after the current commerce price entry in the ordered set where uuid = & # 63 ; .
* @ param commercePriceEntryId the primary key of the current commerce price entry
* @ param uuid the uuid
* @ param orderByCompara... | CommercePriceEntry commercePriceEntry = findByPrimaryKey ( commercePriceEntryId ) ; Session session = null ; try { session = openSession ( ) ; CommercePriceEntry [ ] array = new CommercePriceEntryImpl [ 3 ] ; array [ 0 ] = getByUuid_PrevAndNext ( session , commercePriceEntry , uuid , orderByComparator , true ) ; array ... |
public class ConnectionImpl { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . MPCoreConnection # setWaitTimeInMessage ( boolean ) */
@ Override public void setSetWaitTimeInMessage ( boolean setWaitTime ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setSetWaitTimeInMessage" , Boolean . valueOf ( setWaitTime ) ) ; _setWaitTimeInMessage = setWaitTime ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setSetWaitTimeInMessage"... |
public class PropertiesUtils { /** * Set pipe device properties in db
* @ param deviceName
* @ param pipeName
* @ param properties
* @ throws DevFailed */
public static void setDevicePipePropertiesInDB ( final String deviceName , final String pipeName , final Map < String , String [ ] > properties ) throws DevF... | LOGGER . debug ( "update pipe {} device properties {} in DB " , pipeName , properties . keySet ( ) ) ; DatabaseFactory . getDatabase ( ) . setDevicePipeProperties ( deviceName , pipeName , properties ) ; |
public class SimulatorProtocolImpl { /** * sends the message to the AUT . */
protected void sendMessage ( String xml ) { } } | byte [ ] bytes = null ; try { bytes = xml . getBytes ( "UTF-8" ) ; writeBytes ( bytes ) ; } catch ( SocketException se ) { // when we get a socket exception , let ' s try to re - establish
stop ( ) ; start ( ) ; try { writeBytes ( bytes ) ; } catch ( IOException e ) { throw new WebDriverException ( e ) ; } } catch ( IO... |
public class MatcherApplicationStrategy { /** * Applies the given { @ link ArgumentMatcherAction } to all arguments and
* corresponding matchers
* @ param action
* must not be < code > null < / code >
* @ return
* < ul >
* < li > < code > true < / code > if the given < b > action < / b > returned
* < code... | if ( matchingType == ERROR_UNSUPPORTED_NUMBER_OF_MATCHERS ) return false ; Object [ ] arguments = invocation . getArguments ( ) ; for ( int i = 0 ; i < arguments . length ; i ++ ) { ArgumentMatcher < ? > matcher = matchers . get ( i ) ; Object argument = arguments [ i ] ; if ( ! action . apply ( matcher , argument ) ) ... |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getFontDescriptorSpecification ( ) { } } | if ( fontDescriptorSpecificationEClass == null ) { fontDescriptorSpecificationEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 378 ) ; } return fontDescriptorSpecificationEClass ; |
public class TaskEntity { /** * Tracks a property change . Therefore the original and new value are stored in a map .
* It tracks multiple changes and if a property finally is changed back to the original
* value , then the change is removed .
* @ param propertyName
* @ param orgValue
* @ param newValue */
pr... | if ( propertyChanges . containsKey ( propertyName ) ) { // update an existing change to save the original value
Object oldOrgValue = propertyChanges . get ( propertyName ) . getOrgValue ( ) ; if ( ( oldOrgValue == null && newValue == null ) // change back to null
|| ( oldOrgValue != null && oldOrgValue . equals ( newVa... |
public class JMMap { /** * New changed key map map .
* @ param < K > the type parameter
* @ param < V > the type parameter
* @ param < NK > the type parameter
* @ param map the map
* @ param changingKeyFunction the changing key function
* @ return the map */
public static < K , V , NK > Map < NK , V > newCh... | return buildEntryStream ( map ) . collect ( toMap ( entry -> changingKeyFunction . apply ( entry . getKey ( ) ) , Entry :: getValue ) ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Boolean } { @ code > } */
@ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "includeAllowableActions" , scope = GetAllVersions . class ) public JAXBElement < Boolean > creat... | return new JAXBElement < Boolean > ( _GetObjectOfLatestVersionIncludeAllowableActions_QNAME , Boolean . class , GetAllVersions . class , value ) ; |
public class Moneys { /** * Determine if an instance of { @ code Money } is valid .
* @ param value an instance of { @ code Money }
* @ throws java . lang . IllegalArgumentException if money is invalid */
public static void checkValid ( Money value ) { } } | String currencyCode = value . getCurrencyCode ( ) ; if ( currencyCode == null || currencyCode . length ( ) != 3 ) { throw new IllegalArgumentException ( MSG_3_LETTERS_LONG ) ; } long units = value . getUnits ( ) ; int nanos = value . getNanos ( ) ; if ( ( units > 0 && nanos < 0 ) || ( units < 0 && nanos > 0 ) ) { throw... |
public class TransformerRegistry { /** * Get the sub registry for the servers .
* @ param range the version range
* @ return the sub registry */
public TransformersSubRegistration getServerRegistration ( final ModelVersionRange range ) { } } | final PathAddress address = PathAddress . EMPTY_ADDRESS . append ( HOST , SERVER ) ; return new TransformersSubRegistrationImpl ( range , domain , address ) ; |
public class Swagger2MarkupConfigBuilder { /** * Set the page break locations
* @ param locations List of locations to create new pages
* @ return this builder */
public Swagger2MarkupConfigBuilder withPageBreaks ( List < PageBreakLocations > locations ) { } } | Validate . notNull ( locations , "%s must not be null" , "locations" ) ; config . pageBreakLocations = locations ; return this ; |
public class BeanRepository { /** * Returns a new created Object with the given { @ code creator } . This equates to a { @ code prototype } Bean . It is
* not required to configure a { @ code prototype } Bean in the BeanRepository before . This Method can be used
* to pass Parameters to the Constructor of an Object... | final PrototypeProvider provider = new PrototypeProvider ( name , repository -> creator . get ( ) ) ; return provider . getBean ( this , dryRun ) ; |
public class GSPCOLImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GSPCOL__RES1 : setRES1 ( RES1_EDEFAULT ) ; return ; case AfplibPackage . GSPCOL__COLSPCE : setCOLSPCE ( COLSPCE_EDEFAULT ) ; return ; case AfplibPackage . GSPCOL__RES2 : setRES2 ( RES2_EDEFAULT ) ; return ; case AfplibPackage . GSPCOL__COLSIZE1 : setCOLSIZE1 ( COLSIZE1_EDEFAU... |
public class VectorVectorMult_DDRM { /** * Adds to A & isin ; & real ; < sup > m & times ; n < / sup > the results of an outer product multiplication
* of the two vectors . This is also known as a rank 1 update . < br >
* < br >
* A = A + & gamma ; x * y < sup > T < / sup >
* where x & isin ; & real ; < sup > m... | int m = A . numRows ; int n = A . numCols ; int index = 0 ; if ( gamma == 1.0 ) { for ( int i = 0 ; i < m ; i ++ ) { double xdat = x . get ( i ) ; for ( int j = 0 ; j < n ; j ++ ) { A . plus ( index ++ , xdat * y . get ( j ) ) ; } } } else { for ( int i = 0 ; i < m ; i ++ ) { double xdat = x . get ( i ) ; for ( int j =... |
public class XMonitoredInputStream { /** * / * ( non - Javadoc )
* @ see java . io . InputStream # read ( byte [ ] ) */
@ Override public int read ( byte [ ] b ) throws IOException { } } | int result = stream . read ( b ) ; update ( result ) ; return result ; |
public class WrapperManager { /** * F86406 */
public void introspect ( IntrospectionWriter writer ) { } } | writer . begin ( "WrapperManager" ) ; beanIdCache . introspect ( writer ) ; ( ( Cache ) wrapperCache ) . introspect ( writer ) ; writer . end ( ) ; |
public class CacheListUtil { /** * 指定获取范围 ( 返回的类型是raw string , 所以不推荐使用 ) */
@ SuppressWarnings ( "all" ) public static Single < List < String > > getRange ( CacheConfigBean cacheConfigBean , String cacheKey , int startIndex , int endIndex ) { } } | return SingleRxXian . call ( CacheService . CACHE_SERVICE , "cacheListRange" , new JSONObject ( ) { { put ( "cacheConfig" , cacheConfigBean ) ; put ( "key" , cacheKey ) ; put ( "startIndex" , startIndex ) ; put ( "endIndex" , endIndex ) ; } } ) . map ( unitResponse -> { if ( unitResponse . getData ( ) != null ) return ... |
public class PolicyIndexInvocationHandler { /** * { @ inheritDoc } */
@ Override public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { } } | // get the method parameters and " type "
ManagementMethodInvocation managementMethod = new ManagementMethodInvocation ( method , args ) ; // if it ' s not a method that requires policy cache modifications , quit
if ( managementMethod . action . equals ( ManagementMethodInvocation . Action . NA ) ) return invokeTarget ... |
public class SimpleDateFormat { /** * Private method lazily instantiate the TimeZoneFormat field
* @ param bForceUpdate when true , check if tzFormat is synchronized with
* the current numberFormat and update its digits if necessary . When false ,
* this check is skipped . */
private synchronized void initializeT... | if ( bForceUpdate || tzFormat == null ) { tzFormat = TimeZoneFormat . getInstance ( locale ) ; String digits = null ; if ( numberFormat instanceof DecimalFormat ) { DecimalFormatSymbols decsym = ( ( DecimalFormat ) numberFormat ) . getDecimalFormatSymbols ( ) ; digits = new String ( decsym . getDigits ( ) ) ; } else if... |
public class ManagerConfiguration { /** * Sets the callback property .
* @ param callback callback object
* @ param property name of the property
* @ param value value of the property */
private void setProperty ( Callback callback , String property , String value ) { } } | try { if ( value != null ) { SimonBeanUtils . getInstance ( ) . setProperty ( callback , property , value ) ; } else { callback . getClass ( ) . getMethod ( setterName ( property ) ) . invoke ( callback ) ; } } catch ( NoSuchMethodException | InvocationTargetException | IllegalAccessException e ) { throw new SimonExcep... |
public class Transformers { /** * Transform .
* @ param from the from
* @ return the ticket */
@ Transformer ( from = "{urn:switchyard-quickstart-demo:helpdesk:1.0}openTicket" ) public Ticket transform ( Element from ) { } } | Ticket ticket = new Ticket ( ) ; ticket . setId ( getElementValue ( from , "id" ) ) ; return ticket ; |
public class ZonedDateTime { /** * Returns a copy of this date - time with the specified amount added .
* This returns a { @ code ZonedDateTime } , based on this one , with the amount
* in terms of the unit added . If it is not possible to add the amount , because the
* unit is not supported or for some other rea... | if ( unit instanceof ChronoUnit ) { if ( unit . isDateBased ( ) ) { return resolveLocal ( dateTime . plus ( amountToAdd , unit ) ) ; } else { return resolveInstant ( dateTime . plus ( amountToAdd , unit ) ) ; } } return unit . addTo ( this , amountToAdd ) ; |
public class CreateFileContext { /** * Merges and embeds the given { @ link CreateFilePOptions } with the corresponding master options .
* @ param optionsBuilder Builder for proto { @ link CreateFilePOptions } to embed
* @ return the instance of { @ link CreateFileContext } with default values for master */
public ... | CreateFilePOptions masterOptions = FileSystemOptions . createFileDefaults ( ServerConfiguration . global ( ) ) ; CreateFilePOptions . Builder mergedOptionsBuilder = masterOptions . toBuilder ( ) . mergeFrom ( optionsBuilder . build ( ) ) ; return new CreateFileContext ( mergedOptionsBuilder ) ; |
public class VerifierFactory { /** * parses a schema at the specified location and returns a Verifier object
* that validates documents by using that schema .
* Some of XML parsers accepts filenames as well as URLs , while others
* reject them . Therefore , to parse a file as a schema , you should use
* a File ... | return compileSchema ( uri ) . newVerifier ( ) ; |
public class ExceptionFactory { /** * Creates an exception from an plan name .
* @ param planName the plan name
* @ param version the version
* @ return the exception */
public static final PlanVersionAlreadyExistsException planVersionAlreadyExistsException ( String planName , String version ) { } } | return new PlanVersionAlreadyExistsException ( Messages . i18n . format ( "PlanVersionAlreadyExists" , planName , version ) ) ; // $ NON - NLS - 1 $ |
public class Quaternion { /** * Returns true if the L - infinite distance between this tuple
* and tuple t1 is less than or equal to the epsilon parameter ,
* otherwise returns false . The L - infinite
* distance is equal to MAX [ abs ( x1 - x2 ) , abs ( y1 - y2 ) ] .
* @ param t1 the tuple to be compared to th... | double diff ; diff = this . x - t1 . getX ( ) ; if ( Double . isNaN ( diff ) ) return false ; if ( ( diff < 0 ? - diff : diff ) > epsilon ) return false ; diff = this . y - t1 . getY ( ) ; if ( Double . isNaN ( diff ) ) return false ; if ( ( diff < 0 ? - diff : diff ) > epsilon ) return false ; diff = this . z - t1 . g... |
public class EntityUtils { /** * 清除实体类中引用的无效 ( 外键 ) 属性 . < br >
* < pre >
* hibernate在保存对象是检查对象是否引用了未持久化的对象 , 如果引用则保存出错 .
* 实体类 ( Entity ) 是否已经持久化通过检查其id是否为有效值来判断的 .
* 对于实体类中包含的
* & lt ; code & gt ;
* Component
* & lt ; / code & gt ;
* 则递归处理
* 因为集合为空仍有其含义 , 这里对集合不做随意处理 . 如
* / / evict collection
*... | if ( null == entity ) { return ; } boolean isEntity = false ; if ( entity instanceof Entity ) { isEntity = true ; } BeanMap map = new BeanMap ( entity ) ; List < String > attList = new ArrayList < String > ( ) ; for ( Object o : map . keySet ( ) ) { attList . add ( ( String ) o ) ; } attList . remove ( "class" ) ; for ... |
public class ServiceDirectoryFuture { /** * Fail the Future .
* @ param ex
* the ServiceException of the Directory Request .
* @ return
* true for success . */
public synchronized boolean fail ( ServiceException ex ) { } } | if ( completed ) { return false ; } this . completed = true ; this . ex = ex ; notifyAll ( ) ; return true ; |
public class SqlTableSession { /** * / * ( non - Javadoc )
* @ see org . parosproxy . paros . db . paros . TableSession # insert ( long , java . lang . String ) */
@ Override public synchronized void insert ( long sessionId , String sessionName ) throws DatabaseException { } } | SqlPreparedStatementWrapper psInsert = null ; try { psInsert = DbSQL . getSingleton ( ) . getPreparedStatement ( "session.ps.insert" ) ; psInsert . getPs ( ) . setLong ( 1 , sessionId ) ; psInsert . getPs ( ) . setString ( 2 , sessionName ) ; psInsert . getPs ( ) . executeUpdate ( ) ; } catch ( SQLException e ) { throw... |
public class AbstractJsonArray { /** * Removes a value from the receiver ' s collection
* @ param value the value to remove */
public void remove ( V value ) { } } | int index = values . indexOf ( value ) ; values . remove ( value ) ; if ( value instanceof JsonEntity ) { ( ( JsonEntity ) value ) . removePropertyChangeListener ( propListener ) ; } firePropertyChange ( "#" + index , value , null ) ; |
public class Generator { /** * Adds a section to the given media query section - creates if necessary */
private void addResultSection ( String mediaQueryPath , Section section ) { } } | Section qry = mediaQueries . get ( mediaQueryPath ) ; if ( qry == null ) { qry = new Section ( ) ; qry . getSelectors ( ) . add ( Collections . singletonList ( mediaQueryPath ) ) ; mediaQueries . put ( mediaQueryPath , qry ) ; } qry . addSubSection ( section ) ; |
public class PluginUtils { /** * Reads a plugin spec file and returns a { @ link PluginSpec } .
* @ param pluginSpec the plugin spec
* @ throws IOException when an unhandled exception occurs
* @ return plugin ' s specification */
public static PluginSpec readPluginSpecFile ( URL pluginSpec ) throws IOException { ... | return ( PluginSpec ) mapper . reader ( PluginSpec . class ) . readValue ( pluginSpec ) ; |
public class EditText { /** * Gets the number of times the marquee animation is repeated . Only meaningful if the
* TextView has marquee enabled .
* @ return the number of times the marquee animation is repeated . - 1 if the animation
* repeats indefinitely
* @ see # setMarqueeRepeatLimit ( int )
* @ attr ref... | if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) return mInputView . getMarqueeRepeatLimit ( ) ; return - 1 ; |
public class RDBMDistributedLayoutStore { /** * Replaces the layout Document stored on a fragment definition with a new version . This is
* called when a fragment owner updates their layout . */
private void updateCachedLayout ( Document layout , IUserProfile profile , FragmentDefinition fragment ) { } } | final Locale locale = profile . getLocaleManager ( ) . getLocales ( ) . get ( 0 ) ; // need to make a copy that we can fragmentize
layout = ( Document ) layout . cloneNode ( true ) ; // Fix later to handle multiple profiles
final Element root = layout . getDocumentElement ( ) ; final UserView userView = this . fragment... |
public class Curve25519 { /** * Generating private key . Source : https : / / cr . yp . to / ecdh . html
* @ param randomBytes random bytes ( 32 + bytes )
* @ return generated private key */
public static byte [ ] keyGenPrivate ( byte [ ] randomBytes ) throws NoSuchAlgorithmException , DigestException { } } | if ( randomBytes . length < 32 ) { throw new RuntimeException ( "Random bytes too small" ) ; } // Hashing Random Bytes instead of using random bytes directly
// Just in case as reference ed255519 implementation do same
MessageDigest digest = MessageDigest . getInstance ( "SHA-256" ) ; digest . digest ( randomBytes , 0 ... |
public class RecoveryInterceptor { /** * Finds a fallback method for the given context .
* @ param context The context
* @ return The fallback method if it is present */
public Optional < ? extends MethodExecutionHandle < ? , Object > > findFallbackMethod ( MethodInvocationContext < Object , Object > context ) { } ... | Class < ? > declaringType = context . getDeclaringType ( ) ; Optional < ? extends MethodExecutionHandle < ? , Object > > result = beanContext . findExecutionHandle ( declaringType , Qualifiers . byStereotype ( Fallback . class ) , context . getMethodName ( ) , context . getArgumentTypes ( ) ) ; if ( ! result . isPresen... |
public class SubscriptionMessageHandler { /** * Method to reset the Subscription message object and
* reinitialise it as a Reply proxy subscription message */
protected void resetReplySubscriptionMessage ( ) { } } | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "resetReplySubscriptionMessage" ) ; // Reset the state
reset ( ) ; // Indicate that this is a create message
iSubscriptionMessage . setSubscriptionMessageType ( SubscriptionMessageType . REPLY ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "resetReplySubscript... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CoordinateSystemRefType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link CoordinateSystemRefType ... | return new JAXBElement < CoordinateSystemRefType > ( _CoordinateSystemRef_QNAME , CoordinateSystemRefType . class , null , value ) ; |
public class BasicModelUtils { /** * Words nearest based on positive and negative words
* @ param positive the positive words
* @ param negative the negative words
* @ param top the top n words
* @ return the words nearest the mean of the words */
@ Override public Collection < String > wordsNearestSum ( Collec... | INDArray words = Nd4j . create ( lookupTable . layerSize ( ) ) ; // Set < String > union = SetUtils . union ( new HashSet < > ( positive ) , new HashSet < > ( negative ) ) ;
for ( String s : positive ) words . addi ( lookupTable . vector ( s ) ) ; for ( String s : negative ) words . addi ( lookupTable . vector ( s ) . ... |
public class TripleDES { /** * encrypt a plain password
* @ param aPlainPass a password in plain text
* @ return an encrypted password
* @ throws Exception */
public static String encryptPassword ( @ NotNull final String aPlainPass ) throws Exception { } } | byte [ ] encBytes = encryptString ( aPlainPass . getBytes ( DEFAULT_CODEPAGE ) ) ; return Base64 . encodeBase64String ( encBytes ) ; |
public class WebElementAdapter { /** * { @ inheritDoc }
* < p > The method using the elements matched by findElements must implement a catch for
* StaleElementReferenceException , because if a AJAX reloads one of the elements , the
* exceptions is not solved by WebElementAdapter . */
@ Override public List < WebE... | return ( List < WebElement > ) ( new StaleExceptionResolver < List < WebElement > > ( ) { @ Override public List < WebElement > execute ( WebElement element ) { List < WebElement > elements = new ArrayList < WebElement > ( ) ; // create
// new
// list
// of
// WebElements
for ( WebElement webElement : element . findEle... |
public class MockResponse { /** * Throttles the request reader and response writer to sleep for the given period after each
* series of { @ code bytesPerPeriod } bytes are transferred . Use this to simulate network behavior . */
public MockResponse throttleBody ( long bytesPerPeriod , long period , TimeUnit unit ) { ... | this . throttleBytesPerPeriod = bytesPerPeriod ; this . throttlePeriodAmount = period ; this . throttlePeriodUnit = unit ; return this ; |
public class BaseServer { /** * Returns hostname of this server . The format of the host conforms
* to RFC 2732 , i . e . for a literal IPv6 address , this method will
* return the IPv6 address enclosed in square brackets ( ' [ ' and ' ] ' ) .
* @ return hostname */
public String getHost ( ) { } } | String host = Util . getLocalHostAddress ( ) ; try { URL u = new URL ( "http" , host , 80 , "/" ) ; return u . getHost ( ) ; } catch ( MalformedURLException e ) { return host ; } |
public class ExternalContextUtils { /** * Runs a method on an object and returns the result
* @ param obj the object to run the method on
* @ param methodName the name of the method
* @ return the results of the method run */
private static Object _runMethod ( Object obj , String methodName ) { } } | try { Method sessionIdMethod = obj . getClass ( ) . getMethod ( methodName ) ; return sessionIdMethod . invoke ( obj ) ; } catch ( Exception e ) { return null ; } |
public class AbstractDirectory { /** * Replaces all entries in this directory .
* @ param newEntries the new directory entries */
public void setEntries ( List < FatDirectoryEntry > newEntries ) { } } | if ( newEntries . size ( ) > capacity ) throw new IllegalArgumentException ( "too many entries" ) ; this . entries . clear ( ) ; this . entries . addAll ( newEntries ) ; |
public class State { /** * 获取最大的值
* @ return */
public Integer getLargestValueId ( ) { } } | if ( emits == null || emits . size ( ) == 0 ) return null ; return emits . iterator ( ) . next ( ) ; |
import java . util . * ; class GetMaxElement { /** * Extract the maximum value from a list .
* For instance :
* > > > get _ max _ element ( [ 1 , 2 , 3 ] )
* > > > get _ max _ element ( [ 5 , 3 , - 5 , 2 , - 3 , 3 , 9 , 0 , 123 , 1 , - 10 ] )
* 123
* : param input _ list : A list of numerical values
* : ret... | int maxValue = inputList . get ( 0 ) ; for ( int value : inputList ) { if ( value > maxValue ) { maxValue = value ; } } return maxValue ; |
public class ManagementEnforcer { /** * hasNamedPolicy determines whether a named authorization rule exists .
* @ param ptype the policy type , can be " p " , " p2 " , " p3 " , . .
* @ param params the " p " policy rule .
* @ return whether the rule exists . */
public boolean hasNamedPolicy ( String ptype , Strin... | return hasNamedPolicy ( ptype , Arrays . asList ( params ) ) ; |
public class Filters { /** * Convert a DimFilter to a Filter .
* @ param dimFilter dimFilter
* @ return converted filter , or null if input was null */
@ Nullable public static Filter toFilter ( @ Nullable DimFilter dimFilter ) { } } | return dimFilter == null ? null : dimFilter . toFilter ( ) ; |
public class VirtualNetworkGatewaysInner { /** * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer .
* @ param resourceGroupName The name of the resource group .
* @ param virtualNetworkGatewayName The name of the virtual network gateway .
* @ param peer Th... | return beginGetAdvertisedRoutesWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayName , peer ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class ContentSpec { /** * Set the default publican . cfg configuration that should be used when building .
* @ param defaultPublicanCfg The name of the default publican . cfg to use when building . */
public void setDefaultPublicanCfg ( final String defaultPublicanCfg ) { } } | if ( defaultPublicanCfg == null && this . defaultPublicanCfg == null ) { return ; } else if ( defaultPublicanCfg == null ) { removeChild ( this . defaultPublicanCfg ) ; this . defaultPublicanCfg = null ; } else if ( this . defaultPublicanCfg == null ) { this . defaultPublicanCfg = new KeyValueNode < String > ( CommonCo... |
public class ScriptRunnerController { /** * Starts a Script . Will redirect the request to the jobs controller , showing the progress of the
* started { @ link ScriptJobExecution } . The Script ' s output will be written to the log of the
* { @ link ScriptJobExecution } . If the Script has an outputFile , the URL o... | RequestMethod . GET , RequestMethod . POST } , value = "/scripts/{name}/start" ) public void startScript ( @ PathVariable ( "name" ) String scriptName , @ RequestParam Map < String , Object > parameters , HttpServletResponse response ) throws IOException { String scriptJobExecutionHref = submitScript ( scriptName , par... |
public class TimeBasedLinearMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TimeBasedLinear timeBasedLinear , ProtocolMarshaller protocolMarshaller ) { } } | if ( timeBasedLinear == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( timeBasedLinear . getLinearPercentage ( ) , LINEARPERCENTAGE_BINDING ) ; protocolMarshaller . marshall ( timeBasedLinear . getLinearInterval ( ) , LINEARINTERVAL_BINDING... |
public class CmsExplorerTypeAccessFlushListener { /** * Flushes the cache for all registered access setting objects . < p > */
protected synchronized void doFlush ( ) { } } | Iterator < WeakReference < CmsExplorerTypeAccess > > iter = m_contents . iterator ( ) ; while ( iter . hasNext ( ) ) { WeakReference < CmsExplorerTypeAccess > ref = iter . next ( ) ; CmsExplorerTypeAccess access = ref . get ( ) ; if ( access == null ) { iter . remove ( ) ; } else { access . flushCache ( ) ; } } |
public class MediaDefault { /** * Get the resources prefix .
* @ return The resources prefix . */
private String getPrefix ( ) { } } | final String prefix ; if ( loader . isPresent ( ) ) { prefix = loader . get ( ) . getPackage ( ) . getName ( ) . replace ( Constant . DOT , File . separator ) ; } else { prefix = resourcesDir ; } return prefix ; |
public class JSRepeated { /** * Convert to printable form ( subroutine of toString ) */
public void format ( StringBuffer fmt , Set done , Set todo , int indent ) { } } | formatName ( fmt , indent ) ; fmt . append ( "*(\n" ) ; itemType . format ( fmt , done , todo , indent + 2 ) ; fmt . append ( "\n" ) ; indent ( fmt , indent ) ; fmt . append ( ")*" ) ; |
public class IOSCollator { /** * Sets decomposition field , but is otherwise unused . */
@ Override public void setDecomposition ( int value ) { } } | if ( value < Collator . NO_DECOMPOSITION || value > Collator . FULL_DECOMPOSITION ) { throw new IllegalArgumentException ( ) ; } decomposition = value ; |
public class Fastpath { /** * Creates a FastpathArg with an oid parameter . This is here instead of a constructor of
* FastpathArg because the constructor can ' t tell the difference between an long that ' s really
* int8 and a long thats an oid .
* @ param oid input oid
* @ return FastpathArg with an oid param... | if ( oid > Integer . MAX_VALUE ) { oid -= NUM_OIDS ; } return new FastpathArg ( ( int ) oid ) ; |
public class IfcPropertyEnumeratedValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) public EList < IfcValue > getEnumerationValues ( ) { } } | return ( EList < IfcValue > ) eGet ( Ifc2x3tc1Package . Literals . IFC_PROPERTY_ENUMERATED_VALUE__ENUMERATION_VALUES , true ) ; |
public class AbstractQueueFactory { /** * Creates & Initializes a new queue instance .
* @ param spec
* @ return
* @ throws Exception */
protected T createAndInitQueue ( QueueSpec spec ) throws Exception { } } | T queue = createQueueInstance ( spec ) ; queue . setQueueName ( spec . name ) ; initQueue ( queue , spec ) ; return queue ; |
public class MessageProcessor { /** * Convert message parts which data part exceed the limit of characters ( { @ link MessageProcessor # maxPartSize } ) to content data . */
private void convertLargeParts ( ) { } } | List < Attachment > newAttachments = new ArrayList < > ( ) ; if ( ! publicParts . isEmpty ( ) ) { try { List < Part > toLarge = new ArrayList < > ( ) ; for ( Part p : publicParts ) { if ( p . getData ( ) != null && p . getData ( ) . length ( ) > maxPartSize ) { String type = p . getType ( ) != null ? p . getType ( ) : ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.