signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class LocationHelper { /** * Works in a similar way to modulateCircularLocation but returns * the number of complete passes over a Sequence length a circular * location makes i . e . if we have a sequence of length 10 and the * location 3 . . 52 we make 4 complete passes through the genome to * go from p...
int count = 0 ; while ( index > seqLength ) { count ++ ; index -= seqLength ; } return count - 1 ;
public class MaterializedCollectStreamResult { private void processInsert ( Row row ) { } }
// limit the materialized table if ( materializedTable . size ( ) - validRowPosition >= maxRowCount ) { cleanUp ( ) ; } materializedTable . add ( row ) ; rowPositionCache . put ( row , materializedTable . size ( ) - 1 ) ;
public class TargetHttpProxyClient { /** * Returns the specified TargetHttpProxy resource . Gets a list of available target HTTP proxies by * making a list ( ) request . * < p > Sample code : * < pre > < code > * try ( TargetHttpProxyClient targetHttpProxyClient = TargetHttpProxyClient . create ( ) ) { * Proj...
GetTargetHttpProxyHttpRequest request = GetTargetHttpProxyHttpRequest . newBuilder ( ) . setTargetHttpProxy ( targetHttpProxy ) . build ( ) ; return getTargetHttpProxy ( request ) ;
public class BitfinexApiCallbackListeners { /** * registers listener for orderbook events * @ param listener of event * @ return hook of this listener */ public Closeable onOrderbookEvent ( final BiConsumer < BitfinexOrderBookSymbol , Collection < BitfinexOrderBookEntry > > listener ) { } }
orderbookEntryConsumers . offer ( listener ) ; return ( ) -> orderbookEntryConsumers . remove ( listener ) ;
public class TwitterRiver { /** * Get users id of each list to stream them . * @ param tUserlists List of user list . Should be a public list . * @ return */ private long [ ] getUsersListMembers ( String [ ] tUserlists ) { } }
logger . debug ( "Fetching user id of given lists" ) ; List < Long > listUserIdToFollow = new ArrayList < Long > ( ) ; Configuration cb = buildTwitterConfiguration ( ) ; Twitter twitterImpl = new TwitterFactory ( cb ) . getInstance ( ) ; // For each list given in parameter for ( String listId : tUserlists ) { logger . ...
public class IfcLightDistributionDataImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < String > getLuminousIntensityAsString ( ) { } }
return ( EList < String > ) eGet ( Ifc2x3tc1Package . Literals . IFC_LIGHT_DISTRIBUTION_DATA__LUMINOUS_INTENSITY_AS_STRING , true ) ;
public class IndexFieldTypePollerPeriodical { /** * Cancel the polling job for the given { @ link ScheduledFuture } . * @ param future polling job future */ private void cancel ( @ Nullable ScheduledFuture < ? > future ) { } }
if ( future != null && ! future . isCancelled ( ) ) { if ( ! future . cancel ( true ) ) { LOG . warn ( "Couldn't cancel field type update job" ) ; } }
public class ThreadPoolExecutor { /** * Tries to remove from the work queue all { @ link Future } * tasks that have been cancelled . This method can be useful as a * storage reclamation operation , that has no other impact on * functionality . Cancelled tasks are never executed , but may * accumulate in work qu...
final BlockingQueue < Runnable > q = workQueue ; try { Iterator < Runnable > it = q . iterator ( ) ; while ( it . hasNext ( ) ) { Runnable r = it . next ( ) ; if ( r instanceof Future < ? > && ( ( Future < ? > ) r ) . isCancelled ( ) ) it . remove ( ) ; } } catch ( ConcurrentModificationException fallThrough ) { // Tak...
public class SQLParser { /** * Build a pattern segment to accept a single optional EXPORT or PARTITION clause * to modify CREATE STREAM statements . * @ param captureTokens Capture individual tokens if true * @ return Inner pattern to be wrapped by the caller as appropriate * Capture groups ( when captureTokens...
return SPF . oneOf ( SPF . clause ( SPF . token ( "export" ) , SPF . token ( "to" ) , SPF . token ( "target" ) , SPF . group ( captureTokens , SPF . databaseObjectName ( ) ) ) , SPF . clause ( SPF . token ( "partition" ) , SPF . token ( "on" ) , SPF . token ( "column" ) , SPF . group ( captureTokens , SPF . databaseObj...
public class RandomUtil { /** * 生成RGB随机数 * @ return */ public static int [ ] getRandomRgb ( ) { } }
int [ ] rgb = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { rgb [ i ] = random . nextInt ( 255 ) ; } return rgb ;
public class ArrayTrie { @ Override public V getBest ( byte [ ] b , int offset , int len ) { } }
return getBest ( 0 , b , offset , len ) ;
public class SmsSendResponseDto { /** * Is successfully sent boolean . * @ return the boolean */ @ XmlElement ( name = "successfullySent" , required = true ) @ JsonProperty ( value = "successfullySent" , required = true ) public boolean isSuccessfullySent ( ) { } }
return successfullySent ;
public class ContainerKeyCache { /** * Updates the tail cache for the given Table Segment with the contents of the given { @ link TableKeyBatch } . * Each { @ link TableKeyBatch . Item } is updated only if no previous entry exists with its { @ link TableKeyBatch . Item # getHash ( ) } * or if its { @ link TableKeyB...
SegmentKeyCache cache ; int generation ; synchronized ( this . segmentCaches ) { generation = this . currentCacheGeneration ; cache = this . segmentCaches . computeIfAbsent ( segmentId , s -> new SegmentKeyCache ( s , this . cache ) ) ; } return cache . includeUpdateBatch ( batch , batchOffset , generation ) ;
public class GBSTree { /** * Delete from right side with successor node present . */ private void rightDeleteWithSuccessor ( GBSNode p , GBSNode l , Object deleteKey , DeleteNode point ) { } }
java . util . Comparator comp = p . deleteComparator ( ) ; int xcc = comp . compare ( deleteKey , l . leftMostKey ( ) ) ; if ( xcc == 0 ) /* Target key IS low key of successor */ { /* Migrate up high key of current ( delete key ) into low key of successor ( target key ) */ point . setDelete ( p , p . rightMostIndex (...
public class GroupDiscussInterface { /** * Get info for a given topic * @ param topicId * Unique identifier of a topic for a given group { @ link Topic } . * @ return A group topic * @ throws FlickrException * @ see < a href = " http : / / www . flickr . com / services / api / flickr . groups . discuss . topi...
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_TOPICS_GET_INFO ) ; parameters . put ( "topic_id" , topicId ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { thr...
public class NonMaxBlock_MT { /** * Detects local minimums and / or maximums in the provided intensity image . * @ param intensityImage ( Input ) Feature intensity image . * @ param localMin ( Output ) storage for found local minimums . * @ param localMax ( Output ) storage for found local maximums . */ @ Overrid...
if ( localMin != null ) localMin . reset ( ) ; if ( localMax != null ) localMax . reset ( ) ; // the defines the region that can be processed int endX = intensityImage . width - border ; int endY = intensityImage . height - border ; int step = configuration . radius + 1 ; search . initialize ( configuration , intensity...
public class JsApiMessageImpl { /** * Clear all of the smoke - and - mirrors properties which are clearable . * Modifyable JMS Header fields ( e . g . JMSType ) are not affected . * The method has package level visibility as it is used by JsJmsMessageImpl * and JsSdoMessageImpl . */ final void clearSmokeAndMirror...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "clearSmokeAndMirrorsProperties" ) ; /* JMSXAppId */ getHdr2 ( ) . setChoiceField ( JsHdr2Access . XAPPID , JsHdr2Access . IS_XAPPID_EMPTY ) ; /* JMSXUserID */ setUserid ( null ) ; /* JMSXDeliveryCount is not clearabl...
public class ViewUrl { /** * Get Resource Url for GetViewDocuments * @ param documentListName Name of content documentListName to delete * @ param filter A set of filter expressions representing the search parameters for a query . This parameter is optional . Refer to [ Sorting and Filtering ] ( . . / . . / . . / ....
UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlists/{documentListName}/views/{viewName}/documents?filter={filter}&sortBy={sortBy}&pageSize={pageSize}&startIndex={startIndex}&includeInactive={includeInactive}&responseFields={responseFields}" ) ; formatter . formatUrl ( "documentListName" , documentLi...
public class GoogleMapShapeConverter { /** * Add a shape to the map as markers * @ param map google map * @ param shape google map shape * @ param markerOptions marker options * @ param polylineMarkerOptions polyline marker options * @ param polygonMarkerOptions polygon marker options * @ param polygonMarke...
GoogleMapShapeMarkers shapeMarkers = new GoogleMapShapeMarkers ( ) ; GoogleMapShape addedShape = null ; switch ( shape . getShapeType ( ) ) { case LAT_LNG : if ( markerOptions == null ) { markerOptions = new MarkerOptions ( ) ; } Marker latLngMarker = addLatLngToMap ( map , ( LatLng ) shape . getShape ( ) , markerOptio...
public class HubVirtualNetworkConnectionsInner { /** * Retrieves the details of a HubVirtualNetworkConnection . * @ param resourceGroupName The resource group name of the VirtualHub . * @ param virtualHubName The name of the VirtualHub . * @ param connectionName The name of the vpn connection . * @ throws Illeg...
return getWithServiceResponseAsync ( resourceGroupName , virtualHubName , connectionName ) . map ( new Func1 < ServiceResponse < HubVirtualNetworkConnectionInner > , HubVirtualNetworkConnectionInner > ( ) { @ Override public HubVirtualNetworkConnectionInner call ( ServiceResponse < HubVirtualNetworkConnectionInner > re...
public class ScriptController { /** * Add a new script * @ param model * @ param name * @ param script * @ return * @ throws Exception */ @ RequestMapping ( value = "/api/scripts" , method = RequestMethod . POST ) public @ ResponseBody Script addScript ( Model model , @ RequestParam ( required = true ) String...
return ScriptService . getInstance ( ) . addScript ( name , script ) ;
public class PackageManagerUtils { /** * Checks if the device has a home screen . * @ param manager the package manager . * @ return { @ code true } if the device has a home screen . */ @ TargetApi ( Build . VERSION_CODES . JELLY_BEAN_MR2 ) public static boolean hasHomeScreenFeature ( PackageManager manager ) { } }
return manager . hasSystemFeature ( PackageManager . FEATURE_HOME_SCREEN ) ;
public class ConsumerMonitoring { /** * Method registerConsumerSetMonitor * Checks whether there are existing registrations on this topicspace and * discriminator combination . If there are then we will match the existing set * of subscriptions associated with it - we need only add the supplied callback to * th...
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "registerConsumerSetMonitor" , new Object [ ] { connection , topicSpace , topicSpaceUuid , discriminatorExpression , combinedExpression , callback , new Boolean ( isWildcarded ) , wildcardStem } ) ; boolean areConsumers = false ; // Test whether there are existing reg...
public class RowFormatter { /** * Appends rows */ protected static void appendRows ( final Iterator < ResultRow > it , final Appender ap , final Charset charset , final Formatting fmt , final Iterable < ColumnType > cols ) { } }
int i = 0 ; while ( it . hasNext ( ) ) { if ( i ++ > 0 ) { ap . append ( "\r\n" ) ; } // end of if ap . append ( " " ) ; ap . append ( fmt . rowStart ) ; appendValues ( it . next ( ) , ap , charset , fmt , cols . iterator ( ) , 0 ) ; ap . append ( fmt . rowEnd ) ; } // end of while ap . append ( ";" ) ;
public class Configuration { /** * Get the value at the given index from the result set * @ param < T > type to return * @ param rs result set * @ param path path * @ param i one based index in result set row * @ param clazz type * @ return value * @ throws SQLException */ @ Nullable public < T > T get ( ...
return getType ( path , clazz ) . getValue ( rs , i ) ;
public class BaseWindowedBolt { /** * define a tumbling event time window * @ param size window size */ public BaseWindowedBolt < T > eventTimeWindow ( Time size ) { } }
long s = size . toMilliseconds ( ) ; ensurePositiveTime ( s ) ; setSizeAndSlide ( s , DEFAULT_SLIDE ) ; this . windowAssigner = TumblingEventTimeWindows . of ( s ) ; return this ;
public class ScanCollectionDefault { /** * Convenience method , calls { @ link # getNextScanAtMsLevel ( int , int ) } internally * @ param scan an existing scan from THIS ScanCollection */ @ Override public IScan getNextScanAtSameMsLevel ( IScan scan ) { } }
return getNextScanAtMsLevel ( scan . getNum ( ) , scan . getMsLevel ( ) ) ;
public class Radial2Top { /** * < editor - fold defaultstate = " collapsed " desc = " Areas related " > */ private void createAreas ( final BufferedImage IMAGE ) { } }
if ( ! getAreas ( ) . isEmpty ( ) && bImage != null ) { final double ORIGIN_CORRECTION = 180.0 ; final double OUTER_RADIUS = bImage . getWidth ( ) * 0.38f ; final double RADIUS ; if ( isSectionsVisible ( ) ) { RADIUS = isExpandedSectionsEnabled ( ) ? OUTER_RADIUS - bImage . getWidth ( ) * 0.12f : OUTER_RADIUS - bImage ...
public class CompilerEnvirons { /** * Returns a { @ code CompilerEnvirons } suitable for using Rhino * in an IDE environment . Most features are enabled by default . * The { @ link ErrorReporter } is set to an { @ link ErrorCollector } . */ public static CompilerEnvirons ideEnvirons ( ) { } }
CompilerEnvirons env = new CompilerEnvirons ( ) ; env . setRecoverFromErrors ( true ) ; env . setRecordingComments ( true ) ; env . setStrictMode ( true ) ; env . setWarnTrailingComma ( true ) ; env . setLanguageVersion ( 170 ) ; env . setReservedKeywordAsIdentifier ( true ) ; env . setIdeMode ( true ) ; env . setError...
public class MessageInfo { /** * Set up the key areas . */ public void setupKeys ( ) { } }
KeyAreaInfo keyArea = null ; keyArea = new KeyAreaInfo ( this , Constants . UNIQUE , ID_KEY ) ; keyArea . addKeyField ( ID , Constants . ASCENDING ) ; keyArea = new KeyAreaInfo ( this , Constants . NOT_UNIQUE , DESCRIPTION_KEY ) ; keyArea . addKeyField ( DESCRIPTION , Constants . ASCENDING ) ; keyArea = new KeyAreaInfo...
public class DatasetId { /** * Creates a dataset identity given project ' s and dataset ' s user - defined ids . */ public static DatasetId of ( String project , String dataset ) { } }
return new DatasetId ( checkNotNull ( project ) , checkNotNull ( dataset ) ) ;
public class EbeanDynamicEvolutions { /** * Initialise the Ebean servers . */ public void start ( ) { } }
config . serverConfigs ( ) . forEach ( ( key , serverConfig ) -> servers . put ( key , EbeanServerFactory . create ( serverConfig ) ) ) ;
public class WebServiceConfiguration { /** * Accessor for the example property . Uses ConfigurationProperty annotation to provide property metadata to the * application . */ @ ConfigurationProperty ( displayMessageKey = "ENDPOINT_DISPLAY" , helpMessageKey = "ENDPOINT_HELP" , confidential = false , order = 1 , require...
return endpoint ;
public class EncodingUtils { /** * Get the encoding for a passed in locale . * @ param locale The locale . * @ return The encoding . */ public static String getEncodingFromLocale ( Locale locale ) { } }
init ( ) ; if ( locale == cachedLocale ) { return cachedEncoding ; } String encoding = null ; /* ( String ) _ localeMap . get ( locale . toString ( ) ) ; if ( encoding = = null ) { encoding = ( String ) _ localeMap . get ( locale . getLanguage ( ) + " _ " + locale . getCountry ( ) ) ; if ( encoding = = null ) { ...
public class NfsFileBase { /** * ( non - Javadoc ) * @ see com . emc . ecs . nfsclient . nfs . NfsFile # makeReadRequest ( long , int ) */ public NfsReadRequest makeReadRequest ( long offset , int size ) throws IOException { } }
return getNfs ( ) . makeReadRequest ( getFileHandle ( ) , offset , size ) ;
public class Predictor { /** * The SYSTEM command line includes parameters necessary to define the * system configuration . * @ param pwr PWR indicates the transmitter power in kilowatts . * @ param noise XNOISE indicates the expected man - made noise level . * @ param rsn RSN indicates the required signal - to...
return system ( pwr , noise . getValue ( ) , 3 , 90 , rsn . getSnRatio ( ) , 3 , 0.1 ) ;
public class LevelsLinear { /** * Set RGB input range . * @ param inRGB Range . */ public void setInRGB ( IntRange inRGB ) { } }
this . inRed = inRGB ; this . inGreen = inRGB ; this . inBlue = inRGB ; CalculateMap ( inRGB , outRed , mapRed ) ; CalculateMap ( inRGB , outGreen , mapGreen ) ; CalculateMap ( inRGB , outBlue , mapBlue ) ;
public class WebUtils { /** * Resolves a view for the given view name and controller name * @ param request The request * @ param viewName The view name * @ param controllerName The controller name * @ param viewResolver The resolver * @ return A View or null * @ throws Exception Thrown if an error occurs *...
GrailsWebRequest webRequest = GrailsWebRequest . lookup ( request ) ; Locale locale = webRequest != null ? webRequest . getLocale ( ) : Locale . getDefault ( ) ; return viewResolver . resolveViewName ( addViewPrefix ( viewName , controllerName ) , locale ) ;
public class CmsJspNavElement { /** * Returns the filename of the navigation element , i . e . * the name of the navigation resource without any path information . < p > * @ return the filename of the navigation element , i . e . * the name of the navigation resource without any path information */ public String ...
if ( m_fileName == null ) { // use " lazy initializing " if ( ! m_sitePath . endsWith ( "/" ) ) { m_fileName = m_sitePath . substring ( m_sitePath . lastIndexOf ( "/" ) + 1 , m_sitePath . length ( ) ) ; } else { m_fileName = m_sitePath . substring ( m_sitePath . substring ( 0 , m_sitePath . length ( ) - 1 ) . lastIndex...
public class BeanHelper { /** * get association type . * @ param ppropertyDescriptor property description * @ param puseField use field * @ return JClassType */ public JClassType getAssociationType ( final PropertyDescriptor ppropertyDescriptor , final boolean puseField ) { } }
final JType type = getElementType ( ppropertyDescriptor , puseField ) ; if ( type == null ) { return null ; } final JArrayType jarray = type . isArray ( ) ; if ( jarray != null ) { return jarray . getComponentType ( ) . isClassOrInterface ( ) ; } final JParameterizedType jptype = type . isParameterized ( ) ; JClassType...
public class ObjectUtils { /** * Makes a shallow copy of the source object into the target one excluding properties not in * < code > propertyNames < / code > . * This method differs from { @ link ReflectionUtils # shallowCopyFieldState ( Object , Object ) } this doesn ' t require * source and target objects to s...
ObjectUtils . doShallowCopy ( source , target , Boolean . FALSE , propertyNames ) ;
public class APSPSolver { /** * This method computes the root mean square rigidity of a consistent STN ( the inverse concept of flexibility of a STN ) . * If the STN is completely rigid , then its rigidity is 1 . If the STN has no constraints , its rigidity is 0. * This measure in proposed in [ Luke Hunsberger , 20...
rigidity = new double [ this . getVariables ( ) . length ] ; for ( int i = 0 ; i < this . getVariables ( ) . length ; i ++ ) { if ( ( ( TimePoint ) this . getVariables ( ) [ i ] ) . isUsed ( ) ) { rigidity [ i ] = ( ( ( double ) 1 / ( ( double ) ( 1 + ( ( TimePoint ) this . getVariables ( ) [ i ] ) . getUpperBound ( ) ...
public class AttributeUtils { /** * Creates an { @ code AttributeValue } object of the given class and schema type . * After the object has been constructed , its setter methods should be called to setup the value object before adding * it to the attribute itself . * @ param < T > * the type * @ param schemaT...
XMLObjectBuilder < ? > builder = XMLObjectProviderRegistrySupport . getBuilderFactory ( ) . getBuilder ( schemaType ) ; XMLObject object = builder . buildObject ( AttributeValue . DEFAULT_ELEMENT_NAME , schemaType ) ; return clazz . cast ( object ) ;
public class XMLSitemapProvider { /** * Create URL sets from every provider and invoke the provided consumer with * it . * @ param aConsumer * The consumer to be invoked . Must be able to handle < code > null < / code > * and empty values . May itself not be < code > null < / code > . */ public static void forE...
ValueEnforcer . notNull ( aConsumer , "Consumer" ) ; for ( final IXMLSitemapProviderSPI aSPI : s_aProviders ) { final XMLSitemapURLSet aURLSet = aSPI . createURLSet ( ) ; aConsumer . accept ( aURLSet ) ; }
public class PortletEntityRegistryImpl { /** * / * ( non - Javadoc ) * @ see org . apereo . portal . portlet . registry . IPortletEntityRegistry # storePortletEntity ( org . apereo . portal . portlet . om . IPortletEntity ) */ @ Override public void storePortletEntity ( HttpServletRequest request , final IPortletEnti...
Validate . notNull ( portletEntity , "portletEntity can not be null" ) ; final IUserInstance userInstance = this . userInstanceManager . getUserInstance ( request ) ; final IPerson person = userInstance . getPerson ( ) ; if ( person . isGuest ( ) ) { // Never persist things for the guest user , just rely on in - memory...
public class PyExpressionGenerator { /** * Generate the given object . * @ param operation the binary operation . * @ param it the target for the generated content . * @ param context the context . * @ return the operation . */ @ SuppressWarnings ( "checkstyle:cyclomaticcomplexity" ) protected XExpression _gene...
appendReturnIfExpectedReturnedExpression ( it , context ) ; final String operator = getOperatorSymbol ( operation ) ; if ( operator != null ) { it . append ( "(" ) ; // $ NON - NLS - 1 $ generate ( operation . getLeftOperand ( ) , it , context ) ; switch ( operator ) { case "-" : // $ NON - NLS - 1 $ case "+" : // $ NO...
public class StructrSchema { /** * Replaces the current Structr schema with the given new schema . This * method is the reverse of createFromDatabase above . * @ param app * @ param newSchema the new schema to replace the current Structr schema * @ throws FrameworkException * @ throws URISyntaxException */ pu...
Services . getInstance ( ) . setOverridingSchemaTypesAllowed ( true ) ; try ( final Tx tx = app . tx ( ) ) { for ( final SchemaRelationshipNode schemaRelationship : app . nodeQuery ( SchemaRelationshipNode . class ) . getAsList ( ) ) { app . delete ( schemaRelationship ) ; } for ( final SchemaNode schemaNode : app . no...
public class UserController { /** * 修改密码 * @ param * @ return */ @ RequestMapping ( value = "/password" , method = RequestMethod . PUT ) @ ResponseBody public JsonObjectBase password ( @ Valid PasswordModifyForm passwordModifyForm , HttpServletRequest request ) { } }
// 校验 authValidator . validatePasswordModify ( passwordModifyForm ) ; // 修改 Visitor visitor = ThreadContext . getSessionVisitor ( ) ; userMgr . modifyPassword ( visitor . getLoginUserId ( ) , passwordModifyForm . getNew_password ( ) ) ; // re login redisLogin . logout ( request ) ; return buildSuccess ( "修改成功,请重新登录" ) ...
public class M4AReader { /** * Packages media data for return to providers . */ @ Override public ITag readTag ( ) { } }
// log . debug ( " Read tag " ) ; ITag tag = null ; try { lock . acquire ( ) ; // empty - out the pre - streaming tags first if ( ! firstTags . isEmpty ( ) ) { log . debug ( "Returning pre-tag" ) ; // Return first tags before media data return firstTags . removeFirst ( ) ; } // log . debug ( " Read tag - sample { } pre...
public class ManualWorkQueue { /** * Whether the work is contained in the queue . * @ param context * Work to check . * @ return Whether the work was already waiting . */ public boolean isWaitingWork ( final T context ) { } }
read . lock ( ) ; try { return waitingWork . contains ( context ) ; } finally { read . unlock ( ) ; }
public class Unchecked { /** * Wrap a { @ link CheckedDoubleToLongFunction } in a { @ link DoubleToLongFunction } with a custom handler for checked exceptions . * Example : * < code > < pre > * DoubleStream . of ( 1.0 , 2.0 , 3.0 ) . mapToLong ( Unchecked . doubleToLongFunction ( * if ( d & lt ; 0.0) * throw ...
return t -> { try { return function . applyAsLong ( t ) ; } catch ( Throwable e ) { handler . accept ( e ) ; throw new IllegalStateException ( "Exception handler must throw a RuntimeException" , e ) ; } } ;
public class AddressArrayFactory { /** * Creates a fixed - length { @ link AddressArray } . * @ param homeDir - the home directory where the < code > indexes . dat < / code > is located . * @ param length - the length of { @ link AddressArray } . * @ param batchSize - the number of updates per update batch . * ...
AddressArray addrArray ; if ( _indexesCached ) { addrArray = new StaticLongArray ( length , batchSize , numSyncBatches , homeDir ) ; } else { addrArray = new IOTypeLongArray ( Array . Type . STATIC , length , batchSize , numSyncBatches , homeDir ) ; } return addrArray ;
public class ImportSet { /** * Re - adds the most recently popped import to the set . If a null value was pushed , does * nothing . * @ throws IndexOutOfBoundsException if there is nothing to pop */ public void popIn ( ) { } }
String front = _pushed . remove ( _pushed . size ( ) - 1 ) ; if ( front != null ) { _imports . add ( front ) ; }
public class WildcardPattern { /** * Creates pattern with specified separator for directories . * This is used to match Java - classes , i . e . < code > org . foo . Bar < / code > against < code > org / * * < / code > . * < b > However usage of character other than " / " as a directory separator is misleading and ...
String key = pattern + directorySeparator ; return CACHE . computeIfAbsent ( key , k -> new WildcardPattern ( pattern , directorySeparator ) ) ;
public class Dates { /** * Creates a copy on a Date . * @ param d The Date to copy , can be null * @ return null when the input Date was null , a copy of the Date otherwise */ public static Date copy ( final Date d ) { } }
if ( d == null ) { return null ; } else { return new Date ( d . getTime ( ) ) ; }
public class DObject { /** * Posts the specified event either to our dobject manager or to the compound event for which * we are currently transacting . */ public void postEvent ( DEvent event ) { } }
if ( _tevent != null ) { _tevent . postEvent ( event ) ; } else if ( _omgr != null ) { _omgr . postEvent ( event ) ; } else { log . info ( "Dropping event for non- or no longer managed object" , "oid" , getOid ( ) , "class" , getClass ( ) . getName ( ) , "event" , event ) ; }
public class ComputerVisionImpl { /** * Recognize Text operation . When you use the Recognize Text interface , the response contains a field called ' Operation - Location ' . The ' Operation - Location ' field contains the URL that you must use for your Get Recognize Text Operation Result operation . * @ param mode T...
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( mode == null ) { throw new IllegalArgumentException ( "Parameter mode is required and cannot be null." ) ; } if ( url == null ) { throw new IllegalArgumentExce...
public class RunList { /** * { @ link AbstractList # subList ( int , int ) } isn ' t very efficient on our { @ link Iterable } based implementation . * In fact the range check alone would require us to iterate all the elements , * so we ' d be better off just copying into ArrayList . */ @ Override public List < R >...
List < R > r = new ArrayList < > ( ) ; Iterator < R > itr = iterator ( ) ; hudson . util . Iterators . skip ( itr , fromIndex ) ; for ( int i = toIndex - fromIndex ; i > 0 ; i -- ) { r . add ( itr . next ( ) ) ; } return r ;
public class ConnInterfaceCodeGen { /** * Output class * @ param def definition * @ param out Writer * @ throws IOException ioException */ @ Override public void writeClassBody ( Definition def , Writer out ) throws IOException { } }
int indent = 1 ; out . write ( "public interface " + getClassName ( def ) ) ; writeLeftCurlyBracket ( out , 0 ) ; if ( def . getMcfDefs ( ) . get ( getNumOfMcf ( ) ) . isDefineMethodInConnection ( ) ) { if ( def . getMcfDefs ( ) . get ( getNumOfMcf ( ) ) . getMethods ( ) . size ( ) > 0 ) { for ( MethodForConnection met...
public class OptionsSpiderPanel { /** * This method initializes the combobox for HandleParameters option . * @ return the combo handle parameters */ @ SuppressWarnings ( "unchecked" ) private JComboBox < HandleParametersOption > getComboHandleParameters ( ) { } }
if ( handleParameters == null ) { handleParameters = new JComboBox < > ( new HandleParametersOption [ ] { HandleParametersOption . USE_ALL , HandleParametersOption . IGNORE_VALUE , HandleParametersOption . IGNORE_COMPLETELY } ) ; handleParameters . setRenderer ( new HandleParametersOptionRenderer ( ) ) ; } return handl...
public class AdminResourcesContainer { /** * Starts the container and hence the embedded jetty server . * @ throws Exception if there is an issue while starting the server */ @ PostConstruct public void init ( ) throws Exception { } }
try { if ( alreadyInited . compareAndSet ( false , true ) ) { initAdminContainerConfigIfNeeded ( ) ; initAdminRegistryIfNeeded ( ) ; if ( ! adminContainerConfig . shouldEnable ( ) ) { return ; } if ( adminContainerConfig . shouldScanClassPathForPluginDiscovery ( ) ) { adminPageRegistry . registerAdminPagesWithClasspath...
public class Config { /** * < p > Initializes the configuration . < / p > < p > Looks for a properties ( programName . conf ) in the classpath , the user * home directory , and in the run directory to load < / p > < p > The command line arguments are parsed and added to the * configuration . < / p > * @ param pro...
return initialize ( programName , args , new CommandLineParser ( ) , otherPackages ) ;
public class RandomUtil { /** * 获得一个随机的字符串 * @ param baseString 随机字符选取的样本 * @ param length 字符串的长度 * @ return 随机字符串 */ public static String randomString ( String baseString , int length ) { } }
final StringBuilder sb = new StringBuilder ( ) ; if ( length < 1 ) { length = 1 ; } int baseLength = baseString . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { int number = getRandom ( ) . nextInt ( baseLength ) ; sb . append ( baseString . charAt ( number ) ) ; } return sb . toString ( ) ;
public class LoadBalancer { /** * factory methods */ public static LoadBalancer getDefault ( String urls ) { } }
String [ ] endpoints = new String [ 0 ] ; if ( urls != null ) { endpoints = urls . split ( URL_SEP ) ; } return getDefault ( Arrays . asList ( endpoints ) ) ;
public class PropertyClient { /** * Does a property description scan of the properties in all interface objects . * @ param allProperties < code > true < / code > to scan all property descriptions in the interface * objects , < code > false < / code > to only scan the object type descriptions , i . e . , * { @ li...
for ( int index = 0 ; scan ( index , allProperties , consumer ) > 0 ; ++ index ) ;
public class Expressions { /** * Creates an IsEqual expression from the given expression and constant . * @ param left The left expression . * @ param constant The constant to compare to ( must be a String ) . * @ throws IllegalArgumentException If constant is not a String . * @ return A new IsEqual binary expr...
if ( ! ( constant instanceof String ) ) throw new IllegalArgumentException ( "constant is not a String" ) ; return new StringIsEqual ( left , constant ( ( String ) constant ) ) ;
public class ArrayDeserializer { /** * Reads the array . */ public Object readList ( AbstractHessianInput in , int length ) throws IOException { } }
if ( length >= 0 ) { Object [ ] data = createArray ( length ) ; in . addRef ( data ) ; if ( _componentType != null ) { for ( int i = 0 ; i < data . length ; i ++ ) data [ i ] = in . readObject ( _componentType ) ; } else { for ( int i = 0 ; i < data . length ; i ++ ) data [ i ] = in . readObject ( ) ; } in . readListEn...
public class JobTargetExecutionsInner { /** * Lists the target executions of a job step execution . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * ...
return listByStepWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName , jobName , jobExecutionId , stepName ) . map ( new Func1 < ServiceResponse < Page < JobExecutionInner > > , Page < JobExecutionInner > > ( ) { @ Override public Page < JobExecutionInner > call ( ServiceResponse < Page < JobExecut...
public class TypeConverter { /** * Convert the passed source value to short * @ param aSrcValue * The source value . May be < code > null < / code > . * @ param nDefault * The default value to be returned if an error occurs during type * conversion . * @ return The converted value . * @ throws RuntimeExce...
final Short aValue = convert ( aSrcValue , Short . class , null ) ; return aValue == null ? nDefault : aValue . shortValue ( ) ;
public class CsvReader { /** * Sort the rows by comparator * @ param comparator the comparator used for sorting */ public void sortRows ( Comparator < List < String > > comparator ) { } }
if ( data . isEmpty ( ) ) return ; Collections . sort ( data , comparator ) ;
public class WsByteBufferUtils { /** * Convert a buffer to a string using the input starting position and ending * limit . * @ param buff * @ param position * @ param limit * @ return String */ public static final String asString ( WsByteBuffer buff , int position , int limit ) { } }
byte [ ] data = asByteArray ( buff , position , limit ) ; return ( null != data ) ? new String ( data ) : null ;
public class IdemixUtils { /** * append appends a boolean array to an existing byte array * @ param data the data to which we want to append * @ param toAppend the data to be appended * @ return a new byte [ ] of data + toAppend */ static byte [ ] append ( byte [ ] data , boolean [ ] toAppend ) { } }
byte [ ] toAppendBytes = new byte [ toAppend . length ] ; for ( int i = 0 ; i < toAppend . length ; i ++ ) { toAppendBytes [ i ] = toAppend [ i ] ? ( byte ) 1 : ( byte ) 0 ; } return append ( data , toAppendBytes ) ;
public class PortProber { /** * Returns a port that is within a probable free range . < p / > Based on the ports in * http : / / en . wikipedia . org / wiki / Ephemeral _ ports , this method stays away from all well - known * ephemeral port ranges , since they can arbitrarily race with the operating system in * a...
synchronized ( random ) { final int FIRST_PORT ; final int LAST_PORT ; int freeAbove = HIGHEST_PORT - ephemeralRangeDetector . getHighestEphemeralPort ( ) ; int freeBelow = max ( 0 , ephemeralRangeDetector . getLowestEphemeralPort ( ) - START_OF_USER_PORTS ) ; if ( freeAbove > freeBelow ) { FIRST_PORT = ephemeralRangeD...
public class PluginRepositoryManager { /** * Return a plugin repository identified by the plugin interface type . * @ param pluginType * The plugin interface . * @ param < P > * The plugin type * @ return The { @ link com . buschmais . xo . impl . plugin . PluginRepository } . */ public < P extends PluginRepo...
return ( P ) pluginRepositories . get ( pluginType ) ;
public class DecimalFormat { /** * Returns true if a grouping separator belongs at the given position , based on whether * grouping is in use and the values of the primary and secondary grouping interval . * @ param pos the number of integer digits to the right of the current position . Zero * indicates the posit...
boolean result = false ; if ( isGroupingUsed ( ) && ( pos > 0 ) && ( groupingSize > 0 ) ) { if ( ( groupingSize2 > 0 ) && ( pos > groupingSize ) ) { result = ( ( pos - groupingSize ) % groupingSize2 ) == 0 ; } else { result = pos % groupingSize == 0 ; } } return result ;
public class CheckClassAdapter { /** * Checks a class signature . * @ param signature * a string containing the signature that must be checked . */ public static void checkClassSignature ( final String signature ) { } }
// ClassSignature : // FormalTypeParameters ? ClassTypeSignature ClassTypeSignature * int pos = 0 ; if ( getChar ( signature , 0 ) == '<' ) { pos = checkFormalTypeParameters ( signature , pos ) ; } pos = checkClassTypeSignature ( signature , pos ) ; while ( getChar ( signature , pos ) == 'L' ) { pos = checkClassTypeSig...
public class XMLFormatter { /** * Append the time and date in ISO 8601 format */ private void appendISO8601 ( StringBuilder sb , long millis ) { } }
GregorianCalendar cal = new GregorianCalendar ( ) ; cal . setTimeInMillis ( millis ) ; sb . append ( cal . get ( Calendar . YEAR ) ) ; sb . append ( '-' ) ; a2 ( sb , cal . get ( Calendar . MONTH ) + 1 ) ; sb . append ( '-' ) ; a2 ( sb , cal . get ( Calendar . DAY_OF_MONTH ) ) ; sb . append ( 'T' ) ; a2 ( sb , cal . ge...
public class DescribeNetworkInterfacePermissionsRequest { /** * One or more network interface permission IDs . * @ param networkInterfacePermissionIds * One or more network interface permission IDs . */ public void setNetworkInterfacePermissionIds ( java . util . Collection < String > networkInterfacePermissionIds ...
if ( networkInterfacePermissionIds == null ) { this . networkInterfacePermissionIds = null ; return ; } this . networkInterfacePermissionIds = new com . amazonaws . internal . SdkInternalList < String > ( networkInterfacePermissionIds ) ;
public class FileEntry { /** * { @ inheritDoc } */ @ Override @ FFDCIgnore ( PrivilegedActionException . class ) public URL getResource ( ) { } }
try { URL url = ( URL ) AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { @ Override public URL run ( ) throws MalformedURLException { return file . toURI ( ) . toURL ( ) ; } } ) ; return url ; } catch ( PrivilegedActionException e ) { return null ; }
public class MetadataService { /** * Updates a { @ link ProjectRole } for the specified { @ code member } in the specified { @ code projectName } . */ public CompletableFuture < Revision > updateMemberRole ( Author author , String projectName , User member , ProjectRole projectRole ) { } }
requireNonNull ( author , "author" ) ; requireNonNull ( projectName , "projectName" ) ; requireNonNull ( member , "member" ) ; requireNonNull ( projectRole , "projectRole" ) ; final Change < JsonNode > change = Change . ofJsonPatch ( METADATA_JSON , new ReplaceOperation ( JsonPointer . compile ( "/members" + encodeSegm...
public class SequentialMultiInstanceBehavior { /** * Called when the wrapped { @ link ActivityBehavior } calls the { @ link AbstractBpmnActivityBehavior # leave ( ActivityExecution ) } method . Handles the completion of one instance , and executes the logic for * the sequential behavior . */ public void leave ( Deleg...
DelegateExecution multiInstanceRootExecution = getMultiInstanceRootExecution ( childExecution ) ; int nrOfInstances = getLoopVariable ( multiInstanceRootExecution , NUMBER_OF_INSTANCES ) ; int loopCounter = getLoopVariable ( childExecution , getCollectionElementIndexVariable ( ) ) + 1 ; int nrOfCompletedInstances = get...
public class AutoMap { /** * Use given relative xpath to resolve the value . * @ param path * relative xpath * @ return value in DOM tree . null if no value is present . */ @ SuppressWarnings ( "unchecked" ) @ Override public XBAutoList < T > getList ( final CharSequence path ) { } }
return ( XBAutoList < T > ) getList ( path , invocationContext . getTargetComponentType ( ) ) ;
public class YarnContainerManager { /** * NM Callback : NM accepts the starting container request . * @ param containerId ID of a new container being started . * @ param stringByteBufferMap a Map between the auxiliary service names and their outputs . Not used . */ @ Override public void onContainerStarted ( final ...
final Optional < Container > container = this . containers . getOptional ( containerId . toString ( ) ) ; if ( container . isPresent ( ) ) { this . nodeManager . getContainerStatusAsync ( containerId , container . get ( ) . getNodeId ( ) ) ; }
public class FreemarkerConfigurationBuilder { /** * Sets the charset used for decoding byte sequences to character sequences * when reading template files in a locale for which no explicit encoding * was specified via { @ link Configuration # setEncoding ( Locale , String ) } . Note * that by default there is no ...
this . defaultEncodings . addAll ( Arrays . asList ( encodings ) ) ; return this ;
public class PrivateKeyReader { /** * Reads the given byte array with the default RSA algorithm and returns the { @ link PrivateKey } * object . * @ param privateKeyBytes * the byte array that contains the private key bytes * @ return the { @ link PrivateKey } object * @ throws NoSuchAlgorithmException * is...
return readPrivateKey ( privateKeyBytes , KeyPairGeneratorAlgorithm . RSA . getAlgorithm ( ) ) ;
public class CharacterCLA { /** * { @ inheritDoc } */ @ Override public Character [ ] getValueAsCharacterArray ( ) throws ParseException { } }
final Character [ ] result = new Character [ size ( ) ] ; for ( int r = 0 ; r < size ( ) ; r ++ ) result [ r ] = getValue ( r ) ; return result ;
public class CmsEventManager { /** * Initialize this event manager with all events from the given base event manager . < p > * @ param base the base event manager to initialize this event manager with */ protected void initialize ( CmsEventManager base ) { } }
m_eventListeners = new HashMap < Integer , List < I_CmsEventListener > > ( base . getEventListeners ( ) ) ;
public class JTMConfigurationProvider { /** * The setTMS method call is used to alert the JTMConfigurationProvider to the presence of a * TransactionManagerService . * @ param tms */ public void setTMS ( TransactionManagerService tms ) { } }
if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setTMS " + tms ) ; tmsRef = tms ;
public class DockerClient { /** * Push the latest image to the repository . * @ param name The name , e . g . " alexec / busybox " or just " busybox " if you want to default . Not null . */ public ClientResponse push ( final String name ) throws DockerException { } }
if ( name == null ) { throw new IllegalArgumentException ( "name is null" ) ; } try { final String registryAuth = registryAuth ( ) ; return client . resource ( restEndpointUrl + "/images/" + name ( name ) + "/push" ) . header ( "X-Registry-Auth" , registryAuth ) . accept ( MediaType . APPLICATION_JSON ) . post ( Client...
public class AmazonWorkspacesClient { /** * Reboots the specified WorkSpaces . * You cannot reboot a WorkSpace unless its state is < code > AVAILABLE < / code > or < code > UNHEALTHY < / code > . * This operation is asynchronous and returns before the WorkSpaces have rebooted . * @ param rebootWorkspacesRequest ...
request = beforeClientExecution ( request ) ; return executeRebootWorkspaces ( request ) ;
public class AtomCache { /** * Returns a { @ link Structure } corresponding to the CATH identifier supplied in { @ code structureName } , using the specified { @ link CathDatabase } . */ public Structure getStructureForCathDomain ( StructureName structureName , CathDatabase cathInstall ) throws IOException , StructureE...
CathDomain cathDomain = cathInstall . getDomainByCathId ( structureName . getIdentifier ( ) ) ; Structure s = getStructureForPdbId ( cathDomain . getIdentifier ( ) ) ; Structure n = cathDomain . reduce ( s ) ; // add the ligands of the chain . . . Chain newChain = n . getPolyChainByPDB ( structureName . getChainId ( ) ...
public class RestController { /** * Creates a new entity from a html form post . */ @ Transactional @ PostMapping ( value = "/{entityTypeId}" , headers = "Content-Type=application/x-www-form-urlencoded" ) public void createFromFormPost ( @ PathVariable ( "entityTypeId" ) String entityTypeId , HttpServletRequest request...
Map < String , Object > paramMap = new HashMap < > ( ) ; for ( String param : request . getParameterMap ( ) . keySet ( ) ) { String [ ] values = request . getParameterValues ( param ) ; String value = values != null ? StringUtils . join ( values , ',' ) : null ; if ( StringUtils . isNotBlank ( value ) ) { paramMap . pu...
public class Client { /** * Declares a shovel . * @ param vhost virtual host where to declare the shovel * @ param info Shovel info . */ public void declareShovel ( String vhost , ShovelInfo info ) { } }
Map < String , Object > props = info . getDetails ( ) . getPublishProperties ( ) ; if ( props != null && props . isEmpty ( ) ) { throw new IllegalArgumentException ( "Shovel publish properties must be a non-empty map or null" ) ; } final URI uri = uriWithPath ( "./parameters/shovel/" + encodePathSegment ( vhost ) + "/"...
public class AppServiceEnvironmentsInner { /** * Move an App Service Environment to a different VNET . * Move an App Service Environment to a different VNET . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ param vne...
ServiceResponse < Page < SiteInner > > response = changeVnetSinglePageAsync ( resourceGroupName , name , vnetInfo ) . toBlocking ( ) . single ( ) ; return new PagedList < SiteInner > ( response . body ( ) ) { @ Override public Page < SiteInner > nextPage ( String nextPageLink ) { return changeVnetNextSinglePageAsync ( ...
public class CompensationEventListener { /** * When signaling compensation , you can do that in 1 of 2 ways : * 1 . signalEvent ( " Compensation " , < node - with - compensation - handler - id > ) * This is specific compensation , that only possibly triggers the compensation handler * attached to the node referre...
if ( activityRefStr == null || ! ( activityRefStr instanceof String ) ) { throw new WorkflowRuntimeException ( null , getProcessInstance ( ) , "Compensation can only be triggered with String events, not an event of type " + activityRefStr == null ? "null" : activityRefStr . getClass ( ) . getSimpleName ( ) ) ; } // 1 ....
public class ElectronImpactNBEReaction { /** * set the active center for this molecule . The active center * will be heteroatoms which contain at least one group of * lone pair electrons . * @ param reactant The molecule to set the activity * @ throws CDKException */ private void setActiveCenters ( IAtomContain...
Iterator < IAtom > atoms = reactant . atoms ( ) . iterator ( ) ; while ( atoms . hasNext ( ) ) { IAtom atom = atoms . next ( ) ; if ( reactant . getConnectedLonePairsCount ( atom ) > 0 && reactant . getConnectedSingleElectronsCount ( atom ) == 0 ) atom . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; }
public class CommerceNotificationAttachmentPersistenceImpl { /** * Returns the commerce notification attachment with the primary key or returns < code > null < / code > if it could not be found . * @ param primaryKey the primary key of the commerce notification attachment * @ return the commerce notification attach...
Serializable serializable = entityCache . getResult ( CommerceNotificationAttachmentModelImpl . ENTITY_CACHE_ENABLED , CommerceNotificationAttachmentImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CommerceNotificationAttachment commerceNotificationAttachment = ( CommerceNotificationAtta...
public class BatchDeleteScheduledActionResult { /** * The names of the scheduled actions that could not be deleted , including an error message . * @ param failedScheduledActions * The names of the scheduled actions that could not be deleted , including an error message . */ public void setFailedScheduledActions ( ...
if ( failedScheduledActions == null ) { this . failedScheduledActions = null ; return ; } this . failedScheduledActions = new com . amazonaws . internal . SdkInternalList < FailedScheduledUpdateGroupActionRequest > ( failedScheduledActions ) ;
public class DatabaseManager { /** * Looks up database of a given type and path in the registry . Returns * null if there is none . */ public static synchronized Database lookupDatabaseObject ( String type , String path ) { } }
// A VoltDB extension to work around ENG - 6044 /* disabled 14 lines . . . Object key = path ; HashMap databaseMap ; if ( type = = DatabaseURL . S _ FILE ) { databaseMap = fileDatabaseMap ; key = filePathToKey ( path ) ; } else if ( type = = DatabaseURL . S _ RES ) { databaseMap = resDatabaseMap ; } els...
public class Record { /** * Creates a new record , with the given parameters . * @ param name The owner name of the record . * @ param type The record ' s type . * @ param dclass The record ' s class . * @ param ttl The record ' s time to live . * @ param length The length of the record ' s data . * @ param...
if ( ! name . isAbsolute ( ) ) throw new RelativeNameException ( name ) ; Type . check ( type ) ; DClass . check ( dclass ) ; TTL . check ( ttl ) ; DNSInput in ; if ( data != null ) in = new DNSInput ( data ) ; else in = null ; try { return newRecord ( name , type , dclass , ttl , length , in ) ; } catch ( IOException ...