signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class KnowledgeBaseMonitoring { /** * Initialize the open mbean metadata */
private void initOpenMBeanInfo ( ) { } } | OpenMBeanAttributeInfoSupport [ ] attributes = new OpenMBeanAttributeInfoSupport [ 4 ] ; OpenMBeanConstructorInfoSupport [ ] constructors = new OpenMBeanConstructorInfoSupport [ 1 ] ; OpenMBeanOperationInfoSupport [ ] operations = new OpenMBeanOperationInfoSupport [ 2 ] ; MBeanNotificationInfo [ ] notifications = new M... |
public class FieldPath { /** * Encodes a list of field name segments in the server - accepted format . */
private String canonicalString ( ) { } } | ImmutableList < String > segments = getSegments ( ) ; StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < segments . size ( ) ; i ++ ) { if ( i > 0 ) { builder . append ( "." ) ; } // Escape backslashes and backticks .
String escaped = segments . get ( i ) ; escaped = escaped . replace ( "\\" , "\\\\"... |
public class HuLuIndexTool { /** * Lists a 1D array to the System console . */
public static void displayArray ( int [ ] array ) { } } | String line = "" ; for ( int f = 0 ; f < array . length ; f ++ ) { line += array [ f ] + " | " ; } logger . debug ( line ) ; |
public class JSONObject { /** * Add a { @ link JSONLong } representing the supplied { @ code long } to the { @ code JSONObject } .
* @ param key the key to use when storing the value
* @ param value the value
* @ return { @ code this } ( for chaining )
* @ throws NullPointerException if key is { @ code null } *... | put ( key , JSONLong . valueOf ( value ) ) ; return this ; |
public class NodeSet { /** * Insert a node at a given position .
* @ param n Node to be added
* @ param pos Offset at which the node is to be inserted ,
* with 0 being the first position .
* @ throws RuntimeException thrown if this NodeSet is not of
* a mutable type . */
public void insertNode ( Node n , int ... | if ( ! m_mutable ) throw new RuntimeException ( XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_NODESET_NOT_MUTABLE , null ) ) ; // " This NodeSet is not mutable ! " ) ;
insertElementAt ( n , pos ) ; |
public class AbstractStrongCounter { /** * Initializes the weak value .
* @ param currentValue The current value . */
private synchronized void initCounterState ( Long currentValue ) { } } | if ( weakCounter == null ) { weakCounter = currentValue == null ? newCounterValue ( configuration ) : newCounterValue ( currentValue , configuration ) ; } |
public class AdUnit { /** * Sets the adSenseSettings value for this AdUnit .
* @ param adSenseSettings * AdSense specific settings . To overwrite this , set the { @ link
* # adSenseSettingsSource } to
* { @ link PropertySourceType # DIRECTLY _ SPECIFIED } when
* setting the value of this field . */
public void ... | this . adSenseSettings = adSenseSettings ; |
public class JavadocPopup { protected void initLayout ( ) { } } | setOpaque ( false ) ; setBorder ( BorderFactory . createLineBorder ( Scheme . active ( ) . getWindowBorder ( ) ) ) ; GridBagLayout gridBag = new GridBagLayout ( ) ; JPanel pane = new JPanel ( ) ; pane . addMouseListener ( this ) ; pane . addMouseMotionListener ( this ) ; pane . setLayout ( gridBag ) ; GridBagConstraint... |
public class ToastrResourceReference { /** * { @ inheritDoc } */
@ Override public List < HeaderItem > getDependencies ( ) { } } | final List < HeaderItem > dependencies = new ArrayList < HeaderItem > ( ) ; dependencies . add ( CssHeaderItem . forReference ( new CssResourceReference ( ToastrResourceReference . class , "toastr.min.css" ) ) ) ; return dependencies ; |
public class AtomixCluster { /** * Builds a cluster service . */
protected static ManagedClusterMembershipService buildClusterMembershipService ( ClusterConfig config , BootstrapService bootstrapService , NodeDiscoveryProvider discoveryProvider , GroupMembershipProtocol membershipProtocol , Version version ) { } } | // If the local node has not be configured , create a default node .
Member localMember = Member . builder ( ) . withId ( config . getNodeConfig ( ) . getId ( ) ) . withAddress ( config . getNodeConfig ( ) . getAddress ( ) ) . withHostId ( config . getNodeConfig ( ) . getHostId ( ) ) . withRackId ( config . getNodeConf... |
public class ServletHttpResponse { public void addIntHeader ( String name , int value ) { } } | try { _httpResponse . addIntField ( name , value ) ; } catch ( IllegalStateException e ) { LogSupport . ignore ( log , e ) ; } |
public class BrokerHelper { /** * Returns an array containing values for all READ / WRITE attributes of the object
* based on the specified { @ link org . apache . ojb . broker . metadata . ClassDescriptor } .
* < br / >
* NOTE : This method doesn ' t do any checks on the specified { @ link org . apache . ojb . b... | return getValuesForObject ( cld . getAllRwFields ( ) , obj , true ) ; |
public class MethodTimer { /** * Function that register metrics .
* @ param point
* @ return
* @ throws Throwable */
@ Around ( "execution(* *(..)) && @annotation(TimerJ)" ) public Object around ( ProceedingJoinPoint point ) throws Throwable { } } | String methodName = MethodSignature . class . cast ( point . getSignature ( ) ) . getMethod ( ) . getName ( ) ; String methodArgs = point . getArgs ( ) . toString ( ) ; MetricRegistry metricRegistry = Metrics . getRegistry ( ) ; Timer timer ; String metricName = "Starting method " + methodName + "at " + System . nanoTi... |
public class CommerceOrderUtil { /** * Returns the commerce orders before and after the current commerce order in the ordered set where userId = & # 63 ; .
* @ param commerceOrderId the primary key of the current commerce order
* @ param userId the user ID
* @ param orderByComparator the comparator to order the s... | return getPersistence ( ) . findByUserId_PrevAndNext ( commerceOrderId , userId , orderByComparator ) ; |
public class Rewriter { /** * Make sure attempt isn ' t made to specify an accessor method for fields with multiple fragments ,
* since each variable needs unique accessors . */
@ Override public void endVisit ( PropertyAnnotation node ) { } } | FieldDeclaration field = ( FieldDeclaration ) node . getParent ( ) ; TypeMirror fieldType = field . getTypeMirror ( ) ; String getter = node . getGetter ( ) ; String setter = node . getSetter ( ) ; if ( field . getFragments ( ) . size ( ) > 1 ) { if ( getter != null ) { ErrorUtil . error ( field , "@Property getter dec... |
public class BadRequest { /** * < pre >
* Describes all violations in a client request .
* < / pre >
* < code > repeated . google . rpc . BadRequest . FieldViolation field _ violations = 1 ; < / code > */
public com . google . rpc . BadRequest . FieldViolation getFieldViolations ( int index ) { } } | return fieldViolations_ . get ( index ) ; |
public class RowAVLDisk { /** * Used exclusively by Cache to save the row to disk . New implementation in
* 1.7.2 writes out only the Node data if the table row data has not
* changed . This situation accounts for the majority of invocations as for
* each row deleted or inserted , the Nodes for several other rows... | try { writeNodes ( out ) ; if ( hasDataChanged ) { out . writeData ( rowData , tTable . colTypes ) ; out . writeEnd ( ) ; hasDataChanged = false ; } } catch ( IOException e ) { } |
public class Element { /** * Sets the position of the Element in 2D .
* @ param v
* the vertex of the position of the Element */
public void setPosition ( Vector3D v ) { } } | this . x = v . getX ( ) ; this . y = v . getY ( ) ; this . z = v . getZ ( ) ; |
public class VarTypePrinter { /** * * * * * * Following from JEP - 286 Types . java * * * * * */
public Type upward ( Type t , List < Type > vars ) { } } | return t . map ( new TypeProjection ( vars ) , true ) ; |
public class HBeanReferences { /** * Get a particular type of references identified by propertyName into key value
* form .
* @ param schemaName */
public static KeyValue getReferenceKeyValue ( byte [ ] rowkey , String propertyName , String schemaName , List < BeanId > refs , UniqueIds uids ) { } } | final byte [ ] pid = uids . getUsid ( ) . getId ( propertyName ) ; final byte [ ] sid = uids . getUsid ( ) . getId ( schemaName ) ; final byte [ ] qual = new byte [ ] { sid [ 0 ] , sid [ 1 ] , pid [ 0 ] , pid [ 1 ] } ; final byte [ ] iids = getIids2 ( refs , uids ) ; return new KeyValue ( rowkey , REF_COLUMN_FAMILY , q... |
public class FastHashMap { /** * Requires special handling during serialization process .
* @ param stream the object output stream .
* @ throws IOException if an I / O error occurs . */
private void writeObject ( ObjectOutputStream stream ) throws IOException { } } | stream . writeInt ( _capacity ) ; stream . writeInt ( _size ) ; int count = 0 ; EntryImpl < K , V > entry = _mapFirst ; while ( entry != null ) { stream . writeObject ( entry . _key ) ; stream . writeObject ( entry . _value ) ; count ++ ; entry = entry . _after ; } if ( count != _size ) { throw new IOException ( "FastM... |
public class Util { /** * Creates a slug from a string .
* Does not strip markup .
* @ param str The string .
* @ return The slug for the string . */
public static final String slugify ( final String str ) { } } | StringBuilder buf = new StringBuilder ( ) ; boolean lastWasDash = false ; for ( char ch : str . toLowerCase ( ) . trim ( ) . toCharArray ( ) ) { if ( Character . isLetterOrDigit ( ch ) ) { buf . append ( ch ) ; lastWasDash = false ; } else { if ( ! lastWasDash ) { buf . append ( "-" ) ; lastWasDash = true ; } } } Strin... |
public class AmazonDynamoDBWaiters { /** * Builds a TableNotExists waiter by using custom parameters waiterParameters and other parameters defined in the
* waiters specification , and then polls until it determines whether the resource entered the desired state or not ,
* where polling criteria is bound by either d... | return new WaiterBuilder < DescribeTableRequest , DescribeTableResult > ( ) . withSdkFunction ( new DescribeTableFunction ( client ) ) . withAcceptors ( new TableNotExists . IsResourceNotFoundExceptionMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 25 ) , new FixedDelay... |
public class CronTriggerImpl { /** * NOT YET IMPLEMENTED : Returns the time before the given time that this < code > CronTrigger < / code >
* will fire . */
private Date getTimeBefore ( Date endTime ) { } } | return ( cronEx == null ) ? null : cronEx . getTimeBefore ( endTime ) ; |
public class Validator { /** * checks if a bean has been seen before in the dependencyPath . If not , it
* resolves the InjectionPoints and adds the resolved beans to the set of
* beans to be validated */
private static void reallyValidatePseudoScopedBean ( Bean < ? > bean , BeanManagerImpl beanManager , Set < Obje... | // see if we have already seen this bean in the dependency path
if ( dependencyPath . contains ( bean ) ) { // create a list that shows the path to the bean
List < Object > realDependencyPath = new ArrayList < Object > ( dependencyPath ) ; realDependencyPath . add ( bean ) ; throw ValidatorLogger . LOG . pseudoScopedBe... |
public class LNGDoublePriorityQueue { /** * Rescores all priorities by multiplying them with the same factor .
* @ param factor the factor to multiply with */
public void rescore ( double factor ) { } } | for ( int i = 0 ; i < this . prior . size ( ) ; i ++ ) this . prior . set ( i , this . prior . get ( i ) * factor ) ; |
public class VolumeFromMarshaller { /** * Marshall the given parameter object . */
public void marshall ( VolumeFrom volumeFrom , ProtocolMarshaller protocolMarshaller ) { } } | if ( volumeFrom == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( volumeFrom . getSourceContainer ( ) , SOURCECONTAINER_BINDING ) ; protocolMarshaller . marshall ( volumeFrom . getReadOnly ( ) , READONLY_BINDING ) ; } catch ( Exception e ) ... |
public class MethodIntrospector { /** * Returns a { @ link MethodIntrospector } implementation for the given environment . */
public static MethodIntrospector instance ( ProcessingEnvironment env ) { } } | try { try { return JavacMethodIntrospector . instance ( env ) ; } catch ( LinkageError e ) { return ( MethodIntrospector ) IntrospectorClassLoader . create ( MethodIntrospector . class , env ) . loadClass ( JAVAC_METHOD_INTROSPECTOR ) . getMethod ( "instance" , ProcessingEnvironment . class ) . invoke ( null , env ) ; ... |
public class LoggingHelper { /** * Helper method for formatting connection establishment messages .
* @ param connectionName
* The name of the connection
* @ param host
* The remote host
* @ param connectionReason
* The reason for establishing the connection
* @ return A formatted message in the format : ... | return CON_ESTABLISHMENT_FORMAT . format ( new Object [ ] { connectionName , host , connectionReason } ) ; |
public class JAXBHandle { /** * Returns the unmarshaller that converts a tree data structure
* from XML to Java objects .
* @ param reusewhether to reuse an existing unmarshaller
* @ returnthe unmarshaller for the JAXB context
* @ throws JAXBException if unmarshaller initialization fails */
public Unmarshaller ... | if ( ! reuse || unmarshaller == null ) { unmarshaller = context . createUnmarshaller ( ) ; } return unmarshaller ; |
public class StoreRoutingPlan { /** * Checks if a given partition is stored in the node .
* @ param partition
* @ param nodeId
* @ param cluster
* @ param storeDef
* @ return true if partition belongs to node for given store */
public static boolean checkPartitionBelongsToNode ( int partition , int nodeId , C... | List < Integer > nodePartitions = cluster . getNodeById ( nodeId ) . getPartitionIds ( ) ; List < Integer > replicatingPartitions = new RoutingStrategyFactory ( ) . updateRoutingStrategy ( storeDef , cluster ) . getReplicatingPartitionList ( partition ) ; replicatingPartitions . retainAll ( nodePartitions ) ; return re... |
public class MySqlConnectionPoolBuilder { /** * Warning - Use only when the connection string is in host : port format without schema and other parameter .
* example : mydb . company . com : 3308
* @ param connectionString host : port
* @ param username user name for login . */
public static MySqlConnectionPoolBu... | final String [ ] arr = connectionString . split ( ":" ) ; final String host = arr [ 0 ] ; final int port = Integer . parseInt ( arr [ 1 ] ) ; return newBuilder ( host , port , username ) ; |
public class Channel { /** * Unregister an existing chaincode event listener .
* @ param handle Chaincode event listener handle to be unregistered .
* @ return True if the chaincode handler was found and removed .
* @ throws InvalidArgumentException */
public boolean unregisterChaincodeEventListener ( String hand... | boolean ret ; if ( shutdown ) { throw new InvalidArgumentException ( format ( "Channel %s has been shutdown." , name ) ) ; } checkHandle ( CHAINCODE_EVENTS_TAG , handle ) ; synchronized ( chainCodeListeners ) { ret = null != chainCodeListeners . remove ( handle ) ; } synchronized ( this ) { if ( null != blh && chainCod... |
public class ClassIntrospectorImpl { /** * Returns the annotation of the annotationClass of the clazz or any of it super classes .
* @ param clazz
* The class to inspect .
* @ param annotationClass
* Class of the annotation to return
* @ return The annotation of annnotationClass if found else null . */
@ Over... | return AnnotationUtils . getAnnotation ( target , annotationClass ) ; |
public class COSInputStream { /** * Seek without raising any exception . This is for use in
* { @ code finally } clauses
* @ param positiveTargetPos a target position which must be positive */
private void seekQuietly ( long positiveTargetPos ) { } } | try { seek ( positiveTargetPos ) ; } catch ( IOException ioe ) { LOG . debug ( "Ignoring IOE on seek of {} to {}" , uri , positiveTargetPos , ioe ) ; } |
public class DefaultConfigurationProvider { /** * Saving a map into preferences , using a prefix for the prefs keys
* @ since 5.6.5
* @ param pPrefs
* @ param pEdit
* @ param pMap
* @ param pPrefix */
private static void save ( final SharedPreferences pPrefs , final SharedPreferences . Editor pEdit , final Ma... | for ( final String key : pPrefs . getAll ( ) . keySet ( ) ) { if ( key . startsWith ( pPrefix ) ) { pEdit . remove ( key ) ; } } for ( final Map . Entry < String , String > entry : pMap . entrySet ( ) ) { final String key = pPrefix + entry . getKey ( ) ; pEdit . putString ( key , entry . getValue ( ) ) ; } |
public class AbstractObservable { /** * Notify all changes of the observable to all observers only if the observable has changed .
* Because of data encapsulation reasons this method is not included within the Observer
* interface .
* Attention ! This method is not thread safe against changes of the observable be... | synchronized ( NOTIFICATION_MESSAGE_LOCK ) { long wholeTime = System . currentTimeMillis ( ) ; if ( observable == null ) { LOGGER . debug ( "Skip notification because observable is null!" ) ; return false ; } ExceptionStack exceptionStack = null ; final Map < Observer < S , T > , Future < Void > > notificationFutureLis... |
public class TransactionImpl { /** * Prepare does the actual work of moving the changes at the object level
* into storage ( the underlying rdbms for instance ) . prepare Can be called multiple times , and
* does not release locks .
* @ throws TransactionAbortedException if the transaction has been aborted
* fo... | if ( txStatus == Status . STATUS_MARKED_ROLLBACK ) { throw new TransactionAbortedExceptionOJB ( "Prepare Transaction: tx already marked for rollback" ) ; } if ( txStatus != Status . STATUS_ACTIVE ) { throw new IllegalStateException ( "Prepare Transaction: tx status is not 'active', status is " + TxUtil . getStatusStrin... |
public class CronUtil { /** * 开始
* @ param isDeamon 是否以守护线程方式启动 , 如果为true , 则在调用 { @ link # stop ( ) } 方法后执行的定时任务立即结束 , 否则等待执行完毕才结束 。 */
synchronized public static void start ( boolean isDeamon ) { } } | if ( null == crontabSetting ) { // 尝试查找config / cron . setting
setCronSetting ( CRONTAB_CONFIG_PATH ) ; } // 尝试查找cron . setting
if ( null == crontabSetting ) { setCronSetting ( CRONTAB_CONFIG_PATH2 ) ; } if ( scheduler . isStarted ( ) ) { throw new UtilException ( "Scheduler has been started, please stop it first!" ) ;... |
public class JavaURLContext { /** * Returns " java : "
* @ return { @ link NamingConstants . JAVA _ NS } */
@ Override public String getNameInNamespace ( ) throws NamingException { } } | return base == null ? NamingConstants . JAVA_NS : base . toString ( ) ; |
public class RepositoryApplicationConfiguration { /** * { @ link JpaTenantConfigurationManagement } bean .
* @ return a new { @ link TenantConfigurationManagement } */
@ Bean @ ConditionalOnMissingBean TargetManagement targetManagement ( final EntityManager entityManager , final QuotaManagement quotaManagement , fina... | return new JpaTargetManagement ( entityManager , quotaManagement , targetRepository , targetMetadataRepository , rolloutGroupRepository , distributionSetRepository , targetFilterQueryRepository , targetTagRepository , criteriaNoCountDao , eventPublisher , bus , tenantAware , afterCommit , virtualPropertyReplacer , prop... |
public class JsonSerializationProcessor { /** * Returns true if the given document should be included in the
* serialization .
* @ param itemDocument
* the document to check
* @ return true if the document should be serialized */
private boolean includeDocument ( ItemDocument itemDocument ) { } } | for ( StatementGroup sg : itemDocument . getStatementGroups ( ) ) { // " P19 " is " place of birth " on Wikidata
if ( ! "P19" . equals ( sg . getProperty ( ) . getId ( ) ) ) { continue ; } for ( Statement s : sg ) { if ( s . getMainSnak ( ) instanceof ValueSnak ) { Value v = s . getValue ( ) ; // " Q1731 " is " Dresden... |
public class DacGpioProviderBase { /** * Set the shutdown / terminate value that the DAC should apply to the given GPIO pin
* when the class is destroyed / terminated .
* @ param value the shutdown value to apply to the given pin ( s )
* @ param pin analog output pin ( vararg : one or more pins ) */
public void s... | for ( Pin p : pin ) { shutdownValues [ p . getAddress ( ) ] = value . doubleValue ( ) ; } |
public class HndlAccVarsRequest { /** * < p > Handle request . < / p >
* @ param pReqVars Request scoped variables
* @ param pRequestData Request Data
* @ throws Exception - an exception */
@ Override public final void handle ( final Map < String , Object > pReqVars , final IRequestData pRequestData ) throws Exce... | AccSettings as = srvAccSettings . lazyGetAccSettings ( pReqVars ) ; String curSign ; if ( as . getUseCurrencySign ( ) ) { curSign = as . getCurrency ( ) . getItsSign ( ) ; } else { curSign = " " + as . getCurrency ( ) . getItsName ( ) + " " ; } pReqVars . put ( "quantityDp" , as . getQuantityPrecision ( ) ) ; pReqVars ... |
public class DBCluster { /** * Provides the list of option group memberships for this DB cluster .
* @ return Provides the list of option group memberships for this DB cluster . */
public java . util . List < DBClusterOptionGroupStatus > getDBClusterOptionGroupMemberships ( ) { } } | if ( dBClusterOptionGroupMemberships == null ) { dBClusterOptionGroupMemberships = new com . amazonaws . internal . SdkInternalList < DBClusterOptionGroupStatus > ( ) ; } return dBClusterOptionGroupMemberships ; |
public class CellList2TupleFunction { /** * { @ inheritDoc } */
@ Override public Tuple2 < Cells , Cells > apply ( Cells cells ) { } } | Cells keys = cells . getIndexCells ( ) ; Cells values = cells . getValueCells ( ) ; return new Tuple2 < > ( keys , values ) ; |
public class PyExpressionGenerator { /** * Generate the given object .
* @ param literal the null literal .
* @ param it the target for the generated content .
* @ param context the context .
* @ return the literal . */
@ SuppressWarnings ( "static-method" ) protected XExpression _generate ( XNullLiteral litera... | appendReturnIfExpectedReturnedExpression ( it , context ) ; it . append ( "None" ) ; // $ NON - NLS - 1 $
return literal ; |
public class BarrierBuffer { /** * Blocks the given channel index , from which a barrier has been received .
* @ param channelIndex The channel index to block . */
private void onBarrier ( int channelIndex ) throws IOException { } } | if ( ! blockedChannels [ channelIndex ] ) { blockedChannels [ channelIndex ] = true ; numBarriersReceived ++ ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "{}: Received barrier from channel {}." , inputGate . getOwningTaskName ( ) , channelIndex ) ; } } else { throw new IOException ( "Stream corrupt: Repeated barri... |
public class CellPosition { /** * CellAddressのインスタンスを作成する 。
* @ param row 行番号 ( 0から始まる )
* @ param column 列番号 ( 0から始まる )
* @ return { @ link CellPosition } のインスタンス
* @ throws IllegalArgumentException { @ literal row < 0 | | column < 0} */
public static CellPosition of ( int row , int column ) { } } | ArgUtils . notMin ( row , 0 , "row" ) ; ArgUtils . notMin ( column , 0 , "column" ) ; return new CellPosition ( row , column ) ; |
public class DateTimeDialogFragment { /** * < p > Called when the user clicks outside the dialog or presses the < b > Back < / b >
* button . < / p >
* < p > < b > Note : < / b > Actual < b > Cancel < / b > button clicks are handled by { @ code mCancelButton } ' s
* event handler . < / p > */
@ Override public vo... | super . onCancel ( dialog ) ; if ( mListener == null ) { throw new NullPointerException ( "Listener no longer exists in onCancel()" ) ; } mListener . onDateTimeCancel ( ) ; |
public class ChannelUtil { /** * Returns a list of { @ link Channel } built from the list of
* { @ link Channel . Builder } s
* @ param channelBuilders
* - list of Channel . Builder to be built .
* @ return Collection of { @ link Channel } built from the channelBuilders */
public static Collection < Channel > t... | Collection < Channel > channels = new HashSet < Channel > ( ) ; for ( Channel . Builder builder : channelBuilders ) { channels . add ( builder . build ( ) ) ; } return Collections . unmodifiableCollection ( channels ) ; |
public class RaftContext { /** * Compacts the server logs .
* @ return a future to be completed once the logs have been compacted */
public CompletableFuture < Void > compact ( ) { } } | ComposableFuture < Void > future = new ComposableFuture < > ( ) ; threadContext . execute ( ( ) -> stateMachine . compact ( ) . whenComplete ( future ) ) ; return future ; |
public class Character { /** * Converts the specified character ( Unicode code point ) to its
* UTF - 16 representation . If the specified code point is a BMP
* ( Basic Multilingual Plane or Plane 0 ) value , the same value is
* stored in { @ code dst [ dstIndex ] } , and 1 is returned . If the
* specified code... | if ( isBmpCodePoint ( codePoint ) ) { dst [ dstIndex ] = ( char ) codePoint ; return 1 ; } else if ( isValidCodePoint ( codePoint ) ) { toSurrogates ( codePoint , dst , dstIndex ) ; return 2 ; } else { throw new IllegalArgumentException ( ) ; } |
public class MqttMessagingSkeleton { /** * the communication , e . g . a reply message must not be dropped */
private boolean isRequestMessageTypeThatCanBeDropped ( String messageType ) { } } | if ( messageType . equals ( Message . VALUE_MESSAGE_TYPE_REQUEST ) || messageType . equals ( Message . VALUE_MESSAGE_TYPE_ONE_WAY ) ) { return true ; } return false ; |
public class PageFlowControlContainerFactory { /** * This is a generic routine that will retrieve a value from the Session through the
* StorageHandler .
* @ param request
* @ param servletContext
* @ param name The name of the value to be retrieved
* @ return The requested value from the session */
private s... | StorageHandler sh = Handlers . get ( servletContext ) . getStorageHandler ( ) ; HttpServletRequest unwrappedRequest = PageFlowUtils . unwrapMultipart ( request ) ; RequestContext rc = new RequestContext ( unwrappedRequest , null ) ; String attrName = ScopedServletUtils . getScopedSessionAttrName ( name , unwrappedReque... |
public class LearnTool { /** * 增加一个新词到树中
* @ param newWord */
public void addTerm ( NewWord newWord ) { } } | NewWord temp = null ; SmartForest < NewWord > smartForest = null ; if ( ( smartForest = sf . getBranch ( newWord . getName ( ) ) ) != null && smartForest . getParam ( ) != null ) { temp = smartForest . getParam ( ) ; temp . update ( newWord . getNature ( ) , newWord . getAllFreq ( ) ) ; } else { count ++ ; if ( splitWo... |
public class HelloDory { /** * Add data to Movies and Actors tables . */
private void addData ( DoradusClient client ) { } } | // Now that the application is created , set the application name in the session so
// we don ' t have to call . withParam ( " application " , " HelloSpider " ) for each command .
client . setApplication ( "HelloSpider" ) ; // Add a batch of Movies , including links to Actors not yet inserted
DBObjectBatch dbObjBatch =... |
public class ExampleImageStitching { /** * Given two input images create and display an image where the two have been overlayed on top of each other . */
public static < T extends ImageGray < T > > void stitch ( BufferedImage imageA , BufferedImage imageB , Class < T > imageType ) { } } | T inputA = ConvertBufferedImage . convertFromSingle ( imageA , null , imageType ) ; T inputB = ConvertBufferedImage . convertFromSingle ( imageB , null , imageType ) ; // Detect using the standard SURF feature descriptor and describer
DetectDescribePoint detDesc = FactoryDetectDescribe . surfStable ( new ConfigFastHess... |
public class Logger { /** * Issue a log message with a level of FATAL using { @ link java . text . MessageFormat } - style formatting .
* @ param format the message format string
* @ param params the parameters */
public void fatalv ( String format , Object ... params ) { } } | doLog ( Level . FATAL , FQCN , format , params , null ) ; |
public class Promise { /** * Blocks until a result is available , or timeout milliseconds have elapsed . Needs to be called with lock held
* @ param timeout in ms
* @ return An object
* @ throws TimeoutException If a timeout occurred ( implies that timeout > 0) */
protected T _getResultWithTimeout ( final long ti... | if ( timeout <= 0 ) cond . waitFor ( this :: hasResult ) ; else if ( ! cond . waitFor ( this :: hasResult , timeout , TimeUnit . MILLISECONDS ) ) throw new TimeoutException ( ) ; return result ; |
public class LMAlgoFactoryDecorator { /** * This method calculates the landmark data for all weightings ( optionally in parallel ) or if already existent loads it .
* @ return true if the preparation data for at least one weighting was calculated .
* @ see com . graphhopper . routing . ch . CHAlgoFactoryDecorator #... | ExecutorCompletionService completionService = new ExecutorCompletionService < > ( threadPool ) ; int counter = 0 ; final AtomicBoolean prepared = new AtomicBoolean ( false ) ; for ( final PrepareLandmarks plm : preparations ) { counter ++ ; final int tmpCounter = counter ; final String name = AbstractWeighting . weight... |
public class DObject { /** * Adds an event listener to this object . The listener will be notified when any events are
* dispatched on this object that match their particular listener interface .
* < p > Note that the entity adding itself as a listener should have obtained the object
* reference by subscribing to... | // only add the listener if they ' re not already there
int idx = getListenerIndex ( listener ) ; if ( idx == - 1 ) { _listeners = ListUtil . add ( _listeners , weak ? new WeakReference < Object > ( listener ) : listener ) ; return ; } boolean oweak = _listeners [ idx ] instanceof WeakReference < ? > ; if ( weak == owe... |
public class ListSecurityProfilesForTargetResult { /** * A list of security profiles and their associated targets .
* @ param securityProfileTargetMappings
* A list of security profiles and their associated targets . */
public void setSecurityProfileTargetMappings ( java . util . Collection < SecurityProfileTargetM... | if ( securityProfileTargetMappings == null ) { this . securityProfileTargetMappings = null ; return ; } this . securityProfileTargetMappings = new java . util . ArrayList < SecurityProfileTargetMapping > ( securityProfileTargetMappings ) ; |
public class PersonViewHolder { /** * Optionally override onSetListeners to add listeners to the views . */
@ Override public void onSetListeners ( ) { } } | imageViewPerson . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { PersonHolderListener listener = getListener ( PersonHolderListener . class ) ; if ( listener != null ) { listener . onPersonImageClicked ( getItem ( ) ) ; } } } ) ; |
public class AbstractElement { /** * Sets the value of a property with the added restriction that no other vertex can have that property .
* @ param key The key of the unique property to mutate
* @ param value The new value of the unique property */
public void propertyUnique ( P key , String value ) { } } | GraphTraversal < Vertex , Vertex > traversal = tx ( ) . getTinkerTraversal ( ) . V ( ) . has ( key . name ( ) , value ) ; if ( traversal . hasNext ( ) ) { Vertex vertex = traversal . next ( ) ; if ( ! vertex . equals ( element ( ) ) || traversal . hasNext ( ) ) { if ( traversal . hasNext ( ) ) vertex = traversal . next... |
public class PromotionFeedItem { /** * Gets the ordersOverAmount value for this PromotionFeedItem .
* @ return ordersOverAmount * Orders over amount . Optional .
* Cannot set both ordersOverAmount and promotionCode . */
public com . google . api . ads . adwords . axis . v201809 . cm . MoneyWithCurrency getOrdersOve... | return ordersOverAmount ; |
public class Vector { /** * Checks whether this vector compiles with given { @ code predicate } or not .
* @ param predicate the vector predicate
* @ return whether this vector compiles with predicate */
public boolean is ( VectorPredicate predicate ) { } } | boolean result = true ; VectorIterator it = iterator ( ) ; while ( it . hasNext ( ) ) { double x = it . next ( ) ; int i = it . index ( ) ; result = result && predicate . test ( i , x ) ; } return result ; |
public class TemplateDrivenMultiBranchProject { /** * Overrides view initialization to use BranchListView instead of AllView .
* < br >
* { @ inheritDoc } */
@ Override protected void initViews ( List < View > views ) throws IOException { } } | BranchListView v = new BranchListView ( "All" , this ) ; v . setIncludeRegex ( ".*" ) ; views . add ( v ) ; v . save ( ) ; |
public class JsiiRuntime { /** * Starts jsii - server as a child process if it is not already started . */
private void startRuntimeIfNeeded ( ) { } } | if ( childProcess != null ) { return ; } // If JSII _ DEBUG is set , enable traces .
String jsiiDebug = System . getenv ( "JSII_DEBUG" ) ; if ( jsiiDebug != null && ! jsiiDebug . isEmpty ( ) && ! jsiiDebug . equalsIgnoreCase ( "false" ) && ! jsiiDebug . equalsIgnoreCase ( "0" ) ) { traceEnabled = true ; } // If JSII _ ... |
public class ForkJoinPool { /** * Tries to activate or create a worker if too few are active . */
final void signalWork ( ) { } } | long c ; int u ; while ( ( u = ( int ) ( ( c = ctl ) >>> 32 ) ) < 0 ) { // too few active
WorkQueue [ ] ws = workQueues ; int e , i ; WorkQueue w ; Thread p ; if ( ( e = ( int ) c ) > 0 ) { // at least one waiting
if ( ws != null && ( i = e & SMASK ) < ws . length && ( w = ws [ i ] ) != null && w . eventCount == ( e | ... |
public class LogRepositoryComponent { /** * Stops repository manager and unregisters LogRepository handler registered
* during { @ link # start ( ) } call . This method should be called on server
* shutdown . */
public static synchronized void stop ( ) { } } | // WsHandlerManager manager = ManagerAdmin . getWsHandlerManager ( ) ;
if ( svSuperPid != null ) { LogRepositoryManager destManager = getManager ( LogRepositoryBaseImpl . LOGTYPE ) ; ( ( LogRepositorySubManagerImpl ) destManager ) . inactivateSubProcess ( ) ; } Logger manager = Logger . getLogger ( "" ) ; if ( binaryHa... |
public class FacesContextImplBase { /** * Returns a mutable map of attributes associated with this faces context when
* { @ link javax . faces . context . FacesContext . release } is called the map must be cleared !
* Note this map is not associated with the request map the request map still is accessible via the
... | assertNotReleased ( ) ; if ( _attributes == null ) { _attributes = new HashMap < Object , Object > ( ) ; } return _attributes ; |
public class BTools { /** * public static String getSIntA ( int [ ] intA ) { */
public static String getSIntA ( int ... intA ) { } } | String Info = "" ; if ( intA == null ) return "?" ; if ( intA . length == 0 ) return "?" ; for ( int K = 0 ; K < intA . length ; K ++ ) { Info += ( Info . isEmpty ( ) ) ? "" : ", " ; Info += BTools . getSInt ( intA [ K ] ) ; } return Info ; |
public class CharacterRangeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public NotificationChain basicSetRight ( Keyword newRight , NotificationChain msgs ) { } } | Keyword oldRight = right ; right = newRight ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , XtextPackage . CHARACTER_RANGE__RIGHT , oldRight , newRight ) ; if ( msgs == null ) msgs = notification ; else msgs . add ( notification ) ; } return msgs... |
public class ErlangDistributionTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case BpsimPackage . ERLANG_DISTRIBUTION_TYPE__K : return getK ( ) ; case BpsimPackage . ERLANG_DISTRIBUTION_TYPE__MEAN : return getMean ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class KeyValueLocator { /** * Calculate the vbucket for the given key .
* @ param key the key to calculate from .
* @ param numPartitions the number of partitions in the bucket .
* @ return the calculated partition . */
private static int partitionForKey ( byte [ ] key , int numPartitions ) { } } | CRC32 crc32 = new CRC32 ( ) ; crc32 . update ( key ) ; long rv = ( crc32 . getValue ( ) >> 16 ) & 0x7fff ; return ( int ) rv & numPartitions - 1 ; |
public class DatalogConversionTools { /** * TODO : explain */
public DataNode createDataNode ( IntermediateQueryFactory iqFactory , DataAtom dataAtom , Collection < Predicate > tablePredicates ) { } } | if ( tablePredicates . contains ( dataAtom . getPredicate ( ) ) ) { return iqFactory . createExtensionalDataNode ( dataAtom ) ; } return iqFactory . createIntensionalDataNode ( dataAtom ) ; |
public class Parser { /** * add : = add ( & lt ; PLUS & gt ; mul | & lt ; MINUS & gt ; mul ) * */
protected AstNode add ( boolean required ) throws ScanException , ParseException { } } | AstNode v = mul ( required ) ; if ( v == null ) { return null ; } while ( true ) { switch ( token . getSymbol ( ) ) { case PLUS : consumeToken ( ) ; v = createAstBinary ( v , mul ( true ) , AstBinary . ADD ) ; break ; case MINUS : consumeToken ( ) ; v = createAstBinary ( v , mul ( true ) , AstBinary . SUB ) ; break ; c... |
public class AvailableDelegationsInner { /** * Gets all of the available subnet delegations for this subscription in this region .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the o... | return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < AvailableDelegationInner > > , Page < AvailableDelegationInner > > ( ) { @ Override public Page < AvailableDelegationInner > call ( ServiceResponse < Page < AvailableDelegationInner > > response ) { return response . b... |
public class FacebookJsonRestClient { /** * Extracts a URL from a result that consists of a URL only .
* For JSON , that result is simply a String .
* @ param url
* @ return the URL */
protected URL extractURL ( Object url ) throws IOException { } } | if ( ! ( url instanceof String ) ) { return null ; } return ( null == url || "" . equals ( url ) ) ? null : new URL ( ( String ) url ) ; |
public class ImageFilter { /** * Tests if the filter should do image filtering / processing .
* This default implementation uses { @ link # triggerParams } to test if :
* < dl >
* < dt > { @ code mTriggerParams = = null } < / dt >
* < dd > { @ code return true } < / dd >
* < dt > { @ code mTriggerParams ! = n... | // If triggerParams not set , assume always trigger
if ( triggerParams == null ) { return true ; } // Trigger only for certain request parameters
for ( String triggerParam : triggerParams ) { if ( pRequest . getParameter ( triggerParam ) != null ) { return true ; } } // Didn ' t trigger
return false ; |
public class DelegatingHttpEntityMessageConverter { /** * Sets the binaryMediaTypes .
* @ param binaryMediaTypes */
public void setBinaryMediaTypes ( List < MediaType > binaryMediaTypes ) { } } | requestMessageConverters . stream ( ) . filter ( converter -> converter instanceof ByteArrayHttpMessageConverter ) . map ( ByteArrayHttpMessageConverter . class :: cast ) . forEach ( converter -> converter . setSupportedMediaTypes ( binaryMediaTypes ) ) ; responseMessageConverters . stream ( ) . filter ( converter -> c... |
public class MortarScopeDevHelper { /** * Format the scope hierarchy as a multi line string containing the scope names .
* Can be given any scope in the hierarchy , will always print the whole scope hierarchy .
* Also prints the Dagger modules containing entry points ( injects ) . We ' ve only tested this with
* ... | StringBuilder result = new StringBuilder ( "Mortar Hierarchy:\n" ) ; MortarScope rootScope = getRootScope ( mortarScope ) ; Node rootNode = new MortarScopeNode ( rootScope ) ; nodeHierarchyToString ( result , 0 , 0 , rootNode ) ; return result . toString ( ) ; |
public class ClassProcessorTask { /** * / * package private */
boolean isAlreadyProcessed ( final CtClass ctClass , final ClassProcessor processor ) { } } | final ClassFile classFile = ctClass . getClassFile ( ) ; AnnotationsAttribute annotationAttribute = null ; for ( final Object attributeObject : classFile . getAttributes ( ) ) { if ( attributeObject instanceof AnnotationsAttribute ) { annotationAttribute = ( AnnotationsAttribute ) attributeObject ; final Annotation ann... |
public class PropertyCollection { /** * Returns an integer property value .
* @ param name Property name .
* @ param dflt Default value if a property value is not found .
* @ return Property value or default value if property value not found . */
public int getValue ( String name , int dflt ) { } } | try { return Integer . parseInt ( getValue ( name , Integer . toString ( dflt ) ) ) ; } catch ( Exception e ) { return dflt ; } |
public class WFG9 { /** * WFG9 t2 transformation */
public float [ ] t2 ( float [ ] z , int k ) { } } | float [ ] result = new float [ z . length ] ; for ( int i = 0 ; i < k ; i ++ ) { result [ i ] = ( new Transformations ( ) ) . sDecept ( z [ i ] , ( float ) 0.35 , ( float ) 0.001 , ( float ) 0.05 ) ; } for ( int i = k ; i < z . length ; i ++ ) { result [ i ] = ( new Transformations ( ) ) . sMulti ( z [ i ] , 30 , 95 , ... |
public class BMMImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . BMM__MM_NAME : return MM_NAME_EDEFAULT == null ? mmName != null : ! MM_NAME_EDEFAULT . equals ( mmName ) ; case AfplibPackage . BMM__TRIPLETS : return triplets != null && ! triplets . isEmpty ( ) ; } return super . eIsSet ( featureID ) ; |
public class XBProjector { /** * { @ inheritDoc } */
@ Override @ SuppressWarnings ( "unchecked" ) @ Scope ( DocScope . IO ) public < T > T projectDOMNode ( final Node documentOrElement , final Class < T > projectionInterface ) { } } | ensureIsValidProjectionInterface ( projectionInterface ) ; if ( documentOrElement == null ) { throw new IllegalArgumentException ( "Parameter node must not be null" ) ; } final Map < Class < ? > , Object > mixinsForProjection = mixins . containsKey ( projectionInterface ) ? Collections . unmodifiableMap ( mixins . get ... |
public class CmsHtmlImport { /** * Tests if all given input parameters for the HTML Import are valid , that is that all the
* given folders do exist . < p >
* @ param fi a file item if a file is uploaded per HTTP otherwise < code > null < / code >
* @ param isdefault if this sets , then the destination and input ... | // check the input directory and the HTTP upload file
if ( fi == null ) { if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( m_inputDir ) && ! isdefault ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . GUI_HTMLIMPORT_INPUTDIR_1 , m_inputDir ) ) ; } else if ( ! CmsStringUtil . isEmptyO... |
public class AbstractStreamEx { /** * Returns the minimum element of this stream according to the double values
* extracted by provided function . This is a special case of a reduction .
* This is a terminal operation .
* This method is equivalent to
* { @ code min ( Comparator . comparingDouble ( keyExtractor ... | return Box . asOptional ( reduce ( null , ( ObjDoubleBox < T > acc , T t ) -> { double val = keyExtractor . applyAsDouble ( t ) ; if ( acc == null ) return new ObjDoubleBox < > ( t , val ) ; if ( Double . compare ( val , acc . b ) < 0 ) { acc . b = val ; acc . a = t ; } return acc ; } , ( ObjDoubleBox < T > acc1 , ObjD... |
public class TypeAnnotationPosition { /** * Create a { @ code TypeAnnotationPosition } for a throws clause .
* @ param location The type path .
* @ param type _ index The index of the exception . */
public static TypeAnnotationPosition methodThrows ( final List < TypePathEntry > location , final int type_index ) { ... | return methodThrows ( location , null , type_index , - 1 ) ; |
public class EditsVisitor { /** * Convenience shortcut method to parse a specific token type */
public ShortToken visitShort ( EditsElement e ) throws IOException { } } | return ( ShortToken ) visit ( tokenizer . read ( new ShortToken ( e ) ) ) ; |
public class NullAssigner { /** * { @ inheritDoc } */
@ Override public Object newGroupVariable ( final CmdLineCLA group , final Object target , final ICmdLineArg < ? > factoryValueArg ) throws ParseException { } } | return null ; |
public class AStar { /** * Set the tool that permits to retreive the orinetation of the segments .
* @ param tool the tool for retreiving the orientation of the segments .
* @ return the old tool . */
public AStarSegmentOrientation < ST , PT > setSegmentOrientationTool ( AStarSegmentOrientation < ST , PT > tool ) {... | final AStarSegmentOrientation < ST , PT > old = this . segmentOrientation ; this . segmentOrientation = tool ; return old ; |
public class WRowExample { /** * Creates a row containing columns with the given widths .
* @ param hgap the horizontal gap between columns , in pixels .
* @ param colWidths the percentage widths for each column .
* @ return a WRow containing columns with the given widths . */
private WRow createRow ( final int h... | WRow row = new WRow ( hgap ) ; for ( int i = 0 ; i < colWidths . length ; i ++ ) { WColumn col = new WColumn ( colWidths [ i ] ) ; WPanel box = new WPanel ( WPanel . Type . BOX ) ; box . add ( new WText ( colWidths [ i ] + "%" ) ) ; col . add ( box ) ; row . add ( col ) ; } return row ; |
public class IntIntHashMultiMap { /** * { @ inheritDoc } */
public boolean containsMapping ( int key , int value ) { } } | IntSet s = map . get ( key ) ; return s != null && s . contains ( value ) ; |
public class QDate { /** * Gets values based on a field . */
public long get ( int field ) { } } | switch ( field ) { case TIME : return getLocalTime ( ) ; case YEAR : return getYear ( ) ; case MONTH : return getMonth ( ) ; case DAY_OF_MONTH : return getDayOfMonth ( ) ; case DAY : return getDayOfWeek ( ) ; case DAY_OF_WEEK : return getDayOfWeek ( ) ; case HOUR : return getHour ( ) ; case MINUTE : return getMinute ( ... |
public class EmbeddedMongoDB { /** * Sets the version for the EmbeddedMongoDB instance
* Default is Version . Main . PRODUCTION
* @ param version The version to set
* @ return EmbeddedMongoDB instance */
public EmbeddedMongoDB withVersion ( Version . Main version ) { } } | Objects . requireNonNull ( version , "version can not be null" ) ; this . version = version ; return this ; |
public class InterfaceMeta { /** * Scans this type for { @ link Interface } annotations and creates a native context if possible .
* @ param type Any Java type .
* @ return The associated { @ link InterfaceMeta } or { @ link # NO _ INTERFACE } if the type does not have a wayland interface
* associated with it . *... | InterfaceMeta interfaceMeta = INTERFACE_MAP . get ( type ) ; if ( interfaceMeta == null ) { final Interface waylandInterface = type . getAnnotation ( Interface . class ) ; if ( waylandInterface == null ) { interfaceMeta = NO_INTERFACE ; } else { interfaceMeta = create ( waylandInterface . name ( ) , waylandInterface . ... |
public class MagicMimeEntry { /** * Match long .
* @ param bbuf the bbuf
* @ param bo the bo
* @ param needMask the need mask
* @ param lMask the l mask
* @ return true , if successful
* @ throws IOException Signals that an I / O exception has occurred . */
private boolean matchLong ( final ByteBuffer bbuf ... | bbuf . order ( bo ) ; long got ; final String testContent = getContent ( ) ; if ( testContent . startsWith ( "0x" ) ) { got = Long . parseLong ( testContent . substring ( 2 ) , 16 ) ; } else if ( testContent . startsWith ( "&" ) ) { got = Long . parseLong ( testContent . substring ( 3 ) , 16 ) ; } else { got = Long . p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.