signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class RulePrunerFactory { /** * Performs pruning .
* @ param ts the input time series .
* @ param grammarRules the grammar .
* @ return pruned ruleset . */
public static GrammarRules performPruning ( double [ ] ts , GrammarRules grammarRules ) { } } | RulePruningAlgorithm pruner = new RulePruningAlgorithm ( grammarRules , ts . length ) ; pruner . pruneRules ( ) ; return pruner . regularizePrunedRules ( ) ; |
public class CmsListMetadata { /** * Returns the html code for the multi action bar . < p >
* @ return html code */
public String htmlMultiActionBar ( ) { } } | StringBuffer html = new StringBuffer ( 1024 ) ; html . append ( "<td class='misc'>\n" ) ; html . append ( "\t<div>\n" ) ; Iterator < CmsListMultiAction > itActions = m_multiActions . elementList ( ) . iterator ( ) ; while ( itActions . hasNext ( ) ) { CmsListMultiAction multiAction = itActions . next ( ) ; html . appen... |
public class CallableUtils { /** * Same as @ updateDirections but updates based not on position but on key
* @ param original QueryParameters which would be updated
* @ param source QueryParameters directions of which would be read
* @ return updated clone on @ original with updated directions */
public static Qu... | QueryParameters updatedParams = new QueryParameters ( original ) ; if ( source != null ) { for ( String sourceKey : source . keySet ( ) ) { if ( updatedParams . containsKey ( sourceKey ) == true ) { updatedParams . updateDirection ( sourceKey , source . getDirection ( sourceKey ) ) ; } } } return updatedParams ; |
public class RequirePluginVersions { /** * Add the additional plugins if they don ' t exist yet .
* @ param existing the existing
* @ param additional the additional
* @ return the sets the
* @ throws MojoExecutionException the mojo execution exception */
public Set < Plugin > addAdditionalPlugins ( Set < Plugi... | if ( additional != null ) { for ( String pluginString : additional ) { Plugin plugin = parsePluginString ( pluginString , "AdditionalPlugins" ) ; if ( existing == null ) { existing = new HashSet < Plugin > ( ) ; existing . add ( plugin ) ; } else if ( ! existing . contains ( plugin ) ) { existing . add ( plugin ) ; } }... |
public class ipseccounters_stats { /** * < pre >
* converts nitro response into object and returns the object array in case of get request .
* < / pre > */
protected base_resource [ ] get_nitro_response ( nitro_service service , String response ) throws Exception { } } | ipseccounters_stats [ ] resources = new ipseccounters_stats [ 1 ] ; ipseccounters_response result = ( ipseccounters_response ) service . get_payload_formatter ( ) . string_to_resource ( ipseccounters_response . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == 444 ) { service . clear_sess... |
public class Cursors { /** * Transforms { @ code cursor } to { @ link com . google . common . collect . FluentIterable }
* of type { @ code T } by applying the { @ code singleRowTransform } to every row . */
public static < T > FluentIterable < T > toFluentIterable ( Cursor cursor , Function < ? super Cursor , T > si... | List < T > transformed = Lists . newArrayList ( ) ; if ( cursor != null ) { for ( int i = 0 ; cursor . moveToPosition ( i ) ; i ++ ) { transformed . add ( singleRowTransform . apply ( cursor ) ) ; } } return FluentIterable . from ( transformed ) ; |
public class ActionEvent { /** * / * default */
static < V > ActionEvent < V > create ( String name , Callable < V > action ) { } } | return new CallableActionEvent < > ( name , action ) ; |
public class NettyChannelHandler { /** * Handle the incoming message : pass it to the listener .
* @ param ctx the context object for this handler .
* @ param msg the message .
* @ throws Exception */
@ Override public void channelRead ( final ChannelHandlerContext ctx , final Object msg ) throws Exception { } } | try { this . listener . channelRead ( ctx , msg ) ; } finally { ReferenceCountUtil . release ( msg ) ; } |
public class MG2Encoder { /** * Calculate various forms of derivatives in order to reduce data entropy .
* @ param map attributes
* @ param sortVertices sorted vertices
* @ return encoded UV data */
private int [ ] makeUVCoordDeltas ( AttributeData map , SortableVertex [ ] sortVertices ) { } } | // UV coordinate scaling factor
float scale = 1.0f / map . precision ; int vc = sortVertices . length ; int prevU = 0 , prevV = 0 ; int [ ] intUVCoords = new int [ vc * CTM_UV_ELEMENT_COUNT ] ; for ( int i = 0 ; i < vc ; ++ i ) { // Get old UV coordinate index ( before vertex sorting )
int oldIdx = sortVertices [ i ] .... |
public class ListLabelingJobsResult { /** * An array of < code > LabelingJobSummary < / code > objects , each describing a labeling job .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setLabelingJobSummaryList ( java . util . Collection ) } or
* { @ link ... | if ( this . labelingJobSummaryList == null ) { setLabelingJobSummaryList ( new java . util . ArrayList < LabelingJobSummary > ( labelingJobSummaryList . length ) ) ; } for ( LabelingJobSummary ele : labelingJobSummaryList ) { this . labelingJobSummaryList . add ( ele ) ; } return this ; |
public class ConfigSystem { /** * Generates a Guice Module for use with Injector creation . The generated Guice Module binds a number of support
* classes to service a dynamically generated implementation of the provided configuration interface . See
* { @ link ConfigBuilder } for more information .
* @ param < C... | checkNotNull ( configInterface ) ; checkNotNull ( name ) ; return ConfigBuilder . configModule ( configInterface , Optional . of ( name ) ) ; |
public class HelloSignClient { /** * Retrieves the necessary information to edit an embedded template .
* @ param templateId String ID of the signature request to embed
* @ param skipSignerRoles true if the edited template should not allow the
* user to modify the template ' s signer roles . Defaults to false .
... | return getEmbeddedTemplateEditUrl ( templateId , skipSignerRoles , skipSubjectMessage , false ) ; |
public class Block { /** * Used for nested block quotes . Removes ' > ' char . */
public void removeBlockQuotePrefix ( ) { } } | Line aLine = m_aLines ; while ( aLine != null ) { if ( ! aLine . m_bIsEmpty ) { if ( aLine . m_sValue . charAt ( aLine . m_nLeading ) == '>' ) { int rem = aLine . m_nLeading + 1 ; if ( aLine . m_nLeading + 1 < aLine . m_sValue . length ( ) && aLine . m_sValue . charAt ( aLine . m_nLeading + 1 ) == ' ' ) rem ++ ; aLine ... |
public class Truth8 { /** * to support Java environments without java . nio . file such as Android and J2CL . */
@ GwtIncompatible public static PathSubject assertThat ( @ NullableDecl Path target ) { } } | return assertAbout ( PathSubject . paths ( ) ) . that ( target ) ; |
public class ObjToIntMap { /** * Ensure key index creating one if necessary */
private int ensureIndex ( Object key ) { } } | int hash = key . hashCode ( ) ; int index = - 1 ; int firstDeleted = - 1 ; if ( keys != null ) { int fraction = hash * A ; index = fraction >>> ( 32 - power ) ; Object test = keys [ index ] ; if ( test != null ) { int N = 1 << power ; if ( test == key || ( values [ N + index ] == hash && test . equals ( key ) ) ) { ret... |
public class TransactionException { /** * TODO : represent the failure cause using an enum instead */
public boolean isConflict ( ) { } } | if ( getCause ( ) != null && getCause ( ) instanceof DatastoreException ) { DatastoreException datastoreException = ( DatastoreException ) getCause ( ) ; return datastoreException . getCode ( ) == 10 ; } else { return false ; } |
public class ConfigUtils { /** * Returns the specified String property from the configuration
* @ param config the configuration
* @ param key the key of the property
* @ param defaultValue the default value if the property is not found
* @ return the String value of the property , or the default value if not f... | try { return config . getString ( key , defaultValue ) ; } catch ( Exception e ) { throw new DeployerConfigurationException ( "Failed to retrieve property '" + key + "'" , e ) ; } |
public class DwgBlockControl { /** * Read a Block control in the DWG format Version 15
* @ param data Array of unsigned bytes obtained from the DWG binary file
* @ param offset The current bit offset where the value begins
* @ throws Exception If an unexpected bit value is found in the DWG file . Occurs
* when ... | // System . out . println ( " readDwgBlockControl ( ) executed . . . " ) ;
int bitPos = offset ; Vector v = DwgUtil . getBitLong ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int numReactors = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; setNumReactors ( numReactors ) ; v = DwgUtil . get... |
public class CassandraClientBase { /** * Compose column value .
* @ param cqlMetadata
* the cql metadata
* @ param thriftColumnValue
* the thrift column value
* @ param thriftColumnName
* the thrift column name
* @ return the object */
private Object composeColumnValue ( CqlMetadata cqlMetadata , byte [ ]... | Map < ByteBuffer , String > schemaTypes = cqlMetadata . getValue_types ( ) ; AbstractType < ? > type = null ; try { type = TypeParser . parse ( schemaTypes . get ( ByteBuffer . wrap ( thriftColumnName ) ) ) ; } catch ( SyntaxException | ConfigurationException ex ) { log . error ( ex . getMessage ( ) ) ; throw new Kunde... |
public class Code { /** * Calls the closest superclass ' s virtual method { @ code method } of { @ code
* instance } using { @ code args } and assigns the result to { @ code target } .
* @ param target the local to receive the method ' s return value , or { @ code
* null } if the return type is { @ code void } or... | invoke ( Rops . opInvokeSuper ( method . prototype ( true ) ) , method , target , instance , args ) ; |
public class NodeIdRepresentation { /** * This method is responsible to delete an XML resource addressed through a
* unique node id ( except root node id ) .
* @ param resourceName
* The name of the database , which the node id belongs to .
* @ param nodeId
* The unique node id .
* @ throws JaxRxException
... | synchronized ( resourceName ) { ISession session = null ; INodeWriteTrx wtx = null ; boolean abort = false ; if ( mDatabase . existsResource ( resourceName ) ) { try { // Creating a new session
session = mDatabase . getSession ( new SessionConfiguration ( resourceName , StandardSettings . KEY ) ) ; // Creating a write ... |
public class LabelOperationMetadata { /** * < code >
* . google . cloud . datalabeling . v1beta1 . LabelImageOrientedBoundingBoxOperationMetadata image _ oriented _ bounding _ box _ details = 14;
* < / code > */
public com . google . cloud . datalabeling . v1beta1 . LabelImageOrientedBoundingBoxOperationMetadataOrB... | if ( detailsCase_ == 14 ) { return ( com . google . cloud . datalabeling . v1beta1 . LabelImageOrientedBoundingBoxOperationMetadata ) details_ ; } return com . google . cloud . datalabeling . v1beta1 . LabelImageOrientedBoundingBoxOperationMetadata . getDefaultInstance ( ) ; |
public class FCWsByteBufferImpl { /** * Return the FileChannel object that is representing this WsByteBufferImpl .
* @ return FileChannel */
public FileChannel getFileChannel ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getFileChannel(): " + fc ) ; } return this . fc ; |
public class CQJDBCStorageConnection { /** * { @ inheritDoc } */
@ Override public int getLastOrderNumber ( NodeData parent ) throws RepositoryException { } } | if ( ! containerConfig . useSequenceForOrderNumber ) { return super . getLastOrderNumber ( parent ) ; } return getLastOrderNumber ( ) ; |
public class StandardRoadNetwork { @ Override public final void addRoadSegment ( RoadSegment segment ) throws RoadNetworkException { } } | if ( segment instanceof RoadPolyline ) { addRoadPolyline ( ( RoadPolyline ) segment ) ; } else { throw new UnsupportedRoadSegmentException ( ) ; } |
public class Path { /** * Make this Path identical to the given one .
* @ param other
* a Path to which this object should be made identical */
public void copyFrom ( Path other ) { } } | grow ( other . length - 1 ) ; System . arraycopy ( other . blockIdList , 0 , this . blockIdList , 0 , other . length ) ; this . length = other . length ; this . cachedHashCode = other . cachedHashCode ; |
public class GenericInfoUtils { /** * Type analysis in context of analyzed type with child class as target type . Case : we have interface
* ( or base type ) with generic in class ( as field or return type ) , but we need to analyze actual
* instance type ( from value ) . This method will analyze type from new root... | // root generics are required only to properly solve type
final Map < String , Type > rootGenerics = context . visibleGenericsMap ( ) ; // first step : solve type to replace transitive generics with direct values
final Type actual = GenericsUtils . resolveTypeVariables ( type , rootGenerics ) ; final Class < ? > middle... |
public class LibraryVersions { /** * package private for testing purposes */
void findMavenArtifacts ( Enumeration < URL > mavenDirs ) throws IOException , SAXException , XPathExpressionException , ParserConfigurationException { } } | XPath xpath = XPathFactory . newInstance ( ) . newXPath ( ) ; DocumentBuilderFactory builderFactory = DocumentBuilderFactory . newInstance ( ) ; // don ' t allow external entity refs in the poms .
builderFactory . setFeature ( XMLConstants . FEATURE_SECURE_PROCESSING , true ) ; builderFactory . setFeature ( "http://xml... |
public class PortMappingMarshaller { /** * Marshall the given parameter object . */
public void marshall ( PortMapping portMapping , ProtocolMarshaller protocolMarshaller ) { } } | if ( portMapping == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( portMapping . getPort ( ) , PORT_BINDING ) ; protocolMarshaller . marshall ( portMapping . getProtocol ( ) , PROTOCOL_BINDING ) ; } catch ( Exception e ) { throw new SdkClie... |
public class ComplexNumber { /** * Divides scalar value to a complex number .
* @ param z1 Complex Number .
* @ param scalar Scalar value .
* @ return Returns new ComplexNumber instance containing the divide of specified complex number with the scalar value . */
public static ComplexNumber Divide ( ComplexNumber ... | return new ComplexNumber ( z1 . real / scalar , z1 . imaginary / scalar ) ; |
public class CheckSum { /** * Update the underlying buffer using the integer
* @ param number number to be stored in checksum buffer */
public void update ( int number ) { } } | byte [ ] numberInBytes = new byte [ ByteUtils . SIZE_OF_INT ] ; ByteUtils . writeInt ( numberInBytes , number , 0 ) ; update ( numberInBytes ) ; |
public class WorkflowTriggerHistoriesInner { /** * Resubmits a workflow run based on the trigger history .
* @ param resourceGroupName The resource group name .
* @ param workflowName The workflow name .
* @ param triggerName The workflow trigger name .
* @ param historyName The workflow trigger history name . ... | if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( workflo... |
public class Condition { /** * syntactic sugar */
public ConditionEvidenceComponent addEvidence ( ) { } } | ConditionEvidenceComponent t = new ConditionEvidenceComponent ( ) ; if ( this . evidence == null ) this . evidence = new ArrayList < ConditionEvidenceComponent > ( ) ; this . evidence . add ( t ) ; return t ; |
public class JcrRdfTools { /** * Convert an external statement into a persistable statement by skolemizing
* blank nodes , creating hash - uri subjects , etc
* @ param idTranslator the property of idTranslator
* @ param t the statement
* @ param topic the topic
* @ return the persistable statement
* @ throw... | Statement skolemized = t ; if ( t . getSubject ( ) . isAnon ( ) ) { skolemized = m . createStatement ( getSkolemizedResource ( idTranslator , skolemized . getSubject ( ) , topic ) , skolemized . getPredicate ( ) , skolemized . getObject ( ) ) ; } else if ( idTranslator . inDomain ( t . getSubject ( ) ) && t . getSubjec... |
public class ServerMessageBlock2Response { /** * { @ inheritDoc }
* @ see jcifs . internal . CommonServerMessageBlockResponse # prepare ( jcifs . internal . CommonServerMessageBlockRequest ) */
@ Override public void prepare ( CommonServerMessageBlockRequest next ) { } } | CommonServerMessageBlockResponse n = getNextResponse ( ) ; if ( n != null ) { n . prepare ( next ) ; } |
public class DomainService { /** * Creates a Evse in a charging station type .
* @ param chargingStationTypeId charging station type identifier .
* @ param evse evse object
* @ return created Evse */
public Evse createEvse ( Long chargingStationTypeId , Evse evse ) throws ResourceAlreadyExistsException { } } | ChargingStationType chargingStationType = chargingStationTypeRepository . findOne ( chargingStationTypeId ) ; if ( getEvseByIdentifier ( chargingStationType , evse . getIdentifier ( ) ) != null ) { throw new ResourceAlreadyExistsException ( String . format ( "Evse with identifier '%s' already exists." , evse . getIdent... |
public class RequestLoggingFilter { protected void before ( HttpServletRequest request , HttpServletResponse response ) { } } | final StringBuilder sb = new StringBuilder ( ) ; final String beginDecoration ; if ( isSubRequestUrl ( request ) ) { beginDecoration = "- - - - - - - - - - {SUB BEGIN}: " ; } else { // mainly here
beginDecoration = "* * * * * * * * * * {BEGIN}: " ; } sb . append ( beginDecoration ) ; sb . append ( getTitlePath ( reques... |
public class TileBoundingBoxUtils { /** * Get the standard y tile location as TMS or a TMS y location as standard
* @ param zoom
* zoom level
* @ param y
* y coordinate
* @ return opposite tile format y */
public static int getYAsOppositeTileFormat ( int zoom , int y ) { } } | int tilesPerSide = tilesPerSide ( zoom ) ; int oppositeY = tilesPerSide - y - 1 ; return oppositeY ; |
public class EMMImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . EMM__MM_NAME : return getMMName ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class UnboundedLocalCache { /** * A { @ link Map # compute ( Object , BiFunction ) } that does not directly record any cache statistics .
* @ param key key with which the specified value is to be associated
* @ param remappingFunction the function to compute a value
* @ return the new value associated with... | // ensures that the removal notification is processed after the removal has completed
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) V [ ] oldValue = ( V [ ] ) new Object [ 1 ] ; RemovalCause [ ] cause = new RemovalCause [ 1 ] ; V nv = data . compute ( key , ( K k , V value ) -> { V newValue = remappingFunction . ... |
public class PredictionsImpl { /** * Predict an image url without saving the result .
* @ param projectId The project id
* @ param iterationId Optional . Specifies the id of a particular iteration to evaluate against .
* The default iteration for the project will be used when not specified
* @ param application... | if ( projectId == null ) { throw new IllegalArgumentException ( "Parameter projectId is required and cannot be null." ) ; } if ( this . client . apiKey ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiKey() is required and cannot be null." ) ; } ImageUrl imageUrl = new ImageUrl ( ) ; image... |
public class JMLambda { /** * Consume if true .
* @ param < T > the type parameter
* @ param < U > the type parameter
* @ param target1 the target 1
* @ param target2 the target 2
* @ param targetTester the target tester
* @ param biConsumer the bi consumer */
public static < T , U > void consumeIfTrue ( T ... | consumeIfTrue ( targetTester . test ( target1 , target2 ) , target1 , target2 , biConsumer ) ; |
public class ValidatorContext { /** * Creates the validator and makes all the connections .
* @ return Newly created and configured validator . */
public DefaultSimpleValidator < D , O > build ( ) { } } | final DefaultSimpleValidator < D , O > validator = new DefaultSimpleValidator < D , O > ( ) ; for ( final Trigger trigger : registeredTriggers ) { validator . addTrigger ( trigger ) ; } for ( final DataProvider < D > dataProvider : registeredDataProviders ) { validator . addDataProvider ( dataProvider ) ; } for ( final... |
public class ReturnTaglet { /** * { @ inheritDoc } */
public void inherit ( DocFinder . Input input , DocFinder . Output output ) { } } | Tag [ ] tags = input . element . tags ( "return" ) ; if ( tags . length > 0 ) { output . holder = input . element ; output . holderTag = tags [ 0 ] ; output . inlineTags = input . isFirstSentence ? tags [ 0 ] . firstSentenceTags ( ) : tags [ 0 ] . inlineTags ( ) ; } |
public class HammingWeight { /** * Count number of bits set to one in the given long ( 64 - bit integers ) .
* @ param i
* @ return */
public static long ofSetBits64_1 ( long i ) { } } | i = i - ( ( i >>> 1 ) & 0x5555555555555555L ) ; i = ( i & 0x3333333333333333L ) + ( ( i >>> 2 ) & 0x3333333333333333L ) ; i = ( ( i + ( i >>> 4 ) ) & 0x0F0F0F0F0F0F0F0FL ) ; return ( i * ( 0x0101010101010101L ) ) >>> 56 ; |
public class ModelFactory { /** * Constructor - method to use when service descriptors are not required ( e . g . schema and wsdl for services )
* @ param groupId
* @ param artifactId
* @ param version
* @ param service
* @ param deploymentModel
* @ return the new model instance */
public static IModel newM... | return doCreateNewModel ( groupId , artifactId , version , service , muleVersion , deploymentModel , transports , null , null , TransformerEnum . JAVA , null , null ) ; |
public class DomainsInner { /** * Get domain name recommendations based on keywords .
* Get domain name recommendations based on keywords .
* ServiceResponse < PageImpl < NameIdentifierInner > > * @ param parameters Search parameters for domain name recommendations .
* @ throws IllegalArgumentException thrown if ... | if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } if ( this . client . apiVe... |
public class Cursor { /** * Synchronized . Get the entry currently pointed to by this cursor .
* @ return the entry currently pointed to by this cursor */
public synchronized Entry current ( ) { } } | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "current" ) ; checkEntryParent ( ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "current" , current ) ; return current ; |
public class Collections { /** * A convenience method to merge a single argument plus the ( possibly zero ) remaining values .
* Useful for iterating over a varargs collection that requires at least one value .
* @ param < T > the type
* @ param pFirst the first ( required ) values
* @ param pRest the remaining... | List < T > result = new ArrayList < T > ( 1 + ( pRest == null ? 0 : pRest . length ) ) ; result . add ( pFirst ) ; if ( pRest != null ) { result . addAll ( Arrays . asList ( pRest ) ) ; } return result ; |
public class WsocOutboundChain { /** * SslOption related functions */
@ Trivial protected void setSslOptions ( ServiceReference < ChannelConfiguration > service ) { } } | sslOptions . setReference ( service ) ; wsocSecureChain . setConfigured ( true ) ; performAction ( updateAction ) ; |
public class StreamUtils { /** * Copy the contents of the given InputStream into a String .
* Leaves the stream open when done .
* @ param in the InputStream to copy from
* @ return the String that has been copied to
* @ throws IOException in case of I / O errors */
public static String copyToString ( InputStre... | Assert . notNull ( in , "No InputStream specified" ) ; StringBuilder out = new StringBuilder ( ) ; InputStreamReader reader = new InputStreamReader ( in , charset ) ; char [ ] buffer = new char [ BUFFER_SIZE ] ; int bytesRead = - 1 ; while ( ( bytesRead = reader . read ( buffer ) ) != - 1 ) { out . append ( buffer , 0 ... |
public class DesignDocumentManager { /** * Removes a design document using DesignDocument object from the database .
* @ param designDocument the design document object to be removed
* @ return { @ link DesignDocument } */
public Response remove ( DesignDocument designDocument ) { } } | assertNotEmpty ( designDocument , "DesignDocument" ) ; ensureDesignPrefixObject ( designDocument ) ; return db . remove ( designDocument ) ; |
public class FilterLoader { /** * Given source and name will compile and store the filter if it detects that the filter code has changed or
* the filter doesn ' t exist . Otherwise it will return an instance of the requested ZuulFilter
* @ param sCode source code
* @ param sName name of the filter
* @ return th... | if ( filterCheck . get ( sName ) == null ) { filterCheck . putIfAbsent ( sName , sName ) ; if ( ! sCode . equals ( filterClassCode . get ( sName ) ) ) { LOG . info ( "reloading code " + sName ) ; filterRegistry . remove ( sName ) ; } } ZuulFilter filter = filterRegistry . get ( sName ) ; if ( filter == null ) { Class c... |
public class RxPresenter { /** * This is a shortcut for calling { @ link # restartableFirst ( int , Func0 , Action2 , Action2 ) } with the last parameter = null . */
public < T > void restartableFirst ( int restartableId , final Func0 < Observable < T > > observableFactory , final Action2 < View , T > onNext ) { } } | restartableFirst ( restartableId , observableFactory , onNext , null ) ; |
public class CommerceCountryLocalServiceUtil { /** * Returns the commerce country matching the UUID and group .
* @ param uuid the commerce country ' s UUID
* @ param groupId the primary key of the group
* @ return the matching commerce country , or < code > null < / code > if a matching commerce country could no... | return getService ( ) . fetchCommerceCountryByUuidAndGroupId ( uuid , groupId ) ; |
public class NettyHelper { /** * 得到服务端业务线程池
* @ param config 服务端配置
* @ param executor 业务线程池
* @ return 服务端业务线程池 */
public static EventLoopGroup getServerBizEventLoopGroup ( ServerTransportConfig config , Executor executor ) { } } | int bizThreads = config . getBizMaxThreads ( ) ; return config . isUseEpoll ( ) ? new EpollEventLoopGroup ( config . getBizMaxThreads ( ) , executor ) : new NioEventLoopGroup ( bizThreads , executor ) ; |
public class CRTable { /** * Create a new CRTEntry and add it to the entries .
* @ param tree The tree or the list of trees for which
* we are storing the code pointers .
* @ param flags The set of flags designating type of the entry .
* @ param startPc The starting code position .
* @ param endPc The ending ... | entries . append ( new CRTEntry ( tree , flags , startPc , endPc ) ) ; |
public class PatternBox { /** * Constructs a pattern where first and last molecules are participants of a
* MolecularInteraction .
* @ return the pattern */
public static Pattern molecularInteraction ( ) { } } | Pattern p = new Pattern ( SequenceEntityReference . class , "Protein 1" ) ; p . add ( linkedER ( true ) , "Protein 1" , "generic Protein 1" ) ; p . add ( erToPE ( ) , "generic Protein 1" , "SPE1" ) ; p . add ( linkToComplex ( ) , "SPE1" , "PE1" ) ; p . add ( new PathConstraint ( "PhysicalEntity/participantOf:MolecularI... |
public class ManagementEJBService { /** * Get the configuration for the EJBs in this module
* EJBSystemBeanConfig ( String name , Class < ? > ejbClass , String remoteHomeBindingName ,
* Class < ? extends EJBHome > remoteHomeInterface , Class < ? extends EJBObject > remoteInterface )
* @ param name the valid EJB n... | EJBSystemBeanConfig ejb = new EJBSystemBeanConfig ( BEAN_NAME , ManagementEJB . class , BINDING_NAME , ManagementHome . class , Management . class ) ; EJBSystemBeanConfig [ ] ejbs = new EJBSystemBeanConfig [ ] { ejb } ; return ejbs ; |
public class EasyRandomParameters { /** * Set the string length range .
* @ param minStringLength the minimum string length
* @ param maxStringLength the maximum string length
* @ return the current { @ link EasyRandomParameters } instance for method chaining */
public EasyRandomParameters stringLengthRange ( fin... | if ( minStringLength < 0 ) { throw new IllegalArgumentException ( "minStringLength must be >= 0" ) ; } if ( minStringLength > maxStringLength ) { throw new IllegalArgumentException ( format ( "minStringLength (%s) must be <= than maxStringLength (%s)" , minStringLength , maxStringLength ) ) ; } setStringLengthRange ( n... |
public class EntityClassReader { /** * Retrieves the type of the given property path .
* @ param propertyPath The dot - separated path of the property type to retrieve . E . g . directly property : " name " ,
* sub property : " streetAddress . number "
* @ return the type of the property with the given name or nu... | if ( propertyPath == null ) { throw new IllegalArgumentException ( "Propertyname may not be null" ) ; } StringTokenizer tokenizer = new StringTokenizer ( propertyPath , "." , false ) ; return getPropertyType ( tokenizer ) ; |
public class LoggingHelper { /** * Helper method for formatting transmission and reception messages .
* @ param protocol
* The protocol used
* @ param source
* Message source
* @ param destination
* Message destination
* @ param message
* The message
* @ return A formatted message in the format :
* ... | return COMM_MESSAGE_FORMAT . format ( new Object [ ] { protocol , source , destination , message } ) ; |
public class CommerceWishListItemPersistenceImpl { /** * Returns the first commerce wish list item in the ordered set where commerceWishListId = & # 63 ; and CProductId = & # 63 ; .
* @ param commerceWishListId the commerce wish list ID
* @ param CProductId the c product ID
* @ param orderByComparator the compara... | CommerceWishListItem commerceWishListItem = fetchByCW_CP_First ( commerceWishListId , CProductId , orderByComparator ) ; if ( commerceWishListItem != null ) { return commerceWishListItem ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commerceWishListId=" ) ... |
public class TypesREST { /** * Bulk retrieval API for retrieving all type definitions in Atlas
* @ return A composite wrapper object with lists of all type definitions
* @ throws Exception
* @ HTTP 200 { @ link AtlasTypesDef } with type definitions matching the search criteria or else returns empty list of type d... | SearchFilter searchFilter = getSearchFilter ( httpServletRequest ) ; AtlasTypesDef typesDef = typeDefStore . searchTypesDef ( searchFilter ) ; return typesDef ; |
public class ArchUtils { /** * Adds the given { @ link Processor } with the given keys to the map .
* @ param keys The keys .
* @ param processor The { @ link Processor } to add .
* @ throws IllegalStateException If the key already exists . */
private static void addProcessors ( final Processor processor , final ... | for ( final String key : keys ) { addProcessor ( key , processor ) ; } |
public class Matrix4x3d { /** * / * ( non - Javadoc )
* @ see org . joml . Matrix4x3dc # scale ( double , org . joml . Matrix4x3d ) */
public Matrix4x3d scale ( double xyz , Matrix4x3d dest ) { } } | return scale ( xyz , xyz , xyz , dest ) ; |
public class Task { /** * This method will be called in { @ link # run ( ) } to inform control that this task needs to run again */
public final void running ( ) { } } | Status previousStatus = status ; status = Status . RUNNING ; if ( tree . listeners != null && tree . listeners . size > 0 ) tree . notifyStatusUpdated ( this , previousStatus ) ; if ( control != null ) control . childRunning ( this , this ) ; |
public class ContainerDefinition { /** * The environment variables to set in the Docker container . Each key and value in the < code > Environment < / code >
* string to string map can have length of up to 1024 . We support up to 16 entries in the map .
* @ param environment
* The environment variables to set in ... | setEnvironment ( environment ) ; return this ; |
public class DataContextUtils { /** * Return a converter that can expand the property references within a string
* @ param data property context data
* @ return a Converter to expand property values within a string */
public static Converter < String , String > replaceDataReferencesConverter ( final Map < String , ... | return replaceDataReferencesConverter ( data , null , false ) ; |
public class MigrateToExtensionSettings { /** * Deletes a campaign feed . */
private static CampaignFeed deleteCampaignFeed ( AdWordsServicesInterface adWordsServices , AdWordsSession session , CampaignFeed campaignFeed ) throws RemoteException { } } | // Get the CampaignFeedService .
CampaignFeedServiceInterface campaignFeedService = adWordsServices . get ( session , CampaignFeedServiceInterface . class ) ; CampaignFeedOperation operation = new CampaignFeedOperation ( ) ; operation . setOperand ( campaignFeed ) ; operation . setOperator ( Operator . REMOVE ) ; retur... |
public class FSNamesystem { /** * @ return list of datanodes where decommissioning is in progress */
public ArrayList < DatanodeDescriptor > getDecommissioningNodesList ( ) { } } | try { return getDecommissioningNodesList ( getDatanodeListForReport ( DatanodeReportType . LIVE ) ) ; } catch ( Exception e ) { return new ArrayList < DatanodeDescriptor > ( ) ; } |
public class BooleanSatisfiabilitySolver { private void updateDomains ( int [ ] ... allModels ) { } } | HashSet < Variable > allVars = new HashSet < Variable > ( ) ; allVars . addAll ( Arrays . asList ( this . getConstraintNetwork ( ) . getVariables ( ) ) ) ; for ( int [ ] oneModel : allModels ) { for ( int i : oneModel ) { BooleanVariable bv = ( BooleanVariable ) this . getConstraintNetwork ( ) . getVariable ( Math . ab... |
public class CommercePriceListAccountRelLocalServiceBaseImpl { /** * Adds the commerce price list account rel to the database . Also notifies the appropriate model listeners .
* @ param commercePriceListAccountRel the commerce price list account rel
* @ return the commerce price list account rel that was added */
@... | commercePriceListAccountRel . setNew ( true ) ; return commercePriceListAccountRelPersistence . update ( commercePriceListAccountRel ) ; |
public class Utils { public static String interpolate ( List < Object > prepared , JadeModel model , ExpressionHandler expressionHandler ) throws ExpressionException { } } | StringBuffer result = new StringBuffer ( ) ; for ( Object entry : prepared ) { if ( entry instanceof String ) { result . append ( entry ) ; } else if ( entry instanceof ExpressionString ) { ExpressionString expression = ( ExpressionString ) entry ; String stringValue = "" ; String value = expressionHandler . evaluateSt... |
public class GraphApiCompositeClassLoaderProvider { /** * Creates a classloader which combines classloaders of all addons depending on Graph API . This insures that
* FramedGraph can always load all the relevant types of * Model classes ( as all model classes will be in Addons that
* depend on Graph API ) . */
publ... | List < ClassLoader > loaders = new ArrayList < > ( ) ; AddonFilter filter = new AddonFilter ( ) { @ Override public boolean accept ( Addon addon ) { return addonDependsOnGraphApi ( addon ) ; } } ; for ( Addon addon : furnace . getAddonRegistry ( ) . getAddons ( filter ) ) { loaders . add ( addon . getClassLoader ( ) ) ... |
public class Dynamic { /** * Represents a constant that is resolved by invoking a { @ code static } factory method or a constructor .
* @ param methodDescription The method or constructor to invoke to create the represented constant value .
* @ param rawArguments The method ' s or constructor ' s constant arguments... | if ( ! methodDescription . isConstructor ( ) && methodDescription . getReturnType ( ) . represents ( void . class ) ) { throw new IllegalArgumentException ( "Bootstrap method is no constructor or non-void static factory: " + methodDescription ) ; } else if ( methodDescription . getParameters ( ) . size ( ) + ( methodDe... |
public class Gravatar { /** * Retrieve the gravatar URL for the given email .
* @ param email The email for which the avatar URL should be returned .
* @ return URL to the gravatar . */
public String getUrl ( String email ) { } } | if ( email == null ) { throw new IllegalArgumentException ( "Email can't be null." ) ; } String emailHash = DigestUtils . md5Hex ( email . trim ( ) . toLowerCase ( ) ) ; boolean firstParameter = true ; // StringBuilder standard capacity is 16 characters while the minimum
// url is 63 characters long . The maximum lengt... |
public class RoleVoterImpl { /** * This method is a pass - through for Spring - RoleVoter .
* @ param authentication principal seeking AuthZ
* @ param resource that is under protection
* @ param config access - attributes defined on resource
* @ return vote ( AccessDecisionVoter . ACCESS _ GRANTED , ACCESS _ DE... | int decision = super . vote ( authentication , resource , config ) ; log . debug ( VoterUtil . debugText ( "RoleVoterImpl" , authentication , config , resource , decision ) ) ; return decision ; |
public class BundleUtils { /** * Returns a optional int array value . In other words , returns the value mapped by key if it exists and is a int array .
* The bundle argument is allowed to be { @ code null } . If the bundle is null , this method returns null .
* @ param bundle a bundle . If the bundle is null , thi... | return optIntArray ( bundle , key , new int [ 0 ] ) ; |
public class BitmapUtils { /** * 将指定的图片压缩成需要的尺寸
* @ param path 图片的路径
* @ param width 要压缩成的图片的宽度
* @ param height 要压缩成的图片的高度 */
public static Bitmap getBitmapBySize ( String path , int width , int height ) { } } | BitmapFactory . Options option = new BitmapFactory . Options ( ) ; option . inJustDecodeBounds = true ; BitmapFactory . decodeFile ( path , option ) ; option . inSampleSize = computeSampleSize ( option , - 1 , width * height ) ; option . inJustDecodeBounds = false ; Bitmap bitmap = null ; try { bitmap = BitmapFactory .... |
public class AttributeValueImpl { /** * Set the value of this metadata .
* @ param id identifier . */
public void setUUID ( String id ) { } } | try { this . value = ( id != null ) ? UUID . fromString ( id ) : null ; } catch ( Throwable exception ) { assert id != null ; this . value = UUID . nameUUIDFromBytes ( id . getBytes ( ) ) ; } this . type = AttributeType . UUID ; this . assigned = this . value != null ; |
public class PoolablePreparedStatement { /** * Method setBigDecimal .
* @ param parameterIndex
* @ param x
* @ throws SQLException
* @ see java . sql . PreparedStatement # setBigDecimal ( int , BigDecimal ) */
@ Override public void setBigDecimal ( int parameterIndex , BigDecimal x ) throws SQLException { } } | internalStmt . setBigDecimal ( parameterIndex , x ) ; |
public class DocEnv { /** * Create the AnnotationTypeElementDoc for a MethodSymbol .
* Should be called only on symbols representing annotation type elements . */
protected void makeAnnotationTypeElementDoc ( MethodSymbol meth , TreePath treePath ) { } } | AnnotationTypeElementDocImpl result = ( AnnotationTypeElementDocImpl ) methodMap . get ( meth ) ; if ( result != null ) { if ( treePath != null ) result . setTreePath ( treePath ) ; } else { result = new AnnotationTypeElementDocImpl ( this , meth , treePath ) ; methodMap . put ( meth , result ) ; } |
public class PangoolMultipleOutputs { /** * Checks if a named output name is valid .
* @ param namedOutput
* named output Name
* @ throws IllegalArgumentException
* if the output name is not valid . */
private static void checkNamedOutputName ( JobContext job , String namedOutput , boolean alreadyDefined ) { } ... | validateOutputName ( namedOutput ) ; List < String > definedChannels = getNamedOutputsList ( job ) ; if ( alreadyDefined && definedChannels . contains ( namedOutput ) ) { throw new IllegalArgumentException ( "Named output '" + namedOutput + "' already alreadyDefined" ) ; } else if ( ! alreadyDefined && ! definedChannel... |
public class Servlet { /** * Set the { @ link HTTPContext } for this servlet . This is required for
* < code > Servlet < / code > to be fully initialized . Don ' t use
* { @ link # equals ( Object ) } prior to setting the < code > HTTPContext < / code > ,
* which most likely implies not adding this to a collectio... | if ( context . getHost ( ) == null ) { throw new IllegalArgumentException ( context . getClass ( ) . getSimpleName ( ) + " host must not be null" ) ; } this . host = context . getHost ( ) ; this . port = context . getPort ( ) ; |
public class JsonHandler { /** * { @ inheritDoc } */
public String escape ( String request , boolean isCandidate ) { } } | String result = request ; if ( isCandidate && request != null && ! "" . equals ( request ) ) { try { StringBuilder sb = new StringBuilder ( ) ; JsonNode rootNode = mapper . readValue ( request , JsonNode . class ) ; escape ( sb , rootNode , null ) ; result = sb . toString ( ) ; } catch ( Exception e ) { log . error ( n... |
public class CmsSessionManager { /** * Switches the current user to the given user . The session info is rebuild as if the given user
* performs a login at the workplace .
* @ param cms the current CmsObject
* @ param req the current request
* @ param user the user to switch to
* @ return the direct edit targ... | return switchUserFromSession ( cms , req , user , null ) ; |
public class ArrayQueue { /** * Returns an array containing all of the elements in this queue in
* proper sequence ( from first to last element ) ; the runtime type of the
* returned array is that of the specified array . If the queue fits in
* the specified array , it is returned therein . Otherwise , a new arra... | int size = size ( ) ; if ( a . length < size ) a = ( T [ ] ) java . lang . reflect . Array . newInstance ( a . getClass ( ) . getComponentType ( ) , size ) ; if ( head < tail ) { System . arraycopy ( elements , head , a , 0 , size ( ) ) ; } else if ( head > tail ) { int headPortionLen = elements . length - head ; Syste... |
public class WhiteboxImpl { /** * Invoke a private or inner class method in cases where power mock cannot
* automatically determine the type of the parameters , for example when
* mixing primitive types and wrapper types in the same method . For most
* situations use { @ link # invokeMethod ( Class , String , Obj... | final Class < ? > unmockedType = getType ( tested ) ; Method method = getMethod ( unmockedType , methodToExecute , argumentTypes ) ; if ( method == null ) { throwExceptionIfMethodWasNotFound ( unmockedType , methodToExecute , null , arguments ) ; } return ( T ) performMethodInvocation ( tested , method , arguments ) ; |
public class PutTraceSegmentsRequest { /** * A string containing a JSON document defining one or more segments or subsegments .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setTraceSegmentDocuments ( java . util . Collection ) } or
* { @ link # withTrace... | if ( this . traceSegmentDocuments == null ) { setTraceSegmentDocuments ( new java . util . ArrayList < String > ( traceSegmentDocuments . length ) ) ; } for ( String ele : traceSegmentDocuments ) { this . traceSegmentDocuments . add ( ele ) ; } return this ; |
public class GitUtils { /** * Executes a git push .
* @ param git the Git instance used to handle the repository
* @ param remote remote name or URL
* @ param branch the remote branch being pushed to
* @ param authConfigurator the { @ link GitAuthenticationConfigurator } class used to configure the authenticati... | PushCommand push = git . push ( ) ; push . setRemote ( remote ) ; if ( StringUtils . isNotEmpty ( branch ) ) { push . setRefSpecs ( new RefSpec ( Constants . HEAD + ":" + Constants . R_HEADS + branch ) ) ; } if ( authConfigurator != null ) { authConfigurator . configureAuthentication ( push ) ; } return push . call ( )... |
public class WriterUtils { /** * Creates a { @ link CodecFactory } based on the specified codec name and deflate level . If codecName is absent , then
* a { @ link CodecFactory # deflateCodec ( int ) } is returned . Otherwise the codecName is converted into a
* { @ link CodecFactory } via the { @ link CodecFactory ... | if ( ! codecName . isPresent ( ) ) { return CodecFactory . deflateCodec ( ConfigurationKeys . DEFAULT_DEFLATE_LEVEL ) ; } else if ( codecName . get ( ) . equalsIgnoreCase ( DataFileConstants . DEFLATE_CODEC ) ) { if ( ! deflateLevel . isPresent ( ) ) { return CodecFactory . deflateCodec ( ConfigurationKeys . DEFAULT_DE... |
public class Multiplication { /** * { @ inheritDoc } */
public Node simplify ( ) { } } | Node simplifiedLeft = left . simplify ( ) ; Node simplifiedRight = right . simplify ( ) ; // If the two arguments are constants , we can simplify by calculating the result , it won ' t
// ever change .
if ( simplifiedLeft instanceof Constant && simplifiedRight instanceof Constant ) { return new Constant ( simplifiedLef... |
public class LargeObject { /** * < p > This method is inefficient , as the only way to find out the size of the object is to seek to
* the end , record the current position , then return to the original position . < / p >
* < p > A better method will be found in the future . < / p >
* @ return the size of the lar... | int cp = tell ( ) ; seek ( 0 , SEEK_END ) ; int sz = tell ( ) ; seek ( cp , SEEK_SET ) ; return sz ; |
public class OverdueJson { /** * Unless the user knows what it ' s doing ( inputReevaluationInterval ! = null ) , for time based condition we set the reevaluation interval to match the transition to the next state */
private static DefaultDuration computeReevaluationInterval ( final Integer inputReevaluationInterval , ... | if ( inputReevaluationInterval != null && inputReevaluationInterval > 0 ) { return new DefaultDuration ( ) . setUnit ( TimeUnit . DAYS ) . setNumber ( inputReevaluationInterval ) ; } if ( prevTimeSinceEarliestUnpaidInvoice == - 1 ) { return null ; } Preconditions . checkState ( prevTimeSinceEarliestUnpaidInvoice - curT... |
public class OrderedThreadPoolExecutor { /** * Get the session ' s tasks queue . */
private SessionTasksQueue getSessionTasksQueue ( IoSession session ) { } } | SessionTasksQueue queue = ( SessionTasksQueue ) session . getAttribute ( TASKS_QUEUE ) ; if ( queue == null ) { queue = new SessionTasksQueue ( ) ; SessionTasksQueue oldQueue = ( SessionTasksQueue ) session . setAttributeIfAbsent ( TASKS_QUEUE , queue ) ; if ( oldQueue != null ) { queue = oldQueue ; } } return queue ; |
public class AppMsg { /** * Sets the Animations to be used when displaying / removing the Crouton .
* @ param inAnimation the Animation to be used when displaying .
* @ param outAnimation the Animation to be used when removing . */
public AppMsg setAnimation ( Animation inAnimation , Animation outAnimation ) { } } | mInAnimation = inAnimation ; mOutAnimation = outAnimation ; return this ; |
public class vrid { /** * Use this API to update vrid resources . */
public static base_responses update ( nitro_service client , vrid resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { vrid updateresources [ ] = new vrid [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new vrid ( ) ; updateresources [ i ] . id = resources [ i ] . id ; updateresources [ i ] . priority... |
public class BaseRTMPClientHandler { /** * { @ inheritDoc } */
@ Override protected void onClientBandwidth ( RTMPConnection conn , Channel channel , ClientBW message ) { } } | log . trace ( "onClientBandwidth" ) ; // if the size is not equal to our write size send a server bw control message
int bandwidth = message . getBandwidth ( ) ; if ( bandwidth != bytesWrittenWindow ) { ServerBW serverBw = new ServerBW ( bandwidth ) ; channel . write ( serverBw ) ; } |
public class SamlSettingsApi { /** * Set main settings .
* Change global settings .
* @ return ApiResponse & lt ; PostLocationResponse & gt ;
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public ApiResponse < PostLocationResponse > postLocationWi... | com . squareup . okhttp . Call call = postLocationValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PostLocationResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.