signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AdapterRegistry { /** * Return true if an adapter can be found to adapt the given input into the given output type . */
public boolean canAdapt ( Object input , Class < ? > outputType ) { } } | Class < ? > inputType = input . getClass ( ) ; Adapter a = findAdapter ( input , inputType , outputType ) ; return a != null ; |
public class GvmSpace { /** * Note : ( m1 + m2 ) never zero */
public double variance ( double m1 , Object pt1 , Object ptSqr1 , double m2 , Object pt2 , Object ptSqr2 ) { } } | // compute the total mass
double m0 = m1 + m2 ; // compute the new sum
Object pt0 = newCopy ( pt1 ) ; add ( pt0 , pt2 ) ; // compute the new sum of squares
Object ptSqr0 = newCopy ( ptSqr1 ) ; add ( ptSqr0 , ptSqr2 ) ; // compute the variance
return variance ( m0 , pt0 , ptSqr0 ) ; |
public class Keys { /** * Returns a key for the type provided by , or injected by this key . For
* example , if this is a key for a { @ code Provider < Foo > } , this returns the
* key for { @ code Foo } . This retains annotations and supports both Provider
* keys and MembersInjector keys . */
static String getBu... | int start = startOfType ( key ) ; if ( substringStartsWith ( key , start , PROVIDER_PREFIX ) ) { return extractKey ( key , start , key . substring ( 0 , start ) , PROVIDER_PREFIX ) ; } else if ( substringStartsWith ( key , start , MEMBERS_INJECTOR_PREFIX ) ) { return extractKey ( key , start , "members/" , MEMBERS_INJE... |
public class ListInstancesResult { /** * Summary information about the instances that are associated with the specified service .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setInstances ( java . util . Collection ) } or { @ link # withInstances ( java . ... | if ( this . instances == null ) { setInstances ( new java . util . ArrayList < InstanceSummary > ( instances . length ) ) ; } for ( InstanceSummary ele : instances ) { this . instances . add ( ele ) ; } return this ; |
public class PoolStopResizeOptions { /** * Set the time the request was issued . Client libraries typically set this to the current system clock time ; set it explicitly if you are calling the REST API directly .
* @ param ocpDate the ocpDate value to set
* @ return the PoolStopResizeOptions object itself . */
publ... | if ( ocpDate == null ) { this . ocpDate = null ; } else { this . ocpDate = new DateTimeRfc1123 ( ocpDate ) ; } return this ; |
public class AdminToolQuartzServiceImpl { /** * / * ( non - Javadoc )
* @ see de . chandre . admintool . quartz . AdminToolQuartzService # interruptJob ( java . lang . String , java . lang . String ) */
@ Override public void interruptJob ( String jobGroup , String jobName ) throws SchedulerException { } } | if ( ! config . isInterruptJobAllowed ( ) ) { LOGGER . warn ( "not allowed to interrupt any job" ) ; return ; } JobKey jobKey = new JobKey ( jobName , jobGroup ) ; if ( isInteruptable ( jobKey ) ) { List < JobExecutionContext > executingJobs = scheduler . getCurrentlyExecutingJobs ( ) ; JobDetail jobDetail = scheduler ... |
public class CollectionUtil { /** * Adds all items returned by the iterator to the supplied collection and
* returns the supplied collection . */
@ ReplacedBy ( "com.google.common.collect.Iterators#addAll()" ) public static < T , C extends Collection < T > > C addAll ( C col , Iterator < ? extends T > iter ) { } } | while ( iter . hasNext ( ) ) { col . add ( iter . next ( ) ) ; } return col ; |
public class COSBlockOutputStream { /** * Close the stream .
* This will not return until the upload is complete or the attempt to perform
* the upload has failed . Exceptions raised in this method are indicative that
* the write has failed and data is at risk of being lost .
* @ throws IOException on any failu... | if ( closed . getAndSet ( true ) ) { // already closed
LOG . debug ( "Ignoring close() as stream is already closed" ) ; return ; } COSDataBlocks . DataBlock block = getActiveBlock ( ) ; boolean hasBlock = hasActiveBlock ( ) ; LOG . debug ( "{}: Closing block #{}: current block= {}" , this , blockCount , hasBlock ? bloc... |
public class Quaternionf { /** * / * ( non - Javadoc )
* @ see org . joml . Quaternionfc # getAsMatrix4x3f ( java . nio . ByteBuffer ) */
public ByteBuffer getAsMatrix4x3f ( ByteBuffer dest ) { } } | MemUtil . INSTANCE . putMatrix4x3f ( this , dest . position ( ) , dest ) ; return dest ; |
public class FessMultipartRequestHandler { @ Override public void rollback ( ) { } } | final Iterator < MultipartFormFile > iter = elementsFile . values ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { final MultipartFormFile formFile = iter . next ( ) ; formFile . destroy ( ) ; } |
public class Syslog { /** * Use createInstance ( protocol , config ) to create your own Syslog instance .
* < p > First , create an implementation of SyslogConfigIF , such as UdpNetSyslogConfig . < / p >
* < p > Second , configure that configuration instance . < / p >
* < p > Third , call createInstance ( protoco... | Preconditions . checkArgument ( ! StringUtils . isBlank ( protocol ) , "Instance protocol cannot be null or empty" ) ; Preconditions . checkArgument ( config != null , "SyslogConfig cannot be null" ) ; String syslogProtocol = protocol . toLowerCase ( ) ; SyslogIF syslog = null ; synchronized ( instances ) { Preconditio... |
public class CmsEditUserAddInfoDialog { /** * Creates a new additional information bean object . < p >
* @ param user the user to create the bean for
* @ return a new additional information bean object */
private List < CmsUserAddInfoBean > createAddInfoList ( CmsUser user ) { } } | List < CmsUserAddInfoBean > addInfoList = new ArrayList < CmsUserAddInfoBean > ( ) ; // add beans
Iterator < CmsWorkplaceUserInfoBlock > itBlocks = OpenCms . getWorkplaceManager ( ) . getUserInfoManager ( ) . getBlocks ( ) . iterator ( ) ; while ( itBlocks . hasNext ( ) ) { CmsWorkplaceUserInfoBlock block = itBlocks . ... |
public class LdapTemplate { /** * { @ inheritDoc } */
@ Override public < T > T searchForObject ( LdapQuery query , ContextMapper < T > mapper ) { } } | SearchControls searchControls = searchControlsForQuery ( query , DONT_RETURN_OBJ_FLAG ) ; return searchForObject ( query . base ( ) , query . filter ( ) . encode ( ) , searchControls , mapper ) ; |
public class EventsHelper { /** * Bind a function to the mousedown event of each matched element .
* @ param jsScope
* Scope to use
* @ return the jQuery code */
public static ChainableStatement mousedown ( JsScope jsScope ) { } } | return new DefaultChainableStatement ( MouseEvent . MOUSEDOWN . getEventLabel ( ) , jsScope . render ( ) ) ; |
public class EnvUtil { /** * Production safety check . Protection for production env . */
public static boolean verifyEnvironment ( ) { } } | if ( ! PRODUCTION . equals ( getEnv ( ) ) ) { return true ; } else { File tokenFile = new File ( "/etc/xian/xian_runtime_production.token" ) ; if ( tokenFile . exists ( ) && tokenFile . isFile ( ) ) { String token = PlainFileUtil . readAll ( tokenFile ) ; return "cbab75c745ac9707cf75b719a76e81284abc04c0ae96e2506fd247e9... |
public class FunctionInputDefBuilder { /** * Adds function input variables of the given type . */
public FunctionInputDefBuilder vars ( String type , AbstractVarDef ... vars ) { } } | for ( AbstractVarDef var : vars ) { var . setType ( type ) ; functionInputDef_ . addVarDef ( var ) ; } return this ; |
public class Scales { /** * Compute a linear scale for each dimension .
* @ param rel Relation
* @ return Scales , indexed starting with 0 ( like Vector , not database
* objects ! ) */
public static LinearScale [ ] calcScales ( Relation < ? extends SpatialComparable > rel ) { } } | int dim = RelationUtil . dimensionality ( rel ) ; DoubleMinMax [ ] minmax = DoubleMinMax . newArray ( dim ) ; LinearScale [ ] scales = new LinearScale [ dim ] ; // analyze data
for ( DBIDIter iditer = rel . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { SpatialComparable v = rel . get ( iditer ) ; if ( v... |
public class AstaFileReader { /** * Process a text - based PP file .
* @ param inputStream file input stream
* @ return ProjectFile instance */
private ProjectFile readTextFile ( InputStream inputStream ) throws MPXJException { } } | ProjectReader reader = new AstaTextFileReader ( ) ; addListeners ( reader ) ; return reader . read ( inputStream ) ; |
public class HttpResponse { /** * Returns the response body as twitter4j . JSONObject . < br >
* Disconnects the internal HttpURLConnection silently .
* @ return response body as twitter4j . JSONObject
* @ throws TwitterException when the response body is not in JSON Object format */
public JSONObject asJSONObjec... | if ( json == null ) { try { json = new JSONObject ( asString ( ) ) ; if ( CONF . isPrettyDebugEnabled ( ) ) { logger . debug ( json . toString ( 1 ) ) ; } else { logger . debug ( responseAsString != null ? responseAsString : json . toString ( ) ) ; } } catch ( JSONException jsone ) { if ( responseAsString == null ) { t... |
public class ObjectUtils { /** * Gets the value of a given property into a given bean .
* @ param < Q >
* the bean type .
* @ param bean
* the bean itself .
* @ param propertyName
* the property name .
* @ return the property value .
* @ see # getPropertyValue ( Object , String , Class ) */
public stati... | return ObjectUtils . getPropertyValue ( bean , propertyName , Object . class ) ; |
public class MtasJoinQParser { /** * ( non - Javadoc )
* @ see org . apache . solr . search . QParser # parse ( ) */
@ Override public Query parse ( ) throws SyntaxError { } } | if ( id == null ) { throw new SyntaxError ( "no " + MTAS_JOIN_QPARSER_COLLECTION ) ; } else if ( fields == null ) { throw new SyntaxError ( "no " + MTAS_JOIN_QPARSER_FIELD ) ; } else { BooleanQuery . Builder booleanQueryBuilder = new BooleanQuery . Builder ( ) ; MtasSolrCollectionCache mtasSolrJoinCache = null ; for ( ... |
public class EsperStatement { /** * Stops the underlying native statement from applying its filter query . */
public void stop ( ) { } } | if ( LOG . isInfoEnabled ( ) ) { LOG . info ( "Esper statement [" + epl + "] being stopped" ) ; } this . epStatement . stop ( ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( "Esper statement [" + epl + "] stopped" ) ; } |
public class MACCSFingerprinter { /** * { @ inheritDoc } */
@ Override public IBitFingerprint getBitFingerprint ( IAtomContainer container ) throws CDKException { } } | MaccsKey [ ] keys = keys ( container . getBuilder ( ) ) ; BitSet fp = new BitSet ( keys . length ) ; // init SMARTS invariants ( connectivity , degree , etc )
SmartsPattern . prepare ( container ) ; final int numAtoms = container . getAtomCount ( ) ; final GraphUtil . EdgeToBondMap bmap = GraphUtil . EdgeToBondMap . wi... |
public class TypeUtils { /** * Searching for maximum type to which both types could be downcasted . For example , for { @ code Integer }
* and { @ code Double } common class would be { @ code ? extends Number & Comparable < Number > } ( because both
* { @ code Integer } and { @ code Double } extend { @ code Number ... | return CommonTypeFactory . build ( one , two , true ) ; |
public class CommerceWishListPersistenceImpl { /** * Returns an ordered range of all the commerce wish lists where userId = & # 63 ; and createDate & lt ; & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code ... | boolean pagination = true ; FinderPath finderPath = null ; Object [ ] finderArgs = null ; finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_U_LTC ; finderArgs = new Object [ ] { userId , _getTime ( createDate ) , start , end , orderByComparator } ; List < CommerceWishList > list = null ; if ( retrieveFromCache ) { list ... |
public class CollectionUtils { /** * Wrap set set .
* @ param < T > the type parameter
* @ param source the source
* @ return the set */
public static < T > Set < T > wrapSet ( final T source ) { } } | val list = new LinkedHashSet < T > ( ) ; if ( source != null ) { list . add ( source ) ; } return list ; |
public class E { /** * Throws out an { @ link InvalidStateException } with message specified . */
public static InvalidStateException invalidState ( String msg , Object ... args ) { } } | throw new InvalidStateException ( S . fmt ( msg , args ) ) ; |
public class ArgumentMatchers { /** * Returns an equals matcher for the given value . */
@ SuppressWarnings ( "unchecked" ) public static < T > Matcher < T > eq ( T value ) { } } | return ( Matcher < T > ) new Equals ( value ) ; |
public class JobXMLDescriptorImpl { /** * If not already created , a new < code > listeners < / code > element with the given value will be created .
* Otherwise , the existing < code > listeners < / code > element will be returned .
* @ return a new or existing instance of < code > Listeners < JobXMLDescriptor > <... | Node node = model . getOrCreate ( "listeners" ) ; Listeners < JobXMLDescriptor > listeners = new ListenersImpl < JobXMLDescriptor > ( this , "listeners" , model , node ) ; return listeners ; |
public class SipCall { /** * The waitForCancelResponse ( ) method waits for a response to be received from the network for a
* sent CANCEL . Call this method after calling sendCancel ( ) .
* This method blocks until one of the following occurs : 1 ) A response message has been received .
* In this case , a value ... | initErrorInfo ( ) ; if ( siptrans == null ) { returnCode = SipSession . INVALID_OPERATION ; errorMessage = ( String ) SipSession . statusCodeDescription . get ( new Integer ( returnCode ) ) + " - no RE-INVITE transaction object given" ; return false ; } EventObject response_event = parent . waitResponse ( siptrans , ti... |
public class Cache { /** * visible for testing */
Object runOp ( Op op ) { } } | LOG . debug ( "Run: {}" , op ) ; recursive . set ( Boolean . TRUE ) ; try { if ( op . type == Op . Type . PUT || op . type == Op . Type . ALLOC ) return execOp ( op , null ) ; final long id = op . line ; CacheLine line = getLine ( id ) ; if ( line == null ) { Object res = handleOpNoLine ( op . type , op . line , op . g... |
public class TaskQueuesStatisticsReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return TaskQueuesStatistics ResourceSet */
@ Override public ResourceSet < TaskQueuesStatistics > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class SrvDate { /** * < p > Parse date from ISO8601 date - time string without TZ ,
* e . g . from 2001-07-04T12:08 . < / p >
* @ param pDateStr date in ISO8601 format
* @ param pAddParam additional params
* @ return String representation
* @ throws Exception - an exception */
@ Override public final D... | return this . dateTimeNoTzFormatIso8601 . parse ( pDateStr ) ; |
public class RoadNetworkConstants { /** * Set the preferred name for the traffic direction on the roads .
* @ param name is the preferred name for the traffic direction on the roads .
* @ see # DEFAULT _ ATTR _ TRAFFIC _ DIRECTION */
public static void setPreferredAttributeNameForTrafficDirection ( String name ) { ... | final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( name == null || "" . equals ( name ) || DEFAULT_ATTR_TRAFFIC_DIRECTION . equalsIgnoreCase ( name ) ) { // $ NON - NLS - 1 $
prefs . remove ( "TRAFFIC_DIRECTION_ATTR_NAME" ) ; // $ NON - NLS - 1 $
} ... |
public class UpdatePipelineRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdatePipelineRequest updatePipelineRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updatePipelineRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updatePipelineRequest . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( updatePipelineRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . mars... |
public class StreamHelper { /** * Read all characters from the passed reader into a char array .
* @ param aReader
* The reader to read from . May be < code > null < / code > .
* @ return The character array or < code > null < / code > if the reader is
* < code > null < / code > . */
@ Nullable public static ch... | if ( aReader == null ) return null ; return getCopy ( aReader ) . getAsCharArray ( ) ; |
public class ApiOvhCloud { /** * Request access to a region
* REST : POST / cloud / project / { serviceName } / region
* @ param region [ required ] Region to add on your project
* @ param serviceName [ required ] The project id */
public OvhRegion project_serviceName_region_POST ( String serviceName , String reg... | String qPath = "/cloud/project/{serviceName}/region" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "region" , region ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhRegion . class )... |
public class DefinitionHeaderProvider { /** * Implementation */
private Locale getUserLocale ( IPerson user ) { } } | // get user locale
Locale [ ] locales = localeStore . getUserLocales ( user ) ; LocaleManager localeManager = localeManagerFactory . createLocaleManager ( user , Arrays . asList ( locales ) ) ; return localeManager . getLocales ( ) . get ( 0 ) ; |
public class PlanAssembler { /** * Add a limit , and return the new root .
* @ param root top of the original plan
* @ return new plan ' s root node */
private AbstractPlanNode handleUnionLimitOperator ( AbstractPlanNode root ) { } } | // The coordinator ' s top limit graph fragment for a MP plan .
// If planning " order by . . . limit " , getNextUnionPlan ( )
// will have already added an order by to the coordinator frag .
// This is the only limit node in a SP plan
LimitPlanNode topLimit = m_parsedUnion . getLimitNodeTop ( ) ; assert ( topLimit != ... |
public class NodeModelUtils { /** * / * @ Nullable */
public static ICompositeNode getNode ( /* @ Nullable */
EObject object ) { } } | if ( object == null ) return null ; List < Adapter > adapters = object . eAdapters ( ) ; for ( int i = 0 ; i < adapters . size ( ) ; i ++ ) { Adapter adapter = adapters . get ( i ) ; if ( adapter instanceof ICompositeNode ) return ( ICompositeNode ) adapter ; } return null ; |
public class QueryParserBase { /** * Iterates criteria list and concats query string fragments to form a valid query string to be used with
* { @ link org . apache . solr . client . solrj . SolrQuery # setQuery ( String ) }
* @ param criteria
* @ param domainType
* @ return
* @ since 4.0 */
protected String c... | return createQueryStringFromNode ( criteria , domainType ) ; |
public class DescribeLoadBalancersResult { /** * Information about the load balancers .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setLoadBalancerDescriptions ( java . util . Collection ) } or
* { @ link # withLoadBalancerDescriptions ( java . util . C... | if ( this . loadBalancerDescriptions == null ) { setLoadBalancerDescriptions ( new com . amazonaws . internal . SdkInternalList < LoadBalancerDescription > ( loadBalancerDescriptions . length ) ) ; } for ( LoadBalancerDescription ele : loadBalancerDescriptions ) { this . loadBalancerDescriptions . add ( ele ) ; } retur... |
public class WCOutputStream { /** * @ see javax . servlet . ServletOutputStream # println ( int ) */
public void println ( int i ) throws IOException { } } | String value = Integer . toString ( i ) ; this . output . write ( value . getBytes ( ) , 0 , value . length ( ) ) ; this . output . write ( CRLF , 0 , 2 ) ; |
public class CmsDocumentHtml { /** * Returns the raw text content of a given VFS resource containing HTML data . < p >
* @ see org . opencms . search . documents . I _ CmsSearchExtractor # extractContent ( CmsObject , CmsResource , I _ CmsSearchIndex ) */
public I_CmsExtractionResult extractContent ( CmsObject cms , ... | logContentExtraction ( resource , index ) ; CmsFile file = readFile ( cms , resource ) ; try { CmsProperty encProp = cms . readPropertyObject ( resource , CmsPropertyDefinition . PROPERTY_CONTENT_ENCODING , true ) ; String encoding = encProp . getValue ( OpenCms . getSystemInfo ( ) . getDefaultEncoding ( ) ) ; return C... |
public class NumaOptions { @ Nonnull public static NumaOptions node ( @ Nonnull NumaNodeOptions node ) { } } | NumaOptions self = new NumaOptions ( ) ; self . type = NumaOptionsType . node ; self . node = node ; return self ; |
public class AnnotationRef { /** * Writes an annotation valued field to the writer . */
private static < T extends Annotation > FieldWriter annotationFieldWriter ( final String name , final AnnotationRef < T > ref ) { } } | return new FieldWriter ( ) { @ Override public void write ( AnnotationVisitor visitor , Object value ) { ref . doWrite ( ref . annType . cast ( value ) , visitor . visitAnnotation ( name , ref . typeDescriptor ) ) ; } } ; |
public class RoadNetworkConstants { /** * Set the preferred values of traffic direction
* used in the attributes for the traffic direction on the roads .
* @ param direction a direction
* @ param values are the values for the given direction . */
public static void setPreferredAttributeValuesForTrafficDirection (... | int i = 0 ; for ( final String value : values ) { setPreferredAttributeValueForTrafficDirection ( direction , i , value ) ; ++ i ; } setPreferredAttributeValueForTrafficDirection ( direction , i , null ) ; |
public class PropertyFilter { /** * Returns a canonical instance , creating a new one if there isn ' t one
* already in the cache .
* @ throws IllegalArgumentException if property or operator is null */
@ SuppressWarnings ( "unchecked" ) static < S extends Storable > PropertyFilter < S > getCanonical ( ChainedPrope... | return ( PropertyFilter < S > ) cCanonical . put ( new PropertyFilter < S > ( property , op , bindID , null ) ) ; |
public class Nfs3 { /** * / * ( non - Javadoc )
* @ see com . emc . ecs . nfsclient . nfs . Nfs # makeRemoveRequest ( byte [ ] , java . lang . String ) */
public Nfs3RemoveRequest makeRemoveRequest ( byte [ ] parentDirectoryFileHandle , String name ) throws FileNotFoundException { } } | return new Nfs3RemoveRequest ( parentDirectoryFileHandle , name , _credential ) ; |
public class ExecutionContextImpl { /** * Called when we have determined that this execution is going to be retried
* @ param t the Throwable that prompted the retry */
public void onRetry ( Throwable t ) { } } | try { this . retries ++ ; debugRelativeTime ( "onRetry: " + this . retries ) ; metricRecorder . incrementRetriesCount ( ) ; if ( timeout != null ) { timeout . restart ( ) ; attemptStartTime = System . nanoTime ( ) ; } onAttemptComplete ( t ) ; } catch ( RuntimeException e ) { // Unchecked exceptions thrown here can be ... |
public class ScreenField { /** * Move the HTML input to the screen record fields .
* @ param strSuffix Only move fields with the suffix .
* @ return true if one was moved .
* @ exception DBException File exception . */
public int setSFieldToProperty ( String strSuffix , boolean bDisplayOption , int iMoveMode ) { ... | int iErrorCode = Constant . NORMAL_RETURN ; if ( this . isInputField ( ) ) { String strFieldName = this . getSFieldParam ( strSuffix ) ; String strParamValue = this . getSFieldProperty ( strFieldName ) ; if ( strParamValue != null ) iErrorCode = this . setSFieldValue ( strParamValue , bDisplayOption , iMoveMode ) ; } r... |
public class NeedlessMemberCollectionSynchronization { /** * implements the visitor to clear the collectionFields and stack and to report collections that remain unmodified out of clinit or init
* @ param classContext
* the context object of the currently parsed class */
@ Override public void visitClassContext ( C... | try { if ( ( collectionClass != null ) && ( mapClass != null ) ) { collectionFields = new HashMap < > ( ) ; aliases = new HashMap < > ( ) ; stack = new OpcodeStack ( ) ; JavaClass cls = classContext . getJavaClass ( ) ; className = cls . getClassName ( ) ; super . visitClassContext ( classContext ) ; for ( FieldInfo fi... |
public class BasicContainer { /** * Add < code > box < / code > to the container and sets the parent correctly . If < code > box < / code > is < code > null < / code >
* nochange will be performed and no error thrown .
* @ param box will be added to the container */
public void addBox ( Box box ) { } } | if ( box != null ) { boxes = new ArrayList < Box > ( getBoxes ( ) ) ; boxes . add ( box ) ; } |
public class BasePanel { /** * Display this screen in html input format .
* @ return true if default params were found for this form .
* @ param out The http output stream .
* @ exception DBException File exception . */
public boolean printControl ( PrintWriter out , int iPrintOptions ) { } } | boolean bFieldsFound = super . printControl ( out , iPrintOptions ) ; if ( ! bFieldsFound ) { int iNumCols = this . getSFieldCount ( ) ; for ( int iIndex = 0 ; iIndex < iNumCols ; iIndex ++ ) { ScreenField sField = this . getSField ( iIndex ) ; boolean bPrintControl = this . isPrintableControl ( sField , iPrintOptions ... |
public class CreateVM { /** * Connects to a specified data center and creates a virtual machine using the inputs provided .
* @ param host VMware host or IP - Example : " vc6 . subdomain . example . com "
* @ param port optional - the port to connect through - Examples : " 443 " , " 80 " - Default : " 443"
* @ pa... | @ Output ( Outputs . RETURN_CODE ) , @ Output ( Outputs . RETURN_RESULT ) , @ Output ( Outputs . EXCEPTION ) } , responses = { @ Response ( text = Outputs . SUCCESS , field = Outputs . RETURN_CODE , value = Outputs . RETURN_CODE_SUCCESS , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . RESOLVED ) ... |
public class SessionSecurityManager { /** * INSTANCE SCOPE = = = = = */
@ Override public User getCurrentUser ( ) { } } | HttpSession session = getRequest ( ) . getSession ( false ) ; if ( session == null ) return null ; return ( User ) session . getAttribute ( SESSION_ATTR_USER ) ; |
public class WsMessageReaderImpl { /** * not part of the public API . */
public void close ( ) throws IOException { } } | if ( isClosed ( ) ) { return ; } if ( ! _webSocket . isDisconnected ( ) ) { String s = "Can't close the MessageReader if the WebSocket is " + "still connected" ; throw new WebSocketException ( s ) ; } _sharedQueue . done ( ) ; _closed = true ; |
public class Collections { /** * Returns an immutable list consisting of < tt > n < / tt > copies of the
* specified object . The newly allocated data object is tiny ( it contains
* a single reference to the data object ) . This method is useful in
* combination with the < tt > List . addAll < / tt > method to gr... | if ( n < 0 ) throw new IllegalArgumentException ( "List length = " + n ) ; return new CopiesList < > ( n , o ) ; |
public class ClientEnvironment { /** * Get the async . task manager singleton instance
* @ return the manager instance
* @ throws JMSException */
public static synchronized AsyncTaskManager getAsyncTaskManager ( ) throws JMSException { } } | if ( asyncTaskManager == null ) { int threadPoolMinSize = getSettings ( ) . getIntProperty ( FFMQCoreSettings . ASYNC_TASK_MANAGER_DELIVERY_THREAD_POOL_MINSIZE , 0 ) ; int threadPoolMaxIdle = getSettings ( ) . getIntProperty ( FFMQCoreSettings . ASYNC_TASK_MANAGER_DELIVERY_THREAD_POOL_MAXIDLE , 5 ) ; int threadPoolMaxS... |
public class NotFoundHandler { public void handle ( String pathInContext , String pathParams , HttpRequest request , HttpResponse response ) throws HttpException , IOException { } } | log . debug ( "Not Found" ) ; String method = request . getMethod ( ) ; // Not found requests .
if ( method . equals ( HttpRequest . __GET ) || method . equals ( HttpRequest . __HEAD ) || method . equals ( HttpRequest . __POST ) || method . equals ( HttpRequest . __PUT ) || method . equals ( HttpRequest . __DELETE ) ||... |
public class ImageRenderer { /** * Renders the viewport using an SVGRenderer to the given output writer .
* @ param vp
* @ param out
* @ throws IOException */
protected void writeSVG ( Viewport vp , Writer out ) throws IOException { } } | // obtain the viewport bounds depending on whether we are clipping to viewport size or using the whole page
int w = vp . getClippedContentBounds ( ) . width ; int h = vp . getClippedContentBounds ( ) . height ; SVGRenderer render = new SVGRenderer ( w , h , out ) ; vp . draw ( render ) ; render . close ( ) ; |
public class SuperCfTemplate { /** * Query super columns using the provided predicate instead of the internal one
* @ param key
* @ param predicate
* @ return */
public SuperCfResult < K , SN , N > querySuperColumns ( K key , HSlicePredicate < SN > predicate ) { } } | return doExecuteSlice ( key , null , predicate ) ; |
public class JarWithFile { /** * Returns the dependency . */
private JarDepend getJarDepend ( ) { } } | if ( _depend == null || _depend . isModified ( ) ) _depend = new JarDepend ( new Depend ( getBacking ( ) ) ) ; return _depend ; |
public class MvcFragment { /** * This Android lifecycle callback is sealed . { @ link MvcFragment } will always use the
* layout returned by { @ link # getLayoutResId ( ) } to inflate the view . Instead , do actions to
* prepare views in { @ link # onViewReady ( View , Bundle , Reason ) } where all injected depende... | injectDependencies ( ) ; return inflater . inflate ( getLayoutResId ( ) , container , false ) ; |
public class AbstractMapView { /** * ( non - Javadoc )
* @ see com . ibm . ws . objectManager . Map # get ( java . lang . Object , com . ibm . ws . objectManager . Transaction ) */
public Token get ( Object key , Transaction transaction ) throws ObjectManagerException { } } | try { for ( Iterator iterator = entrySet ( ) . iterator ( ) ; ; ) { Entry entry = ( Entry ) iterator . next ( transaction ) ; Object entryKey = entry . getKey ( ) ; if ( key == entryKey || key . equals ( entryKey ) ) { return entry . getValue ( ) ; } } } catch ( java . util . NoSuchElementException exception ) { // No ... |
public class QStringValue { /** * { @ inheritDoc } */
@ Override public QStringValue prepare ( final AbstractTypeQuery _query , final AbstractQPart _part ) throws EFapsException { } } | if ( _part instanceof AbstractQAttrCompare ) { if ( ( ( AbstractQAttrCompare ) _part ) . isIgnoreCase ( ) ) { this . value = this . value . toUpperCase ( Context . getThreadContext ( ) . getLocale ( ) ) ; } if ( _part instanceof QMatch ) { this . value = Context . getDbType ( ) . prepare4Match ( this . value ) ; } if (... |
public class CreateDurableSubscriberQuery { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . network . packet . AbstractPacket # unserializeFrom ( net . timewalker . ffmq4 . utils . RawDataInputStream ) */
@ Override protected void unserializeFrom ( RawDataBuffer in ) { } } | super . unserializeFrom ( in ) ; consumerId = new IntegerID ( in . readInt ( ) ) ; topic = ( Topic ) DestinationSerializer . unserializeFrom ( in ) ; messageSelector = in . readNullableUTF ( ) ; noLocal = in . readBoolean ( ) ; name = in . readUTF ( ) ; |
public class Cell { /** * Sets the minWidth , prefWidth , maxWidth , minHeight , prefHeight , and maxHeight to the specified values . */
public Cell < C , T > size ( float width , float height ) { } } | size ( new FixedValue < C , T > ( layout . toolkit , width ) , new FixedValue < C , T > ( layout . toolkit , height ) ) ; return this ; |
public class WekaToSamoaInstanceConverter { /** * Get Samoa attribute from a weka attribute .
* @ param index the index
* @ param attribute the attribute
* @ return the attribute */
protected Attribute samoaAttribute ( int index , weka . core . Attribute attribute ) { } } | Attribute samoaAttribute ; if ( attribute . isNominal ( ) ) { Enumeration enu = attribute . enumerateValues ( ) ; List < String > attributeValues = new ArrayList < String > ( ) ; while ( enu . hasMoreElements ( ) ) { attributeValues . add ( ( String ) enu . nextElement ( ) ) ; } samoaAttribute = new Attribute ( attribu... |
public class StrTokenizer { /** * Checks if the characters at the index specified match the quote
* already matched in readNextToken ( ) .
* @ param srcChars the character array being tokenized
* @ param pos the position to check for a quote
* @ param len the length of the character array being tokenized
* @ ... | for ( int i = 0 ; i < quoteLen ; i ++ ) { if ( pos + i >= len || srcChars [ pos + i ] != srcChars [ quoteStart + i ] ) { return false ; } } return true ; |
public class ConnectionFactory { /** * Return a { @ link HttpURLConnection } that writes gets attribution information from { @ code
* https : / / mobile - service . segment . com / attribution } . */
public HttpURLConnection attribution ( String writeKey ) throws IOException { } } | HttpURLConnection connection = openConnection ( "https://mobile-service.segment.com/v1/attribution" ) ; connection . setRequestProperty ( "Authorization" , authorizationHeader ( writeKey ) ) ; connection . setRequestMethod ( "POST" ) ; connection . setDoOutput ( true ) ; return connection ; |
public class ByteArrayWrapper { /** * { @ inheritDoc } */
public synchronized int read ( long position , byte [ ] buffer , int offset , int length ) throws IOException { } } | long oldPos = getPos ( ) ; int nread = - 1 ; try { seek ( position ) ; nread = read ( buffer , offset , length ) ; } finally { seek ( oldPos ) ; } return nread ; |
public class CDIJSFInitializerImpl { /** * { @ inheritDoc } */
@ Override public void initializeCDIJSFViewHandler ( Application application ) { } } | CDIService cdiService = cdiServiceRef . getService ( ) ; if ( cdiService != null ) { BeanManager beanManager = cdiService . getCurrentBeanManager ( ) ; if ( beanManager != null ) { application . addELContextListener ( new WeldELContextListener ( ) ) ; CDIRuntime cdiRuntime = ( CDIRuntime ) cdiService ; String contextID... |
public class ApplicationDialog { /** * Returns the parent window based on the internal parent Component . Will
* search for a Window in the parent hierarchy if needed ( when parent
* Component isn ' t a Window ) .
* @ return the parent window */
public Window getParentWindow ( ) { } } | if ( parentWindow == null ) { if ( ( parentComponent == null ) && ( getApplicationConfig ( ) . windowManager ( ) . getActiveWindow ( ) != null ) ) { parentWindow = getApplicationConfig ( ) . windowManager ( ) . getActiveWindow ( ) . getControl ( ) ; } else { parentWindow = getWindowForComponent ( parentComponent ) ; } ... |
public class NorthArrowGraphic { /** * Embeds the given SVG element into a new SVG element scaling the graphic to the given dimension and
* applying the given rotation . */
private static void embedSvgGraphic ( final SVGElement svgRoot , final SVGElement newSvgRoot , final Document newDocument , final Dimension targe... | final String originalWidth = svgRoot . getAttributeNS ( null , "width" ) ; final String originalHeight = svgRoot . getAttributeNS ( null , "height" ) ; /* * To scale the SVG graphic and to apply the rotation , we distinguish two
* cases : width and height is set on the original SVG or not .
* Case 1 : Width and hei... |
public class SignatureUtil { /** * 生成事件消息接收签名
* @ param token token
* @ param timestamp timestamp
* @ param nonce nonce
* @ return str */
public static String generateEventMessageSignature ( String token , String timestamp , String nonce ) { } } | String [ ] array = new String [ ] { token , timestamp , nonce } ; Arrays . sort ( array ) ; String s = StringUtils . arrayToDelimitedString ( array , "" ) ; return DigestUtils . shaHex ( s ) ; |
public class IntTupleIterables { /** * Returns an iterable returning an iterator that returns
* { @ link MutableIntTuple } s in the specified range , in
* lexicographical order . < br >
* < br >
* Copies of the given tuples will be stored internally . < br >
* < br >
* Also see < a href = " . . / . . / pack... | return iterable ( Order . LEXICOGRAPHICAL , min , max ) ; |
public class ListExtensions { /** * Provides a reverse view on the given list which is especially useful to traverse a list backwards in a for - each
* loop . The list itself is not modified by calling this method .
* @ param list
* the list whose elements should be traversed in reverse . May not be < code > null... | return Lists . reverse ( list ) ; |
public class DescribeAssociationExecutionsResult { /** * A list of the executions for the specified association ID .
* @ param associationExecutions
* A list of the executions for the specified association ID . */
public void setAssociationExecutions ( java . util . Collection < AssociationExecution > associationEx... | if ( associationExecutions == null ) { this . associationExecutions = null ; return ; } this . associationExecutions = new com . amazonaws . internal . SdkInternalList < AssociationExecution > ( associationExecutions ) ; |
public class JShellToolBuilder { /** * Set the output channels . Same as { @ code out ( output , output , output ) } .
* Default , if not set , { @ code out ( System . out ) } .
* @ param output destination of command feedback , console interaction , and
* user code output
* @ return the { @ code JavaShellToolB... | this . cmdOut = output ; this . console = output ; this . userOut = output ; return this ; |
public class ClassDescriptor { /** * Specify the method to instantiate objects
* represented by this descriptor .
* @ see # setFactoryClass */
private synchronized void setFactoryMethod ( Method newMethod ) { } } | if ( newMethod != null ) { // make sure it ' s a no argument method
if ( newMethod . getParameterTypes ( ) . length > 0 ) { throw new MetadataException ( "Factory methods must be zero argument methods: " + newMethod . getClass ( ) . getName ( ) + "." + newMethod . getName ( ) ) ; } // make it accessible if it ' s not a... |
public class Counters { /** * Convert a counters object into a single line that is easy to parse .
* @ return the string with " name = value " for each counter and separated by " , " */
public synchronized String makeCompactString ( ) { } } | StringBuffer buffer = new StringBuffer ( ) ; boolean first = true ; for ( Group group : this ) { for ( Counter counter : group ) { if ( first ) { first = false ; } else { buffer . append ( ',' ) ; } buffer . append ( group . getDisplayName ( ) ) ; buffer . append ( '.' ) ; buffer . append ( counter . getDisplayName ( )... |
public class WordTree { /** * 添加单词 , 使用默认类型
* @ param word 单词 */
public void addWord ( String word ) { } } | WordTree parent = null ; WordTree current = this ; WordTree child ; char currentChar = 0 ; int length = word . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { currentChar = word . charAt ( i ) ; if ( false == StopChar . isStopChar ( currentChar ) ) { // 只处理合法字符
child = current . get ( currentChar ) ; if ( child ==... |
public class InstanceStateManager { /** * Restoring instance state from given { @ code savedState } into the given { @ code obj } .
* < br / >
* Supposed to be called from { @ link android . app . Activity # onCreate ( android . os . Bundle ) } or
* { @ link android . app . Fragment # onCreate ( android . os . Bu... | if ( savedState != null ) { new InstanceStateManager < > ( obj ) . restoreState ( savedState ) ; } |
public class BackedStore { /** * PK68691
* removeFromMemory
* Removes session from Memory if persistence is enabled , otherwise no op
* @ see com . ibm . wsspi . session . IStore # removeFromMemory ( java . lang . String ) */
public void removeFromMemory ( String id ) { } } | final boolean isTraceOn = com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINER ) ) { LoggingUtil . SESSION_LOGGER_WAS . entering ( methodClassName , methodNames [ REMOVE_FROM_MEMORY ] , id ) ; } BackedSession sess = ( Ba... |
public class IndexHtmlDispatcher { /** * Returns a { @ link IndexHtmlDispatcher } if and only if the said class has { @ code index . html } as a side - file .
* @ param context
* @ param c Class from where to start the index . html inspection . Will go through class hierarchy ( unless interface )
* @ return Index... | for ( ; c != null && c != Object . class ; c = c . getSuperclass ( ) ) { String name = "/WEB-INF/side-files/" + c . getName ( ) . replace ( '.' , '/' ) + "/index.html" ; try { URL url = context . getResource ( name ) ; if ( url != null ) return new IndexHtmlDispatcher ( url ) ; } catch ( MalformedURLException e ) { thr... |
public class AppsImpl { /** * Get the application settings .
* @ param appId The application ID .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ApplicationSettings object */
public Observable < ServiceResponse < ApplicationSettings > > getSettingsWit... | 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." ) ; } String parameterizedHost = Joiner . on ( ", " ) ... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AbstractSolidType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link AbstractSolidType } { @ code >... | return new JAXBElement < AbstractSolidType > ( __Solid_QNAME , AbstractSolidType . class , null , value ) ; |
public class TinyLog { /** * 如果最后一个参数为异常参数 , 则获取之 , 否则返回null
* @ param arguments 参数
* @ return 最后一个异常参数
* @ since 4.0.3 */
private static Throwable getLastArgumentIfThrowable ( Object ... arguments ) { } } | if ( ArrayUtil . isNotEmpty ( arguments ) && arguments [ arguments . length - 1 ] instanceof Throwable ) { return ( Throwable ) arguments [ arguments . length - 1 ] ; } else { return null ; } |
public class CmsSearchFieldMapping { /** * Returns a " \ n " separated String of values for the given XPath if according content items can be found . < p >
* @ param contentItems the content items to get the value from
* @ param xpath the short XPath parameter to get the value for
* @ return a " \ n " separated S... | if ( contentItems . get ( xpath ) != null ) { // content item found for XPath
return contentItems . get ( xpath ) ; } else { // try a multiple value mapping and ensure that the values are in correct order .
SortedMap < List < Integer > , String > valueMap = new TreeMap < > ( new Comparator < List < Integer > > ( ) { //... |
public class OWLIrreflexiveObjectPropertyAxiomImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } .
* @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReade... | deserialize ( streamReader , instance ) ; |
public class GetListOfCategoriesRequest { /** * Get a paging of { @ link Category } objects .
* @ return A { @ link Category } paging .
* @ throws IOException In case of networking issues .
* @ throws SpotifyWebApiException The Web API returned an error further specified in this exception ' s root cause . */
@ Su... | return new Category . JsonUtil ( ) . createModelObjectPaging ( getJson ( ) , "categories" ) ; |
public class FileUtil { /** * 判断文件是否存在 , from Jodd .
* @ see { @ link Files # exists }
* @ see { @ link Files # isRegularFile } */
public static boolean isFileExists ( Path path ) { } } | if ( path == null ) { return false ; } return Files . exists ( path ) && Files . isRegularFile ( path ) ; |
public class ExtensionManager { /** * Notifies the extensions that the kernel is initialized */
public void initialized ( ) { } } | for ( KernelExtension kernelExtension : kernelExtensions . keySet ( ) ) { kernelExtension . initialized ( kernelExtensions . get ( kernelExtension ) ) ; } |
public class MetricRegistry { /** * Return the { @ link Timer } registered under this name ; or create and register
* a new { @ link Timer } using the provided MetricSupplier if none is registered .
* @ param name the name of the metric
* @ param supplier a MetricSupplier that can be used to manufacture a Timer
... | return getOrAdd ( name , new MetricBuilder < Timer > ( ) { @ Override public Timer newMetric ( ) { return supplier . newMetric ( ) ; } @ Override public boolean isInstance ( Metric metric ) { return Timer . class . isInstance ( metric ) ; } } ) ; |
public class ReactiveHealthIndicatorRegistryFactory { /** * Create a { @ link ReactiveHealthIndicatorRegistry } based on the specified health
* indicators . Each { @ link HealthIndicator } are wrapped to a
* { @ link HealthIndicatorReactiveAdapter } . If two instances share the same name , the
* reactive variant ... | Assert . notNull ( reactiveHealthIndicators , "ReactiveHealthIndicators must not be null" ) ; return initialize ( new DefaultReactiveHealthIndicatorRegistry ( ) , reactiveHealthIndicators , healthIndicators ) ; |
public class Recurring { /** * Get the day in month of the current month of Calendar .
* @ param cal
* @ param dayOfWeek The day of week .
* @ param orderNum The order number , 0 mean the first , - 1 mean the last .
* @ return The day int month */
private static int getDay ( Calendar cal , int dayOfWeek , int o... | int day = cal . getActualMaximum ( Calendar . DAY_OF_MONTH ) ; cal . set ( Calendar . DAY_OF_MONTH , day ) ; int lastWeekday = cal . get ( Calendar . DAY_OF_WEEK ) ; int shift = lastWeekday >= dayOfWeek ? ( lastWeekday - dayOfWeek ) : ( lastWeekday + 7 - dayOfWeek ) ; // find last dayOfWeek of this month
day -= shift ;... |
public class DirectoryHelper { /** * Compress data . In case when < code > rootPath < / code > is a directory this method
* compress all files and folders inside the directory into single one . IOException
* will be thrown if directory is empty . If the < code > rootPath < / code > is the file
* the only this fil... | ZipOutputStream zip = new ZipOutputStream ( new FileOutputStream ( dstZipPath ) ) ; try { if ( rootPath . isDirectory ( ) ) { String [ ] files = rootPath . list ( ) ; if ( files == null || files . length == 0 ) { // In java 7 no ZipException is thrown in case of an empty directory
// so to remain compatible we need to ... |
public class Http2ConnectionHandler { /** * Closes the connection if the graceful shutdown process has completed .
* @ param future Represents the status that will be passed to the { @ link # closeListener } . */
private void checkCloseConnection ( ChannelFuture future ) { } } | // If this connection is closing and the graceful shutdown has completed , close the connection
// once this operation completes .
if ( closeListener != null && isGracefulShutdownComplete ( ) ) { ChannelFutureListener closeListener = this . closeListener ; // This method could be called multiple times
// and we don ' t... |
public class ConfigArgP { /** * Performs sys - prop and js evals on the passed value
* @ param text The value to process
* @ return the processed value */
public static String processConfigValue ( CharSequence text ) { } } | final String pv = evaluate ( tokenReplaceSysProps ( text ) ) ; return ( pv == null || pv . trim ( ) . isEmpty ( ) ) ? null : pv ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.