signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AbstractRedisStorage { /** * Retrieve a job from redis * @ param jobKey the job key detailing the identity of the job to be retrieved * @ param jedis a thread - safe Redis connection * @ return the { @ link org . quartz . JobDetail } of the desired job * @ throws JobPersistenceException if the desi...
final String jobHashKey = redisSchema . jobHashKey ( jobKey ) ; final String jobDataMapHashKey = redisSchema . jobDataMapHashKey ( jobKey ) ; final Map < String , String > jobDetailMap = jedis . hgetAll ( jobHashKey ) ; if ( jobDetailMap == null || jobDetailMap . size ( ) == 0 ) { // desired job does not exist return n...
public class CmsXmlContent { /** * Adds a new XML content value for the given element name and locale at the given index position * to this XML content document . < p > * @ param cms the current users OpenCms context * @ param path the path to the XML content value element * @ param locale the locale where to a...
// get the schema type of the requested path I_CmsXmlSchemaType type = m_contentDefinition . getSchemaType ( path ) ; if ( type == null ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_XMLCONTENT_UNKNOWN_ELEM_PATH_SCHEMA_1 , path ) ) ; } Element parentElement ; String elementN...
public class CPInstancePersistenceImpl { /** * Returns the first cp instance in the ordered set where groupId = & # 63 ; and status & ne ; & # 63 ; . * @ param groupId the group ID * @ param status the status * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) ...
List < CPInstance > list = findByG_NotST ( groupId , status , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class MethodUtils { /** * Get the { @ link TypeVariable } instance for the specified { @ link Type } . * If the type is not a { @ link TypeVariable } , then < code > null < / code > is * returned . If the type is a { @ link GenericArrayType } , its root type is * looked up and then checked . * @ param ty...
// find root type if generic array while ( type instanceof GenericArrayType ) { type = ( ( GenericArrayType ) type ) . getGenericComponentType ( ) ; } // return type variable if valid if ( type instanceof TypeVariable ) { return ( TypeVariable < ? > ) type ; } // non - type variable , return null return null ;
public class MapperFactoryBean { /** * 函数参数信息 * @ param args 参数列表 * @ return 格式化输出 */ protected String getParameters ( Object [ ] args ) { } }
if ( args == null ) return "" ; StringBuilder sbd = new StringBuilder ( ) ; if ( args . length > 0 ) { for ( Object i : args ) { if ( i == null ) { sbd . append ( "null" ) ; } else { Class clz = i . getClass ( ) ; if ( isPrimitive ( clz ) ) { sbd . append ( evalPrimitive ( i ) ) ; } else if ( clz . isArray ( ) ) { eval...
public class CommerceShipmentLocalServiceUtil { /** * Returns a range of all the commerce shipments . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Th...
return getService ( ) . getCommerceShipments ( start , end ) ;
public class GridFTPServerFacade { /** * Store the data from the data channel to the data sink . * Does not block . * If operation fails , exception might be thrown via local control channel . * @ param sink source of data */ public void store ( DataSink sink ) { } }
try { localControlChannel . resetReplyCount ( ) ; if ( session . transferMode != GridFTPSession . MODE_EBLOCK ) { // no EBLOCK EBlockParallelTransferContext context = ( EBlockParallelTransferContext ) createTransferContext ( ) ; context . setEodsTotal ( 0 ) ; if ( session . serverMode == Session . SERVER_PASSIVE ) { tr...
public class AbstractMaterialDialogBuilder { /** * Obtains the background from a specific theme . * @ param themeResourceId * The resource id of the theme , the background should be obtained from , as an { @ link * Integer } value */ private void obtainBackground ( @ StyleRes final int themeResourceId ) { } }
TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogBackground } ) ; int resourceId = typedArray . getResourceId ( 0 , 0 ) ; if ( resourceId != 0 ) { setBackground ( resourceId ) ; } else { setBackgroundColor ( ContextCompat . getColo...
public class AppsManagerImpl { /** * / * ( non - Javadoc ) * @ see com . github . chrisprice . phonegapbuild . api . managers . AppsManager # getApps ( com . sun . jersey . api . client . WebResource , com . github . chrisprice . phonegapbuild . api . data . ResourcePath ) */ @ Override public AppsResponse getApps ( ...
return resource . path ( appsResponsePath . getPath ( ) ) . get ( AppsResponse . class ) ;
public class DraeneiSearchService { /** * { @ inheritDoc } */ @ Override public void addDocument ( @ NotNull Document document ) { } }
if ( documentsCache != null && rankingAlgorithm != null && documentIndexCache != null ) { Set < FacetRank > facetRanks = rankingAlgorithm . calculate ( buildFacets ( document ) ) ; documentsCache . put ( document . getId ( ) , document ) ; documentIndexCache . put ( document . getId ( ) , new DocumentIndex ( document ,...
public class ConnectionMonitorsInner { /** * Create or update a connection monitor . * @ param resourceGroupName The name of the resource group containing Network Watcher . * @ param networkWatcherName The name of the Network Watcher resource . * @ param connectionMonitorName The name of the connection monitor . ...
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , networkWatcherName , connectionMonitorName , parameters ) , serviceCallback ) ;
public class CmsFlexCacheKey { /** * A helper method for the parsing process which parses * Strings like groups = ( a , b , c ) . < p > * @ param value the String to parse * @ return a Map that contains of the parsed values , only the keyset of the Map is needed later */ private Set < String > parseValueList ( St...
if ( value . charAt ( 0 ) == '(' ) { value = value . substring ( 1 ) ; } int len = value . length ( ) - 1 ; if ( value . charAt ( len ) == ')' ) { value = value . substring ( 0 , len ) ; } if ( value . charAt ( len - 1 ) == ',' ) { value = value . substring ( 0 , len - 1 ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . de...
public class Publishers { /** * Attempts to convert the publisher to the given type . * @ param object The object to convert * @ param publisherType The publisher type * @ param < T > The generic type * @ return The Resulting in publisher */ public static < T > T convertPublisher ( Object object , Class < T > p...
Objects . requireNonNull ( object , "Invalid argument [object]: " + object ) ; Objects . requireNonNull ( object , "Invalid argument [publisherType]: " + publisherType ) ; if ( object instanceof CompletableFuture ) { @ SuppressWarnings ( "unchecked" ) Publisher < T > futurePublisher = ( Publisher < T > ) Publishers . f...
public class Ledgers { /** * Reliably retrieves the LastAddConfirmed for the Ledger with given LedgerId , by opening the Ledger in fencing mode * and getting the value . NOTE : this open - fences the Ledger which will effectively stop any writing action on it . * @ param ledgerId The Id of the Ledger to query . *...
LedgerHandle h = null ; try { // Here we open the Ledger WITH recovery , to force BookKeeper to reconcile any appends that may have been // interrupted and not properly acked . Otherwise there is no guarantee we can get an accurate value for // LastAddConfirmed . h = openFence ( ledgerId , bookKeeper , config ) ; retur...
public class JSONHelpers { /** * Return the value mapped by enum if it exists and is a { @ link JSONObject } by mapping " x " and * " y " members into a { @ link PointF } . The values in { @ code fallback } are used if either field * is missing ; if { @ code fallback } is { @ code null } , { @ link Float # NaN } is...
JSONObject value = optJSONObject ( json , e ) ; PointF p = asPointF ( value , fallback ) ; return p ;
public class DataSourceConnectionSupplierImpl { /** * データソース名を指定したプロパティの取得 * @ param dataSourceName データソース名 * @ return データソースに紐付くプロパティ */ protected Map < String , String > getConnPropsByDataSourceName ( final String dataSourceName ) { } }
return connProps . computeIfAbsent ( dataSourceName , k -> new ConcurrentHashMap < > ( ) ) ;
public class DatasourceDependencyBuilder { /** * Returns a builder instance that is initialized using a prototype DatasourceDependency . * All values of the prototype are copied . * @ param prototype the prototype dependency * @ return DatasourceDependencyBuilder */ public static DatasourceDependencyBuilder copyO...
return new DatasourceDependencyBuilder ( ) . withName ( prototype . getName ( ) ) . withDescription ( prototype . getDescription ( ) ) . withType ( prototype . getType ( ) ) . withSubtype ( prototype . getSubtype ( ) ) . withDatasources ( prototype . getDatasources ( ) ) . withCriticality ( prototype . getCriticality (...
public class Bitstream { /** * Parse ID3v2 tag header to find out size of ID3v2 frames . * @ param in MP3 InputStream * @ return size of ID3v2 frames + header * @ throws IOException * @ author JavaZOOM */ private int readID3v2Header ( InputStream in ) throws IOException { } }
byte [ ] id3header = new byte [ 4 ] ; int size = - 10 ; in . read ( id3header , 0 , 3 ) ; // Look for ID3v2 if ( ( id3header [ 0 ] == 'I' ) && ( id3header [ 1 ] == 'D' ) && ( id3header [ 2 ] == '3' ) ) { in . read ( id3header , 0 , 3 ) ; // int majorVersion = id3header [ 0 ] ; // int revision = id3header [ 1 ] ; in . r...
public class MPP14Reader { /** * Read group definitions . * @ throws IOException */ private void processGroupData ( ) throws IOException { } }
DirectoryEntry dir = ( DirectoryEntry ) m_viewDir . getEntry ( "CGrouping" ) ; FixedMeta fixedMeta = new FixedMeta ( new DocumentInputStream ( ( ( DocumentEntry ) dir . getEntry ( "FixedMeta" ) ) ) , 10 ) ; FixedData fixedData = new FixedData ( fixedMeta , m_inputStreamFactory . getInstance ( dir , "FixedData" ) ) ; Va...
public class DatabaseManager { /** * thrown exception to an HsqlException in the process */ private static String filePathToKey ( String path ) { } }
try { return FileUtil . getDefaultInstance ( ) . canonicalPath ( path ) ; } catch ( Exception e ) { return path ; }
public class JavaUtil { /** * Code to fetch an instance of { @ link java . nio . charset . Charset } corresponding to the given encoding . * @ param encoding as a string name ( eg . UTF - 8 ) . * @ return the code to fetch the associated Charset . */ public static String charset ( final String encoding ) { } }
final String charsetName = STD_CHARSETS . get ( encoding ) ; if ( charsetName != null ) { return "java.nio.charset.StandardCharsets." + charsetName ; } else { return "java.nio.charset.Charset.forName(\"" + encoding + "\")" ; }
public class AuthHandler { /** * Handles the SASL defined callbacks to set user and password ( the { @ link CallbackHandler } interface ) . */ @ Override public void handle ( Callback [ ] callbacks ) throws IOException , UnsupportedCallbackException { } }
for ( Callback callback : callbacks ) { if ( callback instanceof NameCallback ) { ( ( NameCallback ) callback ) . setName ( username ) ; } else if ( callback instanceof PasswordCallback ) { ( ( PasswordCallback ) callback ) . setPassword ( password . toCharArray ( ) ) ; } else { throw new AuthenticationException ( "SAS...
public class CmsSitemapTreeItem { /** * Helper method to add an additional info bean to a list . < p > * @ param infos the list of additional info beans * @ param label the label for the new bean * @ param value the value for the new bean */ protected static void addInfo ( List < CmsAdditionalInfoBean > infos , S...
infos . add ( new CmsAdditionalInfoBean ( label , value , null ) ) ;
public class FastAggregation { /** * Uses a priority queue to compute the xor aggregate . * This function runs in linearithmic ( O ( n log n ) ) time with respect to the number of bitmaps . * @ param bitmaps input bitmaps * @ return aggregated bitmap * @ see # horizontal _ xor ( RoaringBitmap . . . ) */ public ...
// TODO : This code could be faster , see priorityqueue _ or if ( bitmaps . length == 0 ) { return new RoaringBitmap ( ) ; } PriorityQueue < RoaringBitmap > pq = new PriorityQueue < > ( bitmaps . length , new Comparator < RoaringBitmap > ( ) { @ Override public int compare ( RoaringBitmap a , RoaringBitmap b ) { return...
public class PeerManager { /** * TODO : peer stats & reaper */ public @ NotNull Map < String , Integer > getStats ( ) { } }
int in = 0 ; int out = 0 ; for ( Peer peer : peers . values ( ) ) { Map < String , Integer > connStats = peer . getStats ( ) ; in += connStats . get ( "connections.in" ) ; out += connStats . get ( "connections.out" ) ; } Map < String , Integer > result = Maps . newHashMapWithExpectedSize ( 2 ) ; result . put ( "connect...
public class SARLHoverSignatureProvider { /** * Replies the hover for a SARL casted expression . * @ param castExpression the casted expression . * @ param typeAtEnd indicates if the type should be put at end . * @ return the string representation into the hover . */ protected String _signature ( XCastedExpressio...
if ( castExpression instanceof SarlCastedExpression ) { final JvmOperation delegate = ( ( SarlCastedExpression ) castExpression ) . getFeature ( ) ; if ( delegate != null ) { return _signature ( delegate , typeAtEnd ) ; } } return MessageFormat . format ( Messages . SARLHoverSignatureProvider_0 , getTypeName ( castExpr...
public class SibRaConnection { /** * Returns the userid associated with this connection . Checks that the * connection is valid and then delegates . * @ throws SIErrorException * if the delegation fails * @ throws SIResourceException * if the delegation fails * @ throws SIConnectionLostException * if the ...
checkValid ( ) ; return _delegateConnection . getResolvedUserid ( ) ;
public class IterableUtils { /** * Applys a one - to - many transform to each element of an { @ code Iterable } and concatenates all the * results into one { @ code Iterable } . This is done lazily . * @ deprecated Prefer { @ link FluentIterable # transformAndConcat ( Function ) } now that it * exists . */ @ Depr...
return FluentIterable . from ( input ) . transformAndConcat ( function ) ;
public class AbstractInternalAntlrParser { protected EObject createModelElementForParent ( AbstractRule rule ) { } }
return createModelElement ( rule . getType ( ) . getClassifier ( ) , currentNode . getParent ( ) ) ;
public class ReflectionUtil { /** * Checks if the class is available on the current thread ' s context class * loader . * @ param s fully qualified name of the class to check . * @ return < code > true < / code > if the class is available , < code > false < / code > * otherwise . */ public static boolean isClas...
final ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { classLoader . loadClass ( s ) ; return true ; } catch ( ClassNotFoundException e ) { return false ; }
public class ConditionalCheck { /** * Ensures that a given state is { @ code true } . * @ param condition * condition must be { @ code true } ^ so that the check will be performed * @ param expression * an expression that must be { @ code true } to indicate a valid state * @ param description * will be used...
if ( condition ) { Check . stateIsTrue ( expression , description ) ; }
public class ProductPartitionTreeImpl { /** * Using the criteria in { @ code parentIdMap } , recursively adds all children under the partition ID * of { @ code parentNode } to { @ code parentNode } . * @ param parentNode required * @ param parentIdMap the multimap from parent partition ID to list of child criteri...
if ( parentIdMap . containsKey ( parentNode . getProductPartitionId ( ) ) ) { parentNode = parentNode . asSubdivision ( ) ; } for ( AdGroupCriterion adGroupCriterion : parentIdMap . get ( parentNode . getProductPartitionId ( ) ) ) { ProductPartition partition = ( ProductPartition ) adGroupCriterion . getCriterion ( ) ;...
public class IfcMaterialClassificationRelationshipImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcClassificationNotationSelect > getMaterialClassifications ( ) { } }
return ( EList < IfcClassificationNotationSelect > ) eGet ( Ifc2x3tc1Package . Literals . IFC_MATERIAL_CLASSIFICATION_RELATIONSHIP__MATERIAL_CLASSIFICATIONS , true ) ;
public class WebMvcLinkBuilderFactory { /** * ( non - Javadoc ) * @ see org . springframework . hateoas . MethodLinkBuilderFactory # linkTo ( java . lang . reflect . Method , java . lang . Object [ ] ) */ @ Override public WebMvcLinkBuilder linkTo ( Method method , Object ... parameters ) { } }
return WebMvcLinkBuilder . linkTo ( method , parameters ) ;
public class SARLValidator { /** * Check if the given local variable has a valid name . * @ param variable the variable to test . * @ see SARLFeatureNameValidator */ @ Check ( CheckType . FAST ) public void checkParameterName ( XVariableDeclaration variable ) { } }
if ( this . grammarAccess . getOccurrenceKeyword ( ) . equals ( variable . getName ( ) ) ) { error ( MessageFormat . format ( Messages . SARLValidator_15 , this . grammarAccess . getOccurrenceKeyword ( ) ) , variable , XbasePackage . Literals . XVARIABLE_DECLARATION__NAME , ValidationMessageAcceptor . INSIGNIFICANT_IND...
public class Expression { /** * Convert this expression to a statement , by executing it and throwing away the result . * < p > This is useful for invoking non - void methods when we don ' t care about the result . */ public Statement toStatement ( ) { } }
return new Statement ( ) { @ Override protected void doGen ( CodeBuilder adapter ) { Expression . this . gen ( adapter ) ; switch ( resultType ( ) . getSize ( ) ) { case 0 : throw new AssertionError ( "void expressions are not allowed" ) ; case 1 : adapter . pop ( ) ; break ; case 2 : adapter . pop2 ( ) ; break ; defau...
public class BaseTemplate { /** * Includes contents of another file , not as a template but as escaped text . * @ param templatePath the path to the other file * @ throws IOException */ public void includeEscaped ( String templatePath ) throws IOException { } }
URL resource = engine . resolveTemplate ( templatePath ) ; yield ( ResourceGroovyMethods . getText ( resource , engine . getCompilerConfiguration ( ) . getSourceEncoding ( ) ) ) ;
public class ListMigrationTasksResult { /** * Lists the migration task ' s summary which includes : < code > MigrationTaskName < / code > , < code > ProgressPercent < / code > , * < code > ProgressUpdateStream < / code > , < code > Status < / code > , and the < code > UpdateDateTime < / code > for each task . * @ p...
if ( migrationTaskSummaryList == null ) { this . migrationTaskSummaryList = null ; return ; } this . migrationTaskSummaryList = new java . util . ArrayList < MigrationTaskSummary > ( migrationTaskSummaryList ) ;
public class JDBCInputFormat { /** * Checks whether all data has been read . * @ return boolean value indication whether all data has been read . * @ throws IOException */ @ Override public boolean reachedEnd ( ) throws IOException { } }
try { if ( resultSet . isLast ( ) ) { close ( ) ; return true ; } return false ; } catch ( SQLException se ) { throw new IOException ( "Couldn't evaluate reachedEnd() - " + se . getMessage ( ) , se ) ; }
public class Utilities { /** * Convert the appinfo string to the address the application is available on * @ param info the string of the appinfo * @ return the address application is available on */ public static InetAddress appInfoToAddress ( String info ) { } }
Matcher m = INET_ADDRESS_PATTERN . matcher ( info ) ; if ( m . find ( ) ) { int port = Integer . parseInt ( m . group ( 2 ) ) ; return new InetAddress ( m . group ( 1 ) , port ) ; } return null ;
public class InstanceHelpers { /** * Finds the root instance ' s path from another instance path . * @ param scopedInstancePath a scoped instance path ( may be null ) * @ return a non - null root instance path */ public static String findRootInstancePath ( String scopedInstancePath ) { } }
String result ; if ( Utils . isEmptyOrWhitespaces ( scopedInstancePath ) ) { // Do not return null result = "" ; } else if ( scopedInstancePath . contains ( "/" ) ) { // Be as flexible as possible with paths String s = scopedInstancePath . replaceFirst ( "^/*" , "" ) ; int index = s . indexOf ( '/' ) ; result = index >...
public class Subsumption { /** * Generates a UBTree from the formulas operands ( clauses in CNF , minterms in DNF ) * where all subsumed operands are already deleted . * @ param formula the formula ( must be an n - ary operator and CNF or DNF ) * @ return the UBTree with the operands and deleted subsumed operands...
final SortedMap < Integer , List < SortedSet < Literal > > > mapping = new TreeMap < > ( ) ; for ( final Formula term : formula ) { List < SortedSet < Literal > > terms = mapping . get ( term . literals ( ) . size ( ) ) ; if ( terms == null ) { terms = new LinkedList < > ( ) ; mapping . put ( term . literals ( ) . size...
public class MPP14Reader { /** * Clear transient member data . */ private void clearMemberData ( ) { } }
m_reader = null ; m_eventManager = null ; m_file = null ; m_root = null ; m_resourceMap = null ; m_projectDir = null ; m_viewDir = null ; m_outlineCodeVarData = null ; m_outlineCodeVarMeta = null ; m_projectProps = null ; m_fontBases = null ; m_taskSubProjects = null ; m_parentTasks = null ; m_taskOrder = null ; m_null...
public class Attachment { /** * Returns the { @ link # encoding } encoding using the string in the attachment ' s JSON metadata . * @ param encodingString the string containing the attachment ' s { @ link # encoding } encoding . * @ return the attachment ' s { @ link # encoding } encoding . */ public static Encodin...
if ( encodingString == null || encodingString . isEmpty ( ) || encodingString . equalsIgnoreCase ( "Plain" ) ) { return Encoding . Plain ; } else if ( encodingString . equalsIgnoreCase ( "gzip" ) ) { return Encoding . Gzip ; } else { throw new IllegalArgumentException ( "Unsupported encoding" ) ; }
public class ResponsePromise { /** * Handles a retry * @ param cause of last connect fail */ public void handleRetry ( Throwable cause ) { } }
try { this . retryPolicy . retry ( connectionState , retryHandler , connectionFailHandler ) ; } catch ( RetryPolicy . RetryCancelled retryCancelled ) { this . getNettyPromise ( ) . setFailure ( cause ) ; }
public class TopLevelDocumentToApiModelVisitor { /** * { @ inheritDoc } */ @ Override public final void visit ( final TrailerDocument document ) { } }
setBaseObject ( new ApiObject ( document . getType ( ) , document . getString ( ) ) ) ; addAttributes ( document ) ;
public class UnicodeSet { /** * Find the last index before fromIndex where the UnicodeSet matches at that index . * If findNot is true , then reverse the sense of the match : find the last place where the UnicodeSet doesn ' t match . * If there is no match , - 1 is returned . * BEFORE index is not in the UnicodeS...
// TODO add strings , optimize , using ICU4C algorithms int cp ; fromIndex -= 1 ; for ( ; fromIndex >= 0 ; fromIndex -= UTF16 . getCharCount ( cp ) ) { cp = UTF16 . charAt ( value , fromIndex ) ; if ( contains ( cp ) != findNot ) { break ; } } return fromIndex < 0 ? - 1 : fromIndex ;
public class SQLActionParser { /** * Parses SQL query action with result set validation elements . * @ param element the root element . * @ param scriptValidationElement the optional script validation element . * @ param validateElements validation elements . * @ param extractElements variable extraction elemen...
BeanDefinitionBuilder beanDefinition = BeanDefinitionBuilder . rootBeanDefinition ( ExecuteSQLQueryAction . class ) ; // check for script validation if ( scriptValidationElement != null ) { beanDefinition . addPropertyValue ( "scriptValidationContext" , getScriptValidationContext ( scriptValidationElement ) ) ; } Map <...
public class Matrix4f { /** * Apply rotation of < code > angleY < / code > radians about the Y axis , followed by a rotation of < code > angleX < / code > radians about the X axis and * followed by a rotation of < code > angleZ < / code > radians about the Z axis . * When used with a right - handed coordinate syste...
return rotateYXZ ( angleY , angleX , angleZ , thisOrNew ( ) ) ;
public class ProtectionIntentsInner { /** * Create Intent for Enabling backup of an item . This is a synchronous operation . * @ param vaultName The name of the recovery services vault . * @ param resourceGroupName The name of the resource group where the recovery services vault is present . * @ param fabricName ...
return createOrUpdateWithServiceResponseAsync ( vaultName , resourceGroupName , fabricName , intentObjectName , parameters ) . map ( new Func1 < ServiceResponse < ProtectionIntentResourceInner > , ProtectionIntentResourceInner > ( ) { @ Override public ProtectionIntentResourceInner call ( ServiceResponse < ProtectionIn...
public class WnsClient { /** * Based on < a href = " http : / / msdn . microsoft . com / en - us / library / windows / apps / hh465407 . aspx " > http : / / msdn . microsoft . com / en - us / library / windows / apps / hh465407 . aspx < / a > * @ throws WnsException when authentication fails */ public void refreshAcc...
WebTarget target = client . target ( getAuthenticationUri ( ) ) ; MultivaluedStringMap formData = new MultivaluedStringMap ( ) ; formData . add ( "grant_type" , GRANT_TYPE_CLIENT_CREDENTIALS ) ; formData . add ( "client_id" , this . sid ) ; formData . add ( "client_secret" , this . clientSecret ) ; formData . add ( "sc...
public class LogRepositoryListener { /** * ( non - Javadoc ) * @ see org . eclipse . aether . util . listener . AbstractRepositoryListener # metadataResolving * ( org . eclipse . aether . RepositoryEvent ) */ @ Override public void metadataResolving ( RepositoryEvent event ) { } }
log . finer ( "Resolving metadata " + event . getMetadata ( ) + " from " + event . getRepository ( ) ) ;
public class Signature { /** * Retrieve the offset of the given argument name in this signature ' s * arguments . If the argument name is not in the argument list , returns - 1. * @ param pattern the argument name to search for * @ return the offset at which the argument name was found or - 1 */ public int argOff...
for ( int i = 0 ; i < argNames . length ; i ++ ) { if ( Pattern . compile ( pattern ) . matcher ( argNames [ i ] ) . find ( ) ) return i ; } return - 1 ;
public class HeartbeatImpl { /** * Heartbeat from a hub server includes the heartbeat status of its rack . */ public void hubHeartbeat ( UpdateServerHeartbeat updateServer , UpdateRackHeartbeat updateRack , UpdatePodSystem updatePod , long sourceTime ) { } }
RackHeartbeat rack = getCluster ( ) . findRack ( updateRack . getId ( ) ) ; if ( rack == null ) { rack = getRack ( ) ; } updateRack ( updateRack ) ; updateServerStart ( updateServer ) ; // XXX : _ podService . onUpdateFromPeer ( updatePod ) ; // rack . update ( ) ; updateTargetServers ( ) ; PodHeartbeatService podHeart...
public class DestroyAttempts { /** * Gets an immutable instance that represents an attempt where the process is already terminated . * This attempt ' s { @ link DestroyAttempt # result ( ) result ( ) } method will return * { @ link DestroyResult # TERMINATED TERMINATED } . * @ param < A > kill or term attempt typ...
return ( A ) ALREADY_TERMINATED ;
public class RepositoryResourceImpl { /** * { @ inheritDoc } */ protected void setType ( ResourceType type ) { } }
if ( type == null ) { _asset . setType ( null ) ; _asset . getWlpInformation ( ) . setTypeLabel ( null ) ; } else { _asset . setType ( type ) ; _asset . getWlpInformation ( ) . setTypeLabel ( type . getTypeLabel ( ) ) ; }
public class SAMkNN { /** * Removes predictions of the largest window size and shifts the remaining ones accordingly . */ private void adaptHistories ( int numberOfDeletions ) { } }
for ( int i = 0 ; i < numberOfDeletions ; i ++ ) { SortedSet < Integer > keys = new TreeSet < > ( this . predictionHistories . keySet ( ) ) ; this . predictionHistories . remove ( keys . first ( ) ) ; keys = new TreeSet < > ( this . predictionHistories . keySet ( ) ) ; for ( Integer key : keys ) { List < Integer > pred...
public class BNFHeadersImpl { /** * Clear the array of buffers used during the parsing or marshalling of * headers . */ private void clearBuffers ( ) { } }
// simply null out the parse buffers list , then release all the created buffers final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; for ( int i = 0 ; i <= this . parseIndex ; i ++ ) { if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Removing reference to parse buffer: " + this . parseBuffers...
public class MessageStoreImpl { /** * JsMonitoredComponent Implementation */ @ Override public final void reportLocalError ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reportLocalError" ) ; // Only need to set to LOCAL _ ERROR // if we are currently OK . We don ' t want // to overwrite a GLOBAL _ ERROR . if ( _healthState . isOK ( ) ) { _healthState = JsHealthState . getLocalError ...
public class WTemplate { /** * Pass configuration options to the template engine . * The options are determined by the { @ link TemplateRenderer } implementation for the template engine . * The { @ link TemplateRenderer } implemented is determined by the { @ link TemplateRendererFactory } . * @ param key the engi...
if ( Util . empty ( key ) ) { throw new IllegalArgumentException ( "A key must be provided" ) ; } TemplateModel model = getOrCreateComponentModel ( ) ; if ( model . engineOptions == null ) { model . engineOptions = new HashMap < > ( ) ; } model . engineOptions . put ( key , value ) ;
public class HashIntSet { /** * Custom deserializer . */ private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } }
in . defaultReadObject ( ) ; createBuckets ( getBucketCount ( _size ) ) ; for ( int ii = 0 ; ii < _size ; ii ++ ) { readd ( in . readInt ( ) ) ; }
public class ScanResult { /** * Get classes that have a method with a parameter that is annotated with an annotation of the named type . * @ param methodParameterAnnotationName * the name of the method parameter annotation . * @ return A list of classes that have a method with a parameter annotated with the named...
if ( closed . get ( ) ) { throw new IllegalArgumentException ( "Cannot use a ScanResult after it has been closed" ) ; } if ( ! scanSpec . enableClassInfo || ! scanSpec . enableMethodInfo || ! scanSpec . enableAnnotationInfo ) { throw new IllegalArgumentException ( "Please call ClassGraph#enableClassInfo(), #enableMetho...
public class ParityFilePair { /** * Return whether if parity file of the source file exists or not * @ param src The FileStatus of the source file . * @ param codec The Codec of the parity to check * @ param conf * @ return * @ throws IOException */ public static boolean parityExists ( FileStatus src , Codec ...
return ParityFilePair . getParityFile ( codec , src , conf ) != null ;
public class WorkflowsInner { /** * Gets a workflow . * @ param resourceGroupName The resource group name . * @ param workflowName The workflow name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws R...
return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , workflowName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class TextSimilarity { /** * 将字符串的所有数据依次写成一行 , 去除无意义字符串 * @ param str 字符串 * @ return 处理后的字符串 */ private static String removeSign ( String str ) { } }
StringBuilder sb = StrUtil . builder ( str . length ( ) ) ; // 遍历字符串str , 如果是汉字数字或字母 , 则追加到ab上面 int length = str . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { sb . append ( charReg ( str . charAt ( i ) ) ) ; } return sb . toString ( ) ;
public class PercentConverter { /** * Retrieve ( in string format ) from this field . * @ return This field as a percent string . */ public String getString ( ) { } }
String string = Constants . BLANK ; if ( this . getNextConverter ( ) . getData ( ) != null ) { double doubleValue = this . getValue ( ) ; synchronized ( gPercentFormat ) { string = gPercentFormat . format ( doubleValue ) ; } } return string ;
public class Memoize { /** * Creates a new closure delegating to the supplied one and memoizing all return values by the arguments . * The supplied cache is used to store the memoized values and it is the cache ' s responsibility to put limits * on the cache size or implement cache eviction strategy . * The LRUCa...
return new MemoizeFunction < V > ( cache , closure ) ;
import java . lang . Math ; class CalculateSquareRoot { /** * This function calculates the square root of a perfect square . * Args : * n : an input integer which is a perfect square * Returns : * An integer that is the square root of the input perfect square * Examples : * > > > calculateSquareRoot ( 4) ...
int sqRoot = Math . sqrt ( n ) ; return sqRoot ;
public class MinerAdapter { /** * Gets the position of the modification feature as a String . * @ param mf modification feature * @ return location */ public String getPositionInString ( ModificationFeature mf ) { } }
Set vals = SITE_ACC . getValueFromBean ( mf ) ; if ( ! vals . isEmpty ( ) ) { int x = ( ( Integer ) vals . iterator ( ) . next ( ) ) ; if ( x > 0 ) return "@" + x ; } vals = INTERVAL_BEGIN_ACC . getValueFromBean ( mf ) ; if ( ! vals . isEmpty ( ) ) { int begin = ( ( Integer ) vals . iterator ( ) . next ( ) ) ; vals = I...
public class JsonRpcHttpAsyncClient { /** * Invokes the given method with the given arguments and invokes the * { @ code JsonRpcCallback } with the result . * @ param methodName the name of the method to invoke * @ param argument the arguments to the method * @ param callback the { @ code JsonRpcCallback } */ p...
invoke ( methodName , argument , Object . class , new HashMap < String , String > ( ) , callback ) ;
public class TzdbZoneRulesCompiler { /** * Output usage text for the command line . */ private static void outputHelp ( ) { } }
System . out . println ( "Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>" ) ; System . out . println ( "where options include:" ) ; System . out . println ( " -srcdir <directory> Where to find source directories (required)" ) ; System . out . println ( " -dstdir <directory> Where to output gener...
public class VirtualHost { /** * Method getSessionContext . * @ param moduleConfig * @ param webApp * @ return IHttpSessionContext */ @ SuppressWarnings ( "unchecked" ) public IHttpSessionContext getSessionContext ( DeployedModule moduleConfig , WebApp webApp , ArrayList [ ] listeners ) throws Throwable { } }
// System . out . println ( " Vhost createSC " ) ; return ( ( WebContainer ) parent ) . getSessionContext ( moduleConfig , webApp , this . vHostConfig . getName ( ) , listeners ) ;
public class IndexAVL { /** * Returns either child node * @ param x node * @ param isleft boolean * @ return child node */ private static NodeAVL child ( PersistentStore store , NodeAVL x , boolean isleft ) { } }
return isleft ? x . getLeft ( store ) : x . getRight ( store ) ;
public class MapperFactoryBean { /** * { @ inheritDoc } */ public T getObject ( ) throws Exception { } }
final T mapper = getSqlSession ( ) . getMapper ( this . mapperInterface ) ; return Reflection . newProxy ( this . mapperInterface , new InvocationHandler ( ) { @ Override public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { long start = System . currentTimeMillis ( ) ; TraceContext...
public class TypeDescription { /** * Returns the type ' s PropertyDescriptors . */ public PropertyDescriptor [ ] getPropertyDescriptors ( ) { } }
BeanInfo info = getBeanInfo ( ) ; if ( info == null ) { return null ; } PropertyDescriptor [ ] pds = info . getPropertyDescriptors ( ) ; getTeaToolsUtils ( ) . sortPropertyDescriptors ( pds ) ; return pds ;
public class Client { /** * Gets a list of the user Ids assigned to a privilege . * @ param id * Id of the privilege * @ param maxResults * Limit the number of users returned * @ return List of user Ids * @ throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection ...
ExtractionContext context = getResource ( Constants . GET_USERS_ASSIGNED_TO_PRIVILEGE_URL , id ) ; OneloginOAuth2JSONResourceResponse oAuth2Response = null ; String afterCursor = null ; List < Long > userIds = new ArrayList < Long > ( maxResults ) ; while ( oAuth2Response == null || ( userIds . size ( ) < maxResults &&...
public class CancelResizeResult { /** * The names of tables that are being currently imported . * Valid Values : List of table names . * @ param importTablesInProgress * The names of tables that are being currently imported . < / p > * Valid Values : List of table names . */ public void setImportTablesInProgres...
if ( importTablesInProgress == null ) { this . importTablesInProgress = null ; return ; } this . importTablesInProgress = new com . amazonaws . internal . SdkInternalList < String > ( importTablesInProgress ) ;
public class SimonManagerMXBeanImpl { /** * Sample all Counters whose name matches given pattern * @ param namePattern Name pattern , null means all Counters * @ return One Sample for each Counter */ @ Override public List < CounterSample > getCounterSamples ( String namePattern ) { } }
List < CounterSample > counterSamples = new ArrayList < > ( ) ; for ( Simon simon : manager . getSimons ( SimonPattern . createForCounter ( namePattern ) ) ) { counterSamples . add ( sampleCounter ( simon ) ) ; } return counterSamples ;
public class PropertiesListener { /** * Overwrites the default writer to which the output is directed . */ public void setOutputWriter ( Writer writer ) { } }
if ( writer instanceof PrintWriter ) { this . out = ( PrintWriter ) writer ; } else if ( writer == null ) { this . out = null ; } else { this . out = new PrintWriter ( writer ) ; }
public class FlinkKafkaProducer011 { /** * Initializes the connection to Kafka . */ @ Override public void open ( Configuration configuration ) throws Exception { } }
if ( logFailuresOnly ) { callback = new Callback ( ) { @ Override public void onCompletion ( RecordMetadata metadata , Exception e ) { if ( e != null ) { LOG . error ( "Error while sending record to Kafka: " + e . getMessage ( ) , e ) ; } acknowledgeMessage ( ) ; } } ; } else { callback = new Callback ( ) { @ Override ...
public class ApiOvhEmaildomain { /** * List of email address available for migration * REST : GET / email / domain / { domain } / account / { accountName } / migrate / { destinationServiceName } / destinationEmailAddress * @ param quota [ required ] Account maximum size * @ param domain [ required ] Name of your ...
String qPath = "/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress" ; StringBuilder sb = path ( qPath , domain , accountName , destinationServiceName ) ; query ( sb , "quota" , quota ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo...
public class HTMLUtil { /** * returns all urls in a html String * @ param html HTML String to search urls * @ param url Absolute URL path to set * @ return urls found in html String */ public List < URL > getURLS ( String html , URL url ) { } }
List < URL > urls = new ArrayList < URL > ( ) ; SourceCode cfml = new SourceCode ( html , false , CFMLEngine . DIALECT_CFML ) ; while ( ! cfml . isAfterLast ( ) ) { if ( cfml . forwardIfCurrent ( '<' ) ) { for ( int i = 0 ; i < tags . length ; i ++ ) { if ( cfml . forwardIfCurrent ( tags [ i ] . tag + " " ) ) { getSing...
public class AbstractGauge { /** * Sets the image of the currently used led image . * @ param CURRENT _ LED _ IMAGE */ protected void setCurrentLedImage ( final BufferedImage CURRENT_LED_IMAGE ) { } }
if ( currentLedImage != null ) { currentLedImage . flush ( ) ; } currentLedImage = CURRENT_LED_IMAGE ; repaint ( getInnerBounds ( ) ) ;
public class StringUtils { /** * Tests a char to see if is it whitespace . * This method considers the same characters to be white * space as the Pattern class does when matching \ s * @ param ch the character to be tested * @ return true if the character is white space , false otherwise . */ private static boo...
if ( ch == CHAR_SPACE ) return true ; if ( ch == CHAR_TAB ) return true ; if ( ch == CHAR_NEW_LINE ) return true ; if ( ch == CHAR_VERTICAL_TAB ) return true ; if ( ch == CHAR_CARRIAGE_RETURN ) return true ; if ( ch == CHAR_FORM_FEED ) return true ; return false ;
public class CategoryChart { private void sanityCheck ( String seriesName , List < ? > xData , List < ? extends Number > yData , List < ? extends Number > errorBars ) { } }
if ( seriesMap . keySet ( ) . contains ( seriesName ) ) { throw new IllegalArgumentException ( "Series name >" + seriesName + "< has already been used. Use unique names for each series!!!" ) ; } if ( yData == null ) { throw new IllegalArgumentException ( "Y-Axis data cannot be null!!!" ) ; } if ( yData . size ( ) == 0 ...
public class SQLSharedServerLeaseLog { /** * ( non - Javadoc ) * @ see com . ibm . ws . recoverylog . spi . SharedServerLeaseLog # setPeerRecoveryLeaseTimeout ( int ) */ @ Override public void setPeerRecoveryLeaseTimeout ( int leaseTimeout ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setPeerRecoveryLeaseTimeout" , leaseTimeout ) ; // Store the Lease Timeout _leaseTimeout = leaseTimeout ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setPeerRecoveryLeaseTimeout" , this ) ;
public class ListPortfolioAccessRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListPortfolioAccessRequest listPortfolioAccessRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listPortfolioAccessRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listPortfolioAccessRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BINDING ) ; protocolMarshaller . marshall ( listPortfolioAccessRequest . getPortfolioId ( ...
public class StreamEx { /** * Returns a new { @ code StreamEx } which is a concatenation of this stream * and the stream created from supplied collection . * This is a < a href = " package - summary . html # StreamOps " > quasi - intermediate * operation < / a > . * May return this if the supplied collection is...
return appendSpliterator ( null , collection . spliterator ( ) ) ;
public class ChannelImpl { /** * Extracts the peer name from a full channel name . The channel name is * created by asterisk and consists of the peer name a hypen and a unique * sequence number . e . g . SIP / 100-00000123 * For SIP channels the Peer name * is of the form : SIP / 100 For dahdi channels the channe...
// Find the start of the sequence number int channelNameEndPoint = channelName . lastIndexOf ( "-" ) ; // $ NON - NLS - 1 $ if ( channelNameEndPoint == - 1 ) { channelNameEndPoint = channelName . length ( ) ; } // return the peer name which is everything before the sequence number // ( and its hypen ) . return channelN...
public class ConversationAPI { /** * Creates a reply to the conversation . * @ param conversationId * The id of the conversation to reply to * @ param text * The text of the reply * @ return The id of the new message */ public int addReply ( int conversationId , String text ) { } }
return getResourceFactory ( ) . getApiResource ( "/conversation/" + conversationId + "/reply" ) . entity ( new MessageCreate ( text ) , MediaType . APPLICATION_JSON_TYPE ) . get ( MessageCreateResponse . class ) . getMessageId ( ) ;
public class KamDialect { /** * { @ inheritDoc } */ @ Override public KamEdge replaceEdge ( KamEdge kamEdge , FunctionEnum sourceFunction , String sourceLabel , RelationshipType relationship , FunctionEnum targetFunction , String targetLabel ) { } }
return kam . replaceEdge ( kamEdge , sourceFunction , sourceLabel , relationship , targetFunction , targetLabel ) ;
public class UploadOfflineData { /** * Returns the { @ link FieldPathElement # getIndex ( ) } for the specified { @ code field } name , if * present in the error ' s field path elements . * @ param apiError the error to inspect . * @ param field the name of the field to search for in the error ' s field path elem...
FieldPathElement [ ] fieldPathElements = apiError . getFieldPathElements ( ) ; if ( fieldPathElements == null ) { return null ; } for ( int i = 0 ; i < fieldPathElements . length ; i ++ ) { FieldPathElement fieldPathElement = fieldPathElements [ i ] ; if ( field . equals ( fieldPathElement . getField ( ) ) ) { return f...
public class Vector4i { /** * Read this vector from the supplied { @ link IntBuffer } starting at the * specified absolute buffer position / index . * This method will not increment the position of the given IntBuffer . * @ param index * the absolute position into the IntBuffer * @ param buffer * values wil...
MemUtil . INSTANCE . get ( this , index , buffer ) ; return this ;
public class DefaultDelegate { @ Override public void progressiveStop ( CircularProgressDrawable . OnEndListener listener ) { } }
if ( ! mParent . isRunning ( ) || mEndAnimator . isRunning ( ) ) { return ; } mOnEndListener = listener ; mEndAnimator . addListener ( new SimpleAnimatorListener ( ) { @ Override public void onPreAnimationEnd ( Animator animation ) { mEndAnimator . removeListener ( this ) ; CircularProgressDrawable . OnEndListener endL...
public class XPathParser { /** * Parses the the rule ForExpr according to the following production rule : * ForExpr : : = SimpleForClause " return " ExprSingle . * @ throws TTXPathException */ private void parseForExpr ( ) throws TTXPathException { } }
// get number of all for conditions final int rangeVarNo = parseSimpleForClause ( ) ; consume ( "return" , true ) ; // parse return clause parseExprSingle ( ) ; mPipeBuilder . addForExpression ( rangeVarNo ) ;
public class FieldRefConstant { /** * Writes the contents of the pool entry . */ void write ( ByteCodeWriter out ) throws IOException { } }
out . write ( ConstantPool . CP_FIELD_REF ) ; out . writeShort ( _classIndex ) ; out . writeShort ( _nameAndTypeIndex ) ;
public class Char { /** * Encodes a character to a backslash code ( if necessary ) */ public static String encodeBackslash ( char c ) { } }
if ( isAlphanumeric ( c ) || c == ' ' ) return ( "" + c ) ; String hex = Integer . toHexString ( c ) ; while ( hex . length ( ) < 4 ) hex = "0" + hex ; return ( "\\u" + hex ) ;
public class ConfusionMatrix { /** * The percentage of positive predictions that are correct . * @ return Precision */ public double precision ( ) { } }
if ( ! isBinary ( ) ) throw new UnsupportedOperationException ( "precision is only implemented for 2 class problems." ) ; if ( tooLarge ( ) ) throw new UnsupportedOperationException ( "precision cannot be computed: too many classes" ) ; double tp = _cm [ 1 ] [ 1 ] ; double fp = _cm [ 0 ] [ 1 ] ; return tp / ( tp + fp )...
public class ProductDimensionComparator { /** * Returns the deep comparator that will compare the appropriate values between two instances of * type D . Throws an IllegalArgumentException if { @ code D } is a subclass of ProductDimension not * supported by Shopping campaigns . As of v201409 , the types not supporte...
@ SuppressWarnings ( "unchecked" ) Comparator < D > comparator = ( Comparator < D > ) comparatorMap . get ( dimension . getClass ( ) ) ; Preconditions . checkArgument ( comparator != null , "No comparator exists for %s. This comparator only supports comparisons of " + "ProductDimension subclasses supported by Shopping ...
public class RestAction { /** * Schedules a call to { @ link # complete ( ) } to be executed after the specified { @ code delay } . * < br > This is an < b > asynchronous < / b > operation that will return a * { @ link java . util . concurrent . ScheduledFuture ScheduledFuture } representing the task . * < p > Th...
Checks . notNull ( executor , "Scheduler" ) ; Checks . notNull ( unit , "TimeUnit" ) ; return executor . schedule ( ( Callable < T > ) new ContextRunnable ( ( Callable < T > ) this :: complete ) , delay , unit ) ;