signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class SomeCommandAnnotatedObject { /** * region > changeNameImplicitlyInBackground ( action ) */
@ Action ( semantics = SemanticsOf . IDEMPOTENT , command = CommandReification . ENABLED , commandExecuteIn = CommandExecuteIn . BACKGROUND ) @ ActionLayout ( describedAs = "invoke from UI, will create a command impl... | setName ( newName ) ; return this ; |
public class TextClassifier { /** * It validates the modeler using the provided dataset and it returns the ClassificationMetrics . The testDataset should contain the real target variables .
* @ param testDataset
* @ return */
public ClassificationMetrics validate ( Dataframe testDataset ) { } } | logger . info ( "validate()" ) ; predict ( testDataset ) ; ClassificationMetrics vm = new ClassificationMetrics ( testDataset ) ; return vm ; |
public class LicenseResource { /** * Handle license posts when the server got a request POST < dm _ url > / license & MIME that contains the license .
* @ param license The license to add to Grapes database
* @ return Response An acknowledgment : < br / > - 400 if the artifact is MIME is malformed < br / > - 500 if... | if ( ! credential . getRoles ( ) . contains ( AvailableRoles . DATA_UPDATER ) ) { throw new WebApplicationException ( Response . status ( Response . Status . UNAUTHORIZED ) . build ( ) ) ; } LOG . info ( "Got a post license request." ) ; // Checks if the data is corrupted , pattern can be compiled etc .
DataValidator .... |
public class AnyLabelReadPartition { /** * Checks the given label can be added / removed to / from a vertex .
* @ param label The label to validate .
* @ return < code > true < / code > if the label can be assigned to a vertex , otherwise < code > false < / code > . */
@ Override public boolean validateLabel ( Stri... | Objects . requireNonNull ( label , "label cannot be null" ) ; // check label is in set
return ! labels . contains ( label ) ; |
public class IndexProvider { /** * Validates that if certain default columns are present in the index definition , they have a required type .
* @ param context the execution context in which to perform the validation ; never null
* @ param defn the proposed index definition ; never null
* @ param problems the co... | assert defn != null ; for ( int i = 0 ; i < defn . size ( ) ; i ++ ) { validateDefaultColumnDefinitionType ( context , defn , defn . getColumnDefinition ( i ) , problems ) ; } |
public class TransformXMLInterceptor { /** * Override paint to perform XML to HTML transformation .
* @ param renderContext the renderContext to send the output to . */
@ Override public void paint ( final RenderContext renderContext ) { } } | if ( ! doTransform ) { super . paint ( renderContext ) ; return ; } if ( ! ( renderContext instanceof WebXmlRenderContext ) ) { LOG . warn ( "Unable to transform a " + renderContext ) ; super . paint ( renderContext ) ; return ; } LOG . debug ( "Transform XML Interceptor: Start" ) ; UIContext uic = UIContextHolder . ge... |
public class FormattableDocument { /** * TODO : use org . eclipse . xtext . formatting2 . TextReplacements */
protected String applyTextReplacements ( Iterable < ITextReplacement > replacements ) { } } | ITextSegment region = getRegion ( ) ; String input = region . getText ( ) ; ArrayList < ITextReplacement > list = Lists . newArrayList ( replacements ) ; Collections . sort ( list ) ; int startOffset = region . getOffset ( ) ; int lastOffset = 0 ; StringBuilder result = new StringBuilder ( ) ; for ( ITextReplacement r ... |
public class ConcurrentCompletable { /** * Attempt to add an event listener to the list of listeners .
* This implementation uses a spin - lock , where the loop copies the entire list of listeners .
* @ return { @ code true } if a task has been queued up , { @ code false } otherwise . */
boolean add ( Runnable runn... | int spins = 0 ; RunnablePair entries ; while ( ( entries = callbacks . get ( ) ) != END ) { if ( callbacks . compareAndSet ( entries , new RunnablePair ( runnable , entries ) ) ) { return true ; } if ( spins ++ > MAX_SPINS ) { Thread . yield ( ) ; spins = 0 ; } } return false ; |
public class PoolManager { /** * Remove a job */
public synchronized void removeJob ( JobInProgress job ) { } } | if ( getPool ( getPoolName ( job ) ) . removeJob ( job ) ) { return ; } // Job wasn ' t found in this pool . Search for the job in all the pools
// ( the pool may have been created after the job started ) .
for ( Pool pool : getPools ( ) ) { if ( pool . removeJob ( job ) ) { LOG . info ( "Removed job " + job . jobId + ... |
public class ReverseBuilder { /** * Verifies a matching certificate .
* This method executes any of the validation steps in the PKIX path validation
* algorithm which were not satisfied via filtering out non - compliant
* certificates with certificate matching rules .
* If the last certificate is being verified... | if ( debug != null ) { debug . println ( "ReverseBuilder.verifyCert(SN: " + Debug . toHexString ( cert . getSerialNumber ( ) ) + "\n Subject: " + cert . getSubjectX500Principal ( ) + ")" ) ; } ReverseState currentState = ( ReverseState ) currState ; /* we don ' t perform any validation of the trusted cert */
if ( curr... |
public class WebSockets { /** * Sends a complete pong message using blocking IO
* @ param data The data to send
* @ param wsChannel The web socket channel */
public static void sendPongBlocking ( final ByteBuffer [ ] data , final WebSocketChannel wsChannel ) throws IOException { } } | sendBlockingInternal ( mergeBuffers ( data ) , WebSocketFrameType . PONG , wsChannel ) ; |
public class CalendarPanel { /** * labelIndicatorSetColorsToDefaultState , This event is called to set a label indicator to the
* state it should have when there is no mouse hovering over it . */
private void labelIndicatorSetColorsToDefaultState ( JLabel label ) { } } | if ( label == null || settings == null ) { return ; } if ( label == labelMonth || label == labelYear ) { label . setBackground ( settings . getColor ( DateArea . BackgroundMonthAndYearMenuLabels ) ) ; monthAndYearInnerPanel . setBackground ( settings . getColor ( DateArea . BackgroundMonthAndYearMenuLabels ) ) ; } if (... |
public class GitlabAPI { /** * Creates a group Project
* @ param name The name of the project
* @ param group The group for which the project should be crated
* @ param description The project description
* @ param visibility The project visibility level ( private : 0 , internal : 10 , public : 20)
* @ return... | return createProject ( name , group . getId ( ) , description , null , null , null , null , null , null , visibility , null ) ; |
public class Rational { /** * Compute Pochhammer ' s symbol ( this ) _ n .
* @ param n The number of product terms in the evaluation .
* @ return Gamma ( this + n ) / Gamma ( this ) = this * ( this + 1 ) * . . . * ( this + n - 1 ) . */
public Rational Pochhammer ( final BigInteger n ) { } } | if ( n . compareTo ( BigInteger . ZERO ) < 0 ) { return null ; } else if ( n . compareTo ( BigInteger . ZERO ) == 0 ) { return Rational . ONE ; } else { /* initialize results with the current value */
Rational res = new Rational ( a , b ) ; BigInteger i = BigInteger . ONE ; for ( ; i . compareTo ( n ) < 0 ; i = i . add... |
public class ECKey { /** * Create an encrypted private key with the keyCrypter and the AES key supplied .
* This method returns a new encrypted key and leaves the original unchanged .
* @ param keyCrypter The keyCrypter that specifies exactly how the encrypted bytes are created .
* @ param aesKey The KeyParameter... | checkNotNull ( keyCrypter ) ; final byte [ ] privKeyBytes = getPrivKeyBytes ( ) ; EncryptedData encryptedPrivateKey = keyCrypter . encrypt ( privKeyBytes , aesKey ) ; ECKey result = ECKey . fromEncrypted ( encryptedPrivateKey , keyCrypter , getPubKey ( ) ) ; result . setCreationTimeSeconds ( creationTimeSeconds ) ; ret... |
public class HostCandidateHarvester { /** * Finds available addresses that will be used to gather candidates from .
* @ return A list of collected addresses .
* @ throws HarvestException
* If an error occurs while searching for available addresses */
private List < InetAddress > findAddresses ( ) throws HarvestEx... | // Stores found addresses
List < InetAddress > found = new ArrayList < InetAddress > ( 3 ) ; // Retrieve list of available network interfaces
Enumeration < NetworkInterface > interfaces = getNetworkInterfaces ( ) ; while ( interfaces . hasMoreElements ( ) ) { NetworkInterface iface = interfaces . nextElement ( ) ; // E... |
public class AbstractSpreadSheetDocumentRecordReader { /** * Read truststore for establishing certificate chain for signature validation
* @ param conf
* @ throws IOException
* @ throws FormatNotUnderstoodException */
private void readTrustStore ( Configuration conf ) throws IOException , FormatNotUnderstoodExcep... | if ( ( ( this . hocr . getSigTruststoreFile ( ) != null ) && ( ! "" . equals ( this . hocr . getSigTruststoreFile ( ) ) ) ) ) { LOG . info ( "Reading truststore to validate certificate chain for signatures" ) ; HadoopKeyStoreManager hksm = new HadoopKeyStoreManager ( conf ) ; try { hksm . openKeyStore ( new Path ( this... |
public class WebsocketUtil { /** * generics and Undertow ' s dependence on ParameterizedType */
static public MessageHandler . Whole < String > createTextHandler ( final MessageHandler . Whole proxy ) { } } | return new MessageHandler . Whole < String > ( ) { public void onMessage ( String msg ) { proxy . onMessage ( msg ) ; } } ; |
public class DatabaseAdminClient { /** * Creates a new Cloud Spanner database and starts to prepare it for serving . The returned
* [ long - running operation ] [ google . longrunning . Operation ] will have a name of the format
* ` & lt ; database _ name & gt ; / operations / & lt ; operation _ id & gt ; ` and can... | CreateDatabaseRequest request = CreateDatabaseRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . setCreateStatement ( createStatement ) . build ( ) ; return createDatabaseAsync ( request ) ; |
public class ServletRESTRequestWithParams { /** * ( non - Javadoc )
* @ see com . ibm . wsspi . rest . handler . RESTRequest # getPathVariable ( java . lang . String ) */
@ Override public String getPathVariable ( String variable ) { } } | ServletRESTRequestImpl ret = castRequest ( ) ; if ( ret != null ) return ret . getPathVariable ( variable ) ; return null ; |
public class FileSystemTileCache { /** * Determines whether a File instance refers to a valid cache directory .
* This method checks that { @ code file } refers to a directory to which the current process has read and write
* access . If the directory does not exist , it will be created .
* @ param file The File ... | return ! ( ( file == null ) || ( ! file . exists ( ) && ! file . mkdirs ( ) ) || ! file . isDirectory ( ) || ! file . canRead ( ) || ! file . canWrite ( ) ) ; |
public class Whitebox { /** * Invoke a private or inner class static method without the need to specify
* the method name . This is thus a more refactor friendly version of the
* { @ link # invokeMethod ( Class , String , Object . . . ) } method and is recommend
* over this method for that reason . This method mi... | return WhiteboxImpl . invokeMethod ( klass , arguments ) ; |
public class ChainedIoHandler { /** * Handles the specified < tt > messageReceived < / tt > event with the
* { @ link IoHandlerCommand } or { @ link IoHandlerChain } you specified
* in the constructor . */
@ Override public void messageReceived ( IoSession session , Object message ) throws Exception { } } | chain . execute ( null , session , message ) ; |
public class JsonOutput { /** * Format a date that is parseable from JavaScript , according to ISO - 8601.
* @ param date the date to format to a JSON string
* @ return a formatted date in the form of a string */
public static String toJson ( Date date ) { } } | if ( date == null ) { return NULL_VALUE ; } CharBuf buffer = CharBuf . create ( 26 ) ; writeDate ( date , buffer ) ; return buffer . toString ( ) ; |
public class AbstractCache { /** * Returns number of documents ( if applicable ) the label was observed in .
* @ param word the number of documents the word appeared in
* @ return */
@ Override public int docAppearedIn ( String word ) { } } | T element = extendedVocabulary . get ( word ) ; if ( element != null ) { return ( int ) element . getSequencesCount ( ) ; } else return - 1 ; |
public class CommandLine { /** * Equivalent to { @ code new CommandLine ( command ) . usage ( out ) } . See { @ link # usage ( PrintStream ) } for details .
* @ param command the object annotated with { @ link Command } , { @ link Option } and { @ link Parameters }
* @ param out the print stream to print the help m... | toCommandLine ( command , new DefaultFactory ( ) ) . usage ( out ) ; |
public class CPRulePersistenceImpl { /** * Removes all the cp rules where groupId = & # 63 ; from the database .
* @ param groupId the group ID */
@ Override public void removeByGroupId ( long groupId ) { } } | for ( CPRule cpRule : findByGroupId ( groupId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpRule ) ; } |
public class ComplexNumber { /** * Subtract a complex number .
* @ param z1 Complex Number .
* @ param scalar Scalar value .
* @ return Returns new ComplexNumber instance containing the subtract of specified complex number with a scalar value . */
public static ComplexNumber Subtract ( ComplexNumber z1 , double s... | return new ComplexNumber ( z1 . real - scalar , z1 . imaginary ) ; |
public class InviteAccountToOrganizationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InviteAccountToOrganizationRequest inviteAccountToOrganizationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( inviteAccountToOrganizationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( inviteAccountToOrganizationRequest . getTarget ( ) , TARGET_BINDING ) ; protocolMarshaller . marshall ( inviteAccountToOrganizationRequest . getNotes ... |
public class WhileyFileParser { /** * Parse a skip statement , which is of the form :
* < pre >
* SkipStmt : : = " skip "
* < / pre >
* @ param scope
* The enclosing scope for this statement , which determines the
* set of visible ( i . e . declared ) variables and also the current
* indentation level .
... | int start = index ; // Match the break keyword
match ( Skip ) ; int end = index ; matchEndLine ( ) ; // Done .
return annotateSourceLocation ( new Stmt . Skip ( ) , start , end - 1 ) ; |
public class Parser { /** * syck _ new _ parser */
public static Parser newParser ( ) { } } | Parser p = new Parser ( ) ; p . lvl_capa = YAML . ALLOC_CT ; p . levels = new Level [ p . lvl_capa ] ; p . input_type = ParserInput . YAML_UTF8 ; p . io_type = IOType . Str ; p . io = null ; // p . syms = new HashMap < Integer , Object > ( ) ;
p . anchors = null ; p . bad_anchors = null ; p . prepared_anchors = null ; ... |
public class XmlFileService { /** * Loads and parses the provided XML file . This will quietly fail ( not throwing an { @ link Exception } ) and return
* null if it is unable to parse the provided { @ link XmlFileModel } . A { @ link ClassificationModel } will be created to
* indicate that this file failed to parse... | try { return loadDocument ( event , context , model ) ; } catch ( Exception ex ) { return null ; } |
public class ApiOvhStore { /** * List partner ' s products
* REST : GET / store / partner / { partnerId } / product
* @ param partnerId [ required ] Id of the partner
* API beta */
public ArrayList < OvhEditResponse > partner_partnerId_product_GET ( String partnerId ) throws IOException { } } | String qPath = "/store/partner/{partnerId}/product" ; StringBuilder sb = path ( qPath , partnerId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t5 ) ; |
public class EditManager { /** * Searches for a dlm : edit command which indicates that a node attribute was reset to the value
* in the fragment and if found removes it from the user ' s PLF . */
public static void removeEditDirective ( String elementId , String attributeName , IPerson person ) { } } | removeDirective ( elementId , attributeName , Constants . ELM_EDIT , person ) ; |
public class AbstractCoalescingBufferQueue { /** * Remove the first { @ link ByteBuf } from the queue .
* @ param aggregatePromise used to aggregate the promises and listeners for the returned buffer .
* @ return the first { @ link ByteBuf } from the queue . */
public final ByteBuf removeFirst ( ChannelPromise aggr... | Object entry = bufAndListenerPairs . poll ( ) ; if ( entry == null ) { return null ; } assert entry instanceof ByteBuf ; ByteBuf result = ( ByteBuf ) entry ; decrementReadableBytes ( result . readableBytes ( ) ) ; entry = bufAndListenerPairs . peek ( ) ; if ( entry instanceof ChannelFutureListener ) { aggregatePromise ... |
public class HTTPBatchClientConnectionInterceptor { /** * Returns URI instance which will be used as a connection source
* @ param intuitRequest
* @ return URI
* @ throws FMSException */
private URI extractURI ( RequestElements intuitRequest ) throws FMSException { } } | URI uri = null ; try { uri = new URI ( intuitRequest . getRequestParameters ( ) . get ( RequestElements . REQ_PARAM_RESOURCE_URL ) ) ; } catch ( URISyntaxException e ) { throw new FMSException ( "URISyntaxException" , e ) ; } return uri ; |
public class ContentStoreManagerImpl { /** * { @ inheritDoc } */
public Map < String , ContentStore > getContentStores ( int maxRetries ) throws ContentStoreException { } } | log . debug ( "getContentStores()" ) ; StorageAccountManager acctManager = getStorageAccounts ( ) ; Map < String , StorageAccount > accounts = acctManager . getStorageAccounts ( ) ; Map < String , ContentStore > contentStores = new HashMap < String , ContentStore > ( ) ; Iterator < String > acctIDs = accounts . keySet ... |
public class RtfDestinationFontTable { /** * / * ( non - Javadoc )
* @ see com . lowagie . text . rtf . parser . destinations . RtfDestination # setParser ( com . lowagie . text . rtf . parser . RtfParser )
* @ since 2.0.8 */
public void setParser ( RtfParser parser ) { } } | if ( this . rtfParser != null && this . rtfParser . equals ( parser ) ) return ; this . rtfParser = parser ; this . init ( true ) ; |
public class WordCluster { /** * 将结果保存到文件
* @ param file
* @ throws Exception */
public void saveTxt ( String file ) throws Exception { } } | FileOutputStream fos = new FileOutputStream ( file ) ; BufferedWriter bout = new BufferedWriter ( new OutputStreamWriter ( fos , "UTF8" ) ) ; bout . write ( this . toString ( ) ) ; bout . close ( ) ; |
public class FSPermissionChecker { /** * Check whether current user have permissions to access the path .
* Traverse is always checked .
* Parent path means the parent directory for the path .
* Ancestor path means the last ( the closest ) existing ancestor directory
* of the path .
* Note that if the parent ... | if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "ACCESS CHECK: " + this + ", doCheckOwner=" + doCheckOwner + ", ancestorAccess=" + ancestorAccess + ", parentAccess=" + parentAccess + ", access=" + access + ", subAccess=" + subAccess ) ; } int ancestorIndex = inodes . length - 2 ; for ( ; ancestorIndex >= 0 && inodes [ ... |
public class ContextMatcher { /** * Can be used to setup a different pattern for this context matcher .
* This can be used to speed up subsequent matching with the same global
* options , since the class network informations will be reused .
* @ param pattern */
public void setContextCenter ( Pattern pattern ) { ... | // build up the classgraph printing the relations for all of the
// classes that make up the " center " of this context
this . pattern = pattern ; matched = new ArrayList < ClassDoc > ( ) ; for ( ClassDoc cd : root . classes ( ) ) { if ( pattern . matcher ( cd . toString ( ) ) . matches ( ) ) { matched . add ( cd ) ; a... |
public class MtasDataItemBasic { /** * ( non - Javadoc )
* @ see mtas . codec . util . DataCollector . MtasDataItem # rewrite ( ) */
@ Override public Map < String , Object > rewrite ( boolean showDebugInfo ) throws IOException { } } | Map < String , Object > response = new HashMap < > ( ) ; for ( String statsItem : getStatsItems ( ) ) { if ( statsItem . equals ( CodecUtil . STATS_TYPE_SUM ) ) { response . put ( statsItem , valueSum ) ; } else if ( statsItem . equals ( CodecUtil . STATS_TYPE_N ) ) { response . put ( statsItem , valueN ) ; } else if (... |
public class PostalAddress { /** * < pre >
* Optional . The name of the organization at the address .
* < / pre >
* < code > string organization = 11 ; < / code > */
public java . lang . String getOrganization ( ) { } } | java . lang . Object ref = organization_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; organization_ = s ; return s ; } |
public class CmsPopup { /** * Returns the maximum available height inside the popup . < p >
* @ param fixedContentHeight fixed content height to deduct from the available height
* @ return the maximum available height */
public int getAvailableHeight ( int fixedContentHeight ) { } } | if ( m_buttonPanel . isVisible ( ) ) { fixedContentHeight += m_buttonPanel . getOffsetHeight ( ) ; } return Window . getClientHeight ( ) - 150 - fixedContentHeight ; |
public class CompositeMappingStrategy { /** * Adds a strategy ( at the end of the list ) .
* @ param strategy the strategy to add . */
public void addStrategy ( MappingStrategy strategy ) { } } | if ( strategies == null ) { strategies = new ArrayList < > ( ) ; } strategies . add ( strategy ) ; |
public class AppointmentCalendarItem { /** * Change the ending time of this service . */
public Date setEndDate ( Date time ) { } } | try { this . getTable ( ) . edit ( ) ; this . getField ( "EndDateTime" ) . setData ( time ) ; this . getTable ( ) . set ( this ) ; this . getTable ( ) . seek ( null ) ; // Read this record
} catch ( Exception ex ) { ex . printStackTrace ( ) ; } return this . getEndDate ( ) ; |
public class CmsObject { /** * Returns a list of child resources to the given resource that can not be locked by the current user . < p >
* @ param resource the resource
* @ return a list of child resources to the given resource that can not be locked by the current user
* @ throws CmsException if something goes ... | if ( resource . isFolder ( ) ) { CmsLockFilter blockingFilter = CmsLockFilter . FILTER_ALL ; blockingFilter = blockingFilter . filterNotLockableByUser ( getRequestContext ( ) . getCurrentUser ( ) ) ; return getLockedResources ( resource , blockingFilter ) ; } return Collections . < CmsResource > emptyList ( ) ; |
public class ModifyBeanHelper { /** * Builds the javadoc .
* @ param methodBuilder
* the method builder
* @ param updateMode
* the update mode
* @ param method
* the method
* @ param beanNameParameter
* the bean name parameter
* @ param whereCondition
* the where condition
* @ param listUsedProper... | // SQLDaoDefinition daoDefinition = method . getParent ( ) ;
// SQLEntity entity = daoDefinition . getEntity ( ) ;
// in this case , only one parameter can exists for method
Pair < String , TypeName > beanParameter = method . getParameters ( ) . get ( 0 ) ; String sqlResult ; // generate javadoc
StringBuilder buffer = ... |
public class TcasesOpenApi { /** * Returns a { @ link SystemInputDef system input definition } for the API requests defined by the given
* OpenAPI specification . Returns null if the given spec defines no API requests to model . */
public static SystemInputDef getRequestInputModel ( OpenAPI api , ModelOptions options... | RequestInputModeller inputModeller = new RequestInputModeller ( options ) ; return inputModeller . getRequestInputModel ( api ) ; |
public class IntentIntegrator { /** * Shares the given text by encoding it as a barcode , such that another user can
* scan the text off the screen of the device .
* @ param text the text string to encode as a barcode
* @ param type type of data to encode . See { @ code com . google . zxing . client . android . C... | Intent intent = new Intent ( ) ; intent . addCategory ( Intent . CATEGORY_DEFAULT ) ; intent . setAction ( BS_PACKAGE + ".ENCODE" ) ; intent . putExtra ( "ENCODE_TYPE" , type ) ; intent . putExtra ( "ENCODE_DATA" , text ) ; String targetAppPackage = findTargetAppPackage ( intent ) ; if ( targetAppPackage == null ) { re... |
public class lbmetrictable { /** * Use this API to fetch lbmetrictable resource of given name . */
public static lbmetrictable get ( nitro_service service , String metrictable ) throws Exception { } } | lbmetrictable obj = new lbmetrictable ( ) ; obj . set_metrictable ( metrictable ) ; lbmetrictable response = ( lbmetrictable ) obj . get_resource ( service ) ; return response ; |
public class CmsFlexCacheEntry { /** * Completes this cache entry . < p >
* A completed cache entry is made " unmodifiable " ,
* so that no further data can be added and existing data can not be changed . < p >
* This is to prevent the ( unlikely ) case that some user - written class
* tries to make changes to ... | m_completed = true ; // Prevent changing of the cached lists
if ( m_headers != null ) { m_headers = Collections . unmodifiableMap ( m_headers ) ; } if ( m_elements != null ) { m_elements = Collections . unmodifiableList ( m_elements ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ... |
public class AwsSecurityFindingFilters { /** * This is the identifier for the solution - specific component ( a discrete unit of logic ) that generated a finding .
* In various security findings provider ' s solutions , this generator can be called a rule , a check , a detector , a
* plug - in , etc .
* @ param g... | if ( generatorId == null ) { this . generatorId = null ; return ; } this . generatorId = new java . util . ArrayList < StringFilter > ( generatorId ) ; |
public class IfcPolygonalFaceSetImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcIndexedPolygonalFace > getFaces ( ) { } } | return ( EList < IfcIndexedPolygonalFace > ) eGet ( Ifc4Package . Literals . IFC_POLYGONAL_FACE_SET__FACES , true ) ; |
public class Storer { /** * Loads regression data . */
public final Set < RegData > load ( String dirName , String className , String methodName ) { } } | String fullName = className + '.' + methodName ; return load ( openFileRead ( dirName , fullName , className , methodName ) ) ; |
public class SessionImpl { /** * { @ inheritDoc } */
public void logout ( ) { } } | for ( int i = 0 , length = lifecycleListeners . size ( ) ; i < length ; i ++ ) { lifecycleListeners . get ( i ) . onCloseSession ( this ) ; } this . sessionRegistry . unregisterSession ( getId ( ) ) ; this . live = false ; if ( ! ALLOW_CLOSED_SESSION_USAGE && PropertyManager . isDevelopping ( ) ) { this . closedByCallS... |
public class Main { /** * Java function to compute the sum of the cubes of first num odd natural numbers . */
public static int sumOfOddCubes ( int num ) { } public static void main ( String [ ] args ) { System . out . println ( sumOfOddCubes ( 2 ) ) ; // Output : 28
System . out . println ( sumOfOddCubes ( 3 ) ) ; // ... | int total = 0 ; for ( int index = 0 ; index < num ; index ++ ) { total += Math . pow ( ( 2 * index + 1 ) , 3 ) ; } return total ; |
public class TypeMetadata { /** * Return a copy of this TypeMetadata with the metadata entry for { @ code elem . kind ( ) } combined
* with { @ code elem } .
* @ param elem the new value
* @ return a new TypeMetadata updated with { @ code Entry elem } */
public TypeMetadata combine ( Entry elem ) { } } | Assert . checkNonNull ( elem ) ; TypeMetadata out = new TypeMetadata ( this ) ; Entry . Kind key = elem . kind ( ) ; if ( contents . containsKey ( key ) ) { out . add ( key , this . contents . get ( key ) . combine ( elem ) ) ; } else { out . add ( key , elem ) ; } return out ; |
public class DelegateView { /** * Gets the name of delegate
* @ return the name . It may not be a name of a Class ! */
public String getDelegateName ( ) { } } | javax . swing . text . Element data = getElement ( ) ; if ( data instanceof DelegateElement ) { return ( ( DelegateElement ) data ) . getDelegateName ( ) ; } return null ; |
public class WSJobRepositoryImpl { /** * { @ inheritDoc } */
@ Override public WSJobExecution getMostRecentJobExecutionFromInstance ( long instanceId ) throws NoSuchJobInstanceException , JobSecurityException { } } | return persistenceManagerService . getJobExecutionMostRecent ( authorizedInstanceRead ( instanceId ) ) ; |
public class SoyNodeCompiler { /** * Given this delcall : { @ code { delcall foo . bar variant = " $ expr " allowemptydefault = " true " } }
* < p > Generate code that looks like :
* < pre > { @ code
* renderContext . getDeltemplate ( " foo . bar " , < variant - expression > , true )
* . create ( < prepareParam... | Label reattachPoint = new Label ( ) ; Expression variantExpr ; if ( node . getDelCalleeVariantExpr ( ) == null ) { variantExpr = constant ( "" ) ; } else { variantExpr = exprCompiler . compile ( node . getDelCalleeVariantExpr ( ) , reattachPoint ) . coerceToString ( ) ; } Expression calleeExpression = parameterLookup .... |
public class SnapshotUtil { /** * Do parameter checking for the pre - JSON version of @ SnapshotRestore old version */
public static ClientResponseImpl transformRestoreParamsToJSON ( StoredProcedureInvocation task ) { } } | Object params [ ] = task . getParams ( ) . toArray ( ) ; if ( params . length == 1 ) { try { JSONObject jsObj = new JSONObject ( ( String ) params [ 0 ] ) ; String path = jsObj . optString ( JSON_PATH ) ; String dupPath = jsObj . optString ( JSON_DUPLICATES_PATH ) ; if ( ! path . isEmpty ( ) && dupPath . isEmpty ( ) ) ... |
public class TypeaheadDataset { /** * The key used to access the value of the datum in the datum object . Defaults
* to < code > value < / code > .
* @ param sValueKey
* The name of the value key in the typeahead datum . May neither be
* < code > null < / code > nor empty .
* @ return this */
@ Nonnull public... | ValueEnforcer . notEmpty ( sValueKey , "ValueKey" ) ; m_sValueKey = sValueKey ; return this ; |
public class ExpressionParameterTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case BpsimPackage . EXPRESSION_PARAMETER_TYPE__VALUE : setValue ( VALUE_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class PrcEntityFSave { /** * < p > Process entity request . < / p >
* @ param pAddParam additional param , e . g . return this line ' s
* document in " nextEntity " for farther process
* @ param pRequestData Request Data
* @ param pEntity Entity to process
* @ return Entity processed for farther proces... | String fileToUploadName = ( String ) pRequestData . getAttribute ( "fileToUploadName" ) ; String fieldNameFilePath = pRequestData . getParameter ( "fieldNameFilePath" ) ; String fieldNameFileName = pRequestData . getParameter ( "fieldNameFileName" ) ; if ( fieldNameFileName != null ) { Method setterFileName = this . se... |
public class HostStorageSystem { /** * SDK4.0 signature */
public void updateInternetScsiAuthenticationProperties ( String iScsiHbaDevice , HostInternetScsiHbaAuthenticationProperties authenticationProperties , HostInternetScsiHbaTargetSet targetSet ) throws HostConfigFault , NotFound , RuntimeFault , RemoteException {... | getVimService ( ) . updateInternetScsiAuthenticationProperties ( getMOR ( ) , iScsiHbaDevice , authenticationProperties , targetSet ) ; |
public class JSPostProcessorChainFactory { /** * ( non - Javadoc )
* @ see net . jawr . web . resource . bundle . factory . postprocessor .
* AbstractPostProcessorChainFactory # getCustomProcessorWrapper ( net . jawr . web .
* resource . bundle . postprocess . ResourceBundlePostProcessor ,
* java . lang . Strin... | return new CustomJsPostProcessorChainWrapper ( key , customProcessor , isVariantPostProcessor ) ; |
public class HeatChart { /** * Draws the x - axis label string if it is not null . */
private void drawXLabel ( Graphics2D chartGraphics ) { } } | if ( xAxisLabel != null ) { // Strings are drawn from the baseline position of the leftmost char .
int yPosXAxisLabel = chartSize . height - ( margin / 2 ) - xAxisLabelDescent ; // TODO This will need to be updated if the y - axis values / label can be moved to the right .
int xPosXAxisLabel = heatMapC . x - ( xAxisLab... |
public class ExternalContextAccessSkill { /** * Replies the InternalEventBusCapacity skill as fast as possible .
* @ return the skill */
protected final InternalEventBusCapacity getInternalEventBusCapacitySkill ( ) { } } | if ( this . skillBufferInternalEventBusCapacity == null || this . skillBufferInternalEventBusCapacity . get ( ) == null ) { this . skillBufferInternalEventBusCapacity = $getSkill ( InternalEventBusCapacity . class ) ; } return $castSkill ( InternalEventBusCapacity . class , this . skillBufferInternalEventBusCapacity ) ... |
public class JaxWsHttpServletRequestAdapter { /** * ( non - Javadoc )
* @ see javax . servlet . http . HttpServletRequest # getContextPath ( ) */
@ Override public String getContextPath ( ) { } } | try { collaborator . preInvoke ( componentMetaData ) ; return request . getContextPath ( ) ; } finally { collaborator . postInvoke ( ) ; } |
public class GrailsDomainBinder { /** * Binds a simple value to the Hibernate metamodel . A simple value is
* any type within the Hibernate type system
* @ param property
* @ param parentProperty
* @ param simpleValue The simple value to bind
* @ param path
* @ param mappings The Hibernate mappings instance... | // set type
bindSimpleValue ( property , parentProperty , simpleValue , path , getPropertyConfig ( property ) , sessionFactoryBeanName ) ; |
public class Range { /** * Obtains a range using the specified element as both the minimum and maximum in this range .
* The range uses the natural ordering of the elements to determine where values lie in the range .
* @ param < T >
* the type of the elements in this range
* @ param element
* the value to us... | return closed ( element , element ) ; |
public class PrefHelper { /** * < p > Singleton method to return the pre - initialised , or newly initialise and return , a singleton
* object of the type { @ link PrefHelper } . < / p >
* @ param context The { @ link Context } within which the object should be instantiated ; this
* parameter is passed to the pri... | if ( prefHelper_ == null ) { prefHelper_ = new PrefHelper ( context ) ; } return prefHelper_ ; |
public class AWSGlueClient { /** * Retrieves the definitions of some or all of the tables in a given < code > Database < / code > .
* @ param getTablesRequest
* @ return Result of the GetTables operation returned by the service .
* @ throws EntityNotFoundException
* A specified entity does not exist
* @ throw... | request = beforeClientExecution ( request ) ; return executeGetTables ( request ) ; |
public class ModelMapper { /** * Maps { @ code source } to { @ code destination } . Mapping is performed according to the corresponding
* TypeMap for the { @ code typeMapName } . If no TypeMap exists for the { @ code source . getClass ( ) } ,
* { @ code destination . getClass ( ) } and { @ code typeMapName } then o... | Assert . notNull ( source , "source" ) ; Assert . notNull ( destination , "destination" ) ; Assert . notNull ( typeMapName , "typeMapName" ) ; mapInternal ( source , destination , null , typeMapName ) ; |
public class QueryWhere { /** * group management */
public void newGroup ( ) { } } | // create parent
QueryCriteria newCriteriaGroupParent = new QueryCriteria ( this . union ) ; addCriteria ( newCriteriaGroupParent ) ; // add parent to parent stack
ancestry . push ( currentParent ) ; currentParent = newCriteriaGroupParent ; // set group criteria list to new list
currentCriteria = newCriteriaGroupParent... |
public class AsyncCircuitBreaker { /** * Wrap the given service call with the { @ link AsyncCircuitBreaker } protection logic .
* @ param callable the { @ link java . util . concurrent . Callable } to attempt
* @ param < T > The result of a future call
* @ return { @ link ListenableFuture } of whatever callable w... | final SettableListenableFuture < T > response = new SettableListenableFuture < T > ( ) ; ListenableFutureCallback < T > callback = new ListenableFutureCallback < T > ( ) { @ Override public void onSuccess ( T result ) { close ( ) ; response . set ( result ) ; } @ Override public void onFailure ( Throwable ex ) { try { ... |
public class SslContext { /** * Creates a new server - side { @ link SslContext } .
* @ param certChainFile an X . 509 certificate chain file in PEM format
* @ param keyFile a PKCS # 8 private key file in PEM format
* @ return a new server - side { @ link SslContext }
* @ deprecated Replaced by { @ link SslCont... | return newServerContext ( certChainFile , keyFile , null ) ; |
public class PredictionsImpl { /** * Gets predictions for a given utterance , in the form of intents and entities . The current maximum query size is 500 characters .
* @ param appId The LUIS application ID ( Guid ) .
* @ param query The utterance to predict .
* @ param timezoneOffset The timezone offset for the ... | if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( query == null ) { throw new IllegalArgument... |
public class AllTimeReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return AllTime ResourceSet */
@ Override public ResourceSet < AllTime > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class Consumers { /** * Yields element at ( 0 - based ) position of the iterable if found or nothing .
* @ param < E > the iterable element type
* @ param index the element index
* @ param iterable the iterable that will be consumed
* @ return just the element or nothing */
public static < E > Optional <... | dbc . precondition ( iterable != null , "cannot call maybeAt with a null iterable" ) ; final Iterator < E > filtered = new FilteringIterator < E > ( iterable . iterator ( ) , new AtIndex < E > ( index ) ) ; return new MaybeFirstElement < E > ( ) . apply ( filtered ) ; |
public class TracerFactory { /** * Reads the given configuration file , validates it against a XML - Schema and creates the tracer pool , its mappings and the queue accordingly .
* This method should normally be invoked once at program start . Multiple calls with the same configuration file leads to instantiations of... | if ( ! configFile . exists ( ) ) throw new FileNotFoundException ( configFile + "doesn't exist." ) ; try ( FileInputStream fileInputStream = new FileInputStream ( configFile ) ) { readConfiguration ( fileInputStream ) ; } catch ( IOException ex ) { ex . printStackTrace ( System . err ) ; } |
public class ClientNetworkConfig { /** * required for spring module */
public ClientNetworkConfig setAddresses ( List < String > addresses ) { } } | isNotNull ( addresses , "addresses" ) ; addressList . clear ( ) ; addressList . addAll ( addresses ) ; return this ; |
public class NokiaStoreHelper { /** * Initiate the UI flow for an in - app purchase . Call this method to initiate an in - app purchase ,
* which will involve bringing up the Nokia Store screen . The calling activity will be paused while
* the user interacts with Nokia Store , and the result will be delivered via t... | Logger . i ( "NokiaStoreHelper.launchPurchaseFlow" ) ; if ( itemType . equals ( IabHelper . ITEM_TYPE_SUBS ) ) { final IabResult result = new IabResult ( IabHelper . IABHELPER_SUBSCRIPTIONS_NOT_AVAILABLE , "Subscriptions are not available." ) ; if ( listener != null ) { listener . onIabPurchaseFinished ( result , null ... |
public class AjaxBehavior { /** * < p class = " changed _ added _ 2_0 " > Sets the { @ link ValueExpression }
* used to calculate the value for the specified property name . < / p >
* @ param name Name of the property for which to set a
* { @ link ValueExpression }
* @ param binding The { @ link ValueExpression... | if ( name == null ) { throw new NullPointerException ( ) ; } if ( binding != null ) { if ( binding . isLiteralText ( ) ) { setLiteralValue ( name , binding ) ; } else { if ( bindings == null ) { // We use a very small initial capacity on this HashMap .
// The goal is not to reduce collisions , but to keep the
// memory... |
public class CommercePriceListAccountRelLocalServiceWrapper { /** * Returns the commerce price list account rel matching the UUID and group .
* @ param uuid the commerce price list account rel ' s UUID
* @ param groupId the primary key of the group
* @ return the matching commerce price list account rel , or < co... | return _commercePriceListAccountRelLocalService . fetchCommercePriceListAccountRelByUuidAndGroupId ( uuid , groupId ) ; |
public class JSONResource { /** * Execute the given path query on the json and GET the returned URI expecting text / *
* @ param path path to the URI to follow
* @ return a new resource , as a result of getting it from the server in JSON format
* @ throws Exception */
public XMLResource xml ( JSONPathQuery path )... | Object jsonValue = path . eval ( this ) ; return xml ( jsonValue . toString ( ) ) ; |
public class RecordMessageFilter { /** * Get the name / value pairs in an ordered tree .
* Note : Replace this with a DOM tree when it is available in the basic SDK .
* @ return A matrix with the name , type , etc . */
public Object [ ] [ ] createNameValueTree ( Object mxString [ ] [ ] , Map < String , Object > pro... | mxString = super . createNameValueTree ( mxString , properties ) ; if ( properties != null ) mxString = this . addNameValue ( mxString , BOOKMARK , properties . get ( BOOKMARK ) ) ; return mxString ; |
public class RslAttributes { /** * Adds a simple value to the list of values of a given
* attribute .
* @ param attribute the attribute to add the value to .
* @ param value the value to add . */
public void add ( String attribute , String value ) { } } | NameOpValue nv = getRelation ( attribute ) ; nv . add ( new Value ( value ) ) ; |
public class DescriptorFactory { /** * Create a class descriptor from a resource name .
* @ param resourceName
* the resource name
* @ return the class descriptor */
public static ClassDescriptor createClassDescriptorFromResourceName ( String resourceName ) { } } | if ( ! isClassResource ( resourceName ) ) { throw new IllegalArgumentException ( "Resource " + resourceName + " is not a class" ) ; } return createClassDescriptor ( resourceName . substring ( 0 , resourceName . length ( ) - 6 ) ) ; |
public class NodeUtil { /** * Creates a new node representing an * existing * name , copying over the source
* location information from the basis node .
* @ param name The name for the new NAME node .
* @ param srcref The node that represents the name as currently found in
* the AST .
* @ return The node cre... | return newName ( compiler , name ) . srcref ( srcref ) ; |
public class DependencyEmbedder { /** * Generates the new set of instruction containing the original set of instructions enhanced with the embed
* dependencies results .
* @ param instructions the current set of instructions
* @ param dependencies the project ' s dependencies
* @ return the final set of instruc... | Properties result = new Properties ( ) ; result . putAll ( instructions ) ; StringBuilder include = new StringBuilder ( ) ; if ( instructions . getProperty ( Constants . INCLUDE_RESOURCE ) != null ) { include . append ( instructions . getProperty ( Constants . INCLUDE_RESOURCE ) ) ; } StringBuilder classpath = new Stri... |
public class HttpClient { /** * Posts data to stackify
* @ param path REST path
* @ param jsonBytes JSON bytes
* @ return Response string
* @ throws IOException
* @ throws HttpException */
public String post ( final String path , final byte [ ] jsonBytes ) throws IOException , HttpException { } } | return post ( path , jsonBytes , false ) ; |
public class DayCountConventionFactory { /** * Return the number of days between startDate and endDate given the
* specific daycount convention .
* @ param startDate The start date given as a { @ link org . threeten . bp . LocalDate } .
* @ param endDate The end date given as a { @ link org . threeten . bp . Loca... | DayCountConventionInterface daycountConvention = getDayCountConvention ( convention ) ; return daycountConvention . getDaycount ( startDate , endDate ) ; |
public class JBitMaskField { /** * Get the value ( On , Off or Null ) .
* @ return The raw data ( a Short object ) . */
public Object getControlValue ( ) { } } | short iFieldValue = 0 ; for ( int iBitNumber = 0 ; iBitNumber < this . getComponentCount ( ) ; iBitNumber ++ ) { JCheckBox checkBox = ( JCheckBox ) this . getComponent ( iBitNumber ) ; boolean bState = checkBox . isSelected ( ) ; if ( ! m_bCheckedIsOn ) bState = ! bState ; // Do opposite operation
if ( bState ) iFieldV... |
public class JsonCodec { /** * Creates a new JSON codec instance for objects of the specified class and the specified Gson
* instance . You can use this method if you need to customize the behavior of the Gson
* serializer .
* @ param clazz the class of the objects the created codec is for .
* @ param gson the ... | return new JsonCodec < T > ( clazz , gson ) ; |
public class ConsumerSessionProxy { /** * Actually performs the async register . Registration is mainly left up
* to the proxy queues . They will also deal with the situation where we
* register a different callback .
* @ param callback
* @ param maxActiveMessages
* @ param messageLockExpiry
* @ param maxBa... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_registerAsynchConsumerCallback" , new Object [ ] { callback , maxActiveMessages , messageLockExpiry , maxBatchSize , orderContext , maxSequentialFailures , hiddenMessageDelay , stoppable } ) ; boolean completed = fa... |
public class MaterialDatePicker { /** * Set the minimum date limit . */
public void setDateMin ( Date dateMin ) { } } | this . dateMin = dateMin ; if ( isAttached ( ) && dateMin != null ) { getPicker ( ) . set ( "min" , JsDate . create ( ( double ) dateMin . getTime ( ) ) ) ; } |
public class UpdatePhoneNumberRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdatePhoneNumberRequest updatePhoneNumberRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updatePhoneNumberRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updatePhoneNumberRequest . getPhoneNumberId ( ) , PHONENUMBERID_BINDING ) ; protocolMarshaller . marshall ( updatePhoneNumberRequest . getProductType ( ) , PROD... |
public class Line { /** * Get the closest point on the line to a given point
* @ param point
* The point which we want to project
* @ param result
* The point on the line closest to the given point */
public void getClosestPoint ( Vector2f point , Vector2f result ) { } } | loc . set ( point ) ; loc . sub ( start ) ; float projDistance = vec . dot ( loc ) ; projDistance /= vec . lengthSquared ( ) ; if ( projDistance < 0 ) { result . set ( start ) ; return ; } if ( projDistance > 1 ) { result . set ( end ) ; return ; } result . x = start . getX ( ) + projDistance * vec . getX ( ) ; result ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.