signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class MeasureUnitUtil { /** * Convert the given value expressed in the given unit to meters per second .
* @ param value is the value to convert
* @ param inputUnit is the unit of the { @ code value }
* @ return the result of the convertion . */
@ Pure public static double toMetersPerSecond ( double value ... | switch ( inputUnit ) { case KILOMETERS_PER_HOUR : return 3.6 * value ; case MILLIMETERS_PER_SECOND : return value / 1000. ; case METERS_PER_SECOND : default : } return value ; |
public class VarTupleSet { /** * Removes the given tuple from use in test cases . */
public void remove ( Tuple tuple ) { } } | int i = unused_ . indexOf ( tuple ) ; if ( i >= 0 ) { unused_ . remove ( tuple ) ; } |
public class Blacklist { /** * Dumps data to the given file .
* @ param filename output file name */
public void write ( String filename ) { } } | try { write ( new FileOutputStream ( filename ) ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } |
public class GetResourceRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetResourceRequest getResourceRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getResourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getResourceRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( getResourceRequest . getResourceId ( ) , RESOURCEID_BINDING ) ; protocol... |
public class DeviceManagerClient { /** * Creates a device in a device registry .
* < p > Sample code :
* < pre > < code >
* try ( DeviceManagerClient deviceManagerClient = DeviceManagerClient . create ( ) ) {
* RegistryName parent = RegistryName . of ( " [ PROJECT ] " , " [ LOCATION ] " , " [ REGISTRY ] " ) ;
... | CreateDeviceRequest request = CreateDeviceRequest . newBuilder ( ) . setParent ( parent ) . setDevice ( device ) . build ( ) ; return createDevice ( request ) ; |
public class AbstractMfClientHttpRequestFactoryWrapper { /** * This implementation simply calls { @ link # createRequest ( URI , HttpMethod , MfClientHttpRequestFactory ) }
* ( if the matchers are OK ) with the wrapped request factory provided to the { @ linkplain
* # AbstractMfClientHttpRequestFactoryWrapper ( MfC... | if ( uri . getScheme ( ) == null || uri . getScheme ( ) . equals ( "file" ) || this . matchers . matches ( uri , httpMethod ) ) { return createRequest ( uri , httpMethod , this . wrappedFactory ) ; } else if ( this . failIfNotMatch ) { throw new IllegalArgumentException ( uri + " is denied." ) ; } else { return this . ... |
public class HeartbeatDetectionJob { /** * 当实例列表中只有一个 , 且是当前实例时就重启
* @ param session Hibernate Session对象
* @ param instanceNames 排队等待的实例名列表 , 如InsA , InsB , InsC , InsD
* @ param currentInstanceName 当前服务器实例名 */
@ SuppressWarnings ( "unchecked" ) private Operation detection ( Session session , String [ ] clusterJo... | Query query = session . createQuery ( "from " + Heartbeat . class . getName ( ) + " b order by b.date desc" ) ; List < Heartbeat > heartbeats = query . setMaxResults ( 1 ) . list ( ) ; int currentPos = getPosition ( clusterJobInstanceNames , currentInstanceName ) + 1 ; if ( heartbeats . size ( ) > 0 ) { Date now = new ... |
public class Matrix4fStack { /** * Increment the stack pointer by one and set the values of the new current matrix to the one directly below it .
* @ return this */
public Matrix4fStack pushMatrix ( ) { } } | if ( curr == mats . length ) { throw new IllegalStateException ( "max stack size of " + ( curr + 1 ) + " reached" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} mats [ curr ++ ] . set ( this ) ; return this ; |
public class MusicOnHoldApi { /** * Delete WAV file .
* Delete the specified WAV file .
* @ param fileName The musicFile name for deleting from MOH . ( required )
* @ return ApiResponse & lt ; DeleteMOHFilesResponse & gt ;
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserial... | com . squareup . okhttp . Call call = deleteMOHFilesValidateBeforeCall ( fileName , null , null ) ; Type localVarReturnType = new TypeToken < DeleteMOHFilesResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class EthiopicCalendar { /** * { @ inheritDoc }
* @ deprecated This API is ICU internal only .
* @ hide draft / provisional / internal are hidden on Android */
@ Deprecated protected void handleComputeFields ( int julianDay ) { } } | int era , year ; int [ ] fields = new int [ 3 ] ; jdToCE ( julianDay , getJDEpochOffset ( ) , fields ) ; // fields [ 0 ] eyear
// fields [ 1 ] month
// fields [ 2 ] day
if ( isAmeteAlemEra ( ) ) { era = AMETE_ALEM ; year = fields [ 0 ] + AMETE_MIHRET_DELTA ; } else { if ( fields [ 0 ] > 0 ) { era = AMETE_MIHRET ; year ... |
public class TextGenerator { /** * Generate dictionary string .
* @ param length the length
* @ param context the context
* @ param seed the seed
* @ param lookahead the lookahead
* @ param destructive the destructive
* @ return the string */
public String generateDictionary ( int length , int context , fin... | return generateDictionary ( length , context , seed , lookahead , destructive , false ) ; |
public class OnlineUpdateUASparser { /** * Since we ' ve online access to the data file , we check every day for an update */
@ Override protected synchronized void checkDataMaps ( ) throws IOException { } } | if ( lastUpdateCheck == 0 || lastUpdateCheck < System . currentTimeMillis ( ) - updateInterval ) { String versionOnServer = getVersionFromServer ( ) ; if ( currentVersion == null || versionOnServer . compareTo ( currentVersion ) > 0 ) { loadDataFromInternet ( ) ; currentVersion = versionOnServer ; } lastUpdateCheck = S... |
public class DefaultObjectResultSetMapper { /** * Invoked when the return type of the method is an array type .
* @ param rs ResultSet to process .
* @ param maxRows The maximum size of array to create , a value of 0 indicates that the array
* size will be the same as the result set size ( no limit ) .
* @ para... | ArrayList < Object > list = new ArrayList < Object > ( ) ; Class componentType = arrayClass . getComponentType ( ) ; RowMapper rowMapper = RowMapperFactory . getRowMapper ( rs , componentType , cal ) ; // a value of zero indicates that all rows from the resultset should be included .
if ( maxRows == 0 ) { maxRows = - 1... |
public class EbInterfaceWriter { /** * Create a writer builder for Ebi50InvoiceType .
* @ return The builder and never < code > null < / code > */
@ Nonnull public static EbInterfaceWriter < Ebi50InvoiceType > ebInterface50 ( ) { } } | final EbInterfaceWriter < Ebi50InvoiceType > ret = EbInterfaceWriter . create ( Ebi50InvoiceType . class ) ; ret . setNamespaceContext ( EbInterface50NamespaceContext . getInstance ( ) ) ; return ret ; |
public class UASparser { /** * Creates the internal data structes from the seciontList
* @ param sectionList */
protected void createInternalDataStructre ( List < Section > sectionList ) { } } | try { lock . lock ( ) ; for ( Section sec : sectionList ) { if ( "robots" . equals ( sec . getName ( ) ) ) { Map < String , RobotEntry > robotsMapTmp = new HashMap < String , RobotEntry > ( ) ; for ( Entry en : sec . getEntries ( ) ) { RobotEntry re = new RobotEntry ( en . getData ( ) ) ; robotsMapTmp . put ( re . getU... |
public class CPDefinitionOptionRelUtil { /** * Returns the last cp definition option rel in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code... | return getPersistence ( ) . fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; |
public class JStaffLine { /** * Returns true if this staff line has note ( s ) .
* Returns false if it only contains clef , key , time sig . , tempo , barlines . . . */
public boolean hasNotes ( ) { } } | for ( Object m_staffElement : m_staffElements ) { JScoreElement element = ( JScoreElement ) m_staffElement ; if ( ( element instanceof JNoteElementAbstract ) || ( element instanceof JGroupOfNotes ) ) return true ; } return false ; |
public class Track { /** * track an event
* @ param historyToken */
private static void track ( String historyToken ) { } } | if ( historyToken == null ) { historyToken = "historyToken_null" ; } historyToken = URL . encode ( "/WWARN-GWT-Analytics/V1.0/" + historyToken ) ; boolean hasErrored = false ; try { trackGoogleAnalytics ( historyToken ) ; } catch ( JavaScriptException e ) { hasErrored = true ; GWT . log ( "Unable to track" , e ) ; } if... |
public class LoggedInChecker { /** * get logged in user .
* @ return UserData or null if no one is logged in */
public User getLoggedInUser ( ) { } } | User user = null ; final Authentication authentication = SecurityContextHolder . getContext ( ) . getAuthentication ( ) ; if ( authentication != null ) { final Object principal = authentication . getPrincipal ( ) ; // principal can be " anonymousUser " ( String )
if ( principal instanceof UserDetails ) { user = userDet... |
public class PullSocketImporter { /** * Set the socket to newSocket , unless we ' re shutting down .
* The most reliable way to ensure the importer thread exits is to close its socket .
* @ param newSocket socket to replace any previous socket . May be null . */
private void replaceSocket ( Socket newSocket ) { } } | synchronized ( m_socketLock ) { closeSocket ( m_socket ) ; if ( m_eos . get ( ) ) { closeSocket ( newSocket ) ; m_socket = null ; } else { m_socket = newSocket ; } } |
public class AmazonEC2Client { /** * Links an EC2 - Classic instance to a ClassicLink - enabled VPC through one or more of the VPC ' s security groups . You
* cannot link an EC2 - Classic instance to more than one VPC at a time . You can only link an instance that ' s in the
* < code > running < / code > state . An... | request = beforeClientExecution ( request ) ; return executeAttachClassicLinkVpc ( request ) ; |
public class BranchController { /** * Sync . this template instance against its template definition */
@ RequestMapping ( value = "branches/{branchId}/sync" , method = RequestMethod . POST ) public Ack syncTemplateInstance ( @ PathVariable ID branchId ) { } } | return branchTemplateService . syncInstance ( branchId ) ; |
public class Util { /** * Compare two strings . null is less than any non - null string .
* @ param s1 first string .
* @ param s2 second string .
* @ return int 0 if the s1 is equal to s2;
* < 0 if s1 is lexicographically less than s2;
* > 0 if s1 is lexicographically greater than s2. */
public static int co... | if ( s1 == null ) { if ( s2 != null ) { return - 1 ; } return 0 ; } if ( s2 == null ) { return 1 ; } return s1 . compareTo ( s2 ) ; |
public class ServiceFuture { /** * Creates a ServiceCall from an observable object .
* @ param observable the observable to create from
* @ param < T > the type of the response
* @ return the created ServiceCall */
public static < T > ServiceFuture < T > fromResponse ( final Observable < ServiceResponse < T > > o... | final ServiceFuture < T > serviceFuture = new ServiceFuture < > ( ) ; serviceFuture . subscription = observable . last ( ) . subscribe ( new Action1 < ServiceResponse < T > > ( ) { @ Override public void call ( ServiceResponse < T > t ) { serviceFuture . set ( t . body ( ) ) ; } } , new Action1 < Throwable > ( ) { @ Ov... |
public class NetworkEnvironmentConfiguration { /** * Validates the ( new ) network buffer configuration .
* @ param pageSize size of memory buffers
* @ param networkBufFractionfraction of JVM memory to use for network buffers
* @ param networkBufMin minimum memory size for network buffers ( in bytes )
* @ param... | ConfigurationParserUtils . checkConfigParameter ( networkBufFraction > 0.0f && networkBufFraction < 1.0f , networkBufFraction , TaskManagerOptions . NETWORK_BUFFERS_MEMORY_FRACTION . key ( ) , "Network buffer memory fraction of the free memory must be between 0.0 and 1.0" ) ; ConfigurationParserUtils . checkConfigParam... |
public class CryptoServiceImpl { /** * { @ inheritDoc } */
@ Override public String decrypt ( String encrypted ) throws TechnicalException { } } | return decrypt ( Context . getCryptoKey ( ) , encrypted ) ; |
public class AtomicCounterMapBuilder { /** * Sets extra serializable types on the map .
* @ param extraTypes the types to set
* @ return the map builder */
@ SuppressWarnings ( "unchecked" ) public AtomicCounterMapBuilder < K > withExtraTypes ( Class < ? > ... extraTypes ) { } } | config . setExtraTypes ( Lists . newArrayList ( extraTypes ) ) ; return this ; |
public class Parser { /** * 12.6.4 The for - in Statement */
private ParseTree parseForInStatement ( SourcePosition start , ParseTree initializer ) { } } | eat ( TokenType . IN ) ; ParseTree collection = parseExpression ( ) ; eat ( TokenType . CLOSE_PAREN ) ; ParseTree body = parseStatement ( ) ; return new ForInStatementTree ( getTreeLocation ( start ) , initializer , collection , body ) ; |
public class ASTUtil { /** * Returns the < CODE > FieldDeclaration < / CODE > for the specified
* < CODE > FieldAnnotation < / CODE > . The field has to be declared in the
* specified < CODE > TypeDeclaration < / CODE > .
* @ param type
* The < CODE > TypeDeclaration < / CODE > , where the
* < CODE > FieldDec... | requireNonNull ( fieldAnno , "field annotation" ) ; return getFieldDeclaration ( type , fieldAnno . getFieldName ( ) ) ; |
public class MFSResource { /** * Extract most frequent sense baseline from WordNet data , using Ciaramita and
* Altun ' s ( 2006 ) approach for a bio encoding .
* @ param lemmas
* in the sentence
* @ param posTags
* the postags of the sentence
* @ return the most frequent senses for the sentence */
public L... | final List < String > mostFrequentSenseList = new ArrayList < String > ( ) ; String prefix = "-" + BioCodec . START ; String mostFrequentSense = null ; String searchSpan = null ; // iterative over lemmas from the beginning
for ( int i = 0 ; i < lemmas . size ( ) ; i ++ ) { mostFrequentSense = null ; final String pos = ... |
public class LanternaTable { /** * TODO remove when Lanterna 3.1.0 is released */
@ Override public synchronized Table < String > setSize ( TerminalSize size ) { } } | setVisibleRows ( size . getRows ( ) - 1 ) ; return super . setSize ( size ) ; |
public class Span { /** * Returns true if the specified span intersects with this span .
* @ param s
* The span to compare with this span .
* @ return true is the spans overlap ; false otherwise . */
public boolean intersects ( final Span s ) { } } | final int sstart = s . getStart ( ) ; // either s ' s start is in this or this ' start is in s
return this . contains ( s ) || s . contains ( this ) || getStart ( ) <= sstart && sstart < getEnd ( ) || sstart <= getStart ( ) && getStart ( ) < s . getEnd ( ) ; |
public class ActiveSyncManager { /** * Launches polling thread on a particular mount point with starting txId .
* @ param mountId launch polling thread on a mount id
* @ param txId specifies the transaction id to initialize the pollling thread */
public void launchPollingThread ( long mountId , long txId ) { } } | LOG . debug ( "launch polling thread for mount id {}, txId {}" , mountId , txId ) ; if ( ! mPollerMap . containsKey ( mountId ) ) { try ( CloseableResource < UnderFileSystem > ufsClient = mMountTable . getUfsClient ( mountId ) . acquireUfsResource ( ) ) { ufsClient . get ( ) . startActiveSyncPolling ( txId ) ; } catch ... |
public class AppendableExpression { /** * Returns a similar { @ link AppendableExpression } but with the given ( string valued ) expression
* appended to it . */
AppendableExpression appendString ( Expression exp ) { } } | return withNewDelegate ( delegate . invoke ( APPEND , exp ) , true ) ; |
public class IOUtils { /** * Load the parameters in the { @ code TrainingParameters } file .
* @ param paramFile
* the parameter file
* @ param supportSequenceTraining
* wheter sequence training is supported
* @ return the parameters */
private static TrainingParameters loadTrainingParameters ( final String p... | TrainingParameters params = null ; if ( paramFile != null ) { checkInputFile ( "Training Parameter" , new File ( paramFile ) ) ; InputStream paramsIn = null ; try { paramsIn = new FileInputStream ( new File ( paramFile ) ) ; params = new opennlp . tools . util . TrainingParameters ( paramsIn ) ; } catch ( final IOExcep... |
public class NormalM { /** * Sets the mean and covariance for this distribution . For an < i > n < / i > dimensional distribution ,
* < tt > mean < / tt > should be of length < i > n < / i > and < tt > covariance < / tt > should be an < i > n < / i > by < i > n < / i > matrix .
* It is also a requirement that the m... | if ( ! covariance . isSquare ( ) ) throw new ArithmeticException ( "Covariance matrix must be square" ) ; else if ( mean . length ( ) != covariance . rows ( ) ) throw new ArithmeticException ( "The mean vector and matrix must have the same dimension," + mean . length ( ) + " does not match [" + covariance . rows ( ) + ... |
public class DescribeEventsResult { /** * The events that match the specified filter criteria .
* @ param events
* The events that match the specified filter criteria . */
public void setEvents ( java . util . Collection < Event > events ) { } } | if ( events == null ) { this . events = null ; return ; } this . events = new java . util . ArrayList < Event > ( events ) ; |
public class UnmodifiableSet { /** * Returns an unmodifiable view of the set created from the given elements .
* @ param elements Array of elements
* @ param < E > type of the elements
* @ return an unmodifiable view of the set created from the given elements . */
@ SafeVarargs public static < E > Set < E > of ( ... | Set < E > result = new HashSet < > ( ) ; Collections . addAll ( result , elements ) ; return Collections . unmodifiableSet ( result ) ; |
public class BoundedLocalCache { /** * Removes the mapping for a key without notifying the writer .
* @ param key key whose mapping is to be removed
* @ return the removed value or null if no mapping was found */
@ Nullable V removeNoWriter ( Object key ) { } } | Node < K , V > node = data . remove ( nodeFactory . newLookupKey ( key ) ) ; if ( node == null ) { return null ; } V oldValue ; synchronized ( node ) { oldValue = node . getValue ( ) ; if ( node . isAlive ( ) ) { node . retire ( ) ; } } RemovalCause cause ; if ( oldValue == null ) { cause = RemovalCause . COLLECTED ; }... |
public class ECSTarget { /** * The < code > ECSTaskSet < / code > objects associated with the ECS target .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setTaskSetsInfo ( java . util . Collection ) } or { @ link # withTaskSetsInfo ( java . util . Collection... | if ( this . taskSetsInfo == null ) { setTaskSetsInfo ( new com . amazonaws . internal . SdkInternalList < ECSTaskSet > ( taskSetsInfo . length ) ) ; } for ( ECSTaskSet ele : taskSetsInfo ) { this . taskSetsInfo . add ( ele ) ; } return this ; |
public class MCWrapper { /** * Updates the < code > UOWCoordinator < / code > instance .
* This will be used to retrieve the current UOW and update the instance variable .
* This will be used to re - initialize the uowCoord at a new transaction boundary .
* This will need to be set back to null at the completion ... | UOWCurrent uowCurrent = ( UOWCurrent ) pm . connectorSvc . transactionManager ; uowCoord = uowCurrent == null ? null : uowCurrent . getUOWCoord ( ) ; return uowCoord ; |
public class XMLChar { /** * Returns true if the specified character is a BaseChar as defined by production [ 85 ] in the XML
* 1.0 specification .
* @ param ch
* The character to check . */
public static boolean isBaseChar ( int ch ) { } } | return ( 0x0041 <= ch && ch <= 0x005A ) || ( 0x0061 <= ch && ch <= 0x007A ) || ( 0x00C0 <= ch && ch <= 0x00D6 ) || ( 0x00D8 <= ch && ch <= 0x00F6 ) || ( 0x00F8 <= ch && ch <= 0x00FF ) || ( 0x0100 <= ch && ch <= 0x0131 ) || ( 0x0134 <= ch && ch <= 0x013E ) || ( 0x0141 <= ch && ch <= 0x0148 ) || ( 0x014A <= ch && ch <= 0... |
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 779:1 : entryRuleXConditionalExpression returns [ EObject current = null ] : iv _ ruleXConditionalExpression = ruleXConditionalExpression EOF ; */
public final EObject entryRuleXConditionalExpression ( ) throws RecognitionException { } } | EObject current = null ; EObject iv_ruleXConditionalExpression = null ; try { // InternalPureXbase . g : 779:63 : ( iv _ ruleXConditionalExpression = ruleXConditionalExpression EOF )
// InternalPureXbase . g : 780:2 : iv _ ruleXConditionalExpression = ruleXConditionalExpression EOF
{ if ( state . backtracking == 0 ) { ... |
public class AbstractRectangularShape1dfx { /** * Replies the property that is the maximum x coordinate of the box .
* @ return the maxX property . */
@ Pure public DoubleProperty maxXProperty ( ) { } } | if ( this . maxX == null ) { this . maxX = new SimpleDoubleProperty ( this , MathFXAttributeNames . MAXIMUM_X ) { @ Override protected void invalidated ( ) { final double currentMax = get ( ) ; final double currentMin = getMinX ( ) ; if ( currentMin > currentMax ) { // min - max constrain is broken
minXProperty ( ) . s... |
public class CmsHtmlList { /** * Sets the list item to display in the list . < p >
* @ param listItems a collection of { @ link CmsListItem } objects */
public void setContent ( Collection < CmsListItem > listItems ) { } } | if ( m_metadata . isSelfManaged ( ) ) { m_filteredItems = new ArrayList < CmsListItem > ( listItems ) ; m_originalItems = null ; } else { m_filteredItems = null ; m_originalItems = new ArrayList < CmsListItem > ( listItems ) ; } |
public class Yarrgs { /** * Parses < code > args < / code > into an instance of < code > argsType < / code > using
* { @ link Parsers # createFieldParserFactory ( ) } . Calls < code > System . exit ( 1 ) < / code > if the user
* supplied bad arguments after printing a reason to < code > System . err < / code > . Th... | return parseInMain ( argsType , args , Parsers . createFieldParserFactory ( ) ) ; |
public class OptionalInt { /** * Performs negated filtering on inner value if it is present .
* @ param predicate a predicate function
* @ return this { @ code OptionalInt } if the value is present and doesn ' t matches predicate ,
* otherwise an empty { @ code OptionalInt }
* @ since 1.1.9 */
@ NotNull public ... | return filter ( IntPredicate . Util . negate ( predicate ) ) ; |
public class JMSManager { /** * Allows the caller to send a Message object to a destination */
public void send ( Destination dest , Message msg ) throws MessagingException { } } | try { Session s = connection . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; MessageProducer p = s . createProducer ( dest ) ; p . send ( msg ) ; s . close ( ) ; } catch ( JMSException e ) { throw new MessagingException ( e . getMessage ( ) , e ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "send(... |
public class BaseDestinationHandler { /** * Add PubSubLocalisation . */
protected void addPubSubLocalisation ( LocalizationDefinition destinationLocalizationDefinition ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addPubSubLocalisation" , new Object [ ] { destinationLocalizationDefinition } ) ; _pubSubRealization . addPubSubLocalisation ( destinationLocalizationDefinition ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEn... |
public class ScheduledTimer { /** * Waits until the heartbeat is scheduled for execution .
* @ throws InterruptedException if the thread is interrupted while waiting */
public void tick ( ) throws InterruptedException { } } | try ( LockResource r = new LockResource ( mLock ) ) { HeartbeatScheduler . addTimer ( this ) ; // Wait in a loop to handle spurious wakeups
while ( ! mScheduled ) { mTickCondition . await ( ) ; } mScheduled = false ; } |
public class Operators { /** * Entry point for resolving a binary operator given an operator tag and a pair of argument types . */
OperatorSymbol resolveBinary ( DiagnosticPosition pos , JCTree . Tag tag , Type op1 , Type op2 ) { } } | return resolve ( tag , binaryOperators , binop -> binop . test ( op1 , op2 ) , binop -> binop . resolve ( op1 , op2 ) , ( ) -> reportErrorIfNeeded ( pos , tag , op1 , op2 ) ) ; |
public class PatchSchedulesInner { /** * Gets all patch schedules in the specified redis cache ( there is only one ) .
* @ param resourceGroupName The name of the resource group .
* @ param cacheName The name of the Redis cache .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ r... | return listByRedisResourceWithServiceResponseAsync ( resourceGroupName , cacheName ) . map ( new Func1 < ServiceResponse < Page < RedisPatchScheduleInner > > , Page < RedisPatchScheduleInner > > ( ) { @ Override public Page < RedisPatchScheduleInner > call ( ServiceResponse < Page < RedisPatchScheduleInner > > response... |
public class Internal { /** * Encodes a long on 1 , 2 , 4 or 8 bytes
* @ param value The value to encode
* @ return A byte array containing the encoded value
* @ since 2.4 */
public static byte [ ] vleEncodeLong ( final long value ) { } } | if ( Byte . MIN_VALUE <= value && value <= Byte . MAX_VALUE ) { return new byte [ ] { ( byte ) value } ; } else if ( Short . MIN_VALUE <= value && value <= Short . MAX_VALUE ) { return Bytes . fromShort ( ( short ) value ) ; } else if ( Integer . MIN_VALUE <= value && value <= Integer . MAX_VALUE ) { return Bytes . fro... |
public class ClusteredServer { /** * Adds an action to be called with a message to be published to every node in the cluster . */
public Server onpublish ( Action < Map < String , Object > > action ) { } } | publishActions . add ( action ) ; return this ; |
public class QueryRange { /** * - - - - - interface Predicate - - - - - */
@ Override public boolean accept ( final Object t ) { } } | final boolean result = count >= start && count < end ; count ++ ; return result ; |
public class FSEditLog { /** * Add close lease record to edit log . */
public void logCloseFile ( String path , INodeFile newNode ) { } } | CloseOp op = CloseOp . getInstance ( ) ; op . set ( newNode . getId ( ) , path , newNode . getReplication ( ) , newNode . getModificationTime ( ) , newNode . getAccessTime ( ) , newNode . getPreferredBlockSize ( ) , newNode . getBlocks ( ) , newNode . getPermissionStatus ( ) , null , null ) ; logEdit ( op ) ; |
public class FacebookRestClient { /** * Sends a notification email to the specified users , who must have added your application .
* You can send five ( 5 ) emails to a user per day . Requires a session key for desktop applications , which may only
* send email to the person whose session it is . This method does n... | return notifications_sendEmail ( recipientIds , subject , /* fbml */
null , text ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcSizeSelect ( ) { } } | if ( ifcSizeSelectEClass == null ) { ifcSizeSelectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 970 ) ; } return ifcSizeSelectEClass ; |
public class FutureContext { /** * Adds new { @ code Future } and { @ code Consumer } to the context of this
* thread . To resolve this future and invoke the result consumer use method
* { @ link resolve ( ) } Use this method to specify maximum { @ code timeout } used
* when obtaining object from { @ code future ... | LOGGER . debug ( "Registering new future {} and consumer {} with timeout {} {}" , future , consumer , timeout , timeUnit ) ; getFutureContext ( ) . add ( future , consumer , timeout , timeUnit ) ; |
public class StdOperator { /** * / * [ deutsch ]
* < p > Liefert einen Operator , der eine beliebige Entit & auml ; t so
* anpasst , da & szlig ; dieses Element auf den angegebenen Wert im
* Standardmodus gesetzt wird . < / p >
* @ param < T > generic type of target entity
* @ param < V > generic element valu... | return new StdOperator < > ( NEW_VALUE_MODE , element , value ) ; |
public class RedBlackTreeLong { /** * Remove the node containing the given key and element . The node MUST exists , else the tree won ' t be valid anymore . */
@ Override public void remove ( long key , T element ) { } } | if ( first . value == key && ObjectUtil . equalsOrNull ( element , first . element ) ) { removeMin ( ) ; return ; } if ( last . value == key && ObjectUtil . equalsOrNull ( element , last . element ) ) { removeMax ( ) ; return ; } // if both children of root are black , set root to red
if ( ( root . left == null || ! ro... |
public class MLSparse { /** * Returns the real part ( PR ) array . PR has length number - of - nonzero - values .
* @ return real part */
public Double [ ] exportReal ( ) { } } | Double [ ] ad = new Double [ indexSet . size ( ) ] ; int i = 0 ; for ( IndexMN index : indexSet ) { if ( real . containsKey ( index ) ) { ad [ i ] = real . get ( index ) ; } else { ad [ i ] = 0.0 ; } i ++ ; } return ad ; |
public class FileUtil { /** * Writes the specified byte array to a file .
* @ param file The < code > File < / code > to write .
* @ param contents The byte array to write to the file .
* @ param createDirectory A value indicating whether the directory
* containing the file to be written should be created if it... | if ( createDirectory ) { File directory = file . getParentFile ( ) ; if ( ! directory . exists ( ) ) { directory . mkdirs ( ) ; } } FileOutputStream stream = new FileOutputStream ( file ) ; stream . write ( contents ) ; stream . close ( ) ; |
public class Base64 { /** * Low - level access to decoding ASCII characters in
* the form of a byte array . < strong > Ignores GUNZIP option , if
* it ' s set . < / strong > This is not generally a recommended method ,
* although it is used internally as part of the decoding process .
* Special case : if len = ... | byte [ ] decoded = null ; try { decoded = decode ( source , 0 , source . length , Base64 . NO_OPTIONS ) ; } catch ( java . io . IOException ex ) { assert false : "IOExceptions only come from GZipping, which is turned off: " + ex . getMessage ( ) ; } return decoded ; |
public class SqlClient { /** * Opens the CLI client for executing SQL statements .
* @ param context session context
* @ param executor executor */
private void openCli ( SessionContext context , Executor executor ) { } } | CliClient cli = null ; try { cli = new CliClient ( context , executor ) ; // interactive CLI mode
if ( options . getUpdateStatement ( ) == null ) { cli . open ( ) ; } // execute single update statement
else { final boolean success = cli . submitUpdate ( options . getUpdateStatement ( ) ) ; if ( ! success ) { throw new ... |
public class BufferedISPNCache { /** * Sort changes and commit data to the cache . */
public void commitTransaction ( ) { } } | CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe ( ) ; final TransactionManager tm = getTransactionManager ( ) ; try { final List < ChangesContainer > containers = changesContainer . getSortedList ( ) ; commitChanges ( tm , containers ) ; } finally { changesList . set ( null ) ; changesContainer = nu... |
public class FileUtils { /** * Returns a human readable size from a large number of bytes . You can specify that the human readable size use an
* abbreviated label ( e . g . , GB or MB ) .
* @ param aByteCount A large number of bytes
* @ param aAbbreviatedLabel Whether the label should be abbreviated
* @ return... | long count ; if ( ( count = aByteCount / 1073741824 ) > 0 ) { return count + ( aAbbreviatedLabel ? " GB" : " gigabytes" ) ; } else if ( ( count = aByteCount / 1048576 ) > 0 ) { return count + ( aAbbreviatedLabel ? " MB" : " megabytes" ) ; } else if ( ( count = aByteCount / 1024 ) > 0 ) { return count + ( aAbbreviatedLa... |
public class SrvDialog { /** * UTILITIES : */
protected void showAlertDialog ( Activity activity , String msg , String title ) { } } | AlertDialog . Builder builder = new Builder ( activity ) ; builder . setMessage ( msg ) . setTitle ( title ) . setPositiveButton ( R . string . ok , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int id ) { dialog . cancel ( ) ; } } ) ; builder . show ( ) ; |
public class RouteUtils { /** * Collects the @ Route annotation on < em > action < / em > method .
* This set will be added at the end of the list retrieved from the { @ link org . wisdom . api
* . Controller # routes ( ) }
* @ param controller the controller
* @ return the list of route , empty if none are ava... | String prefix = getPath ( controller ) ; List < Route > routes = new ArrayList < > ( ) ; Method [ ] methods = controller . getClass ( ) . getMethods ( ) ; for ( Method method : methods ) { org . wisdom . api . annotations . Route annotation = method . getAnnotation ( org . wisdom . api . annotations . Route . class ) ;... |
public class XcapClientImpl { /** * ( non - Javadoc )
* @ see XcapClient # deleteIfMatch ( java . net . URI ,
* java . lang . String , Header [ ] ,
* Credentials ) */
public XcapResponse deleteIfMatch ( URI uri , String eTag , Header [ ] additionalRequestHeaders , Credentials credentials ) throws IOException { } ... | if ( log . isDebugEnabled ( ) ) { log . debug ( "deleteIfMatch(uri=" + uri + ", eTag=" + eTag + " , additionalRequestHeaders = ( " + Arrays . toString ( additionalRequestHeaders ) + " ) )" ) ; } final HttpDelete request = new HttpDelete ( uri ) ; request . setHeader ( XcapConstant . HEADER_IF_MATCH , eTag ) ; return ex... |
public class DirectoryExtenderEngine { /** * Szablon może być pojedynczym katalogiem . W takiej sytuacji przetwarzane
* są wszsytkie jego wpisy . */
protected void processVelocityResource ( ITemplateSource source , Map < String , Object > params , String target ) throws Exception { } } | for ( ITemplateSourceEntry entry : source . listEntries ( ) ) { // System . out . println ( " Wykryto zasób : " + entry . getName ( ) ) ;
if ( entry . isFile ( ) ) { // System . out . println ( " Element " + entry . getTemplate ( ) + " / " + source . getResource ( ) +
// " / " + entry . getName ( ) + " jest plikiem " ... |
public class StopWatch { /** * Start the stop watch .
* @ return { @ link EChange } . */
@ Nonnull public final EChange start ( ) { } } | // Already started ?
if ( m_nStartDT > 0 ) return EChange . UNCHANGED ; m_nStartDT = getCurrentNanoTime ( ) ; return EChange . CHANGED ; |
public class GUIDefaults { /** * returns the value for the specified property , if non - existent then the
* default value .
* @ param property the property to retrieve the value for
* @ param defaultValue the default value for the property
* @ return the value of the specified property */
public static String ... | return PROPERTIES . getProperty ( property , defaultValue ) ; |
public class Node { /** * Detaches child from Node and replaces it with newChild . */
public final void replaceChild ( Node child , Node newChild ) { } } | checkArgument ( newChild . next == null , "The new child node has next siblings." ) ; checkArgument ( newChild . previous == null , "The new child node has previous siblings." ) ; checkArgument ( newChild . parent == null , "The new child node already has a parent." ) ; checkState ( child . parent == this , "%s is not ... |
public class UpdateAssertionForProxyIdpAction { /** * Assigns the AuthenticatingAuthority element holding the issuer of the proxied assertion .
* @ param assertion
* the assertion to update
* @ param proxiedAssertion
* the proxied assertion */
protected void setAuthenticatingAuthority ( Assertion assertion , As... | if ( proxiedAssertion . getIssuer ( ) == null || proxiedAssertion . getIssuer ( ) . getValue ( ) == null ) { log . warn ( "No issuer element found in proxied assertion" ) ; return ; } if ( assertion . getAuthnStatements ( ) . isEmpty ( ) ) { log . warn ( "No AuthnStatement available is assertion to update - will not pr... |
public class UnarchiveFindingsRequest { /** * IDs of the findings that you want to unarchive .
* @ param findingIds
* IDs of the findings that you want to unarchive . */
public void setFindingIds ( java . util . Collection < String > findingIds ) { } } | if ( findingIds == null ) { this . findingIds = null ; return ; } this . findingIds = new java . util . ArrayList < String > ( findingIds ) ; |
public class SpatialAnchorsAccountsInner { /** * Regenerate 1 Key of a Spatial Anchors Account .
* @ param resourceGroupName Name of an Azure resource group .
* @ param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account .
* @ param serial serial of key to be regenerated
* @ throws Illega... | return regenerateKeysWithServiceResponseAsync ( resourceGroupName , spatialAnchorsAccountName , serial ) . map ( new Func1 < ServiceResponse < SpatialAnchorsAccountKeysInner > , SpatialAnchorsAccountKeysInner > ( ) { @ Override public SpatialAnchorsAccountKeysInner call ( ServiceResponse < SpatialAnchorsAccountKeysInne... |
public class ThrowUnchecked { /** * Throws the cause of the given exception , even though it may be
* checked . If the cause is null , then the original exception is
* thrown . This method only returns normally if the exception is null .
* @ param t exception whose cause is to be thrown */
public static void fire... | if ( t != null ) { Throwable cause = t . getCause ( ) ; if ( cause == null ) { cause = t ; } fire ( cause ) ; } |
public class ProximityTracker { /** * Adds an object to the tracker . */
public void addObject ( int x , int y , Object object ) { } } | Record record = new Record ( x , y , object ) ; // if this is the very first element , we have to insert it
// straight away because our binary search algorithm doesn ' t work
// on empty arrays
if ( _size == 0 ) { _records [ _size ++ ] = record ; return ; } // figure out where to insert it
int ipoint = binarySearch ( ... |
public class SoundStore { /** * Get the Sound based on a specified AIF file
* @ param ref The reference to the AIF file in the classpath
* @ return The Sound read from the AIF file
* @ throws IOException Indicates a failure to load the AIF */
public Audio getAIF ( String ref ) throws IOException { } } | return getAIF ( ref , ResourceLoader . getResourceAsStream ( ref ) ) ; |
public class ZkMasterInquireClient { /** * Gets the client .
* @ param zookeeperAddress the address for Zookeeper
* @ param electionPath the path of the master election
* @ param leaderPath the path of the leader
* @ param inquireRetryCount the number of times to retry connections
* @ return the client */
pub... | ZkMasterConnectDetails connectDetails = new ZkMasterConnectDetails ( zookeeperAddress , leaderPath ) ; if ( ! sCreatedClients . containsKey ( connectDetails ) ) { sCreatedClients . put ( connectDetails , new ZkMasterInquireClient ( connectDetails , electionPath , inquireRetryCount ) ) ; } return sCreatedClients . get (... |
public class InternalOutputStreamManager { /** * This method will be called to force flush of streamSet */
public void forceFlush ( SIBUuid12 streamID ) throws SIErrorException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "forceFlush" , streamID ) ; StreamSet streamSet = streamSets . get ( streamID ) ; streamSet . dereferenceControlAdapter ( ) ; // Send out a flushed message . If this fails , make sure we get
// to at least invoke the callbac... |
public class CodeGenBase { /** * This method translates a VDM node into an IR status .
* @ param statuses
* A list of previously generated IR statuses . The generated IR status will be added to this list .
* @ param node
* The VDM node from which we generate an IR status
* @ throws AnalysisException
* If so... | IRStatus < PIR > status = generator . generateFrom ( node ) ; if ( status != null ) { statuses . add ( status ) ; } |
public class Slice { /** * Sets the specified 32 - bit float at the specified absolute
* { @ code index } in this buffer .
* @ throws IndexOutOfBoundsException if the specified { @ code index } is less than { @ code 0 } or
* { @ code index + 4 } is greater than { @ code this . length ( ) } */
public void setFloat... | checkIndexLength ( index , SizeOf . SIZE_OF_FLOAT ) ; unsafe . putFloat ( base , address + index , value ) ; |
public class ElementHelper { /** * Parse the value for any property tokens relative to the supplied properties .
* @ param value the value to parse
* @ param props the reference properties
* @ return the normalized string */
private static String normalize ( String value , Properties props ) { } } | return PropertyResolver . resolve ( props , value ) ; |
public class GroovyResultSetExtension { /** * Adds a new row to the result set
* @ param values a map containing the mappings for column names and values
* @ throws java . sql . SQLException if something goes wrong
* @ see ResultSet # insertRow ( )
* @ see ResultSet # updateObject ( java . lang . String , java ... | getResultSet ( ) . moveToInsertRow ( ) ; for ( Iterator iter = values . entrySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) iter . next ( ) ; getResultSet ( ) . updateObject ( entry . getKey ( ) . toString ( ) , entry . getValue ( ) ) ; } getResultSet ( ) . insertRow ( ) ; |
public class SelectBuilderUtility { /** * Detect result type .
* @ param method
* @ return
* @ throws ClassNotFoundException */
public static TypeName extractReturnType ( final SQLiteModelMethod method ) { } } | SQLiteEntity daoEntity = method . getParent ( ) . getEntity ( ) ; // if true , field must be associate to ben attributes
TypeName returnTypeName = method . getReturnClass ( ) ; TypeName result = null ; if ( TypeUtility . isTypeIncludedIn ( returnTypeName , Void . class , Void . TYPE ) ) { // return VOID ( in the parame... |
public class Utils { /** * CollectionのインスタンスをListに変換する 。
* @ since 1.0
* @ param collection 変換元のCollectionのインスタンス 。
* @ return 変換したListのインスタンス 。 */
public static < T > List < T > convertCollectionToList ( final Collection < T > collection ) { } } | if ( List . class . isAssignableFrom ( collection . getClass ( ) ) ) { return ( List < T > ) collection ; } return new ArrayList < > ( collection ) ; |
public class HeaderHandlingDispatcherPortlet { /** * Used by the render method to set the response properties and headers .
* < p > The portlet should override this method and set its response header using this method in
* order to ensure that they are set before anything is written to the output stream .
* @ par... | try { doDispatch ( request , response ) ; } catch ( IOException | PortletException ex ) { logger . error ( "Exception rendering headers for portlet " + getPortletName ( ) + ". Aborting doHeaders" , ex ) ; } |
public class AsyncOperationService { /** * Wrap getOperationStatus to avoid throwing exception over JMX */
@ JmxOperation ( description = "Retrieve operation status" ) public String getStatus ( int id ) { } } | try { return getOperationStatus ( id ) . toString ( ) ; } catch ( VoldemortException e ) { return "No operation with id " + id + " found" ; } |
public class TraceStmBuilder { /** * Assumes dialect is VDM - SL . This method does not work with store lookups for local variables and since code
* generated VDM - SL traces do not rely on this then it is safe to use this method for this dialect .
* @ param callStm
* the call statement for which we want to repla... | List < AVarDeclIR > decls = new LinkedList < AVarDeclIR > ( ) ; if ( Settings . dialect != Dialect . VDM_SL ) { return decls ; } List < SExpIR > args = null ; if ( callStm instanceof SCallStmIR ) { args = ( ( SCallStmIR ) callStm ) . getArgs ( ) ; } else if ( callStm instanceof ACallObjectExpStmIR ) { args = ( ( ACallO... |
public class AmazonElastiCacheClient { /** * Creates a new Amazon ElastiCache cache parameter group . An ElastiCache cache parameter group is a collection of
* parameters and their values that are applied to all of the nodes in any cluster or replication group using the
* CacheParameterGroup .
* A newly created C... | request = beforeClientExecution ( request ) ; return executeCreateCacheParameterGroup ( request ) ; |
public class AutoTGT { /** * Hadoop does not just go off of a TGT , it needs a bit more . This should fill in the rest .
* @ param subject the subject that should have a TGT in it . */
private void loginHadoopUser ( Subject subject ) { } } | Class < ? > ugi = null ; try { ugi = Class . forName ( "org.apache.hadoop.security.UserGroupInformation" ) ; } catch ( ClassNotFoundException e ) { LOG . info ( "Hadoop was not found on the class path" ) ; return ; } try { Method isSecEnabled = ugi . getMethod ( "isSecurityEnabled" ) ; if ( ! ( ( Boolean ) isSecEnabled... |
public class PathUtil { /** * Returns the file extension part of the specified path
* @ param path the filname path of the file
* @ return the file extension */
public static String getExtension ( String path ) { } } | int idx = path . lastIndexOf ( "/" ) ; // $ NON - NLS - 1 $
String filename = idx == - 1 ? path : path . substring ( idx + 1 ) ; idx = filename . lastIndexOf ( "." ) ; // $ NON - NLS - 1 $
return idx == - 1 ? "" : filename . substring ( idx + 1 ) ; // $ NON - NLS - 1 $ |
public class ClasspathReader { /** * Uses the java . class . path system property to obtain a list of URLs that
* represent the CLASSPATH
* @ return the URl [ ] */
@ SuppressWarnings ( "deprecation" ) @ Override public final URL [ ] findResourcesByClasspath ( ) { } } | List < URL > list = new ArrayList < URL > ( ) ; String classpath = System . getProperty ( "java.class.path" ) ; StringTokenizer tokenizer = new StringTokenizer ( classpath , File . pathSeparator ) ; while ( tokenizer . hasMoreTokens ( ) ) { String path = tokenizer . nextToken ( ) ; File fp = new File ( path ) ; if ( ! ... |
public class ExpandableButtonMenu { /** * Set image drawable for a menu button
* @ param button
* @ param drawable */
public void setMenuButtonImage ( MenuButton button , Drawable drawable ) { } } | switch ( button ) { case MID : mMidBtn . setImageDrawable ( drawable ) ; break ; case LEFT : mLeftBtn . setImageDrawable ( drawable ) ; break ; case RIGHT : mRightBtn . setImageDrawable ( drawable ) ; break ; } |
public class VpcConfigMarshaller { /** * Marshall the given parameter object . */
public void marshall ( VpcConfig vpcConfig , ProtocolMarshaller protocolMarshaller ) { } } | if ( vpcConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( vpcConfig . getVpcId ( ) , VPCID_BINDING ) ; protocolMarshaller . marshall ( vpcConfig . getSubnets ( ) , SUBNETS_BINDING ) ; protocolMarshaller . marshall ( vpcConfig . getSe... |
public class BsJobLogCA { public void filter ( String name , EsAbstractConditionQuery . OperatorCall < BsJobLogCQ > queryLambda , ConditionOptionCall < FilterAggregationBuilder > opLambda , OperatorCall < BsJobLogCA > aggsLambda ) { } } | JobLogCQ cq = new JobLogCQ ( ) ; if ( queryLambda != null ) { queryLambda . callback ( cq ) ; } FilterAggregationBuilder builder = regFilterA ( name , cq . getQuery ( ) ) ; if ( opLambda != null ) { opLambda . callback ( builder ) ; } if ( aggsLambda != null ) { JobLogCA ca = new JobLogCA ( ) ; aggsLambda . callback ( ... |
public class StabilitySquareFiducialEstimate { /** * Processes the observation and generates a stability estimate
* @ param sampleRadius Radius around the corner pixels it will sample
* @ param input Observed corner location of the fiducial in distorted pixels . Must be in correct order .
* @ return true if succe... | work . set ( input ) ; samples . reset ( ) ; estimator . process ( work , false ) ; estimator . getWorldToCamera ( ) . invert ( referenceCameraToWorld ) ; samples . reset ( ) ; createSamples ( sampleRadius , work . a , input . a ) ; createSamples ( sampleRadius , work . b , input . b ) ; createSamples ( sampleRadius , ... |
public class PropertyReaderHelper { /** * Lookup in { @ link Environment } a certain property or a list of properties .
* @ param env
* the { @ link Environment } context from which to
* @ param propName
* the name of the property to lookup from { @ link Environment } .
* @ return the list */
public static Li... | final List < String > list = new ArrayList < > ( ) ; final String singleProp = env . getProperty ( propName ) ; if ( singleProp != null ) { list . add ( singleProp ) ; return list ; } int counter = 0 ; String prop = env . getProperty ( propName + "[" + counter + "]" ) ; while ( prop != null ) { list . add ( prop ) ; co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.