signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ConsumerDispatcher { /** * Helper methods to create a ConsumerKey . Can be overridden by subclasses * @ param consumerPoint * @ param getCursor * @ param selector * @ param connectionUuid * @ return */ protected ConsumerKey createConsumerKey ( DispatchableConsumerPoint consumerPoint , SelectionCr...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createConsumerKey" , new Object [ ] { consumerPoint , criteria , connectionUuid , Boolean . valueOf ( readAhead ) , Boolean . valueOf ( forwardScanning ) , consumerSet } ) ; ConsumerKey key = new LocalQPConsumerKey ( consum...
public class FacesMessage { /** * < p > Persist { @ link javax . faces . application . FacesMessage } artifacts , * including the non serializable < code > Severity < / code > . < / p > */ private void writeObject ( ObjectOutputStream out ) throws IOException { } }
out . defaultWriteObject ( ) ; out . writeInt ( severity . getOrdinal ( ) ) ; out . writeObject ( summary ) ; out . writeObject ( detail ) ; out . writeObject ( rendered ) ;
public class Project { /** * Get the table name . */ public String getTableNames ( boolean bAddQuotes ) { } }
return ( m_tableName == null ) ? Record . formatTableNames ( PROJECT_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ;
public class Series { /** * The type of series * @ param type the type to set * @ return */ public Series setType ( SeriesType type ) { } }
if ( type != null ) { this . type = type . name ( ) . toLowerCase ( ) ; } else { this . type = null ; } return this ;
public class RoundedMoney { /** * ( non - Javadoc ) * @ see javax . money . MonetaryAmount # adjust ( javax . money . AmountAdjuster ) */ @ Override public RoundedMoney with ( MonetaryOperator operator ) { } }
Objects . requireNonNull ( operator ) ; try { return RoundedMoney . from ( operator . apply ( this ) ) ; } catch ( MonetaryException | ArithmeticException e ) { throw e ; } catch ( Exception e ) { throw new MonetaryException ( "Query failed: " + operator , e ) ; }
public class SSLConnectionLink { /** * @ see com . ibm . wsspi . channelfw . base . OutboundProtocolLink # close ( com . ibm . wsspi . channelfw . VirtualConnection , java . lang . Exception ) */ @ Override public void close ( VirtualConnection inVC , Exception e ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "close, vc=" + getVCHash ( ) ) ; } // Set closed flag so that ready can ' t be called again in an error condition . // This is a protective measure . closed = true ; // Clean up the read and write interfaces as well as the SS...
public class GatewayMessageCodec { /** * Encode given { @ code message } to given { @ code byteBuf } . * @ param message - input message to be encoded . * @ throws MessageCodecException in case of issues during encoding . */ public ByteBuf encode ( GatewayMessage message ) throws MessageCodecException { } }
ByteBuf byteBuf = ByteBufAllocator . DEFAULT . buffer ( ) ; try ( JsonGenerator generator = jsonFactory . createGenerator ( ( OutputStream ) new ByteBufOutputStream ( byteBuf ) , JsonEncoding . UTF8 ) ) { generator . writeStartObject ( ) ; // headers for ( Entry < String , String > header : message . headers ( ) . entr...
public class MetadataRepositoryImpl { /** * { @ inheritDoc } */ public Metadata findByName ( String name ) { } }
for ( Metadata m : metadata ) { if ( m . getName ( ) . equals ( name ) ) return m ; } return null ;
public class DateUtils { /** * 添加分钟 * @ param date 日期 * @ param amount 数量 * @ return 添加后的日期 */ public static Date addMinute ( Date date , int amount ) { } }
return add ( date , Calendar . MINUTE , amount ) ;
public class PropertyUtil { /** * This method returns the property as an integer value . * @ param name The property name * @ param def The optional default value * @ return The property as an integer , or null if not found */ public static Integer getPropertyAsInteger ( String name , Integer def ) { } }
String value = getProperty ( name ) ; if ( value != null ) { try { return Integer . parseInt ( value ) ; } catch ( NumberFormatException e ) { LOG . log ( Level . WARNING , "Failed to convert property value '" + value + "' to integer" , e ) ; } } return def ;
public class ThreadLocalPrivilegedTenantContext { /** * { @ inheritDoc } */ @ Override public < V > V execute ( Tenant tenant , Supplier < V > supplier ) { } }
return TenantContextDataHolder . execute ( tenant , supplier ) ;
public class IndexFacesResult { /** * An array of faces detected and added to the collection . For more information , see Searching Faces in a Collection * in the Amazon Rekognition Developer Guide . * @ param faceRecords * An array of faces detected and added to the collection . For more information , see Search...
if ( faceRecords == null ) { this . faceRecords = null ; return ; } this . faceRecords = new java . util . ArrayList < FaceRecord > ( faceRecords ) ;
public class MessageIntegrityAttribute { /** * Encodes < tt > message < / tt > using < tt > key < / tt > and the HMAC - SHA1 algorithm * as per RFC 2104 and returns the resulting byte array . This is a utility * method that generates content for the { @ link MessageIntegrityAttribute } * regardless of the credent...
try { // get an HMAC - SHA1 key from the raw key bytes SecretKeySpec signingKey = new SecretKeySpec ( key , HMAC_SHA1_ALGORITHM ) ; // get an HMAC - SHA1 Mac instance and initialize it with the key Mac mac = Mac . getInstance ( HMAC_SHA1_ALGORITHM ) ; mac . init ( signingKey ) ; // compute the hmac on input data bytes ...
public class AbstractWebPageSecurityObjectWithAttributes { /** * Validate custom data of the input field . * @ param aWPEC * Current web page execution context . Never < code > null < / code > . * @ param aSelectedObject * The selected object . May be < code > null < / code > . * @ param aFormErrors * The f...
return null ;
public class JLanguageTool { /** * Use this method if you want to access LanguageTool ' s otherwise * internal analysis of the text . For actual text checking , use the { @ code check . . . } methods instead . * @ param text The text to be analyzed * @ since 2.5 */ public List < AnalyzedSentence > analyzeText ( S...
List < String > sentences = sentenceTokenize ( text ) ; return analyzeSentences ( sentences ) ;
public class BundleDelegatingPageMounter { /** * { @ inheritDoc } */ public void addBundle ( ExtendedBundle bundle ) { } }
String symbolicName = bundle . getBundle ( ) . getSymbolicName ( ) ; if ( bundle . isRelevantForMountPointAnnotations ( ) ) { LOGGER . trace ( "Scanning bundle {} for PaxWicketMountPoint annotations" , symbolicName ) ; ArrayList < DefaultPageMounter > pageMounter = new ArrayList < DefaultPageMounter > ( ) ; Collection ...
public class SplittingBAMIndexer { /** * Process the given record for the index . * @ param rec the record from the file being indexed * @ throws IOException */ public void processAlignment ( final SAMRecord rec ) throws IOException { } }
// write an offset for the first record and for the g - th record thereafter ( where // g is the granularity ) , to be consistent with the index method if ( count == 0 || ( count + 1 ) % granularity == 0 ) { SAMFileSource fileSource = rec . getFileSource ( ) ; SAMFileSpan filePointer = fileSource . getFilePointer ( ) ;...
public class KeyStoreUtil { /** * Update a key store with the keys found in a server PEM and its key file . * @ param pKeyStore keystore to update * @ param pServerCert server certificate * @ param pServerKey server key * @ param pKeyAlgo algorithm used in the keystore ( e . g . " RSA " ) * @ param pPassword ...
InputStream is = new FileInputStream ( pServerCert ) ; try { CertificateFactory certFactory = CertificateFactory . getInstance ( "X509" ) ; X509Certificate cert = ( X509Certificate ) certFactory . generateCertificate ( is ) ; byte [ ] keyBytes = decodePem ( pServerKey ) ; PrivateKey privateKey ; KeyFactory keyFactory =...
public class JSDocInfoBuilder { /** * Records that the { @ link JSDocInfo } being built should have its * { @ link JSDocInfo # isNoCompile ( ) } flag set to { @ code true } . * @ return { @ code true } if the no compile flag was recorded and { @ code false } * if it was already recorded */ public boolean recordNo...
if ( ! currentInfo . isNoCompile ( ) ) { currentInfo . setNoCompile ( true ) ; populated = true ; return true ; } else { return false ; }
public class CostlessMeldPairingHeap { /** * Delete a node . * @ param n * the node */ private void delete ( Node < K , V > n ) { } }
if ( n != root && n . o_s == null && n . poolIndex == Node . NO_INDEX ) { // no root , no parent and no pool index throw new IllegalArgumentException ( "Invalid handle!" ) ; } // node has a parent if ( n . o_s != null ) { // cut oldest child Node < K , V > oldestChild = cutOldestChild ( n ) ; if ( oldestChild != null )...
public class GroupElement { /** * Returns true if name matches pattern */ protected boolean name_matches ( String pattern ) { } }
pattern = pattern . toLowerCase ( ) . replaceAll ( "[*]{1}" , ".*?" ) ; return name . toLowerCase ( ) . matches ( pattern ) || get_fully_qualified_name ( ) . toLowerCase ( ) . matches ( pattern ) ;
public class KerasConstraintUtils { /** * Map Keras to DL4J constraint . * @ param kerasConstraint String containing Keras constraint name * @ param conf Keras layer configuration * @ return DL4J LayerConstraint * @ see LayerConstraint */ public static LayerConstraint mapConstraint ( String kerasConstraint , Ke...
LayerConstraint constraint ; if ( kerasConstraint . equals ( conf . getLAYER_FIELD_MINMAX_NORM_CONSTRAINT ( ) ) || kerasConstraint . equals ( conf . getLAYER_FIELD_MINMAX_NORM_CONSTRAINT_ALIAS ( ) ) ) { double min = ( double ) constraintConfig . get ( conf . getLAYER_FIELD_MINMAX_MIN_CONSTRAINT ( ) ) ; double max = ( d...
public class RouteHandler { /** * Gets the request URI . * @ param request the specified request * @ return requestURI */ private String getRequestURI ( final HttpServletRequest request ) { } }
String ret = ( String ) request . getAttribute ( Keys . HttpRequest . REQUEST_URI ) ; if ( StringUtils . isBlank ( ret ) ) { ret = request . getRequestURI ( ) ; } return ret ;
public class PicketBoxSecurityIntegration { /** * { @ inheritDoc } */ public org . ironjacamar . core . spi . security . SecurityContext createSecurityContext ( String sd ) throws Exception { } }
org . jboss . security . SecurityContext sc = SecurityContextFactory . createSecurityContext ( sd ) ; return new PicketBoxSecurityContext ( sc ) ;
public class Day { /** * Find the n ' th xxxxday of s specified month ( for instance find 1st sunday * of May 2006 ; findNthOfMonth ( 1 , Calendar . SUNDAY , Calendar . MAY , 2006 ) ; * Return null if the specified day doesn ' t exists . * @ param n Nth day to look for . * @ param dayOfWeek Day to look for ( Ca...
// Validate the dayOfWeek argument if ( dayOfWeek < 0 || dayOfWeek > 6 ) throw new IllegalArgumentException ( "Invalid day of week: " + dayOfWeek ) ; LocalDateTime localDateTime = LocalDateTime . of ( year , month , 0 , 0 , 0 ) ; return new Day ( localDateTime . with ( TemporalAdjusters . next ( DayOfWeek . of ( dayOfW...
public class HysteresisEdgeTracePoints { /** * Checks to see if the given coordinate is above the lower threshold . If it is the point will be * added to the current segment or be the start of a new segment . * @ param parent The edge segment which is being checked * @ param match Has a match to the current segme...
if ( intensity . isInBounds ( x , y ) ) { int index = intensity . getIndex ( x , y ) ; if ( intensity . data [ index ] >= lower ) { intensity . data [ index ] = MARK_TRAVERSED ; if ( ! match ) { Point2D_I32 p = queuePoints . grow ( ) ; p . set ( x , y ) ; parent . points . add ( p ) ; } else { // a match was found so i...
public class ConfusingAutoboxedOverloading { /** * fills out a set of method details for possibly confusing method signatures * @ param cls * the current class being parsed * @ param methodInfo * a collection to hold possibly confusing methods */ private void populateMethodInfo ( JavaClass cls , Map < String , ...
try { if ( Values . DOTTED_JAVA_LANG_OBJECT . equals ( cls . getClassName ( ) ) ) { return ; } Method [ ] methods = cls . getMethods ( ) ; for ( Method m : methods ) { String sig = m . getSignature ( ) ; if ( isPossiblyConfusingSignature ( sig ) ) { String name = m . getName ( ) ; Set < String > sigs = methodInfo . get...
public class CategoryController { /** * Adds a view / presenter pair to the respective HashMaps . */ public void addView ( Category category , CategoryView view , CategoryPresenter presenter ) { } }
views . put ( category , view ) ; presenters . put ( category , presenter ) ;
public class LambdaResource { /** * The array of ARNs for < a > S3Resource < / a > objects to trigger the < a > LambdaResource < / a > objects associated with this * job . * @ param eventTriggers * The array of ARNs for < a > S3Resource < / a > objects to trigger the < a > LambdaResource < / a > objects associate...
if ( eventTriggers == null ) { this . eventTriggers = null ; return ; } this . eventTriggers = new java . util . ArrayList < EventTriggerDefinition > ( eventTriggers ) ;
public class DubboClientWrapper { /** * 对外提供的接口 , 获取指定类型的dubbo客户端引用 * 如果之前创建过 , 则直接从缓存中获取 , 不必再次创建 * @ param clientType * @ param < T > * @ return */ public static < T extends Object > T getWrapper ( Class < T > clientType ) { } }
return getWrapper ( clientType , generateClientId ( clientType ) ) ;
public class PointWiseCombinor { /** * { @ inheritDoc } */ public SparseDoubleVector combineUnmodified ( SparseDoubleVector v1 , SparseDoubleVector v2 ) { } }
return VectorMath . multiplyUnmodified ( v1 , v2 ) ;
public class HostStorageSystem { /** * Set NFS username and password on the host . The specified password is stored encrypted at the host and overwrites * any previous password configuration . This information is only needed when the host has mounted NFS volumes with * security types that require user credentials f...
getVimService ( ) . setNFSUser ( getMOR ( ) , user , password ) ;
public class ApiOvhMe { /** * remove this partition * REST : DELETE / me / installationTemplate / { templateName } / partitionScheme / { schemeName } / partition / { mountpoint } * @ param templateName [ required ] This template name * @ param schemeName [ required ] name of this partitioning scheme * @ param m...
String qPath = "/me/installationTemplate/{templateName}/partitionScheme/{schemeName}/partition/{mountpoint}" ; StringBuilder sb = path ( qPath , templateName , schemeName , mountpoint ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ;
public class AttributeValue { /** * An attribute of type Map . For example : * < code > " M " : { " Name " : { " S " : " Joe " } , " Age " : { " N " : " 35 " } } < / code > * @ param m * An attribute of type Map . For example : < / p > * < code > " M " : { " Name " : { " S " : " Joe " } , " Age " : { " N " : " ...
setM ( m ) ; return this ;
public class FctBnSeSelEntityProcs { /** * < p > Get PrcSeSrvSpecEmbFlDel ( create and put into map ) . < / p > * @ param pAddParam additional param * @ return requested PrcSeSrvSpecEmbFlDel * @ throws Exception - an exception */ protected final PrcSeSrvSpecEmbFlDel < RS > lazyGetPrcSeSrvSpecEmbFlDel ( final Map ...
String beanName = PrcSeSrvSpecEmbFlDel . class . getSimpleName ( ) ; @ SuppressWarnings ( "unchecked" ) PrcSeSrvSpecEmbFlDel < RS > proc = ( PrcSeSrvSpecEmbFlDel < RS > ) this . processorsMap . get ( beanName ) ; if ( proc == null ) { proc = new PrcSeSrvSpecEmbFlDel < RS > ( ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; pro...
public class CommerceTaxMethodLocalServiceBaseImpl { /** * Creates a new commerce tax method with the primary key . Does not add the commerce tax method to the database . * @ param commerceTaxMethodId the primary key for the new commerce tax method * @ return the new commerce tax method */ @ Override @ Transactiona...
return commerceTaxMethodPersistence . create ( commerceTaxMethodId ) ;
public class FirewallClient { /** * Retrieves the list of firewall rules available to the specified project . * < p > Sample code : * < pre > < code > * try ( FirewallClient firewallClient = FirewallClient . create ( ) ) { * ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ; * for ( Firewall element...
ListFirewallsHttpRequest request = ListFirewallsHttpRequest . newBuilder ( ) . setProject ( project == null ? null : project . toString ( ) ) . build ( ) ; return listFirewalls ( request ) ;
public class CompositeConverter { /** * This method always returns the last object converted from the list */ @ SuppressWarnings ( "unchecked" ) @ Override public Object convert ( Object source ) { } }
Object value = source ; for ( Converter < Object , Object > converter : converters ) { if ( converter != null ) { value = converter . convert ( value ) ; } } return value ;
public class ESJPCompiler { /** * All stored ESJP programs in eFaps are compiled . The system Java compiler * defined from the { @ link ToolProvider tool provider } is used for the * compiler . All old not needed compiled Java classes are automatically * removed . The compiler error and warning are logged ( error...
readESJPPrograms ( ) ; readESJPClasses ( ) ; final JavaCompiler compiler = ToolProvider . getSystemJavaCompiler ( ) ; if ( compiler == null ) { ESJPCompiler . LOG . error ( "no compiler found for compiler !" ) ; } else { // output of used compiler ESJPCompiler . LOG . info ( " Using compiler {}" , compiler . getClas...
public class WebACService { /** * Clean the identifier . * @ param identifier the identifier * @ return the cleaned identifier */ private static String cleanIdentifier ( final String identifier ) { } }
final String id = identifier . split ( "#" ) [ 0 ] . split ( "\\?" ) [ 0 ] ; if ( id . endsWith ( "/" ) ) { return id . substring ( 0 , id . length ( ) - 1 ) ; } return id ;
public class IterUtil { /** * 将键列表和值列表转换为Map < br > * 以键为准 , 值与键位置需对应 。 如果键元素数多于值元素 , 多余部分值用null代替 。 < br > * 如果值多于键 , 忽略多余的值 。 * @ param < K > 键类型 * @ param < V > 值类型 * @ param keys 键列表 * @ param values 值列表 * @ return 标题内容Map * @ since 3.1.0 */ public static < K , V > Map < K , V > toMap ( Iterable < K...
return toMap ( keys , values , false ) ;
public class ClientProcessor { /** * / * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . utils . watchdog . ActiveObject # onActivityTimeout ( ) */ @ Override public boolean onActivityTimeout ( ) throws Exception { } }
if ( ! transport . isClosed ( ) ) { log . warn ( "#" + id + " Timeout waiting for client activity (" + authTimeout + "s), dropping client." ) ; stop ( ) ; } return true ;
public class GeometryTools { /** * Normalizes a point . * @ param point The point to normalize */ public static void normalize ( Point3d point ) { } }
double sum = Math . sqrt ( point . x * point . x + point . y * point . y + point . z * point . z ) ; point . x = point . x / sum ; point . y = point . y / sum ; point . z = point . z / sum ;
public class SqlBasedRsIterator { /** * returns a proxy or a fully materialized Object from the current row of the * underlying resultset . */ protected Object getObjectFromResultSet ( ) throws PersistenceBrokerException { } }
try { // if all primitive attributes of the object are contained in the ResultSet // the fast direct mapping can be used return super . getObjectFromResultSet ( ) ; } // if the full loading failed we assume that at least PK attributes are contained // in the ResultSet and perform a slower Identity based loading . . . /...
public class QR { /** * Solve the least squares A * x = b . * @ param b right hand side of linear system . * @ param x the output solution vector that minimizes the L2 norm of A * x - b . * @ exception RuntimeException if matrix is rank deficient . */ public void solve ( double [ ] b , double [ ] x ) { } }
if ( b . length != qr . nrows ( ) ) { throw new IllegalArgumentException ( String . format ( "Row dimensions do not agree: A is %d x %d, but B is %d x 1" , qr . nrows ( ) , qr . nrows ( ) , b . length ) ) ; } if ( x . length != qr . ncols ( ) ) { throw new IllegalArgumentException ( "A and x dimensions don't match." ) ...
public class ISODateTimeFormat { /** * Creates a date using the ordinal date format . * Specification reference : 5.2.2. * @ param bld the builder * @ param fields the fields * @ param extended true to use extended format * @ param strictISO true to only allow ISO formats * @ since 1.1 */ private static boo...
boolean reducedPrec = false ; if ( fields . remove ( DateTimeFieldType . year ( ) ) ) { bld . append ( Constants . ye ) ; if ( fields . remove ( DateTimeFieldType . dayOfYear ( ) ) ) { // YYYY - DDD / YYYYDDD appendSeparator ( bld , extended ) ; bld . appendDayOfYear ( 3 ) ; } else { // YYYY / YYYY reducedPrec = true ;...
public class DynamoDBTableMapper { /** * Retrieves multiple items from the table using their primary keys . * @ param itemsToGet The items to get . * @ return The list of objects . * @ see com . amazonaws . services . dynamodbv2 . datamodeling . DynamoDBMapper # batchLoad */ public List < T > batchLoad ( Iterable...
final Map < String , List < Object > > results = mapper . batchLoad ( itemsToGet ) ; if ( results . isEmpty ( ) ) { return Collections . < T > emptyList ( ) ; } return ( List < T > ) results . get ( mapper . getTableName ( model . targetType ( ) , config ) ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIDEStructure ( ) { } }
if ( ideStructureEClass == null ) { ideStructureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 392 ) ; } return ideStructureEClass ;
public class JmsMessageImpl { /** * @ see javax . jms . Message # getJMSReplyTo ( ) * d246604 Review error logic . * This method uses 3 mechanisms to determine the type of the replyTo destination : * a ) The JMS specific replyURIBytes * b ) using coreConnection . getDestinationConfiguration ( ) * c ) Guessing...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getJMSReplyTo" ) ; // If we have not cached the replyTo destination . if ( replyTo == null ) { List < SIDestinationAddress > rrp = msg . getReverseRoutingPath ( ) ; SICoreConnection siConn = null ; if ( theSession !=...
public class ApplicationRouter { /** * 获取application定义 * @ param application application名称 * @ throws ApplicationUndefinedException application未定义 */ public NodeStatus newestDefinition ( String application ) throws ApplicationUndefinedException { } }
if ( Objects . equals ( application , EnvUtil . getApplication ( ) ) ) return LocalNodeManager . singleton . getFullStatus ( ) ; if ( ApplicationDiscovery . singleton != null ) { NodeStatus status = ApplicationDiscovery . singleton . newestDefinition ( application ) ; if ( status != null ) return status ; } throw new A...
public class ForkJoinTask { /** * Returns an estimate of how many more locally queued tasks are * held by the current worker thread than there are other worker * threads that might steal them . This value may be useful for * heuristic decisions about whether to fork other tasks . In many * usages of ForkJoinTas...
/* * The aim of this method is to return a cheap heuristic guide * for task partitioning when programmers , frameworks , tools , * or languages have little or no idea about task granularity . * In essence by offering this method , we ask users only about * tradeoffs in overhead vs expected throughput and its ...
public class ClusterMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Cluster cluster , ProtocolMarshaller protocolMarshaller ) { } }
if ( cluster == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( cluster . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( cluster . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( cluster . getCreatedAt ( ) , CREA...
public class QueryBuilder { /** * The remainder of two terms , as in { @ code WHERE k = left % right } . */ @ NonNull public static Term remainder ( @ NonNull Term left , @ NonNull Term right ) { } }
return new BinaryArithmeticTerm ( ArithmeticOperator . REMAINDER , left , right ) ;
public class ReflectionUtils { /** * 循环向上转型 , 获取对象的DeclaredField , 并强制设置为可访问 . * 如向上转型到Object仍无法找到 , 返回null . */ public static Field getAccessibleField ( final Object obj , final String fieldName ) { } }
if ( obj == null ) throw new IllegalArgumentException ( "object cannot be null." ) ; if ( fieldName == null || fieldName . trim ( ) . length ( ) == 0 ) throw new IllegalArgumentException ( "fieldName cannot be null." ) ; for ( Class < ? > superClass = obj . getClass ( ) ; superClass != Object . class ; superClass = sup...
public class CitrusEndpoints { /** * Creates new KubernetesClient builder . * @ return */ @ SuppressWarnings ( "unchecked" ) public static ClientServerEndpointBuilder < KubernetesClientBuilder , KubernetesClientBuilder > kubernetes ( ) { } }
return new ClientServerEndpointBuilder ( new KubernetesClientBuilder ( ) , new KubernetesClientBuilder ( ) ) { @ Override public EndpointBuilder < ? extends Endpoint > server ( ) { throw new UnsupportedOperationException ( "Citrus Kubernetes stack has no support for server implementation" ) ; } } ;
public class EphemeralKey { /** * Invalidates an ephemeral API key for a given resource . */ public EphemeralKey delete ( RequestOptions options ) throws StripeException { } }
return request ( RequestMethod . DELETE , instanceUrl ( EphemeralKey . class , this . id ) , ( Map < String , Object > ) null , EphemeralKey . class , options ) ;
public class BlockLocation { /** * Implement readFields of Writable */ public void readFields ( DataInput in ) throws IOException { } }
this . offset = in . readLong ( ) ; this . length = in . readLong ( ) ; this . corrupt = in . readBoolean ( ) ; int numNames = in . readInt ( ) ; this . names = new String [ numNames ] ; for ( int i = 0 ; i < numNames ; i ++ ) { Text name = new Text ( ) ; name . readFields ( in ) ; names [ i ] = name . toString ( ) ; }...
public class IntTuples { /** * Add an element with the given value at the given index to the given * tuple , creating a new tuple whose { @ link Tuple # getSize ( ) size } is * one larger than that of the given tuple . * @ param t The tuple * @ param index The index where the element should be added * @ param...
if ( index < 0 ) { throw new IndexOutOfBoundsException ( "Index " + index + " is negative" ) ; } if ( index > t . getSize ( ) ) // Note : index = = t . getSize ( ) is valid ! { throw new IndexOutOfBoundsException ( "Index " + index + ", size " + t . getSize ( ) ) ; } if ( result == null ) { result = IntTuples . create ...
public class Socket { /** * Sends a binary frame on the socket . * @ param message the message * @ param bus the Vert . x event bus . */ public void publish ( byte [ ] message , EventBus bus ) { } }
bus . publish ( getBinaryWriteHandlerId ( ) , Buffer . buffer ( message ) ) ;
public class Grammar { public void removeProductions ( int symbol ) { } }
int prod ; for ( prod = getProductionCount ( ) - 1 ; prod >= 0 ; prod -- ) { if ( getLeft ( prod ) == symbol ) { removeProduction ( prod ) ; } }
public class PolicyExecutorImpl { /** * Queue a task to the global executor . * Prereq : maxConcurrencyConstraint permit must already be acquired to reflect the task being queued to global . * If unsuccessful in queuing to global , this method releases the maxConcurrencyConstraint permit . * @ param globalTask ta...
globalTask . expedite = false ; boolean submitted = false ; try { globalExecutor . executeWithoutInterceptors ( globalTask ) ; submitted = true ; } finally { if ( ! submitted ) { maxConcurrencyConstraint . release ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , ...
public class TranscriptSequence { /** * Remove a CDS or coding sequence from the transcript sequence * @ param accession * @ return */ public CDSSequence removeCDS ( String accession ) { } }
for ( CDSSequence cdsSequence : cdsSequenceList ) { if ( cdsSequence . getAccession ( ) . getID ( ) . equals ( accession ) ) { cdsSequenceList . remove ( cdsSequence ) ; cdsSequenceHashMap . remove ( accession ) ; return cdsSequence ; } } return null ;
public class GatewayServlet { /** * Parses the query string into a map . * @ param queryString */ protected static final QueryMap parseApiRequestQueryParams ( String queryString ) { } }
QueryMap rval = new QueryMap ( ) ; if ( queryString != null ) { try { String [ ] pairSplit = queryString . split ( "&" ) ; // $ NON - NLS - 1 $ for ( String paramPair : pairSplit ) { int idx = paramPair . indexOf ( "=" ) ; // $ NON - NLS - 1 $ String key , value ; if ( idx != - 1 ) { key = URLDecoder . decode ( paramPa...
public class SARLRuntime { /** * Returns the XML representation of the given SRE . * @ param sre the SRE to serialize . * @ param xml the XML representation of the given SRE . * @ throws CoreException if trying to compute the XML for the SRE state encounters a problem . */ public static void setSREFromXML ( ISREI...
try { final Element root = parseXML ( xml , false ) ; sre . setFromXML ( root ) ; } catch ( Throwable e ) { throw new CoreException ( SARLEclipsePlugin . getDefault ( ) . createStatus ( IStatus . ERROR , e ) ) ; }
public class TransitionUtil { /** * Get the list of visible MenuItems * @ param toolbar * @ return the list of visible MenuItems */ public static List < MenuItem > getVisibleMenuItemList ( @ NonNull Toolbar toolbar ) { } }
List < MenuItem > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < toolbar . getChildCount ( ) ; i ++ ) { final View v = toolbar . getChildAt ( i ) ; if ( v instanceof ActionMenuView ) { int childCount = ( ( ActionMenuView ) v ) . getChildCount ( ) ; for ( int j = 0 ; j < childCount ; j ++ ) { final View innerView ...
public class ExpressRouteCircuitPeeringsInner { /** * Creates or updates a peering in the specified express route circuits . * @ param resourceGroupName The name of the resource group . * @ param circuitName The name of the express route circuit . * @ param peeringName The name of the peering . * @ param peerin...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , circuitName , peeringName , peeringParameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class XSLTElementProcessor { /** * Receive notification of ignorable whitespace in element content . * @ param handler non - null reference to current StylesheetHandler that is constructing the Templates . * @ param ch The whitespace characters . * @ param start The start position in the character array . ...
// no op
public class PipelineService { /** * / * DIAMOND BEGIN */ public MaterialRevisions getRevisionsBasedOnDependencies ( MaterialRevisions actualRevisions , CruiseConfig cruiseConfig , CaseInsensitiveString pipelineName ) { } }
FanInGraph fanInGraph = new FanInGraph ( cruiseConfig , pipelineName , materialRepository , pipelineDao , systemEnvironment , materialConfigConverter ) ; final MaterialRevisions computedRevisions = fanInGraph . computeRevisions ( actualRevisions , pipelineTimeline ) ; fillUpNonOverridableRevisions ( actualRevisions , c...
public class BasicHttpClient { /** * This is how framework makes the KeyValue pair when " application / x - www - form - urlencoded " headers * is passed in the request . In case you want to build or prepare the requests differently , * you can override this method via @ UseHttpClient ( YourCustomHttpClient . class...
RequestBuilder requestBuilder = RequestBuilder . create ( methodName ) . setUri ( httpUrl ) ; if ( reqBodyAsString != null ) { Map < String , Object > reqBodyMap = HelperJsonUtils . readObjectAsMap ( reqBodyAsString ) ; List < NameValuePair > reqBody = new ArrayList < > ( ) ; for ( String key : reqBodyMap . keySet ( ) ...
public class GuessDialectUtils { /** * Guess dialect based on given JDBC connection instance , Note : this method does * not close connection * @ param jdbcConnection * The connection * @ return dialect or null if can not guess out which dialect */ public static Dialect guessDialect ( Connection jdbcConnection ...
String databaseName ; String driverName ; int majorVersion ; int minorVersion ; try { DatabaseMetaData meta = jdbcConnection . getMetaData ( ) ; driverName = meta . getDriverName ( ) ; databaseName = meta . getDatabaseProductName ( ) ; majorVersion = meta . getDatabaseMajorVersion ( ) ; minorVersion = meta . getDatabas...
public class Resolve { /** * / * Return the most specific of the two methods for a call , * given that both are accessible and applicable . * @ param m1 A new candidate for most specific . * @ param m2 The previous most specific candidate . * @ param env The current environment . * @ param site The original t...
switch ( m2 . kind ) { case MTH : if ( m1 == m2 ) return m1 ; boolean m1SignatureMoreSpecific = signatureMoreSpecific ( argtypes , env , site , m1 , m2 , useVarargs ) ; boolean m2SignatureMoreSpecific = signatureMoreSpecific ( argtypes , env , site , m2 , m1 , useVarargs ) ; if ( m1SignatureMoreSpecific && m2SignatureM...
public class CallbackValidator { /** * { @ inheritDoc } */ @ Override public void validate ( ValidationHelper helper , Context context , String key , Callback t ) { } }
String message ; for ( String urlTemplate : t . keySet ( ) ) { // validate urlTemplate is valid if ( urlTemplate . isEmpty ( ) ) { message = Tr . formatMessage ( tc , "callbackURLTemplateEmpty" ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , messa...
public class PasswordPropertiesField { /** * Add this to the list of properties that must be encrypted . * @ param strProperty */ public void addPasswordProperty ( String strProperty ) { } }
if ( m_setPropertiesDescriptions == null ) m_setPropertiesDescriptions = new HashSet < String > ( ) ; if ( strProperty != null ) m_setPropertiesDescriptions . add ( strProperty ) ; else m_setPropertiesDescriptions . remove ( strProperty ) ;
public class ClassDelegate { /** * needed */ protected ActivityBehavior determineBehaviour ( ActivityBehavior delegateInstance ) { } }
if ( hasMultiInstanceCharacteristics ( ) ) { multiInstanceActivityBehavior . setInnerActivityBehavior ( ( AbstractBpmnActivityBehavior ) delegateInstance ) ; return multiInstanceActivityBehavior ; } return delegateInstance ;
public class DistributedAvatarFileSystem { /** * This ensures that if we have done a client configuration lookup , the * logicalName might have changed and we still need to allow URIs that specify * the old logical name stored in fsName . It also allows paths that don ' t * specify ports . For example : * We wo...
if ( conf . getBoolean ( "client.configuration.lookup.done" , false ) ) { URI uri = path . toUri ( ) ; String thisScheme = this . getUri ( ) . getScheme ( ) ; String thatScheme = uri . getScheme ( ) ; String thisHost = fsName . getHost ( ) ; String thatHost = uri . getHost ( ) ; if ( thatScheme != null && thisScheme . ...
public class PyroProxy { /** * ( re ) connect the proxy to the remote Pyro daemon . */ protected void connect ( ) throws UnknownHostException , IOException { } }
if ( sock == null ) { sock = new Socket ( hostname , port ) ; sock . setKeepAlive ( true ) ; sock . setTcpNoDelay ( true ) ; sock_out = sock . getOutputStream ( ) ; sock_in = sock . getInputStream ( ) ; sequenceNr = 0 ; _handshake ( ) ; if ( Config . METADATA ) { // obtain metadata if this feature is enabled , and the ...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.ibm.com/websphere/wim" , name = "countryName" ) public JAXBElement < String > createCountryName ( String value ) { } }
return new JAXBElement < String > ( _CountryName_QNAME , String . class , null , value ) ;
public class BeanDescImpl { /** * { @ inheritDoc } */ public < T extends Annotation > T getAnnotation ( Class < T > type ) { } }
return clazz . getAnnotation ( type ) ;
public class PlattSMO { /** * Returns the local decision function for regression training purposes * without the bias term * @ param v the index of the point to select * @ return the decision function output sans bias */ protected double decisionFunctionR ( int v ) { } }
double sum = 0 ; for ( int i = 0 ; i < vecs . size ( ) ; i ++ ) if ( alphas [ i ] != alpha_s [ i ] ) // multipler would be zero sum += ( alphas [ i ] - alpha_s [ i ] ) * kEval ( v , i ) ; return sum ;
public class ProxyList { /** * / / / / / Methods from List interface / / / / / */ @ Override public void add ( final int arg0 , final Object arg1 ) { } }
eagerlyLoadDataCollection ( ) ; List dataList = ( List ) dataCollection ; if ( dataList == null ) { dataList = new ArrayList ( ) ; } if ( arg1 != null && ! dataList . contains ( arg1 ) ) { dataList . add ( arg0 , arg1 ) ; }
public class PropertyLoader { /** * Resolve the config for given element . */ private < T extends AnnotatedElement > Map < T , PropertyInfo > resolveConfig ( String keyPrefix , T element , Set < Class > resolvedConfigs ) { } }
Map < T , PropertyInfo > result = new HashMap < > ( ) ; if ( ! element . isAnnotationPresent ( Config . class ) ) { return result ; } String prefix = concat ( keyPrefix , element . getAnnotation ( Config . class ) . prefix ( ) ) ; Class < ? > returnType = getValueType ( element ) ; checkRecursiveConfigs ( resolvedConfi...
public class DOMUtils { /** * Parse the given XML stream and return the root Element */ public static Element parse ( InputStream xmlStream , DocumentBuilder builder ) throws IOException { } }
try { Document doc ; synchronized ( builder ) // synchronize to prevent concurrent parsing on the same DocumentBuilder { doc = builder . parse ( xmlStream ) ; } return doc . getDocumentElement ( ) ; } catch ( SAXException se ) { throw new IOException ( se . toString ( ) ) ; } finally { xmlStream . close ( ) ; }
public class UserAttrs { /** * Returns user - defined - attribute * @ param path * @ param attribute user : attribute name . user : can be omitted . * @ param def Default value if attribute doesn ' t exist * @ param options * @ return * @ throws IOException */ public static final long getLongAttribute ( Pat...
attribute = attribute . startsWith ( "user:" ) ? attribute : "user:" + attribute ; byte [ ] attr = ( byte [ ] ) Files . getAttribute ( path , attribute , options ) ; if ( attr == null ) { return def ; } if ( attr . length != 8 ) { throw new IllegalArgumentException ( attribute + " not correct type" ) ; } return Primiti...
public class AuthenticationUtils { /** * Converts an instance of User to JSON object , fit for a cookie * @ param user Instance of User to convert * @ return JSON string containing the user state * @ throws Exception */ static public String userToCookieString ( boolean loggedIn , User user ) throws Exception { } ...
JSONObject cookieObj = new JSONObject ( ) ; cookieObj . put ( "logged" , loggedIn ) ; JSONObject userObj = user . toJSON ( ) ; cookieObj . put ( "user" , userObj ) ; StringWriter sw = new StringWriter ( ) ; cookieObj . write ( sw ) ; String cookieRaw = sw . toString ( ) ; String cookieStr = URLEncoder . encode ( cookie...
public class MatchAllScorer { /** * { @ inheritDoc } */ @ Override public void score ( Collector collector ) throws IOException { } }
collector . setScorer ( this ) ; while ( nextDoc ( ) != NO_MORE_DOCS ) { collector . collect ( docID ( ) ) ; }
public class ButtonSerializer { /** * ( non - Javadoc ) * @ see com . google . gson . JsonSerializer # serialize ( java . lang . Object , * java . lang . reflect . Type , com . google . gson . JsonSerializationContext ) */ public JsonElement serialize ( Button src , Type typeOfSrc , JsonSerializationContext context...
ButtonType buttonType = src . getType ( ) ; Class < ? > buttonClass = getButtonClass ( buttonType ) ; return context . serialize ( src , buttonClass ) ;
public class QuerySplitterImpl { /** * Verifies that the given query can be properly scattered . * @ param query the query to verify * @ throws IllegalArgumentException if the query is invalid . */ private void validateQuery ( Query query ) throws IllegalArgumentException { } }
if ( query . getKindCount ( ) != 1 ) { throw new IllegalArgumentException ( "Query must have exactly one kind." ) ; } if ( query . getOrderCount ( ) != 0 ) { throw new IllegalArgumentException ( "Query cannot have any sort orders." ) ; } if ( query . hasFilter ( ) ) { validateFilter ( query . getFilter ( ) ) ; }
public class DetachVolumeRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DetachVolumeRequest > getDryRunRequest ( ) { } }
Request < DetachVolumeRequest > request = new DetachVolumeRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class Entity { /** * Deprecated */ public void addReference ( List < Term > span ) { } }
this . references . add ( KAFDocument . < Term > list2Span ( span ) ) ;
public class GVRPose { /** * Sets the world position of a root bone and propagates to all children . * This has the effect of moving the overall skeleton to a new position * without affecting the orientation of it ' s bones . * @ param x , y , znew world position of root bone . * @ return true if world position...
Bone bone = mBones [ 0 ] ; float dx = x - bone . WorldMatrix . m30 ( ) ; float dy = y - bone . WorldMatrix . m31 ( ) ; float dz = z - bone . WorldMatrix . m32 ( ) ; sync ( ) ; bone . LocalMatrix . setTranslation ( x , y , z ) ; for ( int i = 0 ; i < mBones . length ; ++ i ) { bone = mBones [ i ] ; bone . WorldMatrix . ...
public class CacheControl { /** * Returns a new { @ link StringBuilder } with the common directives appended . * Note that the first two characters ( { @ code " , " } must be stripped . */ protected final StringBuilder newHeaderValueBuffer ( ) { } }
final StringBuilder buf = new StringBuilder ( 40 ) ; if ( noCache ) { buf . append ( ", no-cache" ) ; } if ( noStore ) { buf . append ( ", no-store" ) ; } if ( noTransform ) { buf . append ( ", no-transform" ) ; } if ( maxAgeSeconds >= 0 ) { buf . append ( ", max-age=" ) . append ( maxAgeSeconds ) ; } return buf ;
public class AmazonElasticLoadBalancingClient { /** * Adds the specified Availability Zones to the set of Availability Zones for the specified load balancer in * EC2 - Classic or a default VPC . * For load balancers in a non - default VPC , use < a > AttachLoadBalancerToSubnets < / a > . * The load balancer evenl...
request = beforeClientExecution ( request ) ; return executeEnableAvailabilityZonesForLoadBalancer ( request ) ;
public class CQLTranslator { /** * Build where clause with given clause . * @ param builder * the builder * @ param fieldClazz * the field clazz * @ param field * the field * @ param value * the value * @ param clause * the clause * @ param useToken * the use token */ public void buildWhereClaus...
builder = onWhereClause ( builder , fieldClazz , field , value , clause , useToken ) ; builder . append ( AND_CLAUSE ) ;
public class PartyRole { /** * Sets the value of the primaryRolePlayer property . * @ param value * allowed object is { @ link com . ibm . wsspi . security . wim . model . RolePlayer } */ public void setPrimaryRolePlayer ( com . ibm . wsspi . security . wim . model . RolePlayer value ) { } }
this . primaryRolePlayer = value ;
public class A_CmsListDialog { /** * Stores the given object as " list object " for the given list dialog in the current users session . < p > * @ param listDialog the list dialog class * @ param listObject the list to store */ public void setListObject ( Class < ? > listDialog , CmsHtmlList listObject ) { } }
if ( listObject == null ) { // null object : remove the entry from the map getListObjectMap ( getSettings ( ) ) . remove ( listDialog . getName ( ) ) ; } else { if ( ( listObject . getMetadata ( ) != null ) && listObject . getMetadata ( ) . isVolatile ( ) ) { listObject . setMetadata ( null ) ; } getListObjectMap ( get...
public class MariaDbConnection { /** * < p > Undoes all changes made after the given < code > Savepoint < / code > object was set . < / p > * < p > This method should be used only when auto - commit has been disabled . < / p > * @ param savepoint the < code > Savepoint < / code > object to roll back to * @ throws...
try ( Statement st = createStatement ( ) ) { st . execute ( "ROLLBACK TO SAVEPOINT " + savepoint . toString ( ) ) ; }
public class Main { /** * Read file or url specified by < tt > path < / tt > . * @ return file or url content as < tt > byte [ ] < / tt > or as < tt > String < / tt > if * < tt > convertToString < / tt > is true . */ private static Object readFileOrUrl ( String path , boolean convertToString ) throws IOException { ...
return SourceReader . readFileOrUrl ( path , convertToString , shellContextFactory . getCharacterEncoding ( ) ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link TopoPointPropertyType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link TopoPointPropertyType } { ...
return new JAXBElement < TopoPointPropertyType > ( _TopoPointProperty_QNAME , TopoPointPropertyType . class , null , value ) ;
public class HINReader { /** * Private method that actually parses the input to read a ChemFile * object . In its current state it is able to read all the molecules * ( if more than one is present ) in the specified HIN file . These are * placed in a MoleculeSet object which in turn is placed in a ChemModel * w...
IChemSequence chemSequence = file . getBuilder ( ) . newInstance ( IChemSequence . class ) ; IChemModel chemModel = file . getBuilder ( ) . newInstance ( IChemModel . class ) ; IAtomContainerSet setOfMolecules = file . getBuilder ( ) . newInstance ( IAtomContainerSet . class ) ; String info ; StringTokenizer tokenizer ...
public class PDFBoxTree { /** * Updates the font table by adding new fonts used at the current page . */ protected void updateFontTable ( ) { } }
PDResources resources = pdpage . getResources ( ) ; if ( resources != null ) { try { processFontResources ( resources , fontTable ) ; } catch ( IOException e ) { log . error ( "Error processing font resources: " + "Exception: {} {}" , e . getMessage ( ) , e . getClass ( ) ) ; } }