signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TopLevel { /** * Static helper method to get a native error constructor with the given
* < code > type < / code > from the given < code > scope < / code > . If the scope is not
* an instance of this class or does have a cache of native errors ,
* the constructor is looked up via normal property looku... | // must be called with top level scope
assert scope . getParentScope ( ) == null ; if ( scope instanceof TopLevel ) { Function result = ( ( TopLevel ) scope ) . getNativeErrorCtor ( type ) ; if ( result != null ) { return result ; } } // fall back to normal constructor lookup
return ScriptRuntime . getExistingCtor ( cx... |
public class MapStorage { /** * Caller must hold upgrade or write lock . */
private boolean doTryInsertNoLock ( S storable ) { } } | // Create a fresh copy to ensure that custom fields are not saved .
S copy = ( S ) storable . prepare ( ) ; storable . copyAllProperties ( copy ) ; copy . markAllPropertiesClean ( ) ; Key < S > key = new Key < S > ( copy , mFullComparator ) ; S existing = mMap . get ( key ) ; if ( existing != null ) { return false ; } ... |
public class Policy { /** * Specifies the AWS account IDs to include in the policy . If < code > IncludeMap < / code > is null , all accounts in the
* organization in AWS Organizations are included in the policy . If < code > IncludeMap < / code > is not null , only values
* listed in < code > IncludeMap < / code >... | return includeMap ; |
public class ShowCumulatedProducersAction { /** * { @ inheritDoc } */
@ Override public ActionCommand execute ( ActionMapping mapping , FormBean bean , HttpServletRequest req , HttpServletResponse res ) throws Exception { } } | Map < String , GraphDataBean > graphData = new HashMap < > ( ) ; List < String > accumulatorIds = new ArrayList < > ( ) ; List < String > thresholdIds = new ArrayList < > ( ) ; // Obtaining common parameters , required for ProducerAPI
String intervalName = getCurrentInterval ( req ) ; UnitBean currentUnit = getCurrentU... |
public class AmazonCloudDirectoryClient { /** * Retrieves all available parent paths for any object type such as node , leaf node , policy node , and index node
* objects . For more information about objects , see < a
* href = " https : / / docs . aws . amazon . com / clouddirectory / latest / developerguide / key ... | request = beforeClientExecution ( request ) ; return executeListObjectParentPaths ( request ) ; |
public class HttpInputStream { /** * Reads into an array of bytes . This method will block until some input
* is available .
* @ param b the buffer into which the data is read
* @ param off the start offset of the data
* @ param len the maximum number of bytes read
* @ return the actual number of bytes read ,... | // Copy as much as possible from the read buffer
if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . logp ( Level . FINE , CLASS_NAME , "read" , "read length -->" + length ) ; } if ( total >= limit ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . ... |
public class SeaGlassTabbedPaneUI { /** * Scroll the tab buttons backwards . */
protected void scrollBackward ( ) { } } | int selectedIndex = tabPane . getSelectedIndex ( ) ; if ( -- selectedIndex < 0 ) { tabPane . setSelectedIndex ( tabPane . getTabCount ( ) == 0 ? - 1 : 0 ) ; } else { tabPane . setSelectedIndex ( selectedIndex ) ; } tabPane . repaint ( ) ; |
public class MSPDIReader { /** * The way calendars are stored in an MSPDI file means that there
* can be forward references between the base calendar unique ID for a
* derived calendar , and the base calendar itself . To get around this ,
* we initially populate the base calendar name attribute with the
* base ... | for ( Pair < ProjectCalendar , BigInteger > pair : baseCalendars ) { ProjectCalendar cal = pair . getFirst ( ) ; BigInteger baseCalendarID = pair . getSecond ( ) ; ProjectCalendar baseCal = map . get ( baseCalendarID ) ; if ( baseCal != null ) { cal . setParent ( baseCal ) ; } } |
public class PerturbedAtomHashGenerator { /** * Combines the values in an n x m matrix into a single array of size n .
* This process scans the rows and xors all unique values in the row
* together . If a duplicate value is found it is rotated using a
* pseudorandom number generator .
* @ param perturbed n x m ... | int n = perturbed . length ; int m = perturbed [ 0 ] . length ; long [ ] combined = new long [ n ] ; long [ ] rotated = new long [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { Arrays . sort ( perturbed [ i ] ) ; for ( int j = 0 ; j < m ; j ++ ) { // if non - unique , then get the next random number
if ( j > 0 && perturbed ... |
public class DistributedObjectCacheAdapter { /** * Returns < tt > true < / tt > if this map contains no key - value mappings .
* @ param includeDiskCache true to check the memory and disk maps ; false to check
* the memory map .
* @ return < tt > true < / tt > if this map contains no key - value mappings . */
@ O... | boolean isCacheEmpty = false ; /* * Check if the memory cache has entries */
isCacheEmpty = cache . getNumberCacheEntries ( ) == 0 ; /* * If the memory cache is not empty then we don ' t need to check the disk cache .
* If the cache is an instanceof CacheProviderWrapper then we know it ' s not dynacache so
* we nee... |
public class ClientStateListener { /** * Waits until the client is connected to cluster or the timeout expires .
* Does not wait if the client is already shutting down or shutdown .
* @ param timeout the maximum time to wait
* @ param unit the time unit of the { @ code timeout } argument
* @ return true if the ... | lock . lock ( ) ; try { if ( currentState . equals ( CLIENT_CONNECTED ) ) { return true ; } if ( currentState . equals ( SHUTTING_DOWN ) || currentState . equals ( SHUTDOWN ) ) { return false ; } long duration = unit . toNanos ( timeout ) ; while ( duration > 0 ) { duration = connectedCondition . awaitNanos ( duration ... |
public class UIComponent { /** * Sets the < code > focused < / code > state of this { @ link UIComponent } .
* @ param focused the state */
public void setFocused ( boolean focused ) { } } | if ( ! isEnabled ( ) ) return ; boolean flag = this . focused != focused ; flag |= MalisisGui . setFocusedComponent ( this , focused ) ; if ( ! flag ) return ; this . focused = focused ; fireEvent ( new FocusStateChange < > ( this , focused ) ) ; |
public class RemoteBrowserIterator { /** * / * ( non - Javadoc )
* @ see java . util . Iterator # next ( ) */
public Object next ( ) { } } | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "next" ) ; AOBrowserSession aoBrowserSession ; RemoteBrowserReceiver remoteBrowserReceiver ; if ( browserIterator . hasNext ( ) ) { aoBrowserSession = ( AOBrowserSession ) browserIterator . next ( ) ; remoteBrowserReceiver = new RemoteBrowserReceiver ( aoBrowserSessio... |
public class ConvexHull { /** * Orientation predicates */
private static ECoordinate determinant_ ( Point2D p , Point2D q , Point2D r ) { } } | ECoordinate det_ec = new ECoordinate ( ) ; det_ec . set ( q . x ) ; det_ec . sub ( p . x ) ; ECoordinate rp_y_ec = new ECoordinate ( ) ; rp_y_ec . set ( r . y ) ; rp_y_ec . sub ( p . y ) ; ECoordinate qp_y_ec = new ECoordinate ( ) ; qp_y_ec . set ( q . y ) ; qp_y_ec . sub ( p . y ) ; ECoordinate rp_x_ec = new ECoordina... |
public class TableCompactor { /** * Copies the { @ link Candidate } s in the given { @ link CompactionArgs } set to a contiguous block at the end of the Segment .
* @ param segment A { @ link DirectSegmentAccess } representing the Segment to operate on .
* @ param args A { @ link CompactionArgs } containing the { @... | // Collect all the candidates for copying and calculate the total serialization length .
val toWrite = new ArrayList < TableEntry > ( ) ; int totalLength = 0 ; for ( val list : args . candidates . values ( ) ) { for ( val c : list . getAll ( ) ) { toWrite . add ( c . entry ) ; totalLength += this . connector . getSeria... |
public class CreateBicMapConstantsClass { /** * Instantiates a class via deferred binding .
* @ return the new instance , which must be cast to the requested class */
public static BicMapSharedConstants create ( ) { } } | if ( bicMapConstants == null ) { // NOPMD it ' s thread save !
synchronized ( BicMapConstantsImpl . class ) { if ( bicMapConstants == null ) { bicMapConstants = new BicMapConstantsImpl ( readMapFromProperties ( "BicMapConstants" , "bics" ) ) ; } } } return bicMapConstants ; |
public class Row { /** * autofill generated values */
public void autoFill ( RowCursor cursor ) { } } | for ( Column col : columns ( ) ) { col . autoFill ( cursor . buffer ( ) , 0 ) ; } |
public class SVGParser { /** * < tref > element */
private void tref ( Attributes attributes ) throws SVGParseException { } } | debug ( "<tref>" ) ; if ( currentElement == null ) throw new SVGParseException ( "Invalid document. Root element must be <svg>" ) ; if ( ! ( currentElement instanceof SVG . TextContainer ) ) throw new SVGParseException ( "Invalid document. <tref> elements are only valid inside <text> or <tspan> elements." ) ; SVG . TRe... |
public class JKSTrustStore { /** * This method is used to find file from disk or classpath .
* @ param trustStorePath
* file to load
* @ return instance of { @ link InputStream } containing content of the file
* @ throws FileNotFoundException
* if file does not exist */
@ SuppressWarnings ( "resource" ) priva... | InputStream input ; try { input = new FileInputStream ( trustStorePath ) ; } catch ( FileNotFoundException e ) { LOGGER . warn ( "File {} not found. Fallback to classpath." , trustStorePath ) ; input = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( trustStorePath ) ; } if ( input == null... |
public class JStatusbar { /** * Display the status text .
* @ param strMessage The message to display . */
public void setStatus ( int iStatus ) { } } | if ( m_iconArea != null ) { if ( ( iStatus == Cursor . WAIT_CURSOR ) && ( BaseApplet . getSharedInstance ( ) != null ) ) m_iconArea . setIcon ( BaseApplet . getSharedInstance ( ) . loadImageIcon ( ThinMenuConstants . WAIT ) ) ; else m_iconArea . setIcon ( null ) ; } |
public class LaContainerDefaultProvider { protected static void assertCircularInclude ( final LaContainer container , final String path ) { } } | assertCircularInclude ( container , path , new LinkedList < String > ( ) ) ; |
public class Base64 { /** * Encodes the given data to a base64 string .
* @ param data a valid byte [ ] , must not be null .
* @ return a valid < code > String < / code > instance representing the base64 encoding of the given data . */
@ SuppressWarnings ( "AssignmentToForLoopParameter" ) public static String encod... | final int len = data . length ; final StringBuilder result = new StringBuilder ( ( len / 3 + 1 ) * 4 ) ; int bte ; int index ; for ( int i = 0 ; i < len ; i ++ ) { bte = data [ i ] ; // First 6 bits
index = bte >> 2 & MASK_6 ; result . append ( CHAR_TABLE . charAt ( index ) ) ; // Last 2 bits plus 4 from next byte
inde... |
public class CmsSetupBean { /** * Sets the needed database parameters . < p >
* @ param request the http request
* @ param provider the db provider
* @ return true if already submitted */
public boolean setDbParamaters ( HttpServletRequest request , String provider ) { } } | return setDbParamaters ( request . getParameterMap ( ) , provider , request . getContextPath ( ) , request . getSession ( ) ) ; |
public class XCostExtension { /** * Retrieves the cost type for an attribute , if set by this extension ' s type
* attribute .
* @ param attribute
* Attribute element to retrieve cost type for .
* @ return The requested cost type . */
public String extractType ( XAttribute attribute ) { } } | XAttribute attr = attribute . getAttributes ( ) . get ( KEY_TYPE ) ; if ( attr == null ) { return null ; } else { return ( ( XAttributeLiteral ) attr ) . getValue ( ) ; } |
public class MaterialDialogDecorator { /** * Inflates the view , which is used to show the dialog ' s title . The view may either be the
* default one or a custom view , if one has been set before .
* @ return The view , which has been inflated , as an instance of the class { @ link View } or null ,
* if no view ... | if ( getRootView ( ) != null ) { inflateTitleContainer ( ) ; if ( customTitleView != null ) { titleContainer . addView ( customTitleView ) ; } else if ( customTitleViewId != - 1 ) { LayoutInflater layoutInflater = LayoutInflater . from ( getContext ( ) ) ; View view = layoutInflater . inflate ( customTitleViewId , titl... |
public class UBLPEReaderBuilder { /** * Create a new reader builder .
* @ param aClass
* The UBL class to be read . May not be < code > null < / code > .
* @ return The new reader builder . Never < code > null < / code > .
* @ param < T >
* The UBLPE document implementation type */
@ Nonnull public static < T... | return new UBLPEReaderBuilder < > ( aClass ) ; |
public class TypeAdapter { /** * Converts the JSON document in { @ code in } to a Java object . Unlike Gson ' s
* similar { @ link Gson # fromJson ( java . io . Reader , Class ) fromJson } method , this
* read is strict . Create a { @ link JsonReader # setLenient ( boolean ) lenient }
* { @ code JsonReader } and ... | JsonReader reader = new JsonReader ( in ) ; return read ( reader ) ; |
public class AbstractCommand { /** * 映射方法
* @ param pObject
* @ throws APPErrorException */
protected Object invokeByReturn ( Object pObject ) throws APPErrorException { } } | try { Method method = null ; if ( null == getModelClass ( ) ) { method = tgtools . util . ReflectionUtil . findMethod ( mService . getClass ( ) , getMethodName ( ) ) ; return method . invoke ( mService ) ; } else { method = tgtools . util . ReflectionUtil . findMethod ( mService . getClass ( ) , getMethodName ( ) , get... |
public class TextComponentUtil { /** * Gets the line at a given position in the editor */
public static int getLineAtPosition ( JTextComponent editor , int position ) { } } | if ( position <= 0 ) { return 1 ; } String s = editor . getText ( ) ; if ( position > s . length ( ) ) { position = s . length ( ) ; } try { return GosuStringUtil . countMatches ( editor . getText ( 0 , position ) , "\n" ) + 1 ; } catch ( BadLocationException e ) { throw new RuntimeException ( e ) ; } |
public class PrintWriterImpl { /** * Writes a character . */
final public void write ( char [ ] buf , int offset , int length ) { } } | Writer out = this . out ; if ( out == null ) return ; try { out . write ( buf , offset , length ) ; } catch ( IOException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; } |
public class ServletRESTRequestWithParams { /** * ( non - Javadoc )
* @ see com . ibm . wsspi . rest . handler . RESTRequest # getURL ( ) */
@ Override public String getURL ( ) { } } | ServletRESTRequestImpl ret = castRequest ( ) ; if ( ret != null ) return ret . getURL ( ) ; return null ; |
public class VitoDrawableFactoryImpl { /** * We handle the given bitmap and return a Drawable ready for being displayed : If rounding is set ,
* the image will be rounded , if a border if set , the border will be applied and finally , the
* image will be rotated if required .
* < p > Bitmap - > border - > rounded... | RoundingOptions roundingOptions = imageOptions . getRoundingOptions ( ) ; BorderOptions borderOptions = imageOptions . getBorderOptions ( ) ; if ( borderOptions != null && borderOptions . width > 0 ) { return rotatedDrawable ( closeableStaticBitmap , roundedDrawableWithBorder ( closeableStaticBitmap , borderOptions , r... |
public class AbstractContainerTask { /** * Executes a List of Tasks as children of this Task */
protected void performSubtasks ( TaskRequest req , TaskResponse res , List < Task > tasks ) { } } | // Assertions . . .
if ( req == null ) { String msg = "Argument 'req' cannot be null." ; throw new IllegalArgumentException ( msg ) ; } if ( res == null ) { String msg = "Argument 'res' cannot be null." ; throw new IllegalArgumentException ( msg ) ; } if ( tasks == null ) { String msg = "Child tasks have not been initi... |
public class SQLiteSession { /** * Executes a statement that does not return a result .
* @ param sql The SQL statement to execute .
* @ param bindArgs The arguments to bind , or null if none .
* @ param connectionFlags The connection flags to use if a connection must be
* acquired by this operation . Refer to ... | if ( sql == null ) { throw new IllegalArgumentException ( "sql must not be null." ) ; } if ( executeSpecial ( sql , bindArgs , connectionFlags , cancellationSignal ) ) { return ; } acquireConnection ( sql , connectionFlags , cancellationSignal ) ; // might throw
try { mConnection . execute ( sql , bindArgs , cancellati... |
public class ThumbnailBuilder { /** * Create a thumbnail for the video .
* @ param videoPath video path .
* @ return thumbnail path . */
@ WorkerThread @ Nullable public String createThumbnailForVideo ( String videoPath ) { } } | if ( TextUtils . isEmpty ( videoPath ) ) return null ; File thumbnailFile = randomPath ( videoPath ) ; if ( thumbnailFile . exists ( ) ) return thumbnailFile . getAbsolutePath ( ) ; try { MediaMetadataRetriever retriever = new MediaMetadataRetriever ( ) ; if ( URLUtil . isNetworkUrl ( videoPath ) ) { retriever . setDat... |
public class UTF8Reader { /** * @ param available Number of " unused " bytes in the input buffer
* @ return True , if enough bytes were read to allow decoding of at least
* one full character ; false if EOF was encountered instead . */
private boolean loadMore ( int available ) throws IOException { } } | mByteCount += ( mByteBufferEnd - available ) ; // Bytes that need to be moved to the beginning of buffer ?
if ( available > 0 ) { /* 11 - Nov - 2008 , TSa : can only move if we own the buffer ; otherwise
* we are stuck with the data . */
if ( mBytePtr > 0 && canModifyBuffer ( ) ) { for ( int i = 0 ; i < available ; +... |
public class ULocale { /** * < strong > [ icu ] < / strong > Converts the specified keyword value ( legacy type , or BCP 47
* Unicode locale extension type ) to the well - formed BCP 47 Unicode locale
* extension type for the specified keyword ( category ) . For example , BCP 47
* Unicode locale extension type " ... | String bcpType = KeyTypeData . toBcpType ( keyword , value , null , null ) ; if ( bcpType == null && UnicodeLocaleExtension . isType ( value ) ) { // unknown keyword , but syntax is fine . .
bcpType = AsciiUtil . toLowerString ( value ) ; } return bcpType ; |
public class OrmElf { /** * Insert an annotated object into the database .
* @ param connection a SQL connection
* @ param target the annotated object to insert
* @ param < T > the class template
* @ return the same object that was passed in , but with possibly updated @ Id field due to auto - generated keys
... | return OrmWriter . insertObject ( connection , target ) ; |
public class Cipher { /** * Encrypts or decrypts data in a single - part operation , or finishes a
* multiple - part operation . The data is encrypted or decrypted ,
* depending on how this cipher was initialized .
* < p > All < code > input . remaining ( ) < / code > bytes starting at
* < code > input . positi... | checkCipherState ( ) ; if ( ( input == null ) || ( output == null ) ) { throw new IllegalArgumentException ( "Buffers must not be null" ) ; } if ( input == output ) { throw new IllegalArgumentException ( "Input and output buffers must " + "not be the same object, consider using buffer.duplicate()" ) ; } if ( output . i... |
public class NavigationTelemetry { /** * Creates a new { @ link FeedbackEvent } and adds it to the queue
* of events to be sent .
* @ param feedbackType defined in FeedbackEvent
* @ param description optional String describing event
* @ param feedbackSource from either reroute or UI
* @ return String feedback... | FeedbackEvent feedbackEvent = queueFeedbackEvent ( feedbackType , description , feedbackSource ) ; return feedbackEvent . getEventId ( ) ; |
public class SpatialPointLeafEntry { /** * Calls the super method and writes the values of this entry to the specified
* stream .
* @ param out the stream to write the object to
* @ throws java . io . IOException Includes any I / O exceptions that may occur */
@ Override public void writeExternal ( ObjectOutput o... | out . writeInt ( DBIDUtil . asInteger ( id ) ) ; out . writeInt ( values . length ) ; for ( double v : values ) { out . writeDouble ( v ) ; } |
public class PartnersInner { /** * Gets an integration account partner .
* @ param resourceGroupName The resource group name .
* @ param integrationAccountName The integration account name .
* @ param partnerName The integration account partner name .
* @ param serviceCallback the async ServiceCallback to handl... | return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , integrationAccountName , partnerName ) , serviceCallback ) ; |
public class DbPersistenceManager { /** * { @ inheritDoc }
* Basically wraps a JDBC transaction around super . store ( ) .
* FIXME : the retry logic is almost a duplicate of { @ code ConnectionHelper . RetryManager } . */
public synchronized void store ( final ChangeLog changeLog ) throws ItemStateException { } } | int failures = 0 ; ItemStateException lastException = null ; boolean sleepInterrupted = false ; while ( ! sleepInterrupted && ( blockOnConnectionLoss || failures <= 1 ) ) { try { conHelper . startBatch ( ) ; super . store ( changeLog ) ; conHelper . endBatch ( true ) ; return ; } catch ( SQLException e ) { // Either st... |
public class BigComplex { /** * Calculates the addition of the given complex value to this complex number using the specified { @ link MathContext } .
* < p > This methods < strong > does not < / strong > modify this instance . < / p >
* @ param value the { @ link BigComplex } value to add
* @ param mathContext t... | return valueOf ( re . add ( value . re , mathContext ) , im . add ( value . im , mathContext ) ) ; |
public class UserService { /** * Retrieves user login history records matching the given criteria .
* Retrieves up to < code > limit < / code > user history records matching the
* given terms and sorted by the given predicates . Only history records
* associated with data that the given user can read are returned... | List < ActivityRecordModel > searchResults ; // Bypass permission checks if the user is a system admin
if ( user . getUser ( ) . isAdministrator ( ) ) searchResults = userRecordMapper . search ( requiredContents , sortPredicates , limit ) ; // Otherwise only return explicitly readable history records
else searchResults... |
public class MtasToken { /** * Adds the offset .
* @ param start the start
* @ param end the end */
final public void addOffset ( Integer start , Integer end ) { } } | if ( tokenOffset == null ) { setOffset ( start , end ) ; } else if ( ( start == null ) || ( end == null ) ) { // do nothing
} else if ( start > end ) { throw new IllegalArgumentException ( "Start offset after end offset" ) ; } else { tokenOffset . add ( start , end ) ; } |
public class DefaultGroovyMethods { /** * Finds the items matching the IDENTITY Closure ( i . e . & # 160 ; matching Groovy truth ) .
* Example :
* < pre class = " groovyTestCase " >
* def items = [ 1 , 2 , 0 , false , true , ' ' , ' foo ' , [ ] , [ 4 , 5 ] , null ]
* assert items . findAll ( ) = = [ 1 , 2 , tr... | return findAll ( self , Closure . IDENTITY ) ; |
public class RulesExchangeHandler { /** * private boolean isContinue ( Exchange exchange , Message message ) {
* return isBoolean ( exchange , message , RulesConstants . CONTINUE _ PROPERTY ) ; */
private boolean isDispose ( Exchange exchange , Message message ) { } } | return isBoolean ( exchange , message , RulesConstants . DISPOSE_PROPERTY ) ; |
public class FactionWarfareApi { /** * List of the top pilots in faction warfare Top 100 leaderboard of pilots
* for kills and victory points separated by total , last week and yesterday
* - - - This route expires daily at 11:05
* @ param datasource
* The server name you would like data from ( optional , defaul... | com . squareup . okhttp . Call call = getFwLeaderboardsCharactersValidateBeforeCall ( datasource , ifNoneMatch , null ) ; Type localVarReturnType = new TypeToken < FactionWarfareLeaderboardCharactersResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class DeviceMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Device device , ProtocolMarshaller protocolMarshaller ) { } } | if ( device == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( device . getHostPath ( ) , HOSTPATH_BINDING ) ; protocolMarshaller . marshall ( device . getContainerPath ( ) , CONTAINERPATH_BINDING ) ; protocolMarshaller . marshall ( device .... |
public class SftpClient { /** * Download the remote files to the local computer .
* @ param remote
* the regular expression path to the remote file
* @ param progress
* @ return SftpFile [ ]
* @ throws FileNotFoundException
* @ throws SftpStatusException
* @ throws SshException
* @ throws TransferCancel... | return getFiles ( remote , progress , false ) ; |
public class CFMLTransformer { /** * Liest den Body eines Tag ein . Kommentare , Tags und Literale inkl . Expressions . < br / >
* EBNF : < br / >
* < code > [ comment ] ( " < / " | " < " tag body | literal body ) ; < / code >
* @ param body CFXD Body Element dem der Inhalt zugeteilt werden soll .
* @ param par... | boolean parseLiteral = true ; // Comment
comment ( data . srcCode , false ) ; // Tag
// is Tag Beginning
if ( data . srcCode . isCurrent ( '<' ) ) { // return if end tag and inside tag
if ( data . srcCode . isNext ( '/' ) ) { // lucee . print . ln ( " early return " ) ;
return ; } parseLiteral = ! tag ( data , body ) ;... |
public class FileUtils { /** * Creates a file with the given { @ link File } path .
* @ param path the given { @ link File } indicating the absolute location and name of the file .
* @ return true if the path represented by the { @ link File } object is not null , is not an existing directory ,
* or the path can ... | try { return ( path != null && ! path . isDirectory ( ) && ( path . isFile ( ) || path . createNewFile ( ) ) ) ; } catch ( IOException ignore ) { return false ; } |
public class ServiceActionDetail { /** * A map that defines the self - service action .
* @ param definition
* A map that defines the self - service action .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ServiceActionDetail withDefinition ( java . util . Ma... | setDefinition ( definition ) ; return this ; |
public class CalendarDataUtility { /** * Transform a { @ link Calendar } style constant into an ICU context value . */
private static int toContext ( int style ) { } } | switch ( style ) { case Calendar . SHORT_FORMAT : case Calendar . NARROW_FORMAT : case Calendar . LONG_FORMAT : return DateFormatSymbols . FORMAT ; case Calendar . SHORT_STANDALONE : case Calendar . NARROW_STANDALONE : case Calendar . LONG_STANDALONE : return DateFormatSymbols . STANDALONE ; default : throw new Illegal... |
public class Resources { /** * Gets a resource string formatted with MessageFormat .
* @ param key the key
* @ param arguments the arguments
* @ return Formatted stirng . */
public String getFormatted ( String key , Object ... arguments ) { } } | return MessageFormat . format ( resource . getString ( key ) , arguments ) ; |
public class ApkParsers { /** * Get apk manifest xml file as text
* @ throws IOException */
public static String getManifestXml ( String apkFilePath , Locale locale ) throws IOException { } } | try ( ApkFile apkFile = new ApkFile ( apkFilePath ) ) { apkFile . setPreferredLocale ( locale ) ; return apkFile . getManifestXml ( ) ; } |
public class SmartsMatchers { /** * Do not use - temporary method until the SMARTS packages are cleaned up .
* Prepares a target molecule for matching with SMARTS .
* @ param container the container to initialise
* @ param ringQuery whether the smarts will check ring size queries */
public static void prepare ( I... | if ( ringQuery ) { SMARTSAtomInvariants . configureDaylightWithRingInfo ( container ) ; } else { SMARTSAtomInvariants . configureDaylightWithoutRingInfo ( container ) ; } |
public class Proxy { /** * TODO consider storing cache of metricName - > index mappings for O ( 1 ) performance . */
public boolean match ( String destination , String metricName ) { } } | int [ ] matches = match ( destination ) ; if ( matches == null || matches . length == 0 ) { return false ; } for ( int match : matches ) { String candidateMetricName = proxyRules . get ( match ) . getMetricSystemName ( ) ; if ( metricName . equals ( candidateMetricName ) ) { return true ; } } return false ; |
public class SequencedFragment { /** * Convert quality scores in - place .
* @ throws FormatException if quality scores are out of the range
* allowed by the current encoding .
* @ throws IllegalArgumentException if current and target quality encodings are the same . */
public static void convertQuality ( Text qu... | if ( current == target ) throw new IllegalArgumentException ( "current and target quality encodinds are the same (" + current + ")" ) ; byte [ ] bytes = quality . getBytes ( ) ; final int len = quality . getLength ( ) ; final int illuminaSangerDistance = FormatConstants . ILLUMINA_OFFSET - FormatConstants . SANGER_OFFS... |
public class PopupMenuFactoryAddUserFromSession { /** * Gets the Users extension
* @ return the extension Users */
private ExtensionUserManagement getExtensionUserManagement ( ) { } } | if ( extensionUsers == null ) { extensionUsers = Control . getSingleton ( ) . getExtensionLoader ( ) . getExtension ( ExtensionUserManagement . class ) ; } return extensionUsers ; |
public class BPSImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . BPS__PSEG_NAME : return getPsegName ( ) ; case AfplibPackage . BPS__TRIPLETS : return getTriplets ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class MultiLayerNetwork { /** * Returns a 1 x m vector where the vector is composed of a flattened vector of all of the parameters ( weights and
* biases etc ) for all parameters in the network . Note that this method is generally reserved for developer and
* internal use - see { @ link # getParam ( String )... | if ( backwardOnly ) return params ( ) ; List < INDArray > params = new ArrayList < > ( ) ; for ( Layer layer : getLayers ( ) ) { INDArray layerParams = layer . params ( ) ; if ( layerParams != null ) params . add ( layerParams ) ; // may be null : subsampling etc layers
} return Nd4j . toFlattened ( 'f' , params ) ; |
public class FrustumRayBuilder { /** * Update the stored frustum corner rays and origin of < code > this < / code > { @ link FrustumRayBuilder } with the given { @ link Matrix4fc matrix } .
* Reference : < a href = " http : / / gamedevs . org / uploads / fast - extraction - viewing - frustum - planes - from - world -... | float nxX = m . m03 ( ) + m . m00 ( ) , nxY = m . m13 ( ) + m . m10 ( ) , nxZ = m . m23 ( ) + m . m20 ( ) , d1 = m . m33 ( ) + m . m30 ( ) ; float pxX = m . m03 ( ) - m . m00 ( ) , pxY = m . m13 ( ) - m . m10 ( ) , pxZ = m . m23 ( ) - m . m20 ( ) , d2 = m . m33 ( ) - m . m30 ( ) ; float nyX = m . m03 ( ) + m . m01 ( ) ... |
public class CmsSourceSearchApp { /** * Generates the state string for the given search settings . < p >
* @ param settings the search settings
* @ return the state string */
public static String generateState ( CmsSearchReplaceSettings settings ) { } } | String state = "" ; state = A_CmsWorkplaceApp . addParamToState ( state , SITE_ROOT , settings . getSiteRoot ( ) ) ; state = A_CmsWorkplaceApp . addParamToState ( state , SEARCH_TYPE , settings . getType ( ) . name ( ) ) ; state = A_CmsWorkplaceApp . addParamToState ( state , SEARCH_PATTERN , settings . getSearchpatter... |
public class InputParallelismUpdateMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InputParallelismUpdate inputParallelismUpdate , ProtocolMarshaller protocolMarshaller ) { } } | if ( inputParallelismUpdate == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( inputParallelismUpdate . getCountUpdate ( ) , COUNTUPDATE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON... |
public class IntegerExtensions { /** * The bitwise exclusive < code > or < / code > operation . This is the equivalent to the java < code > ^ < / code > operator .
* @ param a
* an integer .
* @ param b
* an integer .
* @ return < code > a ^ b < / code > */
@ Pure @ Inline ( value = "($1 ^ $2)" , constantExpr... | return a ^ b ; |
public class Iterators { /** * Returns the elements in the base iterator until it hits any element that doesn ' t satisfy the filter .
* Then the rest of the elements in the base iterator gets ignored .
* @ since 1.485 */
public static < T > Iterator < T > limit ( final Iterator < ? extends T > base , final Countin... | return new Iterator < T > ( ) { private T next ; private boolean end ; private int index = 0 ; public boolean hasNext ( ) { fetch ( ) ; return next != null ; } public T next ( ) { fetch ( ) ; T r = next ; next = null ; return r ; } private void fetch ( ) { if ( next == null && ! end ) { if ( base . hasNext ( ) ) { next... |
public class AmazonConnectClient { /** * Retrieves the contact attributes associated with a contact .
* @ param getContactAttributesRequest
* @ return Result of the GetContactAttributes operation returned by the service .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws ResourceNotFo... | request = beforeClientExecution ( request ) ; return executeGetContactAttributes ( request ) ; |
public class Webhook { /** * all */
public static WebhookCollection all ( ) throws EasyPostException { } } | Map < String , Object > params = new HashMap < String , Object > ( ) ; return all ( params , null ) ; |
public class MetadataHandler { /** * Return a list of all REST API Routes and a Markdown Table of Contents . */
@ SuppressWarnings ( "unused" ) // called through reflection by RequestServer
public MetadataV3 listRoutes ( int version , MetadataV3 docs ) { } } | MarkdownBuilder builder = new MarkdownBuilder ( ) ; builder . comment ( "Preview with http://jbt.github.io/markdown-editor" ) ; builder . heading1 ( "REST API Routes Table of Contents" ) ; builder . hline ( ) ; builder . tableHeader ( "HTTP method" , "URI pattern" , "Input schema" , "Output schema" , "Summary" ) ; docs... |
public class LinearClassifier { /** * Returns of the score of the Datum as internalized features for the
* specified label . Ignores the true label of the Datum .
* Doesn ' t consider a value for each feature . */
private double scoreOf ( int [ ] feats , L label ) { } } | int iLabel = labelIndex . indexOf ( label ) ; double score = 0.0 ; for ( int feat : feats ) { score += weight ( feat , iLabel ) ; } return score + thresholds [ iLabel ] ; |
public class IndexVectorUtil { /** * Loads a mapping from word to { @ link TernaryVector } from the file */
@ SuppressWarnings ( "unchecked" ) public static Map < String , TernaryVector > load ( File indexVectorFile ) { } } | try { FileInputStream fis = new FileInputStream ( indexVectorFile ) ; ObjectInputStream inStream = new ObjectInputStream ( fis ) ; Map < String , TernaryVector > vectorMap = ( Map < String , TernaryVector > ) inStream . readObject ( ) ; inStream . close ( ) ; return vectorMap ; } catch ( IOException ioe ) { throw new I... |
public class Asset { /** * Create a AssetUpdater to execute update .
* @ param pathServiceSid The service _ sid
* @ param pathSid The sid
* @ param friendlyName The friendly _ name
* @ return AssetUpdater capable of executing the update */
public static AssetUpdater updater ( final String pathServiceSid , final... | return new AssetUpdater ( pathServiceSid , pathSid , friendlyName ) ; |
public class InternalSimpleAntlrParser { /** * InternalSimpleAntlr . g : 317:1 : entryRuleRule returns [ EObject current = null ] : iv _ ruleRule = ruleRule EOF ; */
public final EObject entryRuleRule ( ) throws RecognitionException { } } | EObject current = null ; EObject iv_ruleRule = null ; try { // InternalSimpleAntlr . g : 318:2 : ( iv _ ruleRule = ruleRule EOF )
// InternalSimpleAntlr . g : 319:2 : iv _ ruleRule = ruleRule EOF
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getRuleRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; iv_r... |
public class SelectBooleanCheckboxRenderer { /** * This methods receives and processes input made by the user . More
* specifically , it ckecks whether the user has interacted with the current
* b : selectBooleanCheckbox . The default implementation simply stores the
* input value in the list of submitted values ... | SelectBooleanCheckbox selectBooleanCheckbox = ( SelectBooleanCheckbox ) component ; if ( selectBooleanCheckbox . isDisabled ( ) || selectBooleanCheckbox . isReadonly ( ) ) { return ; } decodeBehaviors ( context , selectBooleanCheckbox ) ; // moved to
// AJAXRenderer
String clientId = selectBooleanCheckbox . getClientId... |
public class ConBox { /** * Makes sure that the PhysicalEntity is controlling more reactions than it participates
* ( excluding complex assembly ) .
* @ return non - generative constraint */
public static Constraint moreControllerThanParticipant ( ) { } } | return new ConstraintAdapter ( 1 ) { PathAccessor partConv = new PathAccessor ( "PhysicalEntity/participantOf:Conversion" ) ; PathAccessor partCompAss = new PathAccessor ( "PhysicalEntity/participantOf:ComplexAssembly" ) ; PathAccessor effects = new PathAccessor ( "PhysicalEntity/controllerOf/controlled*:Conversion" ) ... |
public class Computer { /** * Returns the { @ link Node } that this computer represents .
* @ return
* null if the configuration has changed and the node is removed , yet the corresponding { @ link Computer }
* is not yet gone . */
@ CheckForNull public Node getNode ( ) { } } | Jenkins j = Jenkins . getInstanceOrNull ( ) ; // TODO confirm safe to assume non - null and use getInstance ( )
if ( j == null ) { return null ; } if ( nodeName == null ) { return j ; } return j . getNode ( nodeName ) ; |
public class ESRIFileUtil { /** * Translate a M - coordinate from Java standard
* to ESRI standard .
* @ param measure is the Java z - coordinate
* @ return the ESRI m - coordinate */
@ Pure public static double toESRI_m ( double measure ) { } } | if ( Double . isInfinite ( measure ) || Double . isNaN ( measure ) ) { return ESRI_NAN ; } return measure ; |
public class IdentityT { /** * { @ inheritDoc } */
@ Override public < B > IdentityT < M , B > discardL ( Applicative < B , MonadT < M , Identity < ? > , ? > > appB ) { } } | return MonadT . super . discardL ( appB ) . coerce ( ) ; |
public class AmazonKinesisFirehoseToRedshiftSample { /** * Method to create delivery stream with Redshift destination configuration .
* @ throws Exception */
private static void createDeliveryStream ( ) throws Exception { } } | boolean deliveryStreamExists = false ; LOG . info ( "Checking if " + deliveryStreamName + " already exits" ) ; List < String > deliveryStreamNames = listDeliveryStreams ( ) ; if ( deliveryStreamNames != null && deliveryStreamNames . contains ( deliveryStreamName ) ) { deliveryStreamExists = true ; LOG . info ( "Deliver... |
public class IoUtil { /** * 将Reader中的内容复制到Writer中
* @ param reader Reader
* @ param writer Writer
* @ param bufferSize 缓存大小
* @ param streamProgress 进度处理器
* @ return 传输的byte数
* @ throws IORuntimeException IO异常 */
public static long copy ( Reader reader , Writer writer , int bufferSize , StreamProgress strea... | char [ ] buffer = new char [ bufferSize ] ; long size = 0 ; int readSize ; if ( null != streamProgress ) { streamProgress . start ( ) ; } try { while ( ( readSize = reader . read ( buffer , 0 , bufferSize ) ) != EOF ) { writer . write ( buffer , 0 , readSize ) ; size += readSize ; writer . flush ( ) ; if ( null != stre... |
public class CmsSite { /** * Sets the parameters . < p >
* @ param parameters the parameters to set */
public void setParameters ( SortedMap < String , String > parameters ) { } } | m_parameters = new TreeMap < String , String > ( parameters ) ; |
public class JsonWriter { /** * Writes an array with the given key name
* @ param key the key name for the array
* @ param array the array to be written
* @ return This structured writer
* @ throws IOException Something went wrong writing */
protected JsonWriter property ( String key , Object [ ] array ) throws... | return property ( key , Arrays . asList ( array ) ) ; |
public class BaseRequest { /** * Send this resource request asynchronously , with the given byte array as the request body .
* If the Content - Type header was not previously set , this method will set it to " application / octet - stream " .
* @ param data The byte array to put in the request body
* @ param list... | String contentTypeHeader = headers . get ( CONTENT_TYPE ) ; final String contentType = contentTypeHeader != null ? contentTypeHeader : BINARY_CONTENT_TYPE ; RequestBody body = RequestBody . create ( MediaType . parse ( contentType ) , data ) ; sendRequest ( null , listener , body ) ; |
public class PeerNode { /** * documentation inherited from interface ClientObserver */
public void clientDidLogoff ( Client client ) { } } | if ( nodeobj == null ) { return ; } String nodeName = getNodeName ( ) ; for ( ClientInfo clinfo : nodeobj . clients ) { _peermgr . clientLoggedOff ( nodeName , clinfo ) ; } for ( NodeObject . Lock lock : nodeobj . locks ) { _peermgr . peerRemovedLock ( nodeName , lock ) ; } nodeobj . removeListener ( _listener ) ; _pee... |
public class CuratorZookeeperClient { /** * This method blocks until the connection to ZK succeeds . Use with caution . The block
* will timeout after the connection timeout ( as passed to the constructor ) has elapsed
* @ return true if the connection succeeded , false if not
* @ throws InterruptedException inte... | Preconditions . checkState ( started . get ( ) , "Client is not started" ) ; log . debug ( "blockUntilConnectedOrTimedOut() start" ) ; OperationTrace trace = startAdvancedTracer ( "blockUntilConnectedOrTimedOut" ) ; internalBlockUntilConnectedOrTimedOut ( ) ; trace . commit ( ) ; boolean localIsConnected = state . isCo... |
public class LinkGenerator { /** * Returns the first item .
* @ return first item
* @ throws IOException { @ link IOException } */
private byte [ ] getFirstItem ( ) throws IOException { } } | ByteArrayOutputStream outStream = new ByteArrayOutputStream ( ) ; int [ ] firstItem = { 0x1F , 0x50 , 0xE0 , 0x4F , 0xD0 , 0x20 , 0xEA , 0x3A , 0x69 , 0x10 , 0xA2 , 0xD8 , 0x08 , 0x00 , 0x2B , 0x30 , 0x30 , 0x9D , } ; writeInts ( firstItem , outStream ) ; return outStream . toByteArray ( ) ; |
public class SysUtils { /** * Close a closable ignoring any exceptions .
* This method is used during cleanup , or in a finally block .
* @ param closeable source or destination of data can be closed */
public static void closeIgnoringExceptions ( AutoCloseable closeable ) { } } | if ( closeable != null ) { try { closeable . close ( ) ; // Suppress it since we ignore any exceptions
// SUPPRESS CHECKSTYLE IllegalCatch
} catch ( Exception e ) { // Still log the Exception for issue tracing
LOG . log ( Level . WARNING , String . format ( "Failed to close %s" , closeable ) , e ) ; } } |
public class ExecutorFactoryConfigurationBuilder { /** * Add key / value property pair to this executor factory configuration
* @ param key property key
* @ param value property value
* @ return this ExecutorFactoryConfig */
public ExecutorFactoryConfigurationBuilder addProperty ( String key , String value ) { } ... | attributes . attribute ( PROPERTIES ) . get ( ) . put ( key , value ) ; return this ; |
public class LiveReloadServer { /** * Trigger livereload of all connected clients . */
public void triggerReload ( ) { } } | synchronized ( this . monitor ) { synchronized ( this . connections ) { for ( Connection connection : this . connections ) { try { connection . triggerReload ( ) ; } catch ( Exception ex ) { logger . debug ( "Unable to send reload message" , ex ) ; } } } } |
public class EntityPathTracker { /** * Returns the current entity path with the given literal name appended .
* @ param literalName the literal name to append to the current entity path .
* Must not be null .
* @ return the current entity path with the literal name appended . The { @ link
* # getEntitySeparator... | if ( entityStack . size ( ) == 0 ) { return literalName ; } return getCurrentPath ( ) + entitySeparator + literalName ; |
public class FunctionRegistry { /** * Registers a function by a name other than its default name . */
static public void putFunction ( String name , Function function ) { } } | FunctionRegistry . functions . put ( Objects . requireNonNull ( name ) , function ) ; |
public class CveDB { /** * Analyzes the description to determine if the vulnerability / software is
* for a specific known ecosystem . The ecosystem can be used later for
* filtering CPE matches .
* @ param description the description to analyze
* @ return the ecosystem if one could be identified ; otherwise
... | if ( description == null ) { return null ; } int idx = StringUtils . indexOfIgnoreCase ( description , ".php" ) ; if ( ( idx > 0 && ( idx + 4 == description . length ( ) || ! Character . isLetterOrDigit ( description . charAt ( idx + 4 ) ) ) ) || StringUtils . containsIgnoreCase ( description , "wordpress" ) || StringU... |
public class TinylogLoggingProvider { /** * Creates a writing thread for a matrix of writers .
* @ param matrix
* All writers
* @ return Initialized and running writhing thread */
private static WritingThread createWritingThread ( final Collection < Writer > [ ] [ ] matrix ) { } } | Collection < Writer > writers = getAllWriters ( matrix ) ; WritingThread thread = new WritingThread ( writers ) ; thread . start ( ) ; return thread ; |
public class EntityUrl { /** * Get Resource Url for GetEntity
* @ param entityListFullName The full name of the EntityList including namespace in name @ nameSpace format
* @ param id Unique identifier of the customer segment to retrieve .
* @ param responseFields Filtering syntax appended to an API call to increa... | UrlFormatter formatter = new UrlFormatter ( "/api/platform/entitylists/{entityListFullName}/entities/{id}?responseFields={responseFields}" ) ; formatter . formatUrl ( "entityListFullName" , entityListFullName ) ; formatter . formatUrl ( "id" , id ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return ... |
public class Record { /** * Updates the binary representation of the data , such that it reflects the state of the currently
* stored fields . If the binary representation is already up to date , nothing happens . Otherwise ,
* this function triggers the modified fields to serialize themselves into the records buff... | // check whether the binary state is in sync
final int firstModified = this . firstModifiedPos ; if ( firstModified == Integer . MAX_VALUE ) { return ; } final InternalDeSerializer serializer = this . serializer ; final int [ ] offsets = this . offsets ; final int numFields = this . numFields ; serializer . memory = th... |
public class SizeBoundedQueue { /** * Removes and returns the first element or null if the queue is empty */
public T remove ( ) { } } | lock . lock ( ) ; try { if ( queue . isEmpty ( ) ) return null ; El < T > el = queue . poll ( ) ; count -= el . size ; not_full . signalAll ( ) ; return el . el ; } finally { lock . unlock ( ) ; } |
public class ConsumerDispatcher { /** * Attach a new ConsumerPoint to this ConsumerDispatcher . A ConsumerKey
* object is created for this ConsumerPoint which contains various pieces of
* state information including the consumer point ' s ready state , which is
* initially set to not ready . Also included is a ge... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "attachConsumerPoint" , new Object [ ] { consumerPoint , criteria , connectionUuid , Boolean . valueOf ( readAhead ) , consumerSet } ) ; DispatchableConsumerPoint dispatchableConsumerPoint = ( DispatchableConsumerPoint ) con... |
public class WebSocketNode { /** * 广播消息 , 给所有人发消息
* @ param wsrange 过滤条件
* @ param convert Convert
* @ param message0 消息内容
* @ param last 是否最后一条
* @ return 为0表示成功 , 其他值表示部分发送异常 */
@ Local public CompletableFuture < Integer > broadcastMessage ( final WebSocketRange wsrange , final Convert convert , final Objec... | if ( message0 instanceof CompletableFuture ) return ( ( CompletableFuture ) message0 ) . thenApply ( msg -> broadcastMessage ( wsrange , convert , msg , last ) ) ; final Object message = ( convert == null || message0 instanceof WebSocketPacket ) ? message0 : ( ( convert instanceof TextConvert ) ? new WebSocketPacket ( ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.