signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Summarizer { /** * setup label
* @ param key key */
private void setupLabel ( Key key ) { } } | int i = 0 ; Key k = new Key ( ) ; for ( ValueWritable vw : key . getGrouping ( ) ) { vw . getLabel ( ) . set ( inputLabels [ i ++ ] ) ; k . getGrouping ( ) . add ( new ValueWritable ( vw . getLabel ( ) . toString ( ) , vw . getValue ( ) ) ) ; } defaultGroupRecord . setKey ( k ) ; valuesLabels = new String [ inputLabels . length - i ] ; for ( int j = 0 ; j < valuesLabels . length ; j ++ ) { valuesLabels [ j ] = inputLabels [ i ++ ] ; } |
public class ListStreamProcessorsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListStreamProcessorsRequest listStreamProcessorsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listStreamProcessorsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listStreamProcessorsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listStreamProcessorsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Ingest { /** * Checks if the ingest is catching up .
* If the ingest is consuming finalized segment , it ' s assumed to be behind .
* Otherwise , catching up is based on the position of the input stream .
* @ throws IOException */
private void setCatchingUp ( ) throws IOException { } } | try { if ( inputEditStream != null && inputEditStream . isInProgress ( ) ) { catchingUp = ( inputEditStream . length ( ) - inputEditStream . getPosition ( ) > catchUpLag ) ; } else { catchingUp = true ; } } catch ( Exception e ) { catchingUp = true ; } |
public class ResourceConverter { /** * Converts rawdata input into a collection of requested output objects .
* @ param data raw data input
* @ param clazz target type
* @ param < T > type
* @ return collection of converted elements
* @ throws RuntimeException in case conversion fails */
@ Deprecated public < T > List < T > readObjectCollection ( byte [ ] data , Class < T > clazz ) { } } | return readDocumentCollection ( data , clazz ) . get ( ) ; |
public class CPDefinitionGroupedEntryPersistenceImpl { /** * Returns all the cp definition grouped entries where CPDefinitionId = & # 63 ; .
* @ param CPDefinitionId the cp definition ID
* @ return the matching cp definition grouped entries */
@ Override public List < CPDefinitionGroupedEntry > findByCPDefinitionId ( long CPDefinitionId ) { } } | return findByCPDefinitionId ( CPDefinitionId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class KerasUpsampling3D { /** * Get layer output type .
* @ param inputType Array of InputTypes
* @ return output type as InputType
* @ throws InvalidKerasConfigurationException Invalid Keras config */
@ Override public InputType getOutputType ( InputType ... inputType ) throws InvalidKerasConfigurationException { } } | if ( inputType . length > 1 ) throw new InvalidKerasConfigurationException ( "Keras Upsampling 3D layer accepts only one input (received " + inputType . length + ")" ) ; return this . getUpsampling3DLayer ( ) . getOutputType ( - 1 , inputType [ 0 ] ) ; |
public class ToStringSerializer { /** * { @ inheritDoc }
* @ see fr . dudie . nominatim . client . request . paramhelper . QueryParameterSerializer # handle ( java . lang . Object ) */
@ Override public String handle ( final Object value ) { } } | if ( value instanceof NominatimRequest ) { return ( ( NominatimRequest ) value ) . getQueryString ( ) ; } else { return value . toString ( ) ; } |
public class RateLimiterAspect { /** * handle the asynchronous completable future flow
* @ param proceedingJoinPoint AOPJoinPoint
* @ param rateLimiter configured rate limiter
* @ return CompletionStage */
private Object handleJoinPointCompletableFuture ( ProceedingJoinPoint proceedingJoinPoint , io . github . resilience4j . ratelimiter . RateLimiter rateLimiter ) { } } | return rateLimiter . executeCompletionStage ( ( ) -> { try { return ( CompletionStage < ? > ) proceedingJoinPoint . proceed ( ) ; } catch ( Throwable throwable ) { throw new CompletionException ( throwable ) ; } } ) ; |
public class HtmlEscape { /** * Perform a ( configurable ) HTML < strong > escape < / strong > operation on a < tt > Reader < / tt > input , writing
* results to a < tt > Writer < / tt > .
* This method will perform an escape operation according to the specified
* { @ link org . unbescape . html . HtmlEscapeType } and { @ link org . unbescape . html . HtmlEscapeLevel }
* argument values .
* All other < tt > Reader < / tt > / < tt > Writer < / tt > - based < tt > escapeHtml * ( . . . ) < / tt > methods call this one with preconfigured
* < tt > type < / tt > and < tt > level < / tt > values .
* This method is < strong > thread - safe < / strong > .
* @ param reader the < tt > Reader < / tt > reading the text to be escaped .
* @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will
* be written at all to this writer if input is < tt > null < / tt > .
* @ param type the type of escape operation to be performed , see { @ link org . unbescape . html . HtmlEscapeType } .
* @ param level the escape level to be applied , see { @ link org . unbescape . html . HtmlEscapeLevel } .
* @ throws IOException if an input / output exception occurs
* @ since 1.1.2 */
public static void escapeHtml ( final Reader reader , final Writer writer , final HtmlEscapeType type , final HtmlEscapeLevel level ) throws IOException { } } | if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } if ( type == null ) { throw new IllegalArgumentException ( "The 'type' argument cannot be null" ) ; } if ( level == null ) { throw new IllegalArgumentException ( "The 'level' argument cannot be null" ) ; } HtmlEscapeUtil . escape ( reader , writer , type , level ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getIfcUnitEnum ( ) { } } | if ( ifcUnitEnumEEnum == null ) { ifcUnitEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 923 ) ; } return ifcUnitEnumEEnum ; |
public class AWSRAMClient { /** * Enables resource sharing within your organization .
* @ param enableSharingWithAwsOrganizationRequest
* @ return Result of the EnableSharingWithAwsOrganization operation returned by the service .
* @ throws OperationNotPermittedException
* The requested operation is not permitted .
* @ throws ServerInternalException
* The service could not respond to the request due to an internal problem .
* @ throws ServiceUnavailableException
* The service is not available .
* @ sample AWSRAM . EnableSharingWithAwsOrganization
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ram - 2018-01-04 / EnableSharingWithAwsOrganization "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public EnableSharingWithAwsOrganizationResult enableSharingWithAwsOrganization ( EnableSharingWithAwsOrganizationRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeEnableSharingWithAwsOrganization ( request ) ; |
public class EventsHelper { /** * Bind a function to the dblclick event of each matched element .
* @ param jsScope
* Scope to use
* @ return the jQuery code */
public static ChainableStatement dblclick ( JsScope jsScope ) { } } | return new DefaultChainableStatement ( MouseEvent . DBLCLICK . getEventLabel ( ) , jsScope . render ( ) ) ; |
public class HTTPBatchClientConnectionInterceptor { /** * Returns httpRequest instance with configured fields
* @ param intuitRequest
* @ param client
* @ param < T >
* @ return
* @ throws FMSException */
private < T extends CloseableHttpClient > HttpRequestBase prepareHttpRequest ( RequestElements intuitRequest ) throws FMSException { } } | // setTimeout ( client , intuitRequest . getContext ( ) ) ;
HttpRequestBase httpRequest = extractMethod ( intuitRequest , extractURI ( intuitRequest ) ) ; // populate the headers to HttpRequestBase
populateRequestHeaders ( httpRequest , intuitRequest . getRequestHeaders ( ) ) ; // authorize the request
authorizeRequest ( intuitRequest . getContext ( ) , httpRequest ) ; LOG . debug ( "Request URI : " + httpRequest . getURI ( ) ) ; LOG . debug ( "Http Method : " + httpRequest . getMethod ( ) ) ; return httpRequest ; |
public class UploadManager { /** * Tasks */
public void startUpload ( long rid , String descriptor , String fileName , ActorRef requestActor ) { } } | if ( LOG ) { Log . d ( TAG , "Starting upload #" + rid + " with descriptor " + descriptor ) ; } QueueItem queueItem = new QueueItem ( rid , descriptor , fileName , requestActor ) ; queueItem . isStopped = false ; queue . add ( queueItem ) ; checkQueue ( ) ; |
public class MisoScenePanel { /** * Called whenever a block is done resolving , whether it was successfully resolved or if it
* was abandoned . */
protected void blockFinished ( SceneBlock block ) { } } | -- _pendingBlocks ; // once all the visible pending blocks have completed their
// resolution , recompute our visible object set and show ourselves
if ( _visiBlocks . remove ( block ) && _visiBlocks . size ( ) == 0 ) { allBlocksFinished ( ) ; } |
public class ContainsCondition { /** * { @ inheritDoc } */
@ Override public Query query ( Schema schema ) { } } | if ( field == null || field . trim ( ) . isEmpty ( ) ) { throw new IllegalArgumentException ( "Field name required" ) ; } if ( values == null ) { throw new IllegalArgumentException ( "Field values required" ) ; } BooleanQuery query = new BooleanQuery ( ) ; for ( Object value : values ) { Condition condition = new MatchCondition ( boost , field , value ) ; query . add ( condition . query ( schema ) , BooleanClause . Occur . SHOULD ) ; } query . setBoost ( boost ) ; return query ; |
public class ScriptFunction { /** * Call with parameters
* @ param m put this in context
* @ return
* @ throws org . s1 . script . errors . ScriptException */
public Object call ( Map < String , Object > m ) throws ScriptException { } } | List < Object > args = Objects . newArrayList ( ) ; for ( Object o : m . values ( ) ) { args . add ( o ) ; } return call ( m , args ) ; |
public class AddShoppingDynamicRemarketingCampaign { /** * Uploads the image from the specified { @ code url } .
* @ return the { @ code Image } that was uploaded .
* @ throws IOException if the image cannot be loaded . */
private static Image uploadImage ( AdWordsServicesInterface services , AdWordsSession session , String url ) throws IOException { } } | Image image = new Image ( ) ; image . setType ( MediaMediaType . IMAGE ) ; image . setData ( com . google . api . ads . common . lib . utils . Media . getMediaDataFromUrl ( url ) ) ; MediaServiceInterface mediaService = services . get ( session , MediaServiceInterface . class ) ; return ( Image ) mediaService . upload ( new Media [ ] { image } ) [ 0 ] ; |
public class CharOperation { /** * Answers true if the pattern matches the given name , false otherwise . This char [ ] pattern matching accepts
* wild - cards ' * ' and ' ? ' . When not case sensitive , the pattern is assumed to already be lowercased , the name will
* be lowercased character per character as comparing . If name is null , the answer is false . If pattern is null , the
* answer is true if name is not null . < br >
* < br >
* For example :
* < ol >
* < li >
* < pre >
* pattern = { ' ? ' , ' b ' , ' * ' }
* name = { ' a ' , ' b ' , ' c ' , ' d ' }
* isCaseSensitive = true
* result = & gt ; true
* < / pre >
* < / li >
* < li >
* < pre >
* pattern = { ' ? ' , ' b ' , ' ? ' }
* name = { ' a ' , ' b ' , ' c ' , ' d ' }
* isCaseSensitive = true
* result = & gt ; false
* < / pre >
* < / li >
* < li >
* < pre >
* pattern = { ' b ' , ' * ' }
* name = { ' a ' , ' b ' , ' c ' , ' d ' }
* isCaseSensitive = true
* result = & gt ; false
* < / pre >
* < / li >
* < / ol >
* @ param pattern
* the given pattern
* @ param name
* the given name
* @ param isCaseSensitive
* flag to know whether or not the matching should be case sensitive
* @ return true if the pattern matches the given name , false otherwise */
public static final boolean match ( char [ ] pattern , char [ ] name , boolean isCaseSensitive ) { } } | if ( name == null ) { return false ; // null name cannot match
} if ( pattern == null ) { return true ; // null pattern is equivalent to ' * '
} return match ( pattern , 0 , pattern . length , name , 0 , name . length , isCaseSensitive ) ; |
public class RestReportingEngine { /** * { @ inheritDoc } */
@ Override @ GET @ Path ( "/server-config" ) public String getServerConfigurationAsJson ( ) throws NotAuthorizedException { } } | accessControlUtils . checkAuthorization ( Action . EXECUTE_REPORT , requestContext ) ; return gson . toJson ( appSensorServer . getConfiguration ( ) ) ; |
public class StructureImpl { /** * { @ inheritDoc } */
@ Override public Chain getChainByPDB ( String authId , int modelnr ) throws StructureException { } } | Chain c = getPolyChainByPDB ( authId , modelnr ) ; if ( c == null ) { throw new StructureException ( "Could not find chain with authId \"" + authId + "\"" + " for PDB id " + pdb_id + ", model " + modelnr ) ; } return c ; |
public class SelectOverheadParameters { /** * Creates a new instance of the overhead view */
public < T extends ImageBase < T > > OverheadView createOverhead ( ImageType < T > imageType ) { } } | OverheadView ret = new OverheadView ( ) ; ret . image = imageType . createImage ( overheadWidth , overheadHeight ) ; ret . cellSize = cellSize ; ret . centerX = centerX ; ret . centerY = centerY ; return ret ; |
public class TkJoinedCookies { /** * Join them .
* @ param response The response
* @ return New response
* @ throws IOException If fails */
private static Response join ( final Response response ) throws IOException { } } | final StringBuilder cookies = new StringBuilder ( ) ; for ( final String header : response . head ( ) ) { final Matcher matcher = TkJoinedCookies . PTN . matcher ( header ) ; if ( ! matcher . matches ( ) ) { continue ; } cookies . append ( matcher . group ( 1 ) ) . append ( ", " ) ; } final Response out ; if ( cookies . length ( ) > 0 ) { out = new RsWithHeader ( new RsWithoutHeader ( response , "Set-cookie" ) , "Set-Cookie" , cookies . toString ( ) ) ; } else { out = response ; } return out ; |
public class GHistogramFeatureOps { /** * Computes a joint histogram for a planar image . Since it ' s a joint distribution the histogram
* can become huge ( and too sparse ) if bin sizes are used that are too big . Also consider computing the
* histogram independently in each band .
* @ param image Input image . Not modified .
* @ param histogram Output for the histogram . Must be correctly configured first . */
public static < T extends ImageGray < T > > void histogram ( Planar < T > image , Histogram_F64 histogram ) { } } | if ( image . getNumBands ( ) != histogram . getDimensions ( ) ) throw new IllegalArgumentException ( "Number of bands in the image and histogram must be the same" ) ; if ( image . getBandType ( ) == GrayU8 . class ) { HistogramFeatureOps . histogram_U8 ( ( Planar < GrayU8 > ) image , histogram ) ; } else if ( image . getBandType ( ) == GrayF32 . class ) { HistogramFeatureOps . histogram_F32 ( ( Planar < GrayF32 > ) image , histogram ) ; } else { throw new IllegalArgumentException ( "Umage type not yet supportd" ) ; } |
public class BeanContextSupport { /** * Notifies registered < code > BeanContextMembershipListener < / code > s that a child has been removed .
* @ param event
* the < code > BeanContextMembershipEvent < / code > */
protected final void fireChildrenRemoved ( BeanContextMembershipEvent event ) { } } | Object listeners [ ] ; synchronized ( bcmListeners ) { listeners = bcmListeners . toArray ( ) ; } for ( int i = 0 ; i < listeners . length ; i ++ ) { BeanContextMembershipListener l = ( BeanContextMembershipListener ) listeners [ i ] ; l . childrenRemoved ( event ) ; } |
public class BasicFunctionsRuntime { /** * Rounds the given value to the closest decimal point left ( negative numbers ) or right ( positive
* numbers ) of the decimal point */
public static NumberData round ( SoyValue value , int numDigitsAfterPoint ) { } } | // NOTE : for more accurate rounding , this should really be using BigDecimal which can do correct
// decimal arithmetic . However , for compatibility with js , that probably isn ' t an option .
if ( numDigitsAfterPoint == 0 ) { return IntegerData . forValue ( round ( value ) ) ; } else if ( numDigitsAfterPoint > 0 ) { double valueDouble = value . numberValue ( ) ; double shift = Math . pow ( 10 , numDigitsAfterPoint ) ; return FloatData . forValue ( Math . round ( valueDouble * shift ) / shift ) ; } else { double valueDouble = value . numberValue ( ) ; double shift = Math . pow ( 10 , - numDigitsAfterPoint ) ; return IntegerData . forValue ( ( int ) ( Math . round ( valueDouble / shift ) * shift ) ) ; } |
public class Predicates { /** * Returns a predicate that evaluates to { @ code true } if the key set
* of its argument satisfies { @ code p } . */
public static < K , V > Predicate < Map < K , V > > forKeys ( final Predicate < ? super Set < K > > p ) { } } | return new Predicate < Map < K , V > > ( ) { @ Override public boolean apply ( Map < K , V > obj ) { return p . apply ( obj . keySet ( ) ) ; } } ; |
public class PropertiesLoaderUtils { /** * Fill the given properties from the specified class path resource ( in ISO - 8859-1 encoding ) .
* < p > Merges properties if more than one resource of the same name
* found in the class path . < / p >
* @ param props the Properties instance to load into
* @ param resourceName the name of the class path resource
* @ throws IOException if loading failed */
public static void fillProperties ( Properties props , String resourceName ) throws IOException { } } | fillProperties ( props , resourceName , AspectranClassLoader . getDefaultClassLoader ( ) ) ; |
public class BasePanel { /** * This field changed , if this is the main record , lock it !
* @ param field The field that changed . */
public void fieldChanged ( Field field ) { } } | Record record = this . getMainRecord ( ) ; if ( field != null ) if ( record != null ) if ( field . getRecord ( ) == record ) { int iErrorCode = record . handleRecordChange ( ( BaseField ) field , DBConstants . FIELD_CHANGED_TYPE , DBConstants . DONT_DISPLAY ) ; // Tell table that I ' m getting changed ( if not locked )
if ( iErrorCode != DBConstants . NORMAL_RETURN ) this . displayError ( iErrorCode ) ; } |
public class KeyVaultClientBaseImpl { /** * Backs up the specified certificate .
* Requests that a backup of the specified certificate be downloaded to the client . All versions of the certificate will be downloaded . This operation requires the certificates / backup permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param certificateName The name of the certificate .
* @ 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 < BackupCertificateResult > backupCertificateAsync ( String vaultBaseUrl , String certificateName , final ServiceCallback < BackupCertificateResult > serviceCallback ) { } } | return ServiceFuture . fromResponse ( backupCertificateWithServiceResponseAsync ( vaultBaseUrl , certificateName ) , serviceCallback ) ; |
public class MessageUnpacker { /** * Reads payload bytes of binary , extension , or raw string types .
* This consumes specified amount of bytes into the specified byte array .
* @ param dst the byte array into which the data is read
* @ param off the offset in the dst array
* @ param len the number of bytes to read
* @ throws IOException when underlying input throws IOException */
public void readPayload ( byte [ ] dst , int off , int len ) throws IOException { } } | while ( true ) { int bufferRemaining = buffer . size ( ) - position ; if ( bufferRemaining >= len ) { buffer . getBytes ( position , dst , off , len ) ; position += len ; return ; } buffer . getBytes ( position , dst , off , bufferRemaining ) ; off += bufferRemaining ; len -= bufferRemaining ; position += bufferRemaining ; nextBuffer ( ) ; } |
public class BouncyCastleUtil { /** * Converts given < code > DERObject < / code > into
* a DER - encoded byte array .
* @ param obj DERObject to convert .
* @ return the DER - encoded byte array
* @ exception IOException if conversion fails */
public static byte [ ] toByteArray ( ASN1Primitive obj ) throws IOException { } } | ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; DEROutputStream der = new DEROutputStream ( bout ) ; der . writeObject ( obj ) ; return bout . toByteArray ( ) ; |
public class LongConstant { /** * Writes the contents of the pool entry . */
void write ( ByteCodeWriter out ) throws IOException { } } | out . write ( ConstantPool . CP_LONG ) ; out . writeLong ( _value ) ; |
public class HintManager { /** * Set sharding value for database sharding only .
* < p > The sharding operator is { @ code = } < / p >
* @ param value sharding value */
public void setDatabaseShardingValue ( final Comparable < ? > value ) { } } | databaseShardingValues . clear ( ) ; databaseShardingValues . put ( "" , value ) ; databaseShardingOnly = true ; |
public class FreeOnFreeHandler { /** * Free the dependent object . */
public void freeDependent ( ) { } } | if ( m_recDependent != null ) // If close and file is still open
if ( ! m_recDependent . isInFree ( ) ) { this . setDependentListener ( null ) ; // In case you want to delete me !
if ( m_recDependent != null ) { if ( m_bCloseOnFree ) m_recDependent . close ( ) ; // File is still open , and my listener is still there , close it !
else m_recDependent . free ( ) ; // File is still open , and my listener is still there , close it !
} } m_recDependent = null ; if ( m_freeable != null ) m_freeable . free ( ) ; m_freeable = null ; |
public class RiceEncoder { /** * Create the residual headers for a FLAC stream .
* @ param useFiveBitParam Set TRUE if using a five - bit parameter size , FALSE
* for a four - bit parameter
* @ param order Specify order of partitions to be used ( actual number of
* partitions will be 2 ^ order .
* @ param ele EncodedElement to write header to .
* @ return total written size of header . */
public static int beginResidual ( boolean useFiveBitParam , byte order , EncodedElement ele ) { } } | ele = ele . getEnd ( ) ; int paramSize = ( useFiveBitParam ) ? 1 : 0 ; ele . addInt ( paramSize , 2 ) ; ele . addInt ( order , 4 ) ; return 6 ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcWindowStyleOperationEnum createIfcWindowStyleOperationEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcWindowStyleOperationEnum result = IfcWindowStyleOperationEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcCoordinateReferenceSystemSelect ( ) { } } | if ( ifcCoordinateReferenceSystemSelectEClass == null ) { ifcCoordinateReferenceSystemSelectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1124 ) ; } return ifcCoordinateReferenceSystemSelectEClass ; |
public class AbstractInvokable { /** * Aborts a checkpoint as the result of receiving possibly some checkpoint barriers ,
* but at least one { @ link org . apache . flink . runtime . io . network . api . CancelCheckpointMarker } .
* < p > This requires implementing tasks to forward a
* { @ link org . apache . flink . runtime . io . network . api . CancelCheckpointMarker } to their outputs .
* @ param checkpointId The ID of the checkpoint to be aborted .
* @ param cause The reason why the checkpoint was aborted during alignment */
public void abortCheckpointOnBarrier ( long checkpointId , Throwable cause ) throws Exception { } } | throw new UnsupportedOperationException ( String . format ( "abortCheckpointOnBarrier not supported by %s" , this . getClass ( ) . getName ( ) ) ) ; |
public class Log { /** * Restores in from an incremental backup */
private void restoreBackupIncremental ( ) { } } | try { if ( fa . isStreamElement ( fileName + ".backup" ) ) { RAShadowFile . restoreFile ( fileName + ".backup" , fileName + ".data" ) ; } else { /* / / this is to ensure file has been written fully but it is not necessary
/ / as semantics dictate that if a backup does not exist , the file
/ / was never changed or was fully written to
if ( FileUtil . exists ( cacheFileName ) ) {
int flags = DataFileCache . getFlags ( cacheFileName ) ;
if ( ! BitMap . isSet ( flags , DataFileCache . FLAG _ ISSAVED ) ) {
FileUtil . delete ( cacheFileName ) ; */
} deleteBackup ( ) ; } catch ( IOException e ) { throw Error . error ( ErrorCode . FILE_IO_ERROR , fileName + ".backup" ) ; } |
public class Strings { public static String addLeftOpt ( String str , String left ) { } } | if ( str . startsWith ( left ) ) { return str ; } else { return left + str ; } |
public class NamespaceConverter { /** * ( non - Javadoc )
* @ see
* org . fcrepo . kernel . api . identifiers . InternalIdentifierConverter # doForward (
* java . lang . String ) */
@ Override protected String doForward ( final String inputId ) { } } | LOGGER . trace ( "Converting identifier {} from internal to external..." , inputId ) ; String result = inputId ; for ( final String jcrNamespace : jcrNamespacesToRDFNamespaces . keySet ( ) ) { LOGGER . trace ( "Replacing namespace: {} with: {}" , jcrNamespace , jcrNamespacesToRDFNamespaces . get ( jcrNamespace ) ) ; result = result . replace ( jcrNamespace , jcrNamespacesToRDFNamespaces . get ( jcrNamespace ) ) ; } LOGGER . trace ( "Converted identifier {} from internal to external {}..." , inputId , result ) ; return result ; |
public class ElasticsearchBeyonder { /** * Automatically scan classpath and creates indices , types , templates . . .
* @ param client elasticsearch client
* @ param root dir within the classpath
* @ throws Exception when beyonder can not start */
public static void start ( RestClient client , String root ) throws Exception { } } | start ( client , root , Defaults . MergeMappings , Defaults . ForceCreation ) ; |
public class Weight { /** * Creates a new weight with the opposite sign .
* @ return a new < code > Weight < / code > . */
public Weight invertSign ( ) { } } | if ( isInfinity ) { if ( posOrNeg ) { return WeightFactory . NEG_INFINITY ; } else { return WeightFactory . POS_INFINITY ; } } return new Weight ( - val ) ; |
public class VirtualFileSystems { /** * Constructs a new FileSystem to access the contents of a file as a file system .
* @ param path
* @ param env
* @ return
* @ throws IOException */
public static final FileSystem newFileSystem ( Path path , Map < String , ? > env ) throws IOException { } } | return getDefault ( ) . provider ( ) . newFileSystem ( path , env ) ; |
public class SecurityConstraintTypeImpl { /** * Returns all < code > web - resource - collection < / code > elements
* @ return list of < code > web - resource - collection < / code > */
public List < WebResourceCollectionType < SecurityConstraintType < T > > > getAllWebResourceCollection ( ) { } } | List < WebResourceCollectionType < SecurityConstraintType < T > > > list = new ArrayList < WebResourceCollectionType < SecurityConstraintType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "web-resource-collection" ) ; for ( Node node : nodeList ) { WebResourceCollectionType < SecurityConstraintType < T > > type = new WebResourceCollectionTypeImpl < SecurityConstraintType < T > > ( this , "web-resource-collection" , childNode , node ) ; list . add ( type ) ; } return list ; |
public class PersonImpl { /** * Provides access to this { @ link org . apereo . portal . security . provider . PersonImpl } ' s private copy
* of the attributes attached to this { @ link IPerson } . Changes to the map will affect the
* attributes directly . ( Perhaps we ' d rather do a defensive copy ? ) */
@ Override public Map < String , List < Object > > getAttributeMap ( ) { } } | final Map < String , List < Object > > attrMap = userAttributes ; return attrMap ; |
public class OctalUnescaper { /** * { @ inheritDoc } */
@ Override public int translate ( final CharSequence input , final int index , final Writer out ) throws IOException { } } | final int remaining = input . length ( ) - index - 1 ; // how many characters left , ignoring the first \
final StringBuilder builder = new StringBuilder ( ) ; if ( input . charAt ( index ) == '\\' && remaining > 0 && isOctalDigit ( input . charAt ( index + 1 ) ) ) { final int next = index + 1 ; final int next2 = index + 2 ; final int next3 = index + 3 ; // we know this is good as we checked it in the if block above
builder . append ( input . charAt ( next ) ) ; if ( remaining > 1 && isOctalDigit ( input . charAt ( next2 ) ) ) { builder . append ( input . charAt ( next2 ) ) ; if ( remaining > 2 && isZeroToThree ( input . charAt ( next ) ) && isOctalDigit ( input . charAt ( next3 ) ) ) { builder . append ( input . charAt ( next3 ) ) ; } } out . write ( Integer . parseInt ( builder . toString ( ) , 8 ) ) ; return 1 + builder . length ( ) ; } return 0 ; |
public class Connection { /** * from interface NetEventHandler */
public boolean checkIdle ( long idleStamp ) { } } | if ( _lastEvent > idleStamp ) { return false ; } if ( ! isClosed ( ) ) { log . info ( "Disconnecting non-communicative client" , "conn" , this , "idle" , ( System . currentTimeMillis ( ) - _lastEvent ) + "ms" ) ; } return true ; |
public class Strings { /** * Process formatted string with arguments transform and no illegal format exception . Java string format throws
* unchecked { @ link IllegalFormatException } if given string is not well formatted . This method catches it and return
* original , not formatted string if exception happened . Uses this method instead of Java String whenever source
* string is not from safe source , that can guaranty its format correctness .
* Return null if format string argument is null and empty if empty . If optional arguments is missing return original
* string .
* This method takes care to pre - process arguments as follow :
* < ul >
* < li > replace { @ link Class } with its canonical name ,
* < li > replace { @ link Throwable } with exception message or exception class canonical name if null message ,
* < li > replace { @ link Thread } with concatenation of thread name and thread ID .
* < / ul >
* All pre - processed arguments are replaced with string value and format specifier should be also string ( % s ) .
* @ param format string to format ,
* @ param args variable number of arguments related to format .
* @ return formatted string , possible empty or null . */
public static String format ( String format , Object ... args ) { } } | if ( format == null ) { return null ; } if ( format . isEmpty ( ) ) { return "" ; } if ( args . length == 0 ) { return format ; } for ( int i = 0 ; i < args . length ; i ++ ) { if ( args [ i ] instanceof Class ) { args [ i ] = ( ( Class < ? > ) args [ i ] ) . getCanonicalName ( ) ; } else if ( args [ i ] instanceof Throwable ) { String s = ( ( Throwable ) args [ i ] ) . getMessage ( ) ; if ( s == null ) { s = args [ i ] . getClass ( ) . getCanonicalName ( ) ; } args [ i ] = s ; } else if ( args [ i ] instanceof Thread ) { Thread thread = ( Thread ) args [ i ] ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( thread . getName ( ) ) ; sb . append ( ':' ) ; sb . append ( thread . getId ( ) ) ; args [ i ] = sb . toString ( ) ; } else if ( args [ i ] instanceof File ) { args [ i ] = ( ( File ) args [ i ] ) . getAbsolutePath ( ) ; } } try { return String . format ( format , args ) ; } catch ( IllegalFormatException e ) { log . error ( "Format operation aborted due to error on string format. Returns original, not formated string. Root cause is: " , e ) ; } return format ; |
public class CoinbaseAccountServiceRaw { /** * Authenticated resource that shows the current user accounts .
* @ see < a
* href = " https : / / developers . coinbase . com / api / v2 # list - accounts " > developers . coinbase . com / api / v2 # list - accounts < / a > */
public List < CoinbaseAccount > getCoinbaseAccounts ( ) throws IOException { } } | String apiKey = exchange . getExchangeSpecification ( ) . getApiKey ( ) ; BigDecimal timestamp = coinbase . getTime ( Coinbase . CB_VERSION_VALUE ) . getData ( ) . getEpoch ( ) ; return coinbase . getAccounts ( Coinbase . CB_VERSION_VALUE , apiKey , signatureCreator2 , timestamp ) . getData ( ) ; |
public class TransformResourcesMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TransformResources transformResources , ProtocolMarshaller protocolMarshaller ) { } } | if ( transformResources == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( transformResources . getInstanceType ( ) , INSTANCETYPE_BINDING ) ; protocolMarshaller . marshall ( transformResources . getInstanceCount ( ) , INSTANCECOUNT_BINDING ) ; protocolMarshaller . marshall ( transformResources . getVolumeKmsKeyId ( ) , VOLUMEKMSKEYID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AbstractLinkedList { /** * Concatenates two linked lists . All elements of the specified list ( which will be empty afterwards ) are added at
* the end of this list . This operation runs in constant time .
* @ param other
* the list to append , */
public void concat ( AbstractLinkedList < ? extends E , ? extends T > other ) { } } | if ( other . isEmpty ( ) ) { return ; } if ( isEmpty ( ) ) { head = other . head ; last = other . last ; } else { T otherHead = other . head ; last . setNext ( otherHead ) ; otherHead . setPrev ( last ) ; last = other . last ; } size += other . size ; other . clear ( ) ; |
public class SpringBindRegistry { /** * register .
* @ param type a { @ link java . lang . Class } object .
* @ param name a { @ link java . lang . String } object .
* @ param args a { @ link java . lang . Object } object . */
public void register ( Class < ? > type , String name , Object ... args ) { } } | Assert . notNull ( name , "class'name is null" ) ; if ( 0 == args . length ) { nameTypes . put ( name , type ) ; } else { // 注册bean的name和别名
BeanDefinition bd = ( BeanDefinition ) args [ 0 ] ; definitionRegistry . registerBeanDefinition ( name , bd ) ; // for list ( a . class , b . class ) binding usage
String alias = bd . getBeanClassName ( ) ; if ( bd . isSingleton ( ) && ! name . equals ( alias ) && ! definitionRegistry . isBeanNameInUse ( alias ) ) { definitionRegistry . registerAlias ( name , alias ) ; } if ( null == type ) { if ( ! bd . isAbstract ( ) ) throw new RuntimeException ( "Concrete bean should has class." ) ; } else nameTypes . put ( name , type ) ; } |
public class Graphics { /** * Draw the the given shape filled in with a texture
* @ param shape
* The shape to texture .
* @ param image
* The image to tile across the shape
* @ param scaleX
* The scale to apply on the x axis for texturing
* @ param scaleY
* The scale to apply on the y axis for texturing */
public void texture ( Shape shape , Image image , float scaleX , float scaleY ) { } } | texture ( shape , image , scaleX , scaleY , false ) ; |
public class FidelityOptions { /** * Creates fidelity options using strict option . Note : no namespace
* prefixes , comments etc are preserved nor schema deviations are allowed .
* @ return default fidelity options */
public static FidelityOptions createStrict ( ) { } } | FidelityOptions fo = new FidelityOptions ( ) ; fo . options . add ( FEATURE_STRICT ) ; fo . isStrict = true ; return fo ; |
public class GeometryIndexService { /** * Given a certain geometry and index ( one ) , check if the the other index ( two ) is a neighbor .
* @ param geometry
* The geometry wherein to search if indices one and two are neighbors .
* @ param one
* One of the indices . Must point to either a vertex or and edge .
* @ param two
* Another one of the indices . Must point to either a vertex or and edge .
* @ return true or false . */
public boolean isAdjacent ( Geometry geometry , GeometryIndex one , GeometryIndex two ) { } } | List < GeometryIndex > neighbors = null ; try { if ( isVertex ( two ) ) { neighbors = getAdjacentVertices ( geometry , one ) ; } else if ( isEdge ( two ) ) { neighbors = getAdjacentEdges ( geometry , one ) ; } } catch ( GeometryIndexNotFoundException e ) { return false ; } if ( neighbors != null ) { for ( GeometryIndex neighbor : neighbors ) { if ( neighbor . equals ( two ) ) { return true ; } } } return false ; |
public class ServiceLoaderUtil { /** * Finds all implementations of the given service type and creates their instances .
* @ param clazz service type
* @ return implementations ' stream of the given service type */
public static < T > Stream < T > findAll ( Class < T > clazz ) { } } | ServiceLoader < T > load = ServiceLoader . load ( clazz ) ; return StreamSupport . stream ( load . spliterator ( ) , false ) ; |
public class CasCoreWebConfiguration { /** * Load property files containing non - i18n fallback values
* that should be exposed to Thyme templates .
* keys in properties files added last will take precedence over the
* internal cas _ common _ messages . properties .
* Keys in regular messages bundles will override any of the common messages .
* @ return PropertiesFactoryBean containing all common ( non - i18n ) messages */
@ Bean public PropertiesFactoryBean casCommonMessages ( ) { } } | val properties = new PropertiesFactoryBean ( ) ; val resourceLoader = new DefaultResourceLoader ( ) ; val commonNames = casProperties . getMessageBundle ( ) . getCommonNames ( ) ; val resourceList = commonNames . stream ( ) . map ( resourceLoader :: getResource ) . collect ( Collectors . toList ( ) ) ; resourceList . add ( resourceLoader . getResource ( "classpath:/cas_common_messages.properties" ) ) ; properties . setLocations ( resourceList . toArray ( Resource [ ] :: new ) ) ; properties . setSingleton ( true ) ; properties . setIgnoreResourceNotFound ( true ) ; return properties ; |
public class HttpProxyRequest { /** * Returns the host to which we are connecting . */
public synchronized final String getHost ( ) { } } | if ( host == null ) { if ( getEndpointAddress ( ) != null && ! getEndpointAddress ( ) . isUnresolved ( ) ) { host = getEndpointAddress ( ) . getHostName ( ) ; } if ( host == null && httpURI != null ) { try { host = ( new URL ( httpURI ) ) . getHost ( ) ; } catch ( MalformedURLException e ) { logger . debug ( "Malformed URL" , e ) ; } } } return host ; |
public class AmazonEC2Client { /** * Deletes one or more specified VPC endpoints . Deleting a gateway endpoint also deletes the endpoint routes in the
* route tables that were associated with the endpoint . Deleting an interface endpoint deletes the endpoint network
* interfaces .
* @ param deleteVpcEndpointsRequest
* Contains the parameters for DeleteVpcEndpoints .
* @ return Result of the DeleteVpcEndpoints operation returned by the service .
* @ sample AmazonEC2 . DeleteVpcEndpoints
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DeleteVpcEndpoints " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public DeleteVpcEndpointsResult deleteVpcEndpoints ( DeleteVpcEndpointsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDeleteVpcEndpoints ( request ) ; |
public class InternalXtextParser { /** * InternalXtext . g : 3294:1 : ruleAbstractNegatedToken returns [ EObject current = null ] : ( this _ NegatedToken _ 0 = ruleNegatedToken | this _ UntilToken _ 1 = ruleUntilToken ) ; */
public final EObject ruleAbstractNegatedToken ( ) throws RecognitionException { } } | EObject current = null ; EObject this_NegatedToken_0 = null ; EObject this_UntilToken_1 = null ; enterRule ( ) ; try { // InternalXtext . g : 3300:2 : ( ( this _ NegatedToken _ 0 = ruleNegatedToken | this _ UntilToken _ 1 = ruleUntilToken ) )
// InternalXtext . g : 3301:2 : ( this _ NegatedToken _ 0 = ruleNegatedToken | this _ UntilToken _ 1 = ruleUntilToken )
{ // InternalXtext . g : 3301:2 : ( this _ NegatedToken _ 0 = ruleNegatedToken | this _ UntilToken _ 1 = ruleUntilToken )
int alt72 = 2 ; int LA72_0 = input . LA ( 1 ) ; if ( ( LA72_0 == 41 ) ) { alt72 = 1 ; } else if ( ( LA72_0 == 43 ) ) { alt72 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 72 , 0 , input ) ; throw nvae ; } switch ( alt72 ) { case 1 : // InternalXtext . g : 3302:3 : this _ NegatedToken _ 0 = ruleNegatedToken
{ newCompositeNode ( grammarAccess . getAbstractNegatedTokenAccess ( ) . getNegatedTokenParserRuleCall_0 ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_2 ) ; this_NegatedToken_0 = ruleNegatedToken ( ) ; state . _fsp -- ; current = this_NegatedToken_0 ; afterParserOrEnumRuleCall ( ) ; } break ; case 2 : // InternalXtext . g : 3311:3 : this _ UntilToken _ 1 = ruleUntilToken
{ newCompositeNode ( grammarAccess . getAbstractNegatedTokenAccess ( ) . getUntilTokenParserRuleCall_1 ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_2 ) ; this_UntilToken_1 = ruleUntilToken ( ) ; state . _fsp -- ; current = this_UntilToken_1 ; afterParserOrEnumRuleCall ( ) ; } break ; } } leaveRule ( ) ; } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getBCA ( ) { } } | if ( bcaEClass == null ) { bcaEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 195 ) ; } return bcaEClass ; |
public class br_restoreconfig { /** * < pre >
* Use this operation to restore config from file on Repeater Instances in bulk .
* < / pre > */
public static br_restoreconfig [ ] restoreconfig ( nitro_service client , br_restoreconfig [ ] resources ) throws Exception { } } | if ( resources == null ) throw new Exception ( "Null resource array" ) ; if ( resources . length == 1 ) return ( ( br_restoreconfig [ ] ) resources [ 0 ] . perform_operation ( client , "restoreconfig" ) ) ; return ( ( br_restoreconfig [ ] ) perform_operation_bulk_request ( client , resources , "restoreconfig" ) ) ; |
public class SyntheticPropertyList { /** * Adds a property to this index , with the specified direction .
* @ param propertyName name of property to add to index
* @ param direction optional direction of property */
public void addProperty ( String propertyName , Direction direction ) { } } | if ( propertyName == null ) { throw new IllegalArgumentException ( ) ; } if ( direction == null ) { direction = Direction . UNSPECIFIED ; } if ( direction != Direction . UNSPECIFIED ) { if ( propertyName . length ( ) > 0 ) { if ( propertyName . charAt ( 0 ) == '-' || propertyName . charAt ( 0 ) == '+' ) { // Overrule the direction .
propertyName = propertyName . substring ( 1 ) ; } } propertyName = direction . toCharacter ( ) + propertyName ; } mPropertyList . add ( propertyName ) ; |
public class CrossTabColorShema { /** * Sets the color for each total for the row
* @ param row ( starting from 1)
* @ param color */
public void setTotalColorForRow ( int row , Color color ) { } } | int map = ( colors [ 0 ] . length - 1 ) - row ; colors [ colors . length - 1 ] [ map ] = color ; |
public class AptUtils { /** * Checks that the annotation { @ code am } has the name of { @ code anno } .
* Values are ignored . */
public static boolean areSameByClass ( AnnotationMirror am , Class < ? extends Annotation > anno ) { } } | return areSameByName ( am , anno . getCanonicalName ( ) . intern ( ) ) ; |
public class DevicesInner { /** * Uploads registration certificate for the device .
* @ param deviceName The device name .
* @ param resourceGroupName The resource group name .
* @ param parameters The upload certificate request .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the UploadCertificateResponseInner object */
public Observable < ServiceResponse < UploadCertificateResponseInner > > uploadCertificateWithServiceResponseAsync ( String deviceName , String resourceGroupName , UploadCertificateRequest parameters ) { } } | if ( deviceName == null ) { throw new IllegalArgumentException ( "Parameter deviceName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } Validator . validate ( parameters ) ; return service . uploadCertificate ( deviceName , this . client . subscriptionId ( ) , resourceGroupName , parameters , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < UploadCertificateResponseInner > > > ( ) { @ Override public Observable < ServiceResponse < UploadCertificateResponseInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < UploadCertificateResponseInner > clientResponse = uploadCertificateDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class AromaticityCalculator { /** * Tests the < code > ring < / code > in the < code > molecule < / code > for aromaticity . Uses the
* H & uuml ; ckel rule ( 4n + 2 ) pie electrons . sp < sup > 2 < / sup > hybridized C contibute 1 electron non
* sp < sup > 2 < / sup > hybridized heteroatoms contribute 2 electrons ( N and O should never be sp in
* or anything else in a ring and d electron elements get to complicated )
* sp < sup > 2 < / sup > hybridized heteroatoms contribute 1 electron hybridization is worked out by
* counting the number of bonds with order 2 . Therefore sp < sup > 2 < / sup > hybridization is assumed
* if there is one bond of order 2 . Otherwise sp < sup > 3 < / sup > hybridization is assumed .
* @ param ring the ring to test
* @ param atomContainer the AtomContainer the ring is in
* @ return true if the ring is aromatic false otherwise . */
public static boolean isAromatic ( IRing ring , IAtomContainer atomContainer ) { } } | java . util . Iterator < IAtom > ringAtoms = ring . atoms ( ) . iterator ( ) ; int eCount = 0 ; java . util . List < IBond > conectedBonds ; int numDoubleBond = 0 ; boolean allConnectedBondsSingle ; while ( ringAtoms . hasNext ( ) ) { IAtom atom = ringAtoms . next ( ) ; numDoubleBond = 0 ; allConnectedBondsSingle = true ; conectedBonds = atomContainer . getConnectedBondsList ( atom ) ; for ( IBond conectedBond : conectedBonds ) { if ( conectedBond . getOrder ( ) == IBond . Order . DOUBLE && ring . contains ( conectedBond ) ) { numDoubleBond ++ ; } // Count the Electron if bond order = 1.5
else if ( conectedBond . getFlag ( CDKConstants . ISAROMATIC ) && ring . contains ( conectedBond ) ) { numDoubleBond = 1 ; } if ( conectedBond . getOrder ( ) != IBond . Order . SINGLE ) { allConnectedBondsSingle = false ; } } if ( numDoubleBond == 1 ) { // C or heteroatoms both contibute 1 electron in sp2 hybridized form
eCount ++ ; } else if ( ! atom . getSymbol ( ) . equals ( "C" ) ) { // Heteroatom probably in sp3 hybrid therefore 2 electrons contributed .
eCount = eCount + 2 ; } else if ( atom . getFlag ( CDKConstants . ISAROMATIC ) ) { eCount ++ ; } else if ( allConnectedBondsSingle && atom . getSymbol ( ) . equals ( "C" ) && atom . getFormalCharge ( ) == 1.0 ) { // This is for tropylium and kinds .
// Dependence on hybridisation would be better :
// empty p - orbital is needed
continue ; } else { return false ; } } return eCount - 2 != 0 && ( eCount - 2 ) % 4 == 0 ; |
public class BasicUserProfile { /** * Check to see if profile contains attribute name .
* @ param name the name
* @ return true / false */
@ Override public boolean containsAttribute ( final String name ) { } } | CommonHelper . assertNotNull ( "name" , name ) ; return this . attributes . containsKey ( name ) ; |
public class BitSetHelper { /** * Extract the long representation of the passed bit set . To avoid loss of
* data , the bit set may not have more than 64 bits .
* @ param aBS
* The bit set to extract the value from . May not be < code > null < / code > .
* @ return The extracted value . May be negative if the bit set has 64
* elements , the highest order bit is set . */
public static long getExtractedLongValue ( @ Nonnull final BitSet aBS ) { } } | ValueEnforcer . notNull ( aBS , "BitSet" ) ; final int nMax = aBS . length ( ) ; ValueEnforcer . isTrue ( nMax <= CGlobal . BITS_PER_LONG , ( ) -> "Can extract only up to " + CGlobal . BITS_PER_LONG + " bits" ) ; long ret = 0 ; for ( int i = nMax - 1 ; i >= 0 ; -- i ) { ret <<= 1 ; if ( aBS . get ( i ) ) ret += CGlobal . BIT_SET ; } return ret ; |
public class SplitterNode { /** * Gets the child node splits .
* @ return A list of child node splits */
public List < Double > getSplits ( ) { } } | List < Double > splits = new ArrayList < Double > ( ) ; for ( Node curNode : getVisibleChildren ( ) ) { splits . add ( nodeSplits . get ( curNode ) ) ; } return splits ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AbstractFeatureType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link AbstractFeatureType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "_Feature" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "_GML" ) public JAXBElement < AbstractFeatureType > create_Feature ( AbstractFeatureType value ) { } } | return new JAXBElement < AbstractFeatureType > ( __Feature_QNAME , AbstractFeatureType . class , null , value ) ; |
public class DocumentRevisionTree { /** * < p > Returns whether this document is conflicted . < / p >
* @ return true if there is more than one branch terminated by an active
* leaf revision , otherwise false */
public boolean hasConflicts ( ) { } } | int count = 0 ; for ( DocumentRevisionNode n : leafs ) { if ( ! n . getData ( ) . isDeleted ( ) ) { count ++ ; if ( count > 1 ) { return true ; } } } return false ; |
public class BaseFont { /** * Gets the width of a < CODE > String < / CODE > in normalized 1000 units .
* @ param text the < CODE > String < / CODE > to get the width of
* @ return the width in normalized 1000 units */
public int getWidth ( String text ) { } } | int total = 0 ; if ( fastWinansi ) { int len = text . length ( ) ; for ( int k = 0 ; k < len ; ++ k ) { char char1 = text . charAt ( k ) ; if ( char1 < 128 || ( char1 >= 160 && char1 <= 255 ) ) total += widths [ char1 ] ; else total += widths [ PdfEncodings . winansi . get ( char1 ) ] ; } return total ; } else { byte mbytes [ ] = convertToBytes ( text ) ; for ( int k = 0 ; k < mbytes . length ; ++ k ) total += widths [ 0xff & mbytes [ k ] ] ; } return total ; |
public class ReadStreamIterator { /** * Create a stream iterator that can enforce shard boundary semantics .
* @ param auth The OfflineAuth to use for the request .
* @ param request The request for the shard of data .
* @ param shardBoundary The shard boundary semantics to enforce .
* @ param fields Which fields to include in a partial response or null for all .
* @ throws IOException
* @ throws GeneralSecurityException */
public static ReadStreamIterator enforceShardBoundary ( OfflineAuth auth , StreamReadsRequest request , Requirement shardBoundary , String fields ) throws IOException , GeneralSecurityException { } } | return ReadStreamIterator . enforceShardBoundary ( GenomicsChannel . fromOfflineAuth ( auth , fields ) , request , shardBoundary , fields ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcPath ( ) { } } | if ( ifcPathEClass == null ) { ifcPathEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 407 ) ; } return ifcPathEClass ; |
public class NodeUtil { /** * @ return Whether the provided expression is known not to evaluate to ' undefined ' .
* Similar to # getKnownValueType only for ' undefined ' . This is useful for simplifying
* default value expressions . */
static boolean isDefinedValue ( Node value ) { } } | switch ( value . getToken ( ) ) { case ASSIGN : // Only the assigned value matters here .
case CAST : case COMMA : return isDefinedValue ( value . getLastChild ( ) ) ; case AND : case OR : return isDefinedValue ( value . getFirstChild ( ) ) && isDefinedValue ( value . getLastChild ( ) ) ; case HOOK : return isDefinedValue ( value . getSecondChild ( ) ) && isDefinedValue ( value . getLastChild ( ) ) ; // Assume undefined leaks in this and call results .
case CALL : case NEW : case GETELEM : case GETPROP : case TAGGED_TEMPLATELIT : case THIS : case YIELD : case AWAIT : case VOID : return false ; case DELPROP : case INC : case DEC : case CLASS : case FUNCTION : case REGEXP : case EMPTY : case ARRAYLIT : case OBJECTLIT : case TEMPLATELIT : case STRING : case NUMBER : case NULL : case TRUE : case FALSE : return true ; case TEMPLATELIT_STRING : return value . getCookedString ( ) != null ; case NAME : String name = value . getString ( ) ; // We assume here that programs don ' t change the value of the keyword
// undefined to something other than the value undefined .
return "Infinity" . equals ( name ) || "NaN" . equals ( name ) ; default : // Other op force a local value :
// ' ' + g ( a string )
// x - = g ( x is now an number )
if ( isAssignmentOp ( value ) || isSimpleOperator ( value ) ) { return true ; } throw new IllegalStateException ( "Unexpected expression node: " + value + "\n parent:" + value . getParent ( ) ) ; } |
public class ListManagementTermsImpl { /** * Gets all terms from the list with list Id equal to the list Id passed .
* @ param listId List Id of the image list .
* @ param language Language of the terms .
* @ param getAllTermsOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws APIErrorException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the Terms object if successful . */
public Terms getAllTerms ( String listId , String language , GetAllTermsOptionalParameter getAllTermsOptionalParameter ) { } } | return getAllTermsWithServiceResponseAsync ( listId , language , getAllTermsOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class PoolBase { /** * Set the query timeout , if it is supported by the driver .
* @ param statement a statement to set the query timeout on
* @ param timeoutSec the number of seconds before timeout */
private void setQueryTimeout ( final Statement statement , final int timeoutSec ) { } } | if ( isQueryTimeoutSupported != FALSE ) { try { statement . setQueryTimeout ( timeoutSec ) ; isQueryTimeoutSupported = TRUE ; } catch ( Exception e ) { if ( isQueryTimeoutSupported == UNINITIALIZED ) { isQueryTimeoutSupported = FALSE ; logger . info ( "{} - Failed to set query timeout for statement. ({})" , poolName , e . getMessage ( ) ) ; } } } |
public class WebAppSecurityCollaboratorImpl { /** * no null check for webReply object , so make sure it is not null upon calling this method . */
private void logAuditEntriesBeforeAuthn ( WebReply webReply , Subject receivedSubject , String uriName , WebRequest webRequest ) { } } | AuthenticationResult authResult ; if ( webReply instanceof PermitReply ) { authResult = new AuthenticationResult ( AuthResult . SUCCESS , receivedSubject , null , null , AuditEvent . OUTCOME_SUCCESS ) ; } else { authResult = new AuthenticationResult ( AuthResult . FAILURE , receivedSubject , null , null , AuditEvent . OUTCOME_FAILURE ) ; } int statusCode = Integer . valueOf ( webReply . getStatusCode ( ) ) ; Audit . audit ( Audit . EventID . SECURITY_AUTHN_01 , webRequest , authResult , statusCode ) ; Audit . audit ( Audit . EventID . SECURITY_AUTHZ_01 , webRequest , authResult , uriName , statusCode ) ; |
public class BsJobLog { @ Override public Map < String , Object > toSource ( ) { } } | Map < String , Object > sourceMap = new HashMap < > ( ) ; if ( endTime != null ) { addFieldToSource ( sourceMap , "endTime" , endTime ) ; } if ( jobName != null ) { addFieldToSource ( sourceMap , "jobName" , jobName ) ; } if ( jobStatus != null ) { addFieldToSource ( sourceMap , "jobStatus" , jobStatus ) ; } if ( lastUpdated != null ) { addFieldToSource ( sourceMap , "lastUpdated" , lastUpdated ) ; } if ( scriptData != null ) { addFieldToSource ( sourceMap , "scriptData" , scriptData ) ; } if ( scriptResult != null ) { addFieldToSource ( sourceMap , "scriptResult" , scriptResult ) ; } if ( scriptType != null ) { addFieldToSource ( sourceMap , "scriptType" , scriptType ) ; } if ( startTime != null ) { addFieldToSource ( sourceMap , "startTime" , startTime ) ; } if ( target != null ) { addFieldToSource ( sourceMap , "target" , target ) ; } return sourceMap ; |
public class BaseNeo4jAssociationQueries { /** * Returns the relationship corresponding to the { @ link AssociationKey } and { @ link RowKey } .
* @ param executionEngine the { @ link GraphDatabaseService } used to run the query
* @ param associationKey represents the association
* @ param rowKey represents a row in an association
* @ return the corresponding relationship */
public Relationship findRelationship ( GraphDatabaseService executionEngine , AssociationKey associationKey , RowKey rowKey ) { } } | Object [ ] relationshipValues = relationshipValues ( associationKey , rowKey ) ; Object [ ] queryValues = ArrayHelper . concat ( associationKey . getEntityKey ( ) . getColumnValues ( ) , relationshipValues ) ; Result result = executionEngine . execute ( findRelationshipQuery , params ( queryValues ) ) ; return singleResult ( result ) ; |
public class PeriodicReplicationService { /** * Set a flag in SharedPreferences to indicate whether periodic replications were explicitly
* stopped .
* @ param explicitlyStopped true to indicate that periodic replications were stopped
* explicitly by the sending of COMMAND _ STOP _ PERIODIC _ REPLICATION ,
* otherwise false . */
private void setExplicitlyStopped ( boolean explicitlyStopped ) { } } | SharedPreferences . Editor editor = mPrefs . edit ( ) ; editor . putBoolean ( constructKey ( EXPLICITLY_STOPPED_SUFFIX ) , explicitlyStopped ) ; editor . apply ( ) ; |
public class LongStreamEx { /** * Returns the minimum element of this stream according to the provided key
* extractor function .
* This is a terminal operation .
* @ param keyExtractor a non - interfering , stateless function
* @ return an { @ code OptionalLong } describing the first element of this
* stream for which the lowest value was returned by key extractor ,
* or an empty { @ code OptionalLong } if the stream is empty
* @ since 0.1.2 */
public OptionalLong minByLong ( LongUnaryOperator keyExtractor ) { } } | long [ ] result = collect ( ( ) -> new long [ 3 ] , ( acc , l ) -> { long key = keyExtractor . applyAsLong ( l ) ; if ( acc [ 2 ] == 0 || acc [ 1 ] > key ) { acc [ 0 ] = l ; acc [ 1 ] = key ; acc [ 2 ] = 1 ; } } , ( acc1 , acc2 ) -> { if ( acc2 [ 2 ] == 1 && ( acc1 [ 2 ] == 0 || acc1 [ 1 ] > acc2 [ 1 ] ) ) System . arraycopy ( acc2 , 0 , acc1 , 0 , 3 ) ; } ) ; return result [ 2 ] == 1 ? OptionalLong . of ( result [ 0 ] ) : OptionalLong . empty ( ) ; |
public class SmsClient { /** * Get the detail of message template
* @ param request The request object which includes the id of template which is ready to be get
* @ return The response object which includes all of the detail of message template , refer to
* < code > com . baidubce . services . sms . model . GetTemplateDetailResponse < / code >
* @ see com . baidubce . services . sms . model . GetTemplateDetailRequest
* @ see com . baidubce . services . sms . model . GetTemplateDetailResponse */
public GetTemplateDetailResponse getTemplateDetail ( GetTemplateDetailRequest request ) { } } | checkNotNull ( request , "object request should not be null." ) ; assertStringNotNullOrEmpty ( request . getTemplateId ( ) , "object templateId should not be null or empty." ) ; InternalRequest internalRequest = this . createRequest ( "template" , request , HttpMethodName . GET , request . getTemplateId ( ) ) ; return this . invokeHttpClient ( internalRequest , GetTemplateDetailResponse . class ) ; |
public class Transformation2D { /** * Set transformation to a shear .
* @ param proportionX
* The proportion of shearing in x direction .
* @ param proportionY
* The proportion of shearing in y direction . */
public void setShear ( double proportionX , double proportionY ) { } } | xx = 1 ; xy = proportionX ; xd = 0 ; yx = proportionY ; yy = 1 ; yd = 0 ; |
public class AssessmentRunNotificationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AssessmentRunNotification assessmentRunNotification , ProtocolMarshaller protocolMarshaller ) { } } | if ( assessmentRunNotification == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( assessmentRunNotification . getDate ( ) , DATE_BINDING ) ; protocolMarshaller . marshall ( assessmentRunNotification . getEvent ( ) , EVENT_BINDING ) ; protocolMarshaller . marshall ( assessmentRunNotification . getMessage ( ) , MESSAGE_BINDING ) ; protocolMarshaller . marshall ( assessmentRunNotification . getError ( ) , ERROR_BINDING ) ; protocolMarshaller . marshall ( assessmentRunNotification . getSnsTopicArn ( ) , SNSTOPICARN_BINDING ) ; protocolMarshaller . marshall ( assessmentRunNotification . getSnsPublishStatusCode ( ) , SNSPUBLISHSTATUSCODE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CreateFunctionRequest { /** * A list of < a href = " https : / / docs . aws . amazon . com / lambda / latest / dg / tagging . html " > tags < / a > to apply to the function .
* @ param tags
* A list of < a href = " https : / / docs . aws . amazon . com / lambda / latest / dg / tagging . html " > tags < / a > to apply to the
* function .
* @ return Returns a reference to this object so that method calls can be chained together . */
public CreateFunctionRequest withTags ( java . util . Map < String , String > tags ) { } } | setTags ( tags ) ; return this ; |
public class DBPropertiesUpdate { /** * inserts a new language into the Database .
* @ param _ language language to be inserted
* @ return ID of the new language */
private long insertNewLanguage ( final String _language ) { } } | Long ret = null ; try { final Insert insert = new Insert ( CIAdmin . Language ) ; insert . add ( CIAdmin . Language . Language , _language ) ; insert . executeWithoutAccessCheck ( ) ; ret = insert . getId ( ) ; insert . close ( ) ; } catch ( final EFapsException e ) { DBPropertiesUpdate . LOG . error ( "insertNewLanguage()" , e ) ; } return ret ; |
public class Utils { /** * Must call when epoll is available */
private static Class < ? extends Channel > epollChannelType ( ) { } } | try { Class < ? extends Channel > channelType = Class . forName ( "io.netty.channel.epoll.EpollSocketChannel" ) . asSubclass ( Channel . class ) ; return channelType ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( "Cannot load EpollSocketChannel" , e ) ; } |
public class A_CmsUploadDialog { /** * Removes the drag and drop message . < p > */
protected void removeDragAndDropMessage ( ) { } } | if ( m_dragAndDropMessage != null ) { m_dragAndDropMessage . removeFromParent ( ) ; m_dragAndDropMessage = null ; getContentWrapper ( ) . getElement ( ) . getStyle ( ) . clearBackgroundColor ( ) ; } |
public class ValidatorTag { /** * < p > Create and return a new { @ link Validator } to be registered
* on our surrounding { @ link UIComponent } . < / p >
* @ throws JspException if a new instance cannot be created */
protected Validator createValidator ( ) throws JspException { } } | FacesContext context = FacesContext . getCurrentInstance ( ) ; Validator validator = null ; ValueExpression vb = null ; // If " binding " is set , use it to create a validator instance .
if ( binding != null ) { try { vb = context . getApplication ( ) . getExpressionFactory ( ) . createValueExpression ( context . getELContext ( ) , binding , Object . class ) ; if ( vb != null ) { validator = ( Validator ) vb . getValue ( context . getELContext ( ) ) ; if ( validator != null ) { return validator ; } } } catch ( Exception e ) { throw new JspException ( e ) ; } } // If " validatorId " is set , use it to create the validator
// instance . If " validatorId " and " binding " are both set , store the
// validator instance in the value of the property represented by
// the value binding expression .
if ( validatorId != null ) { try { String validatorIdVal = validatorId ; if ( UIComponentTag . isValueReference ( validatorId ) ) { ValueExpression idBinding = context . getApplication ( ) . getExpressionFactory ( ) . createValueExpression ( context . getELContext ( ) , validatorId , Object . class ) ; validatorIdVal = ( String ) idBinding . getValue ( context . getELContext ( ) ) ; } validator = context . getApplication ( ) . createValidator ( validatorIdVal ) ; if ( validator != null ) { if ( vb != null ) { vb . setValue ( context . getELContext ( ) , validator ) ; } } } catch ( Exception e ) { throw new JspException ( e ) ; } } return validator ; |
public class BBox { /** * Calculates the intersecting BBox between this and the specified BBox
* @ return the intersecting BBox or null if not intersecting */
public BBox calculateIntersection ( BBox bBox ) { } } | if ( ! this . intersects ( bBox ) ) return null ; double minLon = Math . max ( this . minLon , bBox . minLon ) ; double maxLon = Math . min ( this . maxLon , bBox . maxLon ) ; double minLat = Math . max ( this . minLat , bBox . minLat ) ; double maxLat = Math . min ( this . maxLat , bBox . maxLat ) ; return new BBox ( minLon , maxLon , minLat , maxLat ) ; |
public class RedisQueueFactory { /** * { @ inheritDoc }
* @ throws Exception */
@ Override protected void initQueue ( T queue , QueueSpec spec ) throws Exception { } } | queue . setEphemeralDisabled ( getDefaultEphemeralDisabled ( ) ) . setEphemeralMaxSize ( getDefaultEphemeralMaxSize ( ) ) ; Boolean ephemeralDisabled = spec . getField ( QueueSpec . FIELD_EPHEMERAL_DISABLED , Boolean . class ) ; if ( ephemeralDisabled != null ) { queue . setEphemeralDisabled ( ephemeralDisabled . booleanValue ( ) ) ; } Integer maxEphemeralSize = spec . getField ( QueueSpec . FIELD_EPHEMERAL_MAX_SIZE , Integer . class ) ; if ( maxEphemeralSize != null ) { queue . setEphemeralMaxSize ( maxEphemeralSize . intValue ( ) ) ; } queue . setRedisHostAndPort ( getDefaultHostAndPort ( ) ) . setRedisPassword ( getDefaultPassword ( ) ) . setJedisConnector ( getDefaultJedisConnector ( ) ) ; String redisHostAndPort = spec . getField ( SPEC_FIELD_HOST_AND_PORT ) ; if ( ! StringUtils . isBlank ( redisHostAndPort ) ) { queue . setRedisHostAndPort ( redisHostAndPort ) ; } String redisPassword = spec . getField ( SPEC_FIELD_PASSWORD ) ; if ( ! StringUtils . isBlank ( redisPassword ) ) { queue . setRedisPassword ( redisPassword ) ; } queue . setRedisHashName ( getDefaultHashName ( ) ) . setRedisListName ( getDefaultListName ( ) ) . setRedisSortedSetName ( getDefaultSortedSetName ( ) ) ; String redisHashName = spec . getField ( SPEC_FIELD_HASH_NAME ) ; String redisListName = spec . getField ( SPEC_FIELD_LIST_NAME ) ; String redisSortedSetName = spec . getField ( SPEC_FIELD_SORTED_SET_NAME ) ; if ( ! StringUtils . isBlank ( redisHashName ) && ! StringUtils . isBlank ( redisListName ) && ! StringUtils . isBlank ( redisSortedSetName ) ) { queue . setRedisHashName ( redisHashName ) ; queue . setRedisListName ( redisListName ) ; queue . setRedisSortedSetName ( redisSortedSetName ) ; } else if ( ! StringUtils . isBlank ( redisHashName ) || ! StringUtils . isBlank ( redisListName ) || ! StringUtils . isBlank ( redisSortedSetName ) ) { throw new IllegalArgumentException ( "Either supply all parameters [" + SPEC_FIELD_HASH_NAME + "], [" + SPEC_FIELD_LIST_NAME + "] and [" + SPEC_FIELD_SORTED_SET_NAME + "] or none at all!" ) ; } super . initQueue ( queue , spec ) ; |
public class ChaiProviderFactory { /** * Maintains the global chai provider statistics . All { @ code com . novell . ldapchai . provider . ChaiProvider } instances
* that have their { @ link ChaiSetting # STATISTICS _ ENABLE } set to < i > true < / i > will register statistics in
* this global tracker .
* @ return a ProviderStatistics instance containing global statistics for the Chai API */
public Map < String , String > getGlobalStatistics ( ) { } } | final Map < String , String > debugProperties = new LinkedHashMap < > ( ) ; final ProviderStatistics providerStatistics = getCentralService ( ) . getStatsBean ( ) ; if ( providerStatistics != null ) { debugProperties . putAll ( providerStatistics . allStatistics ( ) ) ; } return Collections . unmodifiableMap ( debugProperties ) ; |
public class RoutesApi { /** * Get route Get the systems between origin and destination - - - This route
* is cached for up to 86400 seconds
* @ param destination
* destination solar system ID ( required )
* @ param origin
* origin solar system ID ( required )
* @ param avoid
* avoid solar system ID ( s ) ( optional )
* @ param connections
* connected solar system pairs ( optional )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param flag
* route security preference ( optional , default to shortest )
* @ param ifNoneMatch
* ETag from a previous request . A 304 will be returned if this
* matches the current ETag ( optional )
* @ return List & lt ; Integer & gt ;
* @ throws ApiException
* If fail to call the API , e . g . server error or cannot
* deserialize the response body */
public List < Integer > getRouteOriginDestination ( Integer destination , Integer origin , List < Integer > avoid , List < List < Integer > > connections , String datasource , String flag , String ifNoneMatch ) throws ApiException { } } | ApiResponse < List < Integer > > resp = getRouteOriginDestinationWithHttpInfo ( destination , origin , avoid , connections , datasource , flag , ifNoneMatch ) ; return resp . getData ( ) ; |
public class ID3v1Tag { /** * Set the year field of the tag . The maximum size of the String is 4.
* If the size exceeds the maximum size , the String will be truncated .
* @ param newYear the year for the tag */
public void setYear ( String newYear ) { } } | if ( newYear . length ( ) > YEAR_SIZE ) { year = newYear . substring ( 0 , YEAR_SIZE ) ; } else { year = newYear ; } |
public class HttpHeaders { /** * Get { @ link Map } representation of the HttpHeaders collection .
* @ return the headers as map */
public Map < String , String > toMap ( ) { } } | final Map < String , String > result = new HashMap < > ( ) ; for ( final HttpHeader header : headers . values ( ) ) { result . put ( header . name ( ) , header . value ( ) ) ; } return result ; |
public class BagArray { /** * Retrieve an indexed element and return it as a BagArray .
* @ param index An integer value specifying the offset from the beginning of the array .
* @ return The element as a BagArray , or null if the element is not found . */
public BagArray getBagArray ( int index ) { } } | Object object = getObject ( index ) ; try { return ( BagArray ) object ; } catch ( ClassCastException exception ) { log . warn ( "Cannot cast value type (" + object . getClass ( ) . getName ( ) + ") to BagArray for index (" + index + ")" ) ; } return null ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.