signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TextHandler { /** * 构建 ' < text > < / text > ' 标签中sqlInfo中的SQL文本信息 , 如果有非文本节点则抛出异常 .
* 即text节点中的内容不能包含其他标签
* @ param node xml标签节点 */
@ SuppressWarnings ( "unchecked" ) private void concatSqlText ( Node node , SqlInfo sqlInfo ) { } } | // 获取所有子节点 , 并分别将其使用StringBuilder拼接起来
List < Node > nodes = node . selectNodes ( ZealotConst . ATTR_CHILD ) ; for ( Node n : nodes ) { if ( ZealotConst . NODETYPE_TEXT . equals ( n . getNodeTypeName ( ) ) ) { // 如果子节点node 是文本节点 , 则直接获取其文本
sqlInfo . getJoin ( ) . append ( n . getText ( ) ) ; } else { throw new ContainXmlTagException ( "<text></text>标签中不能包含其他xml标签,只能是文本元素!" ) ; } } |
public class CssFormatter { /** * Release an output and delete it . */
void freeOutput ( ) { } } | state . pool . free ( output ) ; output = outputs . size ( ) > 0 ? outputs . removeLast ( ) : null ; |
public class CreateJobOutputMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateJobOutput createJobOutput , ProtocolMarshaller protocolMarshaller ) { } } | if ( createJobOutput == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createJobOutput . getKey ( ) , KEY_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getThumbnailPattern ( ) , THUMBNAILPATTERN_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getThumbnailEncryption ( ) , THUMBNAILENCRYPTION_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getRotate ( ) , ROTATE_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getPresetId ( ) , PRESETID_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getSegmentDuration ( ) , SEGMENTDURATION_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getWatermarks ( ) , WATERMARKS_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getAlbumArt ( ) , ALBUMART_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getComposition ( ) , COMPOSITION_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getCaptions ( ) , CAPTIONS_BINDING ) ; protocolMarshaller . marshall ( createJobOutput . getEncryption ( ) , ENCRYPTION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ProfileNode { /** * Generates a string giving timing information for this single node , including
* total milliseconds spent on the piece of ink , the time spent within itself
* ( v . s . spent in children ) , as well as the number of samples ( instruction steps )
* recorded for both too .
* @ return The own report . */
public String getOwnReport ( ) { } } | StringBuilder sb = new StringBuilder ( ) ; sb . append ( "total " ) ; sb . append ( Profiler . formatMillisecs ( totalMillisecs ) ) ; sb . append ( ", self " ) ; sb . append ( Profiler . formatMillisecs ( selfMillisecs ) ) ; sb . append ( " (" ) ; sb . append ( selfSampleCount ) ; sb . append ( " self samples, " ) ; sb . append ( totalSampleCount ) ; sb . append ( " total)" ) ; return sb . toString ( ) ; |
public class FarmHashFingerprint64 { /** * Compute an 8 - byte hash of a byte array of length greater than 64 bytes . */
private static long hashLength65Plus ( byte [ ] bytes , int offset , int length ) { } } | final int seed = 81 ; // For strings over 64 bytes we loop . Internal state consists of 56 bytes : v , w , x , y , and z .
long x = seed ; // @ SuppressWarnings ( " ConstantOverflow " )
long y = seed * K1 + 113 ; long z = shiftMix ( y * K2 + 113 ) * K2 ; long [ ] v = new long [ 2 ] , w = new long [ 2 ] ; x = x * K2 + load64 ( bytes , offset ) ; // Set end so that after the loop we have 1 to 64 bytes left to process .
int end = offset + ( ( length - 1 ) / 64 ) * 64 ; int last64offset = end + ( ( length - 1 ) & 63 ) - 63 ; do { x = rotateRight ( x + y + v [ 0 ] + load64 ( bytes , offset + 8 ) , 37 ) * K1 ; y = rotateRight ( y + v [ 1 ] + load64 ( bytes , offset + 48 ) , 42 ) * K1 ; x ^= w [ 1 ] ; y += v [ 0 ] + load64 ( bytes , offset + 40 ) ; z = rotateRight ( z + w [ 0 ] , 33 ) * K1 ; weakHashLength32WithSeeds ( bytes , offset , v [ 1 ] * K1 , x + w [ 0 ] , v ) ; weakHashLength32WithSeeds ( bytes , offset + 32 , z + w [ 1 ] , y + load64 ( bytes , offset + 16 ) , w ) ; long tmp = x ; x = z ; z = tmp ; offset += 64 ; } while ( offset != end ) ; long mul = K1 + ( ( z & 0xFF ) << 1 ) ; // Operate on the last 64 bytes of input .
offset = last64offset ; w [ 0 ] += ( ( length - 1 ) & 63 ) ; v [ 0 ] += w [ 0 ] ; w [ 0 ] += v [ 0 ] ; x = rotateRight ( x + y + v [ 0 ] + load64 ( bytes , offset + 8 ) , 37 ) * mul ; y = rotateRight ( y + v [ 1 ] + load64 ( bytes , offset + 48 ) , 42 ) * mul ; x ^= w [ 1 ] * 9 ; y += v [ 0 ] * 9 + load64 ( bytes , offset + 40 ) ; z = rotateRight ( z + w [ 0 ] , 33 ) * mul ; weakHashLength32WithSeeds ( bytes , offset , v [ 1 ] * mul , x + w [ 0 ] , v ) ; weakHashLength32WithSeeds ( bytes , offset + 32 , z + w [ 1 ] , y + load64 ( bytes , offset + 16 ) , w ) ; return hashLength16 ( hashLength16 ( v [ 0 ] , w [ 0 ] , mul ) + shiftMix ( y ) * K0 + x , hashLength16 ( v [ 1 ] , w [ 1 ] , mul ) + z , mul ) ; |
public class ValueRange { /** * Checks that the specified value is valid and fits in an { @ code int } .
* This validates that the value is within the valid range of values and that
* all valid values are within the bounds of an { @ code int } .
* The field is only used to improve the error message .
* @ param value the value to check
* @ param field the field being checked , may be null
* @ return the value that was passed in
* @ see # isValidIntValue ( long ) */
public int checkValidIntValue ( long value , TemporalField field ) { } } | if ( isValidIntValue ( value ) == false ) { throw new DateTimeException ( genInvalidFieldMessage ( field , value ) ) ; } return ( int ) value ; |
public class FileUtil { /** * 读取文件内容
* @ param file 文件
* @ param charset 字符集
* @ return 内容
* @ throws IORuntimeException IO异常 */
public static String readString ( File file , Charset charset ) throws IORuntimeException { } } | return FileReader . create ( file , charset ) . readString ( ) ; |
public class ScriptProxy { /** * backward sikinti */
public Map addForwarding ( Map params ) throws Exception { } } | CreateForwardingRulePayload payload = new CreateForwardingRulePayload ( ) ; payload . setFromUser ( parseUserMetaBackwardsCompatible ( params . get ( OpsGenieClientConstants . API . FROM_USER ) ) ) ; payload . setToUser ( parseUserMetaBackwardsCompatible ( params . get ( OpsGenieClientConstants . API . TO_USER ) ) ) ; payload . setStartDate ( ScriptBridgeUtils . getAsDateTime ( params , OpsGenieClientConstants . API . START_DATE ) ) ; payload . setEndDate ( ScriptBridgeUtils . getAsDateTime ( params , OpsGenieClientConstants . API . END_DATE ) ) ; payload . setAlias ( ScriptBridgeUtils . getAsString ( params , OpsGenieClientConstants . API . ALIAS ) ) ; return JsonUtils . toMap ( forwardingRuleApi . createForwardingRule ( payload ) ) ; |
public class SelectOption { /** * Process the end of this tag .
* @ throws JspException if a JSP exception has occurred */
public int doEndTag ( ) throws JspException { } } | String scriptId = null ; ServletRequest req = pageContext . getRequest ( ) ; if ( ( hasErrors ( ) ) || _hasError ) { localRelease ( ) ; return EVAL_PAGE ; } // the parent was validated in the doStartTag call
Tag parentTag = getParent ( ) ; while ( ! ( parentTag instanceof Select ) ) { parentTag = parentTag . getParent ( ) ; } assert ( parentTag instanceof Select ) ; Select parentSelect = ( Select ) parentTag ; if ( parentSelect . isRepeater ( ) ) { if ( ! isRenderable ( parentSelect ) ) return EVAL_PAGE ; } // Generate an HTML < option > element
// InternalStringBuilder results = new InternalStringBuilder ( 128 ) ;
_state . value = _value ; // we assume that tagId will over have override id if both
// are defined .
if ( _state . id != null ) { scriptId = renderNameAndId ( ( HttpServletRequest ) req , _state , null ) ; } _state . disabled = _disabled ; if ( parentSelect . isMatched ( _value ) ) _state . selected = true ; WriteRenderAppender writer = new WriteRenderAppender ( pageContext ) ; TagRenderingBase br = TagRenderingBase . Factory . getRendering ( TagRenderingBase . OPTION_TAG , req ) ; br . doStartTag ( writer , _state ) ; if ( _text == null ) write ( parentSelect . formatText ( _value ) ) ; else { // @ TODO : How should we report errors
write ( parentSelect . formatText ( _text ) ) ; } br . doEndTag ( writer ) ; parentSelect . addOptionToList ( _value ) ; if ( scriptId != null ) write ( scriptId ) ; // Continue evaluating this page
localRelease ( ) ; return EVAL_PAGE ; |
public class Expect4j { /** * An internal helper function that converts the input buffer into a
* printable < code > String < / code > .
* @ return the input buffer as a printable < code > String < / code > */
protected String printBuffer ( ) { } } | String javaStr = new String ( input . getBuffer ( ) ) ; javaStr = javaStr . replaceAll ( "\\r" , "\\\\r" ) ; javaStr = javaStr . replaceAll ( "\\n" , "\\\\n" ) ; return javaStr ; |
public class LiAvroDeserializerBase { /** * Configure this class .
* @ param configs configs in key / value pairs
* @ param isKey whether is for key or value */
public void configure ( Map < String , ? > configs , boolean isKey ) { } } | Preconditions . checkArgument ( isKey == false , "LiAvroDeserializer only works for value fields" ) ; _datumReader = new GenericDatumReader < > ( ) ; Properties props = new Properties ( ) ; for ( Map . Entry < String , ? > entry : configs . entrySet ( ) ) { String value = String . valueOf ( entry . getValue ( ) ) ; props . setProperty ( entry . getKey ( ) , value ) ; } _schemaRegistry = KafkaSchemaRegistryFactory . getSchemaRegistry ( props ) ; |
public class JDBCResultSet { /** * < ! - - start generic documentation - - >
* Gives a hint as to the direction in which the rows in this
* < code > ResultSet < / code > object will be processed .
* The initial value is determined by the
* < code > Statement < / code > object
* that produced this < code > ResultSet < / code > object .
* The fetch direction may be changed at any time .
* < ! - - end generic documentation - - >
* < ! - - start release - specific documentation - - >
* < div class = " ReleaseSpecificDocumentation " >
* < h3 > HSQLDB - Specific Information : < / h3 > < p >
* HSQLDB does not need this hint . However , as mandated by the JDBC standard ,
* an SQLException is thrown if the result set type is TYPE _ FORWARD _ ONLY
* and a fetch direction other than FETCH _ FORWARD is requested . < p >
* < / div >
* < ! - - end release - specific documentation - - >
* @ param direction an < code > int < / code > specifying the suggested
* fetch direction ; one of < code > ResultSet . FETCH _ FORWARD < / code > ,
* < code > ResultSet . FETCH _ REVERSE < / code > , or
* < code > ResultSet . FETCH _ UNKNOWN < / code >
* @ exception SQLException if a database access error occurs ; this
* method is called on a closed result set or
* the result set type is < code > TYPE _ FORWARD _ ONLY < / code > and the fetch
* direction is not < code > FETCH _ FORWARD < / code >
* @ since JDK 1.2 ( JDK 1.1 . x developers : read the overview for
* JDBCResultSet )
* @ see JDBCStatement # setFetchDirection
* @ see # getFetchDirection */
public void setFetchDirection ( int direction ) throws SQLException { } } | checkClosed ( ) ; switch ( direction ) { case FETCH_FORWARD : { break ; } case FETCH_REVERSE : { checkNotForwardOnly ( ) ; break ; } case FETCH_UNKNOWN : { checkNotForwardOnly ( ) ; break ; } default : { throw Util . notSupported ( ) ; } } |
public class HiveRegistrationUnitComparator { /** * Compare an existing value and a new value , and set { @ link # result } accordingly .
* This method returns false if newValue is absent ( i . e . , the existing value doesn ' t need to be updated ) .
* This is because when adding a table / partition to Hive , Hive automatically sets default values for
* some of the unspecified parameters . Therefore existingValue being present and newValue being absent
* doesn ' t mean the existing value needs to be updated . */
protected < E > void compare ( Optional < E > existingValue , Optional < E > newValue ) { } } | boolean different ; if ( ! newValue . isPresent ( ) ) { different = false ; } else { different = ! existingValue . isPresent ( ) || ! existingValue . get ( ) . equals ( newValue . get ( ) ) ; } this . result |= different ; |
public class CssSkinGenerator { /** * Returns the skin root dir of the path given in parameter
* @ param path
* the resource path
* @ param skinRootDirs
* the set of skin root directories
* @ return the skin root dir */
public String getSkinRootDir ( String path , Set < String > skinRootDirs ) { } } | String skinRootDir = null ; for ( String skinDir : skinRootDirs ) { if ( path . startsWith ( skinDir ) ) { skinRootDir = skinDir ; } } return skinRootDir ; |
public class BoUtils { /** * De - serialize a BO from byte array .
* @ param bytes
* the byte array obtained from { @ link # toBytes ( BaseBo ) }
* @ param clazz
* @ param classLoader
* @ return
* @ since 0.6.0.3 */
@ SuppressWarnings ( "unchecked" ) public static < T extends BaseBo > T fromBytes ( byte [ ] bytes , Class < T > clazz , ClassLoader classLoader ) { } } | if ( bytes == null || clazz == null ) { return null ; } try { Map < String , Object > data = SerializationUtils . fromByteArray ( bytes , Map . class ) ; String boClassName = DPathUtils . getValue ( data , FIELD_CLASSNAME , String . class ) ; T bo = createObject ( boClassName , classLoader , clazz ) ; if ( bo != null ) { bo . fromByteArray ( DPathUtils . getValue ( data , FIELD_BODATA , byte [ ] . class ) ) ; return bo ; } else { return null ; } } catch ( Exception e ) { throw e instanceof DeserializationException ? ( DeserializationException ) e : new DeserializationException ( e ) ; } |
public class ExcelSaxUtil { /** * 计算两个单元格之间的单元格数目 ( 同一行 )
* @ param preRef 前一个单元格位置 , 例如A1
* @ param ref 当前单元格位置 , 例如A8
* @ return 同一行中两个单元格之间的空单元格数 */
public static int countNullCell ( String preRef , String ref ) { } } | // excel2007最大行数是1048576 , 最大列数是16384 , 最后一列列名是XFD
// 数字代表列 , 去掉列信息
String preXfd = StrUtil . nullToDefault ( preRef , "@" ) . replaceAll ( "\\d+" , "" ) ; String xfd = StrUtil . nullToDefault ( ref , "@" ) . replaceAll ( "\\d+" , "" ) ; // A表示65 , @ 表示64 , 如果A算作1 , 那 @ 代表0
// 填充最大位数3
preXfd = StrUtil . fillBefore ( preXfd , CELL_FILL_CHAR , MAX_CELL_BIT ) ; xfd = StrUtil . fillBefore ( xfd , CELL_FILL_CHAR , MAX_CELL_BIT ) ; char [ ] preLetter = preXfd . toCharArray ( ) ; char [ ] letter = xfd . toCharArray ( ) ; // 用字母表示则最多三位 , 每26个字母进一位
int res = ( letter [ 0 ] - preLetter [ 0 ] ) * 26 * 26 + ( letter [ 1 ] - preLetter [ 1 ] ) * 26 + ( letter [ 2 ] - preLetter [ 2 ] ) ; return res - 1 ; |
public class ElementsExceptionsFactory { /** * Constructs and initializes a new { @ link UserException } with the given { @ link Throwable cause }
* and { @ link String message } formatted with the given { @ link Object [ ] arguments } .
* @ param cause { @ link Throwable } identified as the reason this { @ link UserException } was thrown .
* @ param message { @ link String } describing the { @ link UserException exception } .
* @ param args { @ link Object [ ] arguments } used to replace format placeholders in the { @ link String message } .
* @ return a new { @ link UserException } with the given { @ link Throwable cause } and { @ link String message } .
* @ see org . cp . elements . util . UserException */
public static UserException newUserException ( Throwable cause , String message , Object ... args ) { } } | return new UserException ( format ( message , args ) , cause ) ; |
public class Server { /** * Creates an { @ link OAuth2Credentials } object that can be used by any of the servlets .
* Throws an { @ throws IOException } when no client ID or secret found in secrets . properties */
static OAuth2Credentials createOAuth2Credentials ( SessionConfiguration config ) throws IOException { } } | return new OAuth2Credentials . Builder ( ) . setCredentialDataStoreFactory ( MemoryDataStoreFactory . getDefaultInstance ( ) ) . setRedirectUri ( config . getRedirectUri ( ) ) . setScopes ( config . getScopes ( ) ) . setClientSecrets ( config . getClientId ( ) , config . getClientSecret ( ) ) . build ( ) ; |
public class Quaternion { /** * Replies the rotation axis represented by this quaternion .
* @ return the rotation axis
* @ see # setAxisAngle ( Vector3D , double )
* @ see # setAxisAngle ( double , double , double , double )
* @ see # getAngle ( ) */
@ SuppressWarnings ( "synthetic-access" ) @ Pure public final AxisAngle getAxisAngle ( ) { } } | double mag = this . x * this . x + this . y * this . y + this . z * this . z ; if ( mag > EPS ) { mag = Math . sqrt ( mag ) ; double invMag = 1f / mag ; return new AxisAngle ( this . x * invMag , this . y * invMag , this . z * invMag , ( 2. * Math . atan2 ( mag , this . w ) ) ) ; } return new AxisAngle ( 0 , 0 , 1 , 0 ) ; |
public class Observable { /** * Subscribes to the current Observable and wraps the given Observer into a SafeObserver
* ( if not already a SafeObserver ) that
* deals with exceptions thrown by a misbehaving Observer ( that doesn ' t follow the
* Reactive - Streams specification ) .
* < dl >
* < dt > < b > Scheduler : < / b > < / dt >
* < dd > { @ code safeSubscribe } does not operate by default on a particular { @ link Scheduler } . < / dd >
* < / dl >
* @ param observer the incoming Observer instance
* @ throws NullPointerException if s is null */
@ SchedulerSupport ( SchedulerSupport . NONE ) public final void safeSubscribe ( Observer < ? super T > observer ) { } } | ObjectHelper . requireNonNull ( observer , "s is null" ) ; if ( observer instanceof SafeObserver ) { subscribe ( observer ) ; } else { subscribe ( new SafeObserver < T > ( observer ) ) ; } |
public class BinaryHeapPriorityQueue { /** * Changes a priority , either up or down , adding the key it if it wasn ' t there already .
* @ param key an < code > Object < / code > value
* @ return whether the priority actually changed . */
public boolean changePriority ( E key , double priority ) { } } | Entry < E > entry = getEntry ( key ) ; if ( entry == null ) { entry = makeEntry ( key ) ; } if ( compare ( priority , entry . priority ) == 0 ) { return false ; } entry . priority = priority ; heapify ( entry ) ; return true ; |
public class JvmInnerTypeReferenceImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case TypesPackage . JVM_INNER_TYPE_REFERENCE__OUTER : return outer != null ; } return super . eIsSet ( featureID ) ; |
public class CompositesIndex { /** * Check SecondaryIndex . getIndexComparator if you want to know why this is static */
public static CellNameType getIndexComparator ( CFMetaData baseMetadata , ColumnDefinition cfDef ) { } } | if ( cfDef . type . isCollection ( ) && cfDef . type . isMultiCell ( ) ) { switch ( ( ( CollectionType ) cfDef . type ) . kind ) { case LIST : return CompositesIndexOnCollectionValue . buildIndexComparator ( baseMetadata , cfDef ) ; case SET : return CompositesIndexOnCollectionKey . buildIndexComparator ( baseMetadata , cfDef ) ; case MAP : return cfDef . hasIndexOption ( SecondaryIndex . INDEX_KEYS_OPTION_NAME ) ? CompositesIndexOnCollectionKey . buildIndexComparator ( baseMetadata , cfDef ) : CompositesIndexOnCollectionValue . buildIndexComparator ( baseMetadata , cfDef ) ; } } switch ( cfDef . kind ) { case CLUSTERING_COLUMN : return CompositesIndexOnClusteringKey . buildIndexComparator ( baseMetadata , cfDef ) ; case REGULAR : return CompositesIndexOnRegular . buildIndexComparator ( baseMetadata , cfDef ) ; case PARTITION_KEY : return CompositesIndexOnPartitionKey . buildIndexComparator ( baseMetadata , cfDef ) ; // case COMPACT _ VALUE :
// return CompositesIndexOnCompactValue . buildIndexComparator ( baseMetadata , cfDef ) ;
} throw new AssertionError ( ) ; |
public class GenerateEntityFileNameTask { /** * / * ( non - Javadoc )
* @ see org . danann . cernunnos . Phrase # evaluate ( org . danann . cernunnos . TaskRequest , org . danann . cernunnos . TaskResponse ) */
@ Override public void perform ( TaskRequest req , TaskResponse res ) { } } | final Element rootElement = ( Element ) entityElement . evaluate ( req , res ) ; final IUserLayoutStore rdbmdls = ( IUserLayoutStore ) layoutStore . evaluate ( req , res ) ; SupportedFileTypes y = SupportedFileTypes . getApplicableFileType ( rootElement , rdbmdls ) ; String entityFileName = y . getSafeFileNameWithExtension ( rootElement ) ; ReturnValue rslt = ( ReturnValue ) req . getAttribute ( Attributes . RETURN_VALUE ) ; rslt . setValue ( entityFileName ) ; |
public class ClassParser { /** * Check that a constant pool index is valid .
* @ param index
* the index to check
* @ throws InvalidClassFileFormatException
* if the index is not valid */
private void checkConstantPoolIndex ( int index ) throws InvalidClassFileFormatException { } } | if ( index < 0 || index >= constantPool . length || constantPool [ index ] == null ) { throw new InvalidClassFileFormatException ( expectedClassDescriptor , codeBaseEntry ) ; } |
public class BioCDocumentReader { /** * Reads one BioC document from the XML file .
* @ return the BioC document
* @ throws XMLStreamException if an unexpected processing error occurs */
public BioCDocument readDocument ( ) throws XMLStreamException { } } | if ( reader . document != null ) { BioCDocument thisDocument = reader . document ; reader . read ( ) ; return thisDocument ; } else { return null ; } |
public class PeriodicSubscriptionQos { /** * Set the alertAfterInterval in milliseconds . < br >
* If no notification was received within the last alert interval , a missed
* publication notification will be raised . < br >
* < br >
* < b > Minimum , Maximum , and Default Values : < / b >
* < ul >
* < li > The absolute < b > minimum < / b > setting is the period value . < br >
* Any value less than period will be replaced by the period setting .
* < li > The absolute < b > maximum < / b > setting is 2.592.000.000 milliseconds ( 30 days ) . < br >
* Any value bigger than this maximum will be treated at the absolute maximum setting of
* 2.592.000.000 milliseconds .
* < li > < b > Default < / b > setting : 0 milliseconds ( no alert ) .
* ( no alert ) .
* < / ul >
* Use { @ link # clearAlertAfterInterval ( ) } to remove missed publication notifications .
* @ param alertAfterIntervalMs
* If more than alertInterval _ ms pass without receiving a message ,
* subscriptionManager will issue a publication missed .
* @ see # clearAlertAfterInterval ( )
* @ return this ( fluent interface ) . */
public PeriodicSubscriptionQos setAlertAfterIntervalMs ( final long alertAfterIntervalMs ) { } } | if ( alertAfterIntervalMs > MAX_ALERT_AFTER_INTERVAL_MS ) { this . alertAfterIntervalMs = MAX_ALERT_AFTER_INTERVAL_MS ; logger . warn ( "alertAfterInterval_ms > MAX_ALERT_AFTER_INTERVAL_MS. Using MAX_ALERT_AFTER_INTERVAL_MS: {}" , MAX_ALERT_AFTER_INTERVAL_MS ) ; } else { this . alertAfterIntervalMs = alertAfterIntervalMs ; } if ( this . alertAfterIntervalMs != NO_ALERT_AFTER_INTERVAL && this . alertAfterIntervalMs < periodMs ) { this . alertAfterIntervalMs = periodMs ; logger . warn ( "alertAfterInterval_ms < MIN_ALERT_AFTER_INTERVAL and will therefore be set to the period: {}" , periodMs ) ; } return this ; |
public class Envelope2D { /** * Checks if this envelope intersects the other assuming neither one is empty .
* @ param other The other envelope .
* @ return True if this envelope intersects the other . Assumes this and
* other envelopes are not empty . */
public boolean isIntersectingNE ( Envelope2D other ) { } } | return ( ( xmin <= other . xmin ) ? xmax >= other . xmin : other . xmax >= xmin ) && // check that x projections overlap
( ( ymin <= other . ymin ) ? ymax >= other . ymin : other . ymax >= ymin ) ; // check
// that
// projections
// overlap |
public class DatabaseSpec { /** * Checks if a MongoDB database contains a table .
* @ param database
* @ param tableName */
@ Then ( "^a Mongo dataBase '(.+?)' doesnt contains a table '(.+?)'$" ) public void aMongoDataBaseContainsaTable ( String database , String tableName ) { } } | commonspec . getMongoDBClient ( ) . connectToMongoDBDataBase ( database ) ; Set < String > collectionsNames = commonspec . getMongoDBClient ( ) . getMongoDBCollections ( ) ; assertThat ( collectionsNames ) . as ( "The Mongo dataBase contains the table" ) . doesNotContain ( tableName ) ; |
public class BosClient { /** * Returns a pre - signed URL for accessing a Bos resource .
* @ param bucketName The name of the bucket containing the desired object .
* @ param key The key in the specified bucket under which the desired object is stored .
* @ param expirationInSeconds The expiration after which the returned pre - signed URL will expire .
* @ return A pre - signed URL which expires at the specified time , and can be
* used to allow anyone to download the specified object from Bos ,
* without exposing the owner ' s Bce secret access key . */
public URL generatePresignedUrl ( String bucketName , String key , int expirationInSeconds ) { } } | return this . generatePresignedUrl ( bucketName , key , expirationInSeconds , HttpMethodName . GET ) ; |
public class ApiOvhEmaildomain { /** * Change filter activity
* REST : POST / email / domain / delegatedAccount / { email } / filter / { name } / changeActivity
* @ param activity [ required ] New activity
* @ param email [ required ] Email
* @ param name [ required ] Filter name */
public OvhTaskFilter delegatedAccount_email_filter_name_changeActivity_POST ( String email , String name , Boolean activity ) throws IOException { } } | String qPath = "/email/domain/delegatedAccount/{email}/filter/{name}/changeActivity" ; StringBuilder sb = path ( qPath , email , name ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "activity" , activity ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTaskFilter . class ) ; |
public class Expression { /** * Create a { @ link Expression . PositionFactory } for an optional expression . A position created from such a factory
* will silently swallow a { @ link PropertyNotFoundException } and return { @ code null } as its value .
* @ param expr
* @ return { @ link PositionFactory } */
public static < T > PositionFactory < T > optional ( String expr ) { } } | final boolean optional = true ; return new PositionFactory < > ( Validate . notEmpty ( expr , "expr" ) , optional ) ; |
public class PcpMmvWriter { /** * Writes out a PCP MMV table - of - contents block .
* @ param dataFileBuffer
* ByteBuffer positioned at the correct offset in the file for the block
* @ param tocType
* the type of TOC block to write
* @ param entryCount
* the number of blocks of type tocType to be found in the file
* @ param firstEntryOffset
* the offset of the first tocType block , relative to start of the file */
private void writeToc ( ByteBuffer dataFileBuffer , TocType tocType , int entryCount , int firstEntryOffset ) { } } | dataFileBuffer . putInt ( tocType . identifier ) ; dataFileBuffer . putInt ( entryCount ) ; dataFileBuffer . putLong ( firstEntryOffset ) ; |
public class ServiceRequestHandler { /** * Default format is now JSON . */
protected Format getFormat ( Map < String , String > metaInfo ) { } } | Format format = Format . json ; metaInfo . put ( Listener . METAINFO_CONTENT_TYPE , Listener . CONTENT_TYPE_JSON ) ; String formatParam = ( String ) metaInfo . get ( "format" ) ; if ( formatParam != null ) { if ( formatParam . equals ( "xml" ) ) { format = Format . xml ; metaInfo . put ( Listener . METAINFO_CONTENT_TYPE , Listener . CONTENT_TYPE_XML ) ; } else if ( formatParam . equals ( "text" ) ) { format = Format . text ; metaInfo . put ( Listener . METAINFO_CONTENT_TYPE , Listener . CONTENT_TYPE_TEXT ) ; } } else { if ( Listener . CONTENT_TYPE_XML . equals ( metaInfo . get ( Listener . METAINFO_CONTENT_TYPE ) ) || Listener . CONTENT_TYPE_XML . equals ( metaInfo . get ( Listener . METAINFO_CONTENT_TYPE . toLowerCase ( ) ) ) ) { format = Format . xml ; metaInfo . put ( Listener . METAINFO_CONTENT_TYPE , Listener . CONTENT_TYPE_XML ) ; } else if ( Listener . CONTENT_TYPE_TEXT . equals ( metaInfo . get ( Listener . METAINFO_CONTENT_TYPE ) ) || Listener . CONTENT_TYPE_TEXT . equals ( metaInfo . get ( Listener . METAINFO_CONTENT_TYPE . toLowerCase ( ) ) ) ) { format = Format . text ; metaInfo . put ( Listener . METAINFO_CONTENT_TYPE , Listener . CONTENT_TYPE_JSON ) ; } } return format ; |
public class EitherT { /** * { @ inheritDoc } */
@ Override public < R2 > Lazy < EitherT < M , L , R2 > > lazyZip ( Lazy < ? extends Applicative < Function < ? super R , ? extends R2 > , MonadT < M , Either < L , ? > , ? > > > lazyAppFn ) { } } | return new Compose < > ( melr ) . lazyZip ( lazyAppFn . fmap ( maybeT -> new Compose < > ( maybeT . < EitherT < M , L , Function < ? super R , ? extends R2 > > > coerce ( ) . < Either < L , Function < ? super R , ? extends R2 > > , Monad < Either < L , Function < ? super R , ? extends R2 > > , M > > run ( ) ) ) ) . fmap ( compose -> eitherT ( compose . getCompose ( ) ) ) ; |
public class EmbeddableRegisteredResources { /** * Informs the caller if a single 1PC CAPABLE resource is enlisted in this unit of work . */
@ Override public boolean isOnlyAgent ( ) { } } | final boolean result = ( _resourceObjects . size ( ) == 1 && _resourceObjects . get ( 0 ) instanceof ResourceSupportsOnePhaseCommit && ( _asyncResourceObjects == null || _asyncResourceObjects . size ( ) == 0 ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "isOnlyAgent" , result ) ; return result ; |
public class HomeHandleImpl { /** * p113380 - rewrite entire method of product interoperability . */
private void readObject ( java . io . ObjectInputStream in ) throws IOException , ClassNotFoundException { } } | in . defaultReadObject ( ) ; byte [ ] tempEyeCatcher = new byte [ Constants . EYE_CATCHER_LENGTH ] ; // d164415 start
int bytesRead = 0 ; for ( int offset = 0 ; offset < Constants . EYE_CATCHER_LENGTH ; offset += bytesRead ) { bytesRead = in . read ( tempEyeCatcher , offset , Constants . EYE_CATCHER_LENGTH - offset ) ; if ( bytesRead == - 1 ) { throw new IOException ( "end of input stream while reading eye catcher" ) ; } } // d164415 end
for ( int i = 0 ; i < EYECATCHER . length ; i ++ ) { if ( tempEyeCatcher [ i ] != EYECATCHER [ i ] ) { String eyeCatcherString = new String ( tempEyeCatcher ) ; throw new IOException ( "Invalid eye catcher '" + eyeCatcherString + "' in handle input stream" ) ; } } // Get websphere platform and version ID from header .
in . readShort ( ) ; // platform
ivActualVersion = in . readShort ( ) ; // d158086 added version checking
if ( ( ivActualVersion != Constants . HOME_HANDLE_V1 ) && ( ivActualVersion != Constants . HOME_HANDLE_V2 ) ) { throw new java . io . InvalidObjectException ( "Home Handle data stream is not of the correct version, this client should be updated." ) ; } // d158086
// Use HandleDelegate object to read in EJBHome object .
// d164668 allow 2nd change for type 1 home handles if stub doesn ' t connect use jndi logic
try { ivEjbHome = HandleHelper . lookupHandleDelegate ( ) . readEJBHome ( in ) ; } catch ( IOException ioe ) { // FFDCFilter . processException ( t , CLASS _ NAME + " readObject " , " 335 " , this ) ;
if ( ivActualVersion != Constants . HOME_HANDLE_V1 ) { throw ioe ; } } if ( ivActualVersion == Constants . HOME_HANDLE_V1 ) { ivInitialContextProperties = ( Properties ) in . readObject ( ) ; ivHomeInterface = in . readUTF ( ) ; ivJndiName = in . readUTF ( ) ; // Null out the reference since we do not have a portable way
// to determine if we got reference from the ORB and the version ID
// indicates this is a non - robust handle . So , we need to force the
// getEJBHome method to get a new reference by doing a JNDI lookup .
ivEjbHome = null ; // p125891
} |
public class ResourceSkusInner { /** * Gets the list of Microsoft . CognitiveServices SKUs available for your Subscription .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; ResourceSkuInner & gt ; object */
public Observable < Page < ResourceSkuInner > > listAsync ( ) { } } | return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < ResourceSkuInner > > , Page < ResourceSkuInner > > ( ) { @ Override public Page < ResourceSkuInner > call ( ServiceResponse < Page < ResourceSkuInner > > response ) { return response . body ( ) ; } } ) ; |
public class KeyValue { /** * Creates a { @ link KeyValue } from a { @ code key } and { @ code value } . The resulting value contains the value .
* @ param key the key . Must not be { @ literal null } .
* @ param value the value . Must not be { @ literal null } .
* @ param < K >
* @ param < T >
* @ param < V >
* @ return the { @ link KeyValue } */
public static < K , T extends V , V > KeyValue < K , V > just ( K key , T value ) { } } | LettuceAssert . notNull ( value , "Value must not be null" ) ; return new KeyValue < K , V > ( key , value ) ; |
public class EntityInfo { /** * Return the list of member chain ids ( asym ids ) that are described by this EntityInfo ,
* only unique chain IDs are contained in the list .
* Note that in the case of multimodel structures this will return just the unique
* chain identifiers whilst { @ link # getChains ( ) } will return a corresponding chain
* per model .
* @ return the list of unique ChainIDs that are described by this EnityInfo
* @ see # setChains ( List )
* @ see # getChains ( ) */
public List < String > getChainIds ( ) { } } | Set < String > uniqChainIds = new TreeSet < > ( ) ; for ( int i = 0 ; i < getChains ( ) . size ( ) ; i ++ ) { uniqChainIds . add ( getChains ( ) . get ( i ) . getId ( ) ) ; } return new ArrayList < > ( uniqChainIds ) ; |
public class DNSSEC { /** * Convert an algorithm number to the corresponding JCA string .
* @ param alg The algorithm number .
* @ throws UnsupportedAlgorithmException The algorithm is unknown . */
public static String algString ( int alg ) throws UnsupportedAlgorithmException { } } | switch ( alg ) { case Algorithm . RSAMD5 : return "MD5withRSA" ; case Algorithm . DSA : case Algorithm . DSA_NSEC3_SHA1 : return "SHA1withDSA" ; case Algorithm . RSASHA1 : case Algorithm . RSA_NSEC3_SHA1 : return "SHA1withRSA" ; case Algorithm . RSASHA256 : return "SHA256withRSA" ; case Algorithm . RSASHA512 : return "SHA512withRSA" ; default : throw new UnsupportedAlgorithmException ( alg ) ; } |
public class Downloader { /** * Check the MD5 of the specified file
* @ param targetMD5 Expected MD5
* @ param file File to check
* @ return True if MD5 matches , false otherwise */
public static boolean checkMD5OfFile ( String targetMD5 , File file ) throws IOException { } } | InputStream in = FileUtils . openInputStream ( file ) ; String trueMd5 = DigestUtils . md5Hex ( in ) ; IOUtils . closeQuietly ( in ) ; return ( targetMD5 . equals ( trueMd5 ) ) ; |
public class OPFItems { /** * Search the item with the given ID .
* @ param id
* the ID of the item to search , can be < code > null < / code > .
* @ return An { @ link Optional } containing the item if found , or
* { @ link Optional # absent ( ) } if not found . */
public Optional < OPFItem > getItemById ( String id ) { } } | return Optional . fromNullable ( itemsById . get ( id ) ) ; |
public class IntBuildingInstallationType { /** * Gets the value of the genericApplicationPropertyOfIntBuildingInstallation property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is why there is not a < CODE > set < / CODE > method for the genericApplicationPropertyOfIntBuildingInstallation property .
* For example , to add a new item , do as follows :
* < pre >
* get _ GenericApplicationPropertyOfIntBuildingInstallation ( ) . add ( newItem ) ;
* < / pre >
* Objects of the following type ( s ) are allowed in the list
* { @ link JAXBElement } { @ code < } { @ link Object } { @ code > }
* { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfIntBuildingInstallation ( ) { } } | if ( _GenericApplicationPropertyOfIntBuildingInstallation == null ) { _GenericApplicationPropertyOfIntBuildingInstallation = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfIntBuildingInstallation ; |
public class ReporterConfigMetadata { /** * Adds an new item to the reporter metadata .
* @ param key
* - A { @ link String } that represents the property name contained in JsonRuntimeReporter file .
* @ param itemType
* - A { @ link String } that represents the ( supported ) type of metadata .
* @ param value
* - A { @ link String } that represents the reader friendly value to be displayed in the SeLion HTML
* Reports . */
public static void addReporterMetadataItem ( String key , String itemType , String value ) { } } | logger . entering ( new Object [ ] { key , itemType , value } ) ; if ( StringUtils . isNotBlank ( value ) && supportedMetaDataProperties . contains ( itemType ) ) { Map < String , String > subMap = reporterMetadata . get ( key ) ; if ( null == subMap ) { subMap = new HashMap < String , String > ( ) ; } subMap . put ( itemType , value ) ; reporterMetadata . put ( key , subMap ) ; } else { String message = "Key/value pair for '" + key + "' for '" + itemType + "' was not inserted into report metadata." ; logger . fine ( message ) ; } |
public class TypeValidator { /** * For a concrete class , expect that all abstract methods that haven ' t been implemented by any of
* the super classes on the inheritance chain are implemented . */
void expectAbstractMethodsImplemented ( Node n , FunctionType ctorType ) { } } | checkArgument ( ctorType . isConstructor ( ) ) ; Map < String , ObjectType > abstractMethodSuperTypeMap = new LinkedHashMap < > ( ) ; FunctionType currSuperCtor = ctorType . getSuperClassConstructor ( ) ; if ( currSuperCtor == null || ! currSuperCtor . isAbstract ( ) ) { return ; } while ( currSuperCtor != null && currSuperCtor . isAbstract ( ) ) { ObjectType superType = currSuperCtor . getInstanceType ( ) ; for ( String prop : currSuperCtor . getInstanceType ( ) . getImplicitPrototype ( ) . getOwnPropertyNames ( ) ) { FunctionType maybeAbstractMethod = superType . findPropertyType ( prop ) . toMaybeFunctionType ( ) ; if ( maybeAbstractMethod != null && maybeAbstractMethod . isAbstract ( ) && ! abstractMethodSuperTypeMap . containsKey ( prop ) ) { abstractMethodSuperTypeMap . put ( prop , superType ) ; } } currSuperCtor = currSuperCtor . getSuperClassConstructor ( ) ; } ObjectType instance = ctorType . getInstanceType ( ) ; for ( Map . Entry < String , ObjectType > entry : abstractMethodSuperTypeMap . entrySet ( ) ) { String method = entry . getKey ( ) ; ObjectType superType = entry . getValue ( ) ; FunctionType abstractMethod = instance . findPropertyType ( method ) . toMaybeFunctionType ( ) ; if ( abstractMethod == null || abstractMethod . isAbstract ( ) ) { String sourceName = n . getSourceFileName ( ) ; sourceName = nullToEmpty ( sourceName ) ; registerMismatch ( instance , superType , report ( JSError . make ( n , ABSTRACT_METHOD_NOT_IMPLEMENTED , method , superType . toString ( ) , instance . toString ( ) ) ) ) ; } } |
public class TimestampUtils { /** * # endif */
private static int skipWhitespace ( char [ ] s , int start ) { } } | int slen = s . length ; for ( int i = start ; i < slen ; i ++ ) { if ( ! Character . isSpace ( s [ i ] ) ) { return i ; } } return slen ; |
public class AbstractBusPrimitive { /** * Fire the event that indicates this object has changed .
* @ param propertyName is the name of the graphical property .
* @ param oldValue is the old value of the property .
* @ param newValue is the new value of the property . */
protected final void firePrimitiveChanged ( String propertyName , Object oldValue , Object newValue ) { } } | final BusChangeEvent event = new BusChangeEvent ( // source of the event
this , // type of the event
BusChangeEventType . change ( getClass ( ) ) , // subobject
this , // index in parent
indexInParent ( ) , propertyName , oldValue , newValue ) ; firePrimitiveChanged ( event ) ; |
public class RemoteServiceProxy { /** * Configures a RequestBuilder to send an RPC request .
* @ param < T > return type for the AsyncCallback
* @ param responseReader instance used to read the return value of the
* invocation
* @ param requestData payload that encodes the addressing and arguments of the
* RPC call
* @ param callback callback handler
* @ return a RequestBuilder object that is ready to have its
* { @ link RequestBuilder # send ( ) } method invoked . */
private < T > RequestBuilder doPrepareRequestBuilderImpl ( ResponseReader responseReader , String methodName , RpcStatsContext statsContext , String requestData , AsyncCallback < T > callback ) { } } | if ( getServiceEntryPoint ( ) == null ) { throw new NoServiceEntryPointSpecifiedException ( ) ; } RequestCallback responseHandler = doCreateRequestCallback ( responseReader , methodName , statsContext , callback ) ; ensureRpcRequestBuilder ( ) ; rpcRequestBuilder . create ( getServiceEntryPoint ( ) ) ; rpcRequestBuilder . setCallback ( responseHandler ) ; // changed code
rpcRequestBuilder . setSync ( isSync ( methodName ) ) ; // changed code
rpcRequestBuilder . setContentType ( RPC_CONTENT_TYPE ) ; rpcRequestBuilder . setRequestData ( requestData ) ; rpcRequestBuilder . setRequestId ( statsContext . getRequestId ( ) ) ; return rpcRequestBuilder . finish ( ) ; |
public class Tokenizer { /** * tokenize based on simple regular expression */
public static String [ ] tokenize ( String input , boolean lowercase ) { } } | String [ ] tokens = input . split ( "\\W" ) ; // lower case
for ( int i = 0 ; i < tokens . length && lowercase ; i ++ ) { tokens [ i ] = tokens [ i ] . toLowerCase ( ) ; } return tokens ; |
public class HttpMessage { /** * Gets the Http request context path .
* @ return the context path */
public String getContextPath ( ) { } } | final Object contextPath = getHeader ( HttpMessageHeaders . HTTP_CONTEXT_PATH ) ; if ( contextPath != null ) { return contextPath . toString ( ) ; } return null ; |
public class ScriptContext { /** * Processes a CSV file .
* @ param csvFile
* the file
* @ param delimiter
* the
* @ param quoteChar
* the quote character ( ' \ 0 ' for no quoting )
* @ param charset
* the character set
* @ param closure
* the { @ link Closure } representing a Groovy block */
@ Cmd public void processCsvFile ( final String csvFile , final String delimiter , final char quoteChar , final Charset charset , final Closure < Void > closure ) { } } | File f = new File ( csvFile ) ; try { config . extractFromArchive ( f , true ) ; checkState ( f . exists ( ) , "CSV file not found: " + f ) ; Reader reader = Files . newReader ( f , charset == null ? defaultCharset : charset ) ; csvDataProcessor . processFile ( reader , delimiter , quoteChar , closure ) ; } catch ( IOException ex ) { throw new IllegalStateException ( "Error reading CSV file: " + f , ex ) ; } |
public class TypeExtractor { /** * Creates type information using a factory if for this type or super types . Returns null otherwise . */
@ SuppressWarnings ( "unchecked" ) private < IN1 , IN2 , OUT > TypeInformation < OUT > createTypeInfoFromFactory ( Type t , ArrayList < Type > typeHierarchy , TypeInformation < IN1 > in1Type , TypeInformation < IN2 > in2Type ) { } } | final ArrayList < Type > factoryHierarchy = new ArrayList < > ( typeHierarchy ) ; final TypeInfoFactory < ? super OUT > factory = getClosestFactory ( factoryHierarchy , t ) ; if ( factory == null ) { return null ; } final Type factoryDefiningType = factoryHierarchy . get ( factoryHierarchy . size ( ) - 1 ) ; // infer possible type parameters from input
final Map < String , TypeInformation < ? > > genericParams ; if ( factoryDefiningType instanceof ParameterizedType ) { genericParams = new HashMap < > ( ) ; final ParameterizedType paramDefiningType = ( ParameterizedType ) factoryDefiningType ; final Type [ ] args = typeToClass ( paramDefiningType ) . getTypeParameters ( ) ; final TypeInformation < ? > [ ] subtypeInfo = createSubTypesInfo ( t , paramDefiningType , factoryHierarchy , in1Type , in2Type , true ) ; assert subtypeInfo != null ; for ( int i = 0 ; i < subtypeInfo . length ; i ++ ) { genericParams . put ( args [ i ] . toString ( ) , subtypeInfo [ i ] ) ; } } else { genericParams = Collections . emptyMap ( ) ; } final TypeInformation < OUT > createdTypeInfo = ( TypeInformation < OUT > ) factory . createTypeInfo ( t , genericParams ) ; if ( createdTypeInfo == null ) { throw new InvalidTypesException ( "TypeInfoFactory returned invalid TypeInformation 'null'" ) ; } return createdTypeInfo ; |
public class Relation { /** * Static factory method for relations requiring an argument , including
* HAS _ ITH _ CHILD , ITH _ CHILD _ OF , UNBROKEN _ CATEGORY _ DOMINATES ,
* UNBROKEN _ CATEGORY _ DOMINATED _ BY .
* @ param s The String representation of the relation
* @ param arg The argument to the relation , as a string ; could be a node
* description or an integer
* @ return The singleton static relation of the specified type with the
* specified argument . Uses Interner to insure singleton - ity
* @ throws ParseException If bad relation s */
static Relation getRelation ( String s , String arg , Function < String , String > basicCatFunction , HeadFinder headFinder ) throws ParseException { } } | if ( arg == null ) { return getRelation ( s , basicCatFunction , headFinder ) ; } Relation r ; if ( s . equals ( "<" ) ) { r = new HasIthChild ( Integer . parseInt ( arg ) ) ; } else if ( s . equals ( ">" ) ) { r = new IthChildOf ( Integer . parseInt ( arg ) ) ; } else if ( s . equals ( "<+" ) ) { r = new UnbrokenCategoryDominates ( arg , basicCatFunction ) ; } else if ( s . equals ( ">+" ) ) { r = new UnbrokenCategoryIsDominatedBy ( arg , basicCatFunction ) ; } else if ( s . equals ( ".+" ) ) { r = new UnbrokenCategoryPrecedes ( arg , basicCatFunction ) ; } else if ( s . equals ( ",+" ) ) { r = new UnbrokenCategoryFollows ( arg , basicCatFunction ) ; } else { throw new ParseException ( "Unrecognized compound relation " + s + ' ' + arg ) ; } return Interner . globalIntern ( r ) ; |
public class SparseDataset { /** * Returns an array containing the class labels of the elements in this
* dataset in proper sequence ( from first to last element ) . Unknown labels
* will be saved as Integer . MIN _ VALUE . If the dataset fits in the specified
* array , it is returned therein . Otherwise , a new array is allocated with
* the size of this dataset .
* If the dataset fits in the specified array with room to spare ( i . e . , the
* array has more elements than the dataset ) , the element in the array
* immediately following the end of the dataset is set to Integer . MIN _ VALUE .
* @ param a the array into which the class labels of this dataset are to be
* stored , if it is big enough ; otherwise , a new array is allocated for
* this purpose .
* @ return an array containing the class labels of this dataset . */
public int [ ] toArray ( int [ ] a ) { } } | if ( response == null ) { throw new IllegalArgumentException ( "The dataset has no response values." ) ; } if ( response . getType ( ) != Attribute . Type . NOMINAL ) { throw new IllegalArgumentException ( "The response variable is not nominal." ) ; } int m = data . size ( ) ; if ( a . length < m ) { a = new int [ m ] ; } for ( int i = 0 ; i < m ; i ++ ) { Datum < SparseArray > datum = get ( i ) ; if ( Double . isNaN ( datum . y ) ) { a [ i ] = Integer . MIN_VALUE ; } else { a [ i ] = ( int ) get ( i ) . y ; } } for ( int i = m ; i < a . length ; i ++ ) { a [ i ] = Integer . MIN_VALUE ; } return a ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcBoundaryCurve ( ) { } } | if ( ifcBoundaryCurveEClass == null ) { ifcBoundaryCurveEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 48 ) ; } return ifcBoundaryCurveEClass ; |
public class RabbitMqEventManager { /** * { @ inheritDoc } */
@ Override public void addEvent ( Event event ) { } } | if ( ! initializedProperly ) { throw new IllegalStateException ( getUninitializedMessage ( ) ) ; } String message = gson . toJson ( event ) ; try { RabbitMqUtils . sendMessage ( message , Arrays . asList ( APPSENSOR_ADD_EVENT_QUEUE ) , environment ) ; } catch ( IOException e ) { logger . error ( "Failed to send add event message to output queue." , e ) ; } |
public class PaddingOutputStream { /** * Pads and flushes without closing the underlying stream . */
public void finish ( ) throws IOException { } } | int lastBlockSize = ( int ) ( byteCount % blockSize ) ; if ( lastBlockSize != 0 ) { while ( lastBlockSize < blockSize ) { out . write ( padding ) ; byteCount ++ ; lastBlockSize ++ ; } } out . flush ( ) ; |
public class GoToFilePanel { /** * GEN - LAST : event _ textFieldMaskKeyPressed */
private void listFoundFilesMouseClicked ( java . awt . event . MouseEvent evt ) { } } | // GEN - FIRST : event _ listFoundFilesMouseClicked
if ( evt . getClickCount ( ) > 1 && ! evt . isPopupTrigger ( ) && this . listFoundFiles . getSelectedIndex ( ) >= 0 ) { UiUtils . closeCurrentDialogWithResult ( this , this . dialogOkObject ) ; } |
public class CircularImageView { /** * Sets the border width .
* @ param unit The desired dimension unit .
* @ param size */
public final void setBorderWidth ( int unit , int size ) { } } | if ( size < 0 ) { throw new IllegalArgumentException ( "Border width cannot be less than zero." ) ; } int scaledSize = ( int ) TypedValue . applyDimension ( unit , size , getResources ( ) . getDisplayMetrics ( ) ) ; setBorderInternal ( scaledSize , mBorderColor , true ) ; |
public class Mail { /** * set the value password When required by a proxy server , a valid password .
* @ param proxypassword value to set
* @ throws ApplicationException */
public void setProxypassword ( String proxypassword ) throws ApplicationException { } } | try { smtp . getProxyData ( ) . setPassword ( proxypassword ) ; } catch ( Exception e ) { throw new ApplicationException ( "attribute [proxypassword] of the tag [mail] is invalid" , e . getMessage ( ) ) ; } |
public class ScreenRightLowerCornerPositioner { /** * { @ inheritDoc } */
public final void position ( final JFrame frame ) { } } | final Dimension screenSize = Toolkit . getDefaultToolkit ( ) . getScreenSize ( ) ; final Dimension frameSize = frame . getSize ( ) ; checkMaxSize ( screenSize , frameSize ) ; frame . setLocation ( ( screenSize . width - frameSize . width - getWidthOffset ( ) ) , ( screenSize . height - frameSize . height - getHeightOffset ( ) ) ) ; |
public class Model { /** * Update set statement
* @ param column table column name [ sql ]
* @ param value column value
* @ return AnimaQuery */
public AnimaQuery < ? extends Model > set ( String column , Object value ) { } } | return query . set ( column , value ) ; |
public class BatchPutScheduledUpdateGroupActionResult { /** * The names of the scheduled actions that could not be created or updated , including an error message .
* @ param failedScheduledUpdateGroupActions
* The names of the scheduled actions that could not be created or updated , including an error message . */
public void setFailedScheduledUpdateGroupActions ( java . util . Collection < FailedScheduledUpdateGroupActionRequest > failedScheduledUpdateGroupActions ) { } } | if ( failedScheduledUpdateGroupActions == null ) { this . failedScheduledUpdateGroupActions = null ; return ; } this . failedScheduledUpdateGroupActions = new com . amazonaws . internal . SdkInternalList < FailedScheduledUpdateGroupActionRequest > ( failedScheduledUpdateGroupActions ) ; |
public class StreamConfiguration { /** * Set the maximum block size to use . If this value is out of a valid range ,
* it will be set to the closest valid value . User must ensure that this
* value is set above or equal to the minimum block size .
* @ param size maximum block size to use .
* @ return actual size set */
public int setMaxBlockSize ( int size ) { } } | maxBlockSize = ( size <= MAX_BLOCK_SIZE ) ? size : MAX_BLOCK_SIZE ; maxBlockSize = ( maxBlockSize >= MIN_BLOCK_SIZE ) ? maxBlockSize : MIN_BLOCK_SIZE ; return maxBlockSize ; |
public class SpiderService { /** * Validate the table option " aging - check - frequency " */
private void validateTableOptionAgingCheckFrequency ( TableDefinition tableDef , String optValue ) { } } | new TaskFrequency ( optValue ) ; Utils . require ( tableDef . getOption ( CommonDefs . OPT_AGING_FIELD ) != null , "Option 'aging-check-frequency' requires option 'aging-field'" ) ; |
public class StreamEx { /** * Returns a { @ link SortedMap } whose keys and values are the result of
* applying the provided mapping functions to the input elements .
* This is a < a href = " package - summary . html # StreamOps " > terminal < / a >
* operation .
* If the mapped keys contains duplicates ( according to
* { @ link Object # equals ( Object ) } ) , an { @ code IllegalStateException } is
* thrown when the collection operation is performed .
* For parallel stream the concurrent { @ code SortedMap } is created .
* Returned { @ code SortedMap } is guaranteed to be modifiable .
* @ param < K > the output type of the key mapping function
* @ param < V > the output type of the value mapping function
* @ param keyMapper a mapping function to produce keys
* @ param valMapper a mapping function to produce values
* @ return a { @ code SortedMap } whose keys and values are the result of
* applying mapping functions to the input elements
* @ see Collectors # toMap ( Function , Function )
* @ see Collectors # toConcurrentMap ( Function , Function )
* @ see # toSortedMap ( Function )
* @ see # toNavigableMap ( Function , Function )
* @ since 0.1.0 */
public < K , V > SortedMap < K , V > toSortedMap ( Function < ? super T , ? extends K > keyMapper , Function < ? super T , ? extends V > valMapper ) { } } | SortedMap < K , V > map = isParallel ( ) ? new ConcurrentSkipListMap < > ( ) : new TreeMap < > ( ) ; return toMapThrowing ( keyMapper , valMapper , map ) ; |
public class AWSAppSyncClient { /** * Creates a < code > Function < / code > object .
* A function is a reusable entity . Multiple functions can be used to compose the resolver logic .
* @ param createFunctionRequest
* @ return Result of the CreateFunction operation returned by the service .
* @ throws ConcurrentModificationException
* Another modification is in progress at this time and it must complete before you can make your change .
* @ throws NotFoundException
* The resource specified in the request was not found . Check the resource , and then try again .
* @ throws UnauthorizedException
* You are not authorized to perform this operation .
* @ throws InternalFailureException
* An internal AWS AppSync error occurred . Try your request again .
* @ sample AWSAppSync . CreateFunction
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / appsync - 2017-07-25 / CreateFunction " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public CreateFunctionResult createFunction ( CreateFunctionRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeCreateFunction ( request ) ; |
public class FastTrackData { /** * Log column data .
* @ param column column data */
private void logColumn ( FastTrackColumn column ) { } } | if ( m_log != null ) { m_log . println ( "TABLE: " + m_currentTable . getType ( ) ) ; m_log . println ( column . toString ( ) ) ; m_log . flush ( ) ; } |
public class CollectionJsonAffordanceModel { /** * Transform a list of general { @ link QueryParameter } s into a list of { @ link CollectionJsonData } objects .
* @ return */
private List < CollectionJsonData > determineQueryProperties ( ) { } } | if ( ! getHttpMethod ( ) . equals ( HttpMethod . GET ) ) { return Collections . emptyList ( ) ; } return getQueryMethodParameters ( ) . stream ( ) . map ( queryProperty -> new CollectionJsonData ( ) . withName ( queryProperty . getName ( ) ) . withValue ( "" ) ) . collect ( Collectors . toList ( ) ) ; |
public class Targeting { /** * Gets the dayPartTargeting value for this Targeting .
* @ return dayPartTargeting * Specifies the days of the week and times that are targeted
* by the
* { @ link LineItem } . This attribute is optional . */
public com . google . api . ads . admanager . axis . v201805 . DayPartTargeting getDayPartTargeting ( ) { } } | return dayPartTargeting ; |
public class XMLReaderFactory { /** * Attempt to create an XMLReader from system defaults .
* In environments which can support it , the name of the XMLReader
* class is determined by trying each these options in order , and
* using the first one which succeeds : < / p > < ul >
* < li > If the system property < code > org . xml . sax . driver < / code >
* has a value , that is used as an XMLReader class name . < / li >
* < li > The JAR " Services API " is used to look for a class name
* in the < em > META - INF / services / org . xml . sax . driver < / em > file in
* jarfiles available to the runtime . < / li >
* < li > SAX parser distributions are strongly encouraged to provide
* a default XMLReader class name that will take effect only when
* previous options ( on this list ) are not successful . < / li >
* < li > Finally , if { @ link ParserFactory # makeParser ( ) } can
* return a system default SAX1 parser , that parser is wrapped in
* a { @ link ParserAdapter } . ( This is a migration aid for SAX1
* environments , where the < code > org . xml . sax . parser < / code > system
* property will often be usable . ) < / li >
* < / ul >
* < p > In environments such as small embedded systems , which can not
* support that flexibility , other mechanisms to determine the default
* may be used . < / p >
* < p > Note that many Java environments allow system properties to be
* initialized on a command line . This means that < em > in most cases < / em >
* setting a good value for that property ensures that calls to this
* method will succeed , except when security policies intervene .
* This will also maximize application portability to older SAX
* environments , with less robust implementations of this method .
* @ return A new XMLReader .
* @ exception org . xml . sax . SAXException If no default XMLReader class
* can be identified and instantiated .
* @ see # createXMLReader ( java . lang . String ) */
public static XMLReader createXMLReader ( ) throws SAXException { } } | String className = null ; ClassLoader loader = NewInstance . getClassLoader ( ) ; // 1 . try the JVM - instance - wide system property
try { className = System . getProperty ( property ) ; } catch ( RuntimeException e ) { /* normally fails for applets */
} // 2 . if that fails , try META - INF / services /
if ( className == null ) { try { String service = "META-INF/services/" + property ; InputStream in ; BufferedReader reader ; if ( loader == null ) in = ClassLoader . getSystemResourceAsStream ( service ) ; else in = loader . getResourceAsStream ( service ) ; if ( in != null ) { reader = new BufferedReader ( new InputStreamReader ( in , StandardCharsets . UTF_8 ) ) ; className = reader . readLine ( ) ; in . close ( ) ; } } catch ( Exception e ) { } } // 3 . Distro - specific fallback
if ( className == null ) { // BEGIN DISTRIBUTION - SPECIFIC
// EXAMPLE :
// className = " com . example . sax . XmlReader " ;
// or a $ JAVA _ HOME / jre / lib / * properties setting . . .
// END DISTRIBUTION - SPECIFIC
} // do we know the XMLReader implementation class yet ?
if ( className != null ) return loadClass ( loader , className ) ; // 4 . panic - - adapt any SAX1 parser
try { return new ParserAdapter ( ParserFactory . makeParser ( ) ) ; } catch ( Exception e ) { throw new SAXException ( "Can't create default XMLReader; " + "is system property org.xml.sax.driver set?" ) ; } |
public class BigtableTableAdminGrpcClient { /** * Creates a { @ link Metadata } that contains pertinent headers . */
private Metadata createMetadata ( String resource ) { } } | Metadata metadata = new Metadata ( ) ; if ( resource != null ) { metadata . put ( GRPC_RESOURCE_PREFIX_KEY , resource ) ; } return metadata ; |
public class BaseFFDCService { /** * Process an exception
* @ param th
* The exception to be processed
* @ param sourceId
* The source id of the reporting code
* @ param probeId
* The probe of the reporting code
* @ param callerThis
* The instance of the reporting code
* @ param objectArray
* An array of additional interesting objects */
@ Override public void processException ( Throwable th , String sourceId , String probeId , Object callerThis , Object [ ] objectArray ) { } } | log ( sourceId , probeId , th , callerThis , objectArray ) ; |
public class SingleFieldCondition { /** * { @ inheritDoc } */
@ Override protected MoreObjects . ToStringHelper toStringHelper ( Object o ) { } } | return super . toStringHelper ( o ) . add ( "field" , field ) ; |
public class HostMessenger { /** * Foreign hosts that share the same host id belong to the same machine , one
* poison pill is deadly enough */
public void sendPoisonPill ( Collection < Integer > hostIds , String err , int cause ) { } } | for ( int hostId : hostIds ) { Iterator < ForeignHost > it = m_foreignHosts . get ( hostId ) . iterator ( ) ; // No need to overdose the poison pill
if ( it . hasNext ( ) ) { ForeignHost fh = it . next ( ) ; if ( fh . isUp ( ) ) { fh . sendPoisonPill ( err , cause ) ; } } } |
public class AbstractSingleFileObjectStore { /** * When enabled , reserve requests to this ObjectStore will throw ObjectStoreFullException .
* @ param isFull true subsequent reservations throw ObjectStoreFullException . if false subsequent reservations may
* succeed .
* @ throws ObjectManagerException */
public void simulateFull ( boolean isFull ) throws ObjectManagerException { } } | final String methodName = "simulateFull" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { new Boolean ( isFull ) } ) ; if ( isFull ) { // Clear as much space as we can .
objectManagerState . waitForCheckpoint ( true ) ; // Reserve all of the available space .
synchronized ( this ) { long available = storeFileSizeAllocated - storeFileSizeUsed - directoryReservedSize - reservedSize . get ( ) ; long newReservedSize = reservedSize . addAndGet ( ( int ) available ) ; simulateFullReservedSize = simulateFullReservedSize + available ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "isFull:834" , new Long ( available ) , new Long ( newReservedSize ) , new Long ( simulateFullReservedSize ) } ) ; } // synchronized ( this ) .
} else { synchronized ( this ) { reservedSize . addAndGet ( ( int ) - simulateFullReservedSize ) ; simulateFullReservedSize = 0 ; } // synchronized ( this ) .
objectManagerState . waitForCheckpoint ( true ) ; } // if ( isFull ) .
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { new Long ( simulateFullReservedSize ) } ) ; |
public class DescribeTerminationPolicyTypesResult { /** * The termination policies supported by Amazon EC2 Auto Scaling : < code > OldestInstance < / code > ,
* < code > OldestLaunchConfiguration < / code > , < code > NewestInstance < / code > , < code > ClosestToNextInstanceHour < / code > ,
* < code > Default < / code > , < code > OldestLaunchTemplate < / code > , and < code > AllocationStrategy < / code > .
* @ return The termination policies supported by Amazon EC2 Auto Scaling : < code > OldestInstance < / code > ,
* < code > OldestLaunchConfiguration < / code > , < code > NewestInstance < / code > ,
* < code > ClosestToNextInstanceHour < / code > , < code > Default < / code > , < code > OldestLaunchTemplate < / code > , and
* < code > AllocationStrategy < / code > . */
public java . util . List < String > getTerminationPolicyTypes ( ) { } } | if ( terminationPolicyTypes == null ) { terminationPolicyTypes = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return terminationPolicyTypes ; |
public class Context { /** * Returns a context that differs only in the uri part . */
public Context derive ( UriPart uriPart ) { } } | return uriPart == this . uriPart ? this : toBuilder ( ) . withUriPart ( uriPart ) . build ( ) ; |
public class PojoWrapper { /** * / * ( non - Javadoc )
* @ see groovy . lang . GroovyObject # invokeMethod ( java . lang . String , java . lang . Object ) */
public Object invokeMethod ( final String methodName , final Object arguments ) { } } | return this . delegate . invokeMethod ( this . wrapped , methodName , arguments ) ; |
public class OperationRunnerImpl { /** * This method has a direct dependency on how objects are serialized .
* If the stream format is changed , this extraction method must be changed as well .
* It makes an assumption that the callId is the first long field in the serialized operation . */
private long extractOperationCallId ( Data data ) throws IOException { } } | ObjectDataInput input = ( ( SerializationServiceV1 ) node . getSerializationService ( ) ) . initDataSerializableInputAndSkipTheHeader ( data ) ; return input . readLong ( ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link GenericCityObjectType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link GenericCityObjectType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/generics/2.0" , name = "GenericCityObject" , substitutionHeadNamespace = "http://www.opengis.net/citygml/2.0" , substitutionHeadName = "_CityObject" ) public JAXBElement < GenericCityObjectType > createGenericCityObject ( GenericCityObjectType value ) { } } | return new JAXBElement < GenericCityObjectType > ( _GenericCityObject_QNAME , GenericCityObjectType . class , null , value ) ; |
public class BAMInputFormat { /** * Reset traversal parameters so that all reads are included .
* @ param conf the Hadoop configuration to set properties on */
public static void unsetTraversalParameters ( Configuration conf ) { } } | conf . unset ( BOUNDED_TRAVERSAL_PROPERTY ) ; conf . unset ( INTERVALS_PROPERTY ) ; conf . unset ( TRAVERSE_UNPLACED_UNMAPPED_PROPERTY ) ; |
public class CompositeFaceletHandler { /** * { @ inheritDoc } */
public void apply ( FaceletContext ctx , UIComponent parent ) throws IOException { } } | for ( int i = 0 ; i < len ; i ++ ) { this . children [ i ] . apply ( ctx , parent ) ; } |
public class Record { /** * Get the starting ID for this table .
* Override this for different behavior .
* @ return The starting id */
public int getEndingID ( ) { } } | if ( this . getTable ( ) != null ) if ( this . getTable ( ) . getDatabase ( ) != null ) return this . getTable ( ) . getDatabase ( ) . getEndingID ( ) ; return super . getEndingID ( ) ; // Never ( default ) |
public class AssertDependencies { /** * Asserts that a set of dependency rules is kept .
* @ param clasz
* Class to use for loading the resource - Cannot be < code > null < / code > .
* @ param dependenciesFilePathAndName
* XML resource ( path / name ) with allowed or forbidden dependencies - Cannot be < code > null < / code > .
* @ param classesDir
* Directory with the " . class " files to check - Cannot be < code > null < / code > and must be a valid directory . */
public static final void assertRules ( final Class < ? > clasz , final String dependenciesFilePathAndName , final File classesDir ) { } } | Utils4J . checkNotNull ( "clasz" , clasz ) ; Utils4J . checkNotNull ( "dependenciesFilePathAndName" , dependenciesFilePathAndName ) ; Utils4J . checkNotNull ( "classesDir" , classesDir ) ; try { final DependencyAnalyzer analyzer = new DependencyAnalyzer ( clasz , dependenciesFilePathAndName ) ; assertIntern ( classesDir , analyzer ) ; } catch ( final InvalidDependenciesDefinitionException ex ) { throw new RuntimeException ( ex ) ; } |
public class DocumentRootImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setBackgroundColor ( String newBackgroundColor ) { } } | String oldBackgroundColor = backgroundColor ; backgroundColor = newBackgroundColor ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , ColorPackage . DOCUMENT_ROOT__BACKGROUND_COLOR , oldBackgroundColor , backgroundColor ) ) ; |
public class TransformationUtils { /** * Does the actual parsing . */
private static List < TransformationDescription > loadDescrtipionsFromXMLInputSource ( InputSource source , String fileName ) throws Exception { } } | XMLReader xr = XMLReaderFactory . createXMLReader ( ) ; TransformationDescriptionXMLReader reader = new TransformationDescriptionXMLReader ( fileName ) ; xr . setContentHandler ( reader ) ; xr . parse ( source ) ; return reader . getResult ( ) ; |
public class ReuseOracle { /** * This methods returns the full output to the input query .
* It is possible that the query is already known ( answer provided by { @ link ReuseTree # getOutput ( Word ) } , the query
* is new and no system state could be found for reusage ( { @ link ReuseCapableOracle # processQuery ( Word ) } will be
* invoked ) or there exists a prefix that ( maybe epsilon ) could be reused so save reset invocation ( { @ link
* ReuseCapableOracle # continueQuery ( Word , Object ) } will be invoked with remaining suffix and the corresponding
* { @ link ReuseNode } of the { @ link ReuseTree } ) . */
private Word < O > processQuery ( final Word < I > query ) { } } | Word < O > knownOutput = tree . getOutput ( query ) ; if ( knownOutput != null ) { return knownOutput ; } // Search for system state
final NodeResult < S , I , O > nodeResult = tree . fetchSystemState ( query ) ; final ReuseCapableOracle < S , I , O > oracle = getReuseCapableOracle ( ) ; final Word < O > output ; // No system state available
if ( nodeResult == null ) { final QueryResult < S , O > newResult = filterAndProcessQuery ( query , tree . getPartialOutput ( query ) , oracle :: processQuery ) ; tree . insert ( query , newResult ) ; output = newResult . output ; } else { // System state available - > reuse
final int suffixLen = query . size ( ) - nodeResult . prefixLength ; final Word < I > suffix = query . suffix ( suffixLen ) ; final Word < O > partialOutput = tree . getPartialOutput ( query ) ; final Word < O > partialSuffixOutput = partialOutput . suffix ( suffixLen ) ; final ReuseNode < S , I , O > reuseNode = nodeResult . reuseNode ; final S systemState = nodeResult . systemState ; final QueryResult < S , O > suffixQueryResult = filterAndProcessQuery ( suffix , partialSuffixOutput , filteredInput -> oracle . continueQuery ( filteredInput , systemState ) ) ; this . tree . insert ( suffix , reuseNode , suffixQueryResult ) ; final Word < O > prefixOutput = tree . getOutput ( query . prefix ( nodeResult . prefixLength ) ) ; output = new WordBuilder < > ( prefixOutput ) . append ( suffixQueryResult . output ) . toWord ( ) ; } return output ; |
public class EnglishGrammaticalStructure { /** * This method gets rid of multiwords in conjunctions to avoid having them
* creating disconnected constituents e . g . ,
* " bread - 1 as - 2 well - 3 as - 4 cheese - 5 " will be turned into conj _ and ( bread ,
* cheese ) and then dep ( well - 3 , as - 2 ) and dep ( well - 3 , as - 4 ) cannot be attached
* to the graph , these dependencies are erased
* @ param list List of words to get rid of multiword conjunctions from */
private static void eraseMultiConj ( Collection < TypedDependency > list ) { } } | // find typed deps of form cc ( gov , x )
for ( TypedDependency td1 : list ) { if ( td1 . reln ( ) == COORDINATION ) { TreeGraphNode x = td1 . dep ( ) ; // find typed deps of form dep ( x , y ) and kill them
for ( TypedDependency td2 : list ) { if ( td2 . gov ( ) . equals ( x ) && ( td2 . reln ( ) == DEPENDENT || td2 . reln ( ) == MULTI_WORD_EXPRESSION || td2 . reln ( ) == COORDINATION || td2 . reln ( ) == ADVERBIAL_MODIFIER || td2 . reln ( ) == NEGATION_MODIFIER || td2 . reln ( ) == AUX_MODIFIER ) ) { td2 . setReln ( KILL ) ; } } } } // now remove typed dependencies with reln " kill "
for ( Iterator < TypedDependency > iter = list . iterator ( ) ; iter . hasNext ( ) ; ) { TypedDependency td = iter . next ( ) ; if ( td . reln ( ) == KILL ) { if ( DEBUG ) { System . err . println ( "Removing rest of multiword conj: " + td ) ; } iter . remove ( ) ; } } |
public class MessagePacker { /** * Writes an Integer value .
* This method writes an integer using the smallest format from the int format family .
* @ param r the integer to be written
* @ return this
* @ throws IOException when underlying output throws IOException */
public MessagePacker packInt ( int r ) throws IOException { } } | if ( r < - ( 1 << 5 ) ) { if ( r < - ( 1 << 15 ) ) { writeByteAndInt ( INT32 , r ) ; } else if ( r < - ( 1 << 7 ) ) { writeByteAndShort ( INT16 , ( short ) r ) ; } else { writeByteAndByte ( INT8 , ( byte ) r ) ; } } else if ( r < ( 1 << 7 ) ) { writeByte ( ( byte ) r ) ; } else { if ( r < ( 1 << 8 ) ) { writeByteAndByte ( UINT8 , ( byte ) r ) ; } else if ( r < ( 1 << 16 ) ) { writeByteAndShort ( UINT16 , ( short ) r ) ; } else { // unsigned 32
writeByteAndInt ( UINT32 , r ) ; } } return this ; |
public class StringValue { /** * Sets the value of the StringValue to a substring of the given value .
* @ param chars The new string value ( as a character array ) .
* @ param offset The position to start the substring .
* @ param len The length of the substring . */
public void setValue ( char [ ] chars , int offset , int len ) { } } | checkNotNull ( chars ) ; if ( offset < 0 || len < 0 || offset > chars . length - len ) { throw new IndexOutOfBoundsException ( ) ; } ensureSize ( len ) ; System . arraycopy ( chars , offset , this . value , 0 , len ) ; this . len = len ; this . hashCode = 0 ; |
public class MementoResource { /** * Retrieve all of the Memento - related link headers given a collection of datetimes .
* @ param identifier the public identifier for the resource
* @ param mementos a collection of memento values
* @ return a stream of link headers */
public static Stream < Link > getMementoLinks ( final String identifier , final SortedSet < Instant > mementos ) { } } | if ( mementos . isEmpty ( ) ) { return empty ( ) ; } return concat ( getTimeMap ( identifier , mementos . first ( ) , mementos . last ( ) ) , mementos . stream ( ) . map ( mementoToLink ( identifier ) ) ) ; |
public class JSDocInfoBuilder { /** * Records a return type .
* @ return { @ code true } if the return type was recorded and { @ code false } if
* it is invalid or was already defined */
public boolean recordReturnType ( JSTypeExpression jsType ) { } } | if ( jsType != null && currentInfo . getReturnType ( ) == null && ! hasAnySingletonTypeTags ( ) ) { currentInfo . setReturnType ( jsType ) ; populated = true ; return true ; } else { return false ; } |
public class EventBus { /** * Emit a string event with parameters and force all listener to be called synchronously .
* @ param event
* the target event
* @ param args
* the arguments passed in
* @ see # emit ( String , Object . . . ) */
public EventBus emitSync ( String event , Object ... args ) { } } | return _emitWithOnceBus ( eventContextSync ( event , args ) ) ; |
public class AccessibilityFeature { /** * get the result speech recognize and find match in strings file .
* @ param speechResult */
public void findMatch ( ArrayList < String > speechResult ) { } } | loadCadidateString ( ) ; for ( String matchCandidate : speechResult ) { Locale localeDefault = mGvrContext . getActivity ( ) . getResources ( ) . getConfiguration ( ) . locale ; if ( volumeUp . equals ( matchCandidate ) ) { startVolumeUp ( ) ; break ; } else if ( volumeDown . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { startVolumeDown ( ) ; break ; } else if ( zoomIn . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { startZoomIn ( ) ; break ; } else if ( zoomOut . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { startZoomOut ( ) ; break ; } else if ( invertedColors . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { startInvertedColors ( ) ; break ; } else if ( talkBack . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { enableTalkBack ( ) ; } else if ( disableTalkBack . toLowerCase ( localeDefault ) . equals ( matchCandidate . toLowerCase ( localeDefault ) ) ) { disableTalkBack ( ) ; } } |
public class MithraCompositeList { /** * a llst iterator is a problem for a composite list as going back in the order of the list is an issue ,
* as are the other methods like set ( ) and add ( ) ( and especially , remove ) .
* Convert the internal lists to one list ( if not already just one list )
* and return that list ' s list iterator .
* AFAIK list iterator is only commonly used in sorting .
* @ return a ListIterator for this , with internal state convertedto one list if needed . */
public ListIterator < E > listIterator ( int index ) { } } | FastList < MithraFastList < E > > localLists = this . lists ; if ( localLists . size ( ) == 1 ) { return localLists . getFirst ( ) . listIterator ( index ) ; } if ( localLists . isEmpty ( ) ) { return Collections . EMPTY_LIST . listIterator ( index ) ; } this . convertMultipleListsToFastList ( ) ; return this . lists . getFirst ( ) . listIterator ( index ) ; |
public class EquivalencerServiceImpl { /** * { @ inheritDoc } */
@ Override public NamespaceValue findNamespaceEquivalence ( NamespaceValue sourceNamespaceValue , Namespace targetNamespace ) throws EquivalencerException { } } | String equivalenceValue ; SkinnyUUID uuid ; if ( sourceNamespaceValue . getEquivalence ( ) != null ) { uuid = convert ( sourceNamespaceValue . getEquivalence ( ) ) ; equivalenceValue = equivalencer . equivalence ( uuid , convert ( targetNamespace ) ) ; } else { final Namespace sourceNs = sourceNamespaceValue . getNamespace ( ) ; final org . openbel . framework . common . model . Namespace sns = convert ( sourceNs ) ; final String sourceValue = sourceNamespaceValue . getValue ( ) ; equivalenceValue = equivalencer . equivalence ( convert ( sourceNs ) , sourceValue , convert ( targetNamespace ) ) ; uuid = equivalencer . getUUID ( sns , sourceValue ) ; } final NamespaceValue targetNsValue = new NamespaceValue ( ) ; targetNsValue . setNamespace ( targetNamespace ) ; targetNsValue . setValue ( equivalenceValue ) ; // uuid based off of source
targetNsValue . setEquivalence ( convert ( uuid ) ) ; return targetNsValue ; |
public class InjectorConfiguration { /** * Mark a class instance as shared . The type of the class will be marked as injectable and in all cases this
* class instance will be passed when requested . This holds true even with multiple injectors as long as they
* are created from the same configuration .
* @ param instance class instance to share .
* @ return a modified copy of this injection configuration . */
public < T > InjectorConfiguration withShared ( T instance ) { } } | // noinspection unchecked
return new InjectorConfiguration ( scopes , definedClasses , factories , factoryClasses , sharedClasses , sharedInstances . withPut ( instance . getClass ( ) , instance ) , aliases , collectedAliases , namedParameterValues ) ; |
public class MetaConfig { /** * Allows consumers to set special handling for how { @ link Meta # equals ( Object , Object ) } determines whether
* the 2nd argument is the same type as the first .
* @ param policy a non - null policy
* @ return the new config
* @ see # withInstanceofEqualsTypeCheck ( ) */
public MetaConfig withInstanceCheck ( InstanceCheckPolicy policy ) { } } | Ensure . that ( policy != null , "policy != null" ) ; return new MetaConfigBuilder ( this ) . setInstanceCheckPolicy ( policy ) . build ( ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.