signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class InequalityRule { /** * { @ inheritDoc } */ public boolean evaluate ( final LoggingEvent event , Map matches ) { } }
long first = 0 ; try { first = new Long ( RESOLVER . getValue ( field , event ) . toString ( ) ) . longValue ( ) ; } catch ( NumberFormatException nfe ) { return false ; } long second = 0 ; try { second = new Long ( value ) . longValue ( ) ; } catch ( NumberFormatException nfe ) { return false ; } boolean result = fals...
public class MultiViewOps { /** * Creates a trifocal tensor from two camera matrices . T < sub > i < / sub > < sup > jk < / sup > = a [ j , i ] * b [ k , 3 ] - a [ j , 3 ] * b [ k , i ] , * where a = P2 and b = P3. * IMPORTANT : It is assumed that the first camera has the following camera matrix P1 = [ I | 0 ] , ...
if ( ret == null ) ret = new TrifocalTensor ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { DMatrixRMaj T = ret . getT ( i ) ; int index = 0 ; for ( int j = 0 ; j < 3 ; j ++ ) { double a_left = P2 . get ( j , i ) ; double a_right = P2 . get ( j , 3 ) ; for ( int k = 0 ; k < 3 ; k ++ ) { T . data [ index ++ ] = a_left * P3 . g...
public class AbstractListPreference { /** * Obtains the scrollable area of the preference ' s dialog from a specific typed array . * @ param typedArray * The typed array , the scrollable area should be obtained from , as an instance of the * class { @ link TypedArray } . The typed array may not be null */ private...
int topIndex = typedArray . getInt ( R . styleable . DialogPreference_dialogScrollableAreaTop , - 1 ) ; ScrollableArea . Area top = null ; ScrollableArea . Area bottom = null ; if ( topIndex != - 1 ) { top = ScrollableArea . Area . fromIndex ( topIndex ) ; int bottomIndex = typedArray . getInt ( R . styleable . DialogP...
public class SimpleGroovyClassDocAssembler { /** * hack warning ! fragile ! TODO find a better way */ private String getDefaultValue ( GroovySourceAST t ) { } }
GroovySourceAST child = ( GroovySourceAST ) t . getFirstChild ( ) ; if ( t . getNumberOfChildren ( ) != 4 ) return null ; for ( int i = 1 ; i < t . getNumberOfChildren ( ) ; i ++ ) { child = ( GroovySourceAST ) child . getNextSibling ( ) ; } GroovySourceAST nodeToProcess = child ; if ( child . getType ( ) != ANNOTATION...
public class UpdateIdentityPoolResult { /** * A list representing an Amazon Cognito user pool and its client ID . * @ param cognitoIdentityProviders * A list representing an Amazon Cognito user pool and its client ID . */ public void setCognitoIdentityProviders ( java . util . Collection < CognitoIdentityProvider >...
if ( cognitoIdentityProviders == null ) { this . cognitoIdentityProviders = null ; return ; } this . cognitoIdentityProviders = new java . util . ArrayList < CognitoIdentityProvider > ( cognitoIdentityProviders ) ;
public class ComputeNodeReimageHeaders { /** * Set the time at which the resource was last modified . * @ param lastModified the lastModified value to set * @ return the ComputeNodeReimageHeaders object itself . */ public ComputeNodeReimageHeaders withLastModified ( DateTime lastModified ) { } }
if ( lastModified == null ) { this . lastModified = null ; } else { this . lastModified = new DateTimeRfc1123 ( lastModified ) ; } return this ;
public class InstanceAdminClient { /** * Sets the access control policy on an instance resource . Replaces any existing policy . * < p > Authorization requires ` spanner . instances . setIamPolicy ` on * [ resource ] [ google . iam . v1 . SetIamPolicyRequest . resource ] . * < p > Sample code : * < pre > < code...
SetIamPolicyRequest request = SetIamPolicyRequest . newBuilder ( ) . setResource ( resource ) . setPolicy ( policy ) . build ( ) ; return setIamPolicy ( request ) ;
public class Query { /** * < code > * See { @ link Query # setQueryUrlParams ( Map ) } . * < / code > * @ param key * The key of the url parameter * @ param value * The value of the url parameter */ public Query addQueryUrlParams ( String key , String value ) { } }
this . queryUrlParams . put ( key , value ) ; return this ;
public class CarrierAccount { /** * update */ public CarrierAccount update ( Map < String , Object > params ) throws EasyPostException { } }
return this . update ( params , null ) ;
public class EventCollector { /** * Execute all filters for the event . * @ param event the event * @ return true , if successful */ private boolean filter ( Event event ) { } }
if ( null == filters ) return false ; for ( EventFilter filter : filters ) { if ( filter . filter ( event ) ) { return true ; } } return false ;
public class SrcGen4J { /** * Incremental parse and generate . The class loader of this class will be used . * @ param files * Set of files to parse for the model . * @ throws ParseException * Error during parse process . * @ throws GenerateException * Error during generation process . */ public final void ...
Contract . requireArgNotNull ( "files" , files ) ; LOG . info ( "Executing incremental build ({} files)" , files . size ( ) ) ; if ( LOG . isDebugEnabled ( ) ) { for ( final File file : files ) { LOG . debug ( file . toString ( ) ) ; } } if ( files . size ( ) == 0 ) { // Nothing to do . . . return ; } // Parse models &...
public class HttpServletResponseWrapper { /** * The default behavior of this method is to return addHeader ( String name , String value ) * on the wrapped response object . */ @ Override public void addHeader ( String name , String value ) { } }
this . _getHttpServletResponse ( ) . addHeader ( name , value ) ;
public class AbstractClassFileWriter { /** * Pushes type arguments onto the stack . * @ param generatorAdapter The generator adapter * @ param types The type references */ protected static void pushTypeArguments ( GeneratorAdapter generatorAdapter , Map < String , Object > types ) { } }
if ( types == null || types . isEmpty ( ) ) { generatorAdapter . visitInsn ( ACONST_NULL ) ; return ; } int len = types . size ( ) ; // Build calls to Argument . create ( . . . ) pushNewArray ( generatorAdapter , Argument . class , len ) ; int i = 0 ; for ( Map . Entry < String , Object > entry : types . entrySet ( ) )...
public class SortedBugCollection { /** * Write the BugCollection to given output stream as XML . The output stream * will be closed , even if an exception is thrown . * @ param out * the OutputStream to write to */ @ Override public void writeXML ( @ WillClose Writer out ) throws IOException { } }
assert project != null ; bugsPopulated ( ) ; XMLOutput xmlOutput ; // if ( project = = null ) throw new NullPointerException ( " No project " ) ; xmlOutput = new OutputStreamXMLOutput ( out ) ; writeXML ( xmlOutput ) ;
public class PoolListHeaders { /** * Set the time at which the resource was last modified . * @ param lastModified the lastModified value to set * @ return the PoolListHeaders object itself . */ public PoolListHeaders withLastModified ( DateTime lastModified ) { } }
if ( lastModified == null ) { this . lastModified = null ; } else { this . lastModified = new DateTimeRfc1123 ( lastModified ) ; } return this ;
public class DataTable { /** * getter for body - gets the body of the table that contains data * @ generated * @ return value of the feature */ public StringArray getBody ( ) { } }
if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_body == null ) jcasType . jcas . throwFeatMissing ( "body" , "ch.epfl.bbp.uima.types.DataTable" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DataTable_Type ) jcasType ) . cas...
public class Config { /** * Sets the map of map event journal configurations , mapped by config name . * The config name may be a pattern with which the configuration will be * obtained in the future . * @ param eventJournalConfigs the map event journal configuration map to set * @ return this config instance *...
this . mapEventJournalConfigs . clear ( ) ; this . mapEventJournalConfigs . putAll ( eventJournalConfigs ) ; for ( Entry < String , EventJournalConfig > entry : eventJournalConfigs . entrySet ( ) ) { entry . getValue ( ) . setMapName ( entry . getKey ( ) ) ; } return this ;
public class TimeParser { /** * returns the instance . * @ return Parser */ public static final Parser < Date > instance ( ) { } }
// NOPMD it ' s thread save ! if ( TimeParser . instanceParser == null ) { synchronized ( TimeParser . class ) { if ( TimeParser . instanceParser == null ) { TimeParser . instanceParser = new TimeParser ( "HH:mm:ss" ) ; } } } return TimeParser . instanceParser ;
public class PDFDomTree { /** * Parses a PDF document and serializes the resulting DOM tree to an output . This requires * a DOM Level 3 capable implementation to be available . */ @ Override public void writeText ( PDDocument doc , Writer outputStream ) throws IOException { } }
try { DOMImplementationRegistry registry = DOMImplementationRegistry . newInstance ( ) ; DOMImplementationLS impl = ( DOMImplementationLS ) registry . getDOMImplementation ( "LS" ) ; LSSerializer writer = impl . createLSSerializer ( ) ; LSOutput output = impl . createLSOutput ( ) ; writer . getDomConfig ( ) . setParame...
public class PathParamArgs { /** * # hope jflute similer to UrlPatternAnalyzer ' s one so want to refactor ( 2018/10/30) */ public boolean isNumberTypeParameter ( int index ) { } }
// contains optional generic type if ( pathParamTypeList . size ( ) <= index ) { // avoid out of bounds return false ; } final Class < ? > parameterType = pathParamTypeList . get ( index ) ; if ( Number . class . isAssignableFrom ( parameterType ) ) { return true ; } if ( parameterType . isPrimitive ( ) && Stream . of ...
public class HerokuAPI { /** * Update the list of buildpacks installed on an app * @ param appName See { @ link # listApps } for a list of apps that can be used . * @ param buildpacks the new list of buildpack names or URLs . */ public void updateBuildpackInstallations ( String appName , List < String > buildpacks ...
connection . execute ( new BuildpackInstallationUpdate ( appName , buildpacks ) , apiKey ) ;
public class ProxyFilter { /** * Get the { @ link ProxyLogicHandler } for a given session . * @ param session the session object * @ return the handler which will handle handshaking with the proxy */ private ProxyLogicHandler getProxyHandler ( final IoSession session ) { } }
ProxyLogicHandler handler = ( ( ProxyIoSession ) session . getAttribute ( ProxyIoSession . PROXY_SESSION ) ) . getHandler ( ) ; if ( handler == null ) { throw new IllegalStateException ( ) ; } // Sanity check if ( handler . getProxyIoSession ( ) . getProxyFilter ( ) != this ) { throw new IllegalArgumentException ( "Not...
public class PBaseNumber { /** * Between lower and upper values . * @ param lower the lower bind value * @ param upper the upper bind value * @ return the root query bean instance */ public R between ( int lower , int upper ) { } }
expr ( ) . between ( _name , lower , upper ) ; return _root ;
public class ReconfigurableClient { /** * Closes the connection of a messaging client and terminates it properly . * @ param client the client ( never null ) * @ param errorMessage the error message to log in case of problem * @ param logger a logger */ static void terminateClient ( IMessagingClient client , Stri...
try { logger . fine ( "The reconfigurable client is requesting its internal connection to be closed." ) ; if ( client != null ) client . closeConnection ( ) ; } catch ( Exception e ) { logger . warning ( errorMessage + " " + e . getMessage ( ) ) ; Utils . logException ( logger , e ) ; } finally { // " unregisterService...
public class BillableRevenueOverrides { /** * Sets the netBillableRevenueOverride value for this BillableRevenueOverrides . * @ param netBillableRevenueOverride * The overridden { @ link ReconciliationLineItemReport # netBillableRevenue } . * < p > If the { @ link ReconciliationLineItemReport } data * is for a { ...
this . netBillableRevenueOverride = netBillableRevenueOverride ;
public class BundleProcessor { /** * Creates the bundles in the destination directory * @ param servlet * the servlet * @ param bundleHandler * the bundles handler * @ param destDirPath * the destination directory path * @ param servletMapping * the mapping of the servlet * @ param keepUrlMapping * ...
List < JoinableResourceBundle > bundles = bundleHandler . getContextBundles ( ) ; Iterator < JoinableResourceBundle > bundleIterator = bundles . iterator ( ) ; MockServletResponse response = new MockServletResponse ( ) ; MockServletRequest request = new MockServletRequest ( JAWR_BUNDLE_PROCESSOR_CONTEXT_PATH ) ; MockSe...
public class JavaFxSubscriptions { /** * Create a Disposable that always runs < code > unsubscribe < / code > in the event dispatch thread . * @ param unsubscribe the runnable to be performed in the ui thread at un - subscription * @ return an Disposable that always runs < code > unsubscribe < / code > in the event...
return Disposables . fromRunnable ( ( ) -> { if ( Platform . isFxApplicationThread ( ) ) { unsubscribe . run ( ) ; } else { final Scheduler . Worker inner = JavaFxScheduler . platform ( ) . createWorker ( ) ; inner . schedule ( ( ) -> { unsubscribe . run ( ) ; inner . dispose ( ) ; } ) ; } } ) ;
public class EmbeddedNeo4jEntityQueries { /** * Find the node corresponding to an entity . * @ param executionEngine the { @ link GraphDatabaseService } used to run the query * @ param columnValues the values in { @ link org . hibernate . ogm . model . key . spi . EntityKey # getColumnValues ( ) } * @ return the ...
Map < String , Object > params = params ( columnValues ) ; Result result = executionEngine . execute ( getFindEntityQuery ( ) , params ) ; return singleResult ( result ) ;
public class BasicAnnotationProcessor { /** * Adds { @ code element } and its enclosed elements to { @ code annotatedElements } if they are * annotated with any annotations in { @ code annotationClasses } . Does not traverse to member types * of { @ code element } , so that if { @ code Outer } is passed in the exam...
for ( Element enclosedElement : element . getEnclosedElements ( ) ) { if ( ! enclosedElement . getKind ( ) . isClass ( ) && ! enclosedElement . getKind ( ) . isInterface ( ) ) { findAnnotatedElements ( enclosedElement , annotationClasses , annotatedElements ) ; } } // element . getEnclosedElements ( ) does NOT return p...
public class IntegerRendererWithoutSeparator { /** * returns the instance . * @ return CurrencyDoubleRenderer */ public static final Renderer < Integer > instance ( ) { } }
// NOPMD it ' s thread save ! if ( IntegerRendererWithoutSeparator . instanceRenderer == null ) { synchronized ( IntegerRendererWithoutSeparator . class ) { if ( IntegerRendererWithoutSeparator . instanceRenderer == null ) { IntegerRendererWithoutSeparator . instanceRenderer = new IntegerRendererWithoutSeparator ( ) ; ...
public class FeedCommProcessor { /** * Call this when you know the feed comm processor object will never be used again * and thus the ping executor will also never be used again . */ private void destroyPingExecutor ( ) { } }
synchronized ( pingExecutor ) { if ( ! pingExecutor . isShutdown ( ) ) { try { log . debugf ( "Shutting down WebSocket ping executor" ) ; pingExecutor . shutdown ( ) ; if ( ! pingExecutor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { pingExecutor . shutdownNow ( ) ; } } catch ( Throwable t ) { log . warnf ( "Cannot...
public class Anima { /** * Batch delete model * @ param model model class type * @ param ids mode primary id array * @ param < T > * @ param < S > */ @ SafeVarargs public static < T extends Model , S extends Serializable > void deleteBatch ( Class < T > model , S ... ids ) { } }
atomic ( ( ) -> Arrays . stream ( ids ) . forEach ( new AnimaQuery < > ( model ) :: deleteById ) ) . catchException ( e -> log . error ( "Batch save model error, message: {}" , e ) ) ;
public class CurationManager { /** * Get the stored harvest configuration from storage for the indicated * object . * @ param oid * The object we want config for */ private JsonSimple getConfigFromStorage ( String oid ) { } }
String configOid = null ; String configPid = null ; // Get our object and look for its config info try { DigitalObject object = storage . getObject ( oid ) ; Properties metadata = object . getMetadata ( ) ; configOid = metadata . getProperty ( "jsonConfigOid" ) ; configPid = metadata . getProperty ( "jsonConfigPid" ) ;...
public class MetricZipperTransform { /** * Merges data points . * @ param originalDatapoints The original data points . * @ param baseDatapoints The base data points . * @ return The merged data points . */ public Map < Long , Double > zip ( Map < Long , Double > originalDatapoints , Map < Long , Double > baseDat...
SystemAssert . requireArgument ( baseDatapoints != null && ! baseDatapoints . isEmpty ( ) , "Zipper transform requires valid baseDatapoints from base metric!" ) ; Map < Long , Double > zippedDP = new HashMap < > ( ) ; for ( Map . Entry < Long , Double > originalDP : originalDatapoints . entrySet ( ) ) { Long originalKe...
public class AsciiSequenceView { /** * { @ inheritDoc } */ public char charAt ( final int index ) { } }
if ( index < 0 || index >= length ) { throw new StringIndexOutOfBoundsException ( "index=" + index + " length=" + length ) ; } return ( char ) buffer . getByte ( offset + index ) ;
public class JdbcControlImpl { /** * Get a connection from a DataSource . * @ param jndiName Specifed in the subclasse ' s ConnectionDataSource annotation * @ param jndiFactory Specified in the subclasse ' s ConnectionDataSource Annotation . * @ return null if a connection cannot be established * @ throws SQLEx...
Connection con = null ; try { JndiContextFactory jf = ( JndiContextFactory ) jndiFactory . newInstance ( ) ; Context jndiContext = jf . getContext ( ) ; _dataSource = ( DataSource ) jndiContext . lookup ( jndiName ) ; con = _dataSource . getConnection ( ) ; } catch ( IllegalAccessException iae ) { throw new ControlExce...
public class Json { /** * Quicker method for loading a json string into a < code > Map < / code > of < code > String < / code > keys and < code > Object < / code > * values . This method does not use information about { @ link JsonSerializable } and instead loads into basic data types . * @ param json the json to l...
return qloads ( json . readToString ( ) . trim ( ) ) ;
public class ConfigUtil { /** * Convert the value to an integer . * @ param value The value instance . * @ return The integer value . */ public static int asInteger ( Object value ) { } }
if ( value instanceof Number ) { return ( ( Number ) value ) . intValue ( ) ; } else if ( value instanceof Numeric ) { return ( ( Numeric ) value ) . asInteger ( ) ; } else if ( value instanceof Boolean ) { return ( ( Boolean ) value ) ? 1 : 0 ; } else if ( value instanceof CharSequence ) { try { return Integer . parse...
public class ArrayUtils { /** * Searches the array for the first element accepted by the { @ link Filter } . * @ param < T > Class type of the elements in the array . * @ param array array to search . * @ param filter { @ link Filter } used to find the first element in the array accepted by the { @ link Filter } ...
Assert . notNull ( filter , "Filter is required" ) ; return stream ( nullSafeArray ( array ) ) . filter ( filter :: accept ) . findFirst ( ) . orElse ( null ) ;
public class AbstractGraph { /** * { @ inheritDoc } */ public int degree ( int vertex ) { } }
EdgeSet < T > e = getEdgeSet ( vertex ) ; return ( e == null ) ? 0 : e . size ( ) ;
public class RuntimeUtil { /** * 获取命令执行结果 , 获取后销毁进程 * @ param process { @ link Process } 进程 * @ param charset 编码 * @ return 命令执行结果列表 * @ since 3.1.2 */ public static String getResult ( Process process , Charset charset ) { } }
InputStream in = null ; try { in = process . getInputStream ( ) ; return IoUtil . read ( in , charset ) ; } finally { IoUtil . close ( in ) ; destroy ( process ) ; }
public class EditDistance { /** * / to transform one string to the other , or - 1 if the distance is greater than the specified maxDistance . < / returns > */ public int DamerauLevenshteinDistance ( String string2 , int maxDistance ) { } }
if ( baseString == null ) return string2 == null ? 0 : string2 . length ( ) ; // string2 ? ? " " ) . Length ; if ( string2 == null || string2 . isEmpty ( ) ) return baseString . length ( ) ; if ( maxDistance == 0 ) return baseString . equals ( string2 ) ? 0 : - 1 ; // if strings of different lengths , ensure shorter st...
public class UserAPI { /** * 标签管理 获取公众号已创建的标签 * @ since 2.8.1 * @ param access _ token access _ token * @ return result */ public static TagsGetResult tagsGet ( String access_token ) { } }
HttpUriRequest httpUriRequest = RequestBuilder . get ( ) . setUri ( BASE_URI + "/cgi-bin/tags/get" ) . addParameter ( PARAM_ACCESS_TOKEN , API . accessToken ( access_token ) ) . build ( ) ; return LocalHttpClient . executeJsonResult ( httpUriRequest , TagsGetResult . class ) ;
public class BigComplex { /** * Calculates the subtraction of the given complex value from this complex number . * < p > This methods < strong > does not < / strong > modify this instance . < / p > * @ param value the { @ link BigComplex } value to subtract * @ return the calculated { @ link BigComplex } result *...
return valueOf ( re . subtract ( value . re ) , im . subtract ( value . im ) ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.ibm.com/websphere/wim" , name = "roomNumber" ) public JAXBElement < String > createRoomNumber ( String value ) { } }
return new JAXBElement < String > ( _RoomNumber_QNAME , String . class , null , value ) ;
public class DoradusClient { /** * Set credentials such as tenant , username , password for use with a Doradus application . * @ param tenant tenant name * @ param username user name use when accessing applications within the specified tenant . * @ param userpassword user password */ public void setCredentials ( ...
Credentials credentials = new Credentials ( tenant , username , userpassword ) ; restClient . setCredentials ( credentials ) ;
public class InfluxMeterRegistry { /** * VisibleForTesting */ Stream < String > writeGauge ( Meter . Id id , Double value ) { } }
if ( Double . isFinite ( value ) ) { return Stream . of ( influxLineProtocol ( id , "gauge" , Stream . of ( new Field ( "value" , value ) ) ) ) ; } return Stream . empty ( ) ;
public class UndoCommand { /** * { @ inheritDoc } */ @ Override protected void perform ( final Wave wave ) throws CommandException { } }
this . stackName = wave . get ( UndoRedoWaves . STACK_NAME ) ; getService ( UndoRedoService . class , this . stackName ) . undo ( ) ;
public class GinjectorFragmentOutputter { /** * Outputs all the top - level methods and fields of the class , and commits the * writer . Must be the last method invoked on this object . */ void commit ( ) { } }
if ( committed ) { errorManager . logError ( "Committed the fragment for %s twice." , fragmentPackageName ) ; return ; } committed = true ; // Write the field where the enclosing injector is stored . writer . beginJavaDocComment ( ) ; writer . print ( "Field for the enclosing injector." ) ; writer . endJavaDocComment (...
public class WrappingUtils { /** * Wraps the given drawable with a new { @ link MatrixDrawable } . * < p > If the provided drawable or matrix is null , the given drawable is returned without * being wrapped . * @ return the wrapping matrix drawable , or the original drawable if the wrapping didn ' t * take plac...
if ( drawable == null || matrix == null ) { return drawable ; } return new MatrixDrawable ( drawable , matrix ) ;
public class StaticLog { /** * Error等级日志 < br > * @ param log 日志对象 * @ param format 格式文本 , { } 代表变量 * @ param arguments 变量对应的参数 */ public static void error ( Log log , String format , Object ... arguments ) { } }
error ( log , null , format , arguments ) ;
public class DataChecksum { /** * This constructucts a DataChecksum by reading HEADER _ LEN bytes from * input stream < i > in < / i > */ public static DataChecksum newDataChecksum ( DataInputStream in ) throws IOException { } }
int type = in . readByte ( ) ; int bpc = in . readInt ( ) ; DataChecksum summer = newDataChecksum ( type , bpc ) ; if ( summer == null ) { throw new IOException ( "Could not create DataChecksum of type " + type + " with bytesPerChecksum " + bpc ) ; } return summer ;
public class ArrayTypes { /** * / * @ Nullable */ private ArrayTypeReference doTryConvertToArray ( ParameterizedTypeReference typeReference ) { } }
LightweightTypeReference parameterizedIterable = typeReference . getSuperType ( Iterable . class ) ; if ( parameterizedIterable != null ) { ITypeReferenceOwner owner = typeReference . getOwner ( ) ; if ( parameterizedIterable . isRawType ( ) ) { // return Object [ ] List < LightweightTypeReference > superTypes = parame...
public class ComponentsInner { /** * Purges data in an Application Insights component by a set of user - defined filters . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the Application Insights component resource . * @ param body Describes the body of a request to...
return purgeWithServiceResponseAsync ( resourceGroupName , resourceName , body ) . map ( new Func1 < ServiceResponse < ComponentPurgeResponseInner > , ComponentPurgeResponseInner > ( ) { @ Override public ComponentPurgeResponseInner call ( ServiceResponse < ComponentPurgeResponseInner > response ) { return response . b...
public class ViewMgr { /** * We may have to come out a better method . */ public Collection < String > getViewNamesByTable ( String tblName , Transaction tx ) { } }
Collection < String > result = new LinkedList < String > ( ) ; TableInfo ti = tblMgr . getTableInfo ( VCAT , tx ) ; RecordFile rf = ti . open ( tx , true ) ; rf . beforeFirst ( ) ; while ( rf . next ( ) ) { Parser parser = new Parser ( ( String ) rf . getVal ( VCAT_VDEF ) . asJavaVal ( ) ) ; if ( parser . queryCommand ...
public class Util { /** * Get this image ' s full filename . * @ param strSubDirectory The sub - directory . * @ param fixRelativePaths Fix the relative paths * @ param filename The filename of this image ( if no path , assumes images / buttons ; if not ext assumes . gif ) . * @ return The full ( relative ) fil...
String localLocation = fileLocation . substring ( fileLocation . lastIndexOf ( '/' ) + 1 ) ; if ( ( ( strFilename . indexOf ( File . separator ) == - 1 ) && ( strFilename . indexOf ( '/' ) == - 1 ) ) && ( strSubDirectory != null ) ) strFilename = fileLocation + File . separator + strSubDirectory + File . separator + st...
public class MultiHashTable { /** * version : key is irrelevant */ @ Nonnull public < B > HashTable < K , B > toHashTable ( @ Nonnull F < ImmutableList < V > , B > conversion ) { } }
// return this . data . foldLeft ( ( acc , p ) - > acc . put ( p . a , conversion . apply ( p . b ) ) , HashTable . empty ( this . data . hasher ) ) ; return this . toHashTable ( ( k , vs ) -> conversion . apply ( vs ) ) ;
public class SyncServerGroupOperationHandler { /** * For the local model we include both the original as well as the remote model . The diff will automatically remove * not used configuration . * @ param context the operation context * @ param remote the remote model * @ param remoteExtensions the extension reg...
final ReadMasterDomainModelUtil . RequiredConfigurationHolder rc = new ReadMasterDomainModelUtil . RequiredConfigurationHolder ( ) ; final PathElement host = PathElement . pathElement ( HOST , localHostName ) ; final Resource hostModel = context . readResourceFromRoot ( PathAddress . EMPTY_ADDRESS . append ( host ) ) ;...
public class OobChannel { /** * Must be called only once , right after the OobChannel is created . */ void setSubchannel ( final InternalSubchannel subchannel ) { } }
log . log ( Level . FINE , "[{0}] Created with [{1}]" , new Object [ ] { this , subchannel } ) ; this . subchannel = subchannel ; subchannelImpl = new AbstractSubchannel ( ) { @ Override public void shutdown ( ) { subchannel . shutdown ( Status . UNAVAILABLE . withDescription ( "OobChannel is shutdown" ) ) ; } @ Overri...
public class ModelsImpl { /** * Delete an entity role . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The entity ID . * @ param roleId The entity role Id . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to...
return deletePatternAnyEntityRoleWithServiceResponseAsync ( appId , versionId , entityId , roleId ) . map ( new Func1 < ServiceResponse < OperationStatus > , OperationStatus > ( ) { @ Override public OperationStatus call ( ServiceResponse < OperationStatus > response ) { return response . body ( ) ; } } ) ;
public class WorkflowClient { /** * Paginated search for workflows based on payload * @ param start start value of page * @ param size number of workflows to be returned * @ param sort sort order * @ param freeText additional free text query * @ param query the search query * @ return the { @ link SearchRes...
Object [ ] params = new Object [ ] { "start" , start , "size" , size , "sort" , sort , "freeText" , freeText , "query" , query } ; return getForEntity ( "workflow/search" , params , searchResultWorkflowSummary ) ;
public class LottieDrawable { /** * Create a composition with { @ link LottieCompositionFactory } * @ return True if the composition is different from the previously set composition , false otherwise . */ public boolean setComposition ( LottieComposition composition ) { } }
if ( this . composition == composition ) { return false ; } isDirty = false ; clearComposition ( ) ; this . composition = composition ; buildCompositionLayer ( ) ; animator . setComposition ( composition ) ; setProgress ( animator . getAnimatedFraction ( ) ) ; setScale ( scale ) ; updateBounds ( ) ; // We copy the task...
public class ServiceRefTypeImpl { /** * Returns all < code > port - component - ref < / code > elements * @ return list of < code > port - component - ref < / code > */ public List < PortComponentRefType < ServiceRefType < T > > > getAllPortComponentRef ( ) { } }
List < PortComponentRefType < ServiceRefType < T > > > list = new ArrayList < PortComponentRefType < ServiceRefType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "port-component-ref" ) ; for ( Node node : nodeList ) { PortComponentRefType < ServiceRefType < T > > type = new PortComponentRefTypeImpl < Servi...
public class ReadOnlyStorageEngine { /** * Time since last time the store was swapped * @ return Time in milliseconds since the store was swapped */ @ JmxGetter ( name = "lastSwapped" , description = "Time in milliseconds since the store was swapped" ) public long getLastSwapped ( ) { } }
long timeSinceLastSwap = System . currentTimeMillis ( ) - lastSwapped ; return timeSinceLastSwap > 0 ? timeSinceLastSwap : 0 ;
public class AbstractReady { /** * { @ inheritDoc } */ @ Override public final < C extends Command > C getCommand ( final UniqueKey < C > commandKey ) { } }
localFacade ( ) . globalFacade ( ) . trackEvent ( JRebirthEventType . ACCESS_COMMAND , this . getClass ( ) , commandKey . classField ( ) ) ; return localFacade ( ) . globalFacade ( ) . commandFacade ( ) . retrieve ( commandKey ) ;
public class DateOffsetScanListener { /** * FormatDate Method . */ public String formatDate ( Date date , int type ) { } }
String string = null ; if ( type == DBConstants . DATE_TIME_FORMAT ) string = XmlUtilities . dateTimeFormat . format ( date ) ; else if ( type == DBConstants . DATE_ONLY_FORMAT ) string = XmlUtilities . dateFormat . format ( date ) ; else if ( type == DBConstants . TIME_ONLY_FORMAT ) string = XmlUtilities . timeFormat ...
public class StorageTierAssoc { /** * Interprets a tier ordinal given the number of tiers . * Non - negative values identify tiers starting from top going down ( 0 identifies the first tier , * 1 identifies the second tier , and so on ) . If the provided value is greater than the number * of tiers , it identifies...
if ( ordinal >= 0 ) { return Math . min ( ordinal , numTiers - 1 ) ; } return Math . max ( numTiers + ordinal , 0 ) ;
public class DaoHelper { /** * 转为单列查询语句 * @ param sql * @ return */ public static String toSingleColumnSql ( String sql ) { } }
String tempSql = sql . trim ( ) ; String regex = "(?i)^select(.*?)from" ; Matcher m = Pattern . compile ( regex ) . matcher ( tempSql ) ; String columnAlias = SqlTemplate . SINGLE_COLUMN_ALIAS ; if ( m . find ( ) ) { columnAlias = m . group ( 1 ) . trim ( ) . replaceAll ( "\\(\\s+" , "(" ) . replaceAll ( "\\s+\\)" , ")...
public class MtasRBTree { /** * ( non - Javadoc ) * @ see mtas . codec . tree . MtasTree # addRange ( int , int , java . lang . Integer , * java . lang . Long ) */ @ Override final protected void addRange ( int left , int right , int additionalId , long additionalRef , Integer id , Long ref ) { } }
String key = left + "_" + right ; if ( index . containsKey ( key ) ) { index . get ( key ) . addIdAndRef ( id , ref , additionalId , additionalRef ) ; } else { root = addRange ( root , left , right , additionalId , additionalRef , id , ref ) ; root . color = MtasRBTreeNode . BLACK ; }
public class BigtableDataGrpcClient { /** * { @ inheritDoc } */ @ Override public ResultScanner < Row > readRows ( ReadRowsRequest request ) { } }
if ( shouldOverrideAppProfile ( request . getAppProfileId ( ) ) ) { request = request . toBuilder ( ) . setAppProfileId ( clientDefaultAppProfileId ) . build ( ) ; } // Delegate all resumable operations to the scanner . It will request a non - resumable scanner // during operation . // TODO ( sduskis ) : Figure out a w...
public class ContainerInstanceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ContainerInstance containerInstance , ProtocolMarshaller protocolMarshaller ) { } }
if ( containerInstance == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( containerInstance . getContainerInstanceArn ( ) , CONTAINERINSTANCEARN_BINDING ) ; protocolMarshaller . marshall ( containerInstance . getEc2InstanceId ( ) , EC2INSTAN...
public class SelectParser { /** * STDDEV _ POP | STDDEV _ SAMP } ( [ ALL | DISTINCT ] [ 1 ] ] Expression ) } [ [ AS ] label ] */ private Expression clip ( ParserString raw ) throws SQLParserException { } }
Expression exp = column ( raw ) ; // if ( exp = = null ) exp = brackedColumn ( raw ) ; if ( exp == null ) exp = date ( raw ) ; if ( exp == null ) exp = bracked ( raw ) ; if ( exp == null ) exp = number ( raw ) ; if ( exp == null ) exp = string ( raw ) ; return exp ;
public class AutoElasticsearch { /** * Utility methods */ private void putCred ( String key , EsToken token , Map < String , String > credentials ) { } }
FastByteArrayOutputStream stream = new FastByteArrayOutputStream ( ) ; DataOutput output = new DataOutputStream ( stream ) ; try { token . writeOut ( output ) ; } catch ( IOException e ) { throw new EsHadoopException ( "Could not serialize EsToken" , e ) ; } String credential = new String ( Base64 . encodeBase64 ( stre...
public class ModifyDBClusterSnapshotAttributeRequest { /** * A list of DB cluster snapshot attributes to add to the attribute specified by < code > AttributeName < / code > . * To authorize other AWS accounts to copy or restore a manual DB cluster snapshot , set this list to include one or * more AWS account IDs , ...
if ( this . valuesToAdd == null ) { setValuesToAdd ( new com . amazonaws . internal . SdkInternalList < String > ( valuesToAdd . length ) ) ; } for ( String ele : valuesToAdd ) { this . valuesToAdd . add ( ele ) ; } return this ;
public class GroovyObjectWrapper { /** * / * ( non - Javadoc ) * @ see groovy . lang . GroovyObject # invokeMethod ( java . lang . String , java . lang . Object ) */ public Object invokeMethod ( final String name , final Object args ) { } }
return this . wrapped . invokeMethod ( name , args ) ;
public class LocalDate { /** * Returns a copy of this { @ code LocalDate } with the specified number of months subtracted . * This method subtracts the specified amount from the months field in three steps : * < ol > * < li > Subtract the input months from the month - of - year field < / li > * < li > Check if ...
return ( monthsToSubtract == Long . MIN_VALUE ? plusMonths ( Long . MAX_VALUE ) . plusMonths ( 1 ) : plusMonths ( - monthsToSubtract ) ) ;
public class AVDefaultConnectionListener { /** * 处理 v2 版本中 message 的 rcp 消息 * @ param msgId * @ param conversationId * @ param timestamp */ private void processMessageReceipt ( String msgId , String conversationId , int convType , long timestamp ) { } }
Object messageCache = MessageReceiptCache . get ( session . getSelfPeerId ( ) , msgId ) ; if ( messageCache == null ) { return ; } Message m = ( Message ) messageCache ; AVIMMessage msg = new AVIMMessage ( conversationId , session . getSelfPeerId ( ) , m . timestamp , timestamp ) ; msg . setMessageId ( m . id ) ; msg ....
public class ReceiveListenerDispatcher { /** * Queues any type of invocation entry into an appropriate queue . The queue is selected first * by determining if a requests associated conversation is already associated with a queue . If * it is not then a list of empty queues is consulted before finally reverting to u...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "queueInvocationCommon" , new Object [ ] { invocation , conversation } ) ; if ( dispatcherEnabled ) { // Start F201521 try // D202636 { // D202636 // First job is to ask the ConversationReceiveListener for the object ...
public class CmsSitemapController { /** * Helper method for looking up a value in a map which may be null . < p > * @ param < A > the key type * @ param < B > the value type * @ param map the map ( which may be null ) * @ param key the map key * @ return the value of the map at the given key , or null if the ...
if ( map == null ) { return null ; } return map . get ( key ) ;
public class NodeListener { /** * Inform listeners that node is being created . * @ param node A node being created . */ public static void fireOnCreated ( @ Nonnull Node node ) { } }
for ( NodeListener nl : all ( ) ) { try { nl . onCreated ( node ) ; } catch ( Throwable ex ) { LOGGER . log ( Level . WARNING , "Listener invocation failed" , ex ) ; } }
public class TagTypeImpl { /** * Returns all < code > variable < / code > elements * @ return list of < code > variable < / code > */ public List < VariableType < TagType < T > > > getAllVariable ( ) { } }
List < VariableType < TagType < T > > > list = new ArrayList < VariableType < TagType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "variable" ) ; for ( Node node : nodeList ) { VariableType < TagType < T > > type = new VariableTypeImpl < TagType < T > > ( this , "variable" , childNode , node ) ; list . ad...
public class ParosDatabase { /** * / * ( non - Javadoc ) * @ see org . parosproxy . paros . db . DatabaseIF # deleteSession ( java . lang . String ) */ @ Override public void deleteSession ( String sessionName ) { } }
logger . debug ( "deleteSession " + sessionName ) ; if ( databaseServer == null ) { return ; } try { databaseServer . shutdown ( false ) ; } catch ( SQLException e ) { logger . error ( e . getMessage ( ) , e ) ; } deleteDbFile ( new File ( sessionName ) ) ; deleteDbFile ( new File ( sessionName + ".data" ) ) ; deleteDb...
public class AbstractLazyLoadRunMap { /** * Finds the build # M where M is nearby the given ' n ' . * @ param n * the index to start the search from * @ param d * defines what we mean by " nearby " above . * If EXACT , find # N or return null . * If ASC , finds the closest # M that satisfies M ≥ N . * If ...
switch ( d ) { case EXACT : return getByNumber ( n ) ; case ASC : for ( int m : numberOnDisk ) { if ( m < n ) { // TODO could be made more efficient with numberOnDisk . find continue ; } R r = getByNumber ( m ) ; if ( r != null ) { return r ; } } return null ; case DESC : // TODO again could be made more efficient List...
public class EndpointsResponse { /** * The list of endpoints . * @ param item * The list of endpoints . */ public void setItem ( java . util . Collection < EndpointResponse > item ) { } }
if ( item == null ) { this . item = null ; return ; } this . item = new java . util . ArrayList < EndpointResponse > ( item ) ;
public class Launcher { /** * Expands the list of environment variables by inheriting current env variables . */ private static EnvVars inherit ( @ CheckForNull String [ ] env ) { } }
// convert String [ ] to Map first EnvVars m = new EnvVars ( ) ; if ( env != null ) { for ( String e : env ) { int index = e . indexOf ( '=' ) ; m . put ( e . substring ( 0 , index ) , e . substring ( index + 1 ) ) ; } } // then do the inheritance return inherit ( m ) ;
public class Ssh2DsaPublicKey { /** * Encode the public key into a blob of binary data , the encoded result will * be passed into init to recreate the key . * @ return an encoded byte array * @ throws SshException * @ todo Implement this com . sshtools . ssh . SshPublicKey method */ public byte [ ] getEncoded (...
ByteArrayWriter baw = new ByteArrayWriter ( ) ; try { baw . writeString ( getAlgorithm ( ) ) ; baw . writeBigInteger ( pubkey . getParams ( ) . getP ( ) ) ; baw . writeBigInteger ( pubkey . getParams ( ) . getQ ( ) ) ; baw . writeBigInteger ( pubkey . getParams ( ) . getG ( ) ) ; baw . writeBigInteger ( pubkey . getY (...
public class TreeBuilder { /** * Listen to events on all paths of the tree * @ param listener listener * @ return builder */ public TreeBuilder < T > listen ( Listener < T > listener ) { } }
return listen ( listener , PathUtil . allpathSelector ( ) ) ;
public class DataSetUtil { /** * Extract out the specified column , and merge the specified label and label mask arrays * ( i . e . , concatenate the examples ) * @ param labelsToMerge Features to merge . Will use featuresToMerge [ all ] [ inOutIdx ] * @ param labelMasksToMerge Mask arrays to merge . May be null ...
Pair < INDArray [ ] , INDArray [ ] > p = selectColumnFromMDSData ( labelsToMerge , labelMasksToMerge , inOutIdx ) ; return mergeLabels ( p . getFirst ( ) , p . getSecond ( ) ) ;
public class Utils4J { /** * Create an instance with Class . forName ( . . ) and wrap all exceptions into RuntimeExceptions . * @ param className * Full qualified class name - Cannot be < code > null < / code > . * @ param classLoader * Dedicated class loader to use - Cannot be < code > NULL < / code > . * @ ...
checkNotNull ( "className" , className ) ; checkNotNull ( "classLoader" , classLoader ) ; try { final Class < ? > clasz = Class . forName ( className , true , classLoader ) ; return clasz . newInstance ( ) ; } catch ( final ClassNotFoundException e ) { throw new RuntimeException ( "Unknown class!" , e ) ; } catch ( fin...
public class VisWindow { /** * Adds close button to window , next to window title . After pressing that button , { @ link # close ( ) } is called . If nothing * else was added to title table , and current title alignment is center then the title will be automatically centered . */ public void addCloseButton ( ) { } }
Label titleLabel = getTitleLabel ( ) ; Table titleTable = getTitleTable ( ) ; VisImageButton closeButton = new VisImageButton ( "close-window" ) ; titleTable . add ( closeButton ) . padRight ( - getPadRight ( ) + 0.7f ) ; closeButton . addListener ( new ChangeListener ( ) { @ Override public void changed ( ChangeEvent ...
public class JsDocInfoParser { /** * Extracts the text found on the current line and all subsequent until either an annotation , end * of comment or end of file is reached . Note that if this method detects an end of line as the * first token , it will quit immediately ( indicating that there is no text where it wa...
if ( token == JsDocToken . EOC || token == JsDocToken . EOL || token == JsDocToken . EOF ) { return new ExtractionInfo ( "" , token ) ; } return extractMultilineComment ( token , option , true , includeAnnotations ) ;
public class CassandraDataHandlerBase { /** * Scroll over super column . * @ param m * the m * @ param relationNames * the relation names * @ param isWrapReq * the is wrap req * @ param relations * the relations * @ param entityType * the entity type * @ param superColumn * the super column * ...
for ( Column column : superColumn . getColumns ( ) ) { embeddedObject = onColumn ( column , m , embeddedObject , entityType , relationNames , isWrapReq , relations , isCql3Enabled ) ; }
public class GeoShapeMapperBuilder { /** * Returns the { @ link GeoShapeMapper } represented by this { @ link MapperBuilder } . * @ param field the name of the field to be built * @ return the { @ link GeoShapeMapper } represented by this */ @ Override public GeoShapeMapper build ( String field ) { } }
try { return new GeoShapeMapper ( field , column , validated , maxLevels , transformations ) ; } catch ( NoClassDefFoundError e ) { throw new JTSNotFoundException ( ) ; }
public class CommerceTaxFixedRateAddressRelLocalServiceBaseImpl { /** * 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 commerceTaxFixedRateAddressRelPersistence . findWithDynamicQuery ( dynamicQuery ) ;
public class VpnTunnelClient { /** * Retrieves an aggregated list of VPN tunnels . * < p > Sample code : * < pre > < code > * try ( VpnTunnelClient vpnTunnelClient = VpnTunnelClient . create ( ) ) { * ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ; * for ( VpnTunnelsScopedList element : vpnTunnel...
AggregatedListVpnTunnelsHttpRequest request = AggregatedListVpnTunnelsHttpRequest . newBuilder ( ) . setProject ( project ) . build ( ) ; return aggregatedListVpnTunnels ( request ) ;
public class FnObject { /** * Creates a list of the specified type with only the target object in it . * @ param < T > the type of the list elements * @ param type the type of the list * @ return the resulting list . */ public static final < T > Function < T , List < T > > intoSingletonListOf ( final Type < T > t...
return new IntoSingletonList < T > ( ) ;
public class ImgUtil { /** * 给图片添加文字水印 < br > * 此方法并不关闭流 * @ param srcImage 源图像 * @ param to 目标流 * @ param pressText 水印文字 * @ param color 水印的字体颜色 * @ param font { @ link Font } 字体相关信息 , 如果默认则为 { @ code null } * @ param x 修正值 。 默认在中间 , 偏移量相对于中间偏移 * @ param y 修正值 。 默认在中间 , 偏移量相对于中间偏移 * @ param alpha 透明度...
pressText ( srcImage , getImageOutputStream ( to ) , pressText , color , font , x , y , alpha ) ;
public class Sort { /** * Check if the float array is reverse sorted . It loops through the entire float * array once , checking that the elements are reverse sorted . * < br > * < br > * < i > Runtime : < / i > O ( n ) * @ param floatArray the float array to check * @ return < i > true < / i > if the float...
for ( int i = 0 ; i < floatArray . length - 1 ; i ++ ) { if ( floatArray [ i ] < floatArray [ i + 1 ] ) { return false ; } } return true ;
public class MultiColumnRelation { /** * Creates a multi - column IN relation with a list of IN values or markers . * For example : " SELECT . . . WHERE ( a , b ) IN ( ( 0 , 1 ) , ( 2 , 3 ) ) " * @ param entities the columns on the LHS of the relation * @ param inValues a list of Tuples . Literal instances or a T...
return new MultiColumnRelation ( entities , Operator . IN , null , inValues , null ) ;
public class Pool { /** * Add new connection if needed . Only one thread create new connection , so new connection request * will wait to newly created connection or for a released connection . */ private void addConnectionRequest ( ) { } }
if ( totalConnection . get ( ) < options . maxPoolSize && poolState . get ( ) == POOL_STATE_OK ) { // ensure to have one worker if was timeout connectionAppender . prestartCoreThread ( ) ; connectionAppenderQueue . offer ( ( ) -> { if ( ( totalConnection . get ( ) < options . minPoolSize || pendingRequestNumber . get (...