signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Contents { /** * Save session ' s changes . */
public void save ( ) { } } | SC . ask ( "Do you want to save changes" , new BooleanCallback ( ) { @ Override public void execute ( Boolean yesSelected ) { if ( yesSelected ) { jcrService ( ) . save ( repository ( ) , workspace ( ) , new BaseCallback < Object > ( ) { @ Override public void onSuccess ( Object result ) { session ( ) . setHasChanges (... |
public class WorkflowTriggersInner { /** * Resets a workflow trigger .
* @ param resourceGroupName The resource group name .
* @ param workflowName The workflow name .
* @ param triggerName The workflow trigger name .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the ... | return resetWithServiceResponseAsync ( resourceGroupName , workflowName , triggerName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class JvmExecutableImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EList < JvmFormalParameter > getParameters ( ) { } } | if ( parameters == null ) { parameters = new EObjectContainmentEList < JvmFormalParameter > ( JvmFormalParameter . class , this , TypesPackage . JVM_EXECUTABLE__PARAMETERS ) ; } return parameters ; |
public class JsDocTokenStream { /** * Gets the remaining JSDoc line without the { @ link JsDocToken # EOL } ,
* { @ link JsDocToken # EOF } or { @ link JsDocToken # EOC } . */
@ SuppressWarnings ( "fallthrough" ) String getRemainingJSDocLine ( ) { } } | int c ; for ( ; ; ) { c = getChar ( ) ; switch ( c ) { case '*' : if ( peekChar ( ) != '/' ) { addToString ( c ) ; break ; } // fall through
case EOF_CHAR : case '\n' : ungetChar ( c ) ; this . string = getStringFromBuffer ( ) ; stringBufferTop = 0 ; return this . string ; default : addToString ( c ) ; break ; } } |
public class StructurizrDocumentationTemplate { /** * Adds a " Data " section relating to a { @ link SoftwareSystem } .
* @ param softwareSystem the { @ link SoftwareSystem } the documentation content relates to
* @ param format the { @ link Format } of the documentation content
* @ param content a String contain... | return addSection ( softwareSystem , "Data" , format , content ) ; |
public class ESRIFileUtil { /** * Translate a floating point value into ESRI standard .
* < p > This function translate the Java NaN and infinites values
* into the ESRI equivalent value .
* @ param value the value .
* @ return the ESRI value */
@ Pure public static double toESRI ( float value ) { } } | return ( Float . isInfinite ( value ) || Float . isNaN ( value ) ) ? ESRI_NAN : value ; |
public class Utils { /** * Check that the value we have discovered is of the right type . It may not be if the field has changed type during
* a reload . When this happens we will default the value for the new field and forget the one we were holding onto .
* note : array forms are not compatible ( e . g . int [ ] ... | if ( GlobalConfiguration . assertsMode ) { Utils . assertTrue ( result != null , "result should never be null" ) ; } String actualType = result . getClass ( ) . getName ( ) ; if ( expectedTypeDescriptor . length ( ) == 1 && Utils . isObjectIsUnboxableTo ( result . getClass ( ) , expectedTypeDescriptor . charAt ( 0 ) ) ... |
public class SvnWorkspaceProviderImpl { /** * Returns a File object whose path is the expected user directory .
* Does not create or check for existence .
* @ param prefix
* @ param suffix
* @ param parent
* @ return */
private static File getUserDirectory ( final String prefix , final String suffix , final F... | final String dirname = formatDirName ( prefix , suffix ) ; return new File ( parent , dirname ) ; |
public class AbstractApplication { /** * Print the description for the given parameter */
private static void printDescription ( Class < ? > descriptionClass ) { } } | if ( descriptionClass == null ) { return ; } try { LoggingConfiguration . setVerbose ( Level . VERBOSE ) ; LOG . verbose ( OptionUtil . describeParameterizable ( new StringBuilder ( ) , descriptionClass , FormatUtil . getConsoleWidth ( ) , "" ) . toString ( ) ) ; } catch ( Exception e ) { LOG . exception ( "Error insta... |
public class TimephasedUtility { /** * This is the main entry point used to convert the internal representation
* of timephased baseline work into an external form which can
* be displayed to the user .
* @ param file parent project file
* @ param work timephased resource assignment data
* @ param rangeUnits ... | return segmentWork ( file . getBaselineCalendar ( ) , work , rangeUnits , dateList ) ; |
public class Util { /** * normalize probabilities and check convergence by the maximum probability
* @ return maximum of probabilities */
public static double normalizeProb ( double [ ] prob ) { } } | double maxp = 0 , sump = 0 ; for ( int i = 0 ; i < prob . length ; ++ i ) sump += prob [ i ] ; for ( int i = 0 ; i < prob . length ; ++ i ) { double p = prob [ i ] / sump ; if ( maxp < p ) maxp = p ; prob [ i ] = p ; } return maxp ; |
public class HttpInputStream { /** * Resets the input stream for a new connection . */
public void resets ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . logp ( Level . FINE , CLASS_NAME , "resets" , "resets" ) ; } this . in = null ; |
public class DirectQuickSelectSketch { /** * UpdateSketch */
@ Override public UpdateSketch rebuild ( ) { } } | final int lgNomLongs = getLgNomLongs ( ) ; final int preambleLongs = mem_ . getByte ( PREAMBLE_LONGS_BYTE ) & 0X3F ; if ( getRetainedEntries ( true ) > ( 1 << lgNomLongs ) ) { quickSelectAndRebuild ( mem_ , preambleLongs , lgNomLongs ) ; } return this ; |
public class CmsMessageBundleEditorModel { /** * Rename a key for all languages .
* @ param oldKey the key to rename
* @ param newKey the new key name
* @ return < code > true < / code > if renaming was successful , < code > false < / code > otherwise . */
private boolean renameKeyForAllLanguages ( String oldKey ... | try { loadAllRemainingLocalizations ( ) ; lockAllLocalizations ( oldKey ) ; if ( hasDescriptor ( ) ) { lockDescriptor ( ) ; } } catch ( CmsException | IOException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; return false ; } for ( Entry < Locale , SortedProperties > entry : m_localizations . entrySet ( ) ) {... |
public class FilteringDependencyTransitiveNodeVisitor { /** * { @ inheritDoc } */
@ Override public boolean visit ( DependencyNode node ) { } } | final boolean visit ; if ( filter . accept ( node ) ) { visit = visitor . visit ( node ) ; } else { visit = false ; } return visit ; |
public class ZooKeeperClient { /** * Removes an existing node .
* @ param path
* @ param removeChildren
* { @ code true } to indicate that child nodes should be removed
* too
* @ return { @ code true } if node has been removed successfully , { @ code false }
* otherwise ( maybe node is not empty )
* @ sin... | try { if ( removeChildren ) { curatorFramework . delete ( ) . deletingChildrenIfNeeded ( ) . forPath ( path ) ; } else { curatorFramework . delete ( ) . forPath ( path ) ; } } catch ( KeeperException . NotEmptyException e ) { return false ; } catch ( KeeperException . NoNodeException e ) { return true ; } catch ( Excep... |
public class InstancesController { /** * Get a single instance .
* @ param id The application identifier .
* @ return The registered application . */
@ GetMapping ( path = "/instances/{id}" , produces = MediaType . APPLICATION_JSON_VALUE ) public Mono < ResponseEntity < Instance > > instance ( @ PathVariable String... | LOGGER . debug ( "Deliver registered instance with ID '{}'" , id ) ; return registry . getInstance ( InstanceId . of ( id ) ) . filter ( Instance :: isRegistered ) . map ( ResponseEntity :: ok ) . defaultIfEmpty ( ResponseEntity . notFound ( ) . build ( ) ) ; |
public class HibernateDocumentDao { /** * { @ inheritDoc } */
public Reference get ( Reference reference ) { } } | final Criteria crit = sessionService . getSession ( ) . createCriteria ( Reference . class ) ; if ( StringUtil . isEmpty ( reference . getSections ( ) ) ) { crit . add ( Restrictions . isNull ( "sections" ) ) ; } else { crit . add ( Restrictions . eq ( "sections" , reference . getSections ( ) ) ) ; } crit . createAlias... |
public class XImportDeclarationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case XtypePackage . XIMPORT_DECLARATION__WILDCARD : setWildcard ( WILDCARD_EDEFAULT ) ; return ; case XtypePackage . XIMPORT_DECLARATION__EXTENSION : setExtension ( EXTENSION_EDEFAULT ) ; return ; case XtypePackage . XIMPORT_DECLARATION__STATIC : setStatic ( STATIC_EDEFAULT ) ; return ; case Xtyp... |
public class AnnotationManager { /** * Create an annotation on the map
* @ param options the annotation options defining the annotation to build
* @ return the build annotation */
@ UiThread public T create ( S options ) { } } | T t = options . build ( currentId , this ) ; annotations . put ( t . getId ( ) , t ) ; currentId ++ ; updateSource ( ) ; return t ; |
public class RoadPath { /** * Replies if the road segment of < var > path < / var > ( the first or the last in this order )
* that could be connected to the last point of the current path .
* @ param path is the path from which a road segment should be read .
* @ return the connectable segment from the < var > pa... | assert path != null ; if ( path . isEmpty ( ) ) { return null ; } RoadConnection last1 = getLastPoint ( ) ; RoadConnection first2 = path . getFirstPoint ( ) ; RoadConnection last2 = path . getLastPoint ( ) ; last1 = last1 . getWrappedRoadConnection ( ) ; first2 = first2 . getWrappedRoadConnection ( ) ; last2 = last2 . ... |
public class ForeignSegmentDocId { /** * { @ inheritDoc } */
int [ ] getDocumentNumbers ( MultiIndexReader reader , int [ ] docNumbers ) throws IOException { } } | int doc = reader . getDocumentNumber ( this ) ; if ( doc == - 1 ) { return EMPTY ; } else { if ( docNumbers . length == 1 ) { docNumbers [ 0 ] = doc ; return docNumbers ; } else { return new int [ ] { doc } ; } } |
public class ClassificationService { /** * Return all { @ link ClassificationModel } instances that are attached to the given { @ link FileModel } instance . */
public Iterable < ClassificationModel > getClassifications ( FileModel model ) { } } | GraphTraversal < Vertex , Vertex > pipeline = new GraphTraversalSource ( getGraphContext ( ) . getGraph ( ) ) . V ( model . getElement ( ) ) ; pipeline . in ( ClassificationModel . FILE_MODEL ) ; pipeline . has ( WindupVertexFrame . TYPE_PROP , Text . textContains ( ClassificationModel . TYPE ) ) ; return new FramedVer... |
public class JVnSenSegmenter { /** * Sen segment .
* @ param text the text
* @ return the string */
public String senSegment ( String text ) { } } | // text normalization
text = text . replaceAll ( "([\t \n])+" , "$1" ) ; // System . out . println ( text ) ;
// generate context predicates
List markList = new ArrayList ( ) ; List data = FeatureGenerator . doFeatureGen ( new HashMap ( ) , text , markList , false ) ; if ( markList . isEmpty ( ) ) return text + "\n" ; ... |
public class ScanAPI { /** * 检查wxticket参数
* @ param accessToken accessToken
* @ param ticket ticket
* @ return TicketCheckResult */
public static TicketCheckResult ticketCheck ( String accessToken , String ticket ) { } } | HttpUriRequest httpUriRequest = RequestBuilder . post ( ) . setHeader ( jsonHeader ) . setUri ( BASE_URI + "/scan/scanticket/check" ) . addParameter ( PARAM_ACCESS_TOKEN , API . accessToken ( accessToken ) ) . addParameter ( "ticket" , ticket ) . build ( ) ; return LocalHttpClient . executeJsonResult ( httpUriRequest ,... |
public class LazyLoader { /** * Gets a new instance of the class corresponding to the key . */
public V get ( K key ) { } } | Entry < V > entry = classMap . get ( key ) ; return entry == null ? null : entry . get ( ) ; |
public class MultiTaskProgress { /** * Automatically call the done or error method of this WorkProgress once all current sub - tasks are done . */
public void doneOnSubTasksDone ( ) { } } | if ( jp != null ) return ; synchronized ( tasks ) { jp = new JoinPoint < > ( ) ; for ( SubTask task : tasks ) jp . addToJoinDoNotCancel ( task . getProgress ( ) . getSynch ( ) ) ; } jp . listenInline ( new Runnable ( ) { @ Override public void run ( ) { if ( jp . hasError ( ) ) error ( jp . getError ( ) ) ; else done (... |
public class TupleCombinerBuilder { /** * Adds the given once - only tuples to this combiner . */
public TupleCombinerBuilder once ( Stream < TupleRef > tupleRefs ) { } } | tupleRefs . forEach ( tupleRef -> tupleCombiner_ . addOnceTuple ( tupleRef ) ) ; return this ; |
public class FeatureInfoBuilder { /** * Build a feature results information message
* @ param results feature index results
* @ param tolerance distance tolerance
* @ param clickLocation map click location
* @ param projection desired geometry projection
* @ return results message or null if no results */
pub... | String message = null ; // Fine filter results so that the click location is within the tolerance of each feature row result
FeatureIndexResults filteredResults = fineFilterResults ( results , tolerance , clickLocation ) ; long featureCount = filteredResults . count ( ) ; if ( featureCount > 0 ) { int maxFeatureInfo = ... |
public class ServletSupport { /** * Redirects http - request to url
* @ param url */
public static void redirect ( String url , boolean copyParameters , ServletRequest req , ServletResponse res ) { } } | if ( url == null ) { throw new IllegalArgumentException ( "URL cannot be null" ) ; } String redirectUrl = url ; char separator = '?' ; if ( redirectUrl . indexOf ( '?' ) != - 1 ) { separator = '&' ; } if ( copyParameters ) { Enumeration e = req . getParameterNames ( ) ; while ( e . hasMoreElements ( ) ) { String name =... |
public class Futures { /** * Returns a { @ code Future } whose result is taken from the given primary
* { @ code input } or , if the primary input fails , from the { @ code Future }
* provided by the { @ code fallback } . { @ link FutureFallback # create } is not
* invoked until the primary input has failed , so ... | return withFallback ( input , fallback , directExecutor ( ) ) ; |
public class ConfigHelper { /** * Resolve image with an external image resolver
* @ param images the original image config list ( can be null )
* @ param imageResolver the resolver used to extend on an image configuration
* @ param imageNameFilter filter to select only certain image configurations with the given ... | List < ImageConfiguration > ret = resolveConfiguration ( imageResolver , images ) ; ret = imageCustomizer . customizeConfig ( ret ) ; List < ImageConfiguration > filtered = filterImages ( imageNameFilter , ret ) ; if ( ret . size ( ) > 0 && filtered . size ( ) == 0 && imageNameFilter != null ) { List < String > imageNa... |
public class FileUtil { /** * 计算目录或文件的总大小 < br >
* 当给定对象为文件时 , 直接调用 { @ link File # length ( ) } < br >
* 当给定对象为目录时 , 遍历目录下的所有文件和目录 , 递归计算其大小 , 求和返回
* @ param file 目录或文件
* @ return 总大小 , bytes长度 */
public static long size ( File file ) { } } | Assert . notNull ( file , "file argument is null !" ) ; if ( false == file . exists ( ) ) { throw new IllegalArgumentException ( StrUtil . format ( "File [{}] not exist !" , file . getAbsolutePath ( ) ) ) ; } if ( file . isDirectory ( ) ) { long size = 0L ; File [ ] subFiles = file . listFiles ( ) ; if ( ArrayUtil . is... |
public class BlobOutputStream { /** * Writes a buffer . */
@ Override public void write ( byte [ ] buffer , int offset , int length ) throws IOException { } } | while ( length > 0 ) { if ( _bufferEnd <= _offset ) { flushBlock ( false ) ; } int sublen = Math . min ( _bufferEnd - _offset , length ) ; System . arraycopy ( buffer , offset , _buffer , _offset , sublen ) ; offset += sublen ; _offset += sublen ; length -= sublen ; } |
public class ServletCallback { /** * Called on method entry for HTTP / JSP requests public static void
* True method signature : void before ( long requestTime , HttpServletRequest
* request , HttpServletResponse response )
* @ param request
* HttpServletRequest
* @ param response
* HttpServletResponse */
p... | /* * Use reflection to access the HttpServletRequest / Response as using the
* true method signature caused ClassLoader issues . */
Class < ? > reqClass = request . getClass ( ) ; try { /* * Retrieve the tracker from the request and increment nesting level */
HttpRequestTracker tracker ; Method getAttribute = reqClas... |
public class HistoryStore { /** * return multiple values with a single request */
private void updateReadHistory ( JmxReadRequest pJmxReq , JSONObject pJson , long pTimestamp ) { } } | ObjectName name = pJmxReq . getObjectName ( ) ; if ( name . isPattern ( ) ) { // We have a pattern and hence a value structure
// of bean - > attribute _ key - > attribute _ value
Map < String , Object > values = ( Map < String , Object > ) pJson . get ( KEY_VALUE ) ; // Can be null if used with path and no single matc... |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getIfcSIPrefix ( ) { } } | if ( ifcSIPrefixEEnum == null ) { ifcSIPrefixEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 890 ) ; } return ifcSIPrefixEEnum ; |
public class JavascriptReorderingFilter { /** * Move all included JavaScript files to the end of < code > BODY < / code > tag in the same order
* that they appeared in the original HTML response .
* @ param servletRequest
* the incoming { @ link ServletRequest } instance
* @ param servletResponse
* the outgoi... | // try and see if this request is for an HTML page
HttpServletRequest request = ( HttpServletRequest ) servletRequest ; String uri = request . getRequestURI ( ) ; final boolean htmlPage = isHtmlPage ( uri ) ; // if this is an HTML page , get the entire contents of the page
// in a byte - stream
if ( ! htmlPage ) { LOGG... |
public class DbDatum { public int [ ] extractLongArray ( ) { } } | int [ ] argout ; argout = new int [ values . length ] ; for ( int i = 0 ; i < values . length ; i ++ ) { argout [ i ] = Integer . parseInt ( values [ i ] ) ; } return argout ; |
public class FairSchedulerServlet { /** * Print a view of pools to the given output writer .
* @ param out All html output goes here .
* @ param advancedView Show advanced view if true
* @ param String poolFilterSet If not null , only show this set ' s info */
private void showPools ( PrintWriter out , boolean ad... | ResourceReporter reporter = jobTracker . getResourceReporter ( ) ; synchronized ( jobTracker ) { synchronized ( scheduler ) { PoolManager poolManager = scheduler . getPoolManager ( ) ; out . print ( "<h2>Active Pools</h2>\n" ) ; out . print ( "<table border=\"2\" cellpadding=\"5\" cellspacing=\"2\" " + "class=\"tableso... |
public class CmsGalleryController { /** * Loads the root VFS entry bean for a given site selector option . < p >
* @ param siteRoot the site root for which the VFS entry should be loaded
* @ param filter the search filter
* @ param asyncCallback the callback to call with the result */
public void loadVfsEntryBean... | CmsRpcAction < CmsVfsEntryBean > action = new CmsRpcAction < CmsVfsEntryBean > ( ) { @ Override public void execute ( ) { start ( 200 , false ) ; getGalleryService ( ) . loadVfsEntryBean ( siteRoot , filter , this ) ; } @ Override public void onResponse ( CmsVfsEntryBean result ) { stop ( false ) ; asyncCallback . onSu... |
public class DestinationManager { /** * Remove a link for a pseudo desintation ID .
* @ param destinationUuid The ID of the pseudo destination to remove . */
public final void removePseudoDestination ( SIBUuid12 destinationUuid ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removePseudoDestination" , destinationUuid ) ; destinationIndex . removePseudoUuid ( destinationUuid ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removePseudoDestinatio... |
public class CPDefinitionSpecificationOptionValuePersistenceImpl { /** * Clears the cache for all cp definition specification option values .
* The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */
@ Override public void clearCache ( ) { } } | entityCache . clearCache ( CPDefinitionSpecificationOptionValueImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; |
public class HelloDory { /** * Delete data by ID */
private void deleteData ( DoradusClient client ) { } } | DBObject dbObject = DBObject . builder ( ) . withValue ( "_ID" , "TMaguire" ) . build ( ) ; DBObjectBatch dbObjectBatch = DBObjectBatch . builder ( ) . withObject ( dbObject ) . build ( ) ; Command command = Command . builder ( ) . withName ( "Delete" ) . withParam ( "application" , "HelloSpider" ) . withParam ( "table... |
public class FormLayout { /** * Sets the row groups , where each row in such a group gets the same group wide height . Each
* group is described by an array of integers that are interpreted as row indices . The parameter
* is an array of such group descriptions . < p >
* < strong > Examples : < / strong > < pre >... | int rowCount = getRowCount ( ) ; boolean [ ] usedIndices = new boolean [ rowCount + 1 ] ; for ( int i = 0 ; i < rowGroupIndices . length ; i ++ ) { for ( int j = 0 ; j < rowGroupIndices [ i ] . length ; j ++ ) { int rowIndex = rowGroupIndices [ i ] [ j ] ; if ( rowIndex < 1 || rowIndex > rowCount ) { throw new IndexOut... |
public class Quaternionf { /** * Multiply this quaternion by the quaternion represented via < code > ( qx , qy , qz , qw ) < / code > .
* If < code > T < / code > is < code > this < / code > and < code > Q < / code > is the given
* quaternion , then the resulting quaternion < code > R < / code > is :
* < code > R... | set ( w * qx + x * qw + y * qz - z * qy , w * qy - x * qz + y * qw + z * qx , w * qz + x * qy - y * qx + z * qw , w * qw - x * qx - y * qy - z * qz ) ; return this ; |
public class BlockStateChainingListener { /** * { @ inheritDoc }
* @ since 2.5RC1 */
@ Override public void endLink ( ResourceReference reference , boolean freestanding , Map < String , String > parameters ) { } } | super . endLink ( reference , freestanding , parameters ) ; -- this . linkDepth ; this . previousEvent = Event . LINK ; |
public class Messenger { /** * Command for starting web action
* @ param webAction web action name
* @ return Command for execution */
@ ObjectiveCName ( "startWebAction:" ) public Command < WebActionDescriptor > startWebAction ( final String webAction ) { } } | return modules . getExternalModule ( ) . startWebAction ( webAction ) ; |
public class ElasticHashinator { /** * Returns compressed config bytes .
* @ return config bytes
* @ throws IOException */
private byte [ ] toCookedBytes ( ) { } } | // Allocate for a int pair per token / partition ID entry , plus a size .
ByteBuffer buf = ByteBuffer . allocate ( 4 + ( m_tokenCount * 8 ) ) ; buf . putInt ( m_tokenCount ) ; // Keep tokens and partition ids separate to aid compression .
for ( int zz = 3 ; zz >= 0 ; zz -- ) { int lastToken = Integer . MIN_VALUE ; for ... |
public class DeclarationTransformerImpl { /** * Processes declaration which is supposed to contain one identification
* term
* @ param < T >
* Type of CSSProperty
* @ param type
* Class of CSSProperty to be stored
* @ param d
* Declaration to be parsed
* @ param properties
* Properties map where to st... | if ( d . size ( ) != 1 ) return false ; return genericTermIdent ( type , d . get ( 0 ) , ALLOW_INH , d . getProperty ( ) , properties ) ; |
public class JmsManagedConnectionFactoryImpl { /** * This method is not added in the interface JmsManagedConnectionFactory since it ' s for internal use only .
* @ return */
public String getPassword ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getPassword" ) ; String password = jcaConnectionFactory . getPassword ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getPassword" ) ; return password ; |
public class HashTreeBuilder { /** * Adds a new leaf with its metadata to the hash tree .
* @ param node leaf node to be added , must not be null .
* @ param metadata node ' s metadata , must not be null
* @ throws HashException
* @ throws KSIException */
public void add ( ImprintNode node , IdentityMetadata me... | addToHeads ( heads , aggregate ( node , metadata ) ) ; |
public class Operator { /** * compares a Date with a String
* @ param left
* @ param right
* @ return difference as int
* @ throws PageException */
public static int compare ( Date left , String right ) throws PageException { } } | if ( Decision . isNumber ( right ) ) return compare ( left . getTime ( ) / 1000 , Caster . toDoubleValue ( right ) ) ; DateTime dt = DateCaster . toDateAdvanced ( right , DateCaster . CONVERTING_TYPE_OFFSET , null , null ) ; if ( dt != null ) { return compare ( left . getTime ( ) / 1000 , dt . getTime ( ) / 1000 ) ; } ... |
public class ApiOvhIpLoadbalancing { /** * Get this object properties
* REST : GET / ipLoadbalancing / { serviceName } / udp / farm / { farmId } / server / { serverId }
* @ param serviceName [ required ] The internal name of your IP load balancing
* @ param farmId [ required ] Id of your farm
* @ param serverId... | String qPath = "/ipLoadbalancing/{serviceName}/udp/farm/{farmId}/server/{serverId}" ; StringBuilder sb = path ( qPath , serviceName , farmId , serverId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhBackendUDPServer . class ) ; |
public class StreamSupport { /** * Reads all bytes from an input stream .
* @ param input
* @ return
* @ throws IOException */
public static byte [ ] absorbInputStream ( InputStream input ) throws IOException { } } | ByteArrayOutputStream output = null ; try { output = new ByteArrayOutputStream ( ) ; absorbInputStream ( input , output ) ; return output . toByteArray ( ) ; } finally { output . close ( ) ; } |
public class AbstractTopology { /** * get all the hostIds in the partition group
* contain the host ( s ) that have highest partition id
* @ return all the hostIds in the partition group */
public Set < Integer > getPartitionGroupPeersContainHighestPid ( ) { } } | // find highest partition
int hPid = getPartitionCount ( ) - 1 ; // find the host that contains the highest partition
Collection < Integer > hHostIds = getHostIdList ( hPid ) ; if ( hHostIds == null || hHostIds . isEmpty ( ) ) { return Collections . emptySet ( ) ; } int hHostId = hHostIds . iterator ( ) . next ( ) ; re... |
public class DOMUtils { /** * Parse the contents of the provided source into an element .
* This uses the document builder associated with the current thread .
* @ param source
* @ return
* @ throws IOException */
public static Element sourceToElement ( Source source ) throws IOException { } } | Element retElement = null ; if ( source instanceof StreamSource ) { StreamSource streamSource = ( StreamSource ) source ; InputStream ins = streamSource . getInputStream ( ) ; if ( ins != null ) { retElement = DOMUtils . parse ( ins ) ; } Reader reader = streamSource . getReader ( ) ; if ( reader != null ) { retElement... |
public class Descriptor { /** * Replace all the message serializers registered with this descriptor with the the given message serializers .
* @ param messageSerializers The message serializers to replace the existing ones with .
* @ return A copy of this descriptor with the new message serializers . */
public Desc... | return new Descriptor ( name , calls , pathParamSerializers , messageSerializers , serializerFactory , exceptionSerializer , autoAcl , acls , headerFilter , locatableService , circuitBreaker , topicCalls ) ; |
public class Record { /** * Get value { @ link ArrayWritable } value
* @ param label target label
* @ return { @ link ArrayWritable } value of the label . If it is not null . */
public ArrayWritable getValueArrayWritable ( String label ) { } } | HadoopObject o = getHadoopObject ( VALUE , label , ObjectUtil . ARRAY , "Array" ) ; if ( o == null ) { return null ; } return ( ArrayWritable ) o . getObject ( ) ; |
public class ClassLoaders { /** * Execute the given { @ link Callable } in the { @ link ClassLoader } provided . Return the result , if any . */
public static < T > T executeIn ( ClassLoader loader , Callable < T > task ) throws Exception { } } | if ( task == null ) return null ; if ( log . isLoggable ( Level . FINE ) ) { log . fine ( "ClassLoader [" + loader + "] task began." ) ; } ClassLoader original = SecurityActions . getContextClassLoader ( ) ; try { SecurityActions . setContextClassLoader ( loader ) ; return task . call ( ) ; } finally { SecurityActions ... |
public class ToStringBuilder { /** * < p > Uses < code > ReflectionToStringBuilder < / code > to generate a
* < code > toString < / code > for the specified object . < / p >
* @ param object the Object to be output
* @ param style the style of the < code > toString < / code > to create , may be < code > null < / ... | return ReflectionToStringBuilder . toString ( object , style , outputTransients , false , null ) ; |
public class RepositoryResourceImpl { /** * { @ inheritDoc } */
@ Override public synchronized Collection < AttachmentResource > getAttachments ( ) throws RepositoryBackendException , RepositoryResourceException { } } | return Collections . < AttachmentResource > unmodifiableCollection ( getAttachmentImpls ( ) ) ; |
public class ConnectedCrud { /** * insert value into the db through the specified connection .
* @ param value the value
* @ throws SQLException if an error occurs */
public void create ( final T value ) throws SQLException { } } | transactionTemplate . doInTransaction ( new SQLFunction < Connection , Object > ( ) { @ Override public Object apply ( Connection connection ) throws SQLException { delegate . create ( connection , value ) ; return null ; } } ) ; |
public class CmsContentEditor { /** * Handles validation changes . < p >
* @ param validationContext the changed validation context */
void handleValidationChange ( CmsValidationContext validationContext ) { } } | if ( validationContext . hasValidationErrors ( ) ) { String locales = "" ; for ( String id : validationContext . getInvalidEntityIds ( ) ) { if ( locales . length ( ) > 0 ) { locales += ", " ; } String locale = CmsContentDefinition . getLocaleFromId ( id ) ; if ( m_availableLocales . containsKey ( locale ) ) { locales ... |
public class LBiObjBoolPredicateBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static < T1 , T2 > LBiObjBoolPredicate < T1 , T2 > biObjBoolPredicateFrom ( Consumer < LBiObjBoolPredicateBuilder <... | LBiObjBoolPredicateBuilder builder = new LBiObjBoolPredicateBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class PageContextImpl { /** * @ return returns the cfml compiler / public CFMLCompiler getCompiler ( ) { return compiler ; } */
@ Override public void setVariablesScope ( Variables variables ) { } } | this . variables = variables ; undefinedScope ( ) . setVariableScope ( variables ) ; if ( variables instanceof ClosureScope ) { variables = ( ( ClosureScope ) variables ) . getVariables ( ) ; } if ( variables instanceof StaticScope ) { activeComponent = ( ( StaticScope ) variables ) . getComponent ( ) ; } else if ( var... |
public class FloatField { /** * Move the physical binary data to this SQL parameter row .
* @ param resultset The resultset to get the SQL data from .
* @ param iColumn the column in the resultset that has my data .
* @ exception SQLException From SQL calls . */
public void moveSQLToField ( ResultSet resultset , ... | float fResult = resultset . getFloat ( iColumn ) ; if ( resultset . wasNull ( ) ) this . setString ( Constants . BLANK , false , DBConstants . READ_MOVE ) ; // Null value
else { if ( ( ! this . isNullable ( ) ) && ( fResult == Float . NaN ) ) this . setString ( Constants . BLANK , false , DBConstants . READ_MOVE ) ; //... |
public class BeanManager { /** * Initialize references that lack a bean instance eagerly .
* @ param beans to be initialized */
public final void initializeReferences ( Collection < Bean > beans ) { } } | Map < BeanId , Bean > indexed = BeanUtils . uniqueIndex ( beans ) ; for ( Bean bean : beans ) { for ( String name : bean . getReferenceNames ( ) ) { List < BeanId > ids = bean . getReference ( name ) ; if ( ids == null ) { continue ; } for ( BeanId id : ids ) { Bean ref = indexed . get ( id ) ; if ( ref == null ) { Opt... |
public class LobEngine { /** * Returns a new Blob whose length is zero .
* @ param blockSize block size ( in < i > bytes < / i > ) to use
* @ return new empty Blob */
public Blob createNewBlob ( int blockSize ) throws PersistException { } } | StoredLob lob = mLobStorage . prepare ( ) ; lob . setLocator ( mLocatorSequence . nextLongValue ( ) ) ; lob . setBlockSize ( blockSize ) ; lob . setLength ( 0 ) ; lob . insert ( ) ; return new BlobImpl ( lob . getLocator ( ) ) ; |
public class WindowSpecificationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setYTWIND ( Integer newYTWIND ) { } } | Integer oldYTWIND = ytwind ; ytwind = newYTWIND ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . WINDOW_SPECIFICATION__YTWIND , oldYTWIND , ytwind ) ) ; |
public class MessageProcessor { /** * Get the link change listener that is registered with TRM for changes to
* the WLM link groups
* @ return LinkChangeListener */
public LinkChangeListener getLinkChangeListener ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getLinkChangeListener" ) ; SibTr . exit ( tc , "getLinkChangeListener" , _linkChangeListener ) ; } return _linkChangeListener ; |
public class Jpa2EventStore { /** * { @ inheritDoc } */
@ Override public Collection < Event > findEvents ( SearchCriteria criteria ) { } } | Collection < Event > eventsAllTimestamps = eventRepository . find ( criteria ) ; // timestamp stored as string not queryable in DB , all timestamps come back , still need to filter this subset
return findEvents ( criteria , eventsAllTimestamps ) ; |
public class TangoCacheManager { /** * Get cache of an attribute
* @ param attr
* the attribute
* @ return the attribute cache
* @ throws NoCacheFoundException if cache for the attribute is not found */
public synchronized SelfPopulatingCache getAttributeCache ( final AttributeImpl attr ) throws NoCacheFoundExc... | if ( attr . getName ( ) . equalsIgnoreCase ( DeviceImpl . STATE_NAME ) ) { return stateCache . getCache ( ) ; } else if ( attr . getName ( ) . equalsIgnoreCase ( DeviceImpl . STATUS_NAME ) ) { return statusCache . getCache ( ) ; } else { return tryGetAttributeCache ( attr ) ; } |
public class FamilyBuilderImpl { /** * Add a person as the wife in a family .
* @ param family the family
* @ param person the person
* @ return the wife object */
public Wife addWifeToFamily ( final Family family , final Person person ) { } } | if ( family == null || person == null ) { return new Wife ( ) ; } final FamS famS = new FamS ( person , "FAMS" , new ObjectId ( family . getString ( ) ) ) ; final Wife wife = new Wife ( family , "Wife" , new ObjectId ( person . getString ( ) ) ) ; family . insert ( wife ) ; person . insert ( famS ) ; return wife ; |
public class FlowController { /** * Send a Page Flow error to the browser .
* @ param errText the error message to display .
* @ param response the current HttpServletResponse . */
protected void sendError ( String errText , HttpServletRequest request , HttpServletResponse response ) throws IOException { } } | InternalUtils . sendError ( "PageFlow_Custom_Error" , null , request , response , new Object [ ] { getDisplayName ( ) , errText } ) ; |
public class PreorderVisitor { /** * If currently visiting a field , get the field ' s fully qualified name */
public String getFullyQualifiedFieldName ( ) { } } | if ( ! visitingField ) { throw new IllegalStateException ( "getFullyQualifiedFieldName called while not visiting field" ) ; } if ( fullyQualifiedFieldName == null ) { fullyQualifiedFieldName = getDottedClassName ( ) + "." + getFieldName ( ) + " : " + getFieldSig ( ) ; } return fullyQualifiedFieldName ; |
public class GenTask { /** * Merges the specified template using the supplied mapping of keys to objects .
* @ param data a series of key , value pairs where the keys must be strings and the values can
* be any object . */
protected String mergeTemplate ( String template , Object ... data ) throws IOException { } } | return mergeTemplate ( template , createMap ( data ) ) ; |
public class MailClient { /** * return all messages from inbox
* @ param messageNumbers all messages with this ids
* @ param uIds all messages with this uids
* @ param withBody also return body
* @ return all messages from inbox
* @ throws MessagingException
* @ throws IOException */
public Query getMails (... | Query qry = new QueryImpl ( all ? _fldnew : _flddo , 0 , "query" ) ; Folder folder = _store . getFolder ( "INBOX" ) ; folder . open ( Folder . READ_ONLY ) ; try { getMessages ( qry , folder , uids , messageNumbers , startrow , maxrows , all ) ; } finally { folder . close ( false ) ; } return qry ; |
public class MaskFormat { /** * ( non - Javadoc )
* @ see java . text . Format # format ( java . lang . Object , java . lang . StringBuffer ,
* java . text . FieldPosition ) */
public StringBuffer format ( Object obj , StringBuffer toAppendTo , FieldPosition pos ) { } } | if ( obj == null ) return null ; return toAppendTo . append ( this . format ( obj . toString ( ) ) ) ; |
public class SearchAttribute { /** * Returns all the search annotations for the attribute . Imports are processed automatically . */
public List < String > getAnnotations ( ) { } } | AnnotationBuilder annotations = new AnnotationBuilder ( ) ; annotations . add ( getFieldAnnotation ( ) , getFieldBridgeAnnotation ( ) , getTikaBridgeAnnotation ( ) ) ; return annotations . getAnnotations ( ) ; |
public class AWSElasticsearchClient { /** * Lists available reserved Elasticsearch instance offerings .
* @ param describeReservedElasticsearchInstanceOfferingsRequest
* Container for parameters to < code > DescribeReservedElasticsearchInstanceOfferings < / code >
* @ return Result of the DescribeReservedElastics... | request = beforeClientExecution ( request ) ; return executeDescribeReservedElasticsearchInstanceOfferings ( request ) ; |
public class ApiOvhMe { /** * List of service contact change tasks you are involved in
* REST : GET / me / task / contactChange
* @ param toAccount [ required ] Filter the value of toAccount property ( like )
* @ param state [ required ] Filter the value of state property ( like )
* @ param askingAccount [ requ... | String qPath = "/me/task/contactChange" ; StringBuilder sb = path ( qPath ) ; query ( sb , "askingAccount" , askingAccount ) ; query ( sb , "state" , state ) ; query ( sb , "toAccount" , toAccount ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ; |
public class UrlPropertyConfigProvider { /** * getConfig .
* @ return a { @ link java . util . Properties } object . */
public Properties getConfig ( ) { } } | try { Properties properties = new Properties ( ) ; if ( null != resources . getGlobal ( ) ) populateConfigItems ( properties , resources . getGlobal ( ) ) ; if ( null != resources . getLocals ( ) ) { for ( URL url : resources . getLocals ( ) ) { populateConfigItems ( properties , url ) ; } } if ( null != resources . ge... |
public class RequestTable { /** * Non - blocking alternative to { @ link # forEach ( Visitor ) } : iteration is performed on the array that exists at the
* time of this call . Changes to the underlying array will not be reflected in the iteration .
* @ param visitor the { @ link Visitor } . */
public RequestTable <... | if ( visitor == null ) return null ; T [ ] buf ; long lo , hi ; lock . lock ( ) ; try { buf = this . buffer ; lo = this . low ; hi = this . high ; } finally { lock . unlock ( ) ; } for ( long i = lo , num_iterations = 0 ; i < hi && num_iterations < buf . length ; i ++ , num_iterations ++ ) { int index = index ( i ) ; T... |
public class StringUtil { /** * FooBarBaz → fooBarBaz */
public static String decapitalize ( String s ) { } } | if ( s == null ) { return null ; } return Introspector . decapitalize ( s ) ; |
public class StreamAppenderatorDriver { /** * Execute a task in background to publish all segments corresponding to the given sequence names . The task
* internally pushes the segments to the deep storage first , and then publishes the metadata to the metadata storage .
* @ param publisher segment publisher
* @ p... | final List < SegmentIdWithShardSpec > theSegments = getSegmentWithStates ( sequenceNames ) . map ( SegmentWithState :: getSegmentIdentifier ) . collect ( Collectors . toList ( ) ) ; final ListenableFuture < SegmentsAndMetadata > publishFuture = ListenableFutures . transformAsync ( // useUniquePath = true prevents incon... |
public class MiniMax { /** * Update the entries of the matrices that contain a distance to c , the newly
* merged cluster .
* @ param size number of ids in the data set
* @ param mat matrix paradigm
* @ param prots calculated prototypes
* @ param builder Result builder
* @ param clusters the clusters
* @ ... | final DBIDArrayIter ix = mat . ix , iy = mat . iy ; // c is the new cluster .
// Update entries ( at ( x , y ) with x > y ) in the matrix where x = c or y = c
// Update entries at ( c , y ) with y < c
ix . seek ( c ) ; for ( iy . seek ( 0 ) ; iy . getOffset ( ) < c ; iy . advance ( ) ) { // Skip entry if already merged... |
public class DefaultSensorStorage { /** * Thread safe assuming that each issues for each file are only written once . */
@ Override public void store ( Issue issue ) { } } | if ( issue . primaryLocation ( ) . inputComponent ( ) instanceof DefaultInputFile ) { DefaultInputFile defaultInputFile = ( DefaultInputFile ) issue . primaryLocation ( ) . inputComponent ( ) ; if ( shouldSkipStorage ( defaultInputFile ) ) { return ; } defaultInputFile . setPublished ( true ) ; } moduleIssues . initAnd... |
public class Manager { /** * Removes a messaging client factory .
* WARNING : this method is made available only to be used in non - OSGi environments
* ( e . g . Maven , embedded mode , etc ) . If you are not sure , do not use it .
* @ param clientFactory a non - null client factory */
public void removeMessagin... | if ( this . messagingClient . getRegistry ( ) != null ) this . messagingClient . getRegistry ( ) . removeMessagingClientFactory ( clientFactory ) ; |
public class DocumentationTemplate { /** * Adds a section relating to a { @ link Component } .
* @ param component the { @ link Component } the documentation content relates to
* @ param title the section title
* @ param format the { @ link Format } of the documentation content
* @ param content a String contai... | return add ( component , title , format , content ) ; |
public class DeregisterTargetFromMaintenanceWindowRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeregisterTargetFromMaintenanceWindowRequest deregisterTargetFromMaintenanceWindowRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deregisterTargetFromMaintenanceWindowRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deregisterTargetFromMaintenanceWindowRequest . getWindowId ( ) , WINDOWID_BINDING ) ; protocolMarshaller . marshall ( deregisterTargetFromMa... |
public class MiscUtils { /** * Serialize the deferred serializer data into byte buffer
* @ param mbuf ByteBuffer the buffer is written to
* @ param ds DeferredSerialization data writes to the byte buffer
* @ return size of data
* @ throws IOException */
public static int writeDeferredSerialization ( ByteBuffer ... | int written = 0 ; try { final int objStartPosition = mbuf . position ( ) ; ds . serialize ( mbuf ) ; written = mbuf . position ( ) - objStartPosition ; } finally { ds . cancel ( ) ; } return written ; |
public class SQLPPMapping2DatalogConverter { /** * returns a Datalog representation of the mappings */
public ImmutableMap < CQIE , PPMappingAssertionProvenance > convert ( Collection < SQLPPTriplesMap > triplesMaps , RDBMetadata metadata ) throws InvalidMappingSourceQueriesException { } } | Map < CQIE , PPMappingAssertionProvenance > mutableMap = new HashMap < > ( ) ; List < String > errorMessages = new ArrayList < > ( ) ; QuotedIDFactory idfac = metadata . getQuotedIDFactory ( ) ; for ( SQLPPTriplesMap mappingAxiom : triplesMaps ) { try { OBDASQLQuery sourceQuery = mappingAxiom . getSourceQuery ( ) ; Lis... |
public class Intersectiond { /** * Test whether the ray with given origin < code > ( originX , originY , originZ ) < / code > and direction < code > ( dirX , dirY , dirZ ) < / code > intersects the plane
* given as the general plane equation < i > a * x + b * y + c * z + d = 0 < / i > , and return the
* value of th... | double denom = a * dirX + b * dirY + c * dirZ ; if ( denom < 0.0 ) { double t = - ( a * originX + b * originY + c * originZ + d ) / denom ; if ( t >= 0.0 ) return t ; } return - 1.0 ; |
public class FamFamFlags { /** * Get the flag icon from the passed locale or < code > null < / code > .
* @ param aFlagLocale
* The locale to resolve . May be < code > null < / code > .
* @ return < code > null < / code > if the passed locale is < code > null < / code > , if the
* locale has no country or if th... | final EFamFamFlagIcon eIcon = getFlagFromLocale ( aFlagLocale ) ; return eIcon == null ? null : eIcon . getAsNode ( ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcModulusOfSubgradeReactionMeasure ( ) { } } | if ( ifcModulusOfSubgradeReactionMeasureEClass == null ) { ifcModulusOfSubgradeReactionMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 841 ) ; } return ifcModulusOfSubgradeReactionMeasureEClass ; |
public class DescribeSuggestersRequest { /** * The suggesters you want to describe .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSuggesterNames ( java . util . Collection ) } or { @ link # withSuggesterNames ( java . util . Collection ) } if you want
... | if ( this . suggesterNames == null ) { setSuggesterNames ( new com . amazonaws . internal . SdkInternalList < String > ( suggesterNames . length ) ) ; } for ( String ele : suggesterNames ) { this . suggesterNames . add ( ele ) ; } return this ; |
public class ContainerAliasResolver { /** * Looks up container id for given alias that is associated with task instance
* @ param alias container alias
* @ param taskId unique task instance id
* @ return
* @ throws IllegalArgumentException in case there are no containers for given alias */
public String forTask... | return registry . getContainerId ( alias , new ByTaskIdContainerLocator ( taskId ) ) ; |
public class BundleResource { /** * / * ( non - Javadoc )
* @ see com . ibm . jaggr . service . resource . IResource # lastModified ( ) */
@ Override public long lastModified ( ) { } } | long lastmod = 0L ; try { lastmod = getURI ( ) . toURL ( ) . openConnection ( ) . getLastModified ( ) ; } catch ( IOException ignore ) { } return lastmod ; |
public class Model { /** * Get attribute of mysql type : float */
public Float getFloat ( String attr ) { } } | Number n = ( Number ) attrs . get ( attr ) ; return n != null ? n . floatValue ( ) : null ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.