signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class POIProxy { /** * This method is used to get the pois from a category and return a list of
* { @ link JTSFeature } document with the data retrieved given a bounding box
* corners
* @ param id
* The id of the service
* @ param minX
* @ param minY
* @ param maxX
* @ param maxY
* @ return A l... | List < String > ids = serviceManager . getAvailableServices ( ) . getServicesIDByCategory ( category ) ; ArrayList < JTSFeature > features = new ArrayList < JTSFeature > ( ) ; for ( String id : ids ) { try { features . addAll ( getFeatures ( id , minX , minY , maxX , maxY , optionalParams ) ) ; } catch ( Exception e ) ... |
public class TabDemoModel { private Dockable dockable ( String modelKey ) { } } | return Dockable . create ( ) . modelKey ( Key . create ( SimpleModel . class , "Tab" + modelKey ) ) . name ( "Tab" + modelKey ) ; |
public class Result { /** * Accept Arrays and mark as empty or not
* @ param value
* @ return */
public static < R > Result < R [ ] > ok ( R value [ ] ) { } } | return new Result < R [ ] > ( value , OK , SUCCESS , null ) . emptyList ( value . length == 0 ) ; |
public class ReportGenerator { /** * Writes the dependency - check report ( s ) .
* @ param outputLocation the path where the reports should be written
* @ param format the format the report should be written in ( XML , HTML , ALL )
* @ throws ReportException is thrown if there is an error creating out the
* re... | if ( format == Format . ALL ) { for ( Format f : Format . values ( ) ) { if ( f != Format . ALL ) { write ( outputLocation , f ) ; } } } else { final File out = getReportFile ( outputLocation , format ) ; final String templateName = format . toString ( ) . toLowerCase ( ) + "Report" ; processTemplate ( templateName , o... |
public class TrueTypeFont { /** * Reads the font data .
* @ param ttfAfm the font as a < CODE > byte < / CODE > array , possibly < CODE > null < / CODE >
* @ throws DocumentException the font is invalid
* @ throws IOException the font file could not be read
* @ since2.1.5 */
void process ( byte ttfAfm [ ] , boo... | tables = new HashMap ( ) ; try { if ( ttfAfm == null ) rf = new RandomAccessFileOrArray ( fileName , preload , Document . plainRandomAccess ) ; else rf = new RandomAccessFileOrArray ( ttfAfm ) ; if ( ttcIndex . length ( ) > 0 ) { int dirIdx = Integer . parseInt ( ttcIndex ) ; if ( dirIdx < 0 ) throw new DocumentExcepti... |
public class CommerceWarehouseLocalServiceUtil { /** * Adds the commerce warehouse to the database . Also notifies the appropriate model listeners .
* @ param commerceWarehouse the commerce warehouse
* @ return the commerce warehouse that was added */
public static com . liferay . commerce . model . CommerceWarehou... | return getService ( ) . addCommerceWarehouse ( commerceWarehouse ) ; |
public class BasicScope { /** * Remove event listener from list of listeners
* @ param listener
* Listener to remove
* @ return true if listener is removed and false otherwise */
public boolean removeEventListener ( IEventListener listener ) { } } | log . debug ( "removeEventListener - scope: {} {}" , getName ( ) , listener ) ; if ( log . isTraceEnabled ( ) ) { log . trace ( "Listeners - check #1: {}" , listeners ) ; } boolean removed = listeners . remove ( listener ) ; if ( ! keepOnDisconnect ) { if ( removed && keepAliveJobName == null ) { if ( ScopeUtils . isRo... |
public class PrimitiveTypeMapper { /** * Translate primitive type names ( such as int , long , boolean ) to Object
* type names ( such as Integer , Long , Boolean ) . If the primitive type is not
* defined this method will return the primitiveTypeName . */
public String mapPrimitiveType2ObjectTypeName ( String prim... | if ( primitive2ObjectTypeNameMap . containsKey ( primitiveTypeName ) ) { return primitive2ObjectTypeNameMap . get ( primitiveTypeName ) ; } else { return primitiveTypeName ; } |
public class UpdateIntegrationRequest { /** * A key - value map specifying request parameters that are passed from the method request to the backend . The key is
* an integration request parameter name and the associated value is a method request parameter value or static
* value that must be enclosed within single... | setRequestParameters ( requestParameters ) ; return this ; |
public class CollectMethodsReturningImmutableCollections { /** * overrides the visitor to reset the stack for the new method , then checks if the immutability field is set to immutable and if so reports it
* @ param obj
* the context object of the currently parsed method */
@ Override public void visitCode ( Code o... | try { String signature = SignatureUtils . getReturnSignature ( getMethod ( ) . getSignature ( ) ) ; if ( signature . startsWith ( Values . SIG_QUALIFIED_CLASS_PREFIX ) && CollectionUtils . isListSetMap ( SignatureUtils . stripSignature ( signature ) ) ) { stack . resetForMethodEntry ( this ) ; imType = ImmutabilityType... |
public class AmazonRekognitionClient { /** * Provides information about a stream processor created by < a > CreateStreamProcessor < / a > . You can get information
* about the input and output streams , the input parameters for the face recognition being performed , and the
* current status of the stream processor ... | request = beforeClientExecution ( request ) ; return executeDescribeStreamProcessor ( request ) ; |
public class NativeJSON { /** * # string _ id _ map # */
@ Override protected int findPrototypeId ( String s ) { } } | int id ; // # generated # Last update : 2009-05-25 16:01:00 EDT
{ id = 0 ; String X = null ; L : switch ( s . length ( ) ) { case 5 : X = "parse" ; id = Id_parse ; break L ; case 8 : X = "toSource" ; id = Id_toSource ; break L ; case 9 : X = "stringify" ; id = Id_stringify ; break L ; } if ( X != null && X != s && ! X ... |
public class EmbeddedCDXServerIndex { /** * create { @ link CDXWriter } for writing capture search result .
* < p > possible future changes :
* < ul >
* < li > drop unused argument { @ code waybackAuthToken } < / li >
* < li > change return type to super class ( as far up as appropriate ) < / li >
* < / ul > ... | final CDXQuery query = createQuery ( wbRequest , isFuzzy ) ; if ( isFuzzy && query == null ) { return null ; } boolean resolveRevisits = wbRequest . isReplayRequest ( ) ; // For now , not using seek single capture to allow for run time checking of additional records
// boolean seekSingleCapture = resolveRevisits & & wb... |
public class Option { /** * Read options .
* @ return true , if successful */
public boolean readOptions ( ) { } } | String filename = modelDir + File . separator + optionFile ; BufferedReader fin = null ; String line ; try { fin = new BufferedReader ( new FileReader ( filename ) ) ; System . out . println ( "Reading options ..." ) ; // read option lines
while ( ( line = fin . readLine ( ) ) != null ) { String trimLine = line . trim ... |
public class ReflectionUtils { /** * Check if the field supplied is parameterized with a valid JCR property type .
* @ param field the field
* @ return true if the field is parameterized with a valid JCR property type , else false
* @ deprecated this class is unused in morphia and will be removed in a future rele... | if ( field . getGenericType ( ) instanceof ParameterizedType ) { final ParameterizedType genericType = ( ParameterizedType ) field . getGenericType ( ) ; for ( final Type type : genericType . getActualTypeArguments ( ) ) { if ( isPropertyType ( ( Class ) type ) ) { return true ; } } } return false ; |
public class SignatureDef { /** * < pre >
* Named output parameters .
* < / pre >
* < code > map & lt ; string , . tensorflow . TensorInfo & gt ; outputs = 2 ; < / code > */
public boolean containsOutputs ( java . lang . String key ) { } } | if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } return internalGetOutputs ( ) . getMap ( ) . containsKey ( key ) ; |
public class AbstractSecureSocketHandler { /** * / * ( non - Javadoc )
* @ see org . openhealthtools . ihe . atna . nodeauth . SocketHandler # getSocket ( java . lang . String , int , boolean , org . openhealthtools . ihe . atna . nodeauth . SecurityDomain ) */
public Socket getSocket ( String host , int port , boole... | return getSocket ( host , port , useSecureSocket , securityDomain , null ) ; |
public class DiagramElement { /** * Sets the value of the style property .
* @ param value
* allowed object is
* { @ link JAXBElement } { @ code < } { @ link DMNStyle } { @ code > }
* { @ link JAXBElement } { @ code < } { @ link Style } { @ code > } */
public void setStyle ( org . kie . dmn . model . api . dmnd... | this . style = value ; |
public class ReceiveMessageRequest { /** * A list of s that need to be returned along with each message . These attributes include :
* < ul >
* < li >
* < code > All < / code > - Returns all values .
* < / li >
* < li >
* < code > ApproximateFirstReceiveTimestamp < / code > - Returns the time the message wa... | if ( this . attributeNames == null ) { setAttributeNames ( new com . amazonaws . internal . SdkInternalList < String > ( attributeNames . length ) ) ; } for ( String ele : attributeNames ) { this . attributeNames . add ( ele ) ; } return this ; |
public class GSMSImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GSMS__LCID : setLCID ( LCID_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class WikipediaTraceReader { /** * Returns the path segment of the URL . */
private String getPath ( String url ) { } } | int index = url . indexOf ( '/' , 7 ) ; if ( index == - 1 ) { return url ; } // Replace the html entities that we want to search for inside paths
String cleansed = url . substring ( index + 1 ) ; for ( int i = 0 ; i < SEARCH_LIST . length ; i ++ ) { cleansed = StringUtils . replace ( cleansed , SEARCH_LIST [ i ] , REPL... |
public class IonReaderBuilder { /** * Declares the catalog to use when building an { @ link IonReader } ,
* returning a new mutable builder the current one is immutable .
* @ param catalog the catalog to use in built readers .
* If null , a new { @ link SimpleCatalog } will be used .
* @ return this builder ins... | IonReaderBuilder b = mutable ( ) ; b . setCatalog ( catalog ) ; return b ; |
public class Input { /** * Read Vector & lt ; Object & gt ; object .
* @ return Vector & lt ; Object & gt ; object */
@ SuppressWarnings ( "unchecked" ) @ Override public Vector < Object > readVectorObject ( ) { } } | log . debug ( "readVectorObject" ) ; int type = readInteger ( ) ; log . debug ( "Type: {}" , type ) ; if ( ( type & 1 ) == 0 ) { return ( Vector < Object > ) getReference ( type >> 1 ) ; } int len = type >> 1 ; log . debug ( "Length: {}" , len ) ; Vector < Object > array = new Vector < Object > ( len ) ; storeReference... |
public class StatementUpdate { /** * Marks a given list of statements for insertion into the current document .
* Inserted statements can have an id if they should update an existing
* statement , or use an empty string as id if they should be added . The
* method removes duplicates and avoids unnecessary modific... | for ( Statement statement : addStatements ) { addStatement ( statement , true ) ; } for ( StatementGroup sg : currentDocument . getStatementGroups ( ) ) { if ( this . toKeep . containsKey ( sg . getProperty ( ) ) ) { for ( Statement statement : sg ) { if ( ! this . toDelete . contains ( statement . getStatementId ( ) )... |
public class B2buaHelperImpl { /** * ( non - Javadoc )
* @ see javax . servlet . sip . B2buaHelper # createRequest ( javax . servlet . sip . SipServletRequest ) */
public SipServletRequest createRequest ( SipServletRequest origRequest ) { } } | final SipServletRequestImpl newSipServletRequest = ( SipServletRequestImpl ) sipFactoryImpl . createRequest ( origRequest , false ) ; final SipServletRequestImpl origRequestImpl = ( SipServletRequestImpl ) origRequest ; final MobicentsSipSession originalSession = origRequestImpl . getSipSession ( ) ; final MobicentsSip... |
public class HTODDynacache { /** * close ( )
* Close all HTOD instances and then the filemanager . */
public void close ( ) { } } | try { rwLock . writeLock ( ) . lock ( ) ; closeNoRWLock ( ) ; } finally { rwLock . writeLock ( ) . unlock ( ) ; } if ( this . deleteDiskFiles ) { deleteDiskCacheFiles ( ) ; this . deleteDiskFiles = false ; } |
public class LinkedList { /** * Append a link to the end of the list .
* @ param link */
public synchronized final void append ( Link link ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "append" ) ; Link prev = _dummyTail . _getPreviousLink ( ) ; link . _link ( prev , _dummyTail , _nextPositionToIssue ++ , this ) ; prev . _setNextLink ( link ) ; _dummyTail . _setPreviousLink ( link ) ; if ( TraceComp... |
public class EventSubscriptionManager { /** * @ param tenantId
* @ return the conditional start event subscriptions with the given tenant id */
@ SuppressWarnings ( "unchecked" ) public List < EventSubscriptionEntity > findConditionalStartEventSubscriptionByTenantId ( String tenantId ) { } } | Map < String , String > parameters = new HashMap < String , String > ( ) ; parameters . put ( "tenantId" , tenantId ) ; configureParameterizedQuery ( parameters ) ; return getDbEntityManager ( ) . selectList ( "selectConditionalStartEventSubscriptionByTenantId" , parameters ) ; |
public class MetricsController { /** * Internal API for encoding a registry that can be encoded as JSON .
* This is a helper function for the REST endpoint and to test against . */
Map < String , MetricValues > encodeRegistry ( Registry sourceRegistry , Predicate < Measurement > filter ) { } } | Map < String , MetricValues > metricMap = new HashMap < > ( ) ; /* * Flatten the meter measurements into a map of measurements keyed by
* the name and mapped to the different tag variants . */
for ( Meter meter : sourceRegistry ) { String kind = knownMeterKinds . computeIfAbsent ( meter . id ( ) , k -> meterToKind ( ... |
public class XMLHTTPResponseHandler { /** * This function returns the requested value from the object data . < br >
* The path is a set of key names seperated by ' ; ' .
* @ param object
* The object holding all the data
* @ param path
* The path to the value ( elements seperated by ; )
* @ return The value... | // split path to parts
String [ ] pathParts = path . split ( AbstractMappingHTTPResponseHandler . VALUES_SEPERATOR ) ; int pathPartsAmount = pathParts . length ; String pathPart = null ; StringBuilder buffer = new StringBuilder ( 500 ) ; for ( int index = 0 ; index < pathPartsAmount ; index ++ ) { // get next path part... |
public class EnableHlsTaskRunner { /** * Enable streaming */
public String performTask ( String taskParameters ) { } } | EnableStreamingTaskParameters taskParams = EnableStreamingTaskParameters . deserialize ( taskParameters ) ; String spaceId = taskParams . getSpaceId ( ) ; boolean secure = taskParams . isSecure ( ) ; List < String > allowedOrigins = taskParams . getAllowedOrigins ( ) ; log . info ( "Performing " + TASK_NAME + " task on... |
public class CommerceOrderItemPersistenceImpl { /** * Removes all the commerce order items where CPInstanceId = & # 63 ; from the database .
* @ param CPInstanceId the cp instance ID */
@ Override public void removeByCPInstanceId ( long CPInstanceId ) { } } | for ( CommerceOrderItem commerceOrderItem : findByCPInstanceId ( CPInstanceId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceOrderItem ) ; } |
public class ReflectionUtils { /** * Determines if the class or interface represented by first Class parameter is either the same as , or is a superclass or
* superinterface of , the class or interface represented by the second Class parameter .
* @ param c1 Class to check .
* @ param c2 Class to check against . ... | assertReflectionAccessor ( ) ; return accessor . isAssignableFrom ( c1 , c2 ) ; |
public class WorkClassLoader { /** * { @ inheritDoc } */
@ Override public Class < ? > findClass ( String name ) throws ClassNotFoundException { } } | if ( trace ) log . tracef ( "%s: findClass(%s)" , Integer . toHexString ( System . identityHashCode ( this ) ) , name ) ; if ( resourceAdapterClassLoader != null ) { try { return resourceAdapterClassLoader . findClass ( name ) ; } catch ( Throwable t ) { // Default to parent
} } return super . findClass ( name ) ; |
public class CompensatedSum { /** * Increments the Kahan sum by adding two sums , and updating the correction term for reducing numeric errors . */
public CompensatedSum add ( CompensatedSum other ) { } } | double correctedSum = other . value ( ) + ( delta + other . delta ( ) ) ; double updatedValue = value + correctedSum ; double updatedDelta = correctedSum - ( updatedValue - value ) ; return new CompensatedSum ( updatedValue , updatedDelta ) ; |
public class MethodConfig { /** * Sets parameter .
* @ param key the key
* @ param value the value */
public MethodConfig setParameter ( String key , String value ) { } } | if ( parameters == null ) { parameters = new ConcurrentHashMap < String , String > ( ) ; } parameters . put ( key , value ) ; return this ; |
public class ParagraphVectors { /** * Get top N elements
* @ param vec the vec to extract the top elements from
* @ param N the number of elements to extract
* @ return the indices and the sorted top N elements */
private List < Double > getTopN ( INDArray vec , int N ) { } } | BasicModelUtils . ArrayComparator comparator = new BasicModelUtils . ArrayComparator ( ) ; PriorityQueue < Double [ ] > queue = new PriorityQueue < > ( vec . rows ( ) , comparator ) ; for ( int j = 0 ; j < vec . length ( ) ; j ++ ) { final Double [ ] pair = new Double [ ] { vec . getDouble ( j ) , ( double ) j } ; if (... |
public class AutomationExecution { /** * The combination of AWS Regions and / or AWS accounts where you want to run the Automation .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setTargetLocations ( java . util . Collection ) } or { @ link # withTargetLoca... | if ( this . targetLocations == null ) { setTargetLocations ( new com . amazonaws . internal . SdkInternalList < TargetLocation > ( targetLocations . length ) ) ; } for ( TargetLocation ele : targetLocations ) { this . targetLocations . add ( ele ) ; } return this ; |
public class JavaXmlProcessor { /** * Returns the string value for the node
* @ param node
* the node
* @ return the string value for the node */
private String getStringValue ( Node node ) { } } | switch ( node . getNodeType ( ) ) { case Node . ATTRIBUTE_NODE : case Node . TEXT_NODE : return node . getNodeValue ( ) ; default : { try { Transformer transformer = TRANSFORMER_FACTORY . newTransformer ( ) ; StringWriter buffer = new StringWriter ( ) ; transformer . setOutputProperty ( OutputKeys . OMIT_XML_DECLARATIO... |
public class ByteArray { /** * 写入ByteBuffer指定长度的数据
* @ param buffer 数据
* @ param len 指定长度 */
public void write ( ByteBuffer buffer , int len ) { } } | if ( len < 1 ) return ; if ( count >= content . length - len ) { byte [ ] ns = new byte [ content . length + len ] ; System . arraycopy ( content , 0 , ns , 0 , count ) ; this . content = ns ; } buffer . get ( content , count , len ) ; count += len ; |
public class ViewSelectorAssertions { /** * Fluent assertion entry point for a selection of views from the given view
* based on the given selector . It may be helpful to statically import this rather
* than { @ link # assertThat ( ViewSelection ) } to avoid conflicts with other statically
* imported { @ code ass... | return assertThat ( selection ( selector , view ) ) ; |
public class EllipseClustersIntoHexagonalGrid { /** * Combines the inner and outer grid into one grid for output . See { @ link Grid } for a discussion
* on how elements are ordered internally . */
void saveResults ( List < List < NodeInfo > > graph ) { } } | Grid g = foundGrids . grow ( ) ; g . reset ( ) ; g . columns = graph . get ( 0 ) . size ( ) + graph . get ( 1 ) . size ( ) ; g . rows = graph . size ( ) ; for ( int row = 0 ; row < g . rows ; row ++ ) { List < NodeInfo > list = graph . get ( row ) ; for ( int i = 0 ; i < g . columns ; i ++ ) { if ( ( i % 2 ) == ( row %... |
public class DNSInput { /** * Reads a byte array of a specified length from the stream into an existing
* array .
* @ param b The array to read into .
* @ param off The offset of the array to start copying data into .
* @ param len The number of bytes to copy .
* @ throws WireParseException The end of the str... | require ( len ) ; System . arraycopy ( array , pos , b , off , len ) ; pos += len ; |
public class Synthetic { /** * Returns a sequence of items constructed by the generator . */
private static LongStream generate ( NumberGenerator generator , long count ) { } } | return LongStream . range ( 0 , count ) . map ( ignored -> generator . nextValue ( ) . longValue ( ) ) ; |
public class AnnisUI { /** * Get a cached version of the { @ link CorpusConfig } for a corpus .
* @ param corpus
* @ return */
public CorpusConfig getCorpusConfigWithCache ( String corpus ) { } } | CorpusConfig config = new CorpusConfig ( ) ; if ( corpusConfigCache != null ) { config = corpusConfigCache . getIfPresent ( corpus ) ; if ( config == null ) { if ( corpus . equals ( DEFAULT_CONFIG ) ) { config = Helper . getDefaultCorpusConfig ( ) ; } else { config = Helper . getCorpusConfig ( corpus ) ; } corpusConfig... |
public class P2sVpnGatewaysInner { /** * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group .
* @ param resourceGroupName The name of the resource group .
* @ param gatewayName The name of the P2SVpnGateway .
* @ throws IllegalArgumentException thrown if parameters fail the ... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( gatewayName == null ) { throw new IllegalArgumentException ( "Parameter gatewayName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { ... |
public class ChaincodeEvent { /** * Binary data associated with this event .
* @ return binary data set by the chaincode for this event . This may return null . */
public byte [ ] getPayload ( ) { } } | ByteString ret = getChaincodeEvent ( ) . getPayload ( ) ; if ( null == ret ) { return null ; } return ret . toByteArray ( ) ; |
public class Metadata { /** * Adds a metadata value to the dictionary .
* @ param name the name
* @ param value the value
* @ param isDC the is dublin core */
public void add ( String name , TiffObject value , boolean isDC , String path ) { } } | if ( ! metadata . containsKey ( name ) ) { metadata . put ( name , new MetadataObject ( ) ) ; metadata . get ( name ) . setIsDublinCore ( isDC ) ; metadata . get ( name ) . setPath ( path ) ; } metadata . get ( name ) . getObjectList ( ) . add ( value ) ; |
public class PrometheusExportUtils { /** * Converts a point value in Metric to a list of Prometheus Samples . */
@ VisibleForTesting static List < Sample > getSamples ( final String name , final List < String > labelNames , List < LabelValue > labelValuesList , Value value ) { } } | Preconditions . checkArgument ( labelNames . size ( ) == labelValuesList . size ( ) , "Keys and Values don't have same size." ) ; final List < Sample > samples = Lists . newArrayList ( ) ; final List < String > labelValues = new ArrayList < String > ( labelValuesList . size ( ) ) ; for ( LabelValue labelValue : labelVa... |
public class BELScriptLexer { /** * $ ANTLR start " T _ _ 111" */
public final void mT__111 ( ) throws RecognitionException { } } | try { int _type = T__111 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // BELScript . g : 98:8 : ( ' causesNoChange ' )
// BELScript . g : 98:10 : ' causesNoChange '
{ match ( "causesNoChange" ) ; } state . type = _type ; state . channel = _channel ; } finally { } |
public class KeyVaultClientBaseImpl { /** * Merges a certificate or a certificate chain with a key pair existing on the server .
* The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service . This operation requires the certificates / c... | return ServiceFuture . fromResponse ( mergeCertificateWithServiceResponseAsync ( vaultBaseUrl , certificateName , x509Certificates ) , serviceCallback ) ; |
public class DiagnosticModule { /** * Check the the ThreadLocal to see if we should continue processing this
* FFDC exception
* @ return */
private boolean continueProcessing ( ) { } } | Boolean currentValue = _continueProcessing . get ( ) ; if ( currentValue != null ) return currentValue . booleanValue ( ) ; return true ; |
public class PlanNodeStatsEstimateMath { /** * Subtracts subset stats from supersets stats .
* It is assumed that each NDV from subset has a matching NDV in superset . */
public static PlanNodeStatsEstimate subtractSubsetStats ( PlanNodeStatsEstimate superset , PlanNodeStatsEstimate subset ) { } } | if ( superset . isOutputRowCountUnknown ( ) || subset . isOutputRowCountUnknown ( ) ) { return PlanNodeStatsEstimate . unknown ( ) ; } double supersetRowCount = superset . getOutputRowCount ( ) ; double subsetRowCount = subset . getOutputRowCount ( ) ; double outputRowCount = max ( supersetRowCount - subsetRowCount , 0... |
public class ArgumentDefinition { /** * Initialize a collection value for this field . If the collection can ' t be instantiated directly
* because its the underlying type is not a concrete type , an attempt assign an ArrayList will be made .
* @ param annotationType the type of annotation used for ths argument , f... | final Field field = getUnderlyingField ( ) ; final Object callerArguments = containingObject ; try { if ( field . get ( containingObject ) == null ) { field . set ( callerArguments , field . getType ( ) . newInstance ( ) ) ; } } catch ( final Exception ex ) { // If we can ' t instantiate the collection , try falling ba... |
public class AWSServerlessApplicationRepositoryClient { /** * Sets the permission policy for an application . For the list of actions supported for this operation , see < a href =
* " https : / / docs . aws . amazon . com / serverlessrepo / latest / devguide / access - control - resource - based . html # application ... | request = beforeClientExecution ( request ) ; return executePutApplicationPolicy ( request ) ; |
public class AESHelper { /** * Encrypts a string .
* @ param c The string to encrypt .
* @ return The encrypted string in HEX . */
public static String encrypt ( String c , String key ) { } } | try { SecretKeySpec skeySpec = new SecretKeySpec ( Hex . decodeHex ( key . toCharArray ( ) ) , "AES" ) ; Cipher cipher = Cipher . getInstance ( "AES" ) ; cipher . init ( Cipher . ENCRYPT_MODE , skeySpec ) ; byte [ ] encoded = cipher . doFinal ( c . getBytes ( ) ) ; return new String ( Hex . encodeHex ( encoded ) ) ; } ... |
public class IndirectJndiLookupObjectFactory { /** * Try to get an object instance by looking in the OSGi service registry
* similar to how / com . ibm . ws . jndi / implements the default namespace .
* @ return the object instance , or null if an object could not be found */
@ FFDCIgnore ( PrivilegedActionExceptio... | try { return AccessController . doPrivileged ( new PrivilegedExceptionAction < Object > ( ) { @ Override public Object run ( ) throws Exception { return getJNDIServiceObjectInstancePrivileged ( className , bindingName , envmt ) ; } } ) ; } catch ( PrivilegedActionException paex ) { Throwable cause = paex . getCause ( )... |
public class PromiseCombiner { /** * Adds a new future to be combined . New futures may be added until an aggregate promise is added via the
* { @ link PromiseCombiner # finish ( Promise ) } method .
* @ param future the future to add to this promise combiner */
@ SuppressWarnings ( { } } | "unchecked" , "rawtypes" } ) public void add ( Future future ) { checkAddAllowed ( ) ; checkInEventLoop ( ) ; ++ expectedCount ; future . addListener ( listener ) ; |
public class TridiagonalDecompositionHouseholder_ZDRM { /** * Computes and performs the similar a transform for submatrix k . */
private void similarTransform ( int k ) { } } | double t [ ] = QT . data ; // find the largest value in this column
// this is used to normalize the column and mitigate overflow / underflow
double max = QrHelperFunctions_ZDRM . computeRowMax ( QT , k , k + 1 , N ) ; if ( max > 0 ) { double gamma = QrHelperFunctions_ZDRM . computeTauGammaAndDivide ( k * N + k + 1 , k... |
public class JmolSymmetryScriptGeneratorH { /** * Orients layer lines from lowest y - axis value to largest y - axis value */
private List < List < Integer > > orientLayerLines ( List < List < Integer > > layerLines ) { } } | Matrix4d transformation = helixAxisAligner . getTransformation ( ) ; List < Point3d > centers = helixAxisAligner . getSubunits ( ) . getOriginalCenters ( ) ; for ( int i = 0 ; i < layerLines . size ( ) ; i ++ ) { List < Integer > layerLine = layerLines . get ( i ) ; // get center of first subunit in layerline and trans... |
public class SQLiteQueryBuilder { /** * Build an SQL query string from the given clauses .
* @ param distinct
* true if you want each row to be unique , false otherwise .
* @ param table
* The table name to compile the query against .
* @ param columns
* A list of which columns to return . Passing null will... | return buildQueryString ( distinct , new String [ ] { table } , columns , columnsAs , where , groupBy , having , orderBy , limit ) ; |
public class DomUtils { /** * < p > Returns the first child element with the given name . Returns
* < code > null < / code > if not found . < / p >
* @ param parent parent element
* @ param name name of the child element
* @ return child element */
public static Element getChildElementByName ( Element parent , ... | NodeList children = parent . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { Node node = children . item ( i ) ; if ( node . getNodeType ( ) == Node . ELEMENT_NODE ) { Element element = ( Element ) node ; if ( element . getTagName ( ) . equals ( name ) ) { return element ; } } } return nul... |
public class BatchedJmsTemplate { /** * { @ inheritDoc } */
@ Override public Message receiveSelected ( String messageSelector ) throws JmsException { } } | Destination defaultDestination = getDefaultDestination ( ) ; if ( defaultDestination != null ) { return receiveSelected ( defaultDestination , messageSelector ) ; } else { return receiveSelected ( getRequiredDefaultDestinationName ( ) , messageSelector ) ; } |
public class WriteMethodUtil { /** * Performs the validation of keys .
* The key ( s ) in the ' OData URI ' should match the existing key ( s ) in the passed entity .
* @ param entity The passed entity .
* @ param type The entity type of the passed entity .
* @ throws com . sdl . odata . api . ODataClientExcept... | final Map < String , Object > oDataUriKeyValues = asJavaMap ( getEntityKeyMap ( oDataUri , entityDataModel ) ) ; final Map < String , Object > keyValues = getKeyValues ( entity , type ) ; if ( oDataUriKeyValues . size ( ) != keyValues . size ( ) ) { throw new ODataClientException ( PROCESSOR_ERROR , "Number of keys don... |
public class DescribeQueriesResult { /** * The list of queries that match the request .
* @ return The list of queries that match the request . */
public java . util . List < QueryInfo > getQueries ( ) { } } | if ( queries == null ) { queries = new com . amazonaws . internal . SdkInternalList < QueryInfo > ( ) ; } return queries ; |
public class UserDataHelper { /** * FIXME : there must be a shorter way with XPath . . . */
private static String getValueOfTagInXMLFile ( String filePath , String tagName ) throws ParserConfigurationException , SAXException , IOException { } } | File fXmlFile = new File ( filePath ) ; DocumentBuilderFactory dbFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder dBuilder = dbFactory . newDocumentBuilder ( ) ; Document doc = dBuilder . parse ( fXmlFile ) ; // Optional , but recommended
// Read this : http : / / stackoverflow . com / questions / 1... |
public class UrlConnectionGetTransport { /** * { @ inheritDoc } */
@ Override public < T > T sendRequest ( final Request msg , final ScepResponseHandler < T > handler ) throws TransportException { } } | URL url = getUrl ( msg . getOperation ( ) , msg . getMessage ( ) ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Sending {} to {}" , msg , url ) ; } HttpURLConnection conn ; try { conn = ( HttpURLConnection ) url . openConnection ( ) ; if ( conn instanceof HttpsURLConnection && sslSocketFactory != null ) { (... |
public class ThriftService { /** * - - - - - Public DBService methods : Queries */
@ Override public List < DColumn > getColumns ( String storeName , String rowKey , String startColumn , String endColumn , int count ) { } } | DBConn dbConn = getDBConnection ( ) ; try { List < ColumnOrSuperColumn > columns = dbConn . getSlice ( CassandraDefs . columnParent ( storeName ) , CassandraDefs . slicePredicateStartEndCol ( Utils . toBytes ( startColumn ) , Utils . toBytes ( endColumn ) , count ) , Utils . toByteBuffer ( rowKey ) ) ; List < DColumn >... |
public class HandshakeUtil { /** * Prepare for upgrade */
public static void prepareUpgrade ( final ServerEndpointConfig config , final WebSocketHttpExchange exchange ) { } } | ExchangeHandshakeRequest request = new ExchangeHandshakeRequest ( exchange ) ; ExchangeHandshakeResponse response = new ExchangeHandshakeResponse ( exchange ) ; ServerEndpointConfig . Configurator c = config . getConfigurator ( ) ; c . modifyHandshake ( config , request , response ) ; response . update ( ) ; |
public class Logger { /** * Log a message at the supplied level according to the specified format and ( optional ) parameters . The message should contain
* a pair of empty curly braces for each of the parameter , which should be passed in the correct order . This method is
* efficient and avoids superfluous object... | if ( message == null ) return ; switch ( level ) { case DEBUG : debug ( message . text ( LOGGING_LOCALE . get ( ) , params ) ) ; break ; case ERROR : error ( message , params ) ; break ; case INFO : info ( message , params ) ; break ; case TRACE : trace ( message . text ( LOGGING_LOCALE . get ( ) , params ) ) ; break ;... |
public class TaskSession { /** * Make a table for this database .
* @ param strRecordClassName The record class name .
* @ param strTableSessionClassName The ( optional ) session name for the table .
* @ param properties The properties for the remote table .
* @ param remoteDB The remote db to add this new tabl... | Record record = ( Record ) ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( strRecordClassName ) ; if ( record == null ) return null ; if ( strTableSessionClassName == null ) this . setMasterSlave ( RecordOwner . SLAVE ) ; // If no table is specified , TableSession is a slave
if ( properties != nul... |
public class VLDockingUtils { /** * Transforms a UI object key into an activation aware key name .
* @ param key
* the key .
* @ param active
* < code > true < / code > for < em > active < / em > UI keys and < code > false < / code > for inactive .
* @ return the transformed key . */
public static String acti... | Assert . notNull ( key , "key" ) ; Assert . notNull ( active , "active" ) ; final int index = key . lastIndexOf ( VLDockingUtils . DOT ) ; final String overlay = active ? VLDockingUtils . ACTIVE_INFIX : VLDockingUtils . INACTIVE_INFIX ; // return StringUtils . overlay ( key , overlay , index , index ) ;
return key ; //... |
public class BigtableTableAdminClient { /** * Helper method to transform ApiFuture < Empty > to ApiFuture < Void > */
private static ApiFuture < Void > transformToVoid ( ApiFuture < Empty > future ) { } } | return ApiFutures . transform ( future , new ApiFunction < Empty , Void > ( ) { @ Override public Void apply ( Empty empty ) { return null ; } } , MoreExecutors . directExecutor ( ) ) ; |
public class CPOptionCategoryUtil { /** * Returns a range of all the cp option categories where companyId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in th... | return getPersistence ( ) . findByCompanyId ( companyId , start , end ) ; |
public class UnnecessaryStoreBeforeReturn { /** * implements the visitor to make sure method returns a value , and then clears the targets
* @ param obj
* the context object of the currently parsed code block */
@ Override public void visitCode ( Code obj ) { } } | Method m = getMethod ( ) ; String sig = m . getSignature ( ) ; if ( ! Values . SIG_VOID . equals ( SignatureUtils . getReturnSignature ( sig ) ) ) { state = State . SEEN_NOTHING ; branchTargets . clear ( ) ; CodeException [ ] ces = obj . getExceptionTable ( ) ; catchTargets . clear ( ) ; stack . resetForMethodEntry ( t... |
public class JarFile { /** * Synchronized method for adding a new conent
* @ param record
* @ param filename */
protected synchronized void addContent ( Artifact record , String filename ) { } } | if ( record != null ) { if ( filename . endsWith ( ".jar" ) ) { // this is an embedded archive
embedded . add ( record ) ; } else { contents . add ( record ) ; } } |
public class TransactionImpl { /** * { @ inheritDoc } */
public void commit ( ) throws RollbackException , HeuristicMixedException , HeuristicRollbackException , SecurityException , IllegalStateException , SystemException { } } | if ( status == Status . STATUS_UNKNOWN ) throw new IllegalStateException ( "Status unknown" ) ; if ( status == Status . STATUS_MARKED_ROLLBACK ) throw new IllegalStateException ( "Status marked rollback" ) ; finish ( true ) ; |
public class HSTreeNode { /** * Update the mass profile of this node .
* @ param inst the instance being passed through the HSTree .
* @ param referenceWindow if the HSTree is in the initial reference window : < b > true < / b > , else : < b > false < / b > */
public void updateMass ( Instance inst , boolean refere... | if ( referenceWindow ) r ++ ; else l ++ ; if ( internalNode ) { if ( inst . value ( this . splitAttribute ) > this . splitValue ) right . updateMass ( inst , referenceWindow ) ; else left . updateMass ( inst , referenceWindow ) ; } |
public class HashIntSet { /** * Find position of the integer in { @ link # cells } . If not found , returns the
* first removed cell .
* @ param element element to search
* @ return if < code > returned value > = 0 < / code > , it returns the index of the
* element ; if < code > returned value < 0 < / code > , ... | assert element >= 0 ; int index = toIndex ( IntHashCode . hashCode ( element ) ) ; int offset = 1 ; int removed = - 1 ; while ( cells [ index ] != EMPTY ) { // element found !
if ( cells [ index ] == element ) { return index ; } // remember the last removed cell if we don ' t find the element
if ( cells [ index ] == RE... |
public class MongoDBClient { /** * Method to find entity for given association name and association value .
* @ param colName
* the col name
* @ param colValue
* the col value
* @ param entityClazz
* the entity clazz
* @ return the list */
public List < Object > findByRelation ( String colName , Object co... | EntityMetadata m = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entityClazz ) ; // you got column name and column value .
DBCollection dbCollection = mongoDb . getCollection ( m . getTableName ( ) ) ; BasicDBObject query = new BasicDBObject ( ) ; query . put ( colName , MongoDBUtils . populateValue ( ... |
public class BuiltinAuthorizationService { /** * Check if the subject has a WScredential , is authenticated , and is not a basic auth credential .
* @ param subject
* the subject to check
* @ return true if the subject has a WSCredential that is not marked as
* unauthenticated and is not marked as basic auth , ... | final WSCredential wsCred = getWSCredentialFromSubject ( subject ) ; if ( wsCred == null ) { return false ; } else { // TODO revisit this when EJBs are supported add additional
// checks would be required
return ! wsCred . isUnauthenticated ( ) && ! wsCred . isBasicAuth ( ) ; } |
public class ListModelPackagesResult { /** * An array of < code > ModelPackageSummary < / code > objects , each of which lists a model package .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setModelPackageSummaryList ( java . util . Collection ) } or
* {... | if ( this . modelPackageSummaryList == null ) { setModelPackageSummaryList ( new java . util . ArrayList < ModelPackageSummary > ( modelPackageSummaryList . length ) ) ; } for ( ModelPackageSummary ele : modelPackageSummaryList ) { this . modelPackageSummaryList . add ( ele ) ; } return this ; |
public class JTrees { /** * Returns the parent of the given node in the given tree model .
* This parent may be < code > null < / code > , if the given node is
* the root node ( or not contained in the tree model at all ) .
* @ param treeModel The tree model
* @ param node The node
* @ param potentialParent T... | List < Object > children = getChildren ( treeModel , potentialParent ) ; for ( Object child : children ) { if ( child == node ) { return potentialParent ; } Object parent = getParent ( treeModel , node , child ) ; if ( parent != null ) { return parent ; } } return null ; |
public class BitcoinSerializer { /** * Make a block from the payload . Extension point for alternative
* serialization format support . */
@ Override public Block makeBlock ( final byte [ ] payloadBytes , final int offset , final int length ) throws ProtocolException { } } | return new Block ( params , payloadBytes , offset , this , length ) ; |
public class SecretListEntry { /** * A list of all of the currently assigned < code > SecretVersionStage < / code > staging labels and the
* < code > SecretVersionId < / code > that each is attached to . Staging labels are used to keep track of the different
* versions during the rotation process .
* < note >
*... | this . secretVersionsToStages = secretVersionsToStages ; |
public class TransformerIdentityImpl { /** * Get an output property that is in effect for the
* transformation . The property specified may be a property
* that was set with setOutputProperty , or it may be a
* property specified in the stylesheet .
* @ param name A non - null String that specifies an output
... | String value = null ; OutputProperties props = m_outputFormat ; value = props . getProperty ( name ) ; if ( null == value ) { if ( ! OutputProperties . isLegalPropertyKey ( name ) ) throw new IllegalArgumentException ( XSLMessages . createMessage ( XSLTErrorResources . ER_OUTPUT_PROPERTY_NOT_RECOGNIZED , new Object [ ]... |
public class TransliteratorIDParser { /** * Parse a filter ID , that is , an ID of the general form
* " [ f1 ] s1 - t1 / v1 " , with the filters optional , and the variants optional .
* @ param id the id to be parsed
* @ param pos INPUT - OUTPUT parameter . On input , the position of
* the first character to pa... | int start = pos [ 0 ] ; Specs specs = parseFilterID ( id , pos , true ) ; if ( specs == null ) { pos [ 0 ] = start ; return null ; } // Assemble return results
SingleID single = specsToID ( specs , FORWARD ) ; single . filter = specs . filter ; return single ; |
public class DataStorage { /** * Analyze storage directories .
* Recover from previous transitions if required .
* Perform fs state transition if necessary depending on the namespace info .
* Read storage info .
* @ param nsInfo namespace information
* @ param dataDirs array of data storage directories
* @ ... | if ( initialized ) { // DN storage has been initialized , no need to do anything
return ; } if ( FSConstants . LAYOUT_VERSION != nsInfo . getLayoutVersion ( ) ) { throw new IOException ( "Data-node and name-node layout versions must be the same. Namenode LV: " + nsInfo . getLayoutVersion ( ) + ", current LV: " + FSCons... |
public class ScalingPlanMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ScalingPlan scalingPlan , ProtocolMarshaller protocolMarshaller ) { } } | if ( scalingPlan == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( scalingPlan . getScalingPlanName ( ) , SCALINGPLANNAME_BINDING ) ; protocolMarshaller . marshall ( scalingPlan . getScalingPlanVersion ( ) , SCALINGPLANVERSION_BINDING ) ; p... |
public class ElementWithOptions { /** * Adds an option to the group of this element with the given id .
* If the group is not found , it ' s created with null text .
* @ param value Unique value in this element
* @ param text Option text
* @ param groupId Id of the option group
* @ return This element */
publ... | String valueString = "" ; if ( value != null ) { valueString = value . toString ( ) ; } return addOptionToGroup ( valueString , text , groupId ) ; |
public class ActivationImpl { /** * Get the beanValidationGroups .
* @ return the beanValidationGroups . */
@ Override public List < String > getBeanValidationGroups ( ) { } } | return beanValidationGroups == null ? null : Collections . unmodifiableList ( beanValidationGroups ) ; |
public class DbxClientV1 { /** * Create a file or folder at { @ code toPath } based on the given copy ref ( created with
* { @ link # createCopyRef } ) . */
public /* @ Nullable */
DbxEntry copyFromCopyRef ( String copyRef , String toPath ) throws DbxException { } } | if ( copyRef == null ) throw new IllegalArgumentException ( "'copyRef' can't be null" ) ; if ( copyRef . length ( ) == 0 ) throw new IllegalArgumentException ( "'copyRef' can't be empty" ) ; DbxPathV1 . checkArgNonRoot ( "toPath" , toPath ) ; String [ ] params = { "root" , "auto" , "from_copy_ref" , copyRef , "to_path"... |
public class PojoDataParser { /** * { @ inheritDoc } */
@ NonNull @ Override public ObservableTransformer < ParseComponentsOp , List < BaseCell > > getComponentTransformer ( ) { } } | return new ObservableTransformer < ParseComponentsOp , List < BaseCell > > ( ) { @ Override public ObservableSource < List < BaseCell > > apply ( Observable < ParseComponentsOp > upstream ) { return upstream . map ( new Function < ParseComponentsOp , List < BaseCell > > ( ) { @ Override public List < BaseCell > apply (... |
public class CheckJSDoc { /** * Check that a parameter with a default value is marked as optional .
* TODO ( bradfordcsmith ) : This is redundant . We shouldn ' t require it . */
private void validateDefaultValue ( Node n ) { } } | if ( n . isDefaultValue ( ) && n . getParent ( ) . isParamList ( ) ) { Node targetNode = n . getFirstChild ( ) ; JSDocInfo info = targetNode . getJSDocInfo ( ) ; if ( info == null ) { return ; } JSTypeExpression typeExpr = info . getType ( ) ; if ( typeExpr == null ) { return ; } Node typeNode = typeExpr . getRoot ( ) ... |
public class OntRelationMention { /** * getter for range - gets
* @ generated
* @ return value of the feature */
public Annotation getRange ( ) { } } | if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_range == null ) jcasType . jcas . throwFeatMissing ( "range" , "de.julielab.jules.types.OntRelationMention" ) ; return ( Annotation ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntR... |
public class CIFReader { /** * Process double in the format : ' . 071(1 ) ' . */
private double parseIntoDouble ( String value ) { } } | double returnVal = 0.0 ; if ( value . charAt ( 0 ) == '.' ) value = "0" + value ; int bracketIndex = value . indexOf ( '(' ) ; if ( bracketIndex != - 1 ) { value = value . substring ( 0 , bracketIndex ) ; } try { returnVal = Double . parseDouble ( value ) ; } catch ( Exception exception ) { logger . error ( "Could not ... |
public class MMDCfgPanel { /** * GEN - LAST : event _ colorChooserRootTextActionPerformed */
private void colorChooser1stBackgroundActionPerformed ( java . awt . event . ActionEvent evt ) { } } | // GEN - FIRST : event _ colorChooser1stBackgroundActionPerformed
if ( this . colorChooser1stBackground . isLastOkPressed ( ) && changeNotificationAllowed ) { this . controller . changed ( ) ; } |
public class HttpTools { /** * POST content to the URL with the specified body
* @ param url URL to use in the request
* @ param jsonBody Body to use in the request
* @ return String content
* @ throws MovieDbException exception */
public String postRequest ( final URL url , final String jsonBody ) throws Movie... | try { HttpPost httpPost = new HttpPost ( url . toURI ( ) ) ; httpPost . addHeader ( HTTP . CONTENT_TYPE , APPLICATION_JSON ) ; httpPost . addHeader ( HttpHeaders . ACCEPT , APPLICATION_JSON ) ; StringEntity params = new StringEntity ( jsonBody , ContentType . APPLICATION_JSON ) ; httpPost . setEntity ( params ) ; retur... |
public class GlobalUsersInner { /** * List Environments for the user .
* @ param userName The name of the user .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link Se... | return ServiceFuture . fromResponse ( listEnvironmentsWithServiceResponseAsync ( userName ) , serviceCallback ) ; |
public class InstanceGroup { /** * The EBS block devices that are mapped to this instance group .
* @ return The EBS block devices that are mapped to this instance group . */
public java . util . List < EbsBlockDevice > getEbsBlockDevices ( ) { } } | if ( ebsBlockDevices == null ) { ebsBlockDevices = new com . amazonaws . internal . SdkInternalList < EbsBlockDevice > ( ) ; } return ebsBlockDevices ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.