signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ApiOvhMe { /** * Get this object properties * REST : GET / me / fidelityAccount */ public OvhFidelityAccount fidelityAccount_GET ( ) throws IOException { } }
String qPath = "/me/fidelityAccount" ; StringBuilder sb = path ( qPath ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhFidelityAccount . class ) ;
public class JcrQuery { /** * { @ inheritDoc } * @ see javax . jcr . query . Query # execute ( ) */ @ SuppressWarnings ( "deprecation" ) @ Override public org . modeshape . jcr . api . query . QueryResult execute ( ) throws RepositoryException { } }
context . checkValid ( ) ; final long start = System . nanoTime ( ) ; // Create an executable query and set it on this object . . . CancellableQuery newExecutable = context . createExecutableQuery ( query , hints , variables ) ; CancellableQuery executable = executingQuery . getAndSet ( newExecutable ) ; if ( executabl...
public class CheckpointTupleForwarder { /** * Forwards the checkpoint tuple downstream . Sub - classes can override * with the logic for handling checkpoint tuple . * @ param checkpointTuple the checkpoint tuple * @ param action the action ( prepare , commit , rollback or initstate ) * @ param txid the transact...
collector . emit ( CheckpointSpout . CHECKPOINT_STREAM_ID , checkpointTuple , new Values ( txid , action ) ) ; collector . ack ( checkpointTuple ) ;
public class TypeLexer { /** * $ ANTLR start " EXT " */ public final void mEXT ( ) throws RecognitionException { } }
try { int _type = EXT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // org / javaruntype / type / parser / Type . g : 37:5 : ( ' EXT ' ) // org / javaruntype / type / parser / Type . g : 37:7 : ' EXT ' { match ( "EXT" ) ; } state . type = _type ; state . channel = _channel ; } finally { }
public class A_CmsPublishGroupHelper { /** * Given a list of resources , this method returns a list of their modification dates . < p > * @ param resources a list of resources * @ return the modification dates of the resources , in the same order as the resources */ public List < Long > getModificationDates ( List ...
List < Long > result = new ArrayList < Long > ( ) ; for ( RESOURCE res : resources ) { result . add ( new Long ( getDateLastModified ( res ) ) ) ; } return result ;
public class Passwords { /** * Validates a password using a hash . * @ param password * the password to check * @ param goodHash * the hash of the valid password * @ return true if the password is correct , false if not */ public static boolean validatePassword ( String password , String goodHash ) throws NoS...
return validatePassword ( password . toCharArray ( ) , goodHash ) ;
public class BackupImpl { /** * Must be called by the cache when the line is synchronized , and under a read - lock ( i . e . between startBackup and endBackup ) * @ param id * @ param version */ @ Override public void backup ( long id , long version ) { } }
if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "Backup: {} ver: {} {}" , new Object [ ] { hex ( id ) , version , copyImmediately ? "(COPY)" : "" } ) ; if ( copyImmediately ) { currentBackups . put ( id , makeBackup ( cache . getLine ( id ) , version ) ) ; oldMap ( ) . remove ( id ) ; } else map . put ( id , new BackupEn...
public class TimerServiceRamp { /** * Implements { @ link Timers # schedule ( Runnable , TimerScheduler ) } */ @ Override public void schedule ( @ Pin Consumer < ? super Cancel > task , LongUnaryOperator scheduler , Result < ? super Cancel > result ) { } }
Objects . requireNonNull ( task ) ; Objects . requireNonNull ( scheduler ) ; // cancel ( task ) ; long now = CurrentTime . currentTime ( ) ; long nextTime = scheduler . applyAsLong ( now ) ; TimerListener listener = new TimerListener ( task , scheduler ) ; result . ok ( listener ) ; if ( now <= nextTime ) { listener . ...
public class ReceiptTemplate { /** * Set Address * @ param street _ 1 the street address 1 * @ param street _ 2 the street address 2 * @ param city the city * @ param postal _ code the postal code * @ param state the state * @ param country the country */ public void setAddress ( String street_1 , String st...
this . address . put ( "street_1" , street_1 ) ; this . address . put ( "street_2" , street_2 ) ; this . address . put ( "city" , city ) ; this . address . put ( "postal_code" , postal_code ) ; this . address . put ( "state" , state ) ; this . address . put ( "country" , country ) ;
public class Path { /** * Returns a qualified path object . */ public Path makeQualified ( FileSystem fs ) { } }
Path path = this ; if ( ! isAbsolute ( ) ) { FileSystem . LogForCollect . info ( "make Qualify non absolute path: " + this . toString ( ) + " working directory: " + fs . getWorkingDirectory ( ) ) ; path = new Path ( fs . getWorkingDirectory ( ) , this ) ; } URI pathUri = path . toUri ( ) ; URI fsUri = fs . getUri ( ) ;...
public class SarlcConfigModule { /** * Replies the instance of the sarl configuration . * @ param configFactory accessor to the bootique factory . * @ param injector the current injector . * @ return the path configuration accessor . */ @ SuppressWarnings ( "static-method" ) @ Provides @ Singleton public SarlConf...
final SarlConfig config = SarlConfig . getConfiguration ( configFactory ) ; injector . injectMembers ( config ) ; return config ;
public class HBaseUtils { /** * From bytes . * @ param b * the b * @ param clazz * the clazz * @ return the object */ public static Object fromBytes ( byte [ ] b , Class < ? > clazz ) { } }
if ( clazz . isAssignableFrom ( String . class ) ) { return Bytes . toString ( b ) ; } else if ( clazz . equals ( int . class ) || clazz . isAssignableFrom ( Integer . class ) ) { return Bytes . toInt ( b ) ; } else if ( clazz . equals ( long . class ) || clazz . isAssignableFrom ( Long . class ) ) { return Bytes . toL...
public class IVFPQ { /** * Computes the residual vector . * @ param vector * The original vector * @ param centroidIndex * The centroid of the coarse quantizer from which the original vector is subtracted * @ return The residual vector */ private double [ ] computeResidualVector ( double [ ] vector , int cent...
double [ ] residualVector = new double [ vectorLength ] ; for ( int i = 0 ; i < vectorLength ; i ++ ) { residualVector [ i ] = coarseQuantizer [ centroidIndex ] [ i ] - vector [ i ] ; } return residualVector ;
public class MatrixExtensions { /** * Replies the division of this matrix by the given scalar : { @ code left / right } . * < p > This function is an implementation of the operator for * the languages that defined or based on the * < a href = " https : / / www . eclipse . org / Xtext / " > Xtext framework < / a >...
assert right != null : AssertMessages . notNullParameter ( 1 ) ; final M result = ( M ) right . clone ( ) ; result . set ( left / right . getM00 ( ) , left / right . getM01 ( ) , left / right . getM02 ( ) , left / right . getM10 ( ) , left / right . getM11 ( ) , left / right . getM12 ( ) , left / right . getM20 ( ) , l...
public class SpiceManager { /** * Put some new data in cache using cache key < i > requestCacheKey < / i > . This * method doesn ' t perform any network processing , it just data in cache , * erasing any previsouly saved date in cache using the same class and key . * Don ' t call this method in the main thread be...
return executeCommand ( new PutDataInCacheCommand < T > ( this , data , cacheKey ) ) ;
public class ServletContextResource { /** * This implementation delegates to < code > ServletContext . getResourceAsStream < / code > , * but throws a FileNotFoundException if no resource found . * @ see javax . servlet . ServletContext # getResourceAsStream ( String ) */ public InputStream getInputStream ( ) throw...
InputStream is = this . servletContext . getResourceAsStream ( this . path ) ; if ( is == null ) { throw new FileNotFoundException ( "Could not open " + getDescription ( ) ) ; } return is ;
public class TreeInfo { /** * Return the statement referenced by a label . * If the label refers to a loop or switch , return that switch * otherwise return the labelled statement itself */ public static JCTree referencedStatement ( JCLabeledStatement tree ) { } }
JCTree t = tree ; do t = ( ( JCLabeledStatement ) t ) . body ; while ( t . hasTag ( LABELLED ) ) ; switch ( t . getTag ( ) ) { case DOLOOP : case WHILELOOP : case FORLOOP : case FOREACHLOOP : case SWITCH : return t ; default : return tree ; }
public class StringGroovyMethods { /** * Support the subscript operator for CharSequence . * @ param text a CharSequence * @ param index the index of the Character to get * @ return the Character at the given index * @ since 1.0 */ public static CharSequence getAt ( CharSequence text , int index ) { } }
index = normaliseIndex ( index , text . length ( ) ) ; return text . subSequence ( index , index + 1 ) ;
public class UpdateClusterConfigRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateClusterConfigRequest updateClusterConfigRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateClusterConfigRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateClusterConfigRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( updateClusterConfigRequest . getResourcesVpcConfig ( ) , RESOURCES...
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 565:1 : formalParameters : ' ( ' ( formalParameterDecls ) ? ' ) ' ; */ public final void formalParameters ( ) throws RecognitionException { } }
int formalParameters_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 56 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 566:5 : ( ' ( ' ( formalParameterDecls ) ? ' ) ' ) // src / main / resources / org / d...
public class OptionsConnectionPanel { /** * This method initializes panelProxyChain * @ return javax . swing . JPanel */ private JPanel getPanelProxyChain ( ) { } }
if ( panelProxyChain == null ) { panelProxyChain = new JPanel ( ) ; java . awt . GridBagConstraints gridBagConstraints92 = new GridBagConstraints ( ) ; javax . swing . JLabel jLabel8 = new JLabel ( ) ; java . awt . GridBagConstraints gridBagConstraints102 = new GridBagConstraints ( ) ; panelProxyChain . setLayout ( new...
public class CmsGwtService { /** * Ensures that the user session is still valid . < p > * @ throws CmsException if the current user is the guest user */ protected void ensureSession ( ) throws CmsException { } }
CmsUser user = getCmsObject ( ) . getRequestContext ( ) . getCurrentUser ( ) ; if ( user . isGuestUser ( ) ) { throw new CmsException ( Messages . get ( ) . container ( Messages . ERR_SESSION_EXPIRED_0 ) ) ; }
public class SNAXParser { /** * Parse a data stream , represented by a Reader , to completion . This will process the entire * document and trigger any ElementHandler calls that result from applying the selectors defined * in the NodeModel . The data parameter will be passed back as an argument to all ElementHandle...
// TODO : this needs to catch concurrent parse attempts init ( reader , data ) ; for ( XMLEvent event = xmlReader . nextEvent ( ) ; xmlReader . hasNext ( ) ; event = xmlReader . nextEvent ( ) ) { processEvent ( event ) ; }
public class FieldType { /** * Note the start of the default value in the parsed thrift file , this can be used * for making more accurate exception / parse data from the const parser . * @ return Optional of the < code > value _ start _ pos < / code > field value . */ @ javax . annotation . Nonnull public java . u...
return java . util . Optional . ofNullable ( mValueStartPos ) ;
public class AbstractSegment3F { /** * Compute and replies the perpendicular squared distance from a point to a segment . * @ param sx1 * is the X coord of the first point of the segment * @ param sy1 * is the Y coord of the first point of the segment * @ param sz1 * is the Z coord of the first point of the...
double ratio = getPointProjectionFactorOnSegmentLine ( px , py , pz , sx1 , sy1 , sz1 , sx2 , sy2 , sz2 ) ; if ( ratio <= 0. ) return FunctionalPoint3D . distanceSquaredPointPoint ( px , py , pz , sx1 , sy1 , sz1 ) ; if ( ratio >= 1. ) return FunctionalPoint3D . distanceSquaredPointPoint ( px , py , pz , sx2 , sy2 , sz...
public class FontSize { /** * Returns the font size expressed in points . * @ return Points . */ public final float toPoint ( ) { } }
if ( unit == FontSizeUnit . PIXEL ) { return ( size / 4 * 3 ) ; } if ( unit == FontSizeUnit . EM ) { return ( size * 12 ) ; } if ( unit == FontSizeUnit . PERCENT ) { return ( size / 100 * 12 ) ; } if ( unit == FontSizeUnit . POINT ) { return size ; } throw new IllegalStateException ( "Unknown unit: " + unit ) ;
public class OAuthConsumerContextFilter { /** * Common logic for OAuth failed . ( Note that the default logic doesn ' t pass the failure through so as to not mess * with the current authentication . ) * @ param request The request . * @ param response The response . * @ param failure The failure . * @ throws ...
try { // attempt to set the last exception . request . getSession ( ) . setAttribute ( OAUTH_FAILURE_KEY , failure ) ; } catch ( Exception e ) { // fall through . . . . } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( failure ) ; } if ( getOAuthFailureHandler ( ) != null ) { getOAuthFailureHandler ( ) . handle ( reque...
public class HttpBase { /** * 设置请求头 < br > * 不覆盖原有请求头 * @ param headers 请求头 * @ param isOverride 是否覆盖已有头信息 * @ return this * @ since 4.0.8 */ public T header ( Map < String , List < String > > headers , boolean isOverride ) { } }
if ( CollectionUtil . isEmpty ( headers ) ) { return ( T ) this ; } String name ; for ( Entry < String , List < String > > entry : headers . entrySet ( ) ) { name = entry . getKey ( ) ; for ( String value : entry . getValue ( ) ) { this . header ( name , StrUtil . nullToEmpty ( value ) , isOverride ) ; } } return ( T )...
public class Utils { /** * Compares two Objects for equality . This functionality is provided by { @ code * Objects . equal ( Object , Object ) } in Java 7. */ public static boolean equalsObjects ( @ javax . annotation . Nullable Object x , @ javax . annotation . Nullable Object y ) { } }
return x == null ? y == null : x . equals ( y ) ;
public class HttpMethodDirector { /** * Process the redirect response . * @ return < code > true < / code > if the redirect was successful */ private boolean processRedirectResponse ( final HttpMethod method ) throws RedirectException { } }
// get the location header to find out where to redirect to Header locationHeader = method . getResponseHeader ( "location" ) ; if ( locationHeader == null ) { // got a redirect response , but no location header LOG . error ( "Received redirect response " + method . getStatusCode ( ) + " but no location header" ) ; ret...
public class AbstractWatchService { /** * Registers the given watchable with this service , returning a new watch key for it . This * implementation just checks that the service is open and creates a key ; subclasses may override * it to do other things as well . */ public Key register ( Watchable watchable , Itera...
checkOpen ( ) ; return new Key ( this , watchable , eventTypes ) ;
public class HessianSchurComplement_DSCC { /** * Compuets the Hessian in block form * @ param jacLeft ( Input ) Left side of Jacobian * @ param jacRight ( Input ) Right side of Jacobian */ @ Override public void computeHessian ( DMatrixSparseCSC jacLeft , DMatrixSparseCSC jacRight ) { } }
A . reshape ( jacLeft . numCols , jacLeft . numCols , 1 ) ; B . reshape ( jacLeft . numCols , jacRight . numCols , 1 ) ; D . reshape ( jacRight . numCols , jacRight . numCols , 1 ) ; // take advantage of the inner product ' s symmetry when possible to reduce // the number of calculations CommonOps_DSCC . innerProductLo...
public class FluentLogger { /** * Returns a new logger instance which parses log messages using printf format for the enclosing * class using the system default logging backend . */ public static FluentLogger forEnclosingClass ( ) { } }
// NOTE : It is _ vital _ that the call to " caller finder " is made directly inside the static // factory method . See getCallerFinder ( ) for more information . String loggingClass = Platform . getCallerFinder ( ) . findLoggingClass ( FluentLogger . class ) ; return new FluentLogger ( Platform . getBackend ( loggingC...
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 , null , priority ) ;
public class CPMeasurementUnitPersistenceImpl { /** * Returns the number of cp measurement units where groupId = & # 63 ; and key = & # 63 ; and type = & # 63 ; . * @ param groupId the group ID * @ param key the key * @ param type the type * @ return the number of matching cp measurement units */ @ Override pub...
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_K_T ; Object [ ] finderArgs = new Object [ ] { groupId , key , type } ; Long count = ( Long ) finderCache . getResult ( finderPath , finderArgs , this ) ; if ( count == null ) { StringBundler query = new StringBundler ( 4 ) ; query . append ( _SQL_COUNT_CPMEASUREMENTUNIT_W...
public class RTreeIndexCoreExtension { /** * Get or create the extension * @ param featureTable * feature table * @ return extension */ public Extensions getOrCreate ( FeatureTable featureTable ) { } }
return getOrCreate ( featureTable . getTableName ( ) , featureTable . getGeometryColumn ( ) . getName ( ) ) ;
public class Node { /** * Unregister a listener for publication events . * @ param listener The handler to unregister */ public void removeItemEventListener ( @ SuppressWarnings ( "rawtypes" ) ItemEventListener listener ) { } }
StanzaListener conListener = itemEventToListenerMap . remove ( listener ) ; if ( conListener != null ) pubSubManager . getConnection ( ) . removeSyncStanzaListener ( conListener ) ;
public class streamselector { /** * Use this API to fetch all the streamselector resources that are configured on netscaler . */ public static streamselector [ ] get ( nitro_service service ) throws Exception { } }
streamselector obj = new streamselector ( ) ; streamselector [ ] response = ( streamselector [ ] ) obj . get_resources ( service ) ; return response ;
public class Node { /** * Remove an attribute from this element . * @ param attributeKey The attribute to remove . * @ return this ( for chaining ) */ public Node removeAttr ( String attributeKey ) { } }
Validate . notNull ( attributeKey ) ; attributes ( ) . removeIgnoreCase ( attributeKey ) ; return this ;
public class Stream { /** * Sample code : * < pre > * < code > * final BlockingQueue < String > queue = new ArrayBlockingQueue < > ( 32 ) ; * Stream . observe ( queue , Duration . ofMillis ( 100 ) ) . filter ( s - > s . startsWith ( " a " ) ) . asyncRun ( s - > s . forEach ( Fn . println ( ) ) ) ; * N . asLis...
N . checkArgNotNull ( queue , "queue" ) ; N . checkArgNotNull ( duration , "duration" ) ; N . checkArgNotNull ( onComplete , "onComplete" ) ; final long now = System . currentTimeMillis ( ) ; final long endTime = duration . toMillis ( ) >= Long . MAX_VALUE - now ? Long . MAX_VALUE : now + duration . toMillis ( ) ; fina...
public class BigtableTableAdminClient { /** * Asynchronously creates , updates and drops ColumnFamilies as per the request . * < p > Sample code : * < pre > { @ code * ApiFuture < Table > modifiedTableFuture = client . modifyFamiliesAsync ( * ModifyColumnFamiliesRequest . of ( tableId ) * . addFamily ( " cf1 ...
return transformToTableResponse ( this . stub . modifyColumnFamiliesCallable ( ) . futureCall ( request . toProto ( projectId , instanceId ) ) ) ;
public class DigestAuthenticator { public String newNonce ( HttpRequest request ) { } }
long ts = request . getTimeStamp ( ) ; long sk = nonceSecret ; byte [ ] nounce = new byte [ 24 ] ; for ( int i = 0 ; i < 8 ; i ++ ) { nounce [ i ] = ( byte ) ( ts & 0xff ) ; ts = ts >> 8 ; nounce [ 8 + i ] = ( byte ) ( sk & 0xff ) ; sk = sk >> 8 ; } byte [ ] hash = null ; try { MessageDigest md = MessageDigest . getIns...
public class CommerceUserSegmentCriterionLocalServiceBaseImpl { /** * Updates the commerce user segment criterion in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners . * @ param commerceUserSegmentCriterion the commerce user segment criterion * @ return the commerce u...
return commerceUserSegmentCriterionPersistence . update ( commerceUserSegmentCriterion ) ;
public class SARLProposalProvider { /** * Complete the " extends " if the proposals are enabled . * @ param model the model . * @ param context the context . * @ param acceptor the proposal acceptor . * @ see # isSarlProposalEnabled ( ) */ protected void completeExtends ( EObject model , ContentAssistContext co...
if ( isSarlProposalEnabled ( ) ) { if ( model instanceof SarlAgent ) { completeSarlAgents ( false , true , context , acceptor ) ; } else if ( model instanceof SarlBehavior ) { completeSarlBehaviors ( false , true , context , acceptor ) ; } else if ( model instanceof SarlCapacity ) { completeSarlCapacities ( false , tru...
public class StencilInterpreter { /** * Switch to a new environment * @ param env Environment to switch to * @ returns Previous environment */ private Environment switchEnvironment ( Environment env ) { } }
Environment prev = currentEnvironment ; currentEnvironment = env ; return prev ;
public class SimpleBase { /** * Extracts a row or column from this matrix . The returned vector will either be a row * or column vector depending on the input type . * @ param extractRow If true a row will be extracted . * @ param element The row or column the vector is contained in . * @ return Extracted vecto...
if ( extractRow ) { return extractMatrix ( element , element + 1 , 0 , SimpleMatrix . END ) ; } else { return extractMatrix ( 0 , SimpleMatrix . END , element , element + 1 ) ; }
public class AzureBatchEvaluatorShimManager { /** * A utility method which builds the evaluator shim JAR file and uploads it to Azure Storage . * @ return SAS URI to where the evaluator shim JAR was uploaded . */ public URI generateShimJarFile ( ) { } }
try { Set < FileResource > globalFiles = new HashSet < > ( ) ; final File globalFolder = new File ( this . reefFileNames . getGlobalFolderPath ( ) ) ; final File [ ] filesInGlobalFolder = globalFolder . listFiles ( ) ; for ( final File fileEntry : filesInGlobalFolder != null ? filesInGlobalFolder : new File [ ] { } ) {...
public class TSCopy { /** * Copies a { @ link UniversalAutomaton } with possibly heterogeneous input alphabets , but compatible properties . * @ param method * the traversal method to use * @ param in * the input transition system * @ param limit * the traversal limit , a value less than 0 means no limit ...
return copy ( method , in , limit , inputs , out , inputsMapping , Function . identity ( ) , Function . identity ( ) , stateFilter , transFilter ) ;
public class Cell { /** * Sets the prefWidth and prefHeight to the specified values . */ public Cell < C , T > prefSize ( Value < C , T > width , Value < C , T > height ) { } }
prefWidth = width ; prefHeight = height ; return this ;
public class GetKeyRotationStatusRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetKeyRotationStatusRequest getKeyRotationStatusRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getKeyRotationStatusRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getKeyRotationStatusRequest . getKeyId ( ) , KEYID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: ...
public class ComputeExecutor { /** * The Graql compute mean query run method * @ return a Answer object containing a Number that represents the answer */ private Stream < Numeric > runComputeMean ( GraqlCompute . Statistics . Value query ) { } }
Map < String , Double > meanPair = runComputeStatistics ( query ) ; if ( meanPair == null ) return Stream . empty ( ) ; Double mean = meanPair . get ( MeanMapReduce . SUM ) / meanPair . get ( MeanMapReduce . COUNT ) ; return Stream . of ( new Numeric ( mean ) ) ;
public class Utils { /** * Pad to the left * @ param s string * @ param len desired len * @ param c padding char * @ return padded string */ public static String padleft ( String s , int len , char c ) { } }
s = s . trim ( ) ; if ( s . length ( ) > len ) { return s ; } final StringBuilder sb = new StringBuilder ( len ) ; int fill = len - s . length ( ) ; while ( fill -- > 0 ) { sb . append ( c ) ; } sb . append ( s ) ; return sb . toString ( ) ;
public class UserTaglet { /** * { @ inheritDoc } */ public Content getTagletOutput ( Element holder , TagletWriter writer ) { } }
Content output = writer . getOutputInstance ( ) ; Utils utils = writer . configuration ( ) . utils ; List < ? extends DocTree > tags = utils . getBlockTags ( holder , getName ( ) ) ; if ( ! tags . isEmpty ( ) ) { String tagString = userTaglet . toString ( tags , holder ) ; if ( tagString != null ) { output . addContent...
public class PoolsImpl { /** * Enables automatic scaling for a pool . * You cannot enable automatic scaling on a pool if a resize operation is in progress on the pool . If automatic scaling of the pool is currently disabled , you must specify a valid autoscale formula as part of the request . If automatic scaling of ...
return enableAutoScaleWithServiceResponseAsync ( poolId , poolEnableAutoScaleParameter ) . map ( new Func1 < ServiceResponseWithHeaders < Void , PoolEnableAutoScaleHeaders > , Void > ( ) { @ Override public Void call ( ServiceResponseWithHeaders < Void , PoolEnableAutoScaleHeaders > response ) { return response . body ...
public class DefaultBlockMaster { /** * Generates block info , including worker locations , for a block id . * @ param blockId a block id * @ return optional block info , empty if the block does not exist */ @ GuardedBy ( "masterBlockInfo" ) private Optional < BlockInfo > generateBlockInfo ( long blockId ) throws U...
if ( mSafeModeManager . isInSafeMode ( ) ) { throw new UnavailableException ( ExceptionMessage . MASTER_IN_SAFEMODE . getMessage ( ) ) ; } BlockMeta block ; List < BlockLocation > blockLocations ; try ( LockResource lr = lockBlock ( blockId ) ) { Optional < BlockMeta > blockOpt = mBlockStore . getBlock ( blockId ) ; if...
public class BulletGraphView { /** * / * bullet graph specs */ private PVPanel createVisualization ( final ProtovisWidget graphWidget ) { } }
final PVPanel vis = graphWidget . getPVPanel ( ) . width ( 400 ) . height ( 30 ) . margin ( 20 ) . left ( 100 ) // translate ( _ , y ) . top ( new JsDoubleFunction ( ) { public double f ( JsArgs args ) { PVMark _this = args . getThis ( ) ; return 10 + _this . index ( ) * 60 ; // translate ( x , _ ) } } ) ; PVBulletLayo...
public class ReflectionUtil { /** * Creates a new instance of the given class . The class is loaded using the * current thread ' s context class loader and instantiated using its default * constructor . * @ param s fully qualified name of the class to instantiate . * @ return the new instance or < code > null <...
final ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { Class < ? > clazz = classLoader . loadClass ( s ) ; Constructor < ? > constructor = clazz . getConstructor ( ) ; return constructor . newInstance ( ) ; } catch ( ClassNotFoundException e ) { return null ; } catch ( IllegalAcc...
public class TableBuilder { /** * add new tr having specified attributes . */ public tr addTr ( Map < String , Object > attrMap ) { } }
tr tr = new tr ( ) ; tr . setAttr ( attrMap ) ; trList . add ( tr ) ; return tr ;
public class QrCodePositionPatternDetector { /** * Takes the detected squares and turns it into a list of { @ link PositionPatternNode } . */ private void squaresToPositionList ( ) { } }
this . positionPatterns . reset ( ) ; List < DetectPolygonFromContour . Info > infoList = squareDetector . getPolygonInfo ( ) ; for ( int i = 0 ; i < infoList . size ( ) ; i ++ ) { DetectPolygonFromContour . Info info = infoList . get ( i ) ; // The test below has been commented out because the new external only contou...
public class CmsColor { /** * Sets the hexadecimal representation of Red , Green and Blue . < p > * @ param hex The hexadecimal string notation . It must be 6 or 3 letters long and consist of the characters 0-9 and A - F * @ throws java . lang . Exception if something goes wrong */ public void setHex ( String hex )...
if ( hex . length ( ) == 6 ) { setRGB ( Integer . parseInt ( hex . substring ( 0 , 2 ) , 16 ) , Integer . parseInt ( hex . substring ( 2 , 4 ) , 16 ) , Integer . parseInt ( hex . substring ( 4 , 6 ) , 16 ) ) ; } else if ( hex . length ( ) == 3 ) { setRGB ( Integer . parseInt ( hex . substring ( 0 , 1 ) , 16 ) , Integer...
public class PasswordEditText { /** * Removes all helper texts , which are contained by a specific collection . * @ param helperTexts * A collection , which contains the helper texts , which should be removed , as an * instance of the type { @ link Collection } or an empty collection , if no helper texts * shou...
Condition . INSTANCE . ensureNotNull ( helperTexts , "The collection may not be null" ) ; for ( CharSequence helperText : helperTexts ) { removeHelperText ( helperText ) ; }
public class BundleUtils { /** * Returns any bundle with the given symbolic name , or null if no such bundle exists . If there * are multiple bundles with the same symbolic name and different version , this method returns * the first bundle found . * @ param bc bundle context * @ param symbolicName bundle symbo...
return getBundle ( bc , symbolicName , null ) ;
public class CmsJspNavBuilder { /** * Initializes this bean . < p > * @ param cms the current cms context * @ param locale the locale for which properties should be read * @ param requestUri the request URI */ public void init ( CmsObject cms , Locale locale , String requestUri ) { } }
m_cms = cms ; m_locale = locale ; m_requestUri = requestUri ; m_requestUriFolder = CmsResource . getFolderPath ( m_requestUri ) ;
public class DOMConfigurator { /** * Used internally to parse an appender element . */ protected Appender parseAppender ( Element appenderElement ) { } }
String className = subst ( appenderElement . getAttribute ( CLASS_ATTR ) ) ; LogLog . debug ( "Class name: [" + className + ']' ) ; try { Object instance = Loader . loadClass ( className ) . newInstance ( ) ; Appender appender = ( Appender ) instance ; PropertySetter propSetter = new PropertySetter ( appender ) ; appen...
public class UrlEncoded { /** * Decoded parameters to Map . * @ param content the string containing the encoded parameters */ public static void decodeTo ( String content , MultiMap map , String charset ) { } }
if ( charset == null ) charset = StringUtil . __ISO_8859_1 ; synchronized ( map ) { String key = null ; String value = null ; int mark = - 1 ; boolean encoded = false ; for ( int i = 0 ; i < content . length ( ) ; i ++ ) { char c = content . charAt ( i ) ; switch ( c ) { case '&' : value = encoded ? decodeString ( cont...
public class Transmitter { /** * Immediately closes the socket connection if it ' s currently held . Use this to interrupt an * in - flight request from any thread . It ' s the caller ' s responsibility to close the request body * and response body streams ; otherwise resources may be leaked . * < p > This method...
Exchange exchangeToCancel ; RealConnection connectionToCancel ; synchronized ( connectionPool ) { canceled = true ; exchangeToCancel = exchange ; connectionToCancel = exchangeFinder != null && exchangeFinder . connectingConnection ( ) != null ? exchangeFinder . connectingConnection ( ) : connection ; } if ( exchangeToC...
public class GISCoordinates { /** * This function convert extended France Lambert II coordinate to * France Lambert III coordinate . * @ param x is the coordinate in extended France Lambert II * @ param y is the coordinate in extended France Lambert II * @ return the France Lambert III coordinate . */ @ Pure pu...
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi ( x , y , LAMBERT_2E_N , LAMBERT_2E_C , LAMBERT_2E_XS , LAMBERT_2E_YS ) ; return NTFLambdaPhi_NTFLambert ( ntfLambdaPhi . getX ( ) , ntfLambdaPhi . getY ( ) , LAMBERT_3_N , LAMBERT_3_C , LAMBERT_3_XS , LAMBERT_3_YS ) ;
public class ClassGraph { /** * Start the first inner table of a class . */ private void firstInnerTableStart ( Options opt ) { } }
w . print ( linePrefix + linePrefix + "<tr>" + opt . shape . extraColumn ( ) + "<td><table border=\"0\" cellspacing=\"0\" " + "cellpadding=\"1\">" + linePostfix ) ;
public class JobRequest { /** * / * package */ long getBackoffOffset ( boolean endTime ) { } }
if ( isPeriodic ( ) ) { return 0L ; } long offset ; switch ( getBackoffPolicy ( ) ) { case LINEAR : offset = mFailureCount * getBackoffMs ( ) ; break ; case EXPONENTIAL : if ( mFailureCount == 0 ) { offset = 0L ; } else { offset = ( long ) ( getBackoffMs ( ) * Math . pow ( 2 , mFailureCount - 1 ) ) ; } break ; default ...
public class Query { /** * Encode a command into { @ code x - www - form - urlencoded } format . * @ param command * the command to be encoded . * @ return a encoded command . */ public static String encode ( final String command ) { } }
try { return URLEncoder . encode ( command , StandardCharsets . UTF_8 . name ( ) ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException ( "Every JRE must support UTF-8" , e ) ; }
public class JSONMapping { /** * Append the external representation for this JSON object to a given { @ link Appendable } . * @ param a the { @ link Appendable } * @ throws IOException if thrown by the { @ link Appendable } * @ see JSONValue # appendJSON ( Appendable ) */ @ Override public void appendJSON ( Appen...
a . append ( '{' ) ; int n = list . size ( ) ; if ( n > 0 ) { int i = 0 ; for ( ; ; ) { Entry < String , V > entry = list . get ( i ++ ) ; a . append ( '"' ) ; Strings . appendEscaped ( a , entry . getKey ( ) , JSON . charMapper ) ; a . append ( '"' ) . append ( ':' ) ; JSON . appendJSON ( a , entry . getValue ( ) ) ; ...
public class ActiveSyncManager { /** * Stops the sync manager and any outstanding threads , does not change the sync points . * This stops four things in the following order . * 1 . Stop any outstanding initial sync futures for the sync points . ( syncFuture . cancel ) * 2 . Stop the heartbeat thread that periodi...
for ( AlluxioURI syncPoint : mSyncPathList ) { MountTable . Resolution resolution = null ; try { resolution = mMountTable . resolve ( syncPoint ) ; } catch ( InvalidPathException e ) { LOG . warn ( "stop: InvalidPathException resolving syncPoint {}, exception {}" , syncPoint , e ) ; } long mountId = resolution . getMou...
public class Maxent { /** * Returns the dot product between weight vector and x ( augmented with 1 ) . */ private static double dot ( int [ ] x , double [ ] w ) { } }
double dot = w [ w . length - 1 ] ; for ( int i : x ) { dot += w [ i ] ; } return dot ;
public class CmsUpdateDBProjectId { /** * Creates the CMS _ HISTORY _ PROJECTS table if it does not exist yet . < p > * @ param dbCon the db connection interface * @ throws SQLException if soemthing goes wrong */ protected void createHistProjectsTable ( CmsSetupDb dbCon ) throws SQLException { } }
System . out . println ( new Exception ( ) . getStackTrace ( ) [ 0 ] . toString ( ) ) ; if ( ! dbCon . hasTableOrColumn ( HISTORY_PROJECTS_TABLE , null ) ) { String createStatement = readQuery ( QUERY_CREATE_HISTORY_PROJECTS_TABLE ) ; dbCon . updateSqlStatement ( createStatement , null , null ) ; transferDataToHistoryT...
public class Graphics { /** * Get the colour of a single pixel in this graphics context * @ param x * The x coordinate of the pixel to read * @ param y * The y coordinate of the pixel to read * @ return The colour of the pixel at the specified location */ public Color getPixel ( int x , int y ) { } }
predraw ( ) ; GL . glReadPixels ( x , screenHeight - y , 1 , 1 , SGL . GL_RGBA , SGL . GL_UNSIGNED_BYTE , readBuffer ) ; postdraw ( ) ; return new Color ( translate ( readBuffer . get ( 0 ) ) , translate ( readBuffer . get ( 1 ) ) , translate ( readBuffer . get ( 2 ) ) , translate ( readBuffer . get ( 3 ) ) ) ;
public class OgnlSetter { /** * { @ inheritDoc } */ @ Override public Object send ( String ... args ) throws Exception { } }
assertArgumentsCount ( args ) ; ognlExpression . insertValue ( args [ 0 ] ) ; return null ;
public class PublicSuffixes { /** * bulids regular expression from prefix - tree { @ code alt } into buffer { @ code sb } . * @ param alt prefix tree root . * @ param sb StringBuffer to store regular expression . */ protected static void buildRegex ( Node alt , StringBuilder sb ) { } }
String close = null ; if ( alt . cs != null ) { // actually ' ! ' always be the first character , because it is // always used along with ' * ' . for ( int i = 0 ; i < alt . cs . length ( ) ; i ++ ) { char c = alt . cs . charAt ( i ) ; if ( c == '!' ) { if ( close != null ) throw new RuntimeException ( "more than one '...
public class CommerceOrderPersistenceImpl { /** * Returns the last commerce order in the ordered set where groupId = & # 63 ; and userId = & # 63 ; and orderStatus = & # 63 ; . * @ param groupId the group ID * @ param userId the user ID * @ param orderStatus the order status * @ param orderByComparator the comp...
int count = countByG_U_O ( groupId , userId , orderStatus ) ; if ( count == 0 ) { return null ; } List < CommerceOrder > list = findByG_U_O ( groupId , userId , orderStatus , count - 1 , count , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class MinusOperator { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . common . message . selector . expression . SelectorNode # evaluate ( javax . jms . Message ) */ @ Override public Object evaluate ( Message message ) throws JMSException { } }
Number value = operand . evaluateNumeric ( message ) ; if ( value == null ) return null ; return ArithmeticUtils . minus ( value ) ;
public class CommerceDiscountUsageEntryLocalServiceBaseImpl { /** * Performs a dynamic query on the database and returns the matching rows . * @ param dynamicQuery the dynamic query * @ return the matching rows */ @ Override public < T > List < T > dynamicQuery ( DynamicQuery dynamicQuery ) { } }
return commerceDiscountUsageEntryPersistence . findWithDynamicQuery ( dynamicQuery ) ;
public class LdapUtils { /** * Find the Rdn with the requested key in the supplied Name . * @ param name the Name in which to search for the key . * @ param key the attribute key to search for . * @ return the rdn corresponding to the < b > first < / b > occurrence of the requested key . * @ throws NoSuchElemen...
Assert . notNull ( name , "name must not be null" ) ; Assert . hasText ( key , "key must not be blank" ) ; LdapName ldapName = returnOrConstructLdapNameFromName ( name ) ; List < Rdn > rdns = ldapName . getRdns ( ) ; for ( Rdn rdn : rdns ) { NamingEnumeration < String > ids = rdn . toAttributes ( ) . getIDs ( ) ; while...
public class CatalogUtil { /** * Parse the deployment . xml file and add its data into the catalog . * @ param catalog Catalog to be updated . * @ param deployment Parsed representation of the deployment . xml file . * @ param isPlaceHolderCatalog if the catalog is isPlaceHolderCatalog and we are verifying only d...
String errmsg = null ; try { validateDeployment ( catalog , deployment ) ; // add our hacky Deployment to the catalog if ( catalog . getClusters ( ) . get ( "cluster" ) . getDeployment ( ) . get ( "deployment" ) == null ) { catalog . getClusters ( ) . get ( "cluster" ) . getDeployment ( ) . add ( "deployment" ) ; } // ...
public class WTextAreaRenderer { /** * Paints the given WTextArea . * @ param component the WTextArea to paint . * @ param renderContext the RenderContext to paint to . */ @ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } }
WTextArea textArea = ( WTextArea ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; boolean readOnly = textArea . isReadOnly ( ) ; xml . appendTagOpen ( "ui:textarea" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ;...
public class ChannelPool { /** * { @ inheritDoc } */ @ Override public boolean awaitTermination ( long timeout , TimeUnit unit ) throws InterruptedException { } }
long endTimeNanos = System . nanoTime ( ) + unit . toNanos ( timeout ) ; for ( ManagedChannel channel : channels ) { if ( channel . isTerminated ( ) ) { continue ; } long awaitTimeNanos = endTimeNanos - System . nanoTime ( ) ; if ( awaitTimeNanos <= 0 ) { break ; } channel . awaitTermination ( awaitTimeNanos , TimeUnit...
public class ServiceHandler { /** * rebalance a topology * @ param topologyName topology name * @ param options RebalanceOptions */ @ Override public void rebalance ( String topologyName , RebalanceOptions options ) throws TException { } }
try { checkTopologyActive ( data , topologyName , true ) ; Integer wait_amt = null ; String jsonConf = null ; Boolean reassign = false ; if ( options != null ) { if ( options . is_set_wait_secs ( ) ) wait_amt = options . get_wait_secs ( ) ; if ( options . is_set_reassign ( ) ) reassign = options . is_reassign ( ) ; if ...
public class BundlesHandlerFactory { /** * Builds a single bundle containing all the paths specified . Useful to make * a single bundle out of every resource that is orphan after processing * config definitions . * @ param bundleId * the bundle Id * @ param orphanPaths * the orphan paths * @ return a sing...
JoinableResourceBundle newBundle = new JoinableResourceBundleImpl ( bundleId , generateBundleNameFromBundleId ( bundleId ) , null , fileExtension , new InclusionPattern ( ) , orphanPaths , resourceReaderHandler , jawrConfig . getGeneratorRegistry ( ) ) ; return newBundle ;
public class AmazonAlexaForBusinessClient { /** * Forgets smart home appliances associated to a room . * @ param forgetSmartHomeAppliancesRequest * @ return Result of the ForgetSmartHomeAppliances operation returned by the service . * @ throws NotFoundException * The resource is not found . * @ sample AmazonA...
request = beforeClientExecution ( request ) ; return executeForgetSmartHomeAppliances ( request ) ;
public class SuiteDeployer { /** * Method ignoring GenerateDeployment events if deployment is already done . * @ param eventContext Event to check */ public void blockGenerateDeploymentWhenNeeded ( @ Observes EventContext < GenerateDeployment > eventContext ) { } }
if ( ! extensionEnabled ( ) ) { eventContext . proceed ( ) ; } else if ( suiteDeploymentGenerated ) { // Do nothing with event . debug ( "Blocking GenerateDeployment event {0}" , eventContext . getEvent ( ) . toString ( ) ) ; } else { suiteDeploymentGenerated = true ; debug ( "NOT Blocking GenerateDeployment event {0}"...
public class GenericUtils { /** * Format the next 16 bytes of the input data starting from the input offset * as ASCII characters . Non - ASCII bytes will be printed as a period symbol . * @ param buffer * @ param data * @ param inOffset * @ return StringBuilder */ static private StringBuilder formatTextData ...
int offset = inOffset ; int end = offset + 16 ; for ( ; offset < end ; offset ++ ) { if ( offset >= data . length ) { buffer . append ( " " ) ; continue ; } if ( Character . isLetterOrDigit ( data [ offset ] ) ) { buffer . append ( ( char ) data [ offset ] ) ; } else { buffer . append ( '.' ) ; } } return buffer ;
public class StdEnumDateElement { /** * < p > Obtains the effective calendar type . < / p > * @ param attributes format attributes * @ return effective calendar type */ protected String getCalendarType ( AttributeQuery attributes ) { } }
if ( this . isMonthElement ( ) || this . isEraElement ( ) ) { return attributes . get ( Attributes . CALENDAR_TYPE , this . defaultCalendarType ) ; } else if ( this . isWeekdayElement ( ) ) { return CalendarText . ISO_CALENDAR_TYPE ; } else { return this . defaultCalendarType ; }
public class ClusterManagerClient { /** * Deletes the cluster , including the Kubernetes endpoint and all worker nodes . * < p > Firewalls and routes that were configured during cluster creation are also deleted . * < p > Other Google Compute Engine resources that might be in use by the cluster ( e . g . load * b...
DeleteClusterRequest request = DeleteClusterRequest . newBuilder ( ) . setProjectId ( projectId ) . setZone ( zone ) . setClusterId ( clusterId ) . build ( ) ; return deleteCluster ( request ) ;
public class InternalXbaseParser { /** * InternalXbase . g : 6061:1 : entryRuleJvmLowerBoundAnded returns [ EObject current = null ] : iv _ ruleJvmLowerBoundAnded = ruleJvmLowerBoundAnded EOF ; */ public final EObject entryRuleJvmLowerBoundAnded ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleJvmLowerBoundAnded = null ; try { // InternalXbase . g : 6061:59 : ( iv _ ruleJvmLowerBoundAnded = ruleJvmLowerBoundAnded EOF ) // InternalXbase . g : 6062:2 : iv _ ruleJvmLowerBoundAnded = ruleJvmLowerBoundAnded EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammar...
public class CritBit64 { /** * Get the value for a given key . * @ param key The key * @ return the values associated with { @ code key } or { @ code null } if the key does not exist . */ public V get ( long key ) { } }
if ( size == 0 ) { return null ; } if ( size == 1 ) { int posDiff = compare ( key , rootKey ) ; if ( posDiff == - 1 ) { return rootVal ; } return null ; } Node < V > n = root ; while ( true ) { if ( ! doesInfixMatch ( n , key ) ) { return null ; } // infix matches , so now we check sub - nodes and postfixes if ( getBit...
public class FailoverGroupsInner { /** * Updates a failover group . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server containing the failover group . * @ ...
return beginUpdateWithServiceResponseAsync ( resourceGroupName , serverName , failoverGroupName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class StructuredDataId { /** * Creates an id using another id to supply default values . * @ param id The original StructuredDataId . * @ return the new StructuredDataId . */ public StructuredDataId makeId ( final StructuredDataId id ) { } }
if ( id == null ) { return this ; } return makeId ( id . getName ( ) , id . getEnterpriseNumber ( ) ) ;
public class Controller { /** * Convenience method , calls { @ link # view ( String , Object ) } internally . * The keys in the map are converted to String values . * @ param values map with values to pass to view . */ protected void view ( Map < String , Object > values ) { } }
for ( String key : values . keySet ( ) ) { view ( key , values . get ( key ) ) ; }
public class FileBlobStoreImpl { /** * Get an object tied to writing the data . * @ param key the key of the part to write to . * @ return an object that can be used to both write to , but also commit / cancel the operation . * @ throws IOException on any error */ public LocalFsBlobStoreFile write ( String key , ...
return new LocalFsBlobStoreFile ( getKeyDir ( key ) , true , create ) ;
public class IntArrayList { /** * Searches an element . * @ param ele element to look for * @ return index of the first element found ; - 1 if nothing was found */ public int indexOf ( int ele ) { } }
int i ; for ( i = 0 ; i < size ; i ++ ) { if ( data [ i ] == ele ) { return i ; } } return - 1 ;
public class FileStorage { /** * Returns a { @ link com . frostwire . jlibtorrent . PeerRequest } representing the * piece index , byte offset and size the specified file range overlaps . * This is the inverse mapping of { @ link # mapBlock ( int , long , int ) } . * Note that the { @ link PeerRequest } return ty...
return new PeerRequest ( fs . map_file ( file , offset , size ) ) ;
public class SyncPageWorker { /** * Get saved property . * @ param strKey * @ return */ public Object get ( String strKey ) { } }
if ( m_map != null ) return m_map . get ( strKey ) ; return null ;