signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DFSClient { /** * Get a listing of the indicated directory */ public FileStatus [ ] listPaths ( String src ) throws IOException { } }
checkOpen ( ) ; metrics . incLsCalls ( ) ; try { if ( namenodeProtocolProxy == null ) { return versionBasedListPath ( src ) ; } return methodBasedListPath ( src ) ; } catch ( RemoteException re ) { throw re . unwrapRemoteException ( AccessControlException . class ) ; }
public class Participants { /** * The list of users . * @ param users * The list of users . */ public void setUsers ( java . util . Collection < UserMetadata > users ) { } }
if ( users == null ) { this . users = null ; return ; } this . users = new java . util . ArrayList < UserMetadata > ( users ) ;
public class SqlRepository { /** * Use with care . Removes all content of all tables . Should only * be used for JUnit tests . */ public void clear ( ) { } }
List < AbstractTable < ? > > tableList = new ArrayList < AbstractTable < ? > > ( tables . values ( ) ) ; for ( AbstractTable < ? > table : tableList ) { table . clear ( ) ; }
public class StructureAlignmentOptimizer { /** * run the optimization * @ param maxi maximum nr . of iterations * @ throws StructureException */ public void runOptimization ( int maxi ) throws StructureException { } }
superimposeBySet ( ) ; if ( debug ) System . err . println ( " initial rmsd " + rmsd ) ; // if ( showAlig ) // showCurrentAlignment ( equLen , equSet , " after initial superimposeBySet Len : " + equLen + " rmsd : " + rmsd ) ; maxKeepStep = 4 ; keepStep = 0 ; optimize ( maxi ) ;
public class VirtualMachinesInner { /** * Lists all available virtual machine sizes to which the specified virtual machine can be resized . * @ param resourceGroupName The name of the resource group . * @ param vmName The name of the virtual machine . * @ throws IllegalArgumentException thrown if parameters fail ...
return listAvailableSizesWithServiceResponseAsync ( resourceGroupName , vmName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class JBBPCompilerUtils { /** * Find a named field info index in a list for its path . * @ param fieldPath a field path , it must not be null . * @ param namedFields a list contains named field info items . * @ return the index of a field for the path if found one , - 1 otherwise */ public static int findI...
final String normalized = JBBPUtils . normalizeFieldNameOrPath ( fieldPath ) ; int result = - 1 ; for ( int i = namedFields . size ( ) - 1 ; i >= 0 ; i -- ) { final JBBPNamedFieldInfo f = namedFields . get ( i ) ; if ( normalized . equals ( f . getFieldPath ( ) ) ) { result = i ; break ; } } return result ;
public class TimeZoneFormat { /** * Returns offset from GMT ( UTC ) in milliseconds for the given localized GMT * offset format string . When the given string cannot be parsed , this method * sets the current position as the error index to < code > ParsePosition pos < / code > * and returns 0. * @ param text th...
return parseOffsetLocalizedGMT ( text , pos , false , null ) ;
public class HdfsOutputSwitcher { /** * ベースのファイル名称を取得する 。 * @ param baseDir 出力先ディレクトリパス * @ param fileNameHeader ファイル名ヘッダ * @ param fileNameBody ファイル名ボディ * @ param dateFormat 日付部フォーマット * @ param targetDate 算出時刻 * @ return ベースファイル名称 */ private String generateOutputFileBase ( String baseDir , String fi...
StringBuilder baseFileNameBuilder = new StringBuilder ( ) ; baseFileNameBuilder . append ( baseDir ) . append ( fileNameHeader ) . append ( fileNameBody ) ; baseFileNameBuilder . append ( dateFormat . format ( new Date ( targetDate ) ) ) ; String result = baseFileNameBuilder . toString ( ) ; return result ;
public class ClassDoc { /** * Get a MethodDoc in this ClassDoc with a name and signature * matching that of the specified MethodDoc and accepted by the * specified MethodFinder */ public MethodDoc getMatchingMethod ( MethodDoc method , MethodFinder mf ) { } }
MethodDoc md = getMatchingMethod ( method ) ; if ( md != null ) { if ( mf . checkMethod ( md ) ) { return md ; } } return null ;
public class ElementUI { /** * Apply / remove the design context menu to / from the specified component . If applying the design * context menu , any existing context menu is saved . When removing the context menu , any saved * context menu is restored . * @ param component Component to which to apply / remove th...
component . setAttribute ( CONTEXT_MENU , contextMenu ) ; if ( contextMenu == null ) { SavedState . restore ( component ) ; applyHint ( ) ; } else { new SavedState ( component ) ; component . setContext ( contextMenu ) ; component . setHint ( getDefinition ( ) . getName ( ) ) ; }
public class LinuxMIMEDatabase { /** * Creates a map with file extensions as keys pointing on sets of MIME types * associated with them . * @ return Map of file extensions pointing on MIME types * @ throws OSException */ public final Map < String , Set < String > > getExtensionMimeMap ( ) throws OSException { } }
initializeMimeExtensionArrays ( ) ; return Collections . unmodifiableMap ( extensionMime ) ;
public class DefaultPojoQuery { @ Override protected Object [ ] convertParameters ( Object [ ] params ) { } }
Iterator < Object > parameterIterator = Iterators . forArray ( params ) ; List < Object > converted = parameterConverters . stream ( ) . map ( parameterBinding -> parameterBinding . convertParameter ( parameterIterator ) ) . collect ( Collectors . toList ( ) ) ; return converted . toArray ( new Object [ converted . siz...
public class PdfContentByte { /** * Moves to the start of the next line , offset from the start of the current line . * As a side effect , this sets the leading parameter in the text state . < / P > * @ param x offset of the new current point * @ param y y - coordinate of the new current point */ public void move...
state . xTLM += x ; state . yTLM += y ; state . leading = - y ; content . append ( x ) . append ( ' ' ) . append ( y ) . append ( " TD" ) . append_i ( separator ) ;
public class CPInstancePersistenceImpl { /** * Returns the first cp instance in the ordered set where groupId = & # 63 ; and status = & # 63 ; . * @ param groupId the group ID * @ param status the status * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ r...
CPInstance cpInstance = fetchByG_ST_First ( groupId , status , orderByComparator ) ; if ( cpInstance != null ) { return cpInstance ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . append ( ", status=" ) ; msg . a...
public class EntityFinder { /** * Returns the DNASequence or null if one can ' t be created * @ param str * @ return */ private static DNASequence getDNASequence ( String str ) { } }
try { DNASequence s = new DNASequence ( str ) ; return s ; } catch ( CompoundNotFoundException e ) { logger . error ( "Unexpected error when creating DNASequence " , e ) ; } return null ;
public class CnvTfsBoolean { /** * < p > Convert from string . < / p > * @ param pAddParam additional params , e . g . IRequestData * to fill owner itsVersion . * @ param pStrVal string representation * @ return Boolean value * @ throws Exception - an exception */ @ Override public final Boolean fromString ( ...
if ( pStrVal == null // HTTP checkbox return nothing if unchecked || "" . equals ( pStrVal ) || "false" . equals ( pStrVal ) || "off" . equals ( pStrVal ) ) { return Boolean . FALSE ; } return Boolean . TRUE ;
public class HttpUtil { /** * Executes a HTTP request with the cookie spec set to IGNORE _ COOKIES * @ param httpRequest HttpRequestBase * @ param retryTimeout retry timeout * @ param injectSocketTimeout injecting socket timeout * @ param canceling canceling ? * @ return response * @ throws SnowflakeSQLExce...
return executeRequestInternal ( httpRequest , retryTimeout , injectSocketTimeout , canceling , true , false , true ) ;
public class CmsResourceUtil { /** * Returns the style class to use for the given resource . < p > * @ return style class name * @ see org . opencms . workplace . list . CmsListExplorerColumn # getExplorerStyleDef ( ) */ public String getStyleClassName ( ) { } }
if ( isInsideProject ( ) && isEditable ( ) ) { if ( m_resource . getState ( ) . isChanged ( ) ) { return "fc" ; } else if ( m_resource . getState ( ) . isNew ( ) ) { return "fn" ; } else if ( m_resource . getState ( ) . isDeleted ( ) ) { return "fd" ; } else { return "nf" ; } } return "fp" ;
public class WriteRequest { /** * Adds a DataPoint to the request for a Series . * @ param series The Series to write to . * @ param datapoint The DataPoint to write . * @ return The updated request . * @ since 1.0.0 */ public WriteRequest add ( Series series , DataPoint datapoint ) { } }
WritableDataPoint mdp = new WritableDataPoint ( series , datapoint . getTimestamp ( ) , datapoint . getValue ( ) ) ; data . add ( mdp ) ; return this ;
public class CmsEditLoginMessageDialog { /** * Creates the dialog HTML for all defined widgets of the named dialog ( page ) . < p > * This overwrites the method from the super class to create a layout variation for the widgets . < p > * @ param dialog the dialog ( page ) to get the HTML for * @ return the dialog ...
StringBuffer result = new StringBuffer ( 1024 ) ; // create widget table result . append ( createWidgetTableStart ( ) ) ; // show error header once if there were validation errors result . append ( createWidgetErrorHeader ( ) ) ; // create the widgets for the first dialog page result . append ( dialogBlockStart ( key (...
public class AerospikeRecordReader { /** * - - - - - NEW API - - - - - */ @ Override public void initialize ( InputSplit split , TaskAttemptContext context ) throws IOException { } }
log . info ( "INITIALIZE" ) ; init ( ( AerospikeSplit ) split ) ;
public class Iobeam { /** * Registers a device with the same parameters as the provided { @ link Device } . This call is * < b > BLOCKING < / b > and should not be called on UI threads . It will make a network call and not * return until it finishes . If device is null , a new { @ link Device } with a random ID and...
boolean alreadySet = this . deviceId != null ; // If device ID is set and not explicitly asking for a different one , return current ID . if ( alreadySet && ( device == null || this . deviceId . equals ( device . getId ( ) ) ) ) { setDeviceId ( this . deviceId ) ; return this . deviceId ; } // Make sure to unset before...
public class Strings { /** * Test if given name is Java member like name . If < code > name < / code > is null return false . * @ param name name to test . * @ return true if given name is Java member like name . */ public static boolean isMemberName ( String name ) { } }
if ( name == null ) { return false ; } Matcher matcher = MEMBER_NAME_PATTERN . matcher ( name ) ; return matcher . find ( ) ;
public class ActiveSyncManager { /** * Perform various checks of stopping a sync point . * @ param syncPoint sync point to stop * @ return the path resolution result if successfully passed all checks */ @ Nullable public MountTable . Resolution resolveSyncPoint ( AlluxioURI syncPoint ) throws InvalidPathException {...
if ( ! mSyncPathList . contains ( syncPoint ) ) { LOG . debug ( "syncPoint not found {}" , syncPoint . getPath ( ) ) ; return null ; } MountTable . Resolution resolution = mMountTable . resolve ( syncPoint ) ; return resolution ;
public class ArrayContainer { /** * in order */ private void emit ( short val ) { } }
if ( cardinality == content . length ) { increaseCapacity ( true ) ; } content [ cardinality ++ ] = val ;
public class StringGroovyMethods { /** * Set the position of the given Matcher to the given index . * @ param matcher a Matcher * @ param idx the index number * @ since 1.0 */ public static void setIndex ( Matcher matcher , int idx ) { } }
int count = getCount ( matcher ) ; if ( idx < - count || idx >= count ) { throw new IndexOutOfBoundsException ( "index is out of range " + ( - count ) + ".." + ( count - 1 ) + " (index = " + idx + ")" ) ; } if ( idx == 0 ) { matcher . reset ( ) ; } else if ( idx > 0 ) { matcher . reset ( ) ; for ( int i = 0 ; i < idx ;...
public class DatanodeDescriptor { /** * Store block invalidation work . */ void addBlocksToBeInvalidated ( List < Block > blocklist ) { } }
assert ( blocklist != null && blocklist . size ( ) > 0 ) ; synchronized ( invalidateBlocks ) { for ( Block blk : blocklist ) { invalidateBlocks . add ( blk ) ; } }
public class MultiChangeBuilder { /** * Replaces a range of characters with the given rich - text document . */ public MultiChangeBuilder < PS , SEG , S > replaceAbsolutely ( int start , int end , StyledDocument < PS , SEG , S > replacement ) { } }
return absoluteReplace ( start , end , ReadOnlyStyledDocument . from ( replacement ) ) ;
public class Operator { /** * Sets the degree of parallelism for this operator . * The degree must be 1 or more . * @ param dop The degree of parallelism for this operator . * @ return The operator with set degree of parallelism . */ public O setParallelism ( int dop ) { } }
if ( dop < 1 ) { throw new IllegalArgumentException ( "The parallelism of an operator must be at least 1." ) ; } this . dop = dop ; @ SuppressWarnings ( "unchecked" ) O returnType = ( O ) this ; return returnType ;
public class RObjectsPanel { /** * GEN - LAST : event _ _ addActionPerformed */ private void _delActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ _ delActionPerformed int [ ] i = _oList . getSelectedRows ( ) ; String [ ] o = new String [ i . length ] ; for ( int j = 0 ; j < i . length ; j ++ ) { o [ j ] = ( String ) _oList . getValueAt ( i [ j ] , 0 ) ; } if ( R != null ) { try { R . rm ( o ) ; } catch ( Rsession . RException ex ) { ex ....
public class CouchDBClient { /** * Gets the json from response . * @ param response * the response * @ return the json from response * @ throws IOException * Signals that an I / O exception has occurred . */ private JsonArray getJsonFromResponse ( HttpResponse response ) throws IOException { } }
InputStream content = response . getEntity ( ) . getContent ( ) ; Reader reader = new InputStreamReader ( content ) ; JsonObject json = gson . fromJson ( reader , JsonObject . class ) ; JsonElement jsonElement = json . get ( "rows" ) ; return jsonElement == null ? null : jsonElement . getAsJsonArray ( ) ;
public class ICUResourceBundle { /** * Return a set of the locale names supported by a collection of resource * bundles . * @ param bundlePrefix the prefix of the resource bundles to use . */ public static Set < String > getAvailableLocaleNameSet ( String bundlePrefix , ClassLoader loader ) { } }
return getAvailEntry ( bundlePrefix , loader ) . getLocaleNameSet ( ) ;
public class RESTClient { /** * Verifies that the received image is identical to the original one . * @ param xopOriginal * @ param xopResponse */ private void verifyXopResponse ( XopBean xopOriginal , XopBean xopResponse ) { } }
if ( ! Arrays . equals ( xopResponse . getBytes ( ) , xopOriginal . getBytes ( ) ) ) { throw new RuntimeException ( "Received XOP attachment is corrupted" ) ; } System . out . println ( ) ; System . out . println ( "XOP attachment has been successfully received" ) ;
public class ECKey { /** * Gets the private key in the form of an integer field element . The public key * is derived by performing EC point addition this number of times ( i . e . point * multiplying ) . * @ return - * @ throws java . lang . IllegalStateException * if the private key bytes are not available ...
if ( privKey == null ) { throw new MissingPrivateKeyException ( ) ; } else if ( privKey instanceof BCECPrivateKey ) { return ( ( BCECPrivateKey ) privKey ) . getD ( ) ; } else { throw new MissingPrivateKeyException ( ) ; }
public class HikariDataSource { /** * Evict a connection from the pool . If the connection has already been closed ( returned to the pool ) * this may result in a " soft " eviction ; the connection will be evicted sometime in the future if it is * currently in use . If the connection has not been closed , the evict...
HikariPool p ; if ( ! isClosed ( ) && ( p = pool ) != null && connection . getClass ( ) . getName ( ) . startsWith ( "com.zaxxer.hikari" ) ) { p . evictConnection ( connection ) ; }
public class dnsnsrec { /** * Use this API to add dnsnsrec . */ public static base_response add ( nitro_service client , dnsnsrec resource ) throws Exception { } }
dnsnsrec addresource = new dnsnsrec ( ) ; addresource . domain = resource . domain ; addresource . nameserver = resource . nameserver ; addresource . ttl = resource . ttl ; return addresource . add_resource ( client ) ;
public class DropwizardApnsClientMetricsListener { /** * Records a successful attempt to send a notification and updates metrics accordingly . * @ param apnsClient the client that sent the notification ; note that this is ignored by * { @ code DropwizardApnsClientMetricsListener } instances , which should always be...
this . sentNotifications . mark ( ) ; this . notificationTimerContexts . put ( notificationId , this . notificationTimer . time ( ) ) ;
public class PathAndQuery { /** * Validates the { @ link String } that contains an absolute path and a query , and splits them into * the path part and the query part . If the path is usable ( e . g . , can be served a successful response from * the server and doesn ' t have variable path parameters ) , { @ link Pa...
if ( CACHE != null && rawPath != null ) { final PathAndQuery parsed = CACHE . getIfPresent ( rawPath ) ; if ( parsed != null ) { return parsed ; } } return splitPathAndQuery ( rawPath ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcSensor ( ) { } }
if ( ifcSensorEClass == null ) { ifcSensorEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 591 ) ; } return ifcSensorEClass ;
public class DSClient { /** * ( non - Javadoc ) * @ see com . impetus . client . cassandra . CassandraClientBase # executeUpdateDeleteQuery ( java . lang . String ) */ public int executeUpdateDeleteQuery ( String cqlQuery ) { } }
Session session = null ; try { if ( log . isInfoEnabled ( ) ) { log . info ( "Executing cql query {}." , cqlQuery ) ; } session = factory . getConnection ( ) ; KunderaCoreUtils . printQuery ( cqlQuery , showQuery ) ; session . execute ( cqlQuery ) ; } finally { // factory . releaseConnection ( session ) ; } // TODO : c...
public class RobotUtil { /** * 模拟键盘点击 < br > * 包括键盘的按下和释放 * @ param keyCodes 按键码列表 , 见 { @ link java . awt . event . KeyEvent } * @ since 4.5.7 */ public static void keyClick ( int ... keyCodes ) { } }
for ( int keyCode : keyCodes ) { robot . keyPress ( keyCode ) ; robot . keyRelease ( keyCode ) ; } delay ( ) ;
public class MapUtil { /** * 对一个Map按Value进行排序 , 返回排序LinkedHashMap , 最多只返回n条 , 多用于Value是Counter的情况 . * @ param reverse 按Value的倒序 or 正序排列 */ public static < K , V extends Comparable > Map < K , V > topNByValue ( Map < K , V > map , final boolean reverse , int n ) { } }
return topNByValueInternal ( map , n , reverse ? Ordering . from ( new ComparableEntryValueComparator < K , V > ( ) ) . reverse ( ) : new ComparableEntryValueComparator < K , V > ( ) ) ;
public class SmartBinder { /** * Using the argument names and order in the target Signature , permute the * arguments in this SmartBinder . Arguments may be duplicated or omitted * in the target Signature , but all arguments in the target must be defined * in this SmartBinder . * @ param target the Signature fr...
return new SmartBinder ( this , target , binder . permute ( signature ( ) . to ( target ) ) ) ;
public class ConnectionDescriptorXmlHandler { /** * startElement callback . * Only some Elements need special start operations . * @ throws MetadataException indicating mapping errors */ public void startElement ( String uri , String name , String qName , Attributes atts ) { } }
boolean isDebug = logger . isDebugEnabled ( ) ; try { switch ( getLiteralId ( qName ) ) { case JDBC_CONNECTION_DESCRIPTOR : { if ( isDebug ) logger . debug ( " > " + tags . getTagById ( JDBC_CONNECTION_DESCRIPTOR ) ) ; JdbcConnectionDescriptor newJcd = new JdbcConnectionDescriptor ( ) ; currentAttributeContainer = ne...
public class CouchDbClient { /** * Execute a HTTP request and handle common error cases . * @ param connection the HttpConnection request to execute * @ return the executed HttpConnection * @ throws CouchDbException for HTTP error codes or if an IOException was thrown */ public HttpConnection execute ( HttpConnec...
// set our HttpUrlFactory on the connection connection . connectionFactory = factory ; // all CouchClient requests want to receive application / json responses connection . requestProperties . put ( "Accept" , "application/json" ) ; connection . responseInterceptors . addAll ( this . responseInterceptors ) ; connection...
public class Sequence { /** * Adds an outcome and probability to this sequence . * @ param outcome the outcome to be added . * @ param p the probability associated with this outcome . */ public void add ( String outcome , double p ) { } }
outcomes . add ( outcome ) ; probs . add ( new Double ( p ) ) ; score += Math . log ( p ) ;
public class GetFunctionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetFunctionRequest getFunctionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getFunctionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getFunctionRequest . getFunctionName ( ) , FUNCTIONNAME_BINDING ) ; protocolMarshaller . marshall ( getFunctionRequest . getQualifier ( ) , QUALIFIER_BINDING ) ; } ca...
public class CmsWorkplaceMessages { /** * Gathers all localization files for the workplace from the different modules . < p > * For a module named " my . module . name " the locale file must be named * " my . module . name . workplace " or " my . module . name . messages " and * be located in the classpath so tha...
// create a new list and add the base bundle ArrayList < CmsMessages > result = new ArrayList < CmsMessages > ( ) ; // / / / / / iterate over all registered modules / / / / / Set < String > names = new HashSet < String > ( ) ; Set < String > modules = OpenCms . getModuleManager ( ) . getModuleNames ( ) ; if ( modules !...
public class TempCharStream { /** * Clean up the temp stream . */ public void destroy ( ) { } }
try { close ( ) ; } catch ( IOException e ) { } TempCharBuffer ptr = _head ; _head = null ; _tail = null ; TempCharBuffer . freeAll ( ptr ) ;
public class DataUnitBuilder { /** * Returns the content of < code > data < / code > as unsigned bytes in hexadecimal string * representation . * This method does not add hexadecimal prefixes ( like 0x ) . * @ param data data array to format * @ param sep separator to insert between 2 formatted data bytes , < c...
final StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < data . length ; ++ i ) { final int no = data [ i ] & 0xff ; if ( no < 0x10 ) sb . append ( '0' ) ; sb . append ( Integer . toHexString ( no ) ) ; if ( sep != null && i < data . length - 1 ) sb . append ( sep ) ; } return sb . toString ( ) ;
public class OrderItemUrl { /** * Get Resource Url for UpdateOrderItemDiscount * @ param discountId discountId parameter description DOCUMENT _ HERE * @ param orderId Unique identifier of the order . * @ param orderItemId Unique identifier of the item to remove from the order . * @ param responseFields Filterin...
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/items/{orderItemId}/discounts/{discountId}?updatemode={updateMode}&version={version}&responseFields={responseFields}" ) ; formatter . formatUrl ( "discountId" , discountId ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUr...
public class WebUtilities { /** * Returns the context for this component . The component may not be in the current context . * @ param component the component to find the context it belongs to * @ return the component ' s context */ public static UIContext getContextForComponent ( final WComponent component ) { } }
// Start with the current Context UIContext result = UIContextHolder . getCurrent ( ) ; // Go through the contexts until we find the component while ( result instanceof SubUIContext && ! ( ( SubUIContext ) result ) . isInContext ( component ) ) { result = ( ( SubUIContext ) result ) . getBacking ( ) ; } return result ;
public class NatCubic { /** * / * calculates the natural cubic spline that interpolates * y [ 0 ] , y [ 1 ] , . . . y [ n ] * The first segment is returned as * C [ 0 ] . a + C [ 0 ] . b * u + C [ 0 ] . c * u ^ 2 + C [ 0 ] . d * u ^ 3 0 < = u < 1 * the other segments are in C [ 1 ] , C [ 2 ] , . . . C [ n - 1] ...
double [ ] gamma = new double [ n + 1 ] ; double [ ] delta = new double [ n + 1 ] ; double [ ] D = new double [ n + 1 ] ; int i ; /* We solve the equation [2 1 ] [ D [ 0 ] ] [ 3 ( x [ 1 ] - x [ 0 ] ) ] | 1 4 1 | | D [ 1 ] | | 3 ( x [ 2 ] - x [ 0 ] ) | | 1 4 1 | | . | = | . | | 1 4 1 | | . | | 3 ( x [ n ] - x [ ...
public class AstBuilder { /** * type { - - - - - */ @ Override public ClassNode visitType ( TypeContext ctx ) { } }
if ( ! asBoolean ( ctx ) ) { return ClassHelper . OBJECT_TYPE ; } ClassNode classNode = null ; if ( asBoolean ( ctx . classOrInterfaceType ( ) ) ) { ctx . classOrInterfaceType ( ) . putNodeMetaData ( IS_INSIDE_INSTANCEOF_EXPR , ctx . getNodeMetaData ( IS_INSIDE_INSTANCEOF_EXPR ) ) ; classNode = this . visitClassOrInter...
public class PortletContextLoaderListener { /** * { @ inheritDoc } */ @ Override public void contextDestroyed ( ServletContextEvent sce ) { } }
// destroy the root portlet app context final ServletContext servletContext = sce . getServletContext ( ) ; contextLoader . closeWebApplicationContext ( servletContext ) ; servletContext . removeAttribute ( PortletApplicationContextUtils2 . ROOT_PORTLET_APPLICATION_CONTEXT_LOADER_ATTRIBUTE ) ; contextLoader = null ;
public class RollupReducer { /** * Compares sequentially the fields from two tuples and returns which field * they differ from . Use custom comparators when provided . The provided * RawComparators must implement " compare " so we should use them . < p > * Important . The contract of this method is that the tuple...
int schemaId1 = tupleMRConfig . getSchemaIdByName ( tuple1 . getSchema ( ) . getName ( ) ) ; int schemaId2 = tupleMRConfig . getSchemaIdByName ( tuple2 . getSchema ( ) . getName ( ) ) ; int [ ] translationTuple1 = serInfo . getGroupSchemaIndexTranslation ( schemaId1 ) ; int [ ] translationTuple2 = serInfo . getGroupSch...
public class InMemoryCookieStore { /** * a cookie in index should be returned */ private < T extends Comparable < T > > void getInternal2 ( List < HttpCookie > cookies , Map < T , List < HttpCookie > > cookieIndex , T comparator ) { } }
// Removed cookieJar for ( T index : cookieIndex . keySet ( ) ) { if ( ( index == comparator ) || ( index != null && comparator . compareTo ( index ) == 0 ) ) { List < HttpCookie > indexedCookies = cookieIndex . get ( index ) ; // check the list of cookies associated with this domain if ( indexedCookies != null ) { Ite...
public class ExcelExecutor { /** * 将数据写入excel * @ param datas 要写入excel的pojo数据 * @ param hasTitle 是否需要标题 * @ param outputStream 输出流 ( 该流不会关闭 , 需要用户手动关闭 ) * @ param inMemory 最多保留在内存中多少行 * @ throws IOException IO异常 */ public void writeToExcel ( List < ? extends Object > datas , boolean hasTitle , OutputStream ou...
writeToExcel ( datas , hasTitle , outputStream , inMemory , false ) ;
public class ModelGenerator { /** * Instrospects the provided class , creates a model object ( JS code ) and writes it * into the response . * @ param request the http servlet request * @ param response the http servlet response * @ param clazz class that the generator should introspect * @ param format speci...
OutputConfig outputConfig = new OutputConfig ( ) ; outputConfig . setIncludeValidation ( includeValidation ) ; outputConfig . setOutputFormat ( format ) ; outputConfig . setDebug ( debug ) ; ModelBean model = createModel ( clazz , outputConfig ) ; writeModel ( request , response , model , outputConfig ) ;
public class ColorFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public String convertToString ( EDataType eDataType , Object instanceValue ) { } }
switch ( eDataType . getClassifierID ( ) ) { case ColorPackage . HEX_COLOR : return convertHexColorToString ( eDataType , instanceValue ) ; default : throw new IllegalArgumentException ( "The datatype '" + eDataType . getName ( ) + "' is not a valid classifier" ) ; }
public class SocketBindingGroupAddHandler { /** * { @ inheritDoc } */ @ Override protected void populateModel ( OperationContext context , ModelNode operation , Resource resource ) throws OperationFailedException { } }
super . populateModel ( context , operation , resource ) ; // We need to store the address value in the ' name ' instead of using // ReadResourceNameOperationStepHandler to avoid picky legacy controller // model comparison failures resource . getModel ( ) . get ( NAME ) . set ( context . getCurrentAddressValue ( ) ) ; ...
public class AndPermission { /** * Some privileges permanently disabled , may need to set up in the execute . * @ param fragment { @ link android . app . Fragment } . * @ param deniedPermissions one or more permissions . * @ return true , other wise is false . */ public static boolean hasAlwaysDeniedPermission ( ...
return hasAlwaysDeniedPermission ( new FragmentSource ( fragment ) , deniedPermissions ) ;
public class AmBaseBolt { /** * Create keyhistory from original key history . < br > * Use following situation . * < ol > * < li > Not used current message key . < / li > * < li > This class ' s key history function is not executed . < / li > * < / ol > * @ param history original key history * @ return cr...
KeyHistory result = null ; if ( history != null ) { // For adjust message splited , use keyhistory ' s deepcopy . result = history . createDeepCopy ( ) ; } return result ;
public class ConnectionConsumer { /** * { @ inheritDoc } */ public void pushMessage ( IPipe pipe , IMessage message ) { } }
// log . trace ( " pushMessage - type : { } " , message . getMessageType ( ) ) ; if ( message instanceof ResetMessage ) { // ignore } else if ( message instanceof StatusMessage ) { StatusMessage statusMsg = ( StatusMessage ) message ; data . sendStatus ( statusMsg . getBody ( ) ) ; } else if ( message instanceof RTMPMe...
public class random { /** * Create an { @ code IntStream } which creates random indexes within the * given range and the index probability . * @ since 3.0 * @ param random the random engine used for calculating the random * indexes * @ param n the end index ( exclusively ) . The start index is zero . * @ pa...
return indexes ( random , 0 , n , p ) ;
public class Math { /** * Returns the row maximum for a matrix . */ public static double [ ] rowMax ( double [ ] [ ] data ) { } }
double [ ] x = new double [ data . length ] ; for ( int i = 0 ; i < x . length ; i ++ ) { x [ i ] = max ( data [ i ] ) ; } return x ;
public class DBEngineVersion { /** * A list of the time zones supported by this engine for the < code > Timezone < / code > parameter of the * < code > CreateDBInstance < / code > action . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSupportedTimezone...
if ( this . supportedTimezones == null ) { setSupportedTimezones ( new java . util . ArrayList < Timezone > ( supportedTimezones . length ) ) ; } for ( Timezone ele : supportedTimezones ) { this . supportedTimezones . add ( ele ) ; } return this ;
public class ItemDataTraversingVisitor { /** * Visit all child properties . */ protected void visitChildProperties ( NodeData node ) throws RepositoryException { } }
if ( isInterrupted ( ) ) return ; for ( PropertyData data : dataManager . getChildPropertiesData ( node ) ) { if ( isInterrupted ( ) ) return ; data . accept ( this ) ; }
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createLPA ( int cic ) */ public LoopbackAckMessage createLPA ( ) { } }
LoopbackAckMessage msg = new LoopbackAckMessageImpl ( _LPA_HOLDER . mandatoryCodes , _LPA_HOLDER . mandatoryVariableCodes , _LPA_HOLDER . optionalCodes , _LPA_HOLDER . mandatoryCodeToIndex , _LPA_HOLDER . mandatoryVariableCodeToIndex , _LPA_HOLDER . optionalCodeToIndex ) ; return msg ;
public class NameDbUsa { /** * Poor mans profiler * @ param task task to execute * @ param message message identifying the task * @ param tries number of times task needs to be executed */ private static void profile ( Task task , String message , int tries ) { } }
for ( int i = 0 ; i < tries ; i ++ ) { long start = System . nanoTime ( ) ; task . run ( ) ; long finish = System . nanoTime ( ) ; System . out . println ( String . format ( "[Try %d] %-30s: %-5.2fms" , i + 1 , message , ( finish - start ) / 1000000.0 ) ) ; }
public class SqlExecutor { /** * Sets parameters to the PreparedStatement . * @ param stmt the prepared statement * @ param propDescs the property descriptors * @ param entity the entity * @ throws SQLException if something goes wrong */ @ SuppressWarnings ( "unchecked" ) protected void setParameters ( Prepared...
for ( int i = 0 ; i < propDescs . length ; i ++ ) { PropertyDesc propertyDesc = propDescs [ i ] ; if ( propertyDesc == null /* | | propertyDesc . getValue ( entity ) = = null */ ) { stmt . setObject ( i + 1 , null ) ; } else { Class < ? > propertType = propertyDesc . getPropertyType ( ) ; @ SuppressWarnings ( "rawtypes...
public class JQLBuilder { /** * < pre > * UPDATE bean01 SET text = : text WHERE id = : id * < / pre > * @ param method * the method * @ param result * the result * @ param dynamicReplace * the dynamic replace * @ param preparedJql * the prepared jql * @ return the jql */ private static JQL buildJQ...
final Class < ? extends Annotation > annotation = BindSqlUpdate . class ; // extract some informaction from method and bean // use annotation ' s attribute value and exclude and bean definition to // define field list // final Set < String > fields = defineFields ( JQLType . UPDATE , method , // annotation , false ) ; ...
public class MapDataHistoryDao { /** * Feeds all versions of the given relation to the handler . The elements are sorted by version , * the oldest version is the first , the newest version is the last element . < br > * If not logged in , the Changeset for each returned element will be null * @ throws OsmNotFound...
MapDataHandler mapDataHandler = new WrapperOsmElementHandler < > ( Relation . class , handler ) ; boolean authenticate = osm . getOAuth ( ) != null ; osm . makeRequest ( RELATION + "/" + id + "/" + HISTORY , authenticate , new MapDataParser ( mapDataHandler , factory ) ) ;
public class StringExpression { /** * Create a { @ code this . contains ( str ) } expression * < p > Returns true if the given String is contained < / p > * @ param str string * @ return this . contains ( str ) * @ see java . lang . String # contains ( CharSequence ) */ public BooleanExpression contains ( Expre...
return Expressions . booleanOperation ( Ops . STRING_CONTAINS , mixin , str ) ;
public class Parser { /** * This method reads in one zip file . Before reading the file , it will check if the current file has the same * number of columns and separator type as the previous files it has parssed . If they do not match , no file will * be parsed in this case . * @ param is * @ param dout * @ ...
int cidx = 0 ; StreamData din = new StreamData ( is ) ; // only check header for 2nd file onward since guess setup is already done on first file . if ( ( fileIndex > 0 ) && ( ! checkFileNHeader ( is , dout , din , cidx ) ) ) // cidx should be the actual column index return new StreamInfo ( zidx , nextChunk ) ; // heade...
public class OpenAPIConnection { /** * creates default connection for OpenAPI UI endpoint * @ param server - server to connect to * @ param secure - if true connection uses HTTPS * @ return */ public static OpenAPIConnection openAPIUIConnection ( LibertyServer server , boolean secure ) { } }
return new OpenAPIConnection ( server , OPEN_API_UI ) . secure ( secure ) ;
public class DaoManager { /** * Helper method to lookup a DAO if it has already been associated with the class . Otherwise this returns null . */ public synchronized static < D extends Dao < T , ? > , T > D lookupDao ( ConnectionSource connectionSource , Class < T > clazz ) { } }
if ( connectionSource == null ) { throw new IllegalArgumentException ( "connectionSource argument cannot be null" ) ; } ClassConnectionSource key = new ClassConnectionSource ( connectionSource , clazz ) ; Dao < ? , ? > dao = lookupDao ( key ) ; @ SuppressWarnings ( "unchecked" ) D castDao = ( D ) dao ; return castDao ;
public class AddOnRunIssuesUtils { /** * Returns the textual representation of the issues that prevent the extensions of the add - on from being run , if any . * The messages are not internationalised , should be used only for logging and non UI uses . * @ param requirements the run requirements of the add - on who...
if ( ! requirements . hasExtensionsWithRunningIssues ( ) ) { return new ArrayList < > ( 0 ) ; } List < String > issues = new ArrayList < > ( 10 ) ; for ( AddOn . ExtensionRunRequirements extReqs : requirements . getExtensionRequirements ( ) ) { issues . addAll ( getRunningIssues ( extReqs ) ) ; } return issues ;
public class PackratParser { /** * This method tries to apply a production at a given position . The production * is given as a name and not as a concrete rule to process all choices * afterwards . * @ param rule * @ param position * @ return * @ throws TreeException * @ throws ParserException */ private ...
printMessage ( "applyRule: " + rule , position , line ) ; MemoEntry m = recall ( rule , position , line ) ; if ( m == null ) { /* * " Create a new LR and push it onto the rule invocation stack . " * At this point we found a rule which was never processed at this position . We * start completely virgin here . . . */...
public class PutIntegrationResponseRequest { /** * A key - value map specifying response parameters that are passed to the method response from the back end . The key * is a method response header parameter name and the mapped value is an integration response header value , a static * value enclosed within a pair o...
setResponseParameters ( responseParameters ) ; return this ;
public class Tinylog1Benchmark { /** * Benchmarks issuing log entries that will be output . * @ param lifeCycle * Can be ignored */ @ Benchmark @ BenchmarkMode ( Mode . Throughput ) public void output ( final LifeCycle lifeCycle ) { } }
Logger . info ( "Hello {}!" , MAGIC_NUMBER ) ;
public class StructureName { /** * Tries to determine the source and pdbId without fully realizing the identifier , * which could require I / O depending on the source * @ throws IllegalArgumentException if the source is recognizable but invalid */ private void init ( ) { } }
// First try identifying a prefix String [ ] prefix = name . split ( ":" , 2 ) ; mySource = null ; if ( prefix . length > 1 ) { // Match Source prefixes String suffix = prefix [ 1 ] ; try { mySource = Source . valueOf ( prefix [ 0 ] . toUpperCase ( ) ) ; } catch ( IllegalArgumentException e ) { // unrecognized prefix ;...
public class GeoPackageCoreImpl { /** * { @ inheritDoc } */ @ Override public List < String > getTables ( String type ) { } }
ContentsDao contentDao = getContentsDao ( ) ; List < String > tableNames ; try { tableNames = contentDao . getTables ( type ) ; } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to retrieve " + type + " tables" , e ) ; } return tableNames ;
public class TemplateParserContext { /** * Return the fully qualified name for a given method . Only works if the method has been * statically imported . * @ param methodName The name of the method to get the fully qualified name of * @ return The fully qualified name , or the method name if it ' s unknown */ pub...
if ( ! methodNameToFullyQualifiedName . containsKey ( methodName ) ) { return methodName ; } return methodNameToFullyQualifiedName . get ( methodName ) ;
public class VideoRenderer { /** * Inflate the main layout used to render videos in the list view . * @ param inflater LayoutInflater service to inflate . * @ param parent ViewGroup used to inflate xml . * @ return view inflated . */ @ Override protected View inflate ( LayoutInflater inflater , ViewGroup parent )...
View inflatedView = inflater . inflate ( R . layout . video_renderer , parent , false ) ; /* * You don ' t have to use ButterKnife library to implement the mapping between your layout * and your widgets you can implement setUpView and hookListener methods declared in * Renderer < T > class . */ ButterKnife . bind (...
public class RubyEnumerator { /** * { @ inheritDoc } * @ return this { @ link RubyEnumerator } */ @ Override public RubyEnumerator < E > each ( Consumer < ? super E > block ) { } }
iter . forEach ( block ) ; return this ;
public class ContextServiceImpl { /** * Called by Declarative Services to modify service config properties * @ param context DeclarativeService defined / populated component context */ @ Trivial @ Modified protected void modified ( ComponentContext context ) { } }
Dictionary < String , ? > props = context . getProperties ( ) ; final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "modified" , props ) ; String contextSvcName = ( String ) props . get ( JNDI_NAME ) ; if ( contextSvcName == null ) contextSvc...
public class ArrayMath { /** * Returns the Jensen Shannon divergence ( information radius ) between * a and b , defined as the average of the kl divergences from a to b * and from b to a . */ public static double jensenShannonDivergence ( double [ ] a , double [ ] b ) { } }
double [ ] average = pairwiseAdd ( a , b ) ; multiplyInPlace ( average , .5 ) ; return .5 * klDivergence ( a , average ) + .5 * klDivergence ( b , average ) ;
public class IotHubResourcesInner { /** * Get a list of the consumer groups in the Event Hub - compatible device - to - cloud endpoint in an IoT hub . * Get a list of the consumer groups in the Event Hub - compatible device - to - cloud endpoint in an IoT hub . * ServiceResponse < PageImpl < EventHubConsumerGroupIn...
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 ( resourc...
public class ComparatorCompat { /** * Returns a comparator that considers { @ code null } to be greater than non - null . * If the specified comparator is { @ code null } , then the returned * comparator considers all non - null values to be equal . * @ param < T > the type of the objects compared by the comparat...
return nullsComparator ( false , comparator ) ;
public class Checks { /** * Performs a runtime check if the reference is an instance of the provided class * @ param class _ the class to use * @ param reference reference to check * @ param errorMessage the exception message to use if the check fails ; will * be converted to a string using { @ link String # va...
return checkIsInstance ( class_ , reference , errorMessage , EMPTY_ERROR_MESSAGE_ARGS ) ;
public class ValidationRuleStore { /** * Gets validation checker . * @ param rule the rule * @ return the validation checker */ public BaseValidationCheck getValidationChecker ( ValidationRule rule ) { } }
ValidationRule existRule = this . rules . stream ( ) . filter ( r -> r . getRuleName ( ) . equals ( rule . getRuleName ( ) ) ) . findFirst ( ) . orElse ( null ) ; if ( existRule == null ) { throw new ValidationLibException ( "rulename : " + rule . getRuleName ( ) + "checker is notfound " , HttpStatus . INTERNAL_SERVER...
public class Pkg { /** * From a given map ( package name - > version ) , create a list of maps with just one * element each . This is how Salt requires us to send the ' pkgs ' argument when multiple * packages should be installed or removed . * @ param pkgs map with packages ( name - > version ) * @ return list...
return pkgs . entrySet ( ) . stream ( ) . map ( e -> Collections . unmodifiableMap ( Stream . of ( e ) . collect ( Collectors . < Map . Entry < String , String > , String , String > toMap ( Map . Entry :: getKey , Map . Entry :: getValue ) ) ) ) . collect ( Collectors . toList ( ) ) ;
public class HttpClientUtil { /** * Quitely shuts down an HttpClient instance by shutting down its connection * manager and ignoring any errors that occur . * @ param http The HttpClient to shutdown */ static public void shutdownQuietly ( HttpClient http ) { } }
if ( http != null ) { try { http . getConnectionManager ( ) . shutdown ( ) ; } catch ( Exception ignore ) { // do nothing } }
public class PatchSourceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PatchSource patchSource , ProtocolMarshaller protocolMarshaller ) { } }
if ( patchSource == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( patchSource . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( patchSource . getProducts ( ) , PRODUCTS_BINDING ) ; protocolMarshaller . marshall ( patchSource...
public class CommerceShipmentLocalServiceUtil { /** * Returns the commerce shipment with the primary key . * @ param commerceShipmentId the primary key of the commerce shipment * @ return the commerce shipment * @ throws PortalException if a commerce shipment with the primary key could not be found */ public stat...
return getService ( ) . getCommerceShipment ( commerceShipmentId ) ;
public class ProjectApi { /** * Get an Optional instance with the value for the specific project , which is owned by the authentication user . * < pre > < code > GET / projects / : id < / code > < / pre > * @ param namespace the name of the project namespace or group * @ param project the name of the project * ...
try { return ( Optional . ofNullable ( getProject ( namespace , project ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; }
public class JobReceiver { /** * 添加任务 */ private void addJob ( Job job , JobPo jobPo ) throws DupEntryException { } }
if ( job . isCron ( ) ) { addCronJob ( jobPo ) ; } else if ( job . isRepeatable ( ) ) { addRepeatJob ( jobPo ) ; } else { addTriggerTimeJob ( jobPo ) ; }
public class XAbstractFeatureCallImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public NotificationChain basicSetImplicitFirstArgument ( XExpression newImplicitFirstArgument , NotificationChain msgs ) { } }
XExpression oldImplicitFirstArgument = implicitFirstArgument ; implicitFirstArgument = newImplicitFirstArgument ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , XbasePackage . XABSTRACT_FEATURE_CALL__IMPLICIT_FIRST_ARGUMENT , oldImplicitFirstArgum...
public class SimpleDateFormat { /** * Formats a date or time , which is the standard millis * since January 1 , 1970 , 00:00:00 GMT . * < p > Example : using the US locale : * " yyyy . MM . dd G ' at ' HH : mm : ss zzz " - & gt ; & gt ; 1996.07.10 AD at 15:08:56 PDT * @ param cal the calendar whose date - time ...
TimeZone backupTZ = null ; if ( cal != calendar && ! cal . getType ( ) . equals ( calendar . getType ( ) ) ) { // Different calendar type // We use the time and time zone from the input calendar , but // do not use the input calendar for field calculation . calendar . setTimeInMillis ( cal . getTimeInMillis ( ) ) ; bac...