signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AbstractBuildingType { /** * Gets the value of the genericApplicationPropertyOfAbstractBuilding property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is w... | if ( _GenericApplicationPropertyOfAbstractBuilding == null ) { _GenericApplicationPropertyOfAbstractBuilding = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfAbstractBuilding ; |
public class JavaBackedType { /** * If clazz can be represented as a JavaBackedType , returns a JavaBackedType for representing clazz .
* If clazz can not be represented as a JavaBackedType , returns BuiltInType . UNKNOWN .
* This method performs memoization when necessary .
* @ param clazz the class to be repres... | return Optional . ofNullable ( ( Type ) cache . computeIfAbsent ( clazz , JavaBackedType :: createIfAnnotated ) ) . orElse ( BuiltInType . UNKNOWN ) ; |
public class SwimMembershipProtocol { /** * Handles a probe from another peer .
* @ param members the probing member and local member info
* @ return the current term */
private ImmutableMember handleProbe ( Pair < ImmutableMember , ImmutableMember > members ) { } } | ImmutableMember remoteMember = members . getLeft ( ) ; ImmutableMember localMember = members . getRight ( ) ; LOGGER . trace ( "{} - Received probe {} from {}" , this . localMember . id ( ) , localMember , remoteMember ) ; // If the probe indicates a term greater than the local term , update the local term , increment ... |
public class ParamConvertUtils { /** * Creates a converter function that converts value using a constructor that accepts a single String argument .
* @ return A converter function or { @ code null } if the given type doesn ' t have a public constructor that accepts
* a single String argument . */
private static Con... | try { final Constructor < ? > constructor = resultClass . getConstructor ( String . class ) ; return new BasicConverter ( defaultValue ( resultClass ) ) { @ Override protected Object convert ( String value ) throws Exception { return constructor . newInstance ( value ) ; } } ; } catch ( Exception e ) { return null ; } |
public class Helpers { /** * Returns the string form of the specified key mapping to a JSON object enclosing the selector .
* < pre >
* { @ code
* Selector selector = eq ( " year " , 2017 ) ;
* System . out . println ( selector . toString ( ) ) ;
* / / Output : " year " : { " $ eq " : 2017}
* System . out .... | return String . format ( "\"%s\": %s" , key , enclose ( selector ) ) ; |
public class DescribeFileSystemsRequest { /** * ( Optional ) IDs of the file systems whose descriptions you want to retrieve ( String ) .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setFileSystemIds ( java . util . Collection ) } or { @ link # withFileSys... | if ( this . fileSystemIds == null ) { setFileSystemIds ( new java . util . ArrayList < String > ( fileSystemIds . length ) ) ; } for ( String ele : fileSystemIds ) { this . fileSystemIds . add ( ele ) ; } return this ; |
public class CommonsAssert { /** * Like JUnit assertEquals but using { @ link EqualsHelper } .
* @ param sUserMsg
* Optional user message . May be < code > null < / code > .
* @ param x
* Fist object . May be < code > null < / code >
* @ param y
* Second object . May be < code > null < / code > . */
public ... | if ( ! EqualsHelper . equals ( x , y ) ) fail ( "<" + x + "> is not equal to <" + y + ">" + ( sUserMsg != null && sUserMsg . length ( ) > 0 ? ": " + sUserMsg : "" ) ) ; |
public class Strings { /** * count inner string in host string
* @ param host
* a { @ link java . lang . String } object .
* @ param searchStr
* a { @ link java . lang . String } object .
* @ return a int . */
public static int count ( final String host , final String searchStr ) { } } | int count = 0 ; for ( int startIndex = 0 ; startIndex < host . length ( ) ; startIndex ++ ) { int findLoc = host . indexOf ( searchStr , startIndex ) ; if ( findLoc == - 1 ) { break ; } else { count ++ ; startIndex = findLoc + searchStr . length ( ) - 1 ; } } return count ; |
public class Matrix4x3f { /** * Set this matrix to a rotation matrix which rotates the given radians about a given axis .
* The axis described by the < code > axis < / code > vector needs to be a unit vector .
* When used with a right - handed coordinate system , the produced rotation will rotate a vector
* count... | return rotation ( angle , axis . x ( ) , axis . y ( ) , axis . z ( ) ) ; |
public class AutoAssignChecker { /** * Runs one page of target assignments within a dedicated transaction
* @ param targetFilterQuery
* the target filter query
* @ param dsId
* distribution set id to assign
* @ return count of targets */
private int runTransactionalAssignment ( final TargetFilterQuery targetF... | final String actionMessage = String . format ( ACTION_MESSAGE , targetFilterQuery . getName ( ) ) ; return DeploymentHelper . runInNewTransaction ( transactionManager , "autoAssignDSToTargets" , Isolation . READ_COMMITTED . value ( ) , status -> { final List < TargetWithActionType > targets = getTargetsWithActionType (... |
public class ReflectUtil { /** * Check package access on the proxy interfaces that the given proxy class
* implements .
* @ param clazz Proxy class object */
public static void checkProxyPackageAccess ( Class < ? > clazz ) { } } | SecurityManager s = System . getSecurityManager ( ) ; if ( s != null ) { // check proxy interfaces if the given class is a proxy class
if ( Proxy . isProxyClass ( clazz ) ) { for ( Class < ? > intf : clazz . getInterfaces ( ) ) { checkPackageAccess ( intf ) ; } } } |
public class BootstrapBorderBuilder { /** * Set the border radius . Default is no radius .
* @ param eRadius
* Border type . May not be < code > null < / code > .
* @ return this for chaining */
@ Nonnull public BootstrapBorderBuilder radius ( @ Nonnull final EBootstrapBorderRadiusType eRadius ) { } } | ValueEnforcer . notNull ( eRadius , "Radius" ) ; m_eRadius = eRadius ; return this ; |
public class AOPool { /** * Gets the total number of connects for the entire pool . */
final public long getConnects ( ) { } } | long total = 0 ; synchronized ( poolLock ) { for ( PooledConnection < C > conn : allConnections ) { total += conn . connectCount . get ( ) ; } } return total ; |
public class VodClient { /** * Get the HTML5 code snippet ( encoded in Base64 ) to play the specific media resource .
* @ param request The request object containing all the options on how to
* @ return The Flash and HTML5 code snippet */
public GenerateMediaPlayerCodeResponse generateMediaPlayerCode ( GenerateMedi... | checkStringNotEmpty ( request . getMediaId ( ) , "Media ID should not be null or empty!" ) ; checkIsTrue ( request . getHeight ( ) > 0 , "Height of playback view should be positive!" ) ; checkIsTrue ( request . getWidth ( ) > 0 , "Width of playback view should be positive!" ) ; InternalRequest internalRequest = createR... |
public class SDBaseOps { /** * Less than operation : elementwise x < y < br >
* If x and y arrays have equal shape , the output shape is the same as these inputs . < br >
* Note : supports broadcasting if x and y have different shapes and are broadcastable . < br >
* Returns an array with values 1 where condition... | return lt ( null , x , y ) ; |
public class PreferenceFragment { /** * Restores the default values of all preferences , which are contained by the fragment . */
public final void restoreDefaults ( ) { } } | SharedPreferences sharedPreferences = getPreferenceManager ( ) . getSharedPreferences ( ) ; if ( getPreferenceScreen ( ) != null ) { restoreDefaults ( getPreferenceScreen ( ) , sharedPreferences ) ; } |
public class ObjectDAO { /** * Returns a list of objects that are similar to the specified object
* @ param object
* @ param threshold
* @ return */
public List < Similarity > similar ( Image object , double threshold ) { } } | // return getDatastore ( ) . find ( Similarity . class ) . field ( " firstObject " ) . equal ( object ) . order ( " similarityScore " ) . asList ( ) ;
Query < Similarity > q = getDatastore ( ) . createQuery ( Similarity . class ) ; q . or ( q . criteria ( "firstObject" ) . equal ( object ) , q . criteria ( "secondObjec... |
public class Emitter { /** * syck _ emitter _ mark _ node */
public long markNode ( Object n ) { } } | long oid = 0 ; if ( this . markers == null ) { this . markers = new IdentityHashMap < Object , Long > ( ) ; } if ( ! this . markers . containsKey ( n ) ) { oid = this . markers . size ( ) + 1 ; markers . put ( n , oid ) ; } else { oid = this . markers . get ( n ) ; if ( this . anchors == null ) { this . anchors = new H... |
public class LockedMessageEnumerationImpl { /** * Private method to determine how many messages have not been seen as yet . It does this by
* looking at the number of non - null elements from the current item to the end of the array .
* @ return Returns the number of unseen items . */
private int getUnSeenMessageCo... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getUnseenMessageCount" ) ; int remain = 0 ; for ( int x = nextIndex ; x < messages . length ; x ++ ) { if ( messages [ x ] != null ) remain ++ ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ... |
public class Journaler { /** * Delegate to the JournalWorker . */
public Date purgeObject ( Context context , String pid , String logMessage ) throws ServerException { } } | return worker . purgeObject ( context , pid , logMessage ) ; |
public class JQMList { /** * Find the divider with the given text . This method will search all the dividers and return the first divider
* found with the given text .
* @ return the divider with the given text ( if found , or null otherwise ) . */
public JQMListDivider findDivider ( String text ) { } } | for ( int k = 0 ; k < list . getWidgetCount ( ) ; k ++ ) { Widget w = list . getWidget ( k ) ; if ( isDivider ( w ) && w . getElement ( ) . getInnerText ( ) . equals ( text ) ) { return ( JQMListDivider ) w ; } } return null ; |
public class FixedCalendarInterval { /** * helper method for toString ( ) in subclasses */
static void formatYear ( StringBuilder sb , int year ) { } } | int value = year ; if ( value < 0 ) { sb . append ( '-' ) ; value = Math . negateExact ( year ) ; } if ( value >= 10000 ) { if ( year > 0 ) { sb . append ( '+' ) ; } } else if ( value < 1000 ) { sb . append ( '0' ) ; if ( value < 100 ) { sb . append ( '0' ) ; if ( value < 10 ) { sb . append ( '0' ) ; } } } sb . append ... |
public class Job { /** * Set the value class for job outputs .
* @ param theClass the value class for job outputs .
* @ throws IllegalStateException if the job is submitted */
public void setOutputValueClass ( Class < ? > theClass ) throws IllegalStateException { } } | ensureState ( JobState . DEFINE ) ; conf . setOutputValueClass ( theClass ) ; |
public class HeapClusterAnalyzer { /** * Process entry point and blacklist configuration */
public void prepare ( ) { } } | for ( JavaClass jc : heap . getAllClasses ( ) ) { for ( TypeFilterStep it : interestingTypes ) { if ( it . evaluate ( jc ) ) { rootClasses . add ( jc . getName ( ) ) ; } } for ( TypeFilterStep bt : blacklistedTypes ) { if ( bt . evaluate ( jc ) ) { blacklist . add ( jc . getName ( ) ) ; } } for ( PathStep [ ] bp : blac... |
public class TxtmarkMarkdownConverter { /** * / * ( non - Javadoc )
* @ see org . opoo . press . Converter # convert ( java . lang . String ) */
@ Override public String convert ( String content ) { } } | if ( config != null ) { return Processor . process ( content , config ) ; } else { return Processor . process ( content ) ; } |
public class Transaction { /** * Rolls a transaction back and releases all read locks . */
ApiFuture < Void > rollback ( ) { } } | pending = false ; RollbackRequest . Builder reqBuilder = RollbackRequest . newBuilder ( ) ; reqBuilder . setTransaction ( transactionId ) ; reqBuilder . setDatabase ( firestore . getDatabaseName ( ) ) ; ApiFuture < Empty > rollbackFuture = firestore . sendRequest ( reqBuilder . build ( ) , firestore . getClient ( ) . r... |
public class OidcClientRegistrationUtils { /** * Gets client registration response .
* @ param registeredService the registered service
* @ param serverPrefix the server prefix
* @ return the client registration response */
@ SneakyThrows public static OidcClientRegistrationResponse getClientRegistrationResponse ... | val clientResponse = new OidcClientRegistrationResponse ( ) ; clientResponse . setApplicationType ( registeredService . getApplicationType ( ) ) ; clientResponse . setClientId ( registeredService . getClientId ( ) ) ; clientResponse . setClientSecret ( registeredService . getClientSecret ( ) ) ; clientResponse . setSub... |
public class BeanMap { /** * { @ inheritDoc }
* Returns the value of the bean ' s property with the given name .
* < br >
* The given name must be a { @ link String } and must not be
* null ; otherwise , this method returns < code > null < / code > .
* If the bean defines a property with the given name , the ... | if ( bean != null ) { BeanInvoker invoker = getReadInvoker ( ( String ) name ) ; if ( invoker != null ) { try { return transform ( invoker ) ; } catch ( Throwable e ) { throw new IllegalArgumentException ( e ) ; } } } return null ; |
public class KMLOutputHandler { /** * Get color from a simple heatmap .
* @ param val Score value
* @ return Color in heatmap */
public static final Color getColorForValue ( double val ) { } } | // Color positions
double [ ] pos = new double [ ] { 0.0 , 0.6 , 0.8 , 1.0 } ; // Colors at these positions
Color [ ] cols = new Color [ ] { new Color ( 0.0f , 0.0f , 0.0f , 0.6f ) , new Color ( 0.0f , 0.0f , 1.0f , 0.8f ) , new Color ( 1.0f , 0.0f , 0.0f , 0.9f ) , new Color ( 1.0f , 1.0f , 0.0f , 1.0f ) } ; assert ( ... |
public class MetadataService { /** * Adds { @ link Permission } s to the specified { @ code path } . */
private CompletableFuture < Revision > addPermissionAtPointer ( Author author , String projectName , JsonPointer path , Collection < Permission > permission , String commitSummary ) { } } | final Change < JsonNode > change = Change . ofJsonPatch ( METADATA_JSON , asJsonArray ( new TestAbsenceOperation ( path ) , new AddOperation ( path , Jackson . valueToTree ( permission ) ) ) ) ; return metadataRepo . push ( projectName , Project . REPO_DOGMA , author , commitSummary , change ) ; |
public class CommonsArchiver { /** * Returns a new ArchiveInputStream for reading archives . Subclasses can override this to return their own custom
* implementation .
* @ param archive the archive file to stream from
* @ return a new ArchiveInputStream for the given archive file
* @ throws IOException propagat... | try { return CommonsStreamFactory . createArchiveInputStream ( archive ) ; } catch ( ArchiveException e ) { throw new IOException ( e ) ; } |
public class HString { /** * Left context h string .
* @ param type the type
* @ param windowSize the window size
* @ return the h string */
public HString leftContext ( @ NonNull AnnotationType type , int windowSize ) { } } | windowSize = Math . abs ( windowSize ) ; Preconditions . checkArgument ( windowSize >= 0 ) ; int sentenceStart = sentence ( ) . start ( ) ; if ( windowSize == 0 || start ( ) <= sentenceStart ) { return Fragments . detachedEmptyHString ( ) ; } HString context = firstToken ( ) . previous ( type ) ; for ( int i = 1 ; i < ... |
public class TileConfiguration { /** * Get the index for the fixed resolution that is closest to the provided resolution .
* @ param resolution The resolution to request the closest fixed resolution level for .
* @ return Returns the fixed resolution level index . */
public int getResolutionIndex ( double resolutio... | double maximumResolution = getMaximumResolution ( ) ; if ( resolution >= maximumResolution ) { return 0 ; } double minimumResolution = getMinimumResolution ( ) ; if ( resolution <= minimumResolution ) { return resolutions . size ( ) - 1 ; } for ( int i = 0 ; i < resolutions . size ( ) ; i ++ ) { double upper = resoluti... |
public class CompactionJobConfigurator { /** * Concatenate multiple directory or file names into one path
* @ return Concatenated path or null if the parameter is empty */
private Path concatPaths ( String ... names ) { } } | if ( names == null || names . length == 0 ) { return null ; } Path cur = new Path ( names [ 0 ] ) ; for ( int i = 1 ; i < names . length ; ++ i ) { cur = new Path ( cur , new Path ( names [ i ] ) ) ; } return cur ; |
public class Array { /** * Adds an entry to the end of an array and returns the new array .
* @ param ar array to be resized
* @ param e entry to be added
* @ param < T > array type
* @ return array */
public static < T > T [ ] add ( final T [ ] ar , final T e ) { } } | final int s = ar . length ; final T [ ] t = Arrays . copyOf ( ar , s + 1 ) ; t [ s ] = e ; return t ; |
public class LPPrimalDualMethod { /** * Return the upper bounds for the problem . If the original upper bounds are null , the they are set to
* the value of < i > maxUBValue < / i > . Otherwise , any upper bound is limited to the value of < i > maxUBValue < / i > */
@ Override protected DoubleMatrix1D getUb ( ) { } } | if ( this . limitedUb == null ) { if ( super . getUb ( ) == null ) { this . limitedUb = F1 . make ( getC ( ) . size ( ) , maxUBValue ) ; } else { this . limitedUb = F1 . make ( super . getUb ( ) . size ( ) ) ; for ( int i = 0 ; i < super . getUb ( ) . size ( ) ; i ++ ) { double ubi = super . getUb ( ) . getQuick ( i ) ... |
public class ExportClientVpnClientCertificateRevocationListRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < ExportClientVpnClientCertificateRevocationListRequest > getDry... | Request < ExportClientVpnClientCertificateRevocationListRequest > request = new ExportClientVpnClientCertificateRevocationListRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class Props { /** * Check key in current Props then search in parent */
public boolean containsKey ( final Object k ) { } } | return this . _current . containsKey ( k ) || ( this . _parent != null && this . _parent . containsKey ( k ) ) ; |
public class TrustedIdProvidersInner { /** * Updates the specified trusted identity provider .
* @ param resourceGroupName The name of the Azure resource group .
* @ param accountName The name of the Data Lake Store account .
* @ param trustedIdProviderName The name of the trusted identity provider . This is used... | return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , accountName , trustedIdProviderName ) , serviceCallback ) ; |
public class SimpleKeyValue { /** * Factory method used to construct a new instance of { @ link SimpleKeyValue } initialized from the given { @ link Map . Entry } .
* @ param < KEY > { @ link Class type } of the key .
* @ param < VALUE > { @ link Class type } of the value .
* @ param mapEntry { @ link Map . Entry... | Assert . notNull ( mapEntry , "Map.Entry is required" ) ; return newKeyValue ( mapEntry . getKey ( ) , mapEntry . getValue ( ) ) ; |
public class Matrix4f { /** * Apply a symmetric perspective projection frustum transformation for a left - handed coordinate system
* using the given NDC z range to this matrix .
* If < code > M < / code > is < code > this < / code > matrix and < code > P < / code > the perspective projection matrix ,
* then the ... | return perspectiveLH ( fovy , aspect , zNear , zFar , zZeroToOne , thisOrNew ( ) ) ; |
public class FixtureCompilerMojo { /** * { @ inheritDoc } */
@ Override public void execute ( ) throws MojoExecutionException , CompilationFailureException { } } | if ( skip ) { getLog ( ) . info ( "Not compiling fixture sources." ) ; } else { getLog ( ) . info ( "Compiling fixture sources at " + fixtureSourceDirectory . getAbsolutePath ( ) ) ; getLog ( ) . info ( "to directory " + fixtureOutputDirectory . getAbsolutePath ( ) ) ; super . execute ( ) ; } |
public class Base64 { /** * Decodes bytes from base 64 , returning bytes .
* @ param in bytes to decode
* @ return decoded bytes */
public static byte [ ] decode ( byte [ ] in ) { } } | return org . apache . commons . codec . binary . Base64 . decodeBase64 ( in ) ; |
public class ToStringGenerator { /** * Generates a toString method using concatenation or a StringBuilder . */
public static void addToString ( SourceBuilder code , Datatype datatype , Map < Property , PropertyCodeGenerator > generatorsByProperty , boolean forPartial ) { } } | String typename = ( forPartial ? "partial " : "" ) + datatype . getType ( ) . getSimpleName ( ) ; Predicate < PropertyCodeGenerator > isOptional = generator -> { Initially initially = generator . initialState ( ) ; return ( initially == Initially . OPTIONAL || ( initially == Initially . REQUIRED && forPartial ) ) ; } ;... |
public class MediaModuleGenerator { /** * Generation of responses tag .
* @ param m source
* @ param e element to attach new element to */
private void generateResponses ( final Metadata m , final Element e ) { } } | if ( m . getResponses ( ) == null || m . getResponses ( ) . length == 0 ) { return ; } final Element responsesElements = new Element ( "responses" , NS ) ; for ( final String response : m . getResponses ( ) ) { addNotNullElement ( responsesElements , "response" , response ) ; } e . addContent ( responsesElements ) ; |
public class Session { /** * Executes SQL query , which returns single entity .
* @ param < T > Entity type .
* @ param query SQL query string .
* @ param entityClass Entity class .
* @ param params Parameters , which will be placed instead of ' ? ' signs .
* @ return Single result entity .
* @ throws SQLEx... | Cursor < T > cursor = getCursor ( query , entityClass , params ) ; return cursor . fetchSingle ( ) ; |
public class TrmMessageFactoryImpl { /** * Create a new , empty TrmMeConnectReply message
* @ return The new TrmMeConnectReply .
* @ exception MessageCreateFailedException Thrown if such a message can not be created */
public TrmMeConnectReply createNewTrmMeConnectReply ( ) throws MessageCreateFailedException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeConnectReply" ) ; TrmMeConnectReply msg = null ; try { msg = new TrmMeConnectReplyImpl ( ) ; } catch ( MessageDecodeFailedException e ) { /* No need to FFDC this as JsMsgObject will already have done so */
// ... |
public class ExpressRouteGatewaysInner { /** * Fetches the details of a ExpressRoute gateway in a resource group .
* @ param resourceGroupName The name of the resource group .
* @ param expressRouteGatewayName The name of the ExpressRoute gateway .
* @ throws IllegalArgumentException thrown if parameters fail the... | return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , expressRouteGatewayName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class Topic { public void remove ( SubjectObserver < T > subjectObserver ) { } } | if ( subjectObserver == null || subjectObserver . getId ( ) == null || subjectObserver . getId ( ) . length ( ) == 0 ) return ; // do nothing
// remove
observerMap . remove ( subjectObserver . getId ( ) ) ; |
public class SecurityUtils { /** * An app can edit itself or delete itself . It can ' t read , edit , overwrite or delete other apps , unless it is the
* root app .
* @ param app an app
* @ param object another object
* @ return true if app passes the check */
public static boolean checkImplicitAppPermissions (... | if ( app != null && object != null ) { return isNotAnApp ( object . getType ( ) ) || app . getId ( ) . equals ( object . getId ( ) ) || app . isRootApp ( ) ; } return false ; |
public class Requests { /** * Create a new { @ link PublishUpdate } instance that is used to publish
* a list of metadata on a link between two { @ link Identifier } instances
* with a specific { @ link MetadataLifetime } .
* @ param i1 the first { @ link Identifier } of the link
* @ param i2 the second { @ lin... | if ( mdlist == null ) { throw new NullPointerException ( "mdlist not allowed to be null" ) ; } PublishUpdate pu = createPublishUpdate ( ) ; fillMetadataHolder ( pu , i1 , i2 , mdlist ) ; pu . setLifeTime ( lifetime ) ; return pu ; |
public class ClassHash { /** * Set class hash .
* @ param classHash
* the class hash value to set */
public void setClassHash ( byte [ ] classHash ) { } } | this . classHash = new byte [ classHash . length ] ; System . arraycopy ( classHash , 0 , this . classHash , 0 , classHash . length ) ; |
public class RenderScopedContext { /** * Context Methods */
@ SuppressWarnings ( "unchecked" ) public < T > T get ( final Contextual < T > component ) { } } | assertActive ( ) ; return ( T ) getComponentInstanceMap ( ) . get ( component ) ; |
public class Router { /** * TODO : To be compatible with CBL iOS , this method should move to Replicator . activeTaskInfo ( ) .
* TODO : Reference : - ( NSDictionary * ) activeTaskInfo in CBL _ Replicator . m */
private static Map < String , Object > getActivity ( Replication replicator ) { } } | // For schema , see http : / / wiki . apache . org / couchdb / HttpGetActiveTasks
Map < String , Object > activity = new HashMap < String , Object > ( ) ; String source = replicator . getRemoteUrl ( ) . toExternalForm ( ) ; String target = replicator . getLocalDatabase ( ) . getName ( ) ; if ( ! replicator . isPull ( )... |
public class CmsCategoryDialog { /** * Initializes the dialog content . < p >
* @ param categoryInfo the resource category info */
public void initialize ( CmsResourceCategoryInfo categoryInfo ) { } } | m_initializing = false ; m_initialized = true ; m_main . add ( new CmsListItemWidget ( categoryInfo . getResourceInfo ( ) ) ) ; m_categoryTree = new CmsCategoryTree ( categoryInfo . getCurrentCategories ( ) , 300 , false , categoryInfo . getCategoryTree ( ) , m_collapsed ) ; m_categoryTree . addValueChangeHandler ( new... |
public class Txt2Bin { /** * 输出模型
* @ param inText
* @ param outBin
* @ throws IOException */
private static void text2binModel ( String inText , String outBin ) throws IOException { } } | ObjectOutputStream out = new ObjectOutputStream ( new BufferedOutputStream ( new GZIPOutputStream ( new FileOutputStream ( outBin ) ) ) ) ; String rules = loadtxt ( inText ) ; Pattern p = Pattern . compile ( rules ) ; out . writeObject ( p ) ; out . close ( ) ; |
public class TorqueModelDef { /** * Adds a table for the given class descriptor ( if necessary ) .
* @ param classDef The class descriptor */
private void addTableFor ( ClassDescriptorDef classDef ) { } } | String name = classDef . getProperty ( PropertyHelper . OJB_PROPERTY_TABLE ) ; TableDef tableDef = getTable ( name ) ; FieldDescriptorDef fieldDef ; ReferenceDescriptorDef refDef ; CollectionDescriptorDef collDef ; ColumnDef columnDef ; IndexDef indexDef ; if ( tableDef == null ) { tableDef = new TableDef ( name ) ; ad... |
public class JobScheduler { /** * Executes a { @ link ScheduledJob } immediately .
* @ param scheduledJobId ID of the { @ link ScheduledJob } to run */
public synchronized void runNow ( String scheduledJobId ) { } } | ScheduledJob scheduledJob = getJob ( scheduledJobId ) ; try { JobKey jobKey = new JobKey ( scheduledJobId , SCHEDULED_JOB_GROUP ) ; if ( quartzScheduler . checkExists ( jobKey ) ) { // Run job now
quartzScheduler . triggerJob ( jobKey ) ; } else { // Schedule with ' now ' trigger
Trigger trigger = newTrigger ( ) . with... |
public class LongStreamEx { /** * Returns the maximum element of this stream according to the provided key
* extractor function .
* This is a terminal operation .
* @ param keyExtractor a non - interfering , stateless function
* @ return an { @ code OptionalLong } describing the first element of this
* stream... | return collect ( PrimitiveBox :: new , ( box , l ) -> { int key = keyExtractor . applyAsInt ( l ) ; if ( ! box . b || box . i < key ) { box . b = true ; box . i = key ; box . l = l ; } } , PrimitiveBox . MAX_INT ) . asLong ( ) ; |
public class CommonDataProvider { /** * Writes some data as result .
* @ param column
* The column name
* @ param line
* The line number
* @ param value
* The data value */
public void writeDataResult ( String column , int line , String value ) { } } | logger . debug ( "Write Data result => column:{} line:{} value:{}" , column , line , value ) ; writeValue ( column , line , value ) ; |
public class AppServiceEnvironmentsInner { /** * Get metric definitions for a specific instance of a multi - role pool of an App Service Environment .
* Get metric definitions for a specific instance of a multi - role pool of an App Service Environment .
* @ param resourceGroupName Name of the resource group to whi... | return listMultiRolePoolInstanceMetricDefinitionsWithServiceResponseAsync ( resourceGroupName , name , instance ) . map ( new Func1 < ServiceResponse < Page < ResourceMetricDefinitionInner > > , Page < ResourceMetricDefinitionInner > > ( ) { @ Override public Page < ResourceMetricDefinitionInner > call ( ServiceRespons... |
public class DFSClient { /** * Move blocks from src to trg and delete src
* See { @ link ClientProtocol # concat ( String , String [ ] ) } . */
public void concat ( String trg , String [ ] srcs , boolean restricted ) throws IOException { } } | checkOpen ( ) ; clearFileStatusCache ( ) ; try { if ( namenodeProtocolProxy != null && namenodeProtocolProxy . isMethodSupported ( "concat" , String . class , String [ ] . class , boolean . class ) ) { namenode . concat ( trg , srcs , restricted ) ; } else if ( ! restricted ) { throw new UnsupportedOperationException (... |
public class UnionPayApi { /** * 退货交 、 撤销交易
* @ param reqData
* 请求参数
* @ return { Map < String , String > } */
@ Deprecated public static Map < String , String > refundByMap ( Map < String , String > reqData ) { } } | return SDKUtil . convertResultStringToMap ( refund ( reqData ) ) ; |
public class ConnectorTypeImpl { /** * If not already created , a new < code > license < / code > element with the given value will be created .
* Otherwise , the existing < code > license < / code > element will be returned .
* @ return a new or existing instance of < code > LicenseType < ConnectorType < T > > < /... | Node node = childNode . getOrCreate ( "license" ) ; LicenseType < ConnectorType < T > > license = new LicenseTypeImpl < ConnectorType < T > > ( this , "license" , childNode , node ) ; return license ; |
public class PinViewBaseHelper { /** * Set a Title with all attributes
* @ param pinTitle to set attributes */
private void setStylesPinTitle ( TextView pinTitle ) { } } | if ( mColorTextTitles != PinViewSettings . DEFAULT_TEXT_COLOR_TITLES ) { pinTitle . setTextColor ( mColorTextTitles ) ; } pinTitle . setTextSize ( PinViewUtils . convertPixelToDp ( getContext ( ) , mTextSizeTitles ) ) ; |
public class CmsSiteManagerImpl { /** * Returns the site for the given resource path , using the fall back site root
* in case the resource path is no root path . < p >
* In case neither the given resource path , nor the given fall back site root
* matches any configured site , the default site is returned . < p ... | CmsSite result = getSiteForRootPath ( rootPath ) ; if ( result == null ) { result = getSiteForSiteRoot ( fallbackSiteRoot ) ; if ( result == null ) { result = getDefaultSite ( ) ; } } return result ; |
public class CreateDeploymentGroupRequest { /** * The target Amazon ECS services in the deployment group . This applies only to deployment groups that use the
* Amazon ECS compute platform . A target Amazon ECS service is specified as an Amazon ECS cluster and service name
* pair using the format < code > & lt ; cl... | if ( this . ecsServices == null ) { setEcsServices ( new com . amazonaws . internal . SdkInternalList < ECSService > ( ecsServices . length ) ) ; } for ( ECSService ele : ecsServices ) { this . ecsServices . add ( ele ) ; } return this ; |
public class CatalogMetadataBuilder { /** * Adds tables to the catalog .
* @ param tableMetadataList the table metadata list
* @ return the catalog metadata builder */
@ TimerJ public CatalogMetadataBuilder withTables ( TableMetadata ... tableMetadataList ) { } } | for ( TableMetadata tableMetadata : tableMetadataList ) { tables . put ( tableMetadata . getName ( ) , tableMetadata ) ; } return this ; |
public class LBiDblFunctionBuilder { /** * 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 < R > LBiDblFunction < R > biDblFunctionFrom ( Consumer < LBiDblFunctionBuilder < R > > buildingFunction ) { } } | LBiDblFunctionBuilder builder = new LBiDblFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class JsMessageImpl { /** * Common prefix for all trace summary lines of messages that stem from the
* JsMessage side of the MFP class structure .
* All subclasses should call this , and then append any additional details
* if applicable . */
public void getTraceSummaryLine ( StringBuilder buff ) { } } | buff . append ( "MESSAGE:" ) ; buff . append ( "type=" ) ; buff . append ( getJsMessageType ( ) ) ; buff . append ( ",id=" ) ; buff . append ( getSystemMessageId ( ) ) ; buff . append ( ",proto=" ) ; buff . append ( getGuaranteedProtocolType ( ) ) ; buff . append ( ",tick=" ) ; buff . append ( getGuaranteedValueValueTi... |
public class HTMLExtractor { /** * Checks if any of the elements matched by the { @ code selector } contain the attribute { @ code attributeName } with value { @ code
* attributeValue } . The { @ code url } is used only for caching purposes , to avoid parsing multiple times the markup returned for the
* same resour... | ensureMarkup ( url , markup ) ; Document document = documents . get ( url ) ; Elements elements = document . select ( selector ) ; return ! elements . isEmpty ( ) && elements . hasAttr ( attributeName ) && attributeValue . equals ( elements . attr ( attributeName ) ) ; |
public class DTMDocumentImpl { /** * Replaces the deprecated DocumentHandler interface . */
public void characters ( char [ ] ch , int start , int length ) throws org . xml . sax . SAXException { } } | // Actually creating the text node is handled by
// processAccumulatedText ( ) ; here we just accumulate the
// characters into the buffer .
m_char . append ( ch , start , length ) ; |
public class BridgeMethodResolver { /** * Determines whether or not the bridge { @ link Method } is the bridge for the
* supplied candidate { @ link Method } . */
static boolean isBridgeMethodFor ( Method bridgeMethod , Method candidateMethod , Map < TypeVariable , Type > typeVariableMap ) { } } | if ( isResolvedTypeMatch ( candidateMethod , bridgeMethod , typeVariableMap ) ) { return true ; } Method method = findGenericDeclaration ( bridgeMethod ) ; return ( method != null && isResolvedTypeMatch ( method , candidateMethod , typeVariableMap ) ) ; |
public class MotionEventUtils { /** * Calculate the horizontal move motion direction .
* @ param e1 start point of the motion .
* @ param e2 end point of the motion .
* @ param threshold threshold to detect the motion .
* @ return the motion direction for the horizontal axis . */
public static MotionDirection g... | float delta = getHorizontalMotionRawDelta ( e1 , e2 ) ; return getHorizontalMotionDirection ( delta , threshold ) ; |
public class Tracy { /** * In case where an exception is thrown Tracy . frameError ( errorString ) can be used to
* close Tracy stack frame with a user error message while still flow to continue . < br >
* This can be useful when in a retry exception where the task may be recoverable . < br >
* If the current fra... | TracyThreadContext ctx = threadContext . get ( ) ; if ( isValidContext ( ctx ) ) { ctx . popFrameWithError ( error ) ; } |
public class ParaClient { /** * Checks if a subject is allowed to call method X on resource Y .
* @ param subjectid subject id
* @ param resourcePath resource path or object type
* @ param httpMethod HTTP method name
* @ return true if allowed */
public boolean isAllowedTo ( String subjectid , String resourcePa... | if ( StringUtils . isBlank ( subjectid ) || StringUtils . isBlank ( resourcePath ) || StringUtils . isBlank ( httpMethod ) ) { return false ; } resourcePath = Utils . urlEncode ( resourcePath ) ; String url = Utils . formatMessage ( "_permissions/{0}/{1}/{2}" , subjectid , resourcePath , httpMethod ) ; Boolean result =... |
public class Seq { /** * Merge series of adjacent elements which satisfy the given predicate using the merger function .
* < p > Example :
* < pre >
* < code >
* Seq . of ( new Integer [ 0 ] ) . collapse ( ( a , b ) - > a < b , Collectors . summingInt ( Fn . unboxI ( ) ) ) = > [ ]
* Seq . of ( 1 ) . collapse ... | N . checkArgNotNull ( collapsible ) ; N . checkArgNotNull ( collector ) ; final List < R > result = new ArrayList < > ( ) ; final Supplier < A > supplier = collector . supplier ( ) ; final BiConsumer < A , ? super T > accumulator = collector . accumulator ( ) ; final Function < A , R > finisher = collector . finisher (... |
public class PolicyMappingsExtension { /** * Delete the attribute value . */
public void delete ( String name ) throws IOException { } } | if ( name . equalsIgnoreCase ( MAP ) ) { maps = null ; } else { throw new IOException ( "Attribute name not recognized by " + "CertAttrSet:PolicyMappingsExtension." ) ; } encodeThis ( ) ; |
public class TokenLoader { /** * Tries to dispatch tokens ; returns true if tokens were successfully queued .
* Detects when queue is full and in that case returns false .
* @ return returns true if tokens were successfully queued ; returns false if queue was full */
private boolean tryToDispatchTokens ( MessageHol... | try { dispatchTokensEvent . fire ( msg ) ; return true ; } catch ( MessageDeliveryException e ) { Throwable cause = e . getCause ( ) ; if ( isQueueFullException ( cause ) ) { return false ; } throw e ; } |
public class SOS { /** * Vote for neighbors not being outliers . The key method of SOS .
* @ param ignore Object to ignore
* @ param di Neighbor object IDs .
* @ param p Probabilities
* @ param norm Normalization factor ( 1 / sum )
* @ param scores Output score storage */
public static void nominateNeighbors ... | for ( di . seek ( 0 ) ; di . valid ( ) ; di . advance ( ) ) { if ( DBIDUtil . equal ( ignore , di ) ) { continue ; } double v = p [ di . getOffset ( ) ] * norm ; // Normalize
if ( ! ( v > 0 ) ) { break ; } scores . putDouble ( di , scores . doubleValue ( di ) * ( 1 - v ) ) ; } |
public class JaxbPUnit10 { /** * Gets the value of the excludeUnlistedClasses property . < p >
* Note that the default value defined in the 1.0 persistence xsd is ' false ' ,
* however , that is for when the stanza is specified , but without a value .
* If the stanza is not present in persistence . xml , then the... | // The JAXB generated classes will return ' false ' if the stanza was
// specified , but without a value
Boolean exclude = ivPUnit . isExcludeUnlistedClasses ( ) ; // The version 1.0 persistence . xsd spelled out the default for
// exclude - unlisted - classes is false .
// This means there are 4 choices :
// < exclude... |
public class AbstractDatabase { /** * Adds a new mapping for given eFaps column type used for mapping from and
* to the SQL database .
* @ param _ columnType column type within eFaps
* @ param _ writeTypeName SQL type name used to write ( create new column
* within a SQL table )
* @ param _ nullValueSelect nu... | this . writeColTypeMap . put ( _columnType , _writeTypeName ) ; this . nullValueColTypeMap . put ( _columnType , _nullValueSelect ) ; for ( final String readTypeName : _readTypeNames ) { Set < AbstractDatabase . ColumnType > colTypes = this . readColTypeMap . get ( readTypeName ) ; if ( colTypes == null ) { colTypes = ... |
public class NodeUtil { /** * An operator taking only one operand .
* These all parse very similarly , taking LeftHandSideExpression operands . */
static boolean isUnaryOperatorType ( Token type ) { } } | switch ( type ) { case DELPROP : case VOID : case TYPEOF : case POS : case NEG : case BITNOT : case NOT : return true ; default : return false ; } |
public class TimeSensor { /** * Set the TimeSensor ' s cycleInterval property
* Currently , this does not change the duration of the animation .
* @ param newCycleInterval */
public void setCycleInterval ( float newCycleInterval ) { } } | if ( ( this . cycleInterval != newCycleInterval ) && ( newCycleInterval > 0 ) ) { for ( GVRNodeAnimation gvrKeyFrameAnimation : gvrKeyFrameAnimations ) { // TODO Cannot easily change the GVRAnimation ' s GVRChannel once set .
} this . cycleInterval = newCycleInterval ; } |
public class TranslateToPyExprVisitor { /** * { @ inheritDoc }
* < p > The source of available functions is a look - up map provided by Guice in { @ link
* SharedModule # provideSoyFunctionsMap } .
* @ see BuiltinFunction
* @ see SoyPySrcFunction */
@ Override protected PyExpr visitFunctionNode ( FunctionNode n... | Object soyFunction = node . getSoyFunction ( ) ; if ( soyFunction instanceof BuiltinFunction ) { return visitNonPluginFunction ( node , ( BuiltinFunction ) soyFunction ) ; } else if ( soyFunction instanceof SoyPythonSourceFunction ) { return pluginValueFactory . applyFunction ( node . getSourceLocation ( ) , node . get... |
public class WorkspaceUtils { /** * Serializes the specified workspace to a JSON string .
* @ param workspace a Workspace instance
* @ param indentOutput whether to indent the output ( prettify )
* @ return a JSON string
* @ throws Exception if something goes wrong */
public static String toJson ( Workspace wor... | if ( workspace == null ) { throw new IllegalArgumentException ( "A workspace must be provided." ) ; } JsonWriter jsonWriter = new JsonWriter ( indentOutput ) ; StringWriter stringWriter = new StringWriter ( ) ; jsonWriter . write ( workspace , stringWriter ) ; stringWriter . flush ( ) ; stringWriter . close ( ) ; retur... |
public class OriginateBaseClass { /** * It is important that this method is synchronised as there is some
* interaction between the events and we need to ensure we process one at a
* time . */
@ Override synchronized public void onManagerEvent ( final ManagerEvent event ) { } } | if ( event instanceof HangupEvent ) { final HangupEvent hangupEvt = ( HangupEvent ) event ; final Channel hangupChannel = hangupEvt . getChannel ( ) ; if ( channelId . equals ( hangupEvt . getUniqueId ( ) ) ) { this . originateSuccess = false ; OriginateBaseClass . logger . warn ( "Dest channel " + this . newChannel + ... |
public class RingByteBuffer { /** * Writes bytes from mark ( included ) to position ( excluded ) to bb as much as
* bb has remaining . bb positions are updated .
* @ param bb
* @ return
* @ throws IOException */
public int writeTo ( ByteBuffer bb ) throws IOException { } } | return writeTo ( ( srcs , offset , len ) -> ByteBuffers . move ( srcs , offset , len , bb ) , writeToSplitter ) ; |
public class AccessClassLoader { /** * Returns null if the access class has not yet been defined . */
Class loadAccessClass ( String name ) { } } | // No need to check the parent class loader if the access class hasn ' t been defined yet .
if ( localClassNames . contains ( name ) ) { try { return loadClass ( name , false ) ; } catch ( ClassNotFoundException ex ) { throw new RuntimeException ( ex ) ; // Should not happen , since we know the class has been defined .... |
public class Validate { /** * Method without varargs to increase performance */
public static < T > T [ ] noNullElements ( final T [ ] array , final String message ) { } } | return INSTANCE . noNullElements ( array , message ) ; |
public class ConvertibleType { /** * Returns the conversion type for the generic type . */
private static < T > ConvertibleType < T > of ( Type genericType ) { } } | final Class < T > targetType ; if ( genericType instanceof Class ) { targetType = ( Class < T > ) genericType ; } else if ( genericType instanceof ParameterizedType ) { targetType = ( Class < T > ) ( ( ParameterizedType ) genericType ) . getRawType ( ) ; } else if ( genericType . toString ( ) . equals ( "byte[]" ) ) { ... |
public class MoveMetaModule { /** * Push information from topicmeta in the map into the corresponding topics and maps . */
private void pushMetadata ( final Map < URI , Map < String , Element > > mapSet ) { } } | if ( ! mapSet . isEmpty ( ) ) { // process map first
final DitaMapMetaWriter mapInserter = new DitaMapMetaWriter ( ) ; mapInserter . setLogger ( logger ) ; mapInserter . setJob ( job ) ; for ( final Entry < URI , Map < String , Element > > entry : mapSet . entrySet ( ) ) { final URI key = stripFragment ( entry . getKey... |
public class HBase94QueueConsumer { /** * Creates a HBase filter that will filter out rows that that has committed state = PROCESSED . */
private Filter createFilter ( ) { } } | return new FilterList ( FilterList . Operator . MUST_PASS_ONE , processedStateFilter , new SingleColumnValueFilter ( QueueEntryRow . COLUMN_FAMILY , stateColumnName , CompareFilter . CompareOp . GREATER , new BinaryPrefixComparator ( Bytes . toBytes ( transaction . getReadPointer ( ) ) ) ) ) ; |
public class RecurlyClient { /** * Return all the invoices given query params
* @ param params { @ link QueryParams }
* @ return the count of invoices matching the query */
public int getInvoicesCount ( final QueryParams params ) { } } | FluentCaseInsensitiveStringsMap map = doHEAD ( Invoices . INVOICES_RESOURCE , params ) ; return Integer . parseInt ( map . getFirstValue ( X_RECORDS_HEADER_NAME ) ) ; |
public class JmsErrorUtils { /** * Used by the JMS API layer to create new < code > Throwable < / code > ' s , usually
* < code > Exceptions < / code > ( both < code > JMSException < / code > s and other Java
* exception types ) . If a previous exception has not been caught , an
* overloaded version of this metho... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "newThrowable" , new Object [ ] { throwableClass , messageKey , caughtThrowable , probeId , caller , } ) ; Throwable t = null ; try { // If test environment is enabled then take this opportunity to check
// the the message e... |
public class HndlBalancePdfReq { /** * < p > Handle file - report request . < / p >
* @ param pReqVars Request scoped variables
* @ param pRequestData Request Data
* @ param pSous servlet output stream
* @ throws Exception - an exception */
@ Override public final void handle ( final Map < String , Object > pRe... | try { this . srvDatabase . setIsAutocommit ( false ) ; this . srvDatabase . setTransactionIsolation ( ISrvDatabase . TRANSACTION_READ_UNCOMMITTED ) ; this . srvDatabase . beginTransaction ( ) ; Date date2 = srvDate . fromIso8601DateTimeNoTz ( pRequestData . getParameter ( "date2" ) , null ) ; BalanceSheet balanceSheet ... |
public class TextBoxView { /** * Repaints the content , used by blink decoration .
* @ param ms
* time - the upper bound of delay
* @ param bounds
* the bounds */
protected void repaint ( final int ms , final Rectangle bounds ) { } } | if ( container != null ) { container . repaint ( ms , bounds . x , bounds . y , bounds . width , bounds . height ) ; } |
public class ICalComponent { /** * Adds an experimental property to this component , removing all existing
* properties that have the same name .
* @ param name the property name ( e . g . " X - ALT - DESC " )
* @ param value the property value
* @ return the property object that was created */
public RawProper... | return setExperimentalProperty ( name , null , value ) ; |
public class UserListLogicalRule { /** * Gets the ruleOperands value for this UserListLogicalRule .
* @ return ruleOperands * The list of operands of the rule .
* < span class = " constraint ContentsNotNull " > This field
* must not contain { @ code null } elements . < / span >
* < span class = " constraint Not... | return ruleOperands ; |
public class ReferenceEntityLockService { /** * Returns a lock for the entity , lock type and owner if no conflicting locks exist .
* @ param entityType
* @ param entityKey
* @ param lockType
* @ param owner
* @ return org . apereo . portal . groups . IEntityLock
* @ exception LockingException */
@ Override... | return newLock ( entityType , entityKey , lockType , owner , defaultLockPeriod ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.