signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class SIMPReferenceStream { /** * Removes all items from this reference stream
* @ param tran - the transaction to perform the removals under
* @ throws MessageStoreException */
public void removeAll ( Transaction tran ) throws MessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeAll" , tran ) ; while ( this . removeFirstMatching ( null , tran ) != null ) ; remove ( tran , NO_LOCK_ID ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeAll" ... |
public class HawkbitCommonUtil { /** * Get formatted label . Appends ellipses if content does not fit the label .
* @ param labelContent
* content
* @ return Label */
public static Label getFormatedLabel ( final String labelContent ) { } } | final Label labelValue = new Label ( labelContent , ContentMode . HTML ) ; labelValue . setSizeFull ( ) ; labelValue . addStyleName ( SPUIDefinitions . TEXT_STYLE ) ; labelValue . addStyleName ( "label-style" ) ; return labelValue ; |
public class PhynixxXAResource { /** * finds the transactional branch of the current XAResource associated with
* die XID
* Prepares to perform a commit . May actually perform a commit in the flag
* commitOnPrepare is set to true .
* This method is called to ask the resource manager to prepare for a
* transac... | try { LOG . debug ( "PhynixxXAResource[" + this . getId ( ) + "]:prepare prepare to perform a commit for XID=" + xid ) ; XATransactionalBranch < C > transactionalBranch = this . xaConnection . toGlobalTransactionBranch ( ) ; if ( xid == null ) { LOG . error ( "No XID" ) ; throw new XAException ( XAException . XAER_INVA... |
public class JShellTool { /** * start the built - in editor */
private boolean builtInEdit ( String initialText , Consumer < String > saveHandler , Consumer < String > errorHandler ) { } } | try { ServiceLoader < BuildInEditorProvider > sl = ServiceLoader . load ( BuildInEditorProvider . class ) ; // Find the highest ranking provider
BuildInEditorProvider provider = null ; for ( BuildInEditorProvider p : sl ) { if ( provider == null || p . rank ( ) > provider . rank ( ) ) { provider = p ; } } if ( provider... |
public class WriterVisualizer { /** * Will create a Writer of the outstream .
* @ param outstream */
@ Override public void writeOutput ( VisualizerInput input , OutputStream outstream ) { } } | try { OutputStreamWriter writer = new OutputStreamWriter ( outstream , getCharacterEncoding ( ) ) ; writeOutput ( input , writer ) ; writer . flush ( ) ; } catch ( IOException ex ) { log . error ( "Exception when writing visualizer output." , ex ) ; StringWriter strWriter = new StringWriter ( ) ; ex . printStackTrace (... |
public class JodaBeanBinWriter { /** * Writes the bean to an array of bytes .
* @ param bean the bean to output , not null
* @ param rootType true to output the root type
* @ return the binary data , not null */
public byte [ ] write ( Bean bean , boolean rootType ) { } } | ByteArrayOutputStream baos = new ByteArrayOutputStream ( 1024 ) ; try { write ( bean , rootType , baos ) ; } catch ( IOException ex ) { throw new IllegalStateException ( ex ) ; } return baos . toByteArray ( ) ; |
public class DRL6StrictParser { /** * lhsEval : = EVAL LEFT _ PAREN conditionalExpression RIGHT _ PAREN
* @ param ce
* @ return
* @ throws org . antlr . runtime . RecognitionException */
private BaseDescr lhsEval ( CEDescrBuilder < ? , ? > ce ) throws RecognitionException { } } | EvalDescrBuilder < ? > eval = null ; try { eval = helper . start ( ce , EvalDescrBuilder . class , null ) ; match ( input , DRL6Lexer . ID , DroolsSoftKeywords . EVAL , null , DroolsEditorType . KEYWORD ) ; if ( state . failed ) return null ; if ( ! parseEvalExpression ( eval ) ) return null ; } catch ( RecognitionExce... |
public class BsonGenerator { /** * Creates a new embedded document or array
* @ param array true if the embedded object is an array
* @ throws IOException if the document could not be created */
protected void _writeStartObject ( boolean array ) throws IOException { } } | _writeArrayFieldNameIfNeeded ( ) ; if ( _currentDocument != null ) { // embedded document / array
_buffer . putByte ( _typeMarker , array ? BsonConstants . TYPE_ARRAY : BsonConstants . TYPE_DOCUMENT ) ; } _currentDocument = new DocumentInfo ( _currentDocument , _buffer . size ( ) , array ) ; reserveHeader ( ) ; |
public class hqlParser { /** * hql . g : 653:1 : compoundExpr : ( collectionExpr | path | ( OPEN ! ( subQuery | ( expression ( COMMA ! expression ) * ) ) CLOSE ! ) ) ; */
public final hqlParser . compoundExpr_return compoundExpr ( ) throws RecognitionException { } } | hqlParser . compoundExpr_return retval = new hqlParser . compoundExpr_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token OPEN281 = null ; Token COMMA284 = null ; Token CLOSE286 = null ; ParserRuleReturnScope collectionExpr279 = null ; ParserRuleReturnScope path280 = null ; ParserRuleRetur... |
public class JawnFilter { /** * Creates a new HttpServletRequest object .
* Useful , as we cannot modify an existing ServletRequest .
* Used when resources needs to have the { controller } stripped from the servletPath .
* @ author MTD */
private final static HttpServletRequest createServletRequest ( final HttpSe... | return new HttpServletRequestWrapper ( req ) { @ Override public String getServletPath ( ) { return translatedPath ; } } ; |
public class ConstructorInstantiator { /** * Evalutes { @ code constructor } against the currently found { @ code matchingConstructors } and determines if
* it ' s a better match to the given arguments , a worse match , or an equivalently good match .
* This method tries to emulate the behavior specified in
* < a... | boolean newHasBetterParam = false ; boolean existingHasBetterParam = false ; Class < ? > [ ] paramTypes = constructor . getParameterTypes ( ) ; for ( int i = 0 ; i < paramTypes . length ; ++ i ) { Class < ? > paramType = paramTypes [ i ] ; if ( ! paramType . isPrimitive ( ) ) { for ( Constructor < ? > existingCtor : ma... |
public class AWSCodePipelineClient { /** * Enables artifacts in a pipeline to transition to a stage in a pipeline .
* @ param enableStageTransitionRequest
* Represents the input of an EnableStageTransition action .
* @ return Result of the EnableStageTransition operation returned by the service .
* @ throws Val... | request = beforeClientExecution ( request ) ; return executeEnableStageTransition ( request ) ; |
public class DocumentSubscriptions { /** * Creates a data subscription in a database . The subscription will expose all documents that match the specified subscription options for a given type .
* @ param options Subscription options
* @ param clazz Document class
* @ param < T > Document class
* @ return creat... | return create ( clazz , options , null ) ; |
public class Stream { /** * Returns a new stream of { @ link Indexed } that where each item ' s index is equal to its sequence number .
* @ return a new stream of { @ link Indexed } that where each item ' s index is equal to its sequence number . */
public Stream < Indexed < T > > index ( ) { } } | return map ( new Func1 < T , Indexed < T > > ( ) { int i ; @ Override public Indexed < T > call ( T value ) { return new Indexed < > ( i ++ , value ) ; } } ) ; |
public class InternalXbaseParser { /** * InternalXbase . g : 5216:1 : ruleXCatchClause returns [ EObject current = null ] : ( ( ( ' catch ' ) = > otherlv _ 0 = ' catch ' ) otherlv _ 1 = ' ( ' ( ( lv _ declaredParam _ 2_0 = ruleFullJvmFormalParameter ) ) otherlv _ 3 = ' ) ' ( ( lv _ expression _ 4_0 = ruleXExpression ) ... | EObject current = null ; Token otherlv_0 = null ; Token otherlv_1 = null ; Token otherlv_3 = null ; EObject lv_declaredParam_2_0 = null ; EObject lv_expression_4_0 = null ; enterRule ( ) ; try { // InternalXbase . g : 5222:2 : ( ( ( ( ' catch ' ) = > otherlv _ 0 = ' catch ' ) otherlv _ 1 = ' ( ' ( ( lv _ declaredParam ... |
public class SchemaBuilder { /** * Shortcut for { @ link # createMaterializedView ( CqlIdentifier , CqlIdentifier )
* createMaterializedView ( CqlIdentifier . fromCql ( keyspaceName ) , CqlIdentifier . fromCql ( viewName ) } */
@ NonNull public static CreateMaterializedViewStart createMaterializedView ( @ Nullable St... | return createMaterializedView ( keyspace == null ? null : CqlIdentifier . fromCql ( keyspace ) , CqlIdentifier . fromCql ( viewName ) ) ; |
public class UIViewRoot { /** * - - - - - Private Methods */
private static String getIdentifier ( String target ) { } } | // check map
String id = LOCATION_IDENTIFIER_MAP . get ( target ) ; if ( id == null ) { id = LOCATION_IDENTIFIER_PREFIX + target ; LOCATION_IDENTIFIER_MAP . put ( target , id ) ; } return id ; |
public class JsonReader { /** * Advances the position until after the next newline character . If the line
* is terminated by " \ r \ n " , the ' \ n ' must be consumed as whitespace by the
* caller . */
private void skipToEndOfLine ( ) throws IOException { } } | while ( pos < limit || fillBuffer ( 1 ) ) { char c = buffer [ pos ++ ] ; if ( c == '\n' ) { lineNumber ++ ; lineStart = pos ; break ; } else if ( c == '\r' ) { break ; } } |
public class LWJGL3TypeConversions { /** * Convert stencil ops to GL constants .
* @ param op The op .
* @ return The resulting GL constant . */
public static int stencilOperationToGL ( final JCGLStencilOperation op ) { } } | switch ( op ) { case STENCIL_OP_DECREMENT : return GL11 . GL_DECR ; case STENCIL_OP_DECREMENT_WRAP : return GL14 . GL_DECR_WRAP ; case STENCIL_OP_INCREMENT : return GL11 . GL_INCR ; case STENCIL_OP_INCREMENT_WRAP : return GL14 . GL_INCR_WRAP ; case STENCIL_OP_INVERT : return GL11 . GL_INVERT ; case STENCIL_OP_KEEP : re... |
public class FileUtil { /** * Utility to convert { @ link File } to { @ link URL } .
* @ param filePath the path of the file
* @ return the { @ link URL } representation of the file .
* @ throws MalformedURLException
* @ throws IllegalArgumentException if the file path is null , empty or blank */
public static ... | CheckArg . isNotEmpty ( filePath , "filePath" ) ; File file = new File ( filePath . trim ( ) ) ; return file . toURI ( ) . toURL ( ) ; |
public class FullDTDReader { /** * Method called to read in the external subset definition . */
public static DTDSubset readExternalSubset ( WstxInputSource src , ReaderConfig cfg , DTDSubset intSubset , boolean constructFully , int xmlVersion ) throws XMLStreamException { } } | FullDTDReader r = new FullDTDReader ( src , cfg , intSubset , constructFully , xmlVersion ) ; return r . parseDTD ( ) ; |
public class CmsCreateSiteThread { /** * Saves outputstream of favicon as resource . < p >
* @ param siteRoot site root of considered site . */
private void saveFavIcon ( String siteRoot ) { } } | if ( m_os == null ) { return ; } if ( m_os . size ( ) == 0 ) { return ; } getReport ( ) . println ( Messages . get ( ) . container ( Messages . RPT_SITE_SET_FAVICON_0 ) , I_CmsReport . FORMAT_DEFAULT ) ; CmsResource favicon = null ; try { favicon = m_cms . createResource ( siteRoot + CmsSiteManager . FAVICON , OpenCms ... |
public class ContentSpec { /** * Set the Copyright Year ( s ) of the Content Specification and the book it creates .
* @ param copyrightYear The year ( s ) for the Copyright . */
public void setCopyrightYear ( final String copyrightYear ) { } } | if ( copyrightYear == null && this . copyrightYear == null ) { return ; } else if ( copyrightYear == null ) { removeChild ( this . copyrightYear ) ; this . copyrightYear = null ; } else if ( this . copyrightYear == null ) { this . copyrightYear = new KeyValueNode < String > ( CommonConstants . CS_COPYRIGHT_YEAR_TITLE ,... |
public class FastBlurFilter { /** * < p > Writes a rectangular area of pixels in the destination
* < code > BufferedImage < / code > . Calling this method on
* an image of type different from < code > BufferedImage . TYPE _ INT _ ARGB < / code >
* and < code > BufferedImage . TYPE _ INT _ RGB < / code > will unma... | if ( pixels == null || w == 0 || h == 0 ) { return ; } else if ( pixels . length < w * h ) { throw new IllegalArgumentException ( "pixels array must have a length >= w*h" ) ; } final int imageType = img . getType ( ) ; if ( imageType == BufferedImage . TYPE_INT_ARGB || imageType == BufferedImage . TYPE_INT_RGB ) { fina... |
public class TextBoxView { /** * Sets the font variant .
* @ param newFontVariant
* the new font variant */
protected void setFontVariant ( String newFontVariant ) { } } | if ( fontVariant == null || ! fontVariant . equals ( newFontVariant ) ) { FontVariant val [ ] = FontVariant . values ( ) ; for ( FontVariant aVal : val ) { if ( aVal . toString ( ) . equals ( newFontVariant ) ) { fontVariant = newFontVariant ; invalidateCache ( ) ; return ; } } } |
public class FluentMatchingR { /** * Runs through the possible matches and executes the specified action of the first match and
* returns the result .
* @ throws MatchException if no match is found . */
public R getMatch ( ) { } } | for ( Pattern < T , R > pattern : patterns ) { if ( pattern . matches ( value ) ) { return pattern . apply ( value ) ; } } throw new MatchException ( "No match found for " + value ) ; |
public class GetCampaignActivitiesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetCampaignActivitiesRequest getCampaignActivitiesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getCampaignActivitiesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getCampaignActivitiesRequest . getApplicationId ( ) , APPLICATIONID_BINDING ) ; protocolMarshaller . marshall ( getCampaignActivitiesRequest . getCampaignId... |
public class AmazonRedshiftClient { /** * Deletes the specified manual snapshot . The snapshot must be in the < code > available < / code > state , with no other
* users authorized to access the snapshot .
* Unlike automated snapshots , manual snapshots are retained even after you delete your cluster . Amazon Redsh... | request = beforeClientExecution ( request ) ; return executeDeleteClusterSnapshot ( request ) ; |
public class Symm { /** * Generate a 2048 based Key from which we extract our code base
* @ return
* @ throws IOException */
public byte [ ] keygen ( ) throws IOException { } } | byte inkey [ ] = new byte [ 0x600 ] ; new SecureRandom ( ) . nextBytes ( inkey ) ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( 0x800 ) ; base64url . encode ( new ByteArrayInputStream ( inkey ) , baos ) ; return baos . toByteArray ( ) ; |
public class StreamExecutionEnvironment { /** * Ads a data source with a custom type information thus opening a
* { @ link DataStream } . Only in very special cases does the user need to
* support type information . Otherwise use
* { @ link # addSource ( org . apache . flink . streaming . api . functions . source... | return addSource ( function , "Custom Source" , typeInfo ) ; |
public class BigtableClusterUtilities { /** * Sets a cluster size to a specific size .
* @ param clusterId
* @ param zoneId
* @ param newSize
* @ throws InterruptedException if the cluster is in the middle of updating , and an interrupt was
* received */
public void setClusterSize ( String clusterId , String ... | setClusterSize ( instanceName . toClusterName ( clusterId ) . getClusterName ( ) , newSize ) ; |
public class KeyedStream { /** * Applies a reduce transformation on the grouped data stream grouped on by
* the given key position . The { @ link ReduceFunction } will receive input
* values based on the key value . Only input values with the same key will
* go to the same reducer .
* @ param reducer
* The { ... | return transform ( "Keyed Reduce" , getType ( ) , new StreamGroupedReduce < T > ( clean ( reducer ) , getType ( ) . createSerializer ( getExecutionConfig ( ) ) ) ) ; |
public class XMLUtil { /** * Replies the boolean value that corresponds to the specified attribute ' s path .
* < p > The path is an ordered list of tag ' s names and ended by the name of
* the attribute .
* Be careful about the fact that the names are case sensitives .
* @ param document is the XML document to... | assert document != null : AssertMessages . notNullParameter ( 0 ) ; return getAttributeBooleanWithDefault ( document , true , false , path ) ; |
public class StreamMetrics { /** * This method increments the counter of failed Stream seal operations in the system as well as the failed seal
* attempts for this specific Stream .
* @ param scope Scope .
* @ param streamName Name of the Stream . */
public void sealStreamFailed ( String scope , String streamName... | DYNAMIC_LOGGER . incCounterValue ( globalMetricName ( SEAL_STREAM_FAILED ) , 1 ) ; DYNAMIC_LOGGER . incCounterValue ( SEAL_STREAM_FAILED , 1 , streamTags ( scope , streamName ) ) ; |
public class BoundedBuffer { /** * D638088 - implemented split locks for get queue */
private void notifyGet_ ( ) { } } | // a notification may be lost in some cases - however
// as none of the threads wait endlessly , a waiting thread
// will either be notified , or will eventually wakeup
int lastWaitIndex = getQueueIndex ( getQueueLocks_ , getQueueCounter_ , false ) ; int lockIndex = lastWaitIndex ; for ( int i = 0 ; i < getQueueLocks_ ... |
public class TuneInfos { /** * Add each element of collection c as new lines in field b */
public void add ( byte b , Collection c ) { } } | if ( ( c != null ) && ( c . size ( ) > 0 ) ) { String s2 = get ( b ) ; for ( Object aC : c ) { String s = ( String ) aC ; if ( s2 == null ) s2 = s ; else s2 += lineSeparator + s ; } set ( b , s2 ) ; } |
public class OpBool { /** * Create a String expression from a Expression
* @ param left
* @ param right
* @ return String expression
* @ throws TemplateException */
public static ExprBoolean toExprBoolean ( Expression left , Expression right , int operation ) { } } | if ( left instanceof Literal && right instanceof Literal ) { Boolean l = ( ( Literal ) left ) . getBoolean ( null ) ; Boolean r = ( ( Literal ) right ) . getBoolean ( null ) ; if ( l != null && r != null ) { switch ( operation ) { case Factory . OP_BOOL_AND : return left . getFactory ( ) . createLitBoolean ( l . boolea... |
public class NumbersAreUnsignedIntsLinkedHashMap { /** * a ctor that allows passing a map . */
@ Override public Object put ( String key , Object val ) { } } | val = val != null && val instanceof Number ? Number . class . cast ( val ) . intValue ( ) : val ; return super . put ( key , val ) ; |
public class YObject { /** * syck _ yobject _ initialize */
@ JRubyMethod public static IRubyObject yaml_initialize ( IRubyObject self , IRubyObject klass , IRubyObject ivars ) { } } | ( ( RubyObject ) self ) . fastSetInstanceVariable ( "@class" , klass ) ; ( ( RubyObject ) self ) . fastSetInstanceVariable ( "@ivars" , ivars ) ; return self ; |
public class LiveEventsInner { /** * Create Live Event .
* Creates a Live Event .
* @ param resourceGroupName The name of the resource group within the Azure subscription .
* @ param accountName The Media Services account name .
* @ param liveEventName The name of the Live Event .
* @ param parameters Live Ev... | return ServiceFuture . fromResponse ( beginCreateWithServiceResponseAsync ( resourceGroupName , accountName , liveEventName , parameters , autoStart ) , serviceCallback ) ; |
public class ExceptionUtils { /** * Returns a { @ link Mono } containing an { @ link IllegalArgumentException } with the configured message
* @ param format A < a href = " . . / util / Formatter . html # syntax " > format string < / a >
* @ param args Arguments referenced by the format specifiers in the format stri... | String message = String . format ( format , args ) ; return Mono . error ( new IllegalArgumentException ( message ) ) ; |
public class PojoDataParser { /** * { @ inheritDoc } */
@ NonNull @ Override public List < Card > parseGroup ( @ NonNull JSONArray data , @ NonNull final ServiceManager serviceManager ) { } } | final CardResolver cardResolver = serviceManager . getService ( CardResolver . class ) ; Preconditions . checkState ( cardResolver != null , "Must register CardResolver into ServiceManager first" ) ; final MVHelper cellResolver = serviceManager . getService ( MVHelper . class ) ; Preconditions . checkState ( cellResolv... |
public class ArrayFunctions { /** * Returned expression results in the new array with value pre - pended . */
public static Expression arrayPrepend ( Expression expression , Expression value ) { } } | return x ( "ARRAY_PREPEND(" + value . toString ( ) + ", " + expression . toString ( ) + ")" ) ; |
public class CmsToolbarNewButton { /** * Creates a list item representing a redirect . < p >
* @ return the new list item */
private CmsCreatableListItem makeNavigationLevelItem ( ) { } } | CmsNewResourceInfo typeInfo = getController ( ) . getData ( ) . getNewNavigationLevelElementInfo ( ) ; CmsListItemWidget widget = new CmsListItemWidget ( typeInfo ) ; CmsCreatableListItem listItem = new CmsCreatableListItem ( widget , typeInfo , NewEntryType . regular ) ; listItem . initMoveHandle ( CmsSitemapView . ge... |
public class BatchCreateObjectResponseMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BatchCreateObjectResponse batchCreateObjectResponse , ProtocolMarshaller protocolMarshaller ) { } } | if ( batchCreateObjectResponse == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchCreateObjectResponse . getObjectIdentifier ( ) , OBJECTIDENTIFIER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall... |
public class BellaDatiServiceImpl { /** * Deserialization . Sets up the element lists and maps as empty objects .
* @ param in Input stream of object to be de - serialized
* @ throws IOException Thrown if IO error occurs during class reading
* @ throws ClassNotFoundException Thrown if desired class does not exist... | in . defaultReadObject ( ) ; try { Field domainList = getClass ( ) . getDeclaredField ( "domainList" ) ; domainList . setAccessible ( true ) ; domainList . set ( this , new DomainList ( ) ) ; Field dashboardList = getClass ( ) . getDeclaredField ( "dashboardList" ) ; dashboardList . setAccessible ( true ) ; dashboardLi... |
public class Light { /** * Creates new contact filter for this light with given parameters
* @ param categoryBits - see { @ link Filter # categoryBits }
* @ param groupIndex - see { @ link Filter # groupIndex }
* @ param maskBits - see { @ link Filter # maskBits } */
public void setContactFilter ( short categoryB... | filterA = new Filter ( ) ; filterA . categoryBits = categoryBits ; filterA . groupIndex = groupIndex ; filterA . maskBits = maskBits ; |
public class JCuda { /** * Make a compute stream wait on an event .
* < pre >
* cudaError _ t cudaStreamWaitEvent (
* cudaStream _ t stream ,
* cudaEvent _ t event ,
* unsigned int flags )
* < / pre >
* < div >
* < p > Make a compute stream wait on an event .
* Makes all future work submitted to < tt ... | return checkResult ( cudaStreamWaitEventNative ( stream , event , flags ) ) ; |
public class JedisSortedSet { /** * Adds to this set all of the elements in the specified map of members and their score .
* @ param scoredMember the members to add together with their scores
* @ return the number of members actually added */
public long addAll ( final Map < String , Double > scoredMember ) { } } | return doWithJedis ( new JedisCallable < Long > ( ) { @ Override public Long call ( Jedis jedis ) { return jedis . zadd ( getKey ( ) , scoredMember ) ; } } ) ; |
public class ImageModerationsImpl { /** * Returns probabilities of the image containing racy or adult content .
* @ param imageStream The image file .
* @ param evaluateFileInputOptionalParameter the object representing the optional parameters to be set before calling this API
* @ param serviceCallback the async ... | return ServiceFuture . fromResponse ( evaluateFileInputWithServiceResponseAsync ( imageStream , evaluateFileInputOptionalParameter ) , serviceCallback ) ; |
public class DefaultPermissionChecker { /** * Gets the permission to access an inode path given a user and its groups .
* @ param user the user
* @ param groups the groups this user belongs to
* @ param path the inode path
* @ param inodeList the list of inodes in the path
* @ return the permission */
private... | int size = inodeList . size ( ) ; Preconditions . checkArgument ( size > 0 , PreconditionMessage . EMPTY_FILE_INFO_LIST_FOR_PERMISSION_CHECK ) ; // bypass checking permission for super user or super group of Alluxio file system .
if ( isPrivilegedUser ( user , groups ) ) { return Mode . Bits . ALL ; } // traverses from... |
public class DefaultAnimationsBuilder { /** * @ param croutonView
* The croutonView which gets animated .
* @ return The default Animation for a hiding { @ link Crouton } . */
static Animation buildDefaultSlideOutUpAnimation ( View croutonView ) { } } | if ( ! areLastMeasuredOutAnimationHeightAndCurrentEqual ( croutonView ) || ( null == slideOutUpAnimation ) ) { slideOutUpAnimation = new TranslateAnimation ( 0 , 0 , // X : from , to
0 , - croutonView . getMeasuredHeight ( ) // Y : from , to
) ; slideOutUpAnimation . setDuration ( DURATION ) ; setLastOutAnimationHeight... |
public class Dynamic { /** * Represents a constant that is resolved by invoking a constructor .
* @ param constructor The constructor to invoke to create the represented constant value .
* @ param rawArguments The constructor ' s constant arguments .
* @ return A dynamic constant that is resolved by the supplied ... | return ofInvocation ( new MethodDescription . ForLoadedConstructor ( constructor ) , rawArguments ) ; |
public class EcorePackageRenameStrategy { /** * Replies the text region that is corresponding to the package name .
* @ param script the script .
* @ return the region . */
protected ITextRegion getOriginalPackageRegion ( final SarlScript script ) { } } | return this . locationInFileProvider . getFullTextRegion ( script , XtendPackage . Literals . XTEND_FILE__PACKAGE , 0 ) ; |
public class HadoopJobUtils { /** * Invalidates a Hadoop authentication token file */
public static void cancelHadoopTokens ( HadoopSecurityManager hadoopSecurityManager , String userToProxy , File tokenFile , Logger log ) { } } | if ( tokenFile == null ) { return ; } try { hadoopSecurityManager . cancelTokens ( tokenFile , userToProxy , log ) ; } catch ( HadoopSecurityManagerException e ) { log . error ( e . getCause ( ) + e . getMessage ( ) ) ; } catch ( Exception e ) { log . error ( e . getCause ( ) + e . getMessage ( ) ) ; } if ( tokenFile .... |
public class ParseUtils { /** * Returns the index of the first character in toParse from idx that is not a " space " .
* @ param toParse the string to skip space on .
* @ param idx the index to start skipping space from .
* @ return the index of the first character in toParse from idx that is not a " space . */
p... | while ( isBlank ( toParse . charAt ( idx ) ) && idx < toParse . length ( ) ) ++ idx ; return idx ; |
public class CacheOnDisk { /** * Call this method to read a specified template which contains the cache ids from the disk .
* @ param template
* - template id .
* @ param delete
* - boolean to delete the template after reading
* @ return valueSet - the collection of cache ids . */
public ValueSet readTemplate... | Result result = htod . readTemplate ( template , delete ) ; if ( result . returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( result . diskException ) ; this . htod . returnToResultPool ( result ) ; return HTODDynacache . EMPTY_VS ; } ValueSet valueSet = ( ValueSet ) result . data ; if ( valueSet == null ) {... |
public class AiMesh { /** * Returns the vertex color . < p >
* This method is part of the wrapped API ( see { @ link AiWrapperProvider }
* for details on wrappers ) . < p >
* The built - in behavior is to return a { @ link AiColor } .
* @ param vertex the vertex index
* @ param colorset the color set
* @ pa... | if ( ! hasColors ( colorset ) ) { throw new IllegalStateException ( "mesh has no colorset " + colorset ) ; } checkVertexIndexBounds ( vertex ) ; return wrapperProvider . wrapColor ( m_colorsets [ colorset ] , vertex * 4 * SIZEOF_FLOAT ) ; |
public class NameNode { /** * { @ inheritDoc } */
public void concat ( String trg , String [ ] src , boolean restricted ) throws IOException { } } | namesystem . concat ( trg , src , restricted ) ; |
public class WebhooksInner { /** * Create the webhook identified by webhook name .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param webhookName The webhook name .
* @ param parameters The create or update parameters for ... | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , automationAccountName , webhookName , parameters ) , serviceCallback ) ; |
public class GeneratedJavaFileAccess { /** * Prepends the addition of required imports of the employed annotations .
* Since the ' typeComment ' is a { @ link JavaFileAccess . JavaTypeAwareStringConcatenation }
* any optionally required imports are already processed and tracked in { @ link # imports } . */
@ Overri... | CharSequence _xblockexpression = null ; { final Consumer < IClassAnnotation > _function = ( IClassAnnotation it ) -> { this . importType ( it . getAnnotationImport ( ) ) ; } ; this . getClassAnnotations ( ) . forEach ( _function ) ; _xblockexpression = super . getContent ( ) ; } return _xblockexpression ; |
public class JBBPCompiler { /** * Register a name field info item in a named field list .
* @ param normalizedName normalized name of the named field
* @ param offset the named field offset
* @ param namedFields the named field info list for registration
* @ param token the token for the field
* @ throws JBBP... | for ( int i = namedFields . size ( ) - 1 ; i >= structureBorder ; i -- ) { final JBBPNamedFieldInfo info = namedFields . get ( i ) ; if ( info . getFieldPath ( ) . equals ( normalizedName ) ) { throw new JBBPCompilationException ( "Duplicated named field detected [" + normalizedName + ']' , token ) ; } } namedFields . ... |
public class LdapConfigManager { /** * Return the list of properties supported for a given LDAP entity .
* This is an overloaded method to support getSupportedProperties ( String , List )
* @ param ldapEntity : A given LDAP entity
* @ param propNames : List of property names read from data object
* @ return lis... | List < String > prop = new ArrayList < String > ( ) ; for ( String propName : propNames ) { if ( propName . equals ( SchemaConstants . VALUE_ALL_PROPERTIES ) ) { prop . add ( propName ) ; continue ; } // call the getAttribute method to see if its supported by LDAP
String attrName = ldapEntity . getAttribute ( propName ... |
public class SchematronValidatingParser { /** * Checks the given schematron phase for the XML file and returns the
* validation status .
* @ param doc
* The XML file to validate ( Document )
* @ param schemaFile
* The string path to the schematron file to use
* @ param phase
* The string phase name ( cont... | boolean isValid = false ; if ( doc == null || doc . getDocumentElement ( ) == null ) return isValid ; try { ClassLoader loader = this . getClass ( ) . getClassLoader ( ) ; URL url = loader . getResource ( schemaFile ) ; this . schemaFile = new File ( URLDecoder . decode ( url . getFile ( ) , "UTF-8" ) ) ; } catch ( Exc... |
public class Parsers { /** * A { @ link Parser } that always succeeds and invokes { @ code runnable } . */
@ Deprecated public static Parser < ? > runnable ( final Runnable runnable ) { } } | return new Parser < Object > ( ) { @ Override boolean apply ( ParseContext ctxt ) { runnable . run ( ) ; return true ; } @ Override public String toString ( ) { return runnable . toString ( ) ; } } ; |
public class TargetController { /** * Returns all current { @ link Target } s
* @ return the response entity with all the properties of the targets and 200 OK status
* @ throws DeployerException if an error ocurred */
@ RequestMapping ( value = GET_ALL_TARGETS_URL , method = RequestMethod . GET ) public ResponseEnt... | List < Target > targets = targetService . getAllTargets ( ) ; return new ResponseEntity < > ( targets , RestServiceUtils . setLocationHeader ( new HttpHeaders ( ) , BASE_URL + GET_ALL_TARGETS_URL ) , HttpStatus . OK ) ; |
public class Tuple5 { /** * Split this tuple into two tuples of degree 1 and 4. */
public final Tuple2 < Tuple1 < T1 > , Tuple4 < T2 , T3 , T4 , T5 > > split1 ( ) { } } | return new Tuple2 < > ( limit1 ( ) , skip1 ( ) ) ; |
public class GeoPackageCoreImpl { /** * { @ inheritDoc } */
@ Override public GeometryColumns createFeatureTableWithMetadata ( GeometryColumns geometryColumns , BoundingBox boundingBox , long srsId , List < FeatureColumn > columns ) { } } | // Get the SRS
SpatialReferenceSystem srs = getSrs ( srsId ) ; // Create the Geometry Columns table
createGeometryColumnsTable ( ) ; // Create the user feature table
FeatureTable table = new FeatureTable ( geometryColumns . getTableName ( ) , columns ) ; createFeatureTable ( table ) ; try { // Create the contents
Conte... |
public class OptionalLongSubject { /** * Fails if the { @ link OptionalLong } is present or the subject is null . */
public void isEmpty ( ) { } } | if ( actual ( ) == null ) { failWithActual ( simpleFact ( "expected empty optional" ) ) ; } else if ( actual ( ) . isPresent ( ) ) { failWithoutActual ( simpleFact ( "expected to be empty" ) , fact ( "but was present with value" , actual ( ) . getAsLong ( ) ) ) ; } |
public class ComparableExtensions { /** * The comparison operator < code > less than or equals < / code > .
* @ param left
* a comparable
* @ param right
* the value to compare with
* @ return < code > left . compareTo ( right ) < = 0 < / code > */
@ Pure /* not guaranteed , since compareTo ( ) is invoked */
... | return left . compareTo ( right ) <= 0 ; |
public class AccessLogInterceptor { /** * 获得请求中要操作的userId
* @ return 用户id */
protected Integer getUserId ( ) { } } | Integer userId = ThreadContext . getContext ( UserWebConstant . CTX_USERID ) ; if ( userId != null ) { return userId ; } return null ; |
public class DescribeAccountLimitsResult { /** * An account limit structure that contain a list of AWS CloudFormation account limits and their values .
* @ return An account limit structure that contain a list of AWS CloudFormation account limits and their values . */
public java . util . List < AccountLimit > getAcc... | if ( accountLimits == null ) { accountLimits = new com . amazonaws . internal . SdkInternalList < AccountLimit > ( ) ; } return accountLimits ; |
public class BaseLabels { /** * Returns labels based on the text file resource . */
protected ArrayList < String > getLabels ( String textResource ) throws IOException { } } | ArrayList < String > labels = new ArrayList < > ( ) ; File resourceFile = getResourceFile ( ) ; // Download if required
try ( InputStream is = new BufferedInputStream ( new FileInputStream ( resourceFile ) ) ; Scanner s = new Scanner ( is ) ) { while ( s . hasNextLine ( ) ) { labels . add ( s . nextLine ( ) ) ; } } ret... |
public class WebSiteRequest { /** * Determines if the request is for a Lynx browser */
public boolean isLynx ( ) { } } | if ( ! isLynxDone ) { String agent = req . getHeader ( "user-agent" ) ; isLynx = agent != null && agent . toLowerCase ( Locale . ROOT ) . contains ( "lynx" ) ; isLynxDone = true ; } return isLynx ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link GeneralConversionRefType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link GeneralConversionRefTyp... | return new JAXBElement < GeneralConversionRefType > ( _DefinedByConversion_QNAME , GeneralConversionRefType . class , null , value ) ; |
public class UserRoleJetty { /** * < p > Setter for id . < / p >
* @ param pId reference */
@ Override public final void setItsId ( final IdUserRoleJetty pId ) { } } | this . itsId = pId ; if ( this . itsId == null ) { this . itsUser = null ; this . itsRole = null ; } else { this . itsUser = this . itsId . getItsUser ( ) ; this . itsRole = this . itsId . getItsRole ( ) ; } |
public class AnnotationsClassLoader { /** * Find specified resource in local repositories .
* @ return the loaded resource , or null if the resource isn ' t found */
protected ResourceEntry findResourceInternal ( String name , String path ) { } } | if ( ! started ) { log . info ( sm . getString ( "webappClassLoader.stopped" , name ) ) ; return null ; } if ( ( name == null ) || ( path == null ) ) return null ; ResourceEntry entry = ( ResourceEntry ) resourceEntries . get ( name ) ; if ( entry != null ) return entry ; int contentLength = - 1 ; InputStream binaryStr... |
public class BundlePathMappingBuilder { /** * Detects all files that belong to the bundle and adds them to the bundle
* path mapping .
* @ return the bundlePathMapping */
public BundlePathMapping build ( ) { } } | if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Creating bundle path List for " + this . bundle . getId ( ) ) ; } BundlePathMapping bundlePathMapping = new BundlePathMapping ( this . bundle ) ; bundlePathMapping . setPathMappings ( strPathMappings ) ; List < PathMapping > pathMappings = bundlePathMapping . getPa... |
public class FoundationLoggingPatternLayout { /** * Returns PatternParser used to parse the conversion string . Subclasses may
* override this to return a subclass of PatternParser which recognize
* custom conversion characters .
* @ since 0.9.0 */
protected org . apache . log4j . helpers . PatternParser createPa... | return new FoundationLoggingPatternParser ( pattern ) ; |
public class RelationalExpression { /** * Perform a relational comparison . */
public Object evaluate ( ) { } } | if ( ! isCompileTimeConstant ( ) ) { return super . evaluate ( ) ; } Object lhsValue = getLHS ( ) . evaluate ( ) ; Object rhsValue = getRHS ( ) . evaluate ( ) ; IType lhsType = getLHS ( ) . getType ( ) ; IType rhsType = getRHS ( ) . getType ( ) ; if ( _strOperator . equals ( ">" ) ) { if ( BeanAccess . isNumericType ( ... |
public class Metric2Registry { /** * Removes the metric with the given name .
* @ param name the name of the metric
* @ return whether or not the metric was removed */
public boolean remove ( MetricName name ) { } } | final Metric metric = metrics . remove ( name ) ; if ( metric != null ) { // We have to unregister the Metric with the legacy Dropwizard Metric registry as
// well to support existing reports and listeners
metricRegistry . remove ( name . toGraphiteName ( ) ) ; return true ; } return false ; |
public class CommonOps_DDF2 { /** * Transposes matrix ' a ' and stores the results in ' b ' : < br >
* < br >
* b < sub > ij < / sub > = a < sub > ji < / sub > < br >
* where ' b ' is the transpose of ' a ' .
* @ param input The original matrix . Not modified .
* @ param output Where the transpose is stored .... | if ( input == null ) input = new DMatrix2x2 ( ) ; output . a11 = input . a11 ; output . a12 = input . a21 ; output . a21 = input . a12 ; output . a22 = input . a22 ; return output ; |
public class IIIFPresentationApiController { /** * The manifest response contains sufficient information for the client to initialize itself and begin to display
* something quickly to the user . The manifest resource represents a single object and any intellectual work or works
* embodied within that object . In p... | "*" } , origins = { "*" } ) @ RequestMapping ( value = { "{identifier}/manifest" , "{identifier}" } , method = RequestMethod . GET , produces = "application/json" ) @ ResponseBody public Manifest getManifest ( @ PathVariable String identifier , HttpServletRequest request ) throws NotFoundException , InvalidDataExceptio... |
public class MethodIdentifier { /** * Get the parameter type names , as strings .
* @ return the parameter type names */
public String [ ] getParameterTypes ( ) { } } | final String [ ] parameterTypes = this . parameterTypes ; return parameterTypes == NO_STRINGS ? parameterTypes : parameterTypes . clone ( ) ; |
public class DartSuperAccessorsPass { /** * Wraps a property string in a JSCompiler _ renameProperty call .
* < p > Should only be called in phases running before { @ link RenameProperties } ,
* if such a pass is even used ( see { @ link # renameProperties } ) . */
private Node renameProperty ( Node propertyName ) ... | checkArgument ( propertyName . isString ( ) ) ; if ( ! renameProperties ) { return propertyName ; } Node call = IR . call ( IR . name ( NodeUtil . JSC_PROPERTY_NAME_FN ) . srcref ( propertyName ) , propertyName ) ; call . srcref ( propertyName ) ; call . putBooleanProp ( Node . FREE_CALL , true ) ; call . putBooleanPro... |
public class ConfigurationFileStore { /** * Get the named store . Create it if it does not exist
* @ param name of config
* @ return store
* @ throws ConfigException */
@ Override public ConfigurationStore getStore ( final String name ) throws ConfigException { } } | try { final File dir = new File ( dirPath ) ; final String newPath = dirPath + name ; final File [ ] files = dir . listFiles ( new DirsOnly ( ) ) ; for ( final File f : files ) { if ( f . getName ( ) . equals ( name ) ) { return new ConfigurationFileStore ( newPath ) ; } } final File newDir = new File ( newPath ) ; if ... |
public class SubCommandMetaGetRO { /** * Parses command - line and gets read - only metadata .
* @ param args Command - line input
* @ param printHelp Tells whether to print help only or execute command
* actually
* @ throws IOException */
@ SuppressWarnings ( "unchecked" ) public static void executeCommand ( S... | OptionParser parser = getParser ( ) ; // declare parameters
List < String > metaKeys = null ; String url = null ; List < Integer > nodeIds = null ; Boolean allNodes = true ; List < String > storeNames = null ; // parse command - line input
args = AdminToolUtils . copyArrayAddFirst ( args , "--" + OPT_HEAD_META_GET_RO )... |
public class GetLoggingTargetCmd { /** * Executes the GetLoggingTargetCmd TANGO command */
public Any execute ( DeviceImpl device , Any in_any ) throws DevFailed { } } | Util . out4 . println ( "GetLoggingTargetCmd::execute(): arrived" ) ; String string = null ; try { string = extract_DevString ( in_any ) ; } catch ( DevFailed df ) { Util . out3 . println ( "GetLoggingTargetCmd::execute() --> Wrong argument type" ) ; Except . re_throw_exception ( df , "API_IncompatibleCmdArgumentType" ... |
public class Ssh2RsaPublicKey { /** * ( non - Javadoc )
* @ see com . sshtools . ssh . SshPublicKey # init ( byte [ ] , int , int ) */
public void init ( byte [ ] blob , int start , int len ) throws SshException { } } | ByteArrayReader bar = new ByteArrayReader ( blob , start , len ) ; try { // this . hostKey = hostKey ;
RSAPublicKeySpec rsaKey ; // Extract the key information
String header = bar . readString ( ) ; if ( ! header . equals ( getAlgorithm ( ) ) ) { throw new SshException ( "The encoded key is not RSA" , SshException . IN... |
public class SrvI18n { /** * < p > Evaluate message by given key for given language . < / p >
* @ param pKey key of message
* @ param pLang e . g . " en " , " ru " , etc . */
@ Override public final String getMsg ( final String pKey , final String pLang ) { } } | try { ResourceBundle mb = messagesMap . get ( pLang ) ; if ( mb != null ) { return mb . getString ( pKey ) ; } else { return getMsg ( pKey ) ; } } catch ( Exception e ) { return "[" + pKey + "]-" + pLang ; } |
public class MergeResources { /** * Compute the list of resource set to be used during execution based all the inputs . */
List < ResourceSet > computeResourceSetList ( ) { } } | List < ResourceSet > sourceFolderSets = resSetSupplier . get ( ) ; int size = sourceFolderSets . size ( ) + 4 ; if ( libraries != null ) { size += libraries . getArtifacts ( ) . size ( ) ; } List < ResourceSet > resourceSetList = Lists . newArrayListWithExpectedSize ( size ) ; // add at the beginning since the librarie... |
public class Bool { /** * Apply the operation to two operands , and return the result .
* @ param right non - null reference to the evaluated right operand .
* @ return non - null reference to the XObject that represents the result of the operation .
* @ throws javax . xml . transform . TransformerException */
pu... | if ( XObject . CLASS_BOOLEAN == right . getType ( ) ) return right ; else return right . bool ( ) ? XBoolean . S_TRUE : XBoolean . S_FALSE ; |
public class SibRaEndpointActivation { /** * Closes the connection for the given messaging engine if there is one
* open .
* @ param meUuid
* the UUID for the messaging engine to close the connection for */
protected void closeConnection ( final String meUuid ) { } } | final String methodName = "closeConnection" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , meUuid ) ; } closeConnection ( meUuid , false ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this ... |
public class OAuth20Utils { /** * Check if the callback url is valid .
* @ param registeredService the registered service
* @ param redirectUri the callback url
* @ return whether the callback url is valid */
public static boolean checkCallbackValid ( final @ NonNull RegisteredService registeredService , final St... | val registeredServiceId = registeredService . getServiceId ( ) ; LOGGER . debug ( "Found: [{}] vs redirectUri: [{}]" , registeredService , redirectUri ) ; if ( ! redirectUri . matches ( registeredServiceId ) ) { LOGGER . error ( "Unsupported [{}]: [{}] does not match what is defined for registered service: [{}]. " + "S... |
public class Session { /** * This methods appends the given task to the end of the taskQueue and set the calling thread is sleep state .
* @ param task The task to append to the end of the taskQueue .
* @ throws InterruptedException if another thread interrupted the current thread before or while the current thread... | if ( task instanceof IOTask ) { final Future < Void > returnVal = executor . submit ( ( IOTask ) task ) ; return returnVal ; } else { try { task . call ( ) ; } catch ( final Exception exc ) { throw new TaskExecutionException ( new ExecutionException ( exc ) ) ; } return null ; } // LOGGER . info ( " Added a " + task + ... |
public class CmsContextMenuOverlay { /** * Opens next to the given parent item . < p >
* @ param parentMenuItem the perent item */
public void openNextTo ( CmsContextMenuItemWidget parentMenuItem ) { } } | int left = parentMenuItem . getAbsoluteLeft ( ) + parentMenuItem . getOffsetWidth ( ) ; int top = parentMenuItem . getAbsoluteTop ( ) - Window . getScrollTop ( ) ; showAt ( left , top ) ; |
public class Message { /** * Create a MessageCreator to execute create .
* @ param pathAccountSid The SID of the Account that will create the resource
* @ param to The destination phone number
* @ param from The phone number that initiated the message
* @ param mediaUrl The URL of the media to send with the mes... | return new MessageCreator ( pathAccountSid , to , from , mediaUrl ) ; |
public class WonderPushRestClient { /** * Thin wrapper to the { @ link AsyncHttpClient } library . */
private static void request ( final Request request ) { } } | if ( null == request ) { WonderPush . logError ( "Request with null request." ) ; return ; } WonderPush . safeDefer ( new Runnable ( ) { @ Override public void run ( ) { // Decorate parameters
WonderPushRequestParamsDecorator . decorate ( request . getResource ( ) , request . getParams ( ) ) ; // Generate signature
Bas... |
public class NodeSelector { /** * Check the { @ link NegationSpecifier } .
* This method will add the { @ link Selector } from the specifier in
* a list and invoke { @ link # check ( List ) } with that list as the argument .
* @ param specifier The negation specifier .
* @ return A set of nodes after invoking {... | Collection < Selector > parts = new LinkedHashSet < Selector > ( 1 ) ; parts . add ( specifier . getSelector ( ) ) ; return check ( parts ) ; |
public class BartenderBuilderHeartbeat { /** * The local pod refers to the server itself . */
private UpdatePod initLocalPod ( ) { } } | ServerBartender serverSelf = _bartender . serverSelf ( ) ; ServicesAmp rampManager = AmpSystem . currentManager ( ) ; UpdatePodBuilder podBuilder = new UpdatePodBuilder ( ) ; podBuilder . name ( "local" ) ; podBuilder . cluster ( _bartender . serverSelf ( ) . getCluster ( ) ) ; // int count = Math . min ( 3 , rack . ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.