signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class IntTupleCollections { /** * Create the specified number of tuples with the given dimensions
* ( { @ link Tuple # getSize ( ) size } ) , all initialized to zero , and place
* them into the given target collection
* @ param dimensions The dimensions ( { @ link Tuple # getSize ( ) size } )
* of the tu... | for ( int i = 0 ; i < numElements ; i ++ ) { target . add ( IntTuples . create ( dimensions ) ) ; } |
public class TargetSpecifications { /** * { @ link Specification } for retrieving { @ link Target } s that don ' t have the
* given distribution set in their action history
* @ param distributionSetId
* the ID of the distribution set which must not be assigned
* @ return the { @ link Target } { @ link Specifica... | return ( targetRoot , query , cb ) -> { final ListJoin < JpaTarget , JpaAction > actionsJoin = targetRoot . join ( JpaTarget_ . actions , JoinType . LEFT ) ; actionsJoin . on ( cb . equal ( actionsJoin . get ( JpaAction_ . distributionSet ) . get ( JpaDistributionSet_ . id ) , distributionSetId ) ) ; return cb . isNull... |
public class AbstractJsonDeserializer { /** * Convenience method for subclasses .
* @ param paramName the name of the parameter
* @ param errorMessage the errormessage to add to the exception if the param does not exist .
* @ param mapToUse the map to use as input parametersource
* @ return a stringparameter wi... | return getTypedParam ( paramName , errorMessage , String . class , mapToUse ) ; |
public class LongMapperBuilder { /** * Returns the { @ link LongMapper } represented by this { @ link MapperBuilder } .
* @ param field the name of the field to be built
* @ return the { @ link LongMapper } represented by this */
@ Override public LongMapper build ( String field ) { } } | return new LongMapper ( field , column , validated , boost ) ; |
public class AWSOpsWorksCMClient { /** * Deletes the server and the underlying AWS CloudFormation stacks ( including the server ' s EC2 instance ) . When you
* run this command , the server state is updated to < code > DELETING < / code > . After the server is deleted , it is no
* longer returned by < code > Descri... | request = beforeClientExecution ( request ) ; return executeDeleteServer ( request ) ; |
public class ReactorManager { /** * Creates a staging factory indicated by the { @ link ExamReactorStrategy } annotation of the test
* class .
* @ param testClass
* @ return staging factory */
private StagedExamReactorFactory getStagingFactory ( Class < ? > testClass ) { } } | ExamReactorStrategy strategy = testClass . getAnnotation ( ExamReactorStrategy . class ) ; String strategyName = cm . getProperty ( EXAM_REACTOR_STRATEGY_KEY ) ; StagedExamReactorFactory fact ; try { if ( strategy != null ) { fact = strategy . value ( ) [ 0 ] . newInstance ( ) ; return fact ; } } catch ( IllegalAccessE... |
public class MainActivity { /** * Exercise the NetworkMonitor API */
private void getNetworkInfo ( ) { } } | // Create a listener to check for new network connections ( e . g . switching from mobile to Wifi , or losing internet connection )
NetworkConnectionListener listener = new NetworkConnectionListener ( ) { @ Override public void networkChanged ( NetworkConnectionType newConnection ) { Log . i ( "BMSCore" , "New network ... |
public class CmsToolManager { /** * Registers all tool handlers recursively for a given tool root . < p >
* @ param cms the cms context object
* @ param toolRoot the tool root
* @ param len the recursion level
* @ param handlers the list of handlers to register */
private void registerHandlerList ( CmsObject cm... | boolean found = false ; Iterator < I_CmsToolHandler > it = handlers . iterator ( ) ; while ( it . hasNext ( ) ) { I_CmsToolHandler handler = it . next ( ) ; int myLen = CmsStringUtil . splitAsArray ( handler . getPath ( ) , TOOLPATH_SEPARATOR ) . length ; if ( ( ( len == myLen ) && ! handler . getPath ( ) . equals ( TO... |
public class ApiOvhOrder { /** * Get prices and contracts information
* REST : GET / order / telephony / { billingAccount } / portability
* @ param desireDate [ required ] The date you want for portability execution . Overridden if flag executeAsSoonAsPossible is set
* @ param type [ required ] The type of number... | String qPath = "/order/telephony/{billingAccount}/portability" ; StringBuilder sb = path ( qPath , billingAccount ) ; query ( sb , "building" , building ) ; query ( sb , "callNumber" , callNumber ) ; query ( sb , "city" , city ) ; query ( sb , "contactName" , contactName ) ; query ( sb , "contactNumber" , contactNumber... |
public class BaseSparseNDArrayCOO { /** * Returns the indices of non - zero element of the vector
* @ return indices in Databuffer */
@ Override public DataBuffer getVectorCoordinates ( ) { } } | int idx ; if ( isRowVector ( ) ) { idx = 1 ; } else if ( isColumnVector ( ) ) { idx = 0 ; } else { throw new UnsupportedOperationException ( ) ; } // FIXME : int cast
int [ ] temp = new int [ ( int ) length ( ) ] ; for ( int i = 0 ; i < length ( ) ; i ++ ) { temp [ i ] = getUnderlyingIndicesOf ( i ) . getInt ( idx ) ; ... |
public class ErrorLog { /** * Appends an action to the log .
* @ param action
* the action to append .
* @ throws IOException
* if the node cannot be written to the redo log . */
public void append ( final String action , final String uuid ) throws IOException { } } | initOut ( ) ; out . write ( ByteBuffer . wrap ( ( action + " " + uuid + "\n" ) . getBytes ( ) ) ) ; |
public class Histogram { /** * Get the value at a given position . */
public double get ( double index ) { } } | ListIterator < Bucket > b = buckets_ . listIterator ( 0 ) ; ListIterator < Bucket > e = buckets_ . listIterator ( buckets_ . size ( ) ) ; while ( b . nextIndex ( ) < e . previousIndex ( ) ) { final ListIterator < Bucket > mid = buckets_ . listIterator ( b . nextIndex ( ) / 2 + e . nextIndex ( ) / 2 ) ; final Bucket mid... |
public class IfcStructuralItemImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcRelConnectsStructuralActivity > getAssignedStructuralActivity ( ) { } } | return ( EList < IfcRelConnectsStructuralActivity > ) eGet ( Ifc4Package . Literals . IFC_STRUCTURAL_ITEM__ASSIGNED_STRUCTURAL_ACTIVITY , true ) ; |
public class Logger { /** * resource bundle and then call " void log ( LogRecord ) " . */
private void doLog ( LogRecord lr , String rbname ) { } } | lr . setLoggerName ( name ) ; if ( rbname != null ) { lr . setResourceBundleName ( rbname ) ; lr . setResourceBundle ( findResourceBundle ( rbname , false ) ) ; } log ( lr ) ; |
public class UserTypeUtil { /** * Returns a java class name for a user type . */
public static String getClassName ( UserType userType ) { } } | String name = userType . getName ( ) ; return Formatter . toPascalCase ( name ) ; |
public class WindowedBoltExecutor { /** * Start the trigger policy and waterMarkEventGenerator if set */
protected void start ( ) { } } | if ( waterMarkEventGenerator != null ) { LOG . debug ( "Starting waterMarkEventGenerator" ) ; waterMarkEventGenerator . start ( ) ; } LOG . debug ( "Starting trigger policy" ) ; triggerPolicy . start ( ) ; |
public class BaseDestinationHandler { /** * Handle a remote request to delete a local durable subscription .
* @ param subName The name of the durable subscription to delete .
* @ return DurableConstants . STATUS _ OK if the delete works ,
* DurableConstants . STATUS _ SUB _ NOT _ FOUND if no such subscription
... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteDurableFromRemote" , subName ) ; int status = _pubSubRealization . deleteDurableFromRemote ( subName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteDurableFro... |
public class CmsDriverManager { /** * Returns all roles the given user has for the given resource . < p >
* @ param dbc the current database context
* @ param user the user to check
* @ param resource the resource to check the roles for
* @ return a list of { @ link CmsRole } objects
* @ throws CmsException i... | // guest user has no role
if ( user . isGuestUser ( ) ) { return Collections . emptyList ( ) ; } // try to read from cache
String key = user . getId ( ) . toString ( ) + resource . getRootPath ( ) ; List < CmsRole > result = m_monitor . getCachedRoleList ( key ) ; if ( result != null ) { return result ; } result = new ... |
public class MapFacts { /** * Returns a map factory that generates
* < code > NoCompTreeMap < / code > . { @ link
* jpaul . DataStructs . NoCompTreeMap NoCompTreeMap } is a binary
* tree - backed map that does not require a user - defined { @ link
* java . util . Comparator Comparator } between keys . */
public... | return new MapFactory < K , V > ( ) { private static final long serialVersionUID = 5687187370812696757L ; public Map < K , V > create ( ) { return new NoCompTreeMap < K , V > ( ) ; } public Map < K , V > create ( Map < K , V > m ) { if ( m instanceof NoCompTreeMap /* < K , V > */
) { return ( ( NoCompTreeMap < K , V > ... |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getIfcDocumentStatusEnum ( ) { } } | if ( ifcDocumentStatusEnumEEnum == null ) { ifcDocumentStatusEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 814 ) ; } return ifcDocumentStatusEnumEEnum ; |
public class UserNameServiceImpl { /** * { @ inheritDoc } */
@ Override public int findOptionByIgnoreCaseText ( String text , Select dropDown ) { } } | int index = 0 ; for ( WebElement option : dropDown . getOptions ( ) ) { if ( comparingNames ( text , option . getText ( ) ) ) { return index ; } index ++ ; } return - 1 ; |
public class JSMin { /** * / * next - - get the next character , excluding comments . peek ( ) is used to see
* if a ' / ' is followed by a ' / ' or ' * ' . */
private int next ( ) throws IOException { } } | int c = get ( ) ; if ( c == '/' ) { switch ( peek ( ) ) { case '/' : for ( ; ; ) { c = get ( ) ; if ( c <= '\n' ) { break ; } } break ; case '*' : get ( ) ; while ( c != ' ' ) { switch ( get ( ) ) { case '*' : if ( peek ( ) == '/' ) { get ( ) ; c = ' ' ; } break ; case EOF : error ( "Unterminated comment." ) ; } } brea... |
public class SameAsTargets { /** * TODO : Generalise it to quads and so on */
public static SameAsTargets extract ( Mapping mapping ) { } } | Optional < RDFAtomPredicate > triplePredicate = mapping . getRDFAtomPredicates ( ) . stream ( ) . filter ( p -> p instanceof TriplePredicate ) . findFirst ( ) ; return triplePredicate . map ( p -> { ImmutableSet < Constant > iriTemplates = extractSameAsIRITemplates ( mapping , p ) ; return extractSameAsTargets ( iriTem... |
public class RequestMessage { /** * Sets a name for this tap stream . If the tap stream fails this name can be
* used to try to restart the tap stream from where it last left off .
* @ param n The name for the tap stream . */
public void setName ( String n ) { } } | if ( n . length ( ) > 65535 ) { throw new IllegalArgumentException ( "Tap name too long" ) ; } totalbody += n . length ( ) - name . length ( ) ; keylength = ( short ) n . length ( ) ; name = n ; |
public class CassandraDefs { /** * Create a SlicePredicate that starts at the given column name , selecting up to
* { @ link # MAX _ COLS _ BATCH _ SIZE } columns .
* @ param startColName Starting column name as a byte [ ] .
* @ param endColName Ending column name as a byte [ ]
* @ return SlicePredicate that st... | if ( startColName == null ) startColName = EMPTY_BYTES ; if ( endColName == null ) endColName = EMPTY_BYTES ; SliceRange sliceRange = new SliceRange ( ByteBuffer . wrap ( startColName ) , ByteBuffer . wrap ( endColName ) , false , count ) ; SlicePredicate slicePred = new SlicePredicate ( ) ; slicePred . setSlice_range ... |
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 { } } | if ( key == null ) { throw new JSONException ( "Null key." ) ; } Object object = this . opt ( key ) ; if ( object == null ) { throw new JSONException ( "JSONObject[" + quote ( key ) + "] not found." ) ; } return object ; |
public class CommercePriceListUtil { /** * Returns the last commerce price list in the ordered set where companyId = & # 63 ; .
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching commerce price list... | return getPersistence ( ) . fetchByCompanyId_Last ( companyId , orderByComparator ) ; |
public class DatatypeBuilderImpl { /** * Return Integer . MAX _ VALUE for values that are too big */
private int convertNonNegativeInteger ( String str ) { } } | str = str . trim ( ) ; DecimalDatatype decimal = new DecimalDatatype ( ) ; if ( ! decimal . lexicallyAllows ( str ) ) return - 1 ; // Canonicalize the value
str = decimal . getValue ( str , null ) . toString ( ) ; // Reject negative and fractional numbers
if ( str . charAt ( 0 ) == '-' || str . indexOf ( '.' ) >= 0 ) r... |
public class HttpUtil { /** * Performs an HTTP GET using the given client , sending the response body
* to the given stream ( which won ' t be auto - closed ) .
* @ param httpClient the client to use .
* @ param requestURI the http or https url .
* @ param sink the stream to send the content to ( it won ' t be ... | HttpEntity entity = doGet ( httpClient , requestURI ) ; if ( entity != null ) { entity . writeTo ( sink ) ; } return entity ; |
public class ColorUtils { /** * Convert the hex color values to a hex color , shorthanded when possible
* @ param red
* red hex color in format RR or R
* @ param green
* green hex color in format GG or G
* @ param blue
* blue hex color in format BB or B
* @ param alpha
* alpha hex color in format AA or ... | return shorthandHex ( toColorWithAlpha ( red , green , blue , alpha ) ) ; |
public class DefaultApplicationObjectConfigurer { /** * Sets the { @ link LabelInfo } of the given object . The label info is created
* after loading the encoded label string from this instance ' s
* { @ link MessageSource } using a message code in the format
* < pre >
* & lt ; objectName & gt ; . label
* < /... | Assert . notNull ( configurable , "configurable" ) ; Assert . notNull ( objectName , "objectName" ) ; String labelStr = loadMessage ( objectName + "." + LABEL_KEY ) ; if ( StringUtils . hasText ( labelStr ) ) { LabelInfo labelInfo = LabelInfo . valueOf ( labelStr ) ; configurable . setLabelInfo ( labelInfo ) ; } |
public class Mapper { /** * see { @ link # comparator ( Mapper ) }
* @ param mapper mapper
* @ param reverse if true , reverse the order of comparison
* @ return comparator */
public static Comparator comparator ( final Mapper mapper , final boolean reverse ) { } } | return new Comparator ( ) { public int compare ( Object o , Object o1 ) { return ( ( Comparable ) mapper . map ( reverse ? o1 : o ) ) . compareTo ( mapper . map ( reverse ? o : o1 ) ) ; } } ; |
public class DiffCalculator { /** * Transmits a partial DiffTask .
* @ param result
* Reference to the DiffTask
* @ throws TimeoutException
* if a timeout occurred */
protected void transmitPartialTask ( final Task < Diff > result ) throws TimeoutException { } } | if ( this . partCounter == 1 ) { this . result . setTaskType ( TaskTypes . TASK_PARTIAL_FIRST ) ; this . taskTransmitter . transmitDiff ( result ) ; } else { this . result . setTaskType ( TaskTypes . TASK_PARTIAL ) ; this . taskTransmitter . transmitPartialDiff ( result ) ; } |
public class ShutdownGatewayRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ShutdownGatewayRequest shutdownGatewayRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( shutdownGatewayRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( shutdownGatewayRequest . getGatewayARN ( ) , GATEWAYARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: ... |
public class CommonG { /** * Remove a subelement in a JsonPath
* @ param jsonString String of the json
* @ param expr regex to be removed */
public String removeJSONPathElement ( String jsonString , String expr ) { } } | Configuration conf = Configuration . builder ( ) . jsonProvider ( new GsonJsonProvider ( ) ) . mappingProvider ( new GsonMappingProvider ( ) ) . build ( ) ; DocumentContext context = JsonPath . using ( conf ) . parse ( jsonString ) ; context . delete ( expr ) ; return context . jsonString ( ) ; |
public class DatabaseHashMap { /** * stores userid / passwd information */
void setUserInfo ( ) { } } | String smcDBID = _smc . getSessionDBID ( ) ; if ( smcDBID != null && smcDBID . indexOf ( "::" ) != - 1 ) { try { dbid = smcDBID . substring ( 0 , smcDBID . indexOf ( "::" ) ) ; collectionName = smcDBID . substring ( smcDBID . indexOf ( "::" ) + 2 ) ; if ( collectionName . indexOf ( "$V" ) > 0 ) { collectionName = colle... |
public class ProxyManager { /** * Get the proxy port currently configured .
* This method first locates a proxy host setting , then returns the proxy port from the same location .
* @ param server a specific server to check for proxy settings ( may be null )
* @ return a network port , or 0 if no proxy is configu... | String host = server != null ? server . getProxyHost ( ) : null ; if ( host != null && host . length ( ) > 0 ) { return server . getProxyPort ( ) ; } else { host = System . getProperty ( LOCAL_PROXY_HOST_PROPERTY ) ; if ( host != null && host . length ( ) > 0 ) { return Integer . parseInt ( System . getProperty ( LOCAL... |
public class ViaHeaderImpl { /** * { @ inheritDoc } */
@ Override public Buffer getParameter ( final String name ) throws SipParseException , IllegalArgumentException { } } | return getParameter ( Buffers . wrap ( name ) ) ; |
public class Matrix4f { /** * Apply an orthographic projection transformation for a right - handed coordinate system
* using the given NDC z range to this matrix and store the result in < code > dest < / code > .
* If < code > M < / code > is < code > this < / code > matrix and < code > O < / code > the orthographi... | if ( ( properties & PROPERTY_IDENTITY ) != 0 ) return dest . setOrtho ( left , right , bottom , top , zNear , zFar , zZeroToOne ) ; return orthoGeneric ( left , right , bottom , top , zNear , zFar , zZeroToOne , dest ) ; |
public class OutgoingFileTransfer { /** * This methods handles the transfer and stream negotiation process . It
* returns immediately and its progress will be updated through the
* { @ link NegotiationProgress } callback .
* @ param fileName
* The name of the file that will be transmitted . It is
* preferable... | if ( progress == null ) { throw new IllegalArgumentException ( "Callback progress cannot be null." ) ; } checkTransferThread ( ) ; if ( isDone ( ) || outputStream != null ) { throw new IllegalStateException ( "The negotiation process has already" + " been attempted for this file transfer" ) ; } setFileInfo ( fileName ,... |
public class WebDavNamespaceContext { /** * Returns the list of registered for this URI namespace prefixes .
* @ see javax . xml . namespace . NamespaceContext # getPrefixes ( String )
* @ param namespaceURI namespace URI
* @ return list of registered for prefixes */
public Iterator < String > getPrefixes ( Strin... | List < String > list = new ArrayList < String > ( ) ; list . add ( getPrefix ( namespaceURI ) ) ; return list . iterator ( ) ; |
public class DateUtil { /** * Get the month of the date
* @ param date date
* @ return month of the date */
public static int getMonth ( Date date ) { } } | Calendar c = Calendar . getInstance ( ) ; c . setTime ( date ) ; return c . get ( Calendar . MONTH ) ; |
public class ListRootsResult { /** * A list of roots that are defined in an organization .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setRoots ( java . util . Collection ) } or { @ link # withRoots ( java . util . Collection ) } if you want to override t... | if ( this . roots == null ) { setRoots ( new java . util . ArrayList < Root > ( roots . length ) ) ; } for ( Root ele : roots ) { this . roots . add ( ele ) ; } return this ; |
public class SwaptionDataLattice { /** * Convert tenor given as offset in months to year fraction .
* @ param maturityInMonths The maturity as offset in months .
* @ param tenorInMonths The tenor as offset in months .
* @ return THe tenor as year fraction . */
private double convertTenor ( int maturityInMonths , ... | Schedule schedule = fixMetaSchedule . generateSchedule ( referenceDate , maturityInMonths , tenorInMonths ) ; return schedule . getPayment ( schedule . getNumberOfPeriods ( ) - 1 ) ; |
public class RedBlackTree { /** * Removes the largest key and associated value from the symbol table .
* @ throws NoSuchElementException
* if the symbol table is empty */
public void deleteMax ( ) { } } | if ( isEmpty ( ) ) throw new NoSuchElementException ( "BST underflow" ) ; // if both children of root are black , set root to red
if ( ! isRed ( root . getLeft ( ) ) && ! isRed ( root . getRight ( ) ) ) root . setColor ( RED ) ; root = deleteMax ( root ) ; if ( ! isEmpty ( ) ) { root . setParent ( null ) ; root . setCo... |
public class SameDiff { /** * Create a new scalar ( rank 0 ) SDVariable with the specified value and datatype
* @ param name Name of the SDVariable
* @ param dataType Data type of the scalar
* @ param value Value to initialize the variable with
* @ return SDVariable */
public SDVariable scalar ( String name , D... | try ( MemoryWorkspace ws = Nd4j . getMemoryManager ( ) . scopeOutOfWorkspaces ( ) ) { return var ( name , Nd4j . scalar ( dataType , value ) ) ; } |
public class Font { /** * Gets the style that can be used with the calculated < CODE > BaseFont
* < / CODE > .
* @ return the style that can be used with the calculated < CODE > BaseFont
* < / CODE > */
public int getCalculatedStyle ( ) { } } | int style = this . style ; if ( style == UNDEFINED ) { style = NORMAL ; } if ( baseFont != null ) return style ; if ( family == SYMBOL || family == ZAPFDINGBATS ) return style ; else return style & ( ~ BOLDITALIC ) ; |
public class Slice { /** * Transfers this buffer ' s data to the specified destination starting at
* the specified absolute { @ code index } .
* @ param destinationIndex the first index of the destination
* @ param length the number of bytes to transfer
* @ throws IndexOutOfBoundsException if the specified { @ ... | checkPositionIndexes ( index , index + length , this . length ) ; checkPositionIndexes ( destinationIndex , destinationIndex + length , destination . length ) ; index += offset ; System . arraycopy ( data , index , destination , destinationIndex , length ) ; |
public class EntityTypeMetadataResolver { /** * Determines if any given element in another { @ link Collection } is contained in
* this set .
* @ param set
* The set .
* @ param other
* The other { @ link Collection } .
* @ return < code > true < / code > if any other element is contained . */
public < T > ... | for ( T t : other ) { if ( set . contains ( t ) ) { return true ; } } return false ; |
public class CharOperation { /** * Answers true if the given name starts with the given prefix , false otherwise . The comparison is case sensitive . < br >
* < br >
* For example :
* < ol >
* < li >
* < pre >
* prefix = { ' a ' , ' b ' }
* name = { ' a ' , ' b ' , ' b ' , ' a ' , ' b ' , ' a ' }
* resu... | int max = prefix . length ; if ( name . length < max ) { return false ; } for ( int i = max ; -- i >= 0 ; ) { // assumes the prefix is not larger than the name
if ( prefix [ i ] != name [ i ] ) { return false ; } } return true ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcSpaceHeaterTypeEnum createIfcSpaceHeaterTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcSpaceHeaterTypeEnum result = IfcSpaceHeaterTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class AppConfigChecker { /** * F743-6605 */
static void validateStatefulTimeoutOnInterfaces ( Class < ? > [ ] ifaces , TraceComponent tc ) { } } | if ( ifaces != null ) { for ( Class < ? > iface : ifaces ) { // d618337
if ( iface . isInterface ( ) && iface . getAnnotation ( StatefulTimeout . class ) != null ) { // interface contains class - level @ StatefulTimeout annotation
Tr . warning ( tc , "STATEFUL_TIMEOUT_ON_INTERFACE_CNTR0306W" , iface . getName ( ) ) ; c... |
public class XReturnExpressionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } } | switch ( featureID ) { case XbasePackage . XRETURN_EXPRESSION__EXPRESSION : return basicSetExpression ( null , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ; |
public class PostalCodeElement { /** * Gets the value of the postalCodeNumberExtension property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is why there is not a < CO... | if ( postalCodeNumberExtension == null ) { postalCodeNumberExtension = new ArrayList < PostalCodeElement . PostalCodeNumberExtension > ( ) ; } return this . postalCodeNumberExtension ; |
public class StorageType { /** * List of limits that are applicable for given storage type .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setStorageTypeLimits ( java . util . Collection ) } or { @ link # withStorageTypeLimits ( java . util . Collection ) }... | if ( this . storageTypeLimits == null ) { setStorageTypeLimits ( new java . util . ArrayList < StorageTypeLimit > ( storageTypeLimits . length ) ) ; } for ( StorageTypeLimit ele : storageTypeLimits ) { this . storageTypeLimits . add ( ele ) ; } return this ; |
public class PtoPLocalMsgsItemStream { /** * ( non - Javadoc ) */
@ Override public ConsumerManager createConsumerManager ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createConsumerManager" ) ; ConsumerDispatcher consumerDispatcher = ( ConsumerDispatcher ) getOutputHandler ( ) ; if ( consumerDispatcher == null ) { consumerDispatcher = new ConsumerDispatcher ( destinationHandler , this , ... |
public class XmlParser { /** * Parses the content of the given file as XML turning it into a tree
* of Nodes .
* @ param file the File containing the XML to be parsed
* @ return the root node of the parsed tree of Nodes
* @ throws SAXException Any SAX exception , possibly
* wrapping another exception .
* @ ... | InputSource input = new InputSource ( new FileInputStream ( file ) ) ; input . setSystemId ( "file://" + file . getAbsolutePath ( ) ) ; getXMLReader ( ) . parse ( input ) ; return parent ; |
public class MonitoringFilter { /** * { @ inheritDoc } */
@ Override public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { } } | if ( ! ( request instanceof HttpServletRequest ) || ! ( response instanceof HttpServletResponse ) || monitoringDisabled || ! instanceEnabled ) { // si ce n ' est pas une requête http ou si le monitoring est désactivé , on fait suivre
chain . doFilter ( request , response ) ; return ; } final HttpServletRequest httpR... |
public class fasta { /** * naive */
public static final byte selectRandom ( frequency [ ] a ) { } } | int len = a . length ; double r = random ( 1.0 ) ; for ( int i = 0 ; i < len ; i ++ ) if ( r < a [ i ] . p ) return a [ i ] . c ; return a [ len - 1 ] . c ; |
public class LongTupleNeighborhoodIterables { /** * Creates an iterable that provides iterators for iterating over the
* Moore neighborhood of the given center and the given radius . < br >
* < br >
* Also see < a href = " . . / . . / package - summary . html # Neighborhoods " >
* Neighborhoods < / a >
* @ pa... | return mooreNeighborhoodIterable ( center , radius , null , null , order ) ; |
public class BusItinerary { /** * Add road segments inside the bus itinerary .
* @ param segments is the segment to add .
* @ param autoConnectHalts indicates if the invalid itinery halts are trying to
* be connected to the added segments . If < code > true < / code > { @ link # putInvalidHaltsOnRoads ( BusItiner... | if ( segments == null || segments . isEmpty ( ) ) { return false ; } BusItineraryHalt halt ; RoadSegment sgmt ; final Map < BusItineraryHalt , RoadSegment > haltMapping = new TreeMap < > ( ( obj1 , obj2 ) -> Integer . compare ( System . identityHashCode ( obj1 ) , System . identityHashCode ( obj2 ) ) ) ; final Iterator... |
public class IxSourceQueuedIterator { /** * Cast the object back to a typed value .
* @ param value the value to cast back
* @ return the typed value , maybe null */
@ SuppressWarnings ( "unchecked" ) protected final U fromObject ( Object value ) { } } | return value == NULL ? null : ( U ) value ; |
public class QuadTree { /** * Inserts the element and bounding _ box into the QuadTree at the given
* quad _ handle . Note that a copy will me made of the input bounding _ box .
* Note that this will invalidate any active iterator on the QuadTree .
* Returns an Element _ handle corresponding to the element and bo... | return m_impl . insert ( element , boundingBox , hintIndex ) ; |
public class StreamDescription { /** * Represents the current enhanced monitoring settings of the stream .
* @ param enhancedMonitoring
* Represents the current enhanced monitoring settings of the stream . */
public void setEnhancedMonitoring ( java . util . Collection < EnhancedMetrics > enhancedMonitoring ) { } } | if ( enhancedMonitoring == null ) { this . enhancedMonitoring = null ; return ; } this . enhancedMonitoring = new com . amazonaws . internal . SdkInternalList < EnhancedMetrics > ( enhancedMonitoring ) ; |
public class GoogleCodingConvention { /** * { @ inheritDoc }
* < p > In Google code , the package name of a source file is its file path .
* Exceptions : if a source file ' s parent directory is " test " , " tests " , or
* " testing " , that directory is stripped from the package name .
* If a file is generated... | String name = source . getName ( ) ; Matcher genfilesMatcher = GENFILES_DIR . matcher ( name ) ; if ( genfilesMatcher . find ( ) ) { name = genfilesMatcher . group ( 2 ) ; } Matcher m = PACKAGE_WITH_TEST_DIR . matcher ( name ) ; if ( m . find ( ) ) { return m . group ( 1 ) ; } else { int lastSlash = name . lastIndexOf ... |
public class JDBCPersistenceManagerImpl { /** * / * ( non - Javadoc )
* @ see com . ibm . jbatch . container . services . IPersistenceManagerService # createStepExecution ( long , com . ibm . jbatch . container . context . impl . StepContextImpl ) */
@ Override public StepExecutionImpl createStepExecution ( long root... | StepExecutionImpl stepExecution = null ; String batchStatus = stepContext . getBatchStatus ( ) == null ? BatchStatus . STARTING . name ( ) : stepContext . getBatchStatus ( ) . name ( ) ; String exitStatus = stepContext . getExitStatus ( ) ; String stepName = stepContext . getStepName ( ) ; if ( logger . isLoggable ( Le... |
public class Html5WebSocket { /** * { @ inheritDoc } */
@ Override public void setBinaryType ( @ Nonnull final BinaryType binaryType ) throws IllegalStateException { } } | checkConnected ( ) ; _webSocket . setBinaryType ( binaryType . name ( ) . toLowerCase ( ) ) ; |
public class RedisClient { /** * Test if the specified key exists .
* @ param key
* @ return
* @ throws Exception */
public boolean exists ( String key ) throws Exception { } } | boolean isExist = false ; Jedis jedis = null ; try { jedis = this . jedisPool . getResource ( ) ; isExist = jedis . exists ( SafeEncoder . encode ( key ) ) ; } catch ( Exception e ) { logger . error ( e . getMessage ( ) , e ) ; this . jedisPool . returnBrokenResource ( jedis ) ; throw e ; } finally { if ( jedis != null... |
public class SnackbarBuilder { /** * Set the callback to be informed of the Snackbar being dismissed due to another Snackbar being shown .
* @ param callback The callback .
* @ return This instance . */
@ SuppressWarnings ( "WeakerAccess" ) public SnackbarBuilder consecutiveDismissCallback ( final SnackbarConsecuti... | callbacks . add ( new SnackbarCallback ( ) { public void onSnackbarDismissedAfterAnotherShown ( Snackbar snackbar ) { callback . onSnackbarDismissedAfterAnotherShown ( snackbar ) ; } } ) ; return this ; |
public class ReflectionHelper { /** * Introspect the given object .
* @ param obj object for introspection .
* @ return a map containing object ' s field values .
* @ throws IntrospectionException if an exception occurs during introspection
* @ throws InvocationTargetException if property getter throws an excep... | Map < String , Object > result = new HashMap < > ( ) ; BeanInfo info = Introspector . getBeanInfo ( obj . getClass ( ) ) ; for ( PropertyDescriptor pd : info . getPropertyDescriptors ( ) ) { Method reader = pd . getReadMethod ( ) ; String name = pd . getName ( ) ; if ( reader != null && ! "class" . equals ( name ) ) { ... |
public class ReflectionUtil { /** * 直接设置对象属性值 , 无视private / protected修饰符 , 不经过setter函数 .
* 性能较差 , 用于单次调用的场景 */
public static void setFieldValue ( final Object obj , final String fieldName , final Object value ) { } } | Field field = getField ( obj . getClass ( ) , fieldName ) ; if ( field == null ) { throw new IllegalArgumentException ( "Could not find field [" + fieldName + "] on target [" + obj + ']' ) ; } setField ( obj , field , value ) ; |
public class Iconomy6 { /** * Import accounts from the database .
* @ param sender The command sender so we can send back messages .
* @ return True if the convert is done . Else false . */
private boolean importDatabase ( String sender ) { } } | Connection connection = null ; PreparedStatement statement = null ; try { connection = db . getConnection ( ) ; if ( getDbConnectInfo ( ) . get ( "tablename" ) != null ) { statement = connection . prepareStatement ( "SELECT * FROM " + getDbConnectInfo ( ) . get ( "tablename" ) ) ; } else { statement = connection . prep... |
public class RenameHandler { /** * this is a method to aid IDE debugging of class initialization */
private static RenameHandler createInstance ( ) { } } | // log errors to System . err , as problems in static initializers can be troublesome to diagnose
RenameHandler instance = create ( false ) ; try { // calling loadFromClasspath ( ) is the best option even though it mutates INSTANCE
// only serious errors will be caught here , most errors will log from parseRenameFile (... |
public class MathExpressions { /** * Create a { @ code power ( num , exponent ) } expression
* < p > Returns num raised to the power exponent < / p >
* @ param num numeric expression
* @ param exponent exponent
* @ return power ( num , exponent ) */
public static < A extends Number & Comparable < ? > > NumberEx... | return Expressions . numberOperation ( Double . class , Ops . MathOps . POWER , num , ConstantImpl . create ( exponent ) ) ; |
public class Mapper { /** * Converts an entity ( POJO ) to a DBObject . A special field will be added to keep track of the class type .
* @ param datastore the Datastore to use when fetching this reference
* @ param dbObject the DBObject
* @ param < T > the type of the referenced entity
* @ return the entity
... | if ( dbObject . containsField ( opts . getDiscriminatorField ( ) ) ) { T entity = opts . getObjectFactory ( ) . createInstance ( null , dbObject ) ; entity = fromDb ( datastore , dbObject , entity , createEntityCache ( ) ) ; return entity ; } else { throw new MappingException ( format ( "The DBObject does not contain a... |
public class PreferenceActivity { /** * Obtains the elevation of the activity ' s toolbar from the activity ' s theme . */
private void obtainToolbarElevation ( ) { } } | int elevation ; try { elevation = ThemeUtil . getDimensionPixelSize ( this , R . attr . toolbarElevation ) ; } catch ( NotFoundException e ) { elevation = getResources ( ) . getDimensionPixelSize ( R . dimen . toolbar_elevation ) ; } setToolbarElevation ( pixelsToDp ( this , elevation ) ) ; |
public class AbstractSocket { /** * When one or more new messages have arrived , call this to distribute to all of the listeners .
* If need to wait until all of the listeners have handled the messages , can call Future . get ( )
* or Future . isDone ( ) .
* @ throws IllegalStateException if this socket is closed... | if ( isClosed ( ) ) throw new IllegalStateException ( "Socket is closed" ) ; if ( messages . isEmpty ( ) ) throw new IllegalArgumentException ( "messages may not be empty" ) ; return listenerManager . enqueueEvent ( new ConcurrentListenerManager . Event < SocketListener > ( ) { @ Override public Runnable createCall ( f... |
public class ListPolicyVersionsResult { /** * The policy versions .
* @ param policyVersions
* The policy versions . */
public void setPolicyVersions ( java . util . Collection < PolicyVersion > policyVersions ) { } } | if ( policyVersions == null ) { this . policyVersions = null ; return ; } this . policyVersions = new java . util . ArrayList < PolicyVersion > ( policyVersions ) ; |
public class LanguageAlchemyEntity { /** * Set ISO - 639-3 code for the detected language .
* For more information on ISO - 639-3 : @ see < a href = " http : / / en . wikipedia . org / wiki / ISO _ 639-3 " > http : / / en . wikipedia . org / wiki / ISO _ 639-3 < / a > < / a >
* @ param iso6393 ISO - 639-3 code for ... | if ( iso6393 != null ) { iso6393 = iso6393 . trim ( ) ; } this . iso6393 = iso6393 ; |
public class ConcurrentHeapThetaBuffer { /** * Propagates a single hash value to the shared sketch
* @ param hash to be propagated */
private boolean propagateToSharedSketch ( final long hash ) { } } | // noinspection StatementWithEmptyBody
while ( localPropagationInProgress . get ( ) ) { } // busy wait until previous propagation completed
localPropagationInProgress . set ( true ) ; final boolean res = shared . propagate ( localPropagationInProgress , null , hash ) ; // in this case the parent empty _ and curCount _ ... |
public class RoleAssignmentsInner { /** * Get the specified role assignment .
* @ param scope The scope of the role assignment .
* @ param roleAssignmentName The name of the role assignment to get .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the Rol... | return getWithServiceResponseAsync ( scope , roleAssignmentName ) . map ( new Func1 < ServiceResponse < RoleAssignmentInner > , RoleAssignmentInner > ( ) { @ Override public RoleAssignmentInner call ( ServiceResponse < RoleAssignmentInner > response ) { return response . body ( ) ; } } ) ; |
public class CharStreams { /** * Reads all of the lines from a { @ link Readable } object . The lines do not include
* line - termination characters , but do include other leading and trailing whitespace .
* < p > Does not close the { @ code Readable } . If reading files or resources you should use the
* { @ link... | List < String > result = new ArrayList < String > ( ) ; LineReader lineReader = new LineReader ( r ) ; String line ; while ( ( line = lineReader . readLine ( ) ) != null ) { result . add ( line ) ; } return result ; |
public class RandomAccessStorageModule { /** * { @ inheritDoc } */
@ Override public void write ( byte [ ] bytes , long storageIndex ) throws IOException { } } | randomAccessFile . seek ( storageIndex ) ; randomAccessFile . write ( bytes , 0 , bytes . length ) ; |
public class DefaultFastFileStorageClient { /** * 获取缩略图
* @ param inputStream
* @ return
* @ throws IOException */
private ByteArrayInputStream generateThumbImageByDefault ( InputStream inputStream ) throws IOException { } } | LOGGER . debug ( "根据默认配置生成缩略图" ) ; // 在内存当中生成缩略图
ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; // @ formatter : off
Thumbnails . of ( inputStream ) . size ( thumbImageConfig . getWidth ( ) , thumbImageConfig . getHeight ( ) ) . toOutputStream ( out ) ; // @ formatter : on
return new ByteArrayInputStream (... |
public class MsgDestinationsPresenter { /** * JMS */
void loadJMSConfig ( ) { } } | ModelNode address = Baseadress . get ( ) ; address . add ( "subsystem" , "messaging" ) ; address . add ( "hornetq-server" , getCurrentServer ( ) ) ; loadJMSCmd . execute ( address , new SimpleCallback < AggregatedJMSModel > ( ) { @ Override public void onSuccess ( AggregatedJMSModel result ) { getJMSView ( ) . setConne... |
public class ExpiringReference { /** * Creates an expiring reference with the supplied value and expiration time . */
public static < T > ExpiringReference < T > create ( T value , long expireMillis ) { } } | return new ExpiringReference < T > ( value , expireMillis ) ; |
public class ConditionalBuilder { /** * Adds an { @ code else if } clause with the given predicate and consequent to this conditional . */
public ConditionalBuilder addElseIf ( Expression predicate , Statement consequent ) { } } | conditions . add ( new IfThenPair < > ( predicate , consequent ) ) ; return this ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IDDUNITBASE createIDDUNITBASEFromString ( EDataType eDataType , String initialValue ) { } } | IDDUNITBASE result = IDDUNITBASE . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class SQLiteTypeManager_int { /** * Créee un trigger qui permet la maj automatique d ' un champ de statut ( INTEGER ) dont la valeur signifiera : - 0 : enregistrement créé localement - 1 :
* enregistrement copie conforme du serveur - 2 : enregistrement modifié localement
* @ see com . hexa . client . sql... | String triggerSql = "CREATE TRIGGER IF NOT EXISTS " + tableName + "_" + fieldName + "_localstate_update BEFORE UPDATE ON " + tableName + " FOR EACH ROW " + "WHEN NEW." + fieldName + " <> 1 " + "BEGIN " + "UPDATE " + tableName + " SET " + fieldName + " = 2 WHERE id=NEW.id; END" ; db . execute ( triggerSql ) ; return tru... |
public class RequestParamMap { /** * This method doesn ' t make sense but it should stay , so that it ' s easy to
* spot usage of this invalid method .
* @ param sBaseName
* Base name
* @ return Base name as is . */
@ Nonnull @ Nonempty @ Deprecated public static String getFieldName ( @ Nonnull @ Nonempty final... | ValueEnforcer . notEmpty ( sBaseName , "BaseName" ) ; return sBaseName ; |
public class ConfigOptionsDocGenerator { /** * This method generates html tables from set of classes containing { @ link ConfigOption ConfigOptions } .
* < p > For each class 1 or more html tables will be generated and placed into a separate file , depending on whether
* the class is annotated with { @ link ConfigG... | String outputDirectory = args [ 0 ] ; String rootDir = args [ 1 ] ; for ( OptionsClassLocation location : LOCATIONS ) { createTable ( rootDir , location . getModule ( ) , location . getPackage ( ) , outputDirectory , DEFAULT_PATH_PREFIX ) ; } generateCommonSection ( rootDir , outputDirectory , LOCATIONS , DEFAULT_PATH_... |
public class Journal { /** * Write the given byte buffer record , either sync ( if
* { @ code WriteType . SYNC } ) or async ( if { @ code WriteType . ASYNC } ) , and
* returns the stored { @ link Location } . < br / > A sync write causes all
* previously batched async writes to be synced too . < br / > The provid... | Location loc = appender . storeItem ( data , Location . USER_RECORD_TYPE , write . equals ( WriteType . SYNC ) ? true : false , callback ) ; return loc ; |
public class CSV { /** * Reads in the given CSV dataset as a simple CSV file
* @ param path the CSV file
* @ param lines _ to _ skip the number of lines to skip when reading in the CSV
* ( used to skip header information )
* @ param cat _ cols a set of the indices to treat as categorical features .
* @ return... | return read ( path , DEFAULT_DELIMITER , lines_to_skip , DEFAULT_COMMENT , cat_cols ) ; |
public class PersistenceUnitComponent { /** * @ see javax . persistence . spi . PersistenceUnitInfo # getTransactionType ( ) */
@ Override public PersistenceUnitTransactionType getTransactionType ( ) { } } | if ( persistenceUnitXml . getTransactionType ( ) == org . wisdom . framework . jpa . model . PersistenceUnitTransactionType . RESOURCE_LOCAL ) { return PersistenceUnitTransactionType . RESOURCE_LOCAL ; } else { return PersistenceUnitTransactionType . JTA ; } |
public class ExceptionUtilities { /** * Gets the root cause of an Exception / Error
* @ param throwable The exception / error to find the root cause of .
* @ return The root cause of the exception , or throwable if it is the root cause . */
public static Throwable getRootCause ( Throwable throwable ) { } } | if ( throwable . getCause ( ) != null ) return getRootCause ( throwable . getCause ( ) ) ; return throwable ; |
public class LogPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getNewUserAdded ( ) { } } | if ( newUserAddedEClass == null ) { newUserAddedEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( LogPackage . eNS_URI ) . getEClassifiers ( ) . get ( 7 ) ; } return newUserAddedEClass ; |
public class Matrix { /** * Transposes a 4 x 4 matrix .
* @ param mTrans the array that holds the output inverted matrix
* @ param mTransOffset an offset into mInv where the inverted matrix is
* stored .
* @ param m the input array
* @ param mOffset an offset into m where the matrix is stored . */
public stat... | for ( int i = 0 ; i < 4 ; i ++ ) { int mBase = i * 4 + mOffset ; mTrans [ i + mTransOffset ] = m [ mBase ] ; mTrans [ i + 4 + mTransOffset ] = m [ mBase + 1 ] ; mTrans [ i + 8 + mTransOffset ] = m [ mBase + 2 ] ; mTrans [ i + 12 + mTransOffset ] = m [ mBase + 3 ] ; } |
public class DynamicSelectEkstaziMojo { /** * Implements ' select ' that does not require changes to any
* existing plugin in configuration file ( s ) . */
private void executeThis ( ) throws MojoExecutionException { } } | // Try to attach agent that will modify Surefire .
if ( AgentLoader . loadEkstaziAgent ( ) ) { // Prepare initial list of options and set property .
System . setProperty ( AbstractMojoInterceptor . ARGLINE_INTERNAL_PROP , prepareEkstaziOptions ( ) ) ; // Find non affected classes and set property .
List < String > nonA... |
public class MFPPush { /** * Unsubscribes to the given tag
* @ param tagName name of the tag
* @ param listener Mandatory listener class . When the subscription is deleted
* successfully the { @ link MFPPushResponseListener } . onSuccess
* method is called with the tagName for which subscription is
* deleted ... | if ( isAbleToSubscribe ( ) ) { MFPPushUrlBuilder builder = new MFPPushUrlBuilder ( applicationId ) ; String path = builder . getSubscriptionsUrl ( deviceId , tagName ) ; if ( path == DEVICE_ID_NULL ) { listener . onFailure ( new MFPPushException ( "The device is not registered yet. Please register device before calling... |
public class WiringPiGpioProviderBase { /** * internal */
protected void updateInterruptListener ( Pin pin ) { } } | // enable or disable single static listener with the native impl
if ( listeners . size ( ) > 0 ) { // setup interrupt listener native thread and enable callbacks
if ( ! com . pi4j . wiringpi . GpioInterrupt . hasListener ( this ) ) { com . pi4j . wiringpi . GpioInterrupt . addListener ( this ) ; } // only configure Wir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.