signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JmsJcaActivationSpecImpl { /** * Set the AutoStopSequentialMessageFailure property * @ param autoStopSequentialMessageFailure The maximum number of failed messages before stopping the MDB */ @ Override public void setAutoStopSequentialMessageFailure ( final String autoStopSequentialMessageFailure ) { } }
_autoStopSequentialMessageFailure = ( autoStopSequentialMessageFailure == null ? null : Integer . valueOf ( autoStopSequentialMessageFailure ) ) ;
public class PropertiesManagers { /** * Create a new , default executor for use in a new { @ link PropertiesManager } * . This executor uses cached , daemon threads so it will expand as * necessary , but it will not block JVM shutdown . The executor will be * automatically shutdown on JVM exit . * @ return the ...
ExecutorService executor = Executors . newCachedThreadPool ( new DaemonThreadFactory ( ) ) ; AUTO_GENERATED_EXECUTORS . add ( executor ) ; return executor ;
public class IoUtils { /** * Copies all data from an InputStream to an OutputStream . * @ return the number of bytes copied * @ throws IOException if an I / O error occurs */ public static long copy ( InputStream input , OutputStream output ) throws IOException { } }
byte [ ] buffer = new byte [ 2 * 1024 ] ; long total = 0 ; int count ; while ( ( count = input . read ( buffer ) ) != - 1 ) { output . write ( buffer , 0 , count ) ; total += count ; } return total ;
public class ParallelOracleBuilders { /** * Convenience method for { @ link # newStaticParallelOracle ( Collection ) } . * @ param firstOracle * the first ( mandatory ) oracle * @ param otherOracles * further ( optional ) oracles to be used by other threads * @ param < I > * input symbol type * @ param < ...
return newStaticParallelOracle ( Lists . asList ( firstOracle , otherOracles ) ) ;
public class DListImpl { /** * Inserts the specified element at the specified position in this list * ( optional operation ) . Shifts the element currently at that position * ( if any ) and any subsequent elements to the right ( adds one to their * indices ) . * @ param index index at which the specified elemen...
DListEntry entry = prepareEntry ( element ) ; elements . add ( index , entry ) ; // if we are in a transaction : acquire locks ! TransactionImpl tx = getTransaction ( ) ; if ( checkForOpenTransaction ( tx ) ) { RuntimeObject rt = new RuntimeObject ( this , tx ) ; List regList = tx . getRegistrationList ( ) ; tx . lockA...
public class ApiOvhHorizonView { /** * Add a domain user to add your desktop in your Active Directory * REST : POST / horizonView / { serviceName } / domainTrust / { domainTrustId } / addDomainUserOnComposer * @ param password [ required ] Password of the user * @ param domain [ required ] Name of your Domain ( e...
String qPath = "/horizonView/{serviceName}/domainTrust/{domainTrustId}/addDomainUserOnComposer" ; StringBuilder sb = path ( qPath , serviceName , domainTrustId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "domain" , domain ) ; addBody ( o , "password" , password ) ; addBody ( ...
public class XDBHandler { /** * Receive notification of character data inside an element . */ @ Override public void characters ( char ch [ ] , int start , int len ) { } }
while ( len > 0 && Character . isWhitespace ( ch [ start ] ) ) { ++ start ; -- len ; } while ( len > 0 && Character . isWhitespace ( ch [ start + len - 1 ] ) ) { -- len ; } if ( _text . length ( ) > 0 ) { _text . append ( ' ' ) ; } _text . append ( ch , start , len ) ;
public class MjdbcPoolBinder { /** * Returns new Pooled { @ link DataSource } implementation * In case this function won ' t work - use { @ link # createDataSource ( java . util . Properties ) } * @ param url Database connection url * @ param userName Database user name * @ param password Database user password...
assertNotNull ( url ) ; assertNotNull ( userName ) ; assertNotNull ( password ) ; BasicDataSource ds = new BasicDataSource ( ) ; ds . setUrl ( url ) ; ds . setUsername ( userName ) ; ds . setPassword ( password ) ; return ds ;
public class MyZipUtils { /** * Compress a directory into a zip file * @ param dir Directory * @ param zipFile ZIP file to create * @ throws IOException I / O Error */ public static void compress ( File dir , File zipFile ) throws IOException { } }
FileOutputStream fos = new FileOutputStream ( zipFile ) ; ZipOutputStream zos = new ZipOutputStream ( fos ) ; recursiveAddZip ( dir , zos , dir ) ; zos . finish ( ) ; zos . close ( ) ;
public class Instrumented { /** * Get a { @ link org . apache . gobblin . metrics . MetricContext } to be used by an object needing instrumentation . * This method will read the property " metrics . context . name " from the input State , and will attempt * to find a MetricContext with that name in the global insta...
int randomId = RAND . nextInt ( Integer . MAX_VALUE ) ; List < Tag < ? > > generatedTags = Lists . newArrayList ( ) ; Constructs construct = null ; if ( Converter . class . isAssignableFrom ( klazz ) ) { construct = Constructs . CONVERTER ; } else if ( ForkOperator . class . isAssignableFrom ( klazz ) ) { construct = C...
public class appfwfieldtype { /** * Use this API to add appfwfieldtype resources . */ public static base_responses add ( nitro_service client , appfwfieldtype resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { appfwfieldtype addresources [ ] = new appfwfieldtype [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new appfwfieldtype ( ) ; addresources [ i ] . name = resources [ i ] . name ; addreso...
public class RandomFloat { /** * Updates ( drifts ) a float value within specified range defined * @ param value a float value to drift . * @ param range ( optional ) a range . Default : 10 % of the value * @ return updated random float value . */ public static float updateFloat ( float value , float range ) { } ...
range = range == 0 ? ( float ) ( 0.1 * value ) : range ; float min = value - range ; float max = value + range ; return nextFloat ( min , max ) ;
public class Option { /** * Set the specified sub - text to the option . * @ param subtext */ public void setSubtext ( final String subtext ) { } }
if ( subtext != null ) attrMixin . setAttribute ( SUBTEXT , subtext ) ; else attrMixin . removeAttribute ( SUBTEXT ) ;
public class ListOTAUpdatesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListOTAUpdatesRequest listOTAUpdatesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listOTAUpdatesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listOTAUpdatesRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( listOTAUpdatesRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ;...
public class GroupServiceClient { /** * Creates a new group . * < p > Sample code : * < pre > < code > * try ( GroupServiceClient groupServiceClient = GroupServiceClient . create ( ) ) { * ProjectName name = ProjectName . of ( " [ PROJECT ] " ) ; * Group group = Group . newBuilder ( ) . build ( ) ; * Group ...
CreateGroupRequest request = CreateGroupRequest . newBuilder ( ) . setName ( name ) . setGroup ( group ) . build ( ) ; return createGroup ( request ) ;
public class AnnotationVisitor { /** * Visit annotation on a class , field or method * @ param annotationClass * class of annotation * @ param map * map from names to values * @ param runtimeVisible * true if annotation is runtime visible */ public void visitAnnotation ( @ DottedClassName String annotationC...
if ( DEBUG ) { System . out . println ( "Annotation: " + annotationClass ) ; for ( Map . Entry < String , ElementValue > e : map . entrySet ( ) ) { System . out . println ( " " + e . getKey ( ) ) ; System . out . println ( " -> " + e . getValue ( ) ) ; } }
public class AlertPanel { /** * This method initializes treeAlert * @ return javax . swing . JTree */ JTree getTreeAlert ( ) { } }
if ( treeAlert == null ) { treeAlert = new JTree ( ) { private static final long serialVersionUID = 1L ; @ Override public Point getPopupLocation ( final MouseEvent event ) { if ( event != null ) { // Select item on right click TreePath tp = treeAlert . getPathForLocation ( event . getX ( ) , event . getY ( ) ) ; if ( ...
public class KeyManagementServiceClient { /** * Returns metadata for a given [ KeyRing ] [ google . cloud . kms . v1 . KeyRing ] . * < p > Sample code : * < pre > < code > * try ( KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient . create ( ) ) { * KeyRingName name = KeyRingName...
GetKeyRingRequest request = GetKeyRingRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return getKeyRing ( request ) ;
public class WordNet { /** * 清理from属性 */ public void clean ( ) { } }
for ( List < Vertex > vertexList : vertexes ) { for ( Vertex vertex : vertexList ) { vertex . from = null ; } }
public class InternalSARLParser { /** * $ ANTLR start synpred53 _ InternalSARL */ public final void synpred53_InternalSARL_fragment ( ) throws RecognitionException { } }
// InternalSARL . g : 15000:6 : ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) // InternalSARL . g : 15000:7 : ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) { // InternalSARL . g : 15000:7 : ( ( ) ( ( ( ru...
public class BaseTemplate { /** * This is the main method responsible for writing a tag and its attributes . * The arguments may be : * < ul > * < li > a closure < / li > in which case the closure is rendered inside the tag body * < li > a string < / li > , in which case the string is rendered as the tag body ...
Object o = model . get ( tagName ) ; if ( o instanceof Closure ) { if ( args instanceof Object [ ] ) { yieldUnescaped ( ( ( Closure ) o ) . call ( ( Object [ ] ) args ) ) ; return this ; } yieldUnescaped ( ( ( Closure ) o ) . call ( args ) ) ; return this ; } else if ( args instanceof Object [ ] ) { final Writer wrt = ...
public class HttpFields { /** * Destroy the header . * Help the garbage collector by null everything that we can . */ public void destroy ( ) { } }
for ( int i = _fields . size ( ) ; i -- > 0 ; ) { Field field = ( Field ) _fields . get ( i ) ; if ( field != null ) field . destroy ( ) ; } _fields = null ; _index = null ; _dateBuffer = null ; _calendar = null ; _dateReceive = null ;
public class FieldAccessor { /** * Determines whether the field can be modified using reflection . * @ return Whether or not the field can be modified reflectively . */ public boolean canBeModifiedReflectively ( ) { } }
if ( field . isSynthetic ( ) ) { return false ; } int modifiers = field . getModifiers ( ) ; if ( Modifier . isFinal ( modifiers ) && Modifier . isStatic ( modifiers ) ) { return false ; } return true ;
public class DServer { public void add_obj_polling ( final DevVarLongStringArray argin , final boolean with_db_upd ) throws DevFailed { } }
Util . out4 . println ( "In add_obj_polling command" ) ; for ( final String value : argin . svalue ) { Util . out4 . println ( "Input string = " + value ) ; } for ( final int value : argin . lvalue ) { Util . out4 . println ( "Input long = " + value ) ; } // Check that parameters number is correct if ( argin . svalue ....
public class MessageProcessor { /** * Set up a connection to the message processor for any internal components * that require the creation of producers / consumer . */ private void createSystemConnection ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createSystemConnection" ) ; Subject subject = _authorisationUtils . getSIBServerSubject ( ) ; try { _connectionToMP = ( MPCoreConnection ) createConnection ( subject , true , null ) ; } catch ( SIResourceException e ) { // ...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getCPI ( ) { } }
if ( cpiEClass == null ) { cpiEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 230 ) ; } return cpiEClass ;
public class AbstractRule { /** * @ see java . lang . Comparable # compareTo ( Object ) * We need this because we sort by the number of conditions on the rule * The comparison is done in reverse because we want the high conditions at the top */ public final int compareTo ( AbstractRule o ) { } }
Integer us = new Integer ( this . getSpecificity ( ) ) ; Integer them = new Integer ( o . getSpecificity ( ) ) ; return them . compareTo ( us ) ;
public class TableFactorBuilder { /** * Increments the weight of each assignment in { @ code this } by its weight in * { @ code factor } . * @ param factor */ public void incrementWeight ( DiscreteFactor factor ) { } }
Preconditions . checkArgument ( factor . getVars ( ) . equals ( getVars ( ) ) ) ; weightBuilder . increment ( factor . getWeights ( ) ) ;
public class RootConsole { /** * Starts monitoring the input file . */ public void start ( ) { } }
System . out . println ( new LogEntry ( "starting root console" ) ) ; try { openFileReader ( ) ; } catch ( IOException ioe ) { throw new ResourceException ( "can not open file reader" , ioe ) ; } thread = new Thread ( this ) ; isRunning = true ; thread . start ( ) ;
public class JsonMappingDataDictionary { /** * Walks through the Json object structure and translates values based on element path if necessary . * @ param jsonData * @ param jsonPath * @ param context */ private void traverseJsonData ( JSONObject jsonData , String jsonPath , TestContext context ) { } }
for ( Iterator it = jsonData . entrySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { Map . Entry jsonEntry = ( Map . Entry ) it . next ( ) ; if ( jsonEntry . getValue ( ) instanceof JSONObject ) { traverseJsonData ( ( JSONObject ) jsonEntry . getValue ( ) , ( StringUtils . hasText ( jsonPath ) ? jsonPath + "." + jsonEnt...
public class OpenCensusSleuthSpan { /** * TODO : upgrade to new SpanContext . create ( ) once it has been released . */ @ SuppressWarnings ( "deprecation" ) private static SpanContext fromSleuthSpan ( org . springframework . cloud . sleuth . Span span ) { } }
return SpanContext . create ( TraceId . fromBytes ( ByteBuffer . allocate ( TraceId . SIZE ) . putLong ( span . getTraceIdHigh ( ) ) . putLong ( span . getTraceId ( ) ) . array ( ) ) , SpanId . fromBytes ( ByteBuffer . allocate ( SpanId . SIZE ) . putLong ( span . getSpanId ( ) ) . array ( ) ) , Boolean . TRUE . equals...
public class InstrumentedInvokerFactory { /** * Factory method for TimedInvoker . */ private Invoker timed ( Invoker invoker , List < Method > timedMethods ) { } }
ImmutableMap . Builder < String , Timer > timers = new ImmutableMap . Builder < > ( ) ; for ( Method m : timedMethods ) { Timed annotation = m . getAnnotation ( Timed . class ) ; final String name = chooseName ( annotation . name ( ) , annotation . absolute ( ) , m ) ; Timer timer = metricRegistry . timer ( name ) ; ti...
public class HadoopFileReader { /** * Loads template as InputStreams * @ param fileName filename of template ( full URI / path ) to load * @ return InputStream of the template * @ throws java . io . IOException in case of issues loading a file */ public InputStream loadTemplate ( String fileName ) throws IOExcept...
Path currentPath = new Path ( fileName ) ; return openFile ( currentPath ) ;
public class ParsedValue { /** * called by format processors */ void put ( ChronoElement < ? > element , Object v ) { } }
if ( element == null ) { throw new NullPointerException ( ) ; } if ( v == null ) { // removal if ( this . map != null ) { this . map . remove ( element ) ; if ( this . map . isEmpty ( ) ) { this . map = null ; } } } else { Map < ChronoElement < ? > , Object > m = this . map ; if ( m == null ) { m = new HashMap < > ( ) ...
public class JarURLConnection { /** * get the specs for a given url out of the cache , and compute and cache them if they ' re not there . */ private void parseSpecs ( URL url ) throws MalformedURLException { } }
String spec = url . getFile ( ) ; int separator = spec . indexOf ( '!' ) ; /* * REMIND : we don ' t handle nested JAR URLs */ if ( separator == - 1 ) { throw new MalformedURLException ( "no ! found in url spec:" + spec ) ; } // Get the protocol String protocol = spec . substring ( 0 , spec . indexOf ( ":" ) ) ; // This...
public class DownloadRunner { /** * Print usage options */ private static void usage ( Options options ) { } }
HelpFormatter formatter = new HelpFormatter ( ) ; formatter . printHelp ( DownloadRunner . class . getSimpleName ( ) , options ) ;
public class OpenWatcomCompiler { /** * Get undefine switch . * @ param buffer * StringBuffer argument destination * @ param define * String preprocessor macro */ @ Override protected final void getUndefineSwitch ( final StringBuffer buffer , final String define ) { } }
OpenWatcomProcessor . getUndefineSwitch ( buffer , define ) ;
public class RejoinTaskBuffer { /** * Generate the byte array in preparation of moving over a message bus . * Idempotent , but not thread - safe . Also changes state to immutable . */ public void compile ( ) { } }
if ( compiledSize == 0 ) { ByteBuffer bb = m_container . b ( ) ; compiledSize = bb . position ( ) ; bb . flip ( ) ; m_allocator . track ( compiledSize ) ; } if ( log . isTraceEnabled ( ) ) { StringBuilder sb = new StringBuilder ( "Compiling buffer: " ) ; ByteBuffer dup = m_container . bDR ( ) ; while ( dup . hasRemai...
public class BasicEvaluationCtx { /** * Returns attribute value ( s ) from the subject section of the request * that have no issuer . * @ param type the type of the attribute value ( s ) to find * @ param id the id of the attribute value ( s ) to find * @ param category the category the attribute value ( s ) mu...
return getSubjectAttribute ( type , id , null , category ) ;
public class FreeMarkerTag { /** * Returns a map of all variables in scope . * @ return map of all variables in scope . */ protected Map getAllVariables ( ) { } }
try { Iterator names = FreeMarkerTL . getEnvironment ( ) . getKnownVariableNames ( ) . iterator ( ) ; Map vars = new HashMap ( ) ; while ( names . hasNext ( ) ) { Object name = names . next ( ) ; vars . put ( name , get ( name . toString ( ) ) ) ; } return vars ; } catch ( Exception e ) { throw new ViewException ( e ) ...
public class LogLevelMapping { /** * Normalizes the given level to one of those supported by Selenium . * @ param level log level to normalize * @ return the selenium supported corresponding log level */ public static Level normalize ( Level level ) { } }
if ( levelMap . containsKey ( level . intValue ( ) ) ) { return levelMap . get ( level . intValue ( ) ) ; } else if ( level . intValue ( ) >= Level . SEVERE . intValue ( ) ) { return Level . SEVERE ; } else if ( level . intValue ( ) >= Level . WARNING . intValue ( ) ) { return Level . WARNING ; } else if ( level . intV...
public class SortedCursor { /** * Convenience method to create a comparator which orders storables by the * given order - by properties . The property names may be prefixed with ' + ' * or ' - ' to indicate ascending or descending order . If the prefix is * omitted , ascending order is assumed . * @ param type ...
BeanComparator bc = BeanComparator . forClass ( type ) ; if ( Storable . class . isAssignableFrom ( type ) ) { StorableInfo info = StorableIntrospector . examine ( ( Class ) type ) ; for ( String property : orderProperties ) { bc = orderBy ( bc , OrderedProperty . parse ( info , property ) ) ; } } else { for ( String p...
public class Selectable { /** * Selector that matches any descendant element that satisfies the specified constraints . If no * constraints are provided , accepts all descendant elements . * @ param constraints element constraints * @ return element selector */ public final ElementSelector < T > descendant ( Elem...
return new DescendantSelector < T > ( getContext ( ) , getCurrentSelector ( ) , Arrays . asList ( constraints ) ) ;
public class CouchURIHelper { /** * Returns URI for { @ code documentId } with { @ code query } . */ public URI documentUri ( String documentId , Map < String , Object > query ) { } }
String base_uri = String . format ( "%s/%s" , this . rootUriString , this . encodeId ( documentId ) ) ; String uri = appendQueryString ( base_uri , query ) ; return uriFor ( uri ) ;
public class Math { /** * Standardizes each column of a matrix to 0 mean and unit variance . */ public static void standardize ( double [ ] [ ] x ) { } }
int n = x . length ; int p = x [ 0 ] . length ; double [ ] center = colMeans ( x ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < p ; j ++ ) { x [ i ] [ j ] = x [ i ] [ j ] - center [ j ] ; } } double [ ] scale = new double [ p ] ; for ( int j = 0 ; j < p ; j ++ ) { for ( int i = 0 ; i < n ; i ++ ) { scale ...
public class IOCAFunctionSetIdentificationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setCATEGORY ( Integer newCATEGORY ) { } }
Integer oldCATEGORY = category ; category = newCATEGORY ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . IOCA_FUNCTION_SET_IDENTIFICATION__CATEGORY , oldCATEGORY , category ) ) ;
public class DeprecatedTypesafeEnumPattern { /** * implements the visitor to look for classes compiled with 1.5 or better that have all constructors that are private * @ param context * the currently parsed class context object */ @ Override public void visitClassContext ( ClassContext context ) { } }
try { JavaClass cls = context . getJavaClass ( ) ; if ( ! cls . isEnum ( ) && ( cls . getMajor ( ) >= Const . MAJOR_1_5 ) ) { Method [ ] methods = cls . getMethods ( ) ; for ( Method m : methods ) { if ( Values . CONSTRUCTOR . equals ( m . getName ( ) ) && ! m . isPrivate ( ) ) { return ; } } firstEnumPC = 0 ; enumCoun...
public class AbstractServerPredicate { /** * Referenced from RoundRobinRule * Inspired by the implementation of { @ link AtomicInteger # incrementAndGet ( ) } . * @ param modulo The modulo to bound the value of the counter . * @ return The next value . */ private int incrementAndGetModulo ( int modulo ) { } }
for ( ; ; ) { int current = nextIndex . get ( ) ; int next = ( current + 1 ) % modulo ; if ( nextIndex . compareAndSet ( current , next ) && current < modulo ) return current ; }
public class CombineFileInputFormat { /** * Create a new pool and add the filters to it . * A split cannot have files from different pools . */ protected void createPool ( JobConf conf , List < PathFilter > filters ) { } }
pools . add ( new MultiPathFilter ( filters ) ) ;
public class CmsADESessionCache { /** * Adds the formatter id to the recently used list for the given type . < p > * @ param resType the resource type * @ param formatterId the formatter id */ public void addRecentFormatter ( String resType , CmsUUID formatterId ) { } }
List < CmsUUID > formatterIds = m_recentFormatters . get ( resType ) ; if ( formatterIds == null ) { formatterIds = new ArrayList < CmsUUID > ( ) ; m_recentFormatters . put ( resType , formatterIds ) ; } formatterIds . remove ( formatterId ) ; if ( formatterIds . size ( ) >= ( RECENT_FORMATTERS_SIZE ) ) { formatterIds ...
public class BaseUpdateableRegressor { /** * Performs training on an updateable classifier by going over the whole * data set in random order one observation at a time , multiple times . * @ param dataSet the data set to train from * @ param toTrain the classifier to train * @ param epochs the number of passes ...
if ( epochs < 1 ) throw new IllegalArgumentException ( "epochs must be positive" ) ; toTrain . setUp ( dataSet . getCategories ( ) , dataSet . getNumNumericalVars ( ) ) ; IntList randomOrder = new IntList ( dataSet . size ( ) ) ; ListUtils . addRange ( randomOrder , 0 , dataSet . size ( ) , 1 ) ; for ( int epoch = 0 ; ...
public class AgentPoolsInner { /** * Gets the agent pool . * Gets the details of the agent pool by managed cluster and resource group . * @ param resourceGroupName The name of the resource group . * @ param managedClusterName The name of the managed cluster resource . * @ param agentPoolName The name of the age...
return getWithServiceResponseAsync ( resourceGroupName , managedClusterName , agentPoolName ) . map ( new Func1 < ServiceResponse < AgentPoolInner > , AgentPoolInner > ( ) { @ Override public AgentPoolInner call ( ServiceResponse < AgentPoolInner > response ) { return response . body ( ) ; } } ) ;
public class TenantService { /** * Get the { @ link TenantDefinition } of the tenant with the given name . If the given * tenant name is the default tenant , this method calls { @ link # getDefaultTenantDef ( ) } . * Otherwise , the DBService must be initialized and the tenant definition is read * from the databa...
// Allow access to default tenant if DBService is not yet initialized . if ( tenantName . equals ( m_defaultTenantName ) ) { return getDefaultTenantDef ( ) ; } checkServiceState ( ) ; return getTenantDef ( tenantName ) ;
public class JBBPDslBuilder { /** * Add named fixed signed short array which size calculated through expression . * @ param name name of the field , if null then anonymous * @ param sizeExpression expression to be used to calculate size , must not be null * @ return the builder instance , must not be null */ publ...
final Item item = new Item ( BinType . SHORT_ARRAY , name , this . byteOrder ) ; item . sizeExpression = assertExpressionChars ( sizeExpression ) ; this . addItem ( item ) ; return this ;
public class ThrowableNoCauseMatcher { /** * ( non - Javadoc ) * @ see org . hamcrest . Matcher # matches ( java . lang . Object ) */ @ Override public boolean matches ( Object obj ) { } }
if ( ! ( obj instanceof Throwable ) ) return false ; Throwable throwable = ( Throwable ) obj ; return throwable . getCause ( ) == null ;
public class ModifyVpcEndpointConnectionNotificationRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < ModifyVpcEndpointConnectionNotificationRequest > getDryRunRequest ( )...
Request < ModifyVpcEndpointConnectionNotificationRequest > request = new ModifyVpcEndpointConnectionNotificationRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class MenuPanel { /** * Adds an example to the recent subMenu . * @ param text the text to display . * @ param data the example data instance * @ param select should the menuItem be selected */ private void addRecentExample ( final String text , final ExampleData data , final boolean select ) { } }
WMenuItem item = new WMenuItem ( text , new SelectExampleAction ( ) ) ; item . setCancel ( true ) ; menu . add ( item ) ; item . setActionObject ( data ) ; if ( select ) { menu . setSelectedMenuItem ( item ) ; }
public class CommerceNotificationAttachmentUtil { /** * Removes the commerce notification attachment with the primary key from the database . Also notifies the appropriate model listeners . * @ param commerceNotificationAttachmentId the primary key of the commerce notification attachment * @ return the commerce not...
return getPersistence ( ) . remove ( commerceNotificationAttachmentId ) ;
public class BufferUtil { /** * 从字符串创建新Buffer * @ param data 数据 * @ param charset 编码 * @ return { @ link ByteBuffer } * @ since 4.5.0 */ public static ByteBuffer create ( CharSequence data , Charset charset ) { } }
return create ( StrUtil . bytes ( data , charset ) ) ;
public class RtmpClient { /** * Send a remote procedure call . * Note that due to varargs ambiguity , this method will not work if the first argument to the call is a string . * In that case , use the explicit { @ link # sendRpcWithEndpoint ( String , String , String , Object . . . ) } with endpoint * " my - rtmp...
return sendRpc ( "my-rtmps" , service , method , args ) ;
public class ScopeService { /** * Updates a scope . If the scope does not exists , returns an error . * @ param req http request * @ return String message that will be returned in the response */ public String updateScope ( FullHttpRequest req , String scopeName ) throws OAuthException { } }
String contentType = ( req . headers ( ) != null ) ? req . headers ( ) . get ( HttpHeaderNames . CONTENT_TYPE ) : null ; // check Content - Type if ( contentType != null && contentType . contains ( ResponseBuilder . APPLICATION_JSON ) ) { try { Scope scope = InputValidator . validate ( req . content ( ) . toString ( Ch...
public class BoundedLocalCache { /** * Adapts the eviction policy to towards the optimal recency / frequency configuration . */ @ GuardedBy ( "evictionLock" ) void climb ( ) { } }
if ( ! evicts ( ) ) { return ; } determineAdjustment ( ) ; demoteFromMainProtected ( ) ; long amount = adjustment ( ) ; if ( amount == 0 ) { return ; } else if ( amount > 0 ) { increaseWindow ( ) ; } else { decreaseWindow ( ) ; }
public class CmsCategoryService { /** * Adds a resource identified by the given resource name to the given category . < p > * The resource has to be locked . < p > * @ param cms the current cms context * @ param resourceName the site relative path to the resource to add * @ param category the category to add th...
if ( readResourceCategories ( cms , cms . readResource ( resourceName , CmsResourceFilter . IGNORE_EXPIRATION ) ) . contains ( category ) ) { return ; } String sitePath = cms . getRequestContext ( ) . removeSiteRoot ( category . getRootPath ( ) ) ; cms . addRelationToResource ( resourceName , sitePath , CmsRelationType...
public class AbstractAlpineQueryManager { /** * Wrapper around { @ link Query # executeWithMap ( Map ) } that adds transparent support for * pagination and ordering of results via { @ link # decorate ( Query ) } . * @ param query the JDO Query object to execute * @ param parameters the < code > Map < / code > con...
final long count = getCount ( query , parameters ) ; decorate ( query ) ; return new PaginatedResult ( ) . objects ( query . executeWithMap ( parameters ) ) . total ( count ) ;
public class ElementsExceptionsFactory { /** * Constructs and initializes a new { @ link TypeNotFoundException } with the given { @ link Throwable cause } * and { @ link String message } formatted with the given { @ link Object [ ] arguments } . * @ param cause { @ link Throwable } identified as the reason this { @...
return new TypeNotFoundException ( format ( message , args ) , cause ) ;
public class RibbonizerExtension { /** * utilities */ public Consumer < BufferedImage > grayScaleFilter ( ApplicationVariant variant , File iconFile ) { } }
return new GrayScaleBuilder ( ) . apply ( variant , iconFile ) ;
public class ParsingValidator { /** * Validates an instance against the schema using a pre - configured { @ link SAXParserFactory } . * < p > The factory given will be configured to be namespace aware and validating . < / p > * @ param s the instance document * @ param factory the factory to use , must not be nul...
if ( factory == null ) { throw new IllegalArgumentException ( "factory must not be null" ) ; } try { factory . setNamespaceAware ( true ) ; factory . setValidating ( true ) ; SAXParser parser = factory . newSAXParser ( ) ; if ( Languages . W3C_XML_SCHEMA_NS_URI . equals ( language ) ) { parser . setProperty ( Propertie...
public class GetClientCertificateRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetClientCertificateRequest getClientCertificateRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getClientCertificateRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getClientCertificateRequest . getClientCertificateId ( ) , CLIENTCERTIFICATEID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable t...
public class EConv { /** * / * make _ replacement */ public int makeReplacement ( ) { } }
if ( replacementString != null ) return 0 ; byte [ ] insEnc = encodingToInsertOutput ( ) ; final byte [ ] replEnc ; final int len ; final byte [ ] replacement ; if ( insEnc . length != 0 ) { // Transcoding transcoding = lastTranscoding ; // Transcoder transcoder = transcoding . transcoder ; // Encoding enc = EncodingDB...
public class Log { /** * Check that the ranges and sizes add up , otherwise we have lost some data somewhere */ private void validateSegments ( List < LogSegment > segments ) { } }
synchronized ( lock ) { for ( int i = 0 ; i < segments . size ( ) - 1 ; i ++ ) { LogSegment curr = segments . get ( i ) ; LogSegment next = segments . get ( i + 1 ) ; if ( curr . start ( ) + curr . size ( ) != next . start ( ) ) { throw new IllegalStateException ( "The following segments don't validate: " + curr . getF...
public class IfcSystemImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcRelServicesBuildings > getServicesBuildings ( ) { } }
return ( EList < IfcRelServicesBuildings > ) eGet ( Ifc4Package . Literals . IFC_SYSTEM__SERVICES_BUILDINGS , true ) ;
public class MailChimpMethod { /** * Get the MailChimp API method meta - info . * @ throws IllegalArgumentException if neither this class nor any of its superclasses * are annotated with { @ link Method } . */ public final Method getMetaInfo ( ) { } }
for ( Class < ? > c = getClass ( ) ; c != null ; c = c . getSuperclass ( ) ) { Method a = c . getAnnotation ( Method . class ) ; if ( a != null ) { return a ; } } throw new IllegalArgumentException ( "Neither " + getClass ( ) + " nor its superclasses are annotated with " + Method . class ) ;
public class DeletionInfo { /** * Purge every tombstones that are older than { @ code gcbefore } . * @ param gcBefore timestamp ( in seconds ) before which tombstones should be purged */ public void purge ( int gcBefore ) { } }
topLevel = topLevel . localDeletionTime < gcBefore ? DeletionTime . LIVE : topLevel ; if ( ranges != null ) { ranges . purge ( gcBefore ) ; if ( ranges . isEmpty ( ) ) ranges = null ; }
public class MsBuildParser { /** * Determines the name of the file that is cause of the warning . * @ param matcher * the matcher to get the matches from * @ return the name of the file with a warning */ private String determineFileName ( final Matcher matcher ) { } }
String fileName ; if ( StringUtils . isNotBlank ( matcher . group ( 3 ) ) ) { fileName = matcher . group ( 3 ) ; } else if ( StringUtils . isNotBlank ( matcher . group ( 7 ) ) ) { fileName = matcher . group ( 7 ) ; } else { fileName = matcher . group ( 1 ) ; } if ( StringUtils . isBlank ( fileName ) ) { fileName = Stri...
public class AbstractPlanNode { /** * Does the ( sub ) plan guarantee an identical result / effect when " replayed " * against the same database state , such as during replication or CL recovery . * @ return */ public boolean isOrderDeterministic ( ) { } }
// Leaf nodes need to re - implement this test . assert ( m_children != null ) ; for ( AbstractPlanNode child : m_children ) { if ( ! child . isOrderDeterministic ( ) ) { m_nondeterminismDetail = child . m_nondeterminismDetail ; return false ; } } return true ;
public class Generators { /** * constructs a generator that yields the specified seconds in increasing * order for each minute . * @ param seconds values in [ 0-59] * @ param dtStart non null */ static Generator bySecondGenerator ( int [ ] seconds , final DateValue dtStart ) { } }
seconds = Util . uniquify ( seconds ) ; if ( seconds . length == 0 ) { seconds = new int [ ] { dtStart instanceof TimeValue ? ( ( TimeValue ) dtStart ) . second ( ) : 0 } ; } final int [ ] useconds = seconds ; if ( useconds . length == 1 ) { final int second = useconds [ 0 ] ; return new SingleValueGenerator ( ) { int ...
public class ClientFactory { /** * Configure a linked data client suitable for use with a Fedora Repository . * @ param endpoints additional endpoints to enable on the client * @ param providers additional providers to enable on the client * @ return a configuration for use with an LDClient */ public static Clien...
return createClient ( null , null , endpoints , providers ) ;
public class AbstractTermExtractor { /** * Executes the TermSpec returning a list of stringified terms . This method does not use the TermSpec ' s { @ link * com . davidbracewell . hermes . ml . feature . ValueCalculator } * @ param hString the HString to process * @ return a list of term counts */ public List < ...
return stream ( hString ) . collect ( Collectors . toList ( ) ) ;
public class AmazonCloudFrontClient { /** * List all field - level encryption configurations that have been created in CloudFront for this account . * @ param listFieldLevelEncryptionConfigsRequest * @ return Result of the ListFieldLevelEncryptionConfigs operation returned by the service . * @ throws InvalidArgum...
request = beforeClientExecution ( request ) ; return executeListFieldLevelEncryptionConfigs ( request ) ;
public class SortableArrayList { /** * Inserts the specified item into the list into a position that * preserves the sorting of the list according to the supplied { @ link * Comparator } . The list must be sorted ( via the supplied comparator ) * prior to the call to this method ( an empty list built up entirely ...
int ipos = binarySearch ( value , comp ) ; if ( ipos < 0 ) { ipos = - ( ipos + 1 ) ; } _elements = ( T [ ] ) ListUtil . insert ( _elements , ipos , value ) ; _size ++ ; return ipos ;
public class DBWrapperFactory { /** * Create a wrapper around a collection of entities . * @ param collection The collection to be wrapped . * @ param entityClass The class of the entity that the collection contains . * @ param isRevisionCollection Whether or not the collection is a collection of revision entitie...
"unchecked" , "rawtypes" } ) public < T extends BaseWrapper < T > , U > CollectionWrapper < T > createCollection ( final Collection < U > collection , final Class < U > entityClass , boolean isRevisionCollection ) { if ( collection == null ) { return null ; } // Create the key final DBWrapperKey key = new DBWrapperKey ...
public class DateTimeParserBucket { /** * Sorts elements [ 0 , high ) . Calling java . util . Arrays isn ' t always the right * choice since it always creates an internal copy of the array , even if it * doesn ' t need to . If the array slice is small enough , an insertion sort * is chosen instead , but it doesn ...
if ( high > 10 ) { Arrays . sort ( array , 0 , high ) ; } else { for ( int i = 0 ; i < high ; i ++ ) { for ( int j = i ; j > 0 && ( array [ j - 1 ] ) . compareTo ( array [ j ] ) > 0 ; j -- ) { SavedField t = array [ j ] ; array [ j ] = array [ j - 1 ] ; array [ j - 1 ] = t ; } } }
public class DefaultSentryClientFactory { /** * Whether or not buffering is enabled . * @ param dsn Sentry server DSN which may contain options . * @ return Whether or not buffering is enabled . */ protected boolean getBufferEnabled ( Dsn dsn ) { } }
String bufferEnabled = Lookup . lookup ( BUFFER_ENABLED_OPTION , dsn ) ; if ( bufferEnabled != null ) { return Boolean . parseBoolean ( bufferEnabled ) ; } return BUFFER_ENABLED_DEFAULT ;
public class Matrix3x2f { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix3x2fc # normalizedPositiveX ( org . joml . Vector2f ) */ public Vector2f normalizedPositiveX ( Vector2f dir ) { } }
dir . x = m11 ; dir . y = - m01 ; return dir ;
public class CapacityCommand { /** * Gets the formatted tier values of a worker . * @ param map the map to get worker tier values from * @ param workerName name of the worker * @ return the formatted tier values of the input worker name */ private static String getWorkerFormattedTierValues ( Map < String , Map < ...
return map . values ( ) . stream ( ) . map ( ( tierMap ) -> ( String . format ( "%-14s" , tierMap . getOrDefault ( workerName , "-" ) ) ) ) . collect ( Collectors . joining ( "" ) ) ;
public class DataSet { /** * Emits a DataSet using an { @ link OutputFormat } . This method adds a data sink to the program . * Programs may have multiple data sinks . A DataSet may also have multiple consumers ( data sinks * or transformations ) at the same time . * @ param outputFormat The OutputFormat to proce...
Preconditions . checkNotNull ( outputFormat ) ; // configure the type if needed if ( outputFormat instanceof InputTypeConfigurable ) { ( ( InputTypeConfigurable ) outputFormat ) . setInputType ( getType ( ) , context . getConfig ( ) ) ; } DataSink < T > sink = new DataSink < > ( this , outputFormat , getType ( ) ) ; th...
public class PositionUtil { /** * Return the Excel / OO / LO address of a range , preceeded by the table name * @ param row1 the first row * @ param col1 the first col * @ param row2 the last row * @ param col2 the last col * @ param table the table * @ return the Excel / OO / LO address */ public String to...
return this . toCellAddress ( table , row1 , col1 ) + ":" + this . toCellAddress ( table , row2 , col2 ) ;
public class FilteringScore { /** * Finds covering matches from the remainder . */ private List < Filter < S > > findCoveringMatches ( ) { } }
List < Filter < S > > coveringFilters = null ; boolean check = ! mRemainderFilters . isEmpty ( ) && ( mIdentityFilters . size ( ) > 0 || mRangeStartFilters . size ( ) > 0 || mRangeEndFilters . size ( ) > 0 ) ; if ( check ) { // Any remainder property which is provided by the index is a covering match . for ( Filter < S...
public class Bytes { /** * Retrieve a < b > short < / b > from a byte array in a given byte order */ public static int toShort ( byte [ ] b , int off , boolean littleEndian ) { } }
if ( littleEndian ) { return ( ( b [ off ] & 0xFF ) | ( ( b [ off + 1 ] & 0xFF ) << 8 ) ) ; } return ( ( ( b [ off ] & 0xFF ) << 8 ) | ( b [ off + 1 ] & 0xFF ) ) ;
public class Snappy { /** * Uncompress the input [ offset , offset + length ) as a String * @ param input * @ param offset * @ param length * @ return the uncompressed data * @ throws IOException */ public static String uncompressString ( byte [ ] input , int offset , int length ) throws IOException { } }
try { return uncompressString ( input , offset , length , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException ( "UTF-8 decoder is not found" ) ; }
public class IpAccessControlListReader { /** * Make the request to the Twilio API to perform the read . * @ param client TwilioRestClient with which to make the request * @ return IpAccessControlList ResourceSet */ @ Override public ResourceSet < IpAccessControlList > read ( final TwilioRestClient client ) { } }
return new ResourceSet < > ( this , client , firstPage ( client ) ) ;
public class Process { /** * Finds one work transition for this process matching the specified parameters * @ param fromId * @ param eventType * @ param completionCode * @ return the work transition value object ( or null if not found ) */ public Transition getTransition ( Long fromId , Integer eventType , Stri...
Transition ret = null ; for ( Transition transition : getTransitions ( ) ) { if ( transition . getFromId ( ) . equals ( fromId ) && transition . match ( eventType , completionCode ) ) { if ( ret == null ) ret = transition ; else { throw new IllegalStateException ( "Multiple matching work transitions when one expected:\...
public class AwsSecurityFindingFilters { /** * A finding ' s title . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTitle ( java . util . Collection ) } or { @ link # withTitle ( java . util . Collection ) } if you want to override the * existing values...
if ( this . title == null ) { setTitle ( new java . util . ArrayList < StringFilter > ( title . length ) ) ; } for ( StringFilter ele : title ) { this . title . add ( ele ) ; } return this ;
public class Link { /** * Connect a device to the link * @ param device * @ throws TooManyConnectionException */ public void connectDevice ( Device device ) throws ShanksException { } }
if ( this . linkedDevices . size ( ) < deviceCapacity ) { if ( ! this . linkedDevices . contains ( device ) ) { this . linkedDevices . add ( device ) ; device . connectToLink ( this ) ; logger . finer ( "Link " + this . getID ( ) + " has Device " + device . getID ( ) + " in its linked device list." ) ; } else { logger ...
public class NumberFormat { /** * Sets the maximum number of digits allowed in the integer portion of a * number . This must be & gt ; = minimumIntegerDigits . If the * new value for maximumIntegerDigits is less than the current value * of minimumIntegerDigits , then minimumIntegerDigits will also be set to * t...
maximumIntegerDigits = Math . max ( 0 , newValue ) ; if ( minimumIntegerDigits > maximumIntegerDigits ) minimumIntegerDigits = maximumIntegerDigits ;
public class FreePool { /** * Return a mcWrapper from the free pool . */ protected MCWrapper getFreeConnection ( ManagedConnectionFactory managedConnectionFactory , Subject subject , ConnectionRequestInfo cri , int hashCode ) throws ResourceAllocationException { } }
final boolean isTracingEnabled = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTracingEnabled && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "getFreeConnection" , gConfigProps . cfName ) ; } MCWrapper mcWrapper = null ; MCWrapper mcWrapperTemp1 = null ; MCWrapper mcWrapperTemp2 = null ; int mcwlSize = 0 ; ...
public class Crossfade { /** * Sets the type of resizing behavior that will be used during the * transition animation , one of { @ link # RESIZE _ BEHAVIOR _ NONE } and * { @ link # RESIZE _ BEHAVIOR _ SCALE } . * @ param resizeBehavior The type of resizing behavior to use when this * transition is run . */ @ N...
if ( resizeBehavior >= RESIZE_BEHAVIOR_NONE && resizeBehavior <= RESIZE_BEHAVIOR_SCALE ) { mResizeBehavior = resizeBehavior ; } return this ;
public class ContextAwareReporter { /** * Stops the { @ link ContextAwareReporter } . If the { @ link ContextAwareReporter } has not been started , or if it has been * stopped already , and not started since , this is a no - op . */ public final void stop ( ) { } }
if ( ! this . started ) { log . warn ( String . format ( "Reporter %s has already been stopped." , this . name ) ) ; return ; } try { stopImpl ( ) ; this . started = false ; } catch ( Exception exception ) { log . warn ( String . format ( "Reporter %s did not stop correctly." , this . name ) , exception ) ; }
public class AbstractValueCountingAnalyzerResult { /** * Appends a string representation with a maximum amount of entries * @ param sb * the StringBuilder to append to * @ param maxEntries * @ return */ protected void appendToString ( StringBuilder sb , ValueCountingAnalyzerResult groupResult , int maxEntries )...
if ( maxEntries != 0 ) { Collection < ValueFrequency > valueCounts = groupResult . getValueCounts ( ) ; for ( ValueFrequency valueCount : valueCounts ) { sb . append ( "\n - " ) ; sb . append ( valueCount . getName ( ) ) ; sb . append ( ": " ) ; sb . append ( valueCount . getCount ( ) ) ; maxEntries -- ; if ( maxEntrie...
public class SAXDriver { /** * ( temporarily ) package - visible for external entity decls */ String absolutize ( String baseURI , String systemId , boolean nice ) throws MalformedURLException , SAXException { } }
// FIXME normalize system IDs - - when ? // - Convert to UTF - 8 // - Map reserved and non - ASCII characters to % HH try { if ( baseURI == null ) { if ( XmlParser . uriWarnings ) { warn ( "No base URI; hope this SYSTEM id is absolute: " + systemId ) ; } return new URL ( systemId ) . toString ( ) ; } else { return new ...