signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DObject { /** * Request to have the specified item added to the specified DSet . */
public < T extends DSet . Entry > void addToSet ( String setName , T entry ) { } } | requestEntryAdd ( setName , getSet ( setName ) , entry ) ; |
public class TransformedResultHandler { /** * { @ inheritDoc }
* @ see Disposable # dispose ( ) */
@ Override public void dispose ( ) { } } | if ( wrappedResultHandler instanceof Disposable ) { ( ( Disposable ) wrappedResultHandler ) . dispose ( ) ; } if ( resultTransformer instanceof Disposable ) { ( ( Disposable ) resultTransformer ) . dispose ( ) ; } |
public class Word { /** * Creates a word from a subrange of an array of symbols . Note that to ensure immutability , internally a copy of the
* array is made .
* @ param symbols
* the symbols array
* @ param offset
* the starting index in the array
* @ param length
* the length of the resulting word ( from the starting index on )
* @ return the word consisting of the symbols in the range */
@ Nonnull public static < I > Word < I > fromArray ( I [ ] symbols , int offset , int length ) { } } | if ( length == 0 ) { return epsilon ( ) ; } if ( length == 1 ) { return fromLetter ( symbols [ offset ] ) ; } Object [ ] array = new Object [ length ] ; System . arraycopy ( symbols , offset , array , 0 , length ) ; return new SharedWord < > ( array ) ; |
public class cmpaction { /** * Use this API to fetch cmpaction resource of given name . */
public static cmpaction get ( nitro_service service , String name ) throws Exception { } } | cmpaction obj = new cmpaction ( ) ; obj . set_name ( name ) ; cmpaction response = ( cmpaction ) obj . get_resource ( service ) ; return response ; |
public class CmsSitesWebserverDialog { /** * Returns a parameter value from the module parameters ,
* or a given default value in case the parameter is not set . < p >
* @ param params the parameter map to get a value from
* @ param key the parameter to return the value for
* @ param defaultValue the default value in case there is no value stored for this key
* @ return the parameter value from the module parameters */
private String getParameter ( Map < String , String > params , String key , String defaultValue ) { } } | String value = params . get ( key ) ; return ( value != null ) ? value : defaultValue ; |
public class PaymentChannelServerListener { /** * Binds to the given port and starts accepting new client connections .
* @ throws Exception If binding to the given port fails ( eg SocketException : Permission denied for privileged ports ) */
public void bindAndStart ( int port ) throws Exception { } } | server = new NioServer ( new StreamConnectionFactory ( ) { @ Override public ProtobufConnection < Protos . TwoWayChannelMessage > getNewConnection ( InetAddress inetAddress , int port ) { return new ServerHandler ( new InetSocketAddress ( inetAddress , port ) , timeoutSeconds ) . socketProtobufHandler ; } } , new InetSocketAddress ( port ) ) ; server . startAsync ( ) ; server . awaitRunning ( ) ; |
public class Path2dfx { /** * Replies the isCurved property .
* @ return the isCurved property . */
public BooleanProperty isCurvedProperty ( ) { } } | if ( this . isCurved == null ) { this . isCurved = new ReadOnlyBooleanWrapper ( this , MathFXAttributeNames . IS_CURVED , false ) ; this . isCurved . bind ( Bindings . createBooleanBinding ( ( ) -> { for ( final PathElementType type : innerTypesProperty ( ) ) { if ( type == PathElementType . CURVE_TO || type == PathElementType . QUAD_TO ) { return true ; } } return false ; } , innerTypesProperty ( ) ) ) ; } return this . isCurved ; |
public class Location { /** * Create a new location form the given GPS point .
* @ param point the GPS point
* @ return a new location form the given GPS point
* @ throws NullPointerException if the given { @ code point } is { @ code null } */
public static Location of ( final Point point ) { } } | requireNonNull ( point ) ; return of ( point . getLatitude ( ) , point . getLongitude ( ) , point . getElevation ( ) . orElse ( null ) ) ; |
public class BooleanUtils { /** * < p > Converts an int to a Boolean specifying the conversion values . < / p >
* < p > NOTE : This returns null and will throw a NullPointerException if unboxed to a boolean . < / p >
* < pre >
* BooleanUtils . toBooleanObject ( 0 , 0 , 2 , 3 ) = Boolean . TRUE
* BooleanUtils . toBooleanObject ( 2 , 1 , 2 , 3 ) = Boolean . FALSE
* BooleanUtils . toBooleanObject ( 3 , 1 , 2 , 3 ) = null
* < / pre >
* @ param value the Integer to convert
* @ param trueValue the value to match for { @ code true }
* @ param falseValue the value to match for { @ code false }
* @ param nullValue the value to to match for { @ code null }
* @ return Boolean . TRUE , Boolean . FALSE , or { @ code null }
* @ throws IllegalArgumentException if no match */
public static Boolean toBooleanObject ( final int value , final int trueValue , final int falseValue , final int nullValue ) { } } | if ( value == trueValue ) { return Boolean . TRUE ; } if ( value == falseValue ) { return Boolean . FALSE ; } if ( value == nullValue ) { return null ; } // no match
throw new IllegalArgumentException ( "The Integer did not match any specified value" ) ; |
public class VertxGenerator { /** * Overwrite this method to handle your custom type . This is needed especially when you have custom converters .
* @ param column the column definition
* @ param setter the setter name
* @ param columnType the type of the column
* @ param javaMemberName the java member name
* @ param out the JavaWriter
* @ return < code > true < / code > if the column was handled .
* @ see # generateFromJson ( TableDefinition , JavaWriter , org . jooq . codegen . GeneratorStrategy . Mode ) */
protected boolean handleCustomTypeFromJson ( TypedElementDefinition < ? > column , String setter , String columnType , String javaMemberName , JavaWriter out ) { } } | return false ; |
public class cachepolicy_binding { /** * Use this API to fetch cachepolicy _ binding resources of given names . */
public static cachepolicy_binding [ ] get ( nitro_service service , String policyname [ ] ) throws Exception { } } | if ( policyname != null && policyname . length > 0 ) { cachepolicy_binding response [ ] = new cachepolicy_binding [ policyname . length ] ; cachepolicy_binding obj [ ] = new cachepolicy_binding [ policyname . length ] ; for ( int i = 0 ; i < policyname . length ; i ++ ) { obj [ i ] = new cachepolicy_binding ( ) ; obj [ i ] . set_policyname ( policyname [ i ] ) ; response [ i ] = ( cachepolicy_binding ) obj [ i ] . get_resource ( service ) ; } return response ; } return null ; |
public class ListPreference { /** * Returns the entry , the currently persisted value of the preference belongs to .
* @ return The entry , the currently persisted value of the preference belongs to , as an instance
* of the type { @ link CharSequence } */
public final CharSequence getEntry ( ) { } } | int index = indexOf ( value ) ; return index >= 0 && getEntries ( ) != null ? getEntries ( ) [ index ] : null ; |
public class BilingualAligner { /** * Creates the bilingual single - word aligner .
* @ return the aligner object */
public BilingualAlignmentService create ( ) { } } | Preconditions . checkArgument ( sourceCorpus . isPresent ( ) , "No source indexed corpus given" ) ; Preconditions . checkArgument ( dico . isPresent ( ) , "No bilingual dictionary given" ) ; Preconditions . checkArgument ( targetCorpus . isPresent ( ) , "No target indexed corpus given" ) ; Injector sourceInjector = TermSuiteFactory . createExtractorInjector ( sourceCorpus . get ( ) ) ; Injector targetInjector = TermSuiteFactory . createExtractorInjector ( targetCorpus . get ( ) ) ; AlignerModule alignerModule = new AlignerModule ( sourceInjector , targetInjector , dico . get ( ) , distance ) ; Injector alignerInjector = Guice . createInjector ( alignerModule ) ; BilingualAlignmentService alignService = alignerInjector . getInstance ( BilingualAlignmentService . class ) ; return alignService ; |
public class MiniSatStyleSolver { /** * Returns the variable index for a given variable name .
* @ param name the variable name
* @ return the variable index for the name */
public int idxForName ( final String name ) { } } | final Integer id = this . name2idx . get ( name ) ; return id == null ? - 1 : id ; |
public class CalendarAPI { /** * Returns all items and tasks that the user have access to in the given
* space . Tasks with reference to other spaces are not returned or tasks
* with no reference .
* @ param spaceId
* The id of the space
* @ param dateFrom
* The from date
* @ param dateTo
* The to date
* @ param types
* The types of events that should be returned . Leave out to get
* all types of events .
* @ return The events in the calendar */
public List < Event > getSpace ( int spaceId , LocalDate dateFrom , LocalDate dateTo , ReferenceType ... types ) { } } | return getCalendar ( "space/" + spaceId , dateFrom , dateTo , null , types ) ; |
public class system { /** * Make the smartphone vibrate for a giving time . You need to put the
* vibration permission in the manifest as follows : < uses - permission
* android : name = " android . permission . VIBRATE " / >
* @ param duration duration of the vibration in miliseconds */
public static void vibrate ( int duration ) { } } | Vibrator v = ( Vibrator ) QuickUtils . getContext ( ) . getSystemService ( Context . VIBRATOR_SERVICE ) ; v . vibrate ( duration ) ; |
public class Utils { /** * Encoding a Long integer into a variable - length encoding format .
* < ul >
* < li > if n in [ - 32 , 127 ) : encode in one byte with the actual value .
* Otherwise ,
* < li > if n in [ - 20*2 ^ 8 , 20*2 ^ 8 ) : encode in two bytes : byte [ 0 ] = n / 256 - 52;
* byte [ 1 ] = n & 0xff . Otherwise ,
* < li > if n IN [ - 16*2 ^ 16 , 16*2 ^ 16 ) : encode in three bytes : byte [ 0 ] = n / 2 ^ 16 -
* 88 ; byte [ 1 ] = ( n > > 8 ) & 0xff ; byte [ 2 ] = n & 0xff . Otherwise ,
* < li > if n in [ - 8*2 ^ 24 , 8*2 ^ 24 ) : encode in four bytes : byte [ 0 ] = n / 2 ^ 24 - 112;
* byte [ 1 ] = ( n > > 16 ) & 0xff ; byte [ 2 ] = ( n > > 8 ) & 0xff ; byte [ 3 ] = n & 0xff . Otherwise :
* < li > if n in [ - 2 ^ 31 , 2 ^ 31 ) : encode in five bytes : byte [ 0 ] = - 125 ; byte [ 1 ] =
* ( n > > 24 ) & 0xff ; byte [ 2 ] = ( n > > 16 ) & 0xff ; byte [ 3 ] = ( n > > 8 ) & 0xff ; byte [ 4 ] = n & 0xff ;
* < li > if n in [ - 2 ^ 39 , 2 ^ 39 ) : encode in six bytes : byte [ 0 ] = - 124 ; byte [ 1 ] =
* ( n > > 32 ) & 0xff ; byte [ 2 ] = ( n > > 24 ) & 0xff ; byte [ 3 ] = ( n > > 16 ) & 0xff ;
* byte [ 4 ] = ( n > > 8 ) & 0xff ; byte [ 5 ] = n & 0xff
* < li > if n in [ - 2 ^ 47 , 2 ^ 47 ) : encode in seven bytes : byte [ 0 ] = - 123 ; byte [ 1 ] =
* ( n > > 40 ) & 0xff ; byte [ 2 ] = ( n > > 32 ) & 0xff ; byte [ 3 ] = ( n > > 24 ) & 0xff ;
* byte [ 4 ] = ( n > > 16 ) & 0xff ; byte [ 5 ] = ( n > > 8 ) & 0xff ; byte [ 6 ] = n & 0xff ;
* < li > if n in [ - 2 ^ 55 , 2 ^ 55 ) : encode in eight bytes : byte [ 0 ] = - 122 ; byte [ 1 ] =
* ( n > > 48 ) & 0xff ; byte [ 2 ] = ( n > > 40 ) & 0xff ; byte [ 3 ] = ( n > > 32 ) & 0xff ;
* byte [ 4 ] = ( n > > 24 ) & 0xff ; byte [ 5 ] = ( n > > 16 ) & 0xff ; byte [ 6 ] = ( n > > 8 ) & 0xff ;
* byte [ 7 ] = n & 0xff ;
* < li > if n in [ - 2 ^ 63 , 2 ^ 63 ) : encode in nine bytes : byte [ 0 ] = - 121 ; byte [ 1 ] =
* ( n > > 54 ) & 0xff ; byte [ 2 ] = ( n > > 48 ) & 0xff ; byte [ 3 ] = ( n > > 40 ) & 0xff ;
* byte [ 4 ] = ( n > > 32 ) & 0xff ; byte [ 5 ] = ( n > > 24 ) & 0xff ; byte [ 6 ] = ( n > > 16 ) & 0xff ;
* byte [ 7 ] = ( n > > 8 ) & 0xff ; byte [ 8 ] = n & 0xff ;
* < / ul >
* @ param out
* output stream
* @ param n
* the integer number
* @ throws IOException */
@ SuppressWarnings ( "fallthrough" ) public static void writeVLong ( DataOutput out , long n ) throws IOException { } } | if ( ( n < 128 ) && ( n >= - 32 ) ) { out . writeByte ( ( int ) n ) ; return ; } long un = ( n < 0 ) ? ~ n : n ; // how many bytes do we need to represent the number with sign bit ?
int len = ( Long . SIZE - Long . numberOfLeadingZeros ( un ) ) / 8 + 1 ; int firstByte = ( int ) ( n >> ( ( len - 1 ) * 8 ) ) ; switch ( len ) { case 1 : // fall it through to firstByte = = - 1 , len = 2.
firstByte >>= 8 ; case 2 : if ( ( firstByte < 20 ) && ( firstByte >= - 20 ) ) { out . writeByte ( firstByte - 52 ) ; out . writeByte ( ( int ) n ) ; return ; } // fall it through to firstByte = = 0 / - 1 , len = 3.
firstByte >>= 8 ; case 3 : if ( ( firstByte < 16 ) && ( firstByte >= - 16 ) ) { out . writeByte ( firstByte - 88 ) ; out . writeShort ( ( int ) n ) ; return ; } // fall it through to firstByte = = 0 / - 1 , len = 4.
firstByte >>= 8 ; case 4 : if ( ( firstByte < 8 ) && ( firstByte >= - 8 ) ) { out . writeByte ( firstByte - 112 ) ; out . writeShort ( ( ( int ) n ) >>> 8 ) ; out . writeByte ( ( int ) n ) ; return ; } out . writeByte ( len - 129 ) ; out . writeInt ( ( int ) n ) ; return ; case 5 : out . writeByte ( len - 129 ) ; out . writeInt ( ( int ) ( n >>> 8 ) ) ; out . writeByte ( ( int ) n ) ; return ; case 6 : out . writeByte ( len - 129 ) ; out . writeInt ( ( int ) ( n >>> 16 ) ) ; out . writeShort ( ( int ) n ) ; return ; case 7 : out . writeByte ( len - 129 ) ; out . writeInt ( ( int ) ( n >>> 24 ) ) ; out . writeShort ( ( int ) ( n >>> 8 ) ) ; out . writeByte ( ( int ) n ) ; return ; case 8 : out . writeByte ( len - 129 ) ; out . writeLong ( n ) ; return ; default : throw new RuntimeException ( "Internel error" ) ; } |
public class LdapModule { /** * Method to compare two passwords . The method attempts to encode the user
* password based on the ldap password encoding extracted from the storage
* format ( e . g . { SHA } g0bbl3d3g00ka12 @ # 19 / = ) .
* @ param userPassword
* the password that the user entered
* @ param ldapPassword
* the password from the ldap directory
* @ return true if userPassword equals ldapPassword with respect to encoding */
private static boolean passwordsMatch ( String userPassword , String ldapPassword ) { } } | Matcher m = LDAP_PASSWORD_PATTERN . matcher ( ldapPassword ) ; boolean match = false ; if ( m . find ( ) && m . groupCount ( ) == 2 ) { // if password is encoded in the LDAP , encode the password before
// compare
String encoding = m . group ( 1 ) ; String password = m . group ( 2 ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Encoding: {}, Password: {}" , encoding , password ) ; } MessageDigest digest = null ; try { digest = MessageDigest . getInstance ( encoding . toUpperCase ( ) ) ; } catch ( NoSuchAlgorithmException e ) { logger . error ( "Unsupported Algorithm used: {}" , encoding ) ; logger . error ( e . getMessage ( ) ) ; return false ; } byte [ ] resultBytes = digest . digest ( userPassword . getBytes ( ) ) ; byte [ ] result = Base64 . encodeBytesToBytes ( resultBytes ) ; String pwd = new String ( password ) ; String ldp = new String ( result ) ; match = pwd . equals ( ldp ) ; } else { // if passwords are not encoded , just do raw compare
match = userPassword . equals ( ldapPassword ) ; } return match ; |
public class UnsupportedCycOperationException { /** * Converts a Throwable to a UnsupportedCycOperationException with the specified detail message . If the
* Throwable is a UnsupportedCycOperationException and if the Throwable ' s message is identical to the
* one supplied , the Throwable will be passed through unmodified ; otherwise , it will be wrapped in
* a new UnsupportedCycOperationException with the detail message .
* @ param cause the Throwable to convert
* @ param message the specified detail message
* @ return a UnsupportedCycOperationException */
public static UnsupportedCycOperationException fromThrowable ( String message , Throwable cause ) { } } | return ( cause instanceof UnsupportedCycOperationException && Objects . equals ( message , cause . getMessage ( ) ) ) ? ( UnsupportedCycOperationException ) cause : new UnsupportedCycOperationException ( message , cause ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcRoundedRectangleProfileDef ( ) { } } | if ( ifcRoundedRectangleProfileDefEClass == null ) { ifcRoundedRectangleProfileDefEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 500 ) ; } return ifcRoundedRectangleProfileDefEClass ; |
public class BsScheduledJobCB { public ScheduledJobCB acceptPK ( String id ) { } } | assertObjectNotNull ( "id" , id ) ; BsScheduledJobCB cb = this ; cb . query ( ) . docMeta ( ) . setId_Equal ( id ) ; return ( ScheduledJobCB ) this ; |
public class GalleriesApi { /** * Modify the photos in a gallery . Use this method to add , remove and re - order photos .
* < br >
* This method requires authentication with ' write ' permission .
* @ param galleryId Required . The id of the gallery to modify . The gallery must belong to the calling user .
* @ param primaryPhotoId Required . The id of the photo to use as the ' primary ' photo for the gallery . This id must also be passed along in photo _ ids list argument .
* @ param photoIds Required . A list of photo ids to include in the gallery . They will appear in the set in the order sent . This list must contain the primary photo id . This list of photos replaces the existing list .
* @ return object with response from Flickr indicating ok or fail .
* @ throws JinxException if required parameters are null or empty , or if there are any errors .
* @ see < a href = " https : / / www . flickr . com / services / api / flickr . galleries . editPhotos . html " > flickr . galleries . editPhotos < / a > */
public Response editPhotos ( String galleryId , String primaryPhotoId , List < String > photoIds ) throws JinxException { } } | JinxUtils . validateParams ( galleryId , primaryPhotoId , photoIds ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.galleries.editPhotos" ) ; params . put ( "gallery_id" , galleryId ) ; params . put ( "primary_photo_id" , primaryPhotoId ) ; params . put ( "photo_ids" , JinxUtils . buildCommaDelimitedList ( photoIds ) ) ; return jinx . flickrPost ( params , Response . class ) ; |
public class CitrusMessageDispatcherServlet { /** * Post process endpoint .
* @ param context */
protected void configureMessageEndpoint ( ApplicationContext context ) { } } | if ( context . containsBean ( MESSAGE_ENDPOINT_BEAN_NAME ) ) { WebServiceEndpoint messageEndpoint = context . getBean ( MESSAGE_ENDPOINT_BEAN_NAME , WebServiceEndpoint . class ) ; EndpointAdapter endpointAdapter = webServiceServer . getEndpointAdapter ( ) ; if ( endpointAdapter != null ) { messageEndpoint . setEndpointAdapter ( endpointAdapter ) ; } WebServiceEndpointConfiguration endpointConfiguration = new WebServiceEndpointConfiguration ( ) ; endpointConfiguration . setHandleMimeHeaders ( webServiceServer . isHandleMimeHeaders ( ) ) ; endpointConfiguration . setHandleAttributeHeaders ( webServiceServer . isHandleAttributeHeaders ( ) ) ; endpointConfiguration . setKeepSoapEnvelope ( webServiceServer . isKeepSoapEnvelope ( ) ) ; endpointConfiguration . setMessageConverter ( webServiceServer . getMessageConverter ( ) ) ; messageEndpoint . setEndpointConfiguration ( endpointConfiguration ) ; if ( StringUtils . hasText ( webServiceServer . getSoapHeaderNamespace ( ) ) ) { messageEndpoint . setDefaultNamespaceUri ( webServiceServer . getSoapHeaderNamespace ( ) ) ; } if ( StringUtils . hasText ( webServiceServer . getSoapHeaderPrefix ( ) ) ) { messageEndpoint . setDefaultPrefix ( webServiceServer . getSoapHeaderPrefix ( ) ) ; } } |
public class ParamTaglet { /** * Given an array of < code > Parameter < / code > s , return
* a name / rank number map . If the array is null , then
* null is returned .
* @ param params The array of parameters ( from type or executable member ) to
* check .
* @ return a name - rank number map . */
private static Map < String , String > getRankMap ( Utils utils , List < ? extends Element > params ) { } } | if ( params == null ) { return null ; } HashMap < String , String > result = new HashMap < > ( ) ; int rank = 0 ; for ( Element e : params ) { String name = utils . isTypeParameterElement ( e ) ? utils . getTypeName ( e . asType ( ) , false ) : utils . getSimpleName ( e ) ; result . put ( name , String . valueOf ( rank ) ) ; rank ++ ; } return result ; |
public class CmsDataViewParams { /** * Creates the script which calls the callback with the result . < p >
* @ param result the list of result data items
* @ return the script to call the callback */
public String prepareCallbackScript ( List < I_CmsDataViewItem > result ) { } } | try { if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( m_callbackArg ) ) { m_callbackArg = "{}" ; } JSONObject obj = new JSONObject ( m_callbackArg ) ; JSONArray selection = new JSONArray ( ) ; for ( I_CmsDataViewItem item : result ) { JSONObject singleResult = new JSONObject ( ) ; singleResult . put ( CmsDataViewConstants . FIELD_ID , item . getId ( ) ) ; singleResult . put ( CmsDataViewConstants . FIELD_TITLE , item . getTitle ( ) ) ; singleResult . put ( CmsDataViewConstants . FIELD_DESCRIPTION , item . getDescription ( ) ) ; singleResult . put ( CmsDataViewConstants . FIELD_DATA , item . getData ( ) ) ; selection . put ( singleResult ) ; } obj . put ( CmsDataViewConstants . KEY_RESULT , selection ) ; String jsonString = obj . toString ( ) ; return "parent." + m_callback + "(" + jsonString + ")" ; } catch ( Exception e ) { return null ; } |
public class Trie2_16 { /** * Serialize a Trie2_16 onto an OutputStream .
* A Trie2 can be serialized multiple times .
* The serialized data is compatible with ICU4C UTrie2 serialization .
* Trie2 serialization is unrelated to Java object serialization .
* @ param os the stream to which the serialized Trie2 data will be written .
* @ return the number of bytes written .
* @ throw IOException on an error writing to the OutputStream . */
public int serialize ( OutputStream os ) throws IOException { } } | DataOutputStream dos = new DataOutputStream ( os ) ; int bytesWritten = 0 ; bytesWritten += serializeHeader ( dos ) ; for ( int i = 0 ; i < dataLength ; i ++ ) { dos . writeChar ( index [ data16 + i ] ) ; } bytesWritten += dataLength * 2 ; return bytesWritten ; |
public class GSCHImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GSCH__HX : return HX_EDEFAULT == null ? hx != null : ! HX_EDEFAULT . equals ( hx ) ; case AfplibPackage . GSCH__HY : return HY_EDEFAULT == null ? hy != null : ! HY_EDEFAULT . equals ( hy ) ; } return super . eIsSet ( featureID ) ; |
public class CommerceOrderItemPersistenceImpl { /** * Returns the first commerce order item in the ordered set where commerceOrderId = & # 63 ; and subscription = & # 63 ; .
* @ param commerceOrderId the commerce order ID
* @ param subscription the subscription
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching commerce order item
* @ throws NoSuchOrderItemException if a matching commerce order item could not be found */
@ Override public CommerceOrderItem findByC_S_First ( long commerceOrderId , boolean subscription , OrderByComparator < CommerceOrderItem > orderByComparator ) throws NoSuchOrderItemException { } } | CommerceOrderItem commerceOrderItem = fetchByC_S_First ( commerceOrderId , subscription , orderByComparator ) ; if ( commerceOrderItem != null ) { return commerceOrderItem ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commerceOrderId=" ) ; msg . append ( commerceOrderId ) ; msg . append ( ", subscription=" ) ; msg . append ( subscription ) ; msg . append ( "}" ) ; throw new NoSuchOrderItemException ( msg . toString ( ) ) ; |
public class Cell { /** * Sets the minWidth , prefWidth , maxWidth , minHeight , prefHeight , and maxHeight to the specified value . */
public Cell < C , T > size ( float size ) { } } | size ( new FixedValue < C , T > ( layout . toolkit , size ) ) ; return this ; |
public class Unpooled { /** * Creates a new big - endian buffer whose content is a subregion of
* the specified { @ code string } encoded in the specified { @ code charset } .
* The new buffer ' s { @ code readerIndex } and { @ code writerIndex } are
* { @ code 0 } and the length of the encoded string respectively . */
public static ByteBuf copiedBuffer ( CharSequence string , int offset , int length , Charset charset ) { } } | if ( string == null ) { throw new NullPointerException ( "string" ) ; } if ( length == 0 ) { return EMPTY_BUFFER ; } if ( string instanceof CharBuffer ) { CharBuffer buf = ( CharBuffer ) string ; if ( buf . hasArray ( ) ) { return copiedBuffer ( buf . array ( ) , buf . arrayOffset ( ) + buf . position ( ) + offset , length , charset ) ; } buf = buf . slice ( ) ; buf . limit ( length ) ; buf . position ( offset ) ; return copiedBuffer ( buf , charset ) ; } return copiedBuffer ( CharBuffer . wrap ( string , offset , offset + length ) , charset ) ; |
public class DefaultGroovyMethods { /** * Bitwise NEGATE a BitSet .
* @ param self a BitSet
* @ return the bitwise NEGATE of the BitSet
* @ since 1.5.0 */
public static BitSet bitwiseNegate ( BitSet self ) { } } | BitSet result = ( BitSet ) self . clone ( ) ; result . flip ( 0 , result . size ( ) - 1 ) ; return result ; |
public class AsciiSequenceView { /** * { @ inheritDoc } */
public AsciiSequenceView subSequence ( final int start , final int end ) { } } | if ( start < 0 ) { throw new StringIndexOutOfBoundsException ( "start=" + start ) ; } if ( end > length ) { throw new StringIndexOutOfBoundsException ( "end=" + end ) ; } if ( end - start < 0 ) { throw new StringIndexOutOfBoundsException ( "start=" + start + " end=" + end ) ; } return new AsciiSequenceView ( buffer , offset + start , end - start ) ; |
public class ExpandableButtonMenu { /** * Start expand animation */
private void animateExpand ( ) { } } | mCloseBtn . setVisibility ( View . VISIBLE ) ; mMidContainer . setVisibility ( View . VISIBLE ) ; mRightContainer . setVisibility ( View . VISIBLE ) ; mLeftContainer . setVisibility ( View . VISIBLE ) ; setButtonsVisibleForPreHC ( ) ; ANIMATION_COUNTER = 0 ; ViewPropertyAnimator . animate ( mMidContainer ) . setDuration ( ANIMATION_DURATION ) . translationYBy ( - TRANSLATION_Y ) . setInterpolator ( overshoot ) . setListener ( ON_EXPAND_COLLAPSE_LISTENER ) ; ViewPropertyAnimator . animate ( mRightContainer ) . setDuration ( ANIMATION_DURATION ) . translationYBy ( - TRANSLATION_Y ) . translationXBy ( TRANSLATION_X ) . setInterpolator ( overshoot ) . setListener ( ON_EXPAND_COLLAPSE_LISTENER ) ; ViewPropertyAnimator . animate ( mLeftContainer ) . setDuration ( ANIMATION_DURATION ) . translationYBy ( - TRANSLATION_Y ) . translationXBy ( - TRANSLATION_X ) . setInterpolator ( overshoot ) . setListener ( ON_EXPAND_COLLAPSE_LISTENER ) ; |
public class WriterBasedGenerator { /** * / * Output method implementations , unprocessed ( " raw " ) */
@ Override public void writeRaw ( String text ) throws IOException , JsonGenerationException { } } | // Nothing to check , can just output as is
int len = text . length ( ) ; int room = _outputEnd - _outputTail ; if ( room == 0 ) { _flushBuffer ( ) ; room = _outputEnd - _outputTail ; } // But would it nicely fit in ? If yes , it ' s easy
if ( room >= len ) { text . getChars ( 0 , len , _outputBuffer , _outputTail ) ; _outputTail += len ; } else { writeRawLong ( text ) ; } |
public class StorePackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getPluginDescriptor ( ) { } } | if ( pluginDescriptorEClass == null ) { pluginDescriptorEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 29 ) ; } return pluginDescriptorEClass ; |
public class GenericDraweeHierarchy { /** * Sets a new placeholder drawable with scale type .
* @ param resourceId an identifier of an Android drawable or color resource .
* @ param ScalingUtils . ScaleType a new scale type . */
public void setPlaceholderImage ( int resourceId , ScalingUtils . ScaleType scaleType ) { } } | setPlaceholderImage ( mResources . getDrawable ( resourceId ) , scaleType ) ; |
public class TextReport { /** * Display mode for output streams . */
public void setShowOutput ( String mode ) { } } | try { this . outputMode = OutputMode . valueOf ( mode . toUpperCase ( Locale . ROOT ) ) ; } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException ( "showOutput accepts any of: " + Arrays . toString ( OutputMode . values ( ) ) + ", value is not valid: " + mode ) ; } |
public class ReportRunner { /** * Set a list of alert object for report of type alarm
* @ param alerts
* list of alert object */
public void setAlerts ( List < Alert > alerts ) { } } | if ( format == null ) { throw new IllegalStateException ( "You have to use setFormat with a valid output format before using setAlert!" ) ; } if ( ! ALARM_FORMAT . equals ( format ) && ! INDICATOR_FORMAT . equals ( format ) && ! DISPLAY_FORMAT . equals ( format ) ) { throw new IllegalStateException ( "You can use setAlert only for ALARM, INDICATOR or DISPLAY output formats!" ) ; } this . alerts = alerts ; |
public class WorkspacesInner { /** * Creates a Workspace .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param workspaceName The name of the workspace . Workspace names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long .
* @ param parameters Workspace creation parameters .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the WorkspaceInner object */
public Observable < WorkspaceInner > beginCreateAsync ( String resourceGroupName , String workspaceName , WorkspaceCreateParameters parameters ) { } } | return beginCreateWithServiceResponseAsync ( resourceGroupName , workspaceName , parameters ) . map ( new Func1 < ServiceResponse < WorkspaceInner > , WorkspaceInner > ( ) { @ Override public WorkspaceInner call ( ServiceResponse < WorkspaceInner > response ) { return response . body ( ) ; } } ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcSimpleValue ( ) { } } | if ( ifcSimpleValueEClass == null ) { ifcSimpleValueEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 969 ) ; } return ifcSimpleValueEClass ; |
public class ComputeNodesImpl { /** * Upload Azure Batch service log files from the specified compute node to Azure Blob Storage .
* This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support . The Azure Batch service log files should be shared with Azure support to aid in debugging issues with the Batch service .
* @ param poolId The ID of the pool that contains the compute node .
* @ param nodeId The ID of the compute node from which you want to upload the Azure Batch service log files .
* @ param uploadBatchServiceLogsConfiguration The Azure Batch service log files upload configuration .
* @ param computeNodeUploadBatchServiceLogsOptions Additional parameters for the operation
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the UploadBatchServiceLogsResult object */
public Observable < UploadBatchServiceLogsResult > uploadBatchServiceLogsAsync ( String poolId , String nodeId , UploadBatchServiceLogsConfiguration uploadBatchServiceLogsConfiguration , ComputeNodeUploadBatchServiceLogsOptions computeNodeUploadBatchServiceLogsOptions ) { } } | return uploadBatchServiceLogsWithServiceResponseAsync ( poolId , nodeId , uploadBatchServiceLogsConfiguration , computeNodeUploadBatchServiceLogsOptions ) . map ( new Func1 < ServiceResponseWithHeaders < UploadBatchServiceLogsResult , ComputeNodeUploadBatchServiceLogsHeaders > , UploadBatchServiceLogsResult > ( ) { @ Override public UploadBatchServiceLogsResult call ( ServiceResponseWithHeaders < UploadBatchServiceLogsResult , ComputeNodeUploadBatchServiceLogsHeaders > response ) { return response . body ( ) ; } } ) ; |
public class ModuleRenaming { /** * Returns the globalized name of a reference to a binding in JS Doc . See { @ link
* # replace ( AbstractCompiler , ModuleMap , Binding , Node ) } to replace actual code nodes .
* < p > For example :
* < pre >
* / / bar
* export class Bar { }
* < / pre >
* < pre >
* / / foo
* import * as bar from ' bar ' ;
* export { bar } ;
* < / pre >
* < pre >
* import * as foo from ' foo ' ;
* let / * * ! foo . bar . Bar * \ / b ;
* < / pre >
* < p > Should call this method with the binding for { @ code foo } and a list ( " bar " , " Bar " ) . In this
* example any of these properties could also be modules . This method will replace as much as the
* GETPROP as it can with module exported variables . Meaning in the above example this would
* return something like " baz $ $ module $ bar " , whereas if this method were called for just " foo . bar "
* it would return " module $ bar " , as it refers to a module object itself . */
static String getGlobalNameForJsDoc ( ModuleMap moduleMap , Binding binding , List < String > propertyChain ) { } } | int prop = 0 ; while ( binding . isModuleNamespace ( ) && binding . metadata ( ) . isEs6Module ( ) && prop < propertyChain . size ( ) ) { String propertyName = propertyChain . get ( prop ) ; Module m = moduleMap . getModule ( binding . metadata ( ) . path ( ) ) ; if ( m . namespace ( ) . containsKey ( propertyName ) ) { binding = m . namespace ( ) . get ( propertyName ) ; } else { // This means someone referenced an invalid export on a module object . This should be an
// error , so just rewrite and let the type checker complain later . It isn ' t a super clear
// error , but we ' re working on type checking modules soon .
break ; } prop ++ ; } String globalName = getGlobalName ( binding ) ; if ( prop < propertyChain . size ( ) ) { globalName = globalName + "." + Joiner . on ( '.' ) . join ( propertyChain . subList ( prop , propertyChain . size ( ) ) ) ; } return globalName ; |
public class ST_RemoveRepeatedPoints { /** * Removes duplicated points within a geometry .
* @ param geom
* @ param tolerance to delete the coordinates
* @ return
* @ throws java . sql . SQLException */
public static Geometry removeDuplicateCoordinates ( Geometry geom , double tolerance ) throws SQLException { } } | if ( geom == null ) { return null ; } else if ( geom . isEmpty ( ) ) { return geom ; } else if ( geom instanceof Point ) { return geom ; } else if ( geom instanceof MultiPoint ) { return geom ; } else if ( geom instanceof LineString ) { return removeDuplicateCoordinates ( ( LineString ) geom , tolerance ) ; } else if ( geom instanceof MultiLineString ) { return removeDuplicateCoordinates ( ( MultiLineString ) geom , tolerance ) ; } else if ( geom instanceof Polygon ) { return removeDuplicateCoordinates ( ( Polygon ) geom , tolerance ) ; } else if ( geom instanceof MultiPolygon ) { return removeDuplicateCoordinates ( ( MultiPolygon ) geom , tolerance ) ; } else if ( geom instanceof GeometryCollection ) { return removeDuplicateCoordinates ( ( GeometryCollection ) geom , tolerance ) ; } return null ; |
public class GetInstancesHealthStatusResult { /** * A complex type that contains the IDs and the health status of the instances that you specified in the
* < code > GetInstancesHealthStatus < / code > request .
* @ param status
* A complex type that contains the IDs and the health status of the instances that you specified in the
* < code > GetInstancesHealthStatus < / code > request .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetInstancesHealthStatusResult withStatus ( java . util . Map < String , String > status ) { } } | setStatus ( status ) ; return this ; |
public class MediaPackageGroupSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( MediaPackageGroupSettings mediaPackageGroupSettings , ProtocolMarshaller protocolMarshaller ) { } } | if ( mediaPackageGroupSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( mediaPackageGroupSettings . getDestination ( ) , DESTINATION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class BrownTokenClasses { /** * It provides a list containing the pathLengths for a token if found in the
* { @ code BrownCluster } Map token , BrownClass .
* @ param token
* the token to be looked up in the brown clustering map
* @ param brownLexicon
* the Brown clustering map
* @ return the list of the paths for a token */
public static List < String > getWordClasses ( final String token , final WordCluster brownLexicon ) { } } | if ( brownLexicon . lookupToken ( token ) == null ) { return new ArrayList < String > ( 0 ) ; } else { final String brownClass = brownLexicon . lookupToken ( token ) ; final List < String > pathLengthsList = new ArrayList < String > ( ) ; pathLengthsList . add ( brownClass . substring ( 0 , Math . min ( brownClass . length ( ) , pathLengths [ 0 ] ) ) ) ; for ( int i = 1 ; i < pathLengths . length ; i ++ ) { if ( pathLengths [ i - 1 ] < brownClass . length ( ) ) { pathLengthsList . add ( brownClass . substring ( 0 , Math . min ( brownClass . length ( ) , pathLengths [ i ] ) ) ) ; } } return pathLengthsList ; } |
public class DZcs_permute { /** * Permutes a sparse matrix , C = PAQ .
* @ param A
* m - by - n , column - compressed matrix
* @ param pinv
* a permutation vector of length m
* @ param q
* a permutation vector of length n
* @ param values
* allocate pattern only if false , values and pattern otherwise
* @ return C = PAQ , null on error */
public static DZcs cs_permute ( DZcs A , int [ ] pinv , int [ ] q , boolean values ) { } } | int t , j , k , nz = 0 , m , n , Ap [ ] , Ai [ ] , Cp [ ] , Ci [ ] ; DZcsa Cx = new DZcsa ( ) , Ax = new DZcsa ( ) ; DZcs C ; if ( ! CS_CSC ( A ) ) return ( null ) ; /* check inputs */
m = A . m ; n = A . n ; Ap = A . p ; Ai = A . i ; Ax . x = A . x ; C = cs_spalloc ( m , n , Ap [ n ] , values && Ax . x != null , false ) ; /* alloc result */
Cp = C . p ; Ci = C . i ; Cx . x = C . x ; for ( k = 0 ; k < n ; k ++ ) { Cp [ k ] = nz ; /* column k of C is column q [ k ] of A */
j = q != null ? ( q [ k ] ) : k ; for ( t = Ap [ j ] ; t < Ap [ j + 1 ] ; t ++ ) { if ( Cx . x != null ) Cx . set ( nz , Ax . get ( t ) ) ; /* row i of A is row pinv [ i ] of C */
Ci [ nz ++ ] = pinv != null ? ( pinv [ Ai [ t ] ] ) : Ai [ t ] ; } } Cp [ n ] = nz ; /* finalize the last column of C */
return C ; |
public class LatLongUtils { /** * Returns the destination point from this point having travelled the given distance on the
* given initial bearing ( bearing normally varies around path followed ) .
* @ param start the start point
* @ param distance the distance travelled , in same units as earth radius ( default : meters )
* @ param bearing the initial bearing in degrees from north
* @ return the destination point
* @ see < a href = " http : / / www . movable - type . co . uk / scripts / latlon . js " > latlon . js < / a > */
public static LatLong destinationPoint ( LatLong start , double distance , float bearing ) { } } | double theta = Math . toRadians ( bearing ) ; double delta = distance / EQUATORIAL_RADIUS ; // angular distance in radians
double phi1 = Math . toRadians ( start . latitude ) ; double lambda1 = Math . toRadians ( start . longitude ) ; double phi2 = Math . asin ( Math . sin ( phi1 ) * Math . cos ( delta ) + Math . cos ( phi1 ) * Math . sin ( delta ) * Math . cos ( theta ) ) ; double lambda2 = lambda1 + Math . atan2 ( Math . sin ( theta ) * Math . sin ( delta ) * Math . cos ( phi1 ) , Math . cos ( delta ) - Math . sin ( phi1 ) * Math . sin ( phi2 ) ) ; return new LatLong ( Math . toDegrees ( phi2 ) , Math . toDegrees ( lambda2 ) ) ; |
public class Generator { /** * The runtime main . String arguments are treated and parsed as
* command line parameters .
* @ param args
* Command line arguments . */
public static void main ( String [ ] args ) { } } | Generator schemaGen = new Generator ( ) ; System . exit ( schemaGen . createSchema ( args ) ) ; |
public class AdminSuggestAction { @ Override protected void setupHtmlData ( final ActionRuntime runtime ) { } } | super . setupHtmlData ( runtime ) ; runtime . registerData ( "helpLink" , systemHelper . getHelpLink ( fessConfig . getOnlineHelpNameSuggest ( ) ) ) ; runtime . registerData ( "totalWordsNum" , suggestHelper . getAllWordsNum ( ) ) ; runtime . registerData ( "documentWordsNum" , suggestHelper . getDocumentWordsNum ( ) ) ; runtime . registerData ( "queryWordsNum" , suggestHelper . getQueryWordsNum ( ) ) ; |
public class Configs { /** * Get system config decimal . Config key include prefix .
* Example : < br >
* If key . getKeyString ( ) is " test " , < br >
* getSystemConfigDecimal ( " 1 . " , key ) ; will return " 1 . test " config value in system config file .
* @ param keyPrefix config key prefix
* @ param key config key
* @ return config BigDecimal value . Return null if not config in
* system config file " { @ value # DEFAULT _ SYSTEM _ CONFIG _ ABSOLUTE _ CLASS _ PATH } " or self define system config path .
* @ see # setSystemConfigs ( String , OneProperties ) */
public static BigDecimal getSystemConfigDecimal ( String keyPrefix , IConfigKey key ) { } } | return systemConfigs . getDecimalConfig ( keyPrefix , key ) ; |
public class FrequencySketch { /** * Increments the specified counter by 1 if it is not already at the maximum value ( 15 ) .
* @ param i the table index ( 16 counters )
* @ param j the counter to increment
* @ return if incremented */
private boolean incrementAt ( int i , int j ) { } } | int offset = j << 2 ; long mask = ( 0xfL << offset ) ; long t = tableAt ( i ) ; if ( ( t & mask ) != mask ) { tableAt ( i , t + ( 1L << offset ) ) ; return true ; } return false ; |
public class AtomPlacer3D { /** * Method assigns 3D coordinates to the heavy atoms in an aliphatic chain .
* @ param molecule the reference molecule for the chain
* @ param chain the atoms to be assigned , must be connected
* @ throws CDKException the ' chain ' was not a chain */
public void placeAliphaticHeavyChain ( IAtomContainer molecule , IAtomContainer chain ) throws CDKException { } } | // logger . debug ( " * * * * * Place aliphatic Chain * * * * * " ) ;
int [ ] first = new int [ 2 ] ; int counter = 1 ; int nextAtomNr = 0 ; String id1 = "" ; String id2 = "" ; String id3 = "" ; first = findHeavyAtomsInChain ( molecule , chain ) ; distances = new double [ first [ 1 ] ] ; firstAtoms = new int [ first [ 1 ] ] ; angles = new double [ first [ 1 ] ] ; secondAtoms = new int [ first [ 1 ] ] ; dihedrals = new double [ first [ 1 ] ] ; thirdAtoms = new int [ first [ 1 ] ] ; firstAtoms [ 0 ] = first [ 0 ] ; molecule . getAtom ( firstAtoms [ 0 ] ) . setFlag ( CDKConstants . VISITED , true ) ; int hybridisation = 0 ; for ( int i = 0 ; i < chain . getAtomCount ( ) ; i ++ ) { if ( isHeavyAtom ( chain . getAtom ( i ) ) ) { if ( ! chain . getAtom ( i ) . getFlag ( CDKConstants . VISITED ) ) { // logger . debug ( " Counter : " + counter ) ;
nextAtomNr = molecule . indexOf ( chain . getAtom ( i ) ) ; id2 = molecule . getAtom ( firstAtoms [ counter - 1 ] ) . getAtomTypeName ( ) ; id1 = molecule . getAtom ( nextAtomNr ) . getAtomTypeName ( ) ; if ( molecule . getBond ( molecule . getAtom ( firstAtoms [ counter - 1 ] ) , molecule . getAtom ( nextAtomNr ) ) == null ) throw new CDKException ( "atoms do not form a chain, please use ModelBuilder3D" ) ; distances [ counter ] = getBondLengthValue ( id1 , id2 ) ; // logger . debug ( " Distance : " + distances [ counter ] ) ;
firstAtoms [ counter ] = nextAtomNr ; secondAtoms [ counter ] = firstAtoms [ counter - 1 ] ; if ( counter > 1 ) { id3 = molecule . getAtom ( firstAtoms [ counter - 2 ] ) . getAtomTypeName ( ) ; hybridisation = getHybridisationState ( molecule . getAtom ( firstAtoms [ counter - 1 ] ) ) ; angles [ counter ] = getAngleValue ( id1 , id2 , id3 ) ; // Check if sp , sp2
if ( angles [ counter ] == - 1 ) { if ( hybridisation == 3 ) { angles [ counter ] = DEFAULT_SP3_ANGLE ; } else if ( hybridisation == 2 ) { angles [ counter ] = DEFAULT_SP2_ANGLE ; } else if ( hybridisation == 1 ) { angles [ counter ] = DEFAULT_SP_ANGLE ; } } thirdAtoms [ counter ] = firstAtoms [ counter - 2 ] ; // logger . debug ( " Angle : " + angles [ counter ] ) ;
} else { angles [ counter ] = - 1 ; thirdAtoms [ counter ] = - 1 ; } if ( counter > 2 ) { // double bond
try { if ( getDoubleBondConfiguration2D ( molecule . getBond ( molecule . getAtom ( firstAtoms [ counter - 1 ] ) , molecule . getAtom ( firstAtoms [ counter - 2 ] ) ) , ( molecule . getAtom ( firstAtoms [ counter ] ) ) . getPoint2d ( ) , ( molecule . getAtom ( firstAtoms [ counter - 1 ] ) ) . getPoint2d ( ) , ( molecule . getAtom ( firstAtoms [ counter - 2 ] ) ) . getPoint2d ( ) , ( molecule . getAtom ( firstAtoms [ counter - 3 ] ) ) . getPoint2d ( ) ) == 5 ) { dihedrals [ counter ] = DIHEDRAL_BRANCHED_CHAIN ; } else { dihedrals [ counter ] = DIHEDRAL_EXTENDED_CHAIN ; } } catch ( CDKException ex1 ) { dihedrals [ counter ] = DIHEDRAL_EXTENDED_CHAIN ; } } else { dihedrals [ counter ] = - 1 ; } counter ++ ; } } } |
public class Debug { /** * Like println , but will print PC , if it ' s passed in
* e . g . Debug . println ( getPC ( ) , " Hello world " ) ; will print [ PC : 42 ] Hello world
* @ param pc
* the program counter
* @ param obj
* the object to output */
public static void println ( int pc , Object obj ) { } } | out . printf ( "[PC:%d] %s%n" , Integer . valueOf ( pc ) , obj ) ; |
public class lbvserver_servicegroup_binding { /** * Use this API to fetch lbvserver _ servicegroup _ binding resources of given name . */
public static lbvserver_servicegroup_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | lbvserver_servicegroup_binding obj = new lbvserver_servicegroup_binding ( ) ; obj . set_name ( name ) ; lbvserver_servicegroup_binding response [ ] = ( lbvserver_servicegroup_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class EJBMethodInfoImpl { /** * F86406 */
public void introspect ( IntrospectionWriter writer , String type , int methodId , boolean dumpCMP2xAccessIntent ) { } } | writer . begin ( null ) ; writer . println ( "Method signature = " + methodSignature + ( ( type != null ) ? ( " (" + type + ")" ) : "" ) ) ; writer . println ( "Method index = " + ( ( methodId != Integer . MAX_VALUE ) ? methodId : "unknown" ) ) ; writer . println ( "TX attribute = " + MethodAttribUtils . TX_ATTR_STR [ txAttr . getValue ( ) ] ) ; if ( asAttr != null ) { writer . println ( "AS attribute = " + asAttr . toString ( ) ) ; } // d493211 start
// Is this a EJB 1 . x module ?
if ( bmd . ivModuleVersion <= BeanMetaData . J2EE_EJB_VERSION_1_1 ) { // Yep , this is a 1 . x module version , so old connection manager is being used .
// Old connection manager does not allow isolation level to change once set
// for a transaction . So dump the isolation level that is used for CMP 1 . x access
// regardless of bean type being processed . This is done since the first
// method call in a transaction that is started by a EJB in a 1 . x module
// causes the isolation level for that TX to be set . See preInvokeActivate
// method in EJSContainer to see the logic for setting TX isolation level .
writer . println ( "CMP 1.x Isolation Level = " + MethodAttribUtils . getIsolationLevelString ( isolationAttr ) ) ; // If this is a CMP 1 . x bean , then dump read only attribute for the CMP 1 . x bean .
// Does not apply for other bean types , so only do for CMP 1 . x beans . See ContainerManagedBeanO
// for CMP 1 . x implementation since that is the only place that uses the read only attribute
// ( e . g . used to determine if dirty flag should be set for the CMP 1 . x bean ) . Note , WAS does
// NOT support CMP 2 . x beans in a 1 . x module , so we do not have to worry about CMP 2 . x .
if ( bmd . cmpVersion == InternalConstants . CMP_VERSION_1_X ) { writer . println ( "CMP 1.x access intent(read-only attribute) = " + readOnlyAttr ) ; } } else { // This is a 2 . x or later module version , so new J2C connection manager is being used .
// Is this a CMP 2 . x bean and dumpCMP2xAccessIntent is true ?
if ( bmd . cmpVersion == InternalConstants . CMP_VERSION_2_X && dumpCMP2xAccessIntent ) { introspectCMP2xAccessIntent ( writer ) ; } else { // Not a CMP 2 . x bean in 2 . x module or later or dumpCMP2xAccessIntent is false .
// We know this is a 2 . x or later module version . If this is a CMP 1 . x bean , then dump the
// CMP 1 . x isolation level and read only attribute . Only do this for CMP 1 . x rather
// than all EJB types since preInvokeActivate in EJSContainer only sets TX
// isolation level when module version is 2 . x or later when the EJB type is CMP 1 . x .
if ( bmd . cmpVersion == InternalConstants . CMP_VERSION_1_X ) { writer . println ( "CMP 1.x Isolation Level = " + MethodAttribUtils . getIsolationLevelString ( isolationAttr ) ) ; writer . println ( "CMP 1.x access intent(read-only attribute) = " + readOnlyAttr ) ; } } } // d493211 end
writer . println ( "isAsynchMethod = " + ivAsynchMethod ) ; writer . println ( "JDI signature = " + jdiMethodSignature ) ; // F743-1752CodRev start
if ( isSingletonSessionBean ) // F743-1752.1
{ if ( bmd . ivSingletonUsesBeanManagedConcurrency ) { writer . println ( "Singleton LockType = Bean Managed" ) ; } else { String lockType = null ; if ( ivLockType != null ) { lockType = ivLockType . name ( ) ; } else { if ( ivInterface == MethodInterface . LIFECYCLE_INTERCEPTOR ) { lockType = "not applicable for lifecycle methods" ; } } writer . println ( "Singleton LockType = " + lockType ) ; writer . println ( "Singleton Access Timeout = " + ivAccessTimeout ) ; } } // F743-1752CodRev end
else if ( isStatefulSessionBean ) { // dump unique Stateful method data F743-22462
writer . println ( "Stateful Access Timeout = " + ivAccessTimeout ) ; } introspectDeclaredExceptions ( writer ) ; introspectSecurityInfo ( writer ) ; writer . end ( ) ; |
public class HtmlSerializer { /** * Must be called first . */
@ Override public void startDocument ( ) throws SAXException { } } | try { switch ( doctype ) { case NO_DOCTYPE : return ; case DOCTYPE_HTML5 : writer . write ( "<!DOCTYPE html>\n" ) ; return ; case DOCTYPE_HTML401_STRICT : writer . write ( "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n" ) ; return ; case DOCTYPE_HTML401_TRANSITIONAL : writer . write ( "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" ) ; return ; } } catch ( IOException ioe ) { throw ( SAXException ) new SAXException ( ioe ) . initCause ( ioe ) ; } |
public class AWSDataSyncClient { /** * Deletes an agent . To specify which agent to delete , use the Amazon Resource Name ( ARN ) of the agent in your
* request . The operation disassociates the agent from your AWS account . However , it doesn ' t delete the agent
* virtual machine ( VM ) from your on - premises environment .
* < note >
* After you delete an agent , you can ' t reactivate it and you longer pay software charges for it .
* < / note >
* @ param deleteAgentRequest
* DeleteAgentRequest
* @ return Result of the DeleteAgent operation returned by the service .
* @ throws InvalidRequestException
* This exception is thrown when the client submits a malformed request .
* @ sample AWSDataSync . DeleteAgent
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / datasync - 2018-11-09 / DeleteAgent " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public DeleteAgentResult deleteAgent ( DeleteAgentRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDeleteAgent ( request ) ; |
public class Property { /** * Returns this property ' s annotation for the specified type if
* such an annotation is < em > collectively and directly present < / em > ,
* else { @ code null } .
* < p > This method ignores inherited annotations . and returns { @ code null }
* if no annotations are < em > collectively and directly present < / em > on
* this property ' s members .
* @ param < T > the type of the annotation to query for and return if
* collectively and directly present
* @ param annotationClass the Class corresponding to the annotation type
* @ return this property ' s annotation for the specified annotation type if
* collectively and directly present on this element , else { @ code null }
* @ throws NullPointerException if the given annotation class is { @ code null } */
@ SuppressWarnings ( "override" ) // must be disabled to support jdk 6 +
public < T extends Annotation > T getDeclaredAnnotation ( Class < T > annotationClass ) { } } | if ( annotationClass == null ) { throw new NullPointerException ( "Cannot get a declared annotation with a 'null' annotationClass." ) ; } return annotationClass . cast ( declaredAnnotations . get ( annotationClass ) ) ; |
public class JMResources { /** * Gets string list as opt with classpath .
* @ param classpathOrFilePath the classpath or file path
* @ return the string list as opt with classpath */
public static Optional < List < String > > getStringListAsOptWithClasspath ( String classpathOrFilePath ) { } } | return getResourceInputStreamAsOpt ( classpathOrFilePath ) . map ( JMInputStream :: readLines ) ; |
public class UserAPI { /** * 设置关注者备注
* @ param openid 关注者ID
* @ param remark 备注内容
* @ return 调用结果 */
public ResultType setUserRemark ( String openid , String remark ) { } } | BeanUtil . requireNonNull ( openid , "openid is null" ) ; LOG . debug ( "设置关注者备注....." ) ; String url = BASE_API_URL + "cgi-bin/user/info/updateremark?access_token=#" ; Map < String , String > param = new HashMap < String , String > ( ) ; param . put ( "openid" , openid ) ; param . put ( "remark" , remark ) ; BaseResponse response = executePost ( url , JSONUtil . toJson ( param ) ) ; return ResultType . get ( response . getErrcode ( ) ) ; |
public class HttpChannelConfig { /** * Query whether or not the HTTP Channel should swallow
* inbound connections IOE
* @ return boolean */
public boolean throwIOEForInboundConnections ( ) { } } | // If the httpOption throwIOEForInboundConnections is defined , return that value
if ( this . throwIOEForInboundConnections != null ) return this . throwIOEForInboundConnections ; // PI57542
// Otherwise , verify if a declarative service has been set to dictate the behavior
// for this property . If not , return false .
Boolean IOEForInboundConnectionsBehavior = HttpDispatcher . useIOEForInboundConnectionsBehavior ( ) ; return ( ( IOEForInboundConnectionsBehavior != null ) ? IOEForInboundConnectionsBehavior : Boolean . FALSE ) ; |
public class RunLevel { /** * Returns the list of all initializers .
* @ return list of all initializers */
private List < String > getAllInitializers ( ) { } } | final List < String > ret = new ArrayList < > ( ) ; for ( final CacheMethod cacheMethod : this . cacheMethods ) { ret . add ( cacheMethod . className ) ; } if ( this . parent != null ) { ret . addAll ( this . parent . getAllInitializers ( ) ) ; } return ret ; |
public class PermissionAction { /** * 根据菜单配置来分配权限 */
public String edit ( ) { } } | Integer roleId = getId ( "role" , Integer . class ) ; Role role = entityDao . get ( Role . class , roleId ) ; User user = userService . get ( SecurityUtils . getUsername ( ) ) ; put ( "manager" , user ) ; List < Role > mngRoles = CollectUtils . newArrayList ( ) ; if ( isAdmin ( ) ) { mngRoles = entityDao . getAll ( Role . class ) ; } else { for ( RoleMember m : user . getMembers ( ) ) { if ( m . isGranter ( ) ) mngRoles . add ( m . getRole ( ) ) ; } } put ( "mngRoles" , mngRoles ) ; List < MenuProfile > menuProfiles = securityHelper . getMenuService ( ) . getProfiles ( role ) ; put ( "menuProfiles" , menuProfiles ) ; MenuProfile menuProfile = securityHelper . getMenuService ( ) . getProfile ( role , getInt ( "menuProfileId" ) ) ; if ( null == menuProfile && ! menuProfiles . isEmpty ( ) ) { menuProfile = menuProfiles . get ( 0 ) ; } List < Menu > menus = CollectUtils . newArrayList ( ) ; if ( null != menuProfile ) { Collection < FuncResource > resources = null ; if ( isAdmin ( ) ) { menus = menuProfile . getMenus ( ) ; resources = entityDao . getAll ( FuncResource . class ) ; } else { resources = CollectUtils . newHashSet ( ) ; Map < String , Object > params = CollectUtils . newHashMap ( ) ; String hql = "select distinct fp.resource from " + FuncPermission . class . getName ( ) + " fp where fp.role.id = :roleId" ; Set < Menu > menuSet = CollectUtils . newHashSet ( ) ; for ( RoleMember m : user . getMembers ( ) ) { if ( ! m . isGranter ( ) ) continue ; menuSet . addAll ( securityHelper . getMenuService ( ) . getMenus ( menuProfile , m . getRole ( ) , true ) ) ; params . put ( "roleId" , m . getRole ( ) . getId ( ) ) ; List < FuncResource > roleResources = entityDao . search ( hql , params ) ; resources . addAll ( roleResources ) ; } menus = CollectUtils . newArrayList ( menuSet ) ; Collections . sort ( menus , new PropertyComparator ( "code" ) ) ; } put ( "resources" , CollectUtils . newHashSet ( resources ) ) ; boolean displayFreezen = getBool ( "displayFreezen" ) ; if ( ! displayFreezen ) { List < Menu > freezed = CollectUtils . newArrayList ( ) ; for ( Menu menu : menus ) { if ( ! menu . isEnabled ( ) ) freezed . add ( menu ) ; } menus . removeAll ( freezed ) ; } Set < FuncResource > roleResources = CollectUtils . newHashSet ( ) ; List < FuncPermission > permissions = securityHelper . getFuncPermissionService ( ) . getPermissions ( role ) ; Collection < Menu > roleMenus = securityHelper . getMenuService ( ) . getMenus ( menuProfile , role , null ) ; for ( final FuncPermission permission : permissions ) { roleResources . add ( permission . getResource ( ) ) ; } put ( "roleMenus" , CollectUtils . newHashSet ( roleMenus ) ) ; put ( "roleResources" , roleResources ) ; Set < Role > parents = CollectUtils . newHashSet ( ) ; Set < FuncResource > parentResources = CollectUtils . newHashSet ( ) ; Set < Menu > parentMenus = CollectUtils . newHashSet ( ) ; Role parent = role . getParent ( ) ; while ( null != parent && ! parents . contains ( parent ) ) { List < FuncPermission > parentPermissions = securityHelper . getFuncPermissionService ( ) . getPermissions ( parent ) ; parentMenus . addAll ( securityHelper . getMenuService ( ) . getMenus ( menuProfile , parent , null ) ) ; for ( final FuncPermission permission : parentPermissions ) { parentResources . add ( permission . getResource ( ) ) ; } parents . add ( parent ) ; parent = parent . getParent ( ) ; } put ( "parentMenus" , parentMenus ) ; put ( "parentResources" , parentResources ) ; } else { put ( "roleMenus" , Collections . emptySet ( ) ) ; put ( "roleResources" , Collections . emptySet ( ) ) ; put ( "parentMenus" , Collections . emptySet ( ) ) ; put ( "parentResources" , Collections . emptySet ( ) ) ; } put ( "menus" , menus ) ; put ( "menuProfile" , menuProfile ) ; put ( "role" , role ) ; return forward ( ) ; |
public class FastDateFormat { /** * 获得 { @ link FastDateFormat } 实例 < br >
* 支持缓存
* @ param style time style : FULL , LONG , MEDIUM , or SHORT
* @ param locale { @ link Locale } 日期地理位置
* @ return 本地化 { @ link FastDateFormat } */
public static FastDateFormat getTimeInstance ( final int style , final Locale locale ) { } } | return cache . getTimeInstance ( style , null , locale ) ; |
public class ModelsImpl { /** * Deletes a prebuilt domain ' s models from the application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param domainName Domain name .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < OperationStatus > deleteCustomPrebuiltDomainAsync ( UUID appId , String versionId , String domainName , final ServiceCallback < OperationStatus > serviceCallback ) { } } | return ServiceFuture . fromResponse ( deleteCustomPrebuiltDomainWithServiceResponseAsync ( appId , versionId , domainName ) , serviceCallback ) ; |
public class RoundedMoney { /** * ( non - Javadoc )
* @ see javax . money . MonetaryAmount # pow ( int ) */
public RoundedMoney pow ( int n ) { } } | MathContext mc = monetaryContext . get ( MathContext . class ) ; if ( mc == null ) { mc = MathContext . DECIMAL64 ; } return new RoundedMoney ( number . pow ( n , mc ) , currency , rounding ) . with ( rounding ) ; |
public class XMLEmitter { /** * End of an element .
* @ param sNamespacePrefix
* Optional namespace prefix . May be < code > null < / code > .
* @ param sTagName
* Tag name
* @ param eBracketMode
* Bracket mode to use . Never < code > null < / code > . */
public void onElementEnd ( @ Nullable final String sNamespacePrefix , @ Nonnull final String sTagName , @ Nonnull final EXMLSerializeBracketMode eBracketMode ) { } } | if ( eBracketMode . isOpenClose ( ) ) { _append ( "</" ) ; if ( StringHelper . hasText ( sNamespacePrefix ) ) _appendMasked ( EXMLCharMode . ELEMENT_NAME , sNamespacePrefix ) . _append ( CXML . XML_PREFIX_NAMESPACE_SEP ) ; _appendMasked ( EXMLCharMode . ELEMENT_NAME , sTagName ) . _append ( '>' ) ; } |
public class GibbsSampler { /** * Resample the specified variable conditioned on all of the other variables . */
private Assignment doSample ( FactorGraph factorGraph , Assignment curAssignment , int varNum ) { } } | // Retain the assignments to all other variables .
Assignment otherVarAssignment = curAssignment . removeAll ( varNum ) ; // Multiply together all of the factors which define a probability distribution over
// variable varNum , conditioned on all other variables .
Set < Integer > factorNums = factorGraph . getFactorsWithVariable ( varNum ) ; Preconditions . checkState ( factorNums . size ( ) > 0 , "Variable not in factor: " + varNum + " " + factorNums ) ; List < Factor > factorsToCombine = new ArrayList < Factor > ( ) ; for ( Integer factorNum : factorNums ) { Factor conditional = factorGraph . getFactor ( factorNum ) . conditional ( otherVarAssignment ) ; factorsToCombine . add ( conditional . marginalize ( otherVarAssignment . getVariableNums ( ) ) ) ; } Factor toSampleFrom = factorsToCombine . get ( 0 ) . product ( factorsToCombine . subList ( 1 , factorsToCombine . size ( ) ) ) ; // Draw the sample and update the sampler ' s current assignment .
Assignment subsetValues = toSampleFrom . sample ( ) ; return otherVarAssignment . union ( subsetValues ) ; |
public class BitUtil { /** * returns 0 based index of first set bit
* < br / > This is an alternate implementation of ntz ( ) */
public static int ntz3 ( long x ) { } } | // another implementation taken from Hackers Delight , extended to 64 bits
// and converted to Java .
// Many 32 bit ntz algorithms are at http : / / www . hackersdelight . org / HDcode / ntz . cc
int n = 1 ; // do the first step as a long , all others as ints .
int y = ( int ) x ; if ( y == 0 ) { n += 32 ; y = ( int ) ( x >>> 32 ) ; } if ( ( y & 0x0000FFFF ) == 0 ) { n += 16 ; y >>>= 16 ; } if ( ( y & 0x000000FF ) == 0 ) { n += 8 ; y >>>= 8 ; } if ( ( y & 0x0000000F ) == 0 ) { n += 4 ; y >>>= 4 ; } if ( ( y & 0x00000003 ) == 0 ) { n += 2 ; y >>>= 2 ; } return n - ( y & 1 ) ; |
public class BillableRevenueOverrides { /** * Gets the netBillableRevenueOverride value for this BillableRevenueOverrides .
* @ return netBillableRevenueOverride * The overridden { @ link ReconciliationLineItemReport # netBillableRevenue } .
* < p > If the { @ link ReconciliationLineItemReport } data
* is for a { @ link ProposalLineItem }
* and the { @ link ReconciliationLineItemReport # pricingModel }
* is
* { @ link PricingModel # GROSS } , then this value will be
* calculated using the
* { @ link # billableRevenueOverride } and the proposal
* line item ' s billing
* settings . Otherwise , the value of this field will
* be the same as the
* { @ link # billableRevenueOverride } . < / p >
* < p > This value is read - only . < / p > */
public com . google . api . ads . admanager . axis . v201808 . Money getNetBillableRevenueOverride ( ) { } } | return netBillableRevenueOverride ; |
public class GetCommentRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetCommentRequest getCommentRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getCommentRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getCommentRequest . getCommentId ( ) , COMMENTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AttachedRemoteSubscriberControl { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . AbstractControllable # checkValidControllable ( ) */
public void assertValidControllable ( ) throws SIMPControllableNotFoundException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "assertValidControllable" ) ; if ( _destinationHandler == null || _messageProcessor == null || _anycastInputHandler == null || _remoteTopicSpaceControl == null ) { SIMPControllableNotFoundException e = new SIMPControllableNotFoundException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "AttachedRemoteSubscriberControl.assertValidControllable" , "1:218:1.32" } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "assertValidControllable" , e ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "assertValidControllable" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "assertValidControllable" ) ; |
public class HTMLEntities { /** * escapes html character inside a string
* @ param str html code to escape
* @ param version HTML Version ( )
* @ return escaped html code */
public static String escapeHTML ( String str , short version ) { } } | String [ ] [ ] data ; int [ ] offset ; StringBuilder rtn = new StringBuilder ( str . length ( ) ) ; char [ ] chars = str . toCharArray ( ) ; if ( version == HTMLV20 ) { data = HTML20_DATA ; offset = HTML20_OFFSET ; } else if ( version == HTMLV32 ) { data = HTML32_DATA ; offset = HTML32_OFFSET ; } else { data = HTML40_DATA ; offset = HTML40_OFFSET ; } outer : for ( int i = 0 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; if ( c == CR ) continue ; // for compatibility to ACF
for ( int y = 0 ; y < offset . length ; y ++ ) { if ( c >= offset [ y ] && c < data [ y ] . length + offset [ y ] ) { String replacement = data [ y ] [ c - offset [ y ] ] ; if ( replacement != null ) { rtn . append ( '&' ) ; rtn . append ( replacement ) ; rtn . append ( ';' ) ; continue outer ; } } } rtn . append ( c ) ; } return rtn . toString ( ) ; |
public class JerseyParameterNameProvider { /** * Derives member ' s name and type from it ' s annotations */
public static Optional < String > getParameterNameFromAnnotations ( Annotation [ ] memberAnnotations ) { } } | for ( Annotation a : memberAnnotations ) { if ( a instanceof QueryParam ) { return Optional . of ( "query param " + ( ( QueryParam ) a ) . value ( ) ) ; } else if ( a instanceof PathParam ) { return Optional . of ( "path param " + ( ( PathParam ) a ) . value ( ) ) ; } else if ( a instanceof HeaderParam ) { return Optional . of ( "header " + ( ( HeaderParam ) a ) . value ( ) ) ; } else if ( a instanceof CookieParam ) { return Optional . of ( "cookie " + ( ( CookieParam ) a ) . value ( ) ) ; } else if ( a instanceof FormParam ) { return Optional . of ( "form field " + ( ( FormParam ) a ) . value ( ) ) ; } else if ( a instanceof Context ) { return Optional . of ( "context" ) ; } else if ( a instanceof MatrixParam ) { return Optional . of ( "matrix param " + ( ( MatrixParam ) a ) . value ( ) ) ; } } return Optional . empty ( ) ; |
public class DetectChessboardSquarePoints { /** * Configures the contour detector based on the image size . Setting a maximum contour and turning off recording
* of inner contours and improve speed and reduce the memory foot print significantly . */
private void configureContourDetector ( T gray ) { } } | // determine the maximum possible size of a square when viewed head on
// also take in account shapes touching the edge will be concave
int maxContourSize = Math . max ( gray . width , gray . height ) / Math . max ( numCols , numRows ) ; BinaryContourFinder contourFinder = detectorSquare . getDetector ( ) . getContourFinder ( ) ; contourFinder . setMaxContour ( maxContourSize * 4 * 2 ) ; // fisheye distortion can let one square go larger
contourFinder . setSaveInnerContour ( false ) ; |
public class MathUtils { /** * Judge divisor is an aliquot part of dividend . < / br > 判断被除数是否能被除数整除 。
* @ param dividend
* number to be handled . 被除数 。
* @ param divisor
* number to be handled . 除数 。
* @ return true if divisor is an aliquot part of dividend , otherwise
* false . 是否能被整除 。 */
public static < T extends Number > boolean isAliquot ( final T dividend , final T divisor ) { } } | return dividend . doubleValue ( ) % divisor . doubleValue ( ) == 0 ; |
public class DefaultRoleManager { /** * getUsers gets the users that inherits a subject .
* domain is an unreferenced parameter here , may be used in other implementations . */
@ Override public List < String > getUsers ( String name ) { } } | if ( ! hasRole ( name ) ) { throw new Error ( "error: name does not exist" ) ; } List < String > names = new ArrayList < > ( ) ; for ( Role role : allRoles . values ( ) ) { if ( role . hasDirectRole ( name ) ) { names . add ( role . name ) ; } } return names ; |
public class ArrayLikeUtil { /** * Cast the static instance .
* @ param dummy Dummy variable , for type inference
* @ return Static instance */
@ SuppressWarnings ( "unchecked" ) public static < T > ArrayAdapter < T , List < ? extends T > > listAdapter ( List < ? extends T > dummy ) { } } | return ( ListArrayAdapter < T > ) LISTADAPTER ; |
public class SegmentAggregator { /** * Returns a FlushArgs which contains the data needing to be flushed to Storage .
* @ return The aggregated object that can be used for flushing .
* @ throws DataCorruptionException If a unable to retrieve required data from the Data Source . */
private FlushArgs getFlushArgs ( ) throws DataCorruptionException { } } | StorageOperation first = this . operations . getFirst ( ) ; if ( ! ( first instanceof AggregatedAppendOperation ) ) { // Nothing to flush - first operation is not an AggregatedAppend .
return new FlushArgs ( null , 0 , Collections . emptyMap ( ) ) ; } AggregatedAppendOperation appendOp = ( AggregatedAppendOperation ) first ; int length = ( int ) appendOp . getLength ( ) ; InputStream data ; if ( length > 0 ) { data = this . dataSource . getAppendData ( appendOp . getStreamSegmentId ( ) , appendOp . getStreamSegmentOffset ( ) , length ) ; if ( data == null ) { if ( this . metadata . isDeleted ( ) ) { // Segment was deleted - nothing more to do .
return new FlushArgs ( null , 0 , Collections . emptyMap ( ) ) ; } throw new DataCorruptionException ( String . format ( "Unable to retrieve CacheContents for '%s'." , appendOp ) ) ; } } else { if ( appendOp . attributes . isEmpty ( ) ) { throw new DataCorruptionException ( String . format ( "Found AggregatedAppendOperation with no data or attributes: '%s'." , appendOp ) ) ; } data = null ; } appendOp . seal ( ) ; return new FlushArgs ( data , length , appendOp . attributes ) ; |
public class NullabilityUtil { /** * Works for method parameters defined either in source or in class files
* @ param symbol the method symbol
* @ param paramInd index of the parameter
* @ return all declaration and type - use annotations for the parameter */
public static Stream < ? extends AnnotationMirror > getAllAnnotationsForParameter ( Symbol . MethodSymbol symbol , int paramInd ) { } } | Symbol . VarSymbol varSymbol = symbol . getParameters ( ) . get ( paramInd ) ; return Stream . concat ( varSymbol . getAnnotationMirrors ( ) . stream ( ) , symbol . getRawTypeAttributes ( ) . stream ( ) . filter ( t -> t . position . type . equals ( TargetType . METHOD_FORMAL_PARAMETER ) && t . position . parameter_index == paramInd ) ) ; |
public class ReceiveMessageActionParser { /** * Parses validation elements and adds information to the message validation context .
* @ param messageElement the message DOM element .
* @ param context the message validation context . */
private void parseNamespaceValidationElements ( Element messageElement , XmlMessageValidationContext context ) { } } | // check for validate elements , these elements can either have script , xpath or namespace validation information
// for now we only handle namespace validation
Map < String , String > validateNamespaces = new HashMap < String , String > ( ) ; List < ? > validateElements = DomUtils . getChildElementsByTagName ( messageElement , "validate" ) ; if ( validateElements . size ( ) > 0 ) { for ( Iterator < ? > iter = validateElements . iterator ( ) ; iter . hasNext ( ) ; ) { Element validateElement = ( Element ) iter . next ( ) ; // check for namespace validation elements
List < ? > validateNamespaceElements = DomUtils . getChildElementsByTagName ( validateElement , "namespace" ) ; if ( validateNamespaceElements . size ( ) > 0 ) { for ( Iterator < ? > namespaceIterator = validateNamespaceElements . iterator ( ) ; namespaceIterator . hasNext ( ) ; ) { Element namespaceElement = ( Element ) namespaceIterator . next ( ) ; validateNamespaces . put ( namespaceElement . getAttribute ( "prefix" ) , namespaceElement . getAttribute ( "value" ) ) ; } } } context . setControlNamespaces ( validateNamespaces ) ; } |
public class AbstractX509FileSystemStore { /** * Write data encoded based64 between PEM line headers .
* @ param out the output buffered writer to write to .
* @ param type the type to be written in the header .
* @ param data the bytes data to store encoded .
* @ throws IOException on error . */
protected void write ( BufferedWriter out , String type , byte [ ] data ) throws IOException { } } | writeHeader ( out , type ) ; out . write ( this . base64 . encode ( data , 64 ) ) ; out . newLine ( ) ; writeFooter ( out , type ) ; |
public class BranchUniversalObject { /** * Convert the BUO to corresponding Json representation
* @ return A { @ link JSONObject } which represent this BUO */
public JSONObject convertToJson ( ) { } } | JSONObject buoJsonModel = new JSONObject ( ) ; try { // Add all keys in plane format initially . All known keys will be replaced with corresponding data type in the following section
JSONObject metadataJsonObject = metadata_ . convertToJson ( ) ; Iterator < String > keys = metadataJsonObject . keys ( ) ; while ( keys . hasNext ( ) ) { String key = keys . next ( ) ; buoJsonModel . put ( key , metadataJsonObject . get ( key ) ) ; } if ( ! TextUtils . isEmpty ( title_ ) ) { buoJsonModel . put ( Defines . Jsonkey . ContentTitle . getKey ( ) , title_ ) ; } if ( ! TextUtils . isEmpty ( canonicalIdentifier_ ) ) { buoJsonModel . put ( Defines . Jsonkey . CanonicalIdentifier . getKey ( ) , canonicalIdentifier_ ) ; } if ( ! TextUtils . isEmpty ( canonicalUrl_ ) ) { buoJsonModel . put ( Defines . Jsonkey . CanonicalUrl . getKey ( ) , canonicalUrl_ ) ; } if ( keywords_ . size ( ) > 0 ) { JSONArray keyWordJsonArray = new JSONArray ( ) ; for ( String keyword : keywords_ ) { keyWordJsonArray . put ( keyword ) ; } buoJsonModel . put ( Defines . Jsonkey . ContentKeyWords . getKey ( ) , keyWordJsonArray ) ; } if ( ! TextUtils . isEmpty ( description_ ) ) { buoJsonModel . put ( Defines . Jsonkey . ContentDesc . getKey ( ) , description_ ) ; } if ( ! TextUtils . isEmpty ( imageUrl_ ) ) { buoJsonModel . put ( Defines . Jsonkey . ContentImgUrl . getKey ( ) , imageUrl_ ) ; } if ( expirationInMilliSec_ > 0 ) { buoJsonModel . put ( Defines . Jsonkey . ContentExpiryTime . getKey ( ) , expirationInMilliSec_ ) ; } buoJsonModel . put ( Defines . Jsonkey . PublicallyIndexable . getKey ( ) , isPublicallyIndexable ( ) ) ; buoJsonModel . put ( Defines . Jsonkey . LocallyIndexable . getKey ( ) , isLocallyIndexable ( ) ) ; buoJsonModel . put ( Defines . Jsonkey . CreationTimestamp . getKey ( ) , creationTimeStamp_ ) ; } catch ( JSONException ignore ) { } return buoJsonModel ; |
public class AWSIoTJobsDataPlaneClient { /** * Gets details of a job execution .
* @ param describeJobExecutionRequest
* @ return Result of the DescribeJobExecution operation returned by the service .
* @ throws InvalidRequestException
* The contents of the request were invalid . For example , this code is returned when an UpdateJobExecution
* request contains invalid status details . The message contains details about the error .
* @ throws ResourceNotFoundException
* The specified resource does not exist .
* @ throws ThrottlingException
* The rate exceeds the limit .
* @ throws ServiceUnavailableException
* The service is temporarily unavailable .
* @ throws CertificateValidationException
* The certificate is invalid .
* @ throws TerminalStateException
* The job is in a terminal state .
* @ sample AWSIoTJobsDataPlane . DescribeJobExecution
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / iot - jobs - data - 2017-09-29 / DescribeJobExecution "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeJobExecutionResult describeJobExecution ( DescribeJobExecutionRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeJobExecution ( request ) ; |
public class AbstractAppender { /** * Handles a configure failure . */
protected void handleConfigureResponseFailure ( MemberState member , ConfigureRequest request , Throwable error ) { } } | // Log the failed attempt to contact the member .
failAttempt ( member , error ) ; |
public class SDBaseOps { /** * Convert the array to a one - hot array with walues 0 and 1 for each entry < br >
* If input has shape [ a , . . . , n ] then output has shape [ a , . . . , n , depth ] ,
* with out [ i , . . . , j , in [ i , . . . , j ] ] = 1 with other values being set to 0
* @ param name Output variable name
* @ param indices Indices - value 0 to depth - 1
* @ param depth Number of classes
* @ return Output variable
* @ see # oneHot ( SDVariable , int , int , double , double ) */
public SDVariable oneHot ( String name , SDVariable indices , int depth ) { } } | return oneHot ( name , indices , depth , - 1 , 1.00 , 0.00 ) ; |
public class ViterbiBuilder { /** * Tries to repair the lattice by creating and adding an additional Viterbi node to the RIGHT of the newly
* inserted user dictionary entry by using the substring of the node in the lattice that overlaps the least
* @ param lattice
* @ param nodeEndIndex */
private void repairBrokenLatticeAfter ( ViterbiLattice lattice , int nodeEndIndex ) { } } | ViterbiNode [ ] [ ] nodeEndIndices = lattice . getEndIndexArr ( ) ; for ( int endIndex = nodeEndIndex + 1 ; endIndex < nodeEndIndices . length ; endIndex ++ ) { if ( nodeEndIndices [ endIndex ] != null ) { ViterbiNode glueBase = findGlueNodeCandidate ( nodeEndIndex , nodeEndIndices [ endIndex ] , endIndex ) ; if ( glueBase != null ) { int delta = endIndex - nodeEndIndex ; String glueBaseSurface = glueBase . getSurface ( ) ; String surface = glueBaseSurface . substring ( glueBaseSurface . length ( ) - delta ) ; ViterbiNode glueNode = createGlueNode ( nodeEndIndex , glueBase , surface ) ; lattice . addNode ( glueNode , nodeEndIndex , nodeEndIndex + glueNode . getSurface ( ) . length ( ) ) ; return ; } } } |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcPerformanceHistoryTypeEnum createIfcPerformanceHistoryTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcPerformanceHistoryTypeEnum result = IfcPerformanceHistoryTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class UserConfiguration { /** * Saves the configuration
* @ throws java . io . IOException If there was a problem while writting the config file */
public synchronized void storeConfiguration ( ) throws IOException { } } | OutputStream out = new FileOutputStream ( configFilePath ) ; configuration . store ( out , configFilePath ) ; |
public class DefaultCacheLoaderWriterProviderConfiguration { /** * Adds a default { @ link CacheLoaderWriter } class and associated constuctor arguments to be used with a cache matching
* the provided alias .
* @ param alias the cache alias
* @ param clazz the cache loader writer class
* @ param arguments the constructor arguments
* @ return this configuration instance */
public DefaultCacheLoaderWriterProviderConfiguration addLoaderFor ( String alias , Class < ? extends CacheLoaderWriter < ? , ? > > clazz , Object ... arguments ) { } } | getDefaults ( ) . put ( alias , new DefaultCacheLoaderWriterConfiguration ( clazz , arguments ) ) ; return this ; |
public class NavigationAnimationImpl { @ Override protected void onUpdate ( double progress ) { } } | View view = trajectory . getView ( progress ) ; view . setAnimation ( progress < 1 ) ; viewPort . applyView ( view ) ; eventBus . fireEvent ( new NavigationUpdateEvent ( this , view ) ) ; |
public class AmazonSimpleEmailServiceClient { /** * Returns the details of the specified configuration set . For information about using configuration sets , see the
* < a href = " http : / / docs . aws . amazon . com / ses / latest / DeveloperGuide / monitor - sending - activity . html " > Amazon SES Developer
* Guide < / a > .
* You can execute this operation no more than once per second .
* @ param describeConfigurationSetRequest
* Represents a request to return the details of a configuration set . Configuration sets enable you to
* publish email sending events . For information about using configuration sets , see the < a
* href = " http : / / docs . aws . amazon . com / ses / latest / DeveloperGuide / monitor - sending - activity . html " > Amazon SES
* Developer Guide < / a > .
* @ return Result of the DescribeConfigurationSet operation returned by the service .
* @ throws ConfigurationSetDoesNotExistException
* Indicates that the configuration set does not exist .
* @ sample AmazonSimpleEmailService . DescribeConfigurationSet
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / email - 2010-12-01 / DescribeConfigurationSet " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DescribeConfigurationSetResult describeConfigurationSet ( DescribeConfigurationSetRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeConfigurationSet ( request ) ; |
public class CollectionData { /** * Puts data into this data tree at the specified key string .
* @ param keyStr One or more map keys and / or list indices ( separated by ' . ' if multiple parts ) .
* Indicates the path to the location within this data tree .
* @ param value The data to put at the specified location . */
public void put ( String keyStr , String value ) { } } | put ( keyStr , StringData . forValue ( value ) ) ; |
public class ResolvableType { /** * Return a { @ link ResolvableType } for the specified { @ link Method } return type .
* Use this variant when the class that declares the method includes generic
* parameter variables that are satisfied by the implementation class .
* @ param method the source for the method return type
* @ param implementationClass the implementation class
* @ return a { @ link ResolvableType } for the specified method return
* @ see # forMethodReturnType ( Method ) */
public static ResolvableType forMethodReturnType ( Method method , Class < ? > implementationClass ) { } } | Assert . notNull ( method , "Method must not be null" ) ; MethodParameter methodParameter = MethodParameter . forMethodOrConstructor ( method , - 1 ) ; methodParameter . setContainingClass ( implementationClass ) ; return forMethodParameter ( methodParameter ) ; |
public class ElemNumber { /** * Get the count match pattern , or a default value .
* @ param support The XPath runtime state for this .
* @ param contextNode The node that " . " expresses .
* @ return the count match pattern , or a default value .
* @ throws javax . xml . transform . TransformerException */
XPath getCountMatchPattern ( XPathContext support , int contextNode ) throws javax . xml . transform . TransformerException { } } | XPath countMatchPattern = m_countMatchPattern ; DTM dtm = support . getDTM ( contextNode ) ; if ( null == countMatchPattern ) { switch ( dtm . getNodeType ( contextNode ) ) { case DTM . ELEMENT_NODE : MyPrefixResolver resolver ; if ( dtm . getNamespaceURI ( contextNode ) == null ) { resolver = new MyPrefixResolver ( dtm . getNode ( contextNode ) , dtm , contextNode , false ) ; } else { resolver = new MyPrefixResolver ( dtm . getNode ( contextNode ) , dtm , contextNode , true ) ; } countMatchPattern = new XPath ( dtm . getNodeName ( contextNode ) , this , resolver , XPath . MATCH , support . getErrorListener ( ) ) ; break ; case DTM . ATTRIBUTE_NODE : // countMatchPattern = m _ stylesheet . createMatchPattern ( " @ " + contextNode . getNodeName ( ) , this ) ;
countMatchPattern = new XPath ( "@" + dtm . getNodeName ( contextNode ) , this , this , XPath . MATCH , support . getErrorListener ( ) ) ; break ; case DTM . CDATA_SECTION_NODE : case DTM . TEXT_NODE : // countMatchPattern = m _ stylesheet . createMatchPattern ( " text ( ) " , this ) ;
countMatchPattern = new XPath ( "text()" , this , this , XPath . MATCH , support . getErrorListener ( ) ) ; break ; case DTM . COMMENT_NODE : // countMatchPattern = m _ stylesheet . createMatchPattern ( " comment ( ) " , this ) ;
countMatchPattern = new XPath ( "comment()" , this , this , XPath . MATCH , support . getErrorListener ( ) ) ; break ; case DTM . DOCUMENT_NODE : // countMatchPattern = m _ stylesheet . createMatchPattern ( " / " , this ) ;
countMatchPattern = new XPath ( "/" , this , this , XPath . MATCH , support . getErrorListener ( ) ) ; break ; case DTM . PROCESSING_INSTRUCTION_NODE : // countMatchPattern = m _ stylesheet . createMatchPattern ( " pi ( " + contextNode . getNodeName ( ) + " ) " , this ) ;
countMatchPattern = new XPath ( "pi(" + dtm . getNodeName ( contextNode ) + ")" , this , this , XPath . MATCH , support . getErrorListener ( ) ) ; break ; default : countMatchPattern = null ; } } return countMatchPattern ; |
public class ScriptRuntime { /** * Operator new .
* See ECMA 11.2.2 */
public static Scriptable newObject ( Object fun , Context cx , Scriptable scope , Object [ ] args ) { } } | if ( ! ( fun instanceof Function ) ) { throw notFunctionError ( fun ) ; } Function function = ( Function ) fun ; return function . construct ( cx , scope , args ) ; |
public class BaseEntity { /** * Returns the property value as a Key .
* @ throws DatastoreException if no such property
* @ throws ClassCastException if value is not a Key */
@ SuppressWarnings ( "unchecked" ) public Key getKey ( String name ) { } } | return ( ( Value < Key > ) getValue ( name ) ) . get ( ) ; |
public class CmsSerialDateController { /** * Set the start time .
* @ param date the start time to set . */
public void setStartTime ( final Date date ) { } } | if ( ! Objects . equals ( m_model . getStart ( ) , date ) ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { m_model . setStart ( date ) ; setPatternDefaultValues ( date ) ; valueChanged ( ) ; } } ) ; } |
public class CommerceRegionPersistenceImpl { /** * Returns the commerce region where uuid = & # 63 ; and groupId = & # 63 ; or throws a { @ link NoSuchRegionException } if it could not be found .
* @ param uuid the uuid
* @ param groupId the group ID
* @ return the matching commerce region
* @ throws NoSuchRegionException if a matching commerce region could not be found */
@ Override public CommerceRegion findByUUID_G ( String uuid , long groupId ) throws NoSuchRegionException { } } | CommerceRegion commerceRegion = fetchByUUID_G ( uuid , groupId ) ; if ( commerceRegion == null ) { StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", groupId=" ) ; msg . append ( groupId ) ; msg . append ( "}" ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( msg . toString ( ) ) ; } throw new NoSuchRegionException ( msg . toString ( ) ) ; } return commerceRegion ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.