signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ReplicationRule { /** * Sets the { @ link ReplicationFilter } that is used to identify objects that a CRR Rule applies to . * A rule cannot have both { @ link ReplicationFilter } and the deprecated { @ link # prefix } . * @ param filter { @ link ReplicationFilter } */ public void setFilter ( Replicatio...
if ( filter == null ) { throw new IllegalArgumentException ( "Filter cannot be null for a replication rule" ) ; } if ( prefix != null ) { throw new IllegalArgumentException ( "You cannot use both prefix and filter at the same time in a replication rule" ) ; } this . filter = filter ;
public class OptionsDoclet { /** * Given a command - line option of this doclet , returns the number of arguments you must specify on * the command line for the given option . Returns 0 if the argument is not recognized . This method * is automatically invoked by Javadoc . * @ param option the command - line opti...
if ( option . equals ( "-help" ) ) { System . out . printf ( USAGE ) ; return 1 ; } if ( option . equals ( "-i" ) || option . equals ( "-classdoc" ) || option . equals ( "-singledash" ) ) { return 1 ; } if ( option . equals ( "-docfile" ) || option . equals ( "-outfile" ) || option . equals ( "-format" ) || option . eq...
public class Interceptors { /** * The same as addGlobalActionInterceptor . It is used to compatible with earlier version of jfinal */ public Interceptors add ( Interceptor globalActionInterceptor ) { } }
if ( globalActionInterceptor == null ) { throw new IllegalArgumentException ( "globalActionInterceptor can not be null." ) ; } InterceptorManager . me ( ) . addGlobalActionInterceptor ( globalActionInterceptor ) ; return this ;
public class AbstractMessage { /** * / * ( non - Javadoc ) * @ see javax . jms . Message # getStringProperty ( java . lang . String ) */ @ Override public final String getStringProperty ( String name ) throws JMSException { } }
return MessageConvertTools . asString ( getProperty ( name ) ) ;
public class OpenPgpPubSubUtil { /** * Consult the public key metadata node and fetch a list of all of our published OpenPGP public keys . * @ see < a href = " https : / / xmpp . org / extensions / xep - 0373 . html # discover - pubkey - list " > * XEP - 0373 § 4.3 : Discovering Public Keys of a User < / a > * @ ...
return fetchPubkeysList ( connection , null ) ;
import java . util . ArrayList ; import java . util . Collections ; import java . util . HashSet ; import java . util . List ; public class Main { /** * Return the unique elements in a list , sorted in ascending order * > > > distinct _ sorted _ elements ( [ 5 , 3 , 5 , 2 , 3 , 3 , 9 , 0 , 123 ] ) * [ 0 , 2 , 3 , 5...
HashSet < Integer > set = new HashSet < Integer > ( array ) ; ArrayList < Integer > distinctSortedArray = new ArrayList < Integer > ( set ) ; Collections . sort ( distinctSortedArray ) ; return distinctSortedArray ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ConstantType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "rationals" ) public JAXBElement < ConstantType > createRationals ( ConstantType value ) { } }
return new JAXBElement < ConstantType > ( _Rationals_QNAME , ConstantType . class , null , value ) ;
public class PostalAddress { /** * < pre > * Optional . Additional , country - specific , sorting code . This is not used * in most regions . Where it is used , the value is either a string like * " CEDEX " , optionally followed by a number ( e . g . " CEDEX 7 " ) , or just a number * alone , representing the "...
java . lang . Object ref = sortingCode_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; sortingCode_ = s ; return s ; }
public class GqClientSessionImpl { /** * ClientAuthSession Implementation methods - - - - - */ @ Override public void sendAbortSessionAnswer ( AbortSessionAnswer answer ) throws InternalException , IllegalDiameterStateException , RouteException , OverloadException { } }
send ( Event . Type . SEND_SESSION_ABORT_ANSWER , answer ) ;
public class DatabaseDAODefaultImpl { private String stringArray2String ( String [ ] array ) { } }
StringBuilder sb = new StringBuilder ( "" ) ; for ( int i = 0 ; i < array . length ; i ++ ) { sb . append ( array [ i ] ) ; if ( i < array . length - 1 ) sb . append ( "\n" ) ; } return sb . toString ( ) ;
public class GenericsUtils { /** * Order variables for consequent variables resolution ( to support reverse order declaration cases ) . * E . g . { @ code T extends List < K > , K , P extends Collection < T > } must be resolved as 2 , 1 , 3 or * { @ code T extends List < D > , D extends Collection < P > , P } must ...
final List < TypeVariable > vars = new ArrayList < TypeVariable > ( variables ) ; final List < String > countableNames = new ArrayList < String > ( ) ; for ( TypeVariable var : variables ) { countableNames . add ( var . getName ( ) ) ; } final List < String > known = new ArrayList < String > ( ) ; final List < TypeVari...
public class Duration { /** * { @ inheritDoc } */ @ Override public int compareTo ( Duration rhs ) { } }
if ( m_units != rhs . m_units ) { rhs = convertUnits ( rhs . m_duration , rhs . m_units , m_units , ( 8 * 60 ) , ( 5 * 8 * 60 ) , 20 ) ; } return durationComponentEquals ( rhs ) ? 0 : m_duration < rhs . m_duration ? - 1 : 1 ;
public class ImageComponent { /** * Sets the image to be displayed . * @ param img * the image to be displayed */ public void setImage ( BufferedImage img ) { } }
this . img = img ; Dimension dim ; if ( img != null ) { dim = new Dimension ( img . getWidth ( ) , img . getHeight ( ) ) ; } else { dim = new Dimension ( DEFAULT_WIDTH , DEFAULT_HEIGHT ) ; } setSize ( dim ) ; setPreferredSize ( dim ) ; repaint ( ) ;
public class Strands { /** * Disables the current strand for scheduling purposes , until * the specified deadline , unless the permit is available . * If the permit is available then it is consumed and the call * returns immediately ; otherwise the current strand becomes disabled * for scheduling purposes and l...
try { Strand . parkUntil ( blocker , deadline ) ; } catch ( SuspendExecution e ) { throw RuntimeSuspendExecution . of ( e ) ; }
public class Ui { /** * Modulate the color to new alpha * @ param color Color * @ param alpha Modulate alpha * @ return Modulate alpha color */ public static int modulateColorAlpha ( int color , int alpha ) { } }
int colorAlpha = color >>> 24 ; int scale = alpha + ( alpha >> 7 ) ; int newAlpha = colorAlpha * scale >> 8 ; int r = ( color >> 16 ) & 0xFF ; int g = ( color >> 8 ) & 0xFF ; int b = color & 0xFF ; return newAlpha << 24 | r << 16 | g << 8 | b ;
public class ConnectionMonitorsInner { /** * Starts the specified connection monitor . * @ param resourceGroupName The name of the resource group containing Network Watcher . * @ param networkWatcherName The name of the Network Watcher resource . * @ param connectionMonitorName The name of the connection monitor ...
return ServiceFuture . fromResponse ( startWithServiceResponseAsync ( resourceGroupName , networkWatcherName , connectionMonitorName ) , serviceCallback ) ;
public class JettySetting { /** * 创建Hulu的ServletHolder * @ return Hulu的ServletHolder */ private static ServletHolder createHuluServletHolder ( ) { } }
ServletHolder servletHolder = new ServletHolder ( ActionServlet . class ) ; servletHolder . setAsyncSupported ( false ) ; servletHolder . setInitOrder ( 1 ) ; return servletHolder ;
public class MapBackedClassLoader { /** * Javadocs recommend that this method not be overloaded . We overload this so that we can prioritise the fastFindClass * over method calls to parent . loadClass ( name , false ) ; and c = findBootstrapClass0 ( name ) ; which the default implementation * would first - hence wh...
Class clazz = fastFindClass ( name ) ; if ( clazz == null ) { final ClassLoader parent = getParent ( ) ; if ( parent != null ) { clazz = Class . forName ( name , true , parent ) ; } } if ( resolve ) { resolveClass ( clazz ) ; } return clazz ;
public class CommerceTaxMethodPersistenceImpl { /** * Returns a range of all the commerce tax methods . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . ...
return findAll ( start , end , null ) ;
public class druidGParser { /** * druidG . g : 265:1 : anyValue returns [ Object obj ] : ( a = SINGLE _ QUOTE _ STRING | b = ( LONG | FLOAT ) ) ; */ public final Object anyValue ( ) throws RecognitionException { } }
Object obj = null ; Token a = null ; Token b = null ; try { // druidG . g : 266:2 : ( a = SINGLE _ QUOTE _ STRING | b = ( LONG | FLOAT ) ) int alt128 = 2 ; int LA128_0 = input . LA ( 1 ) ; if ( ( LA128_0 == SINGLE_QUOTE_STRING ) ) { alt128 = 1 ; } else if ( ( LA128_0 == FLOAT || LA128_0 == LONG ) ) { alt128 = 2 ; } els...
public class AbstractListPreference { /** * Initializes the list preference . * @ param attributeSet * The attribute set , which should be used to initialize the list preferences , as an * instance of the type { @ link AttributeSet } or null , if no attributes should be * obtained * @ param defaultStyle * T...
entries = new CharSequence [ 0 ] ; entryValues = new CharSequence [ 0 ] ; obtainStyledAttributes ( attributeSet , defaultStyle , defaultStyleResource ) ;
public class AbstractInstanceRegistry { /** * Registers a new instance with a given duration . * @ see com . netflix . eureka . lease . LeaseManager # register ( java . lang . Object , int , boolean ) */ public void register ( InstanceInfo registrant , int leaseDuration , boolean isReplication ) { } }
try { read . lock ( ) ; Map < String , Lease < InstanceInfo > > gMap = registry . get ( registrant . getAppName ( ) ) ; REGISTER . increment ( isReplication ) ; if ( gMap == null ) { final ConcurrentHashMap < String , Lease < InstanceInfo > > gNewMap = new ConcurrentHashMap < String , Lease < InstanceInfo > > ( ) ; gMa...
public class StatefulPassivator { /** * Passivates the object to the bean store . < p > * @ param obj BeanO that corresponds to the bean to passivate < p > */ public void passivate ( StatefulBeanO beanO , BeanMetaData bmd ) // d648122 throws RemoteException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) // 130050 Tr . entry ( tc , "passivate: " + beanO ) ; if ( beanO . isRemoved ( ) || isTerminating ( ) ) { if ( isTraceOn && tc . isEventEnabled ( ) ) // 130050 Tr . event ( tc , "Bean removed!" ) ; return ; ...
public class DefaultKeySanitizer { @ Override public Object sanitizeKey ( Object cacheKey ) throws KeySanitationExcepion { } }
if ( ! ( cacheKey instanceof String ) ) { throw new KeySanitationExcepion ( DefaultKeySanitizer . class . getSimpleName ( ) + " can only be used with Strings cache keys." ) ; } try { return Base64 . encodeToString ( ( ( String ) cacheKey ) . getBytes ( UTF8_CHARSET_NAME ) , BASE64_FLAGS ) ; } catch ( UnsupportedEncodin...
public class LruCache { /** * Puts all the values from the given map into the cache . * @ param m The map containing entries to put into the cache */ public synchronized void putAll ( Map < Key , Value > m ) { } }
for ( Map . Entry < Key , Value > entry : m . entrySet ( ) ) { this . put ( entry . getKey ( ) , entry . getValue ( ) ) ; }
public class ParameterList { /** * Remove all parameters with the specified name . * @ param paramName the name of parameters to remove */ public final void removeAll ( final String paramName ) { } }
final ParameterList params = getParameters ( paramName ) ; parameters . removeAll ( params . parameters ) ;
public class CharTrie { /** * Recompute cursor details char trie . * @ return the char trie */ CharTrie recomputeCursorDetails ( ) { } }
godparentIndex = new int [ getNodeCount ( ) ] ; parentIndex = new int [ getNodeCount ( ) ] ; Arrays . fill ( godparentIndex , 0 , godparentIndex . length , - 1 ) ; Arrays . fill ( parentIndex , 0 , parentIndex . length , - 1 ) ; System . gc ( ) ; recomputeCursorTotals ( root ( ) ) ; System . gc ( ) ; recomputeCursorPos...
public class ExtDirectSpringUtil { /** * Checks if the request is a multipart request * @ param request the HTTP servlet request * @ return true if request is a Multipart request ( file upload ) */ public static boolean isMultipart ( HttpServletRequest request ) { } }
if ( ! "post" . equals ( request . getMethod ( ) . toLowerCase ( ) ) ) { return false ; } String contentType = request . getContentType ( ) ; return contentType != null && contentType . toLowerCase ( ) . startsWith ( "multipart/" ) ;
public class Drawer { /** * Build the nav drawer layout , inflate it , then attach it to the * activity */ @ SuppressLint ( "NewApi" ) private void buildAndAttach ( ) { } }
// Disable any pending transition on the activity since we are transforming it mActivity . overridePendingTransition ( 0 , 0 ) ; // Setup window flags if Lollipop if ( BuildUtils . isLollipop ( ) ) { Window window = mActivity . getWindow ( ) ; window . addFlags ( FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS ) ; window . setStatus...
public class DescribeAlarmsForMetricResult { /** * The information for each alarm with the specified metric . * @ return The information for each alarm with the specified metric . */ public java . util . List < MetricAlarm > getMetricAlarms ( ) { } }
if ( metricAlarms == null ) { metricAlarms = new com . amazonaws . internal . SdkInternalList < MetricAlarm > ( ) ; } return metricAlarms ;
public class MergeMapParser { /** * Read map . * @ param filename map file path * @ param tmpDir temporary directory path , may be { @ code null } */ public void read ( final File filename , final File tmpDir ) { } }
tempdir = tmpDir != null ? tmpDir : filename . getParentFile ( ) ; try { final TransformerHandler s = stf . newTransformerHandler ( ) ; s . getTransformer ( ) . setOutputProperty ( OMIT_XML_DECLARATION , "yes" ) ; s . setResult ( new StreamResult ( output ) ) ; setContentHandler ( s ) ; dirPath = filename . getParentFi...
public class AlluxioJobMaster { /** * Starts the Alluxio job master . * @ param args command line arguments , should be empty */ public static void main ( String [ ] args ) { } }
if ( args . length != 0 ) { LOG . info ( "java -cp {} {}" , RuntimeConstants . ALLUXIO_JAR , AlluxioJobMaster . class . getCanonicalName ( ) ) ; System . exit ( - 1 ) ; } CommonUtils . PROCESS_TYPE . set ( alluxio . util . CommonUtils . ProcessType . JOB_MASTER ) ; AlluxioJobMasterProcess process ; try { process = Allu...
public class ExtensionScript { /** * Returns a unique name for the given script name */ private String getUniqueScriptName ( String name , String ext ) { } }
if ( this . getScriptImpl ( name ) == null ) { // Its unique return name ; } // Its not unique , add a suitable index . . . String stub = name . substring ( 0 , name . length ( ) - ext . length ( ) - 1 ) ; int index = 1 ; do { index ++ ; name = stub + "(" + index + ")." + ext ; } while ( this . getScriptImpl ( name ) !...
public class ListTagsForVaultResult { /** * The tags attached to the vault . Each tag is composed of a key and a value . * @ param tags * The tags attached to the vault . Each tag is composed of a key and a value . * @ return Returns a reference to this object so that method calls can be chained together . */ pub...
setTags ( tags ) ; return this ;
public class ParentEditController { /** * Set a new child edit controller . If there was a previous child controller , then it ' s < code > onDeactivate < / code > * method will be called first . Likewise on the new controller , the < code > onActivate < / code > will be called . * @ param controller * The new ch...
if ( this . controller != null ) { this . controller . onDeactivate ( ) ; } this . controller = controller ; if ( controller != null ) { controller . setMaxBoundsDisplayed ( isMaxBoundsDisplayed ( ) ) ; controller . onActivate ( ) ; } else { onActivate ( ) ; }
public class KeyVaultClientBaseImpl { /** * Merges a certificate or a certificate chain with a key pair existing on the server . * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service . This operation requires the certificates / c...
return mergeCertificateWithServiceResponseAsync ( vaultBaseUrl , certificateName , x509Certificates ) . map ( new Func1 < ServiceResponse < CertificateBundle > , CertificateBundle > ( ) { @ Override public CertificateBundle call ( ServiceResponse < CertificateBundle > response ) { return response . body ( ) ; } } ) ;
public class DynamoDBQueryExpression { /** * Sets one range key condition for this query , using the attribute name of * the range key . All range key attributes for the table must be specified * by using { @ link DynamoDBRangeKey } or { @ link DynamoDBIndexRangeKey } annotations * before executing the query . ...
if ( rangeKeyConditions == null ) rangeKeyConditions = new HashMap < String , Condition > ( ) ; rangeKeyConditions . put ( rangeKeyAttributeName , rangeKeyCondition ) ; return this ;
public class CreateDatasetContentRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateDatasetContentRequest createDatasetContentRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createDatasetContentRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createDatasetContentRequest . getDatasetName ( ) , DATASETNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall reque...
public class TriggerConfig { /** * The event type or types for which notifications are triggered . * @ param triggerEvents * The event type or types for which notifications are triggered . * @ see TriggerEventType */ public void setTriggerEvents ( java . util . Collection < String > triggerEvents ) { } }
if ( triggerEvents == null ) { this . triggerEvents = null ; return ; } this . triggerEvents = new com . amazonaws . internal . SdkInternalList < String > ( triggerEvents ) ;
public class EventDAOWrapper { /** * { @ inheritDoc } */ @ Override public < E extends Entity > ObjectStream < E > streamEntities ( EntityQuery < E > eq ) { } }
return wrapper . streamEntities ( eq ) ;
public class AbstractTransport { /** * Extract parts from Multi - part message . * @ param multiPart multi - part to visit * @ return map of part contentType - > part content * @ throws MessagingException * @ throws IOException */ static Map < String , Collection < String > > extractTextParts ( Multipart multiP...
HashMap < String , Collection < String > > bodies = new HashMap < > ( ) ; for ( int i = 0 ; i < multiPart . getCount ( ) ; i ++ ) { checkPartForTextType ( bodies , multiPart . getBodyPart ( i ) ) ; } return bodies ;
public class OneSideTrim { /** * { @ inheritDoc } */ @ Override public < T > T execute ( final Object value , final CsvContext context ) { } }
if ( value == null ) { return next . execute ( value , context ) ; } final String result = trim ( value . toString ( ) ) ; return next . execute ( result , context ) ;
public class VerificationConditionGenerator { /** * Flatten a given assumption set into a single logical condition . The key * challenge here is to try and do this as efficiency as possible . * @ param assumptions * @ return */ private WyalFile . Stmt flatten ( AssumptionSet assumptions ) { } }
WyalFile . Stmt result = flattenUpto ( assumptions , null ) ; if ( result == null ) { return new Expr . Constant ( new Value . Bool ( true ) ) ; } else { return result ; }
public class ObjectId { /** * Converts this instance into a 24 - byte hexadecimal string representation . * @ return a string representation of the ObjectId in hexadecimal format */ public String toHexString ( ) { } }
final StringBuilder buf = new StringBuilder ( 24 ) ; for ( final byte b : toByteArray ( ) ) { buf . append ( String . format ( "%02x" , b & 0xff ) ) ; } return buf . toString ( ) ;
public class ShareLinkManager { /** * Invokes a sharing client with a link created by the given json objects . * @ param selectedResolveInfo The { @ link ResolveInfo } corresponding to the selected sharing client . */ private void invokeSharingClient ( final ResolveInfo selectedResolveInfo ) { } }
isShareInProgress_ = true ; final String channelName = selectedResolveInfo . loadLabel ( context_ . getPackageManager ( ) ) . toString ( ) ; BranchShortLinkBuilder shortLinkBuilder = builder_ . getShortLinkBuilder ( ) ; shortLinkBuilder . generateShortUrlInternal ( new Branch . BranchLinkCreateListener ( ) { @ Override...
public class AntBuilder { /** * Determines , when the ANT Task that is represented by the " node " should perform . * Node must be an ANT Task or no " perform " is called . * If node is an ANT Task , it performs right after complete construction . * If node is nested in a TaskContainer , calling " perform " is de...
if ( parent == null ) insideTask = false ; antElementHandler . onEndElement ( null , null , antXmlContext ) ; lastCompletedNode = node ; if ( parent != null && ! ( parent instanceof Target ) ) { log . finest ( "parent is not null: no perform on nodeCompleted" ) ; return ; // parent will care about when children perform...
public class MaterialScrollfire { /** * Executes callback method depending on how far into the page you ' ve scrolled * @ param element Target element that is being tracked * @ param offset If this is 0 , the callback will be fired when the selector element is at the very bottom of the user ' s window . * @ param...
MaterialScrollfire scrollfire = new MaterialScrollfire ( ) ; scrollfire . setElement ( element ) ; scrollfire . setCallback ( callback ) ; scrollfire . setOffset ( offset ) ; scrollfire . apply ( ) ;
public class ApiOvhCloud { /** * Get network subnets * REST : GET / cloud / project / { serviceName } / network / private / { networkId } / subnet * @ param networkId [ required ] Network id * @ param serviceName [ required ] Service name */ public ArrayList < OvhSubnet > project_serviceName_network_private_netwo...
String qPath = "/cloud/project/{serviceName}/network/private/{networkId}/subnet" ; StringBuilder sb = path ( qPath , serviceName , networkId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t6 ) ;
public class VersionDependency { /** * Returns true if the underlying resource has changed . */ public boolean logModified ( Logger log ) { } }
if ( ! CauchoUtil . getFullVersion ( ) . equals ( _version ) ) { log . info ( "Baratine version has changed to " + CauchoUtil . getFullVersion ( ) ) ; return true ; } else return false ;
public class LabelProcessor { /** * Get the first label for a languageCode from a label type . * This method will call { @ link # getLabelListByLanguage ( String , LabelOrBuilder ) } to extract the list of labels * for the languageCode and then return its first entry . * @ param languageCode the languageCode whic...
final List < String > labelList = getLabelListByLanguage ( languageCode , label ) ; if ( labelList . isEmpty ( ) ) { throw new NotAvailableException ( "Label for Language[" + languageCode + "]" ) ; } return labelList . get ( 0 ) ;
public class CommerceWarehouseLocalServiceBaseImpl { /** * Deletes the commerce warehouse with the primary key from the database . Also notifies the appropriate model listeners . * @ param commerceWarehouseId the primary key of the commerce warehouse * @ return the commerce warehouse that was removed * @ throws P...
return commerceWarehousePersistence . remove ( commerceWarehouseId ) ;
public class PerspectiveOps { /** * Computes : D = A < sup > T < / sup > * B * C * @ param A ( Input ) 3x3 matrix * @ param B ( Input ) 3x3 matrix * @ param C ( Input ) 3x3 matrix * @ param output ( Output ) 3x3 matrix . Can be same instance A or B . */ public static void multTranA ( DMatrixRMaj A , DMatrixRMaj...
double t11 = A . data [ 0 ] * B . data [ 0 ] + A . data [ 3 ] * B . data [ 3 ] + A . data [ 6 ] * B . data [ 6 ] ; double t12 = A . data [ 0 ] * B . data [ 1 ] + A . data [ 3 ] * B . data [ 4 ] + A . data [ 6 ] * B . data [ 7 ] ; double t13 = A . data [ 0 ] * B . data [ 2 ] + A . data [ 3 ] * B . data [ 5 ] + A . data ...
public class MutateInBuilder { /** * Replace an existing value by the given fragment . * @ param path the path where the value to replace is . * @ param fragment the new value . */ public < T > MutateInBuilder replace ( String path , T fragment ) { } }
asyncBuilder . replace ( path , fragment ) ; return this ;
public class PippoSettings { /** * Gets the duration setting and converts it to hours . * The setting must be use one of the following conventions : * < ul > * < li > n MILLISECONDS * < li > n SECONDS * < li > n MINUTES * < li > n HOURS * < li > n DAYS * < / ul > * @ param name * @ param defaultValu...
TimeUnit timeUnit = extractTimeUnit ( name , defaultValue + " HOURS" ) ; long duration = getLong ( name , defaultValue ) ; return timeUnit . toHours ( duration ) ;
public class SelfRegisteringRemote { /** * uses the hub API to get some of its configuration . * @ return json object of the current hub configuration */ private GridHubConfiguration getHubConfiguration ( ) throws Exception { } }
String hubApi = "http://" + registrationRequest . getConfiguration ( ) . getHubHost ( ) + ":" + registrationRequest . getConfiguration ( ) . getHubPort ( ) + "/grid/api/hub" ; URL api = new URL ( hubApi ) ; HttpClient client = httpClientFactory . createClient ( api ) ; String url = api . toExternalForm ( ) ; HttpReques...
public class ThrowingFunctions { /** * Converts a throwing function and its argument into a { @ link Callable } . * @ param < T1 > the first parameter type * @ param < R > the result type * @ param func a throwing function to convert into a callable * @ param args the input to apply to the throwing function *...
return new Callable < R > ( ) { @ Override public R call ( ) throws Exception { return func . call ( args ) ; } } ;
public class SSLCertificateHelper { /** * TODO check */ public static X509Certificate [ ] exportRootCertificates ( final KeyStore ks , final String alias ) throws KeyStoreException { } }
logKeyStore ( ks ) ; final List < X509Certificate > trustedCerts = new ArrayList < X509Certificate > ( ) ; if ( Strings . isNullOrEmpty ( alias ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "No alias given, will trust all of the certificates in the store" ) ; } final List < String > aliases = toList ( ks . alia...
public class StreamEx { /** * Return an ordered stream produced by consecutive calls of the supplied * producer until it returns false . * The producer function may call the passed consumer any number of times * and return true if the producer should be called again or false * otherwise . It ' s guaranteed that...
Box < Emitter < T > > box = new Box < > ( ) ; return ( box . a = action -> producer . test ( action ) ? box . a : null ) . stream ( ) ;
public class ActionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Action action , ProtocolMarshaller protocolMarshaller ) { } }
if ( action == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( action . getDynamoDB ( ) , DYNAMODB_BINDING ) ; protocolMarshaller . marshall ( action . getDynamoDBv2 ( ) , DYNAMODBV2_BINDING ) ; protocolMarshaller . marshall ( action . getLa...
public class RasterImage { /** * Create raster from data or load from cache . * @ param rasterMedia The raster media . * @ param raster The raster data . * @ param i The raster index . * @ param save < code > true < / code > to save generated raster , < code > false < / code > else . * @ return The created ra...
final ImageBuffer rasterBuffer ; if ( rasterMedia . exists ( ) ) { rasterBuffer = Graphics . getImageBuffer ( rasterMedia ) ; rasterBuffer . prepare ( ) ; } else { final double fr = getRasterFactor ( i , raster . getRed ( ) ) ; final double fg = getRasterFactor ( i , raster . getGreen ( ) ) ; final double fb = getRaste...
public class StringSupport { /** * default is 0 , which means that all found characters must be replaced */ public static void replaceAll ( StringBuffer haystack , String needle , String newNeedle , int interval ) { } }
if ( needle == null ) { throw new IllegalArgumentException ( "string to replace can not be empty" ) ; } int idx = haystack . indexOf ( needle ) ; int nextIdx = - 1 ; int processedChunkSize = idx ; int needleLength = needle . length ( ) ; int newNeedleLength = newNeedle . length ( ) ; while ( idx != - 1 /* & & idx < hay...
public class LicenseFrame { /** * This method initializes txtLicense * @ return javax . swing . JTextPane */ private JTextPane getTxtLicense ( ) { } }
if ( txtLicense == null ) { txtLicense = new JTextPane ( ) ; txtLicense . setName ( "txtLicense" ) ; txtLicense . setEditable ( false ) ; } return txtLicense ;
public class ByteBufMono { /** * Convert to an { @ link InputStream } inbound { @ link Mono } * @ return a { @ link InputStream } inbound { @ link Mono } */ public Mono < InputStream > asInputStream ( ) { } }
return handle ( ( bb , sink ) -> { try { sink . next ( new ReleasingInputStream ( bb ) ) ; } catch ( IllegalReferenceCountException e ) { sink . complete ( ) ; } } ) ;
public class SignInApi { /** * HuaweiApiClient 连接结果回调 * @ param rst 结果码 * @ param client HuaweiApiClient 实例 */ @ Override public void onConnect ( int rst , HuaweiApiClient client ) { } }
if ( client == null || ! ApiClientMgr . INST . isConnect ( client ) ) { HMSAgentLog . e ( "client not connted" ) ; onSignInResult ( rst , null ) ; return ; } Activity curActivity = ActivityMgr . INST . getLastActivity ( ) ; if ( curActivity == null ) { HMSAgentLog . e ( "activity is null" ) ; onSignInResult ( HMSAgent ...
public class JShell { /** * Returns the active variable snippets . * This convenience method is equivalent to { @ code snippets ( ) } filtered for * { @ link jdk . jshell . Snippet . Status # isActive ( ) status ( snippet ) . isActive ( ) } * { @ code & & snippet . kind ( ) = = Kind . VARIABLE } * and cast to {...
return snippets ( ) . filter ( sn -> status ( sn ) . isActive ( ) && sn . kind ( ) == Snippet . Kind . VAR ) . map ( sn -> ( VarSnippet ) sn ) ;
public class EJBSecurityCollaboratorImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . container . service . metadata . ComponentMetaDataListener # componentMetaDataCreated ( com . ibm . ws . container . service . metadata . MetaDataEvent ) */ @ Override public void componentMetaDataCreated ( MetaDataEvent < Com...
JaccService js = jaccService . getService ( ) ; if ( js != null ) { MetaData metaData = event . getMetaData ( ) ; if ( metaData instanceof BeanMetaData ) { BeanMetaData bmd = ( BeanMetaData ) metaData ; js . propagateEJBRoles ( bmd . j2eeName . getApplication ( ) , bmd . j2eeName . getModule ( ) , bmd . enterpriseBeanN...
public class ConditionalBuilder { /** * Adds an { @ code else } clause encapsulating the given chunk to this conditional . */ public ConditionalBuilder setElse ( Statement trailingElse ) { } }
Preconditions . checkState ( this . trailingElse == null ) ; this . trailingElse = trailingElse ; return this ;
public class DatasourceTemplate { /** * Return a list of objects obtained applying the given { @ link RowMapper } to each record . * @ returnA not null empty list when the result set is empty . * @ throws SQLException */ public < T > List < T > query ( String sql , RowMapper < T > rowMapper ) throws SQLException { ...
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Executing SQL statement [" + sql + "]" ) ; } Connection connection = null ; Statement stm = null ; ResultSet rs = null ; ArrayList < T > result = new ArrayList < T > ( ) ; try { connection = ds . getConnection ( ) ; stm = connection . createStatement ( ) ; rs = stm...
public class AwsSecurityFindingFilters { /** * The key name associated with the instance . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setResourceAwsEc2InstanceKeyName ( java . util . Collection ) } or * { @ link # withResourceAwsEc2InstanceKeyName ( ja...
if ( this . resourceAwsEc2InstanceKeyName == null ) { setResourceAwsEc2InstanceKeyName ( new java . util . ArrayList < StringFilter > ( resourceAwsEc2InstanceKeyName . length ) ) ; } for ( StringFilter ele : resourceAwsEc2InstanceKeyName ) { this . resourceAwsEc2InstanceKeyName . add ( ele ) ; } return this ;
public class ModelsImpl { /** * Update an entity role for a given entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The entity ID . * @ param roleId The entity role ID . * @ param updateCustomPrebuiltEntityRoleOptionalParameter the object representing the op...
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgu...
public class RuleTemplateModelXMLPersistenceImpl { /** * ( non - Javadoc ) * @ see * org . drools . ide . common . server . util . RuleModelPersistence # toModel ( java . lang . String */ @ Override public TemplateModel unmarshal ( final String xml ) { } }
if ( xml == null || xml . trim ( ) . length ( ) == 0 ) { return createEmptyModel ( ) ; } TemplateModel model = ( TemplateModel ) this . xt . fromXML ( xml ) ; // Upgrade model changes to legacy artifacts ruleModelUpgrader1 . upgrade ( model ) ; ruleModelUpgrader2 . upgrade ( model ) ; ruleModelUpgrader3 . upgrade ( mod...
public class BTree { /** * wrapping generic Comparator with support for Special + / - infinity sentinels */ static < V > int find ( Comparator < V > comparator , Object key , Object [ ] a , final int fromIndex , final int toIndex ) { } }
int low = fromIndex ; int high = toIndex - 1 ; while ( low <= high ) { int mid = ( low + high ) / 2 ; int cmp = comparator . compare ( ( V ) key , ( V ) a [ mid ] ) ; if ( cmp > 0 ) low = mid + 1 ; else if ( cmp < 0 ) high = mid - 1 ; else return mid ; // key found } return - ( low + 1 ) ; // key not found .
public class GrpcServerBuilder { /** * Add a service to this server . * @ param serviceType the type of service * @ param serviceDefinition the service definition of new service * @ return an updated instance of this { @ link GrpcServerBuilder } */ public GrpcServerBuilder addService ( ServiceType serviceType , G...
mServices . add ( serviceType ) ; return addService ( serviceDefinition ) ;
public class V2ExtraJaxbClassModel { /** * { @ inheritDoc } */ @ Override public Class < ? > getClazz ( ClassLoader loader ) { } }
String c = getModelValue ( ) ; return c != null ? Classes . forName ( c , loader ) : null ;
public class CommandRunnable { /** * { @ inheritDoc } */ @ Override protected void runInto ( ) throws JRebirthThreadException { } }
try { // Call the innerRun available with package visibility this . command . innerRun ( this . wave ) ; } catch ( final CommandException ce ) { // Log all exception thrown during the execution of this command LOGGER . error ( CMD_EXCEPTION , ce ) ; // Then update the wave status in order to perform right task after th...
public class ClassFile { /** * Resolves a constants value from the constant pool to the lowest form it * can be represented by . E . g . String , Integer , Float , etc . * @ author gcmurphy * @ param index * @ param cp * @ return */ public static String constantValue ( int index , ConstantPool cp ) { } }
Constant type = cp . getConstant ( index ) ; if ( type != null ) { switch ( type . getTag ( ) ) { case Constants . CONSTANT_Class : ConstantClass cls = ( ConstantClass ) type ; return constantValue ( cls . getNameIndex ( ) , cp ) ; case Constants . CONSTANT_Double : ConstantDouble dbl = ( ConstantDouble ) type ; return...
public class SelectItemsIterator { /** * < p > Return < code > true < / code > if the iteration has more elements . < / p > */ public boolean hasNext ( ) { } }
if ( items != null ) { if ( items . hasNext ( ) ) { return ( true ) ; } else { items = null ; } } Object next = findNextValidChild ( ) ; while ( next != null ) { initializeItems ( next ) ; if ( items != null ) { return true ; } else { next = findNextValidChild ( ) ; } } return false ;
public class ClassTransformer { /** * Slim AnnotatedTypes */ public < T > BackedAnnotatedType < T > getBackedAnnotatedType ( final Class < T > rawType , final Type baseType , final String bdaId , final String suffix ) { } }
try { return backedAnnotatedTypes . getCastValue ( new TypeHolder < T > ( rawType , baseType , bdaId , suffix ) ) ; } catch ( RuntimeException e ) { if ( e instanceof TypeNotPresentException || e instanceof ResourceLoadingException ) { BootstrapLogger . LOG . exceptionWhileLoadingClass ( rawType . getName ( ) , e ) ; t...
public class EventTypeMapper { /** * Map originator type . * @ param originatorType the originator type * @ return the originator */ private static Originator mapOriginatorType ( OriginatorType originatorType ) { } }
Originator originator = new Originator ( ) ; if ( originatorType != null ) { originator . setCustomId ( originatorType . getCustomId ( ) ) ; originator . setHostname ( originatorType . getHostname ( ) ) ; originator . setIp ( originatorType . getIp ( ) ) ; originator . setProcessId ( originatorType . getProcessId ( ) )...
public class PrcTradingSettingsSave { /** * < p > Process entity request . < / p > * @ param pAddParam additional param , e . g . return this line ' s * document in " nextEntity " for farther process * @ param pRequestData Request Data * @ param pEntity Entity to process * @ return Entity processed for farthe...
srvTradingSettings . saveTradingSettings ( pAddParam , pEntity ) ; return pEntity ;
public class aaagroup_tmsessionpolicy_binding { /** * Use this API to fetch aaagroup _ tmsessionpolicy _ binding resources of given name . */ public static aaagroup_tmsessionpolicy_binding [ ] get ( nitro_service service , String groupname ) throws Exception { } }
aaagroup_tmsessionpolicy_binding obj = new aaagroup_tmsessionpolicy_binding ( ) ; obj . set_groupname ( groupname ) ; aaagroup_tmsessionpolicy_binding response [ ] = ( aaagroup_tmsessionpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class UserApi { /** * Changes custom attribute for the given user * @ param userIdOrUsername the user in the form of an Integer ( ID ) , String ( username ) , or User instance * @ param key for the customAttribute * @ param value for the customAttribute * @ return changedCustomAttribute * @ throws GitL...
return createCustomAttribute ( userIdOrUsername , key , value ) ;
public class PendingInvitation { /** * Gets the manager value for this PendingInvitation . * @ return manager */ public com . google . api . ads . adwords . axis . v201809 . mcm . ManagedCustomer getManager ( ) { } }
return manager ;
public class InternalSARLParser { /** * InternalSARL . g : 7962:1 : ruleXVariableDeclaration returns [ EObject current = null ] : ( ( ( ( ( ) ( ( ( ( ( ' var ' ) ) | ' val ' ) ( ( ' extension ' ) ) ? ) | ( ( ( ' extension ' ) ) ( ( ( ' var ' ) ) | ' val ' ) ) ) ) ) = > ( ( ) ( ( ( ( ( lv _ writeable _ 1_0 = ' var ' ) )...
EObject current = null ; Token lv_writeable_1_0 = null ; Token otherlv_2 = null ; Token lv_extension_3_0 = null ; Token lv_extension_4_0 = null ; Token lv_writeable_5_0 = null ; Token otherlv_6 = null ; Token otherlv_8 = null ; Token otherlv_10 = null ; AntlrDatatypeRuleToken lv_name_7_0 = null ; EObject lv_type_9_0 = ...
public class TouchState { /** * Compare two non - null states whose points are sorted by ID */ boolean equalsSorted ( TouchState ts ) { } }
if ( ts . pointCount == pointCount && ts . primaryID == primaryID && ts . window == window ) { for ( int i = 0 ; i < pointCount ; i ++ ) { Point p1 = ts . points [ i ] ; Point p2 = points [ i ] ; if ( p1 . x != p2 . x || p1 . y != p2 . y || p1 . id != p2 . id ) { return false ; } } return true ; } else { return false ;...
public class CmsGalleryService { /** * Returns the workplace settings of the current user . < p > * @ return the workplace settings */ private CmsWorkplaceSettings getWorkplaceSettings ( ) { } }
if ( m_workplaceSettings == null ) { m_workplaceSettings = CmsWorkplace . getWorkplaceSettings ( getCmsObject ( ) , getRequest ( ) ) ; } return m_workplaceSettings ;
public class ProtoBufToFlatBufConversion { /** * Converts a file containing a model from the Protocol Buffer format to the Flat * Buffer format . * @ param inFile input file ( . pb format ) * @ param outFile output file ( . fb format ) * @ throws IOException * @ throws org . nd4j . linalg . exception . ND4JIl...
SameDiff tg = TFGraphMapper . getInstance ( ) . importGraph ( new File ( inFile ) ) ; tg . asFlatFile ( new File ( outFile ) ) ;
public class JsJmsMapMessageImpl { /** * Set a float value with the given name , into the Map . * Javadoc description supplied by JsJmsMessage interface . */ public void setFloat ( String name , float value ) throws UnsupportedEncodingException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setFloat" , new Float ( value ) ) ; getBodyMap ( ) . put ( name , new Float ( value ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setFloat" ) ;
public class Intersection { /** * modifies the intersection by further intersecting it with a class / property * IMPORTANT : the class / property is given by the DOWNWRD - SATURATED SET * ( in other words , by the result of EquivalencesDAG . getSubRepresentatives * @ param e a non - empty downward saturated set f...
if ( elements == null ) // we have top , the intersection is sub elements = new HashSet < > ( dag . getSubRepresentatives ( e ) ) ; // copy the set else elements . retainAll ( dag . getSubRepresentatives ( e ) ) ;
public class IntTupleDistanceFunctions { /** * Computes the squared Euclidean distance between the given tuples * when they are interpreted as points of a sphere with the specified * size . * @ param t0 The first array * @ param t1 The second array * @ param size The size of the sphere * @ return The distan...
return Math . sqrt ( computeWrappedEuclideanSquared ( t0 , t1 , size ) ) ;
public class pqpolicy_stats { /** * Use this API to fetch the statistics of all pqpolicy _ stats resources that are configured on netscaler . */ public static pqpolicy_stats [ ] get ( nitro_service service ) throws Exception { } }
pqpolicy_stats obj = new pqpolicy_stats ( ) ; pqpolicy_stats [ ] response = ( pqpolicy_stats [ ] ) obj . stat_resources ( service ) ; return response ;
public class GooglePublicKeysManager { /** * Forces a refresh of the public certificates downloaded from { @ link # getPublicCertsEncodedUrl } . * This method is automatically called from { @ link # getPublicKeys ( ) } if the public keys have not * yet been initialized or if the expiration time is very close , so n...
lock . lock ( ) ; try { publicKeys = new ArrayList < PublicKey > ( ) ; // HTTP request to public endpoint CertificateFactory factory = SecurityUtils . getX509CertificateFactory ( ) ; HttpResponse certsResponse = transport . createRequestFactory ( ) . buildGetRequest ( new GenericUrl ( publicCertsEncodedUrl ) ) . execut...
public class LinkedHashMapPro { /** * Called by superclass constructors and pseudoconstructors ( clone , readObject ) before any entries * are inserted into the map . Initializes the chain . */ @ Override void init ( ) { } }
header = new Entry < K , V > ( - 1 , null , null , null ) ; header . before = header . after = header ;
public class ClassInfoList { /** * Filter this { @ link ClassInfoList } to include only { @ link Enum } classes . * @ return The filtered list , containing only enums . */ public ClassInfoList getEnums ( ) { } }
return filter ( new ClassInfoFilter ( ) { @ Override public boolean accept ( final ClassInfo ci ) { return ci . isEnum ( ) ; } } ) ;
public class MetricsCacheSink { /** * If so , restart the metricsCacheClientService with the new MetricsCacheLocation */ private void startMetricsCacheChecker ( ) { } }
final int checkIntervalSec = TypeUtils . getInteger ( sinkConfig . get ( KEY_TMASTER_LOCATION_CHECK_INTERVAL_SEC ) ) ; Runnable runnable = new Runnable ( ) { @ Override public void run ( ) { TopologyMaster . MetricsCacheLocation location = ( TopologyMaster . MetricsCacheLocation ) SingletonRegistry . INSTANCE . getSing...
public class AlluxioURI { /** * Checks if the path is a windows path . This should be platform independent . * @ param path the path to check * @ param slashed if the path starts with a slash * @ return true if it is a windows path , false otherwise */ public static boolean hasWindowsDrive ( String path , boolean...
int start = slashed ? 1 : 0 ; return path . length ( ) >= start + 2 && ( ! slashed || path . charAt ( 0 ) == '/' ) && path . charAt ( start + 1 ) == ':' && ( ( path . charAt ( start ) >= 'A' && path . charAt ( start ) <= 'Z' ) || ( path . charAt ( start ) >= 'a' && path . charAt ( start ) <= 'z' ) ) ;
public class SealStreamTask { /** * A method that issues abort request for all outstanding transactions on the stream , which are processed asynchronously . * This method returns false if it found transactions to abort , true otherwise . * @ param context operation context * @ param scope scope * @ param stream...
return streamMetadataStore . getActiveTxns ( scope , stream , context , executor ) . thenCompose ( activeTxns -> { if ( activeTxns == null || activeTxns . isEmpty ( ) ) { return CompletableFuture . completedFuture ( true ) ; } else { // abort transactions return Futures . allOf ( activeTxns . entrySet ( ) . stream ( ) ...
public class GenericsHelper { /** * same as class . isAssignableFrom ( class ) but with implicit cast check for native numbers */ public static boolean isAssignableFrom ( Class < ? > assignedCls , Class < ? > assigningCls ) { } }
if ( isNativeNumberType ( assigningCls ) && isNativeNumberType ( assignedCls ) ) { return isNumberImplicitlyCastableFrom ( assignedCls , assigningCls ) ; } return assignedCls . isAssignableFrom ( assigningCls ) ;
public class FileSupport { /** * Retrieves all files from a directory and its subdirectories * matching the given mask . * @ param file directory * @ param includeMask mask to match * @ return a list containing the found files */ public static ArrayList < File > getFilesInDirectoryTree ( File file , String incl...
return getContentsInDirectoryTree ( file , includeMask , true , false ) ;
public class BarcodeUtils { /** * Call this from your { @ link Activity } ' s { @ link Activity # onActivityResult ( int , int , Intent ) } method . * @ param requestCode * @ param resultCode * @ param intent * @ return null if the event handled here was not related to this class , or else an { @ link BarcodeIn...
if ( requestCode == REQUEST_CODE && resultCode == Activity . RESULT_OK ) { String contents = intent . getStringExtra ( SCAN_RESULT ) ; String formatName = intent . getStringExtra ( SCAN_RESULT_FORMAT ) ; return new BarcodeIntentResult ( contents , formatName ) ; } return null ;