signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class FlexCompColMatrix { /** * Sets the given column equal the passed vector */
public void setColumn ( int i , SparseVector x ) { } } | if ( x . size ( ) != numRows ) throw new IllegalArgumentException ( "New column must be of the same size as existing column" ) ; colD [ i ] = x ; |
public class Entities { /** * Gets any entity within the container marked with the specified type .
* @ param container
* Entity container .
* @ param type
* Entity type .
* @ return Gets an Optional of the resulting entity or an empty Optional if it was not found .
* @ see Entity # markAsType ( Class ) */
... | return container . streamEntitiesOfType ( type ) . findAny ( ) ; |
public class MidaoFactory { /** * Returns new Pooled { @ link javax . sql . DataSource } implementation
* @ param poolProperties pool properties
* @ return new Pooled { @ link javax . sql . DataSource } implementation
* @ throws java . sql . SQLException */
public static DataSource createDataSource ( Properties p... | try { return MidaoFrameworkPoolBinder . createDataSource ( poolProperties ) ; } catch ( NoClassDefFoundError ex ) { throw new NoClassDefFoundError ( ERROR_COULDNT_FIND_POOL_PROVIDER ) ; } |
public class AssessmentRun { /** * A list of notifications for the event subscriptions . A notification about a particular generated finding is added
* to this list only once .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setNotifications ( java . util .... | if ( this . notifications == null ) { setNotifications ( new java . util . ArrayList < AssessmentRunNotification > ( notifications . length ) ) ; } for ( AssessmentRunNotification ele : notifications ) { this . notifications . add ( ele ) ; } return this ; |
public class IOUtils { /** * Read stopwords in memory from a file , one per line . Stopwords are converted to lowercase when read .
* @ param reader
* the input reader .
* @ return a set of stopwords .
* @ throws IOException */
public static Set < String > readStopwords ( BufferedReader reader ) throws IOExcept... | HashSet < String > words = new HashSet < String > ( ) ; String nextLine ; while ( ( ( nextLine = reader . readLine ( ) ) != null ) ) { words . add ( nextLine . trim ( ) . toLowerCase ( ) ) ; } return words ; |
public class PeepholeReplaceKnownMethods { /** * Try to fold . substr ( ) calls on strings */
private Node tryFoldStringSubstr ( Node n , Node stringNode , Node arg1 ) { } } | checkArgument ( n . isCall ( ) ) ; checkArgument ( stringNode . isString ( ) ) ; checkArgument ( arg1 != null ) ; int start ; int length ; String stringAsString = stringNode . getString ( ) ; Double maybeStart = NodeUtil . getNumberValue ( arg1 ) ; if ( maybeStart != null ) { start = maybeStart . intValue ( ) ; } else ... |
public class BranchEvent { /** * Logs this BranchEvent to Branch for tracking and analytics
* @ param context Current context
* @ return { @ code true } if the event is logged to Branch */
public boolean logEvent ( Context context ) { } } | boolean isReqQueued = false ; String reqPath = isStandardEvent ? Defines . RequestPath . TrackStandardEvent . getPath ( ) : Defines . RequestPath . TrackCustomEvent . getPath ( ) ; if ( Branch . getInstance ( ) != null ) { Branch . getInstance ( ) . handleNewRequest ( new ServerRequestLogEvent ( context , reqPath ) ) ;... |
public class ResourceUtils { /** * recurse add all the files matching given name pattern inside the given
* directory and all subdirectories */
public static void addFiles ( final Project findBugsProject , File clzDir , final Pattern pat ) { } } | if ( clzDir . isDirectory ( ) ) { clzDir . listFiles ( new FileCollector ( pat , findBugsProject ) ) ; } |
public class MissingDataHandler { /** * This function filters out rows or columns that contain NA values , Default : axis = 0 , how = ' any ' , thresh = 0 , columns = null ,
* inplace = false
* @ param axis = 0 : drop by row , 1 : drop by column , default 0
* @ param how = ' any ' or ' all ' , default ' any '
*... | DDF newddf = null ; int numcols = this . getDDF ( ) . getNumColumns ( ) ; if ( columns == null ) { columns = this . getDDF ( ) . getColumnNames ( ) ; } String sqlCmd = "" ; if ( axis == Axis . ROW ) { // drop row with NA
if ( thresh > 0 ) { if ( thresh > numcols ) { throw new DDFException ( "Required number of non-NA v... |
public class CacheHandler { /** * 删除缓存组
* @ param mt
* @ param mapperNameSpace
* @ param removePkCache 是否同时删除按主键的缓存 */
private void removeCacheByGroup ( String msId , String mapperNameSpace , boolean removePkCache ) { } } | // 删除cachegroup关联缓存
String entityName = mapperNameRalateEntityNames . get ( mapperNameSpace ) ; getCacheProvider ( ) . clearGroup ( entityName , removePkCache ) ; logger . debug ( "_autocache_ method[{}] remove cache Group:{}" , msId , entityName ) ; // 关联缓存
if ( cacheEvictCascades . containsKey ( msId ) ) { String cac... |
public class CmsMultiDialog { /** * Checks if the resource operation is an operation on at least one folder . < p >
* @ return true if the operation an operation on at least one folder , otherwise false */
protected boolean isOperationOnFolder ( ) { } } | Iterator < String > i = getResourceList ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { String resName = i . next ( ) ; try { CmsResource curRes = getCms ( ) . readResource ( resName , CmsResourceFilter . ALL ) ; if ( curRes . isFolder ( ) ) { // found a folder
return true ; } } catch ( CmsException e ) { // can usual... |
public class ADSUtil { /** * Computes an upper bound for the length of a splitting word . Based on
* I . V . Kogan . " Estimated Length of a Minimal Simple Conditional Diagnostic Experiment " . In : Automation and Remote
* Control 34 ( 1973)
* @ param n
* the size of the automaton ( number of states )
* @ par... | if ( m == 2 ) { return n ; } return LongMath . binomial ( n , i ) - LongMath . binomial ( m - 1 , i - 1 ) - 1 ; |
public class RamEventStore { /** * Converts an opaque handle into a long ID . If the handle is not a Long , this will throw an
* { @ link java . lang . IllegalArgumentException } .
* @ param handle The handle to convert to an ID .
* @ return The ID . */
private Long handleToId ( Object handle ) { } } | if ( handle instanceof Long ) { return ( Long ) handle ; } else { throw new IllegalArgumentException ( "Expected handle to be a Long, but was: " + handle . getClass ( ) . getCanonicalName ( ) ) ; } |
public class ByteArrayReader { /** * Reads a standard SSH1 MPINT using the first 16 bits as the length prefix
* @ return
* @ throws IOException */
public BigInteger readMPINT ( ) throws IOException { } } | short bits = readShort ( ) ; byte [ ] raw = new byte [ ( bits + 7 ) / 8 + 1 ] ; raw [ 0 ] = 0 ; readFully ( raw , 1 , raw . length - 1 ) ; return new BigInteger ( raw ) ; |
public class AsynchronousRequest { /** * For more info on pvp ranks API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / pvp / ranks " > here < / a > < br / >
* Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } m... | isParamValid ( new ParamChecker ( ids ) ) ; gw2API . getPvPRankInfo ( processIds ( ids ) , GuildWars2 . lang . getValue ( ) ) . enqueue ( callback ) ; |
public class WorkArounds { /** * TODO : This method exists because of a bug in javac which does not
* handle " @ deprecated tag in package - info . java " , when this issue
* is fixed this method and its uses must be jettisoned . */
public boolean isDeprecated0 ( Element e ) { } } | if ( ! utils . getDeprecatedTrees ( e ) . isEmpty ( ) ) { return true ; } JavacTypes jctypes = ( ( DocEnvImpl ) configuration . docEnv ) . toolEnv . typeutils ; TypeMirror deprecatedType = utils . getDeprecatedType ( ) ; for ( AnnotationMirror anno : e . getAnnotationMirrors ( ) ) { if ( jctypes . isSameType ( anno . g... |
public class UsbConnection { /** * Fires a frame received event ( { @ link KNXListener # frameReceived ( FrameEvent ) } ) for the supplied EMI
* < code > frame < / code > .
* @ param frame the EMI1 / EMI2 / cEMI L - data frame to generate the event for
* @ throws KNXFormatException on error creating cEMI message ... | logger . debug ( "received {} frame {}" , emiType , DataUnitBuilder . toHex ( frame , "" ) ) ; final FrameEvent fe = emiType == KnxTunnelEmi . CEmi ? new FrameEvent ( this , CEMIFactory . create ( frame , 0 , frame . length ) ) : new FrameEvent ( this , frame ) ; listeners . fire ( l -> l . frameReceived ( fe ) ) ; |
public class AuthenticationContext { /** * Acquires security token from the authority .
* @ param resource
* Identifier of the target resource that is the recipient of the
* requested token .
* @ param clientAssertion
* The client assertion to use for client authentication .
* @ param callback
* optional ... | this . validateInput ( resource , clientAssertion , true ) ; final ClientAuthentication clientAuth = createClientAuthFromClientAssertion ( clientAssertion ) ; final AdalOAuthAuthorizationGrant authGrant = new AdalOAuthAuthorizationGrant ( new ClientCredentialsGrant ( ) , resource ) ; return this . acquireToken ( authGr... |
public class FluentCloseableIterable { /** * Returns the elements from this fluent iterable that satisfy a predicate . The
* resulting fluent iterable ' s iterator does not support { @ code remove ( ) } . */
public final FluentCloseableIterable < T > filter ( Predicate < ? super T > predicate ) { } } | return from ( CloseableIterables . filter ( this , predicate ) ) ; |
public class Ui { /** * Check the AttributeSet values have a attribute String , on user set the attribute resource .
* Form android styles namespace
* @ param attrs AttributeSet
* @ param attribute The attribute to retrieve
* @ return If have the attribute return True */
public static boolean isHaveAttribute ( ... | return attrs . getAttributeValue ( Ui . androidStyleNameSpace , attribute ) != null ; |
public class ConsulClient { /** * Event */
@ Override public Response < Event > eventFire ( String event , String payload , EventParams eventParams , QueryParams queryParams ) { } } | return eventClient . eventFire ( event , payload , eventParams , queryParams ) ; |
public class ProtoTruth { /** * Assert on a single { @ link Message } instance . */
public static ProtoSubject < ? , Message > assertThat ( @ NullableDecl Message message ) { } } | return assertAbout ( protos ( ) ) . that ( message ) ; |
public class JavaParser { /** * $ ANTLR start synpred139 _ Java */
public final void synpred139_Java_fragment ( ) throws RecognitionException { } } | // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 658:9 : ( enumDeclaration ( ' ; ' ) ? )
// src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 658:9 : enumDeclaration ( ' ; ' ) ?
{ pushFollow ( FOLLOW_enumDeclaration_in_synpred139_Java26... |
public class StreamThrottler { /** * Throttles an { @ link InputStream } if throttling is configured .
* @ param inputStream { @ link InputStream } to throttle .
* @ param sourceURI used for selecting the throttling policy .
* @ param targetURI used for selecting the throttling policy . */
@ Builder ( builderMeth... | Preconditions . checkNotNull ( inputStream , "InputStream cannot be null." ) ; Limiter limiter = new NoopLimiter ( ) ; if ( sourceURI != null && targetURI != null ) { StreamCopierSharedLimiterKey key = new StreamCopierSharedLimiterKey ( sourceURI , targetURI ) ; try { limiter = new MultiLimiter ( limiter , this . broke... |
public class FirestoreAdminClient { /** * Gets the metadata and configuration for a Field .
* < p > Sample code :
* < pre > < code >
* try ( FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient . create ( ) ) {
* FieldName name = FieldName . of ( " [ PROJECT ] " , " [ DATABASE ] " , " [ COLLECTION _... | GetFieldRequest request = GetFieldRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; return getField ( request ) ; |
public class XMLChar { /** * Returns true if the encoding name is a valid IANA encoding .
* This method does not verify that there is a decoder available
* for this encoding , only that the characters are valid for an
* IANA encoding name .
* @ param ianaEncoding The IANA encoding name . */
public static boolea... | if ( ianaEncoding != null ) { int length = ianaEncoding . length ( ) ; if ( length > 0 ) { char c = ianaEncoding . charAt ( 0 ) ; if ( ( c >= 'A' && c <= 'Z' ) || ( c >= 'a' && c <= 'z' ) ) { for ( int i = 1 ; i < length ; i ++ ) { c = ianaEncoding . charAt ( i ) ; if ( ( c < 'A' || c > 'Z' ) && ( c < 'a' || c > 'z' ) ... |
public class FilePickerActivity { /** * Set the background color of the header
* @ param colorResId Resource Id of the color
* @ param drawableResId Resource Id of the drawable */
private void setHeaderBackground ( int colorResId , int drawableResId ) { } } | if ( drawableResId == - 1 ) { try { header . setBackgroundColor ( getResources ( ) . getColor ( colorResId ) ) ; } catch ( Resources . NotFoundException e ) { e . printStackTrace ( ) ; } } else { try { header . setBackgroundDrawable ( getResources ( ) . getDrawable ( drawableResId ) ) ; } catch ( Resources . NotFoundEx... |
public class HiveUtils { /** * Normally hive . aux . jars . path is expanded from just being a path to the full
* list of files in the directory by the hive shell script . Since we normally
* won ' t be running from the script , it ' s up to us to do that work here . We
* use a heuristic that if there is no occur... | if ( original == null || original . contains ( ".jar" ) ) return original ; File [ ] files = new File ( original ) . listFiles ( ) ; if ( files == null || files . length == 0 ) { LOG . info ( "No files in to expand in aux jar path. Returning original parameter" ) ; return original ; } return filesToURIString ( files ) ... |
public class FastStringBuffer { /** * Append the contents of another FastStringBuffer onto
* this FastStringBuffer , growing the storage if necessary .
* NOTE THAT after calling append ( ) , previously obtained
* references to m _ array [ ] may no longer be valid .
* @ param value FastStringBuffer whose content... | // Complicating factor here is that the two buffers may use
// different chunk sizes , and even if they ' re the same we ' re
// probably on a different alignment due to previously appended
// data . We have to work through the source in bite - sized chunks .
if ( value == null ) return ; int strlen = value . length ( ... |
public class Record { /** * Returns the unique value of the property converted to an instance of a certain class , or
* null if the property has no value . Note that this method fails if the property has multiple
* values or its unique value cannot be converted to the requested class ; if this is not the
* desire... | final Object result ; synchronized ( this ) { result = doGet ( property , valueClass ) ; } if ( result == null ) { return null ; } else if ( result instanceof List < ? > ) { final List < T > list = ( List < T > ) result ; final StringBuilder builder = new StringBuilder ( "Expected one value for property " ) . append ( ... |
public class Template { /** * Returns the inferred method type of the template based on the given actual argument types .
* @ throws InferException if no instances of the specified type variables would allow the { @ code
* actualArgTypes } to match the { @ code expectedArgTypes } */
private Type infer ( Warner warn... | Symtab symtab = inliner . symtab ( ) ; Type methodType = new MethodType ( expectedArgTypes , returnType , List . < Type > nil ( ) , symtab . methodClass ) ; if ( ! freeTypeVariables . isEmpty ( ) ) { methodType = new ForAll ( freeTypeVariables , methodType ) ; } Enter enter = inliner . enter ( ) ; MethodSymbol methodSy... |
public class Evaluators { /** * Return true if < em > all < / em > evaluators are in closed state
* ( and their processing queues are empty ) . */
public synchronized boolean allEvaluatorsAreClosed ( ) { } } | synchronized ( this . evaluators ) { for ( final EvaluatorManager eval : this . evaluators . values ( ) ) { if ( ! eval . isClosed ( ) ) { return false ; } } } return true ; |
public class ClassFields { /** * Get the table name . */
public String getTableNames ( boolean bAddQuotes ) { } } | return ( m_tableName == null ) ? Record . formatTableNames ( CLASS_FIELDS_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ; |
public class PasswordValidationCallback { /** * < p > Clear the password . < / p > */
public void clearPassword ( ) { } } | char [ ] password = this . password ; this . password = null ; if ( password != null ) { Arrays . fill ( password , ( char ) 0 ) ; } |
public class Input { /** * Reads a short array in bulk . This may be more efficient than reading them individually . */
public short [ ] readShorts ( int length ) throws KryoException { } } | short [ ] array = new short [ length ] ; if ( optional ( length << 1 ) == length << 1 ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p += 2 ) array [ i ] = ( short ) ( ( buffer [ p ] & 0xFF ) | ( ( buffer [ p + 1 ] & 0xFF ) ) << 8 ) ; position = p ; } else { for ( ... |
public class TimeoutException { /** * Utility method that produce the message of the timeout .
* @ param timeout the maximum time to wait .
* @ param unit the time unit of the timeout argument
* @ return formatted string that contains the timeout information . */
public static String getTimeoutMessage ( long time... | return String . format ( "Timeout of %d %s reached" , timeout , requireNonNull ( unit , "unit" ) ) ; |
public class DateRangeCondition { /** * Returns the { @ link SpatialOperation } representing the specified { @ code String } .
* @ param operation a { @ code String } representing a { @ link SpatialOperation }
* @ return the { @ link SpatialOperation } representing the specified { @ code String } */
static SpatialO... | if ( operation == null ) { throw new IndexException ( "Operation is required" ) ; } else if ( operation . equalsIgnoreCase ( "is_within" ) ) { return SpatialOperation . IsWithin ; } else if ( operation . equalsIgnoreCase ( "contains" ) ) { return SpatialOperation . Contains ; } else if ( operation . equalsIgnoreCase ( ... |
public class XPathUtils { /** * Evaluate XPath expression with result type Node .
* @ param node
* @ param xPathExpression
* @ param nsContext
* @ return */
public static Node evaluateAsNode ( Node node , String xPathExpression , NamespaceContext nsContext ) { } } | Node result = ( Node ) evaluateExpression ( node , xPathExpression , nsContext , XPathConstants . NODE ) ; if ( result == null ) { throw new CitrusRuntimeException ( "No result for XPath expression: '" + xPathExpression + "'" ) ; } return result ; |
public class JSTalkBackFilter { /** * Creates producer with given producer id , category and subsystem and register it in producer registry .
* @ param producerId id of the producer
* @ param category name of the category
* @ param subsystem name of the subsystem
* @ return PageInBrowserStats producer */
privat... | OnDemandStatsProducer < PageInBrowserStats > producer = limit == - 1 ? new OnDemandStatsProducer < PageInBrowserStats > ( producerId , category , subsystem , new PageInBrowserStatsFactory ( ) ) : new EntryCountLimitedOnDemandStatsProducer < PageInBrowserStats > ( producerId , category , subsystem , new PageInBrowserSta... |
public class DocumentTreeUrl { /** * Get Resource Url for UpdateTreeDocumentContent
* @ param documentListName Name of content documentListName to delete
* @ param documentName The name of the document in the site .
* @ return String Resource Url */
public static MozuUrl updateTreeDocumentContentUrl ( String docu... | UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlists/{documentListName}/documentTree/{documentName}/content?folderPath={folderPath}&folderId={folderId}" ) ; formatter . formatUrl ( "documentListName" , documentListName ) ; formatter . formatUrl ( "documentName" , documentName ) ; return new MozuUrl (... |
public class FuncKey { /** * Execute the function . The function must return
* a valid object .
* @ param xctxt The current execution context .
* @ return A valid XObject .
* @ throws javax . xml . transform . TransformerException */
public XObject execute ( XPathContext xctxt ) throws javax . xml . transform .... | // TransformerImpl transformer = ( TransformerImpl ) xctxt ;
TransformerImpl transformer = ( TransformerImpl ) xctxt . getOwnerObject ( ) ; XNodeSet nodes = null ; int context = xctxt . getCurrentNode ( ) ; DTM dtm = xctxt . getDTM ( context ) ; int docContext = dtm . getDocumentRoot ( context ) ; if ( DTM . NULL == do... |
public class MapMethods { /** * Sorts by Value a Associative Array in ascending order .
* @ param associativeArray
* @ return */
public static AssociativeArray sortAssociativeArrayByValueAscending ( AssociativeArray associativeArray ) { } } | ArrayList < Map . Entry < Object , Object > > entries = new ArrayList < > ( associativeArray . entrySet ( ) ) ; Collections . sort ( entries , ( Map . Entry < Object , Object > a , Map . Entry < Object , Object > b ) -> { Double va = TypeInference . toDouble ( a . getValue ( ) ) ; Double vb = TypeInference . toDouble (... |
public class BytecodeUtils { /** * Compare a string valued expression to another expression using soy = = semantics .
* @ param stringExpr An expression that is known to be an unboxed string
* @ param other An expression to compare it to . */
private static Expression doEqualsString ( SoyExpression stringExpr , Soy... | // This is compatible with SharedRuntime . compareString , which interestingly makes = = break
// transitivity . See b / 21461181
SoyRuntimeType otherRuntimeType = other . soyRuntimeType ( ) ; if ( otherRuntimeType . isKnownStringOrSanitizedContent ( ) ) { if ( stringExpr . isNonNullable ( ) ) { return stringExpr . inv... |
public class ObjectPool { /** * Close the pool , destroying all objects */
public void close ( ) { } } | synchronized ( closeLock ) { if ( closed ) return ; closed = true ; } synchronized ( this ) { Iterator < T > allObjects = all . iterator ( ) ; while ( allObjects . hasNext ( ) ) { T poolObject = allObjects . next ( ) ; internalDestroyPoolObject ( poolObject ) ; } all . clear ( ) ; available . clear ( ) ; // Unlock all ... |
public class CPDefinitionOptionRelLocalServiceBaseImpl { /** * Adds the cp definition option rel to the database . Also notifies the appropriate model listeners .
* @ param cpDefinitionOptionRel the cp definition option rel
* @ return the cp definition option rel that was added */
@ Indexable ( type = IndexableType... | cpDefinitionOptionRel . setNew ( true ) ; return cpDefinitionOptionRelPersistence . update ( cpDefinitionOptionRel ) ; |
public class V1InstanceGetter { /** * Get Messages filtered by the criteria specified in the passed in filter .
* @ param filter Limit the items returned . If null , then all items returned .
* @ return Collection of items as specified in the filter . */
public Collection < Message > messages ( MessageFilter filter... | return get ( Message . class , ( filter != null ) ? filter : new MessageFilter ( ) ) ; |
public class BitvUnit { /** * JUnit Assertion to verify a { @ link com . gargoylesoftware . htmlunit . html . HtmlPage } instance for accessibility .
* @ param htmlPage { @ link com . gargoylesoftware . htmlunit . html . HtmlPage } instance
* @ param testable rule ( s ) to apply */
public static void assertAccessib... | assertThat ( htmlPage , is ( compliantTo ( testable ) ) ) ; |
public class DeleteBackupRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteBackupRequest deleteBackupRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteBackupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteBackupRequest . getBackupArn ( ) , BACKUPARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . ... |
public class FnNumber { /** * It converts the input into a { @ link BigDecimal } using the given scale and { @ link RoundingMode }
* @ param scale the scale to be used
* @ param roundingMode the { @ link RoundingMode } to round the input with
* @ return the { @ link BigDecimal } */
public static final Function < ... | return new ToBigDecimal ( scale , roundingMode ) ; |
public class TranscoderWrapperStatisticsSupport { /** * { @ inheritDoc } */
public CachedData encode ( final Object object ) { } } | final CachedData result = _delegate . encode ( object ) ; _statistics . register ( StatsType . CACHED_DATA_SIZE , result . getData ( ) . length ) ; return result ; |
public class FrameManager { /** * Removes a frameView from the list and exits if it was the last
* @ param frameView NavigationFrameView to remove from the list */
private void removeNavigationFrameView ( SwingFrame frameView ) { } } | navigationFrames . remove ( frameView ) ; if ( navigationFrames . size ( ) == 0 ) { System . exit ( 0 ) ; } |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Bill } { @ code > } } */
@ XmlElementDecl ( namespace = "http://schema.intuit.com/finance/v3" , name = "Bill" , substitutionHeadNamespace = "http://schema.intuit.com/finance/v3" , substitutionHeadName = "IntuitObject" ... | return new JAXBElement < Bill > ( _Bill_QNAME , Bill . class , null , value ) ; |
public class FuzzySymbolicVariableConstraintSolver { private boolean isFound ( String [ ] s , String st ) { } } | String [ ] t = s ; java . util . Arrays . sort ( t ) ; if ( Arrays . binarySearch ( t , st ) >= 0 ) return true ; return false ; |
public class SARLLabelProvider { /** * Replies the image for the given element .
* < p > This function is a Xtext dispatch function for { @ link # imageDescriptor ( Object ) } .
* @ param element the element .
* @ return the image descriptor .
* @ see # imageDescriptor ( Object ) */
protected ImageDescriptor im... | final JvmDeclaredType jvmElement = this . jvmModelAssociations . getInferredType ( element ) ; return this . images . forCapacity ( element . getVisibility ( ) , this . adornments . get ( jvmElement ) ) ; |
public class CmsFlexResponse { /** * Method overload from the standard HttpServletRequest API . < p >
* @ see javax . servlet . http . HttpServletResponse # setHeader ( java . lang . String , java . lang . String ) */
@ Override public void setHeader ( String name , String value ) { } } | if ( isSuspended ( ) ) { return ; } if ( CmsRequestUtil . HEADER_CONTENT_TYPE . equalsIgnoreCase ( name ) ) { setContentType ( value ) ; return ; } if ( m_cachingRequired && ! m_includeMode ) { setHeaderList ( m_bufferHeaders , name , value ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBun... |
public class SharedObject { /** * Unregister event listener
* @ param listener
* Event listener */
protected void unregister ( IEventListener listener ) { } } | log . debug ( "unregister - listener: {}" , listener ) ; if ( listeners . remove ( listener ) ) { listenerStats . decrement ( ) ; } |
public class CmsDbSettingsPanel { /** * Saves form field data to setup bean . */
public void saveToSetupBean ( ) { } } | Map < String , String [ ] > result = new HashMap < String , String [ ] > ( ) ; CmsSetupBean bean = m_setupBean ; if ( m_dbCreateUser . isVisible ( ) ) { bean . setDbCreateUser ( m_dbCreateUser . getValue ( ) ) ; } if ( m_dbCreatePwd . isVisible ( ) ) { bean . setDbCreatePwd ( m_dbCreatePwd . getValue ( ) ) ; } if ( m_d... |
public class RuleSessionImpl { /** * / * ( non - Javadoc )
* @ see nz . co . senanque . rules . RuleSession # exclude ( nz . co . senanque . rules . RuleContext , java . lang . String , nz . co . senanque . validationengine . ProxyField ) */
@ InternalFunction ( precedence = 1 , isAssign = true ) public void exclude ... | exclude ( proxyField , key , ruleContext ) ; |
public class ScreenFullAwt { /** * Format resolution to string .
* @ param resolution The resolution reference .
* @ param depth The depth reference .
* @ return The formatted string . */
private static String formatResolution ( Resolution resolution , int depth ) { } } | return new StringBuilder ( MIN_LENGTH ) . append ( String . valueOf ( resolution . getWidth ( ) ) ) . append ( Constant . STAR ) . append ( String . valueOf ( resolution . getHeight ( ) ) ) . append ( Constant . STAR ) . append ( depth ) . append ( Constant . SPACE ) . append ( Constant . AT ) . append ( String . value... |
public class FakeTable { /** * Add this record ( Always called from the record class ) .
* Make the remote add call with the current data .
* @ param record The record to add .
* @ exception DBException File exception . */
public void doAdd ( Record record ) throws DBException { } } | record = this . moveRecordToBase ( record ) ; int iOpenMode = record . getOpenMode ( ) ; RecordChangedHandler recordChangeListener = ( RecordChangedHandler ) record . getListener ( RecordChangedHandler . class ) ; Object [ ] rgobjEnabledFields = record . setEnableFieldListeners ( false ) ; boolean [ ] rgbEnabled = reco... |
public class HBeanPredecessors { /** * If this key value is of predecessor familiy type . */
public static boolean isPredecessor ( KeyValue kv ) { } } | if ( Bytes . equals ( kv . getFamily ( ) , PRED_COLUMN_FAMILY ) ) { return true ; } return false ; |
public class ComparatorCompat { /** * Adds the comparator , that uses a function for extract
* a { @ code long } sort key , to the chain .
* @ param keyExtractor the function that extracts the sort key
* @ return the new { @ code ComparatorCompat } instance */
@ NotNull public ComparatorCompat < T > thenComparing... | return thenComparing ( comparingLong ( keyExtractor ) ) ; |
public class FailoverGroupsInner { /** * Fails over from the current primary server to this server . This operation might result in data loss .
* @ 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 .
* @ pa... | return beginForceFailoverAllowDataLossWithServiceResponseAsync ( resourceGroupName , serverName , failoverGroupName ) . map ( new Func1 < ServiceResponse < FailoverGroupInner > , FailoverGroupInner > ( ) { @ Override public FailoverGroupInner call ( ServiceResponse < FailoverGroupInner > response ) { return response . ... |
public class KuteIO { /** * Read a
* { @ link slieb . kute . api . Resource . Readable } resource from its input stream . This is almost like { @ link KuteIO # readResource ( Resource . Readable ) } ,
* except that it uses the { @ link slieb . kute . api . Resource . Readable # getInputStream ( ) } method instead .... | try ( InputStream inputStream = resource . getInputStream ( ) ) { return IOUtils . toString ( inputStream ) ; } |
public class FilterByStatusLayout { /** * Get - status of FILTER . */
private void getTargetFilterStatuses ( ) { } } | unknown = SPUIComponentProvider . getButton ( UIComponentIdProvider . UNKNOWN_STATUS_ICON , TargetUpdateStatus . UNKNOWN . toString ( ) , i18n . getMessage ( UIMessageIdProvider . TOOLTIP_TARGET_STATUS_UNKNOWN ) , SPUIDefinitions . SP_BUTTON_STATUS_STYLE , false , FontAwesome . SQUARE , SPUIButtonStyleSmall . class ) ;... |
public class COFFFileHeader { /** * Reads the header ' s fields . */
private void read ( ) { } } | // define the specification format
final int key = 0 ; final int description = 1 ; final int offset = 2 ; final int length = 3 ; SpecificationFormat format = new SpecificationFormat ( key , description , offset , length ) ; // read the header data
try { data = IOUtil . readHeaderEntries ( COFFHeaderKey . class , format... |
public class CalendarPeriod { /** * list of periods , false if not */
public boolean IsContained ( String pFrom , String pTo ) { } } | if ( periods == null ) { // echo " IsContained ( ) TO BE IMPLEMENTED FLLKJ : : { { } ' ' < br / > " ;
throw new RuntimeException ( "Error Periods is Null" ) ; } for ( int i = 0 ; i < periods . size ( ) ; i ++ ) { Period period = periods . get ( i ) ; if ( period . getFrom ( ) . compareTo ( pFrom ) > 0 ) return false ; ... |
public class DeviceStatus { /** * Check if current connection is Wi - Fi .
* @ param context Context to use
* @ return true if current connection is Wi - Fi false otherwise */
public static boolean isCurrentConnectionWifi ( Context context ) { } } | ConnectivityManager cm = ( ConnectivityManager ) context . getSystemService ( Context . CONNECTIVITY_SERVICE ) ; if ( cm == null ) { return false ; } NetworkInfo info = cm . getActiveNetworkInfo ( ) ; return info != null && info . getType ( ) == ConnectivityManager . TYPE_WIFI ; |
public class BasicWorkspaceManager { /** * This method checks , if Workspace with a given Id was created before this call
* @ param id
* @ return */
@ Override public boolean checkIfWorkspaceExists ( @ NonNull String id ) { } } | ensureThreadExistense ( ) ; return backingMap . get ( ) . containsKey ( id ) ; |
public class DynamoDbStoreTransaction { /** * Gets the expected value for a particular key and column , if any
* @ param store the store to put the expected key column value
* @ param key the key to get the expected value for
* @ param column the column to get the expected value for
* @ return the expected valu... | // This method assumes the caller has called contains ( . . ) and received a positive response
return expectedValues . get ( store ) . get ( key ) . get ( column ) ; |
public class AppServiceEnvironmentsInner { /** * Get usage metrics for a multi - role pool of an App Service Environment .
* Get usage metrics for a multi - role pool of an App Service Environment .
* ServiceResponse < PageImpl < UsageInner > > * @ param resourceGroupName Name of the resource group to which the res... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Parameter name is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new Ille... |
public class APSPSolver { /** * Batch create intervals ( for many constraints ) */
private boolean cCreate ( Bounds [ ] in , int [ ] from , int [ ] to ) { } } | long [ ] old_d = new long [ in . length ] ; long [ ] old_D = new long [ in . length ] ; boolean [ ] added = new boolean [ in . length ] ; for ( int i = 0 ; i < added . length ; i ++ ) added [ i ] = false ; boolean rollback = false ; int rollBackPoint = - 1 ; for ( int i = 0 ; i < in . length ; i ++ ) { // Conversion
lo... |
public class BookKeeperJournalInputStream { /** * a new stream for a new ledger entry */
private InputStream nextEntryStream ( ) throws IOException { } } | long nextLedgerEntryId = currentStreamState . getNextLedgerEntryId ( ) ; if ( nextLedgerEntryId > maxLedgerEntryIdSeen ) { updateMaxLedgerEntryIdSeen ( ) ; if ( nextLedgerEntryId > maxLedgerEntryIdSeen ) { // Return null if we ' ve reached the end of the ledger : we can not
// read beyond the end of the ledger and it i... |
public class DigitalClockSkin { /** * * * * * * Canvas * * * * * */
private void drawTime ( final ZonedDateTime TIME ) { } } | ctx . clearRect ( 0 , 0 , width , height ) ; // draw the time
if ( clock . isTextVisible ( ) ) { ctx . setFill ( textColor ) ; ctx . setTextBaseline ( VPos . CENTER ) ; ctx . setTextAlign ( TextAlignment . CENTER ) ; if ( Locale . US == clock . getLocale ( ) ) { ctx . setFont ( Fonts . digital ( 0.5 * height ) ) ; ctx ... |
public class ReladomoDeserializer { protected Object invokeStaticMethod ( Class classToInvoke , String methodName ) throws DeserializationException { } } | try { Method method = ReflectionMethodCache . getZeroArgMethod ( classToInvoke , methodName ) ; return method . invoke ( null , NULL_ARGS ) ; } catch ( Exception e ) { throw new DeserializationException ( "Could not invoke method " + methodName + " on class " + classToInvoke , e ) ; } |
public class MutableURI { /** * Get the earliest index , searching for the first occurrance of
* any one of the given delimiters .
* @ param s the string to be indexed
* @ param delims the delimiters used to index
* @ param offset the from index
* @ return the earlier index if there are delimiters */
protecte... | if ( s == null || s . length ( ) == 0 ) { return - 1 ; } if ( delims == null || delims . length ( ) == 0 ) { return - 1 ; } // check boundaries
if ( offset < 0 ) { offset = 0 ; } else if ( offset > s . length ( ) ) { return - 1 ; } // s is never null
int min = s . length ( ) ; char [ ] delim = delims . toCharArray ( ) ... |
public class IterativeDataSet { /** * Registers an { @ link Aggregator } for the iteration . Aggregators can be used to maintain simple statistics during the
* iteration , such as number of elements processed . The aggregators compute global aggregates : After each iteration step ,
* the values are globally aggrega... | this . aggregators . registerAggregator ( name , aggregator ) ; return this ; |
public class LocalTaskScheduler { /** * TODO : detecter si la capacite totale permet de faire passer tout le monde ( et mettre passif dans ce cas ) */
private void updateDStartsInf ( BitSet watchHosts ) throws ContradictionException { } } | for ( int idx = 0 ; idx < vInSize . get ( ) ; idx ++ ) { int i = vIn . quickGet ( idx ) ; if ( ! dStarts [ i ] . isInstantiated ( ) && ! associatedToCSliceOnCurrentNode ( i ) ) { int lastT = - 1 ; for ( int x = sortedMinProfile . length - 1 ; x >= 0 ; x -- ) { int t = sortedMinProfile [ x ] ; if ( t <= dStarts [ i ] . ... |
public class SelectSubPlanAssembler { /** * Given a join node and plan - sub - graph for outer and inner sub - nodes ,
* construct the plan - sub - graph for that node .
* @ param joinNode A parent join node .
* @ param outerPlan The outer node plan - sub - graph .
* @ param innerPlan The inner node plan - sub ... | // Filter ( post - join ) expressions
ArrayList < AbstractExpression > whereClauses = new ArrayList < > ( ) ; whereClauses . addAll ( joinNode . m_whereInnerList ) ; whereClauses . addAll ( joinNode . m_whereInnerOuterList ) ; if ( joinNode . getJoinType ( ) == JoinType . FULL ) { // For all other join types , the wher... |
public class GenericScriptProvider { /** * 加载
* @ throws Exception */
protected final void load ( ) throws Exception { } } | synchronized ( this ) { Set < Class < ? > > classes = classProvider . getLoadedClasses ( ) ; initScriptClasses ( classes ) ; onScriptLoaded ( classes ) ; } |
public class AbstractGeneratedSQLTransform { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . processor . sqlite . transform . AbstractSQLTransform # generateWriteParam2ContentValues ( com . squareup . javapoet . MethodSpec . Builder , com . abubusoft . kripton . processor . sqlite . model . SQLiteMode... | String methodName = method . getParent ( ) . generateJava2ContentSerializer ( paramTypeName ) ; methodBuilder . addCode ( "$L($L)" , methodName , paramName ) ; |
public class TenantService { /** * Validate that the given modifications are allowed ; throw any transgressions found . */
private void validateTenantUpdate ( TenantDefinition oldTenantDef , TenantDefinition newTenantDef ) { } } | Utils . require ( oldTenantDef . getName ( ) . equals ( newTenantDef . getName ( ) ) , "Tenant name cannot be changed: %s" , newTenantDef . getName ( ) ) ; Map < String , Object > oldDBServiceOpts = oldTenantDef . getOptionMap ( "DBService" ) ; String oldDBService = oldDBServiceOpts == null ? null : ( String ) oldDBSer... |
public class CmsCmisTypeManager { /** * Refreshes the internal data if the last update was longer ago than the udpate interval . < p > */
private synchronized void refresh ( ) { } } | try { long now = System . currentTimeMillis ( ) ; if ( ( now - m_lastUpdate ) > UPDATE_INTERVAL ) { setup ( ) ; } } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } |
public class SchemeInformationImpl { /** * { @ inheritDoc } */
@ Override public void setSchemeIdentifier ( String schemeIdentifier ) { } } | XSURI uri = null ; if ( schemeIdentifier != null ) { uri = ( new XSURIBuilder ( ) ) . buildObject ( this . getElementQName ( ) . getNamespaceURI ( ) , SCHEME_IDENTIFIER_LOCAL_NAME , this . getElementQName ( ) . getPrefix ( ) ) ; uri . setValue ( schemeIdentifier ) ; } this . setSchemeIdentifier ( uri ) ; |
public class Interceptor { /** * this method will be invoked after methodToBeInvoked is invoked */
protected Object doInvoke ( Object proxy , Method methodToBeInvoked , Object [ ] args ) throws Throwable { } } | Method m = getRealSubject ( ) . getClass ( ) . getMethod ( methodToBeInvoked . getName ( ) , methodToBeInvoked . getParameterTypes ( ) ) ; return m . invoke ( getRealSubject ( ) , args ) ; |
public class SortWorker { /** * Add a pointer to the key value pair with the provided parameters . */
final void addPointer ( int keyPos , int keySize , int valuePos , int valueSize ) { } } | assert keyPos + keySize == valuePos ; int start = memoryBuffer . limit ( ) - POINTER_SIZE_BYTES ; memoryBuffer . putInt ( start , keyPos ) ; memoryBuffer . putInt ( start + 4 , valuePos ) ; memoryBuffer . putInt ( start + 8 , valueSize ) ; memoryBuffer . limit ( start ) ; valuesHeld ++ ; |
public class CausticUtil { /** * Converts an AWT { @ link java . awt . Color } into a normalized float color .
* @ param color The AWT color to convert
* @ return The color as a 4 float vector */
public static Vector4f fromAWTColor ( Color color ) { } } | return new Vector4f ( color . getRed ( ) / 255f , color . getGreen ( ) / 255f , color . getBlue ( ) / 255f , color . getAlpha ( ) / 255f ) ; |
public class Resource { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } } | if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case ID : return isSetId ( ) ; case LOCATION : return isSetLocation ( ) ; } throw new IllegalStateException ( ) ; |
public class TiffDocument { /** * Gets the ifd count .
* @ return the ifd count */
public int getIfdCount ( ) { } } | int c = 0 ; if ( metadata != null && metadata . contains ( "IFD" ) ) c = getMetadataList ( "IFD" ) . size ( ) ; return c ; |
public class BatchPreparedStatementExecutor { /** * Execute batch .
* @ return execute results
* @ throws SQLException SQL exception */
public int [ ] executeBatch ( ) throws SQLException { } } | final boolean isExceptionThrown = ExecutorExceptionHandler . isExceptionThrown ( ) ; SQLExecuteCallback < int [ ] > callback = new SQLExecuteCallback < int [ ] > ( getDatabaseType ( ) , isExceptionThrown ) { @ Override protected int [ ] executeSQL ( final RouteUnit routeUnit , final Statement statement , final Connecti... |
public class EtcdNettyClient { /** * Connect to server
* @ param etcdRequest to request with
* @ param < R > Type of response
* @ throws IOException if request could not be sent . */
@ SuppressWarnings ( "unchecked" ) protected < R > void connect ( final EtcdRequest < R > etcdRequest ) throws IOException { } } | this . connect ( etcdRequest , etcdRequest . getPromise ( ) . getConnectionState ( ) ) ; |
public class CoronaJobTrackerRunner { /** * Copies the job file to the working directory of the process that will be
* started . */
@ SuppressWarnings ( "deprecation" ) private void localizeTaskConfiguration ( TaskTracker tracker , JobConf ttConf , String workDir , Task t , JobID jobID ) throws IOException { } } | Path jobFile = new Path ( t . getJobFile ( ) ) ; FileSystem systemFS = tracker . systemFS ; this . localizedJobFile = new Path ( workDir , jobID + ".xml" ) ; LOG . info ( "Localizing CJT configuration from " + jobFile + " to " + localizedJobFile ) ; systemFS . copyToLocalFile ( jobFile , localizedJobFile ) ; JobConf lo... |
public class DSLMapParser { /** * src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 119:1 : entry : scope _ section ( meta _ section ) ? key _ section EQUALS ( value _ section ) ? ( EOL | EOF ) - > ^ ( VT _ ENTRY scope _ section ( meta _ section ) ? key _ section ( value _ section ) ? ) ; */
... | DSLMapParser . entry_return retval = new DSLMapParser . entry_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; Token EQUALS7 = null ; Token EOL9 = null ; Token EOF10 = null ; ParserRuleReturnScope scope_section4 = null ; ParserRuleReturnScope meta_section5 = null ; ParserRuleReturnScope key_secti... |
public class AbstractFilter { /** * Adds a log message to be emitted when this AbstractFilter is initialized ( and the Log is made available to it ) .
* @ param logLevel The logLevel of the message to emit .
* @ param message The message to emit . */
protected final void addDelayedLogMessage ( final String logLevel... | this . delayedLogMessages . add ( new DelayedLogMessage ( logLevel , message ) ) ; |
public class FastSet { /** * { @ inheritDoc } */
@ Override public void flip ( int e ) { } } | int wordIndex = wordIndex ( e ) ; expandTo ( wordIndex ) ; int mask = ( 1 << e ) ; words [ wordIndex ] ^= mask ; fixFirstEmptyWord ( ) ; if ( size >= 0 ) { if ( ( words [ wordIndex ] & mask ) == 0 ) { size -- ; } else { size ++ ; } } |
public class Bits { /** * Return the index of the least bit position & ge ; x that is set .
* If none are set , returns - 1 . This provides a nice way to iterate
* over the members of a bit set :
* < pre > { @ code
* for ( int i = bits . nextBit ( 0 ) ; i > = 0 ; i = bits . nextBit ( i + 1 ) ) . . .
* } < / p... | Assert . check ( currentState != BitsState . UNKNOWN ) ; int windex = x >>> wordshift ; if ( windex >= bits . length ) { return - 1 ; } int word = bits [ windex ] & ~ ( ( 1 << ( x & wordmask ) ) - 1 ) ; while ( true ) { if ( word != 0 ) { return ( windex << wordshift ) + trailingZeroBits ( word ) ; } windex ++ ; if ( w... |
public class DriverFactory { /** * Creates new { @ link Driver } .
* < b > This method is protected only for testing < / b > */
protected InternalDriver createDriver ( SecurityPlan securityPlan , SessionFactory sessionFactory , MetricsProvider metricsProvider , Config config ) { } } | return new InternalDriver ( securityPlan , sessionFactory , metricsProvider , config . logging ( ) ) ; |
public class BigDecimalSQLTransform { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . processor . sqlite . transform . AbstractSQLTransform # generateWriteParam2ContentValues ( com . squareup . javapoet . MethodSpec . Builder , com . abubusoft . kripton . processor . sqlite . model . SQLiteModelMethod... | methodBuilder . addCode ( "$L" , paramName ) ; |
public class BusLayerConstants { /** * Replies if the preferred color for bus stops selection .
* @ return Color for selection */
@ Pure public static int getSelectionColor ( ) { } } | final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { final String str = prefs . get ( "SELECTION_COLOR" , null ) ; // $ NON - NLS - 1 $
if ( str != null ) { try { return Integer . valueOf ( str ) ; } catch ( Throwable exception ) { } } } return DEFAULT_SELECT... |
public class WorkspacesApi { /** * Get Workspace File
* Retrieves a workspace file ( the binary ) .
* @ param accountId The external account number ( int ) or account ID Guid . ( required )
* @ param workspaceId Specifies the workspace ID GUID . ( required )
* @ param folderId The ID of the folder being accesse... | getWorkspaceFile ( accountId , workspaceId , folderId , fileId , null ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.