signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SplitDataProperties { /** * Defines that the data within an input split is grouped on the fields defined by the field positions . * All records sharing the same key ( combination ) must be subsequently emitted by the input * format for each input split . * < p > < b > * IMPORTANT : Providing wrong ...
if ( groupFields == null ) { throw new InvalidProgramException ( "GroupFields may not be null." ) ; } else if ( groupFields . length == 0 ) { throw new InvalidProgramException ( "GroupFields may not be empty." ) ; } if ( this . splitOrdering != null ) { throw new InvalidProgramException ( "DataSource may either be grou...
public class GenericAnalyticsRequest { /** * Create a { @ link GenericAnalyticsRequest } and mark it as containing a full Analytics query in Json form * ( including additional query parameters ) . * The simplest form of such a query is a single statement encapsulated in a json query object : * < pre > { " stateme...
return new GenericAnalyticsRequest ( jsonQuery , true , bucket , username , password , targetNode , NO_PRIORITY ) ;
public class FxRateImpl { /** * Nice human readable description of the FX Rate , useful reminder . * < pre > * CAD . SGD Mkt Convention : true * Quoter buys CAD and sells SGD at 1.1279 * Quoter sells CAD and buys SGD at 1.1289 * < / pre > */ @ Override public String getDescription ( ) { } }
final StringBuilder b = new StringBuilder ( ) ; b . append ( currencyPair ) . append ( " Mkt Convention:" ) . append ( marketConvention ) ; if ( crossCcy != null ) { b . append ( " Cross Ccy:" ) . append ( crossCcy ) ; } final String cr = System . getProperty ( "line.separator" ) ; b . append ( cr ) ; b . append ( "Quo...
public class Gravatar { /** * Set the default image which will be retrieved when there is no avatar * for the given email , when the avatar can ' t be shown due to the rating * or when you enforce the default avatar . * @ param customDefaultImage Absolute URL to an image . * @ param encoding customDefaultImage ...
assert customDefaultImage != null && encoding != null ; this . customDefaultImage = URLEncoder . encode ( customDefaultImage , encoding ) ; standardDefaultImage = null ; return this ;
public class TrainingSpecification { /** * A list of the metrics that the algorithm emits that can be used as the objective metric in a hyperparameter * tuning job . * @ param supportedTuningJobObjectiveMetrics * A list of the metrics that the algorithm emits that can be used as the objective metric in a * hype...
if ( supportedTuningJobObjectiveMetrics == null ) { this . supportedTuningJobObjectiveMetrics = null ; return ; } this . supportedTuningJobObjectiveMetrics = new java . util . ArrayList < HyperParameterTuningJobObjective > ( supportedTuningJobObjectiveMetrics ) ;
public class ProcessorTemplateHandler { /** * This method will be called for any event that arrives from a previous handler in the chain ( or the parser , cache . . . ) * when the execution has already been stopped and we ( potentially ) have some work pending . The idea is to queue * these events at the end of the...
final SimpleModelProcessable pendingProcessableModel ; if ( this . pendingProcessingsSize > 0 ) { final IEngineProcessable level0Pending = this . pendingProcessings [ 0 ] ; if ( level0Pending instanceof SimpleModelProcessable && ( ( SimpleModelProcessable ) level0Pending ) . getModelHandler ( ) == this ) { pendingProce...
public class FeatureInfoWidgetFactory { /** * Create a default { @ link FeatureInfoWidget } with a { @ link ZoomToObjectAction } * to allow zooming to selected features . * @ param mapPresenter The map presenter used by the action ( s ) . * @ return A feature info widget with actions . */ public FeatureInfoWithAc...
FeatureInfoWithActions widgetWithActions = new FeatureInfoWithActions ( ) ; widgetWithActions . addHasFeature ( new ZoomToObjectAction ( mapPresenter ) ) ; return widgetWithActions ;
public class ImageModerationsImpl { /** * Returns probabilities of the image containing racy or adult content . * @ param imageStream The image file . * @ param evaluateFileInputOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException ...
if ( this . client . baseUrl ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.baseUrl() is required and cannot be null." ) ; } if ( imageStream == null ) { throw new IllegalArgumentException ( "Parameter imageStream is required and cannot be null." ) ; } final Boolean cacheImage = evaluateFil...
public class WhitesourceService { /** * Checks the policies application of the given OSS information . * @ param orgToken Organization token uniquely identifying the account at white source . * @ param product The product name or token to update . * @ param productVersion The product version . * @ param project...
return client . checkPolicyCompliance ( requestFactory . newCheckPolicyComplianceRequest ( orgToken , product , productVersion , projectInfos , forceCheckAllDependencies , userKey , requesterEmail , logData , productToken ) ) ;
public class QueryAtomContainerCreator { /** * Creates a QueryAtomContainer with the following settings : * < pre > * QueryAtomContainer . create ( container , * Expr . Type . ELEMENT , * Expr . Type . IS _ AROMATIC , * Expr . Type . ALIPHATIC _ ORDER ) ; * < / pre > * @ param container The AtomContainer ...
return QueryAtomContainer . create ( container , Expr . Type . ELEMENT , Expr . Type . IS_AROMATIC , Expr . Type . ALIPHATIC_ORDER ) ;
public class VimGenerator2 { /** * Append a Vim comment . * @ param it the receiver of the generated elements . * @ param text the text of the comment . * @ return { @ code it } . */ protected IStyleAppendable appendComment ( IStyleAppendable it , String text ) { } }
return appendComment ( it , true , text ) ;
public class BigtableTableAdminGCJClient { /** * { @ inheritDoc } */ @ Override public void dropRowRange ( String tableId , String rowKeyPrefix ) { } }
delegate . dropRowRange ( tableId , rowKeyPrefix ) ;
public class ProtoParser { /** * Adds an object or objects to a List . */ private void addToList ( List < Object > list , Object value ) { } }
if ( value instanceof List ) { list . addAll ( ( List ) value ) ; } else { list . add ( value ) ; }
public class CreateProductPackageItems { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param productPackageId the ID of the product package to add product package items to . * @ param productId the ID of the product to generate a product package ...
ProductPackageItemServiceInterface productPackageItemService = adManagerServices . get ( session , ProductPackageItemServiceInterface . class ) ; // Create a local product package item . ProductPackageItem productPackageItem = new ProductPackageItem ( ) ; // Set the product from which the product package item is create...
public class LineNumberFormatter { /** * Processes { @ link # _ file } , breaking apart any lines on which multiple line - number markers appear in different * columns . * @ return the list of broken lines */ private List < String > breakLines ( List < LineNumberPosition > o_LineBrokenPositions ) throws IOException...
int numLinesRead = 0 ; int lineOffset = 0 ; List < String > brokenLines = new ArrayList < > ( ) ; try ( BufferedReader r = new BufferedReader ( new FileReader ( _file ) ) ) { for ( int posIndex = 0 ; posIndex < _positions . size ( ) ; posIndex ++ ) { LineNumberPosition pos = _positions . get ( posIndex ) ; o_LineBroken...
public class MinioClient { /** * Lists object information in given bucket and prefix . * @ param bucketName Bucket name . * @ param prefix Prefix string . List objects whose name starts with ` prefix ` . * @ return an iterator of Result Items . * @ throws XmlPullParserException upon parsing response xml */ publ...
// list all objects recursively return listObjects ( bucketName , prefix , true ) ;
public class NumberFormatContext { /** * Check whether the given value is a valid numeric value that can be * converted to an { @ link Double } . * @ param value The associated value to test * @ return < code > true < / code > The value is a valid double , * < code > false < / code > otherwise * @ see # conve...
boolean result = true ; try { Double . valueOf ( value ) ; } catch ( NumberFormatException e ) { result = false ; } return result ;
public class HttpStaticFileServerHandler { /** * If Keep - Alive is disabled , attaches " Connection : close " header to the response * and closes the connection after the response being sent . */ private void sendAndCleanupConnection ( ChannelHandlerContext ctx , FullHttpResponse response ) { } }
final FullHttpRequest request = this . request ; final boolean keepAlive = HttpUtil . isKeepAlive ( request ) ; HttpUtil . setContentLength ( response , response . content ( ) . readableBytes ( ) ) ; if ( ! keepAlive ) { // We ' re going to close the connection as soon as the response is sent , // so we should also mak...
public class SaverDef { /** * < pre > * The operation to run when saving a model checkpoint . * < / pre > * < code > optional string save _ tensor _ name = 2 ; < / code > */ public com . google . protobuf . ByteString getSaveTensorNameBytes ( ) { } }
java . lang . Object ref = saveTensorName_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; saveTensorName_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; }
public class CmisConnector { /** * Determines supertypes for the given CMIS type in terms of JCR . * @ param cmisType given CMIS type * @ return supertypes in JCR lexicon . */ private String [ ] superTypes ( ObjectType cmisType ) { } }
if ( cmisType . getBaseTypeId ( ) == BaseTypeId . CMIS_FOLDER ) { return new String [ ] { JcrConstants . NT_FOLDER } ; } if ( cmisType . getBaseTypeId ( ) == BaseTypeId . CMIS_DOCUMENT ) { return new String [ ] { JcrConstants . NT_FILE } ; } return new String [ ] { cmisType . getParentType ( ) . getId ( ) } ;
public class EmailAutoCompleteTextView { /** * / * Implemented Methods */ @ Override public void onFocusChange ( View v , boolean hasFocus ) { } }
final EmailAutoCompleteTextView editText = ( EmailAutoCompleteTextView ) v ; if ( mClearButtonEnabled ) { editText . setClearVisible ( ( hasFocus && ! TextUtils . isEmpty ( editText . getText ( ) . toString ( ) ) ) ) ; } if ( mOnFocusChangeListener != null ) { mOnFocusChangeListener . onFocusChange ( v , hasFocus ) ; }
public class BoxSearch { /** * Searches all descendant folders using a given query and query parameters . * @ param offset is the starting position . * @ param limit the maximum number of items to return . The default is 30 and the maximum is 200. * @ param bsp containing query and advanced search capabilities . ...
QueryStringBuilder builder = bsp . getQueryParameters ( ) . appendParam ( "limit" , limit ) . appendParam ( "offset" , offset ) ; URL url = SEARCH_URL_TEMPLATE . buildWithQuery ( this . getAPI ( ) . getBaseURL ( ) , builder . toString ( ) ) ; BoxAPIRequest request = new BoxAPIRequest ( this . getAPI ( ) , url , "GET" )...
public class CXFEndpointProvider { /** * Creates an endpoint reference from a given adress . * @ param address * @ param props * @ return */ private static EndpointReferenceType createEPR ( String address , SLProperties props ) { } }
EndpointReferenceType epr = WSAEndpointReferenceUtils . getEndpointReference ( address ) ; if ( props != null ) { addProperties ( epr , props ) ; } return epr ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link FeaturePropertyType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link FeaturePropertyType } { @ co...
return new JAXBElement < FeaturePropertyType > ( _FeatureMember_QNAME , FeaturePropertyType . class , null , value ) ;
public class MaxiCode { /** * { @ inheritDoc } */ @ Override protected void plotSymbol ( ) { } }
// hexagons for ( int row = 0 ; row < 33 ; row ++ ) { for ( int col = 0 ; col < 30 ; col ++ ) { if ( grid [ row ] [ col ] ) { double x = ( 2.46 * col ) + 1.23 ; if ( ( row & 1 ) != 0 ) { x += 1.23 ; } double y = ( 2.135 * row ) + 1.43 ; hexagons . add ( new Hexagon ( x , y ) ) ; } } } // circles double [ ] radii = { 10...
public class TracingJmsListenerEndpointRegistry { /** * It would be better to trace by wrapping , but * { @ link MethodJmsListenerEndpoint # createMessageListenerInstance ( ) } , is protected so * we can ' t call it from outside code . In other words , a forwarding pattern can ' t be * used . Instead , we copy st...
// Skip out rather than incompletely copying the source if ( this . messageHandlerMethodFactoryField == null || this . embeddedValueResolverField == null ) { return source ; } // We want the stock implementation , except we want to wrap the message listener // in a new span MethodJmsListenerEndpoint dest = new MethodJm...
public class XLifecycleExtension { /** * Assigns a lifecycle transition string to the given event . * @ param event * Event to be tagged . * @ param transition * Lifecycle transition string to be assigned . */ public void assignTransition ( XEvent event , String transition ) { } }
if ( transition != null && transition . trim ( ) . length ( ) > 0 ) { XAttributeLiteral transAttr = ( XAttributeLiteral ) ATTR_TRANSITION . clone ( ) ; transAttr . setValue ( transition . trim ( ) ) ; event . getAttributes ( ) . put ( KEY_TRANSITION , transAttr ) ; }
public class DrizzlePreparedStatement { /** * Sets the designated parameter to the given < code > Reader < / code > object , which is the given number of characters * long . When a very large UNICODE value is input to a < code > LONGVARCHAR < / code > parameter , it may be more practical * to send it via a < code >...
if ( reader == null ) { setNull ( parameterIndex , Types . BLOB ) ; return ; } try { setParameter ( parameterIndex , new ReaderParameter ( reader , length ) ) ; } catch ( IOException e ) { throw SQLExceptionMapper . getSQLException ( "Could not read stream: " + e . getMessage ( ) , e ) ; }
public class BasicEvaluationCtx { /** * Returns attribute value ( s ) from the environment section of the request . * @ param type the type of the attribute value ( s ) to find * @ param id the id of the attribute value ( s ) to find * @ param issuer the issuer of the attribute value ( s ) to find or null * @ r...
return getGenericAttributes ( type , id , issuer , environmentMap , null , AttributeDesignator . ENVIRONMENT_TARGET ) ;
public class Sherdog { /** * Gets an event via it ' s sherdog URL . * @ param sherdogUrl Sherdog URL , can be found in the list of event of an organization * @ return an Event * @ throws IOException if connecting to sherdog fails * @ throws ParseException if the page structure has changed * @ throws SherdogPa...
return new EventParser ( zoneId ) . parse ( sherdogUrl ) ;
public class Logger { /** * Logs a warning that may or may not have a negative impact . * @ param correlationId ( optional ) transaction id to trace execution through * call chain . * @ param message a human - readable message to log . * @ param args arguments to parameterize the message . */ public void warn (...
formatAndWrite ( LogLevel . Warn , correlationId , null , message , args ) ;
public class ControlBean { /** * Internal method used to lookup a ControlBeanContextFactory . This factory is used to create the * ControlBeanContext object for this ControlBean . The factory is discoverable from either the containing * ControlBeanContext object or from the environment . If the containing CBC objec...
// first , try to find the CBCFactory from the container if ( context != null ) { ControlBeanContextFactory cbcFactory = context . getService ( ControlBeanContextFactory . class , null ) ; if ( cbcFactory != null ) { return cbcFactory ; } } // Create the context that acts as the BeanContextProxy for this bean ( the con...
public class TransactionCheckpointLogRecord { /** * Called to perform recovery action during a warm start of the ObjectManager . * @ param objectManagerState of the ObjectManager performing recovery . * @ throws ObjectManagerException */ public void performRecovery ( ObjectManagerState objectManagerState ) throws O...
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "performRecovery" , objectManagerState ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , "logicalUnitOfWork=" + logicalUnitOfWork + "(LogicalUnitOfWork)" + "\n ...
public class RollbackConfiguration { /** * The triggers to monitor during stack creation or update actions . * By default , AWS CloudFormation saves the rollback triggers specified for a stack and applies them to any * subsequent update operations for the stack , unless you specify otherwise . If you do specify rol...
if ( rollbackTriggers == null ) { this . rollbackTriggers = null ; return ; } this . rollbackTriggers = new com . amazonaws . internal . SdkInternalList < RollbackTrigger > ( rollbackTriggers ) ;
public class AdCustomizerFeed { /** * Gets the feedAttributes value for this AdCustomizerFeed . * @ return feedAttributes * The AdCustomizerFeed ' s schema . In SET operations , these attributes * will be considered new * attributes and will be appended to the existing list * of attributes unless this list is a...
return feedAttributes ;
public class LogBuffer { /** * Return 32 - bit signed int from buffer . ( little - endian ) * @ see mysql - 5.1.60 / include / my _ global . h - sint4korr */ public final int getInt32 ( final int pos ) { } }
final int position = origin + pos ; if ( pos + 3 >= limit || pos < 0 ) throw new IllegalArgumentException ( "limit excceed: " + ( pos < 0 ? pos : ( pos + 3 ) ) ) ; byte [ ] buf = buffer ; return ( 0xff & buf [ position ] ) | ( ( 0xff & buf [ position + 1 ] ) << 8 ) | ( ( 0xff & buf [ position + 2 ] ) << 16 ) | ( ( buf ...
public class IAPlatformClient { /** * getCurrentUser the user from quickbooks * @ throws ConnectionException */ public User getcurrentUser ( String consumerKey , String consumerSecret , String accessToken , String accessTokenSecret ) throws ConnectionException { } }
httpClient = new PlatformHttpClient ( consumerKey , consumerSecret , accessToken , accessTokenSecret ) ; User user = null ; ; try { user = this . httpClient . getCurrentUser ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return user ;
public class MultiKeySequentialProcessor { /** * Queues up a new task to execute , subject to the dependency keys that match the given filter . * This task will not begin execution until all previous tasks whose keys match the given filter have finished . * In addition , no subsequent task for any key that matches ...
CompletableFuture < ReturnType > result = new CompletableFuture < > ( ) ; ArrayList < CompletableFuture < ? > > existingTasks = new ArrayList < > ( ) ; synchronized ( this . queue ) { Exceptions . checkNotClosed ( this . closed , this ) ; // Collect all currently executing tasks for the given keys . for ( val e : this ...
public class AlluxioStatusException { /** * Converts checked throwables to Alluxio status exceptions . Unchecked throwables should not be * passed to this method . Use Throwables . propagateIfPossible before passing a Throwable to this * method . * @ param throwable a throwable * @ return the converted { @ link...
try { throw throwable ; } catch ( IOException e ) { return fromIOException ( e ) ; } catch ( AlluxioException e ) { return fromAlluxioException ( e ) ; } catch ( InterruptedException e ) { return new CancelledException ( e ) ; } catch ( RuntimeException e ) { throw new IllegalStateException ( "Expected a checked except...
public class Currency { /** * Returns the localized currency symbol for this currency in { @ code locale } . * That is , given " USD " and Locale . US , you ' d get " $ " , but given " USD " and a non - US locale , * you ' d get " US $ " . * < p > If the locale only specifies a language rather than a language and...
if ( locale == null ) { throw new NullPointerException ( "locale == null" ) ; } // Check the locale first , in case the locale has the same currency . LocaleData localeData = LocaleData . get ( locale ) ; if ( localeData . internationalCurrencySymbol . equals ( currencyCode ) ) { return localeData . currencySymbol ; } ...
public class DeterministicHierarchy { /** * Extends the tree by calculating the requested child for the given path . For example , to get the key at position * 1/2/3 you would pass 1/2 as the parent path and 3 as the child number . * @ param parentPath the path to the parent * @ param relative whether the path is...
return deriveChild ( get ( parentPath , relative , createParent ) , createChildNumber ) ;
public class Client { /** * Opens a TCP only client . * @ see # connect ( int , InetAddress , int , int ) */ public void connect ( int timeout , String host , int tcpPort ) throws IOException { } }
connect ( timeout , InetAddress . getByName ( host ) , tcpPort , - 1 ) ;
public class LazyList { /** * Converts the resultset to list of maps , where each map represents a row in the resultset keyed off column names . * @ return list of maps , where each map represents a row in the resultset keyed off column names . */ public List < Map < String , Object > > toMaps ( ) { } }
hydrate ( ) ; List < Map < String , Object > > maps = new ArrayList < > ( delegate . size ( ) ) ; for ( T t : delegate ) { maps . add ( t . toMap ( ) ) ; } return maps ;
public class CSSHandler { /** * Create a { @ link CascadingStyleSheet } object from a parsed object . * @ param eVersion * The CSS version to use . May not be < code > null < / code > . * @ param aNode * The parsed CSS object to read . May not be < code > null < / code > . * @ return Never < code > null < / c...
return readCascadingStyleSheetFromNode ( eVersion , aNode , CSSReader . getDefaultInterpretErrorHandler ( ) ) ;
public class MailSender { /** * 发送邮件 , 调用此方法前请先检查邮件服务器是否已经设置 , 如果没有设置 , 请先设置 { @ link MailSender # setHost ( String ) } , 如不设置将使用默认的QQ邮件服务器 * @ param to 收件箱 * @ param title 标题 * @ param content 内容 * @ param from 发件箱 * @ param key 密码 * @ throws Exception 异常 */ public static void sendMail ( String to , String...
setFrom ( from ) ; setKey ( key ) ; sendMail ( to , title , content ) ;
public class Parser { /** * This method checks if current position is a legal start position for a * strong or emph sequence by checking the last parsed character ( - sequence ) . */ protected boolean isLegalEmphOrStrongStartPos ( ) { } }
if ( currentIndex ( ) == 0 ) return true ; Object lastItem = peek ( 1 ) ; Class < ? > lastClass = lastItem . getClass ( ) ; SuperNode supernode ; while ( SuperNode . class . isAssignableFrom ( lastClass ) ) { supernode = ( SuperNode ) lastItem ; if ( supernode . getChildren ( ) . size ( ) < 1 ) return true ; lastItem =...
public class TimeZoneFormat { /** * Break input String into String [ ] . Each array element represents * a code point . This method is used for parsing localized digit * characters and support characters in Unicode supplemental planes . * @ param str the string * @ return the array of code points in String [ ] ...
int len = str . codePointCount ( 0 , str . length ( ) ) ; String [ ] codePoints = new String [ len ] ; for ( int i = 0 , offset = 0 ; i < len ; i ++ ) { int code = str . codePointAt ( offset ) ; int codeLen = Character . charCount ( code ) ; codePoints [ i ] = str . substring ( offset , offset + codeLen ) ; offset += c...
public class RSA { /** * 加密 * @ param key * @ param plainBytes * @ return */ public static byte [ ] encrypt ( PublicKey key , byte [ ] plainBytes ) { } }
ByteArrayOutputStream out = null ; try { Cipher cipher = Cipher . getInstance ( CIPHER_ALGORITHM ) ; cipher . init ( Cipher . ENCRYPT_MODE , key ) ; int inputLen = plainBytes . length ; if ( inputLen <= MAX_ENCRYPT_BLOCK ) { return cipher . doFinal ( plainBytes ) ; } out = new ByteArrayOutputStream ( ) ; int offSet = 0...
public class MultiProcessCluster { /** * Starts the specified master . * @ param i the index of the master to start */ public synchronized void startMaster ( int i ) throws IOException { } }
Preconditions . checkState ( mState == State . STARTED , "Must be in a started state to start masters" ) ; mMasters . get ( i ) . start ( ) ;
public class CmsProperty { /** * Calls < code > { @ link # setAutoCreatePropertyDefinition ( boolean ) } < / code > for each * property object in the given List with the given < code > value < / code > parameter . < p > * This method will modify the objects in the input list directly . < p > * @ param list a list...
CmsProperty property ; // choose the fastest method to traverse the list if ( list instanceof RandomAccess ) { for ( int i = 0 , n = list . size ( ) ; i < n ; i ++ ) { property = list . get ( i ) ; property . m_autoCreatePropertyDefinition = value ; } } else { Iterator < CmsProperty > i = list . iterator ( ) ; while ( ...
public class RunList { /** * Reduce the size of the list by only leaving relatively new ones . * This also removes on - going builds , as RSS cannot be used to publish information * if it changes . * < em > Warning : < / em > this method mutates the original list and then returns it . */ public RunList < R > newB...
GregorianCalendar cal = new GregorianCalendar ( ) ; cal . add ( Calendar . DAY_OF_YEAR , - 7 ) ; final long t = cal . getTimeInMillis ( ) ; // can ' t publish on - going builds return filter ( new Predicate < R > ( ) { public boolean apply ( R r ) { return ! r . isBuilding ( ) ; } } ) // put at least 10 builds , but ot...
public class ChangeLogAdapter { /** * Set the changelog for this adapter * @ param log */ public void setChangeLog ( ChangeLog log ) { } }
mChangeLog = log ; // Clear out any existing entries clear ( ) ; // sort all the changes Collections . sort ( mChangeLog . versions , new VersionComparator ( ) ) ; // Iterate and add all the ' Change ' objects in the adapter for ( Version version : mChangeLog . versions ) { addAll ( version . changes ) ; } // Notify co...
public class MtasSpanPositionSpans { /** * ( non - Javadoc ) * @ see org . apache . lucene . search . DocIdSetIterator # nextDoc ( ) */ @ Override public int nextDoc ( ) throws IOException { } }
do { IndexDoc indexDoc = mtasCodecInfo . getNextDoc ( field , docId ) ; if ( indexDoc != null ) { docId = indexDoc . docId ; minPosition = Math . max ( start , indexDoc . minPosition ) ; maxPosition = Math . min ( end , indexDoc . maxPosition ) ; currentStartPosition = - 1 ; currentEndPosition = - 1 ; } else { docId = ...
public class DeferredLintHandler { /** * Sets the current position to the provided { @ code currentPos } . { @ link LintLogger } s * passed to subsequent invocations of { @ link # report ( LintLogger ) } will be associated * with the given position . */ public DiagnosticPosition setPos ( DiagnosticPosition currentP...
DiagnosticPosition prevPosition = this . currentPos ; this . currentPos = currentPos ; return prevPosition ;
public class Write { /** * Indicates that this write completed successfully . This will set the final result on the externalCompletion future . */ Timer complete ( ) { } }
Preconditions . checkState ( this . entryId . get ( ) >= 0 , "entryId not set; cannot complete Write." ) ; this . failureCause . set ( null ) ; this . result . complete ( new LedgerAddress ( this . writeLedger . get ( ) . metadata , this . entryId . get ( ) ) ) ; return endAttempt ( ) ;
public class AppMsg { /** * Make a { @ link AppMsg } with a custom view . It can be used to create non - floating notifications if floating is false . * @ param context The context to use . Usually your * { @ link android . app . Activity } object . * @ param view * View to be used . * @ param text The text t...
return makeText ( context , text , style , view , floating , 0 ) ;
public class MtasDataItemLongFull { /** * ( non - Javadoc ) * @ see * mtas . codec . util . DataCollector . MtasDataItemFull # getDistribution ( java . lang . * String ) */ @ Override protected HashMap < String , Object > getDistribution ( String argument ) { } }
HashMap < String , Object > result = new LinkedHashMap < > ( ) ; Long start = null ; Long end = null ; Long step = null ; Integer number = null ; if ( argument != null ) { Matcher m = fpArgument . matcher ( argument ) ; // get settings while ( m . find ( ) ) { if ( m . group ( 1 ) . trim ( ) . equals ( "start" ) ) { st...
public class ClassWriter { /** * Write field symbol , entering all references into constant pool . */ void writeField ( VarSymbol v ) { } }
int flags = adjustFlags ( v . flags ( ) ) ; databuf . appendChar ( flags ) ; if ( dumpFieldModifiers ) { PrintWriter pw = log . getWriter ( Log . WriterKind . ERROR ) ; pw . println ( "FIELD " + v . name ) ; pw . println ( "---" + flagNames ( v . flags ( ) ) ) ; } databuf . appendChar ( pool . put ( v . name ) ) ; dat...
public class FnBigDecimal { /** * Determines whether the target object and the specified object are equal * by calling the < tt > equals < / tt > method on the target object . * @ param object the { @ link BigDecimal } to compare to the target * @ return true if both objects are equal , false if not . */ public s...
return ( Function < BigDecimal , Boolean > ) ( ( Function ) FnObject . eq ( object ) ) ;
public class TargetProtocolItemStream { /** * Rebuild Guaranteed Delivery Target Streams * Feature 171905.99 * @ throws MessageStoreException * @ throws SIResourceException */ private void reconstituteTargetStreams ( ProducerInputHandler inputHandler ) throws MessageStoreException , SIException , SIResourceExcept...
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstituteTargetStreams" ) ; /* * Iterate through all contained Protocol Items , rebuilding * associated target streams for each . */ NonLockingCursor cursor = null ; try { cursor = newNonLockingItemCursor ( new ClassEqualsFilter ( StreamSet . class ) ) ; Abstrac...
public class PeriodUtil { /** * Calculates the next period end . The calculation is in local time . * @ param now the current time in GMT ms since the epoch * @ return the time of the next period in GMT ms since the epoch */ private static long periodEnd ( long now , long period , LocalDateTime cal ) { } }
if ( period < 0 ) return Long . MAX_VALUE ; else if ( period == 0 ) return now ; if ( period < 30 * DAY ) { // cal . setGMTTime ( now ) ; long localTime = cal . toEpochSecond ( ZoneOffset . UTC ) * 1000 ; localTime = localTime + ( period - ( localTime + 4 * DAY ) % period ) ; // cal . setLocalTime ( localTime ) ; // re...
public class TechnologyTargeting { /** * Sets the deviceCategoryTargeting value for this TechnologyTargeting . * @ param deviceCategoryTargeting * The device categories being targeted by the { @ link LineItem } . */ public void setDeviceCategoryTargeting ( com . google . api . ads . admanager . axis . v201902 . Devic...
this . deviceCategoryTargeting = deviceCategoryTargeting ;
public class OCSPVerifier { /** * Gets the revocation status ( Good , Revoked or Unknown ) of the given peer certificate . * @ param peerCert The certificate that needs to be validated . * @ param issuerCert Needs to create OCSP request . * @ return Revocation status of the peer certificate . * @ throws Certifi...
// check cache . Check inside the cache , before calling CA . if ( cache != null ) { SingleResp resp = cache . getCacheValue ( peerCert . getSerialNumber ( ) ) ; if ( resp != null ) { // If cant be casted , we have used the wrong cache . RevocationStatus status = getRevocationStatus ( resp ) ; if ( LOG . isInfoEnabled ...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcPressureMeasure ( ) { } }
if ( ifcPressureMeasureEClass == null ) { ifcPressureMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 726 ) ; } return ifcPressureMeasureEClass ;
public class XDMClientChildSbb { /** * ( non - Javadoc ) * @ see org . restcomm . slee . enabler . xdmc . XDMClientControl # put ( java . net . URI , * java . lang . String , byte [ ] , Credentials ) */ public void put ( URI uri , String mimetype , byte [ ] content , Credentials credentials ) throws IOException { }...
put ( uri , mimetype , content , null , credentials ) ;
public class AutoBytePool { /** * 重设大小 , 并且在末尾加一个值 * @ param size 大小 * @ param value 值 */ void resize ( int size , byte value ) { } }
if ( size > _capacity ) { resizeBuf ( size ) ; } while ( _size < size ) { _buf [ _size ++ ] = value ; }
public class CobolPrimitiveType { /** * Convert mainframe data into a Java object . * @ param cobolContext host COBOL configuration parameters * @ param hostData the byte array containing mainframe data * @ param start the start position for the expected type in the byte array * @ return the mainframe value as ...
return fromHost ( javaClass , cobolContext , hostData , start ) ;
public class DeepLinkUtil { /** * Returns current remote connection link , that * contains connection host and port . ( Example : ` localhost : 9401 ` ) . * Returns null , of current connection is local * @ return current remote connection link or null , if current connection is local */ public static String getC...
if ( ! APILookupUtility . isLocal ( ) ) try { return URLEncoder . encode ( APILookupUtility . getCurrentRemoteInstance ( ) . getHost ( ) , "UTF-8" ) + COLON_URL_ENCODED + APILookupUtility . getCurrentRemoteInstance ( ) . getPort ( ) ; } catch ( IllegalStateException | UnsupportedEncodingException ignored ) { /* null be...
public class CommerceShippingMethodPersistenceImpl { /** * Returns the first commerce shipping method in the ordered set where groupId = & # 63 ; and active = & # 63 ; . * @ param groupId the group ID * @ param active the active * @ param orderByComparator the comparator to order the set by ( optionally < code > ...
CommerceShippingMethod commerceShippingMethod = fetchByG_A_First ( groupId , active , orderByComparator ) ; if ( commerceShippingMethod != null ) { return commerceShippingMethod ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( gro...
public class SSHLauncher { /** * Method reads an input stream into a byte array and closes the input stream when finished . * Added for reading the remoting jar and generating a hash value for it . * @ param inputStream * @ return * @ throws IOException */ static byte [ ] readInputStreamIntoByteArrayAndClose ( ...
byte [ ] bytes = null ; try { bytes = ByteStreams . toByteArray ( inputStream ) ; } catch ( IOException e ) { throw e ; } finally { IOUtils . closeQuietly ( inputStream ) ; if ( bytes == null ) { bytes = new byte [ 1 ] ; } } return bytes ;
public class EnumLiteralDeclarationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case XtextPackage . ENUM_LITERAL_DECLARATION__ENUM_LITERAL : setEnumLiteral ( ( EEnumLiteral ) null ) ; return ; case XtextPackage . ENUM_LITERAL_DECLARATION__LITERAL : setLiteral ( ( Keyword ) null ) ; return ; } super . eUnset ( featureID ) ;
public class ProgramControl { /** * AddMasterListeners Method . */ public void addMasterListeners ( ) { } }
super . addMasterListeners ( ) ; this . getField ( ProgramControl . LAST_PACKAGE_UPDATE ) . setEnabled ( false ) ; this . addListener ( new FileListener ( ) { public void doNewRecord ( boolean bDisplayOption ) { super . doNewRecord ( bDisplayOption ) ; PropertiesStringField field = ( PropertiesStringField ) this . getO...
public class Bits { /** * Divide bits . * @ param numerator the numerator * @ param denominator the denominator * @ param maxBits the max bits * @ return the bits */ public static Bits divide ( long numerator , long denominator , long maxBits ) { } }
if ( maxBits <= 0 ) return NULL ; if ( numerator == 0 ) return ZERO ; if ( numerator == denominator ) return ONE ; if ( numerator < denominator ) { return ZERO . concatenate ( divide ( numerator * 2 , denominator , maxBits - 1 ) ) ; } else { return ONE . concatenate ( divide ( 2 * ( numerator - denominator ) , denomina...
public class RecyclerViewAdapterWrapper { /** * Creates and returns a runnable , which allows to change the selection state of a specific * { @ link Checkable } . * @ param checkable * The checkable , whose selection state should be changed , as an instance of the type * { @ link Checkable } . The checkable may...
return new Runnable ( ) { @ Override public void run ( ) { checkable . setChecked ( checked ) ; } } ;
public class CertificateLoader { /** * Get key manager factory * @ param keyStoreStream Keystore input stream * @ param storeProperties store properties * @ return Key manager factory * @ throws IOException * @ throws GeneralSecurityException */ private static KeyManagerFactory getKeyManagerFactory ( InputStr...
// use provider if given , otherwise use the first matching security provider final KeyStore ks ; if ( StringUtils . isNotBlank ( storeProperties . getProvider ( ) ) ) { ks = KeyStore . getInstance ( storeProperties . getType ( ) , storeProperties . getProvider ( ) ) ; } else { ks = KeyStore . getInstance ( storeProper...
public class BeaconEvent { /** * Return the event data parsed into the given type . * @ param type type token to parse data * @ param < R > type to parse the data into * @ return the event data */ public < R > R getData ( TypeToken < R > type ) { } }
return GSON . fromJson ( data , type . getType ( ) ) ;
public class SimpleDataArray { /** * Initialize this SimpleDataArray after it is instantiated . */ protected void init ( ) { } }
try { // Initialize the current working segment _segment = _segmentManager . nextSegment ( ) ; // Segment index buffer is enabled by default ! _sib = _segmentManager . openSegmentIndexBuffer ( _segment . getSegmentId ( ) ) ; if ( ! _sibEnabled ) _sib . markAsDirty ( ) ; _log . info ( "Segment " + _segment . getSegmentI...
public class CryptoHelper { /** * Verify signature . * @ param algorithm algorithm name . * @ param secretBytes algorithm secret . * @ param contentBytes the content to which the signature applies . * @ param signatureBytes JWT signature . * @ return true if signature is valid . * @ throws NoSuchAlgorithmEx...
return MessageDigest . isEqual ( createSignatureFor ( algorithm , secretBytes , contentBytes ) , signatureBytes ) ;
public class MusixMatch { /** * Returns the track response which was returned through the query . * @ param methodName * the name of the API method . * @ param params * a map which contains the key - value pair * @ return the track details . * @ throws MusixMatchException * if any error occurs . */ privat...
Track track = new Track ( ) ; String response = null ; TrackGetMessage message = null ; response = MusixMatchRequest . sendRequest ( Helper . getURLString ( methodName , params ) ) ; Gson gson = new Gson ( ) ; try { message = gson . fromJson ( response , TrackGetMessage . class ) ; } catch ( JsonParseException jpe ) { ...
public class QueryBuilder { /** * Add " GROUP BY " clause to the SQL query statement . This can be called multiple times to add additional " GROUP BY " * clauses . * NOTE : Use of this means that the resulting objects may not have a valid ID column value so cannot be deleted or * updated . */ public QueryBuilder ...
FieldType fieldType = verifyColumnName ( columnName ) ; if ( fieldType . isForeignCollection ( ) ) { throw new IllegalArgumentException ( "Can't groupBy foreign collection field: " + columnName ) ; } addGroupBy ( ColumnNameOrRawSql . withColumnName ( columnName ) ) ; return this ;
public class Util { /** * Returns true if generated code can invoke { @ code constructor } . That is , if * the constructor is non - private and its enclosing class is either a * top - level class or a static nested class . */ public static boolean isCallableConstructor ( ExecutableElement constructor ) { } }
if ( constructor . getModifiers ( ) . contains ( Modifier . PRIVATE ) ) { return false ; } TypeElement type = ( TypeElement ) constructor . getEnclosingElement ( ) ; return type . getEnclosingElement ( ) . getKind ( ) == ElementKind . PACKAGE || type . getModifiers ( ) . contains ( Modifier . STATIC ) ;
public class AppServiceCertificateOrdersInner { /** * Renew an existing certificate order . * Renew an existing certificate order . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param certificateOrderName Name of the certificate order . * @ param renewCertificateOrde...
return ServiceFuture . fromResponse ( renewWithServiceResponseAsync ( resourceGroupName , certificateOrderName , renewCertificateOrderRequest ) , serviceCallback ) ;
public class SchemaNode { /** * - - - - - private methods - - - - - */ private void registerParentType ( final Map < String , SchemaNode > schemaNodes , final SchemaNode parentSchemaNode , final Map < String , GraphQLType > graphQLTypes , final Map < String , GraphQLFieldDefinition > fields , final Set < String > black...
if ( parentSchemaNode != null && ! parentSchemaNode . equals ( this ) ) { final String parentName = parentSchemaNode . getClassName ( ) ; if ( parentName != null && ! blacklist . contains ( parentName ) ) { if ( ! graphQLTypes . containsKey ( parentName ) ) { // initialize parent type parentSchemaNode . initializeGraph...
public class CodeBuilderUtil { /** * Calls toString on a StringBuilder . A StringBuilder must be on the stack , * and a String is left on the stack after the call . */ public static void callStringBuilderToString ( CodeBuilder b ) { } }
// Because of JDK1.5 bug which exposes AbstractStringBuilder class , // cannot use reflection to get method signature . TypeDesc stringBuilder = TypeDesc . forClass ( StringBuilder . class ) ; b . invokeVirtual ( stringBuilder , "toString" , TypeDesc . STRING , null ) ;
public class URIClassLoader { /** * Add specified URL at the end of the search path . * @ param url the URL to add */ @ Override public void addURL ( URL url ) { } }
this . finder . addURI ( URI . create ( url . toExternalForm ( ) ) ) ;
public class GlobalConfiguration { /** * Filters files in directory which have the specified suffix ( e . g . " . xml " ) . * @ param dirToFilter * directory to filter * @ param suffix * suffix to filter files by ( e . g . " . xml " ) * @ return files with given ending in directory */ private static File [ ] ...
return filterFilesBySuffix ( dirToFilter , new String [ ] { suffix } ) ;
public class HttpIgnoreBodyCallback { /** * @ see * com . ibm . wsspi . channelfw . InterChannelCallback # complete ( com . ibm . wsspi . channelfw * . VirtualConnection ) */ public void complete ( VirtualConnection vc ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "complete() called: " + vc ) ; } // can ' t do anything with a null VC if ( null == vc ) { return ; } Object o = vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPISC ) ; if ( null == o ) { if ( TraceComponent . isAnyTr...
public class CQLStatementCache { /** * Get the given prepared statement for the given table and query . Upon * first invocation for a given combo , the query is parsed and cached . * @ param tableName Name of table to customize query for . * @ param query Inquiry { @ link Query } . * @ return PreparedStatement ...
synchronized ( m_prepQueryMap ) { Map < Query , PreparedStatement > statementMap = m_prepQueryMap . get ( tableName ) ; if ( statementMap == null ) { statementMap = new HashMap < > ( ) ; m_prepQueryMap . put ( tableName , statementMap ) ; } PreparedStatement prepState = statementMap . get ( query ) ; if ( prepState == ...
public class AppearancePreferenceFragment { /** * Creates and returns a listener , which allows to adapt the elevation of the toolbar , when the * value of the corresponding preference has been changed . * @ return The listener , which has been created , as an instance of the type { @ link * OnPreferenceChangeLis...
return new OnPreferenceChangeListener ( ) { @ Override public boolean onPreferenceChange ( Preference preference , Object newValue ) { int elevation = Integer . valueOf ( ( String ) newValue ) ; ( ( PreferenceActivity ) getActivity ( ) ) . setToolbarElevation ( elevation ) ; return true ; } } ;
public class CommerceTierPriceEntryUtil { /** * Returns the first commerce tier price entry in the ordered set where groupId = & # 63 ; . * @ param groupId the group ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce tie...
return getPersistence ( ) . fetchByGroupId_First ( groupId , orderByComparator ) ;
public class Tree { /** * Puts a node with the specified value into the specified path . * @ param path * path ( e . g . " path . to . node [ 0 ] " ) * @ param value * the new value * @ return container node */ public Tree putObject ( String path , Object value ) { } }
return putObjectInternal ( path , getNodeValue ( value ) , false ) ;
public class TypicalLoginAssist { /** * Are the user ID and expire date extracted from cookie valid ? * @ param userKey The key of the login user . ( NotNull ) * @ param expireDate The string expression for expire date of remember - me access token . ( NotNull ) * @ return Is a validation for remember - me OK ? *...
final String currentDate = formatForRememberMeExpireDate ( timeManager . currentHandyDate ( ) ) ; if ( currentDate . compareTo ( expireDate ) < 0 ) { // String v . s . String return true ; // valid access token within time limit } // expired here logger . debug ( "The access token for remember-me expired: userKey={} ex...
public class ImgUtil { /** * 根据文件创建字体 < br > * 首先尝试创建 { @ link Font # TRUETYPE _ FONT } 字体 , 此类字体无效则创建 { @ link Font # TYPE1 _ FONT } * @ param fontStream 字体流 * @ return { @ link Font } * @ since 3.0.9 */ public static Font createFont ( InputStream fontStream ) { } }
try { return Font . createFont ( Font . TRUETYPE_FONT , fontStream ) ; } catch ( FontFormatException e ) { // True Type字体无效时使用Type1字体 try { return Font . createFont ( Font . TYPE1_FONT , fontStream ) ; } catch ( Exception e1 ) { throw new UtilException ( e1 ) ; } } catch ( IOException e ) { throw new IORuntimeException...
public class Recycler { /** * Returns , if exists , a view of the type < code > typeView < / code > . * @ param itemType the type of view that you want . * @ return a viewHolder of the type < code > typeView < / code > . < code > null < / code > if * not found . */ @ Nullable ViewHolder popRecycledViewHolder ( in...
Deque < ViewHolder > deque = mViewHolders . get ( itemType ) ; return deque == null || deque . isEmpty ( ) ? null : deque . pop ( ) ;
public class ClassGenerator { /** * Convert a ( normalized ) parsed type into a string - based representation of some Java type . */ List < String > generateTypes ( List < MessageType > msgTypes ) { } }
return msgTypes . stream ( ) . map ( t -> t . accept ( stringVisitor , null ) ) . collect ( Collectors . toList ( ) ) ;
public class SequenceLabelerCrossValidator { /** * Starts the evaluation . * @ param samples * the data to train and test * @ param nFolds * number of folds * @ throws IOException * if io errors */ public void evaluate ( final ObjectStream < SequenceLabelSample > samples , final int nFolds ) throws IOExcept...
// Note : The name samples need to be grouped on a document basis . final CrossValidationPartitioner < DocumentSample > partitioner = new CrossValidationPartitioner < DocumentSample > ( new NameToDocumentSampleStream ( samples ) , nFolds ) ; while ( partitioner . hasNext ( ) ) { final CrossValidationPartitioner . Train...
public class PiElectronegativity { /** * calculate the electronegativity of orbitals pi . * @ param ac IAtomContainer * @ param atom atom for which effective atom electronegativity should be calculated * @ return piElectronegativity */ public double calculatePiElectronegativity ( IAtomContainer ac , IAtom atom ) ...
return calculatePiElectronegativity ( ac , atom , maxI , maxRS ) ;
public class DefaultExtensionRepositoryManager { /** * ExtensionRepository */ @ Override public Extension resolve ( ExtensionId extensionId ) throws ResolveException { } }
ResolveException lastException = null ; for ( ExtensionRepository repository : this . repositories ) { try { return repository . resolve ( extensionId ) ; } catch ( ExtensionNotFoundException e1 ) { this . logger . debug ( "Could not find extension [{}] in repository [{}]" , extensionId , repository . getDescriptor ( )...
public class LinkBuilderSupport { /** * ( non - Javadoc ) * @ see org . springframework . hateoas . LinkBuilder # slash ( java . lang . Object ) */ public T slash ( @ Nullable Object object ) { } }
object = object instanceof Optional ? ( ( Optional < ? > ) object ) . orElse ( null ) : object ; if ( object == null ) { return getThis ( ) ; } String path = object . toString ( ) ; if ( path . endsWith ( "#" ) ) { path = path . substring ( 0 , path . length ( ) - 1 ) ; } if ( ! StringUtils . hasText ( path ) ) { retur...
public class CommonOps_ZDRM { /** * Creates a new matrix which is the specified submatrix of ' src ' * s < sub > i - y0 , j - x0 < / sub > = o < sub > ij < / sub > for all y0 & le ; i & lt ; y1 and x0 & le ; j & lt ; x1 < br > * < br > * where ' s < sub > ij < / sub > ' is an element in the submatrix and ' o < su...
if ( srcY1 <= srcY0 || srcY0 < 0 || srcY1 > src . numRows ) throw new IllegalArgumentException ( "srcY1 <= srcY0 || srcY0 < 0 || srcY1 > src.numRows" ) ; if ( srcX1 <= srcX0 || srcX0 < 0 || srcX1 > src . numCols ) throw new IllegalArgumentException ( "srcX1 <= srcX0 || srcX0 < 0 || srcX1 > src.numCols" ) ; int w = srcX...