signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Mailer { /** * Fills the { @ link Message } instance with the embedded images from the { @ link Email } .
* @ param email The message in which the embedded images are defined .
* @ param multipartRelated The branch in the email structure in which we ' ll stuff the embedded images .
* @ throws Messagi... | for ( final AttachmentResource embeddedImage : email . getEmbeddedImages ( ) ) { multipartRelated . addBodyPart ( getBodyPartFromDatasource ( embeddedImage , Part . INLINE ) ) ; } |
public class Email { /** * Adds an embedded image ( attachment type ) to the email message and generates the necessary { @ link DataSource } with
* the given byte data . Then delegates to { @ link # addEmbeddedImage ( String , DataSource ) } . At this point the
* datasource is actually a { @ link ByteArrayDataSourc... | final ByteArrayDataSource dataSource = new ByteArrayDataSource ( data , mimetype ) ; dataSource . setName ( name ) ; addEmbeddedImage ( name , dataSource ) ; |
public class Javalin { /** * Adds an exception mapper to the instance .
* @ see < a href = " https : / / javalin . io / documentation # exception - mapping " > Exception mapping in docs < / a > */
public < T extends Exception > Javalin exception ( @ NotNull Class < T > exceptionClass , @ NotNull ExceptionHandler < ? ... | servlet . getExceptionMapper ( ) . getHandlers ( ) . put ( exceptionClass , ( ExceptionHandler < Exception > ) exceptionHandler ) ; return this ; |
public class MisoScenePanel { /** * Renders the base and fringe layer tiles that intersect the
* specified clipping rectangle . */
protected void paintTiles ( Graphics2D gfx , Rectangle clip ) { } } | // go through rendering our tiles
_paintOp . setGraphics ( gfx ) ; _applicator . applyToTiles ( clip , _paintOp ) ; _paintOp . setGraphics ( null ) ; |
public class ReadFileExtensions { /** * Reads every line from the File and puts them to the List .
* @ param input
* The File from where the input comes .
* @ return The List with all lines from the file .
* @ throws FileNotFoundException
* is thrown if the given file is not found .
* @ throws IOException
... | return readLinesInList ( input , false ) ; |
public class ExtensionRESTService { /** * Returns the arbitrary REST resource exposed by the AuthenticationProvider
* having the given identifier .
* @ param identifier
* The identifier of the AuthenticationProvider whose REST resource
* should be retrieved .
* @ return
* The arbitrary REST resource exposed... | // Retrieve authentication provider having given identifier
AuthenticationProvider authProvider = getAuthenticationProvider ( identifier ) ; if ( authProvider != null ) { // Pull resource from authentication provider
Object resource = authProvider . getResource ( ) ; if ( resource != null ) return resource ; } // Authe... |
public class GatewayManagementBeanImpl { /** * This must run ON the IO thread */
@ Override public void doSessionCreated ( final long sessionId , final ManagementSessionType managementSessionType ) throws Exception { } } | ThreadGatewayStats stats = gatewayStats . get ( ) ; stats . doSessionCreated ( ) ; |
public class TileBoundingBoxUtils { /** * Get the Web Mercator tile bounding box from the Google Maps API tile grid
* and zoom level
* @ param tileGrid
* tile grid
* @ param zoom
* zoom level
* @ return bounding box */
public static BoundingBox getWebMercatorBoundingBox ( TileGrid tileGrid , int zoom ) { } ... | double tileSize = tileSizeWithZoom ( zoom ) ; double minLon = ( - 1 * ProjectionConstants . WEB_MERCATOR_HALF_WORLD_WIDTH ) + ( tileGrid . getMinX ( ) * tileSize ) ; double maxLon = ( - 1 * ProjectionConstants . WEB_MERCATOR_HALF_WORLD_WIDTH ) + ( ( tileGrid . getMaxX ( ) + 1 ) * tileSize ) ; double minLat = Projection... |
public class CmsUserSettings { /** * Initializes the user settings with the given users setting parameters . < p >
* @ param user the current CmsUser */
public void init ( CmsUser user ) { } } | m_user = user ; // try to initialize the User Settings with the values stored in the user object .
// if no values are found , the default user settings will be used .
// workplace button style
try { m_workplaceButtonStyle = ( ( Integer ) m_user . getAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLAC... |
public class CommerceTierPriceEntryLocalServiceWrapper { /** * Returns the commerce tier price entry matching the UUID and group .
* @ param uuid the commerce tier price entry ' s UUID
* @ param groupId the primary key of the group
* @ return the matching commerce tier price entry , or < code > null < / code > if... | return _commerceTierPriceEntryLocalService . fetchCommerceTierPriceEntryByUuidAndGroupId ( uuid , groupId ) ; |
public class DynamicCompositeAgent { /** * Try and remove an { @ link Agent } from the composite . The agent is removed during the next { @ link # doWork ( ) }
* duty cycle if this operation is successful . This method does not block and will return false if another
* concurrent attempt to remove is in progress . .... | Objects . requireNonNull ( agent , "agent cannot be null" ) ; if ( Status . ACTIVE != status ) { throw new IllegalStateException ( "remove called when not active" ) ; } return removeAgent . compareAndSet ( null , agent ) ; |
public class ChangesListener { /** * { @ inheritDoc }
* Checks if new changes can exceeds some limits . It either can be node , workspace ,
* repository or global JCR instance .
* @ throws IllegalStateException if data size exceeded quota limit */
public void onSaveItems ( ItemStateChangesLog itemStates ) { } } | try { ChangesItem changesItem = new ChangesItem ( ) ; for ( ItemState state : itemStates . getAllStates ( ) ) { if ( ! state . getData ( ) . isNode ( ) ) { String nodePath = getPath ( state . getData ( ) . getQPath ( ) . makeParentPath ( ) ) ; Set < String > parentsWithQuota = quotaPersister . getAllParentNodesWithQuot... |
public class BaseDAO { /** * Clear all entries in internal shared preferences file .
* @ return Returns true if the new values were successfully written */
boolean clearAll ( ) { } } | SharedPreferences . Editor editor = sharedPreferences . edit ( ) ; Map < String , ? > all = sharedPreferences . getAll ( ) ; // noinspection Convert2streamapi
for ( String key : all . keySet ( ) ) { editor . remove ( key ) ; } return editor . commit ( ) ; |
public class StaticTypeCheckingSupport { /** * Tells if a class is one of the " accept all " classes as the left hand side of an
* assignment .
* @ param node the classnode to test
* @ return true if it ' s an Object , String , boolean , Boolean or Class . */
public static boolean isWildcardLeftHandSide ( final C... | if ( OBJECT_TYPE . equals ( node ) || STRING_TYPE . equals ( node ) || boolean_TYPE . equals ( node ) || Boolean_TYPE . equals ( node ) || CLASS_Type . equals ( node ) ) { return true ; } return false ; |
public class ZeroCodePackageRunner { /** * Returns a list of objects that define the children of this Runner . */
@ Override protected List < ScenarioSpec > getChildren ( ) { } } | TestPackageRoot rootPackageAnnotation = testClass . getAnnotation ( TestPackageRoot . class ) ; JsonTestCases jsonTestCasesAnnotation = testClass . getAnnotation ( JsonTestCases . class ) ; validateSuiteAnnotationPresent ( rootPackageAnnotation , jsonTestCasesAnnotation ) ; if ( rootPackageAnnotation != null ) { /* * D... |
public class Optimum { /** * Sets to indicate three LZMA symbols of which the second one
* is a literal . */
void set3 ( int newPrice , int optCur , int back2 , int len2 , int back ) { } } | price = newPrice ; optPrev = optCur + len2 + 1 ; backPrev = back ; prev1IsLiteral = true ; hasPrev2 = true ; optPrev2 = optCur ; backPrev2 = back2 ; |
public class PortletDefinitionImporterExporter { /** * Save a portlet definition .
* @ param definition the portlet definition
* @ param categories the list of categories for the portlet
* @ param permissionMap a map of permission name - > list of groups who are granted that
* permission ( Note : for now , only... | boolean newChannel = ( definition . getPortletDefinitionId ( ) == null ) ; // save the channel
definition = portletDefinitionDao . savePortletDefinition ( definition ) ; definition = portletDefinitionDao . getPortletDefinitionByFname ( definition . getFName ( ) ) ; final String defId = definition . getPortletDefinition... |
public class JacksonWrapperParser { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . persistence . ParserWrapper # close ( ) */
@ Override public void close ( ) { } } | try { if ( ! jacksonParser . isClosed ( ) ) jacksonParser . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw ( new KriptonRuntimeException ( e ) ) ; } |
public class AttributeMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Attribute attribute , ProtocolMarshaller protocolMarshaller ) { } } | if ( attribute == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attribute . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( attribute . getValue ( ) , VALUE_BINDING ) ; protocolMarshaller . marshall ( attribute . getTargetTy... |
public class VarOptItemsSketch { /** * Resets this sketch to the empty state , but retains the original value of k . */
public void reset ( ) { } } | final int ceilingLgK = Util . toLog2 ( Util . ceilingPowerOf2 ( k_ ) , "VarOptItemsSketch" ) ; final int initialLgSize = SamplingUtil . startingSubMultiple ( ceilingLgK , rf_ . lg ( ) , MIN_LG_ARR_ITEMS ) ; currItemsAlloc_ = SamplingUtil . getAdjustedSize ( k_ , 1 << initialLgSize ) ; data_ = new ArrayList < > ( currIt... |
public class EnvironmentStream { /** * Sets path as the backing stream for System . err */
public static synchronized void setStderr ( OutputStream os ) { } } | if ( _stderrStream == null ) { initStderr ( ) ; } if ( os == _systemErr || os == _systemOut ) { return ; } if ( os instanceof WriteStream ) { WriteStream out = ( WriteStream ) os ; /* if ( out . getSource ( ) = = StdoutStream . create ( )
| | out . getSource ( ) = = StderrStream . create ( ) ) {
return ; */
} _stde... |
public class AmazonIdentityManagementClient { /** * Retrieves the status of your service - linked role deletion . After you use the < a > DeleteServiceLinkedRole < / a > API
* operation to submit a service - linked role for deletion , you can use the < code > DeletionTaskId < / code > parameter in
* < code > GetSer... | request = beforeClientExecution ( request ) ; return executeGetServiceLinkedRoleDeletionStatus ( request ) ; |
public class SortedProperties { /** * To be compatible with version control systems , we need to sort properties
* before storing them to disk . Otherwise each change may lead to problems
* by diff against previous version - because Property entries are randomly
* distributed ( it ' s a map ) .
* @ param keySet... | List < String > sortedList = new ArrayList < > ( ) ; sortedList . addAll ( keySet ) ; Collections . sort ( sortedList ) ; return Collections . enumeration ( sortedList ) ; |
public class TermsByQueryShardResponse { /** * Deserialize */
@ Override public void readFrom ( StreamInput in ) throws IOException { } } | super . readFrom ( in ) ; TermsByQueryRequest . TermsEncoding termsEncoding = TermsByQueryRequest . TermsEncoding . values ( ) [ in . readVInt ( ) ] ; switch ( termsEncoding ) { case LONG : termsSet = new LongTermsSet ( breaker ) ; termsSet . readFrom ( in ) ; return ; case INTEGER : termsSet = new IntegerTermsSet ( br... |
public class DynamicReportBuilder { /** * Set a colspan in a group of columns . First add the cols to the report
* @ param colNumber the index of the col
* @ param colQuantity the number of cols how i will take
* @ param colspanTitle colspan title
* @ return a Dynamic Report Builder
* @ throws ColumnBuilderEx... | this . setColspan ( colNumber , colQuantity , colspanTitle , null ) ; return this ; |
public class BplusTree { /** * Return the first / low or last / high LeafNode in the Tree
* @ param lowORhigh true first / low node , false last / high node
* @ return the LeafNoder head / first / lower or tail / last / higher */
private final LeafNode < K , V > findSideLeafNode ( final boolean lowORhigh ) { } } | if ( _isEmpty ( ) ) { return null ; } try { int nodeIdx = ( lowORhigh ? lowIdx : highIdx ) ; // rootIdx ;
Node < K , V > nodeFind = getNode ( ( nodeIdx == 0 ) ? rootIdx : nodeIdx ) ; while ( ! nodeFind . isLeaf ( ) ) { nodeIdx = ( ( InternalNode < K , V > ) nodeFind ) . childs [ ( lowORhigh ? 0 : nodeFind . allocated )... |
public class JbcSrcRuntime { /** * Helper function to translate null - > NullData when calling SoyJavaPrintDirectives that may
* expect it . */
public static SoyValue applyPrintDirective ( SoyJavaPrintDirective directive , SoyValue value , List < SoyValue > args ) { } } | value = value == null ? NullData . INSTANCE : value ; for ( int i = 0 ; i < args . size ( ) ; i ++ ) { if ( args . get ( i ) == null ) { args . set ( i , NullData . INSTANCE ) ; } } return directive . applyForJava ( value , args ) ; |
public class CssScanner { /** * Check if a forward scan will equal given match string
* @ param match The string to match
* @ param ignoreCase Whether case should be ignored
* @ param resetOnTrue Whether the reader should be reset on found match
* @ throws IOException */
private boolean forwardMatch ( String ma... | Mark mark = reader . mark ( ) ; List < Integer > cbuf = Lists . newArrayList ( ) ; StringBuilder builder = new StringBuilder ( ) ; boolean result = true ; boolean seenChar = false ; while ( true ) { cbuf . add ( reader . next ( ) ) ; char ch = ( char ) reader . curChar ; if ( reader . curChar == - 1 ) { result = false ... |
public class QueryParserBase { /** * Create the plain query string representation of the given node using mapping information derived from the domain
* type .
* @ param node
* @ param domainType can be { @ literal null } .
* @ return
* @ since 4.0 */
public String createQueryStringFromNode ( Node node , @ Nul... | return createQueryStringFromNode ( node , 0 , domainType ) ; |
public class DualPivotQuicksort { /** * Sorts the specified range of the array using the given
* workspace array slice if possible for merging
* @ param a the array to be sorted
* @ param left the index of the first element , inclusive , to be sorted
* @ param right the index of the last element , inclusive , t... | /* * Phase 1 : Move NaNs to the end of the array . */
while ( left <= right && Double . isNaN ( a [ right ] ) ) { -- right ; } for ( int k = right ; -- k >= left ; ) { double ak = a [ k ] ; if ( ak != ak ) { // a [ k ] is NaN
a [ k ] = a [ right ] ; a [ right ] = ak ; -- right ; } } /* * Phase 2 : Sort everything excep... |
public class SiteNode { /** * Tells whether or not the given alert is the alert with highest risk than the current highest alert .
* { @ link Alert # CONFIDENCE _ FALSE _ POSITIVE False positive alerts } are ignored .
* @ param alert the alert to check
* @ return { @ code true } if it ' s the alert with highest r... | if ( alert . getConfidence ( ) == Alert . CONFIDENCE_FALSE_POSITIVE ) { return false ; } if ( highestAlert == null ) { return true ; } return alert . getRisk ( ) > highestAlert . getRisk ( ) ; |
public class ShellFactory { /** * Facade method facilitating the creation of subshell .
* Subshell is created and run inside Command method and shares the same IO and naming strtategy .
* Run the obtained Shell with commandLoop ( ) .
* @ param pathElement sub - prompt
* @ param parent Shell to be subshell ' d
... | return createSubshell ( pathElement , parent , appName , mainHandler , new EmptyMultiMap < String , Object > ( ) ) ; |
public class AuditReaderTask { /** * Convert the properties for encoding from the command line parameters . */
protected Map < String , String > convertToProperties ( Map < String , String > argMap ) { } } | HashMap < String , String > props = new HashMap < String , String > ( ) ; String value = argMap . get ( ARG_AUDIT_FILE_LOCATION ) ; if ( value != null ) { props . put ( "auditFileLocation" , value ) ; } value = argMap . get ( ARG_OUTPUT_FILE_LOCATION ) ; if ( value != null ) { props . put ( "outputFileLocation" , value... |
public class MeterRegistry { /** * Measures the distribution of samples .
* @ param name The base metric name
* @ param tags MUST be an even number of arguments representing key / value pairs of tags .
* @ return A new or existing distribution summary . */
public DistributionSummary summary ( String name , String... | return summary ( name , Tags . of ( tags ) ) ; |
public class FrameScreen { /** * Utility to get the sub - screen ( applet ) .
* @ return The applet ( sub ) screen . */
public AppletScreen getAppletScreen ( ) { } } | AppletScreen appletScreen = null ; if ( this . getSFieldCount ( ) > 0 ) appletScreen = ( AppletScreen ) this . getSField ( 0 ) ; return appletScreen ; |
public class DefaultThemeController { /** * ( non - Javadoc )
* @ see fr . putnami . pwt . core . theme . client . ThemeController # installTheme (
* fr . putnami . pwt . core . theme . client * . Theme ) */
@ Override public void installTheme ( Theme theme ) { } } | this . removeCssLinks ( ) ; if ( this . currentTheme != null ) { for ( CssLink link : this . currentTheme . getLinks ( ) ) { link . getLink ( ) . removeFromParent ( ) ; } } this . currentTheme = theme ; this . resetTheme ( ) ; |
public class ListUtils { /** * Obtains a random sample without replacement from a source list and places
* it in the destination list . This is done without modifying the source list .
* @ param < T > the list content type involved
* @ param source the source of values to randomly sample from
* @ param dest the... | randomSample ( ( Collection < T > ) source , dest , samples , rand ) ; |
public class MessageFormat { /** * Both arguments cannot be null . */
private Format createAppropriateFormat ( String type , String style ) { } } | Format newFormat = null ; int subformatType = findKeyword ( type , typeList ) ; switch ( subformatType ) { case TYPE_NUMBER : switch ( findKeyword ( style , modifierList ) ) { case MODIFIER_EMPTY : newFormat = NumberFormat . getInstance ( ulocale ) ; break ; case MODIFIER_CURRENCY : newFormat = NumberFormat . getCurren... |
public class CommerceDiscountUserSegmentRelPersistenceImpl { /** * Returns an ordered range of all the commerce discount user segment rels where commerceUserSegmentEntryId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < c... | return findByCommerceUserSegmentEntryId ( commerceUserSegmentEntryId , start , end , orderByComparator , true ) ; |
public class ObjNameFlagRight { /** * { @ inheritDoc } */
@ Override public void infoSeeFromEast ( ControllerPlayer c , double distance , double direction , double distChange , double dirChange , double bodyFacingDirection , double headFacingDirection ) { } } | switch ( qualifier ) { case 't' : switch ( number ) { case 30 : c . infoSeeFlagOwn ( Flag . RIGHT_30 , distance , direction , distChange , dirChange , bodyFacingDirection , headFacingDirection ) ; break ; case 20 : c . infoSeeFlagOwn ( Flag . RIGHT_20 , distance , direction , distChange , dirChange , bodyFacingDirectio... |
public class RemoveAliasCommand { /** * Remove an alias from a LIST ModelNode of existing aliases .
* @ param list LIST ModelNode of aliases
* @ param alias
* @ return LIST ModelNode with the alias removed */
private ModelNode removeAliasFromList ( ModelNode list , String alias ) throws OperationFailedException {... | // check for empty string
if ( alias == null || alias . equals ( "" ) ) return list ; // check for undefined list ( AS7-3476)
if ( ! list . isDefined ( ) ) { throw InfinispanMessages . MESSAGES . cannotRemoveAliasFromEmptyList ( alias ) ; } ModelNode newList = new ModelNode ( ) ; List < ModelNode > listElements = list ... |
public class AbstractResources { /** * Post an object to Smartsheet REST API and receive a CopyOrMoveRowResult object from response .
* Parameters : - path : the relative path of the resource collections - objectToPost : the object to post -
* Returns : the object
* Exceptions :
* IllegalArgumentException : if ... | Util . throwIfNull ( path , objectToPost ) ; Util . throwIfEmpty ( path ) ; HttpRequest request = createHttpRequest ( smartsheet . getBaseURI ( ) . resolve ( path ) , HttpMethod . POST ) ; ByteArrayOutputStream objectBytesStream = new ByteArrayOutputStream ( ) ; this . smartsheet . getJsonSerializer ( ) . serialize ( o... |
public class CommerceOrderItemPersistenceImpl { /** * Removes all the commerce order items where commerceOrderId = & # 63 ; and CPInstanceId = & # 63 ; from the database .
* @ param commerceOrderId the commerce order ID
* @ param CPInstanceId the cp instance ID */
@ Override public void removeByC_I ( long commerceO... | for ( CommerceOrderItem commerceOrderItem : findByC_I ( commerceOrderId , CPInstanceId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceOrderItem ) ; } |
public class FilterBasedTriggeringPolicy { /** * { @ inheritDoc } */
public boolean isTriggeringEvent ( final Appender appender , final LoggingEvent event , final String file , final long fileLength ) { } } | return isTriggeringEvent ( event ) ; |
public class ValoSideBar { /** * Adds a logo to the very top of the side bar , above the header . The logo ' s primary style is automatically
* set to { @ link ValoTheme # MENU _ LOGO } ands its size to undefined .
* @ param logo a { @ link com . vaadin . ui . Label } or { @ link com . vaadin . ui . Button } to use... | if ( getCompositionRoot ( ) != null && this . logo != null ) { getCompositionRoot ( ) . removeComponent ( this . logo ) ; } this . logo = logo ; if ( logo != null ) { logo . setPrimaryStyleName ( ValoTheme . MENU_LOGO ) ; logo . setSizeUndefined ( ) ; if ( getCompositionRoot ( ) != null ) { getCompositionRoot ( ) . add... |
public class DukeController { /** * Runs the record linkage process . */
public void process ( ) { } } | // are we ready to process yet , or have we had an error , and are
// waiting a bit longer in the hope that it will resolve itself ?
if ( error_skips > 0 ) { error_skips -- ; return ; } try { if ( logger != null ) logger . debug ( "Starting processing" ) ; status = "Processing" ; lastCheck = System . currentTimeMillis ... |
public class AbstractTemplateEngine { /** * Performs common initialization for template engines .
* Implementations must override this method to do their own template engine specific initialization .
* To use the convenience of this class , implementations must invoke this class ' s implementation before
* perfor... | languages = application . getLanguages ( ) ; messages = application . getMessages ( ) ; router = application . getRouter ( ) ; pippoSettings = application . getPippoSettings ( ) ; fileExtension = pippoSettings . getString ( PippoConstants . SETTING_TEMPLATE_EXTENSION , getDefaultFileExtension ( ) ) ; templatePathPrefix... |
public class OWLClassImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } .
* @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to read the
* objec... | deserialize ( streamReader , instance ) ; |
public class Word2Vec { /** * This method defines TokenizerFactory instance to be using during model building
* @ param tokenizerFactory TokenizerFactory instance */
public void setTokenizerFactory ( @ NonNull TokenizerFactory tokenizerFactory ) { } } | this . tokenizerFactory = tokenizerFactory ; if ( sentenceIter != null ) { SentenceTransformer transformer = new SentenceTransformer . Builder ( ) . iterator ( sentenceIter ) . tokenizerFactory ( this . tokenizerFactory ) . build ( ) ; this . iterator = new AbstractSequenceIterator . Builder < > ( transformer ) . build... |
public class SnorocketReasoner { /** * Prints a concept given its internal id . Useful for debugging .
* @ param id
* @ return */
protected String printConcept ( int id ) { } } | Object oid = factory . lookupConceptId ( id ) ; if ( factory . isVirtualConcept ( id ) ) { if ( oid instanceof AbstractConcept ) { return printAbstractConcept ( ( AbstractConcept ) oid ) ; } else { return oid . toString ( ) ; } } else { return ( String ) oid ; } |
public class AlertPolicyService { /** * Returns the set of alert policies with the given name .
* @ param name The name of the alert policy to return
* @ return The set of alert policies */
public Collection < AlertPolicy > list ( String name ) { } } | return list ( filters ( ) . name ( name ) . build ( ) ) ; |
public class Enum { /** * Returns a list of all enum constant names . */
public Set < String > getConstantNames ( ) { } } | return constants . stream ( ) . map ( EnumConstant :: getName ) . collect ( Collectors . toSet ( ) ) ; |
public class MessageBuilder { /** * 构建rpc错误结果
* @ param errorMsg 错误消息
* @ return rpc结果 */
public static SofaResponse buildSofaErrorResponse ( String errorMsg ) { } } | SofaResponse sofaResponse = new SofaResponse ( ) ; sofaResponse . setErrorMsg ( errorMsg ) ; return sofaResponse ; |
public class JobMetrics { /** * Get a new { @ link GobblinMetrics } instance for a given job .
* @ param jobName job name
* @ param jobId job ID
* @ return a new { @ link GobblinMetrics } instance for the given job */
public static JobMetrics get ( String jobName , String jobId ) { } } | return get ( new JobState ( jobName , jobId ) ) ; |
public class ImmutableRoaringBitmap { /** * Checks whether the parameter is a subset of this RoaringBitmap or not
* @ param subset the potential subset
* @ return true if the parameter is a subset of this RoaringBitmap */
public boolean contains ( ImmutableRoaringBitmap subset ) { } } | if ( subset . getCardinality ( ) > getCardinality ( ) ) { return false ; } final int length1 = this . highLowContainer . size ( ) ; final int length2 = subset . highLowContainer . size ( ) ; int pos1 = 0 , pos2 = 0 ; while ( pos1 < length1 && pos2 < length2 ) { final short s1 = this . highLowContainer . getKeyAtIndex (... |
public class FileIndex { /** * Reads index from input stream .
* @ param stream input stream
* @ return { @ code FileIndex }
* @ throws IOException */
public static FileIndex read ( InputStream stream ) throws IOException { } } | // Creating raw input stream
DataInputStream raw = new DataInputStream ( stream ) ; // Reading magic number
int magic = raw . readInt ( ) ; if ( magic != MAGIC ) throw new IOException ( "Wrong magic number" ) ; // Reading length
int length = raw . readInt ( ) ; // Reading whole index
byte [ ] buffer = new byte [ length... |
public class TypeMapper { /** * only for change appenders */
public MapContentType getMapContentType ( ContainerType containerType ) { } } | JaversType keyType = getJaversType ( Integer . class ) ; JaversType valueType = getJaversType ( containerType . getItemType ( ) ) ; return new MapContentType ( keyType , valueType ) ; |
public class ExtensionController { /** * Gets the list of extensions . */
@ RequestMapping ( value = "" , method = RequestMethod . GET ) public Resource < ExtensionList > getExtensions ( ) { } } | return Resource . of ( extensionManager . getExtensionList ( ) , uri ( MvcUriComponentsBuilder . on ( getClass ( ) ) . getExtensions ( ) ) ) ; |
public class PersistenceUnitMetadata { /** * Sets the jar files .
* @ param jarFiles
* the new jar files */
public void addJarFile ( String jarFile ) { } } | if ( jarFiles == null ) { jarFiles = new HashSet < String > ( ) ; } this . jarFiles . add ( jarFile ) ; addJarFileUrl ( jarFile ) ; |
public class _SharedRendererUtils { /** * Gets a Class object from a given component attribute . The attribute can
* be a ValueExpression ( that evaluates to a String or a Class ) or a
* String ( that is a fully qualified Java class name ) or a Class object .
* @ param facesContext
* @ param attribute
* @ ret... | // Attention !
// This code is duplicated in shared renderkit package .
// If you change something here please do the same in the other class !
Class < ? > type = null ; // if there is a value , it must be a . . .
// . . . a ValueExpression that evaluates to a String or a Class
if ( attribute instanceof ValueExpression... |
public class SslRefInfoImpl { /** * { @ inheritDoc } */
@ FFDCIgnore ( { } } | SocialLoginException . class } ) @ Override public PublicKey getPublicKey ( ) throws SocialLoginException { if ( this . jsseHelper == null ) { init ( ) ; } if ( sslKeyStoreName != null ) { if ( keyAliasName != null && keyAliasName . trim ( ) . isEmpty ( ) == false ) { KeyStoreService keyStoreService = keyStoreServiceRe... |
public class SelectListUtil { /** * Check for legacy matching , which supported setSelected using String representations .
* @ param option the option to test for a match
* @ param data the test data value
* @ return true if the option is a legacy match
* @ deprecated Support for legacy matching will be removed... | // Support legacy matching , which supported setSelected using String representations . . .
String optionAsString = String . valueOf ( option ) ; String matchAsString = String . valueOf ( data ) ; boolean equal = Util . equals ( optionAsString , matchAsString ) ; return equal ; |
public class JKServerDownException { /** * ( non - Javadoc )
* @ see java . lang . Throwable # getMessage ( ) */
@ Override public String getMessage ( ) { } } | if ( getCause ( ) instanceof UnknownHostException ) { return "Host (" + getHost ( ) + ") is unreachable !!!!" ; } if ( getCause ( ) instanceof ConnectException ) { return "Host (" + getHost ( ) + ") is unreachable at Port (" + getPort ( ) + ")!!!!" ; } return getCause ( ) . getMessage ( ) ; |
public class MsgCompiler { /** * Handles a complex message with placeholders . */
private Statement handleTranslationWithPlaceholders ( MsgNode msg , ImmutableList < SoyPrintDirective > escapingDirectives , Expression soyMsgParts , Expression locale , MsgPartsAndIds partsAndId ) { } } | // We need to render placeholders into a buffer and then pack them into a map to pass to
// Runtime . renderSoyMsgWithPlaceholders .
Map < String , Function < Expression , Statement > > placeholderNameToPutStatement = new LinkedHashMap < > ( ) ; putPlaceholdersIntoMap ( msg , partsAndId . parts , placeholderNameToPutSt... |
public class InstrumentedResourceLeakDetector { /** * This private field in the superclass needs to be reset so that we can continue reporting leaks even
* if they ' re duplicates . This is ugly but ideally should not be called frequently ( or at all ) . */
private void resetReportedLeaks ( ) { } } | try { Field reportedLeaks = ResourceLeakDetector . class . getDeclaredField ( "reportedLeaks" ) ; reportedLeaks . setAccessible ( true ) ; Object f = reportedLeaks . get ( this ) ; if ( f instanceof Map ) { ( ( Map ) f ) . clear ( ) ; } } catch ( Throwable t ) { // do nothing
} |
public class MKeyArea { /** * Read the record that matches this record ' s temp key area . < p >
* WARNING - This method changes the current record ' s buffer .
* @ param strSeekSign - Seek sign : < p >
* < pre >
* " = " - Look for the first match .
* " = = " - Look for an exact match ( On non - unique keys ,... | BaseBuffer buffer = null ; int iLowestMatch = - 1 ; // For non - exact matches
keyArea . setupKeyBuffer ( null , Constants . TEMP_KEY_AREA ) ; if ( keyArea . getUniqueKeyCode ( ) != Constants . UNIQUE ) // The main key is part of the comparison
vectorTable . getRecord ( ) . getKeyArea ( Constants . MAIN_KEY_AREA ) . se... |
public class CommerceOrderItemUtil { /** * Returns the first commerce order item in the ordered set where commerceOrderId = & # 63 ; and CPInstanceId = & # 63 ; .
* @ param commerceOrderId the commerce order ID
* @ param CPInstanceId the cp instance ID
* @ param orderByComparator the comparator to order the set b... | return getPersistence ( ) . findByC_I_First ( commerceOrderId , CPInstanceId , orderByComparator ) ; |
public class GHUtility { /** * TODO very similar to createSortedGraph - > use a ' int map ( int ) ' interface */
public static Graph copyTo ( Graph fromGraph , Graph toGraph ) { } } | AllEdgesIterator eIter = fromGraph . getAllEdges ( ) ; while ( eIter . next ( ) ) { int base = eIter . getBaseNode ( ) ; int adj = eIter . getAdjNode ( ) ; toGraph . edge ( base , adj ) . copyPropertiesFrom ( eIter ) ; } NodeAccess fna = fromGraph . getNodeAccess ( ) ; NodeAccess tna = toGraph . getNodeAccess ( ) ; int... |
public class UnXARMojo { /** * Unpack xar dependencies of the provided artifact .
* @ throws MojoExecutionException error when unpack dependencies . */
protected void unpackDependentXars ( Artifact artifact ) throws MojoExecutionException { } } | try { Set < Artifact > dependencies = resolveArtifactDependencies ( artifact ) ; for ( Artifact dependency : dependencies ) { unpack ( dependency . getFile ( ) , this . outputDirectory , "XAR Plugin" , false , getIncludes ( ) , getExcludes ( ) ) ; } } catch ( Exception e ) { throw new MojoExecutionException ( String . ... |
public class Reporter { /** * Records the performed step to the output file . This includes the action taken if any , the
* expected result , and the actual result . If a screenshot is desired , indicate as such . If
* a ' real ' browser is not being used ( not NONE or HTMLUNIT ) , then no screenshot will be taken ... | stepNum ++ ; String imageLink = "" ; if ( screenshot && isRealBrowser ( ) ) { // get a screen shot of the action
imageLink = captureEntirePageScreenshot ( ) ; } // determine time differences
Date currentTime = new Date ( ) ; long dTime = currentTime . getTime ( ) - lastTime ; long tTime = currentTime . getTime ( ) - st... |
public class PeerAwareInstanceRegistryImpl { /** * ( non - Javadoc )
* @ see com . netflix . eureka . registry . InstanceRegistry # cancel ( java . lang . String ,
* java . lang . String , long , boolean ) */
@ Override public boolean cancel ( final String appName , final String id , final boolean isReplication ) {... | if ( super . cancel ( appName , id , isReplication ) ) { replicateToPeers ( Action . Cancel , appName , id , null , null , isReplication ) ; synchronized ( lock ) { if ( this . expectedNumberOfClientsSendingRenews > 0 ) { // Since the client wants to cancel it , reduce the number of clients to send renews
this . expect... |
public class AbstractBigtableAdmin { /** * { @ inheritDoc } */
@ Override public boolean tableExists ( TableName tableName ) throws IOException { } } | for ( TableName existingTableName : listTableNames ( tableName . getNameAsString ( ) ) ) { if ( existingTableName . equals ( tableName ) ) { return true ; } } return false ; |
public class DefaultPDUSender { /** * ( non - Javadoc )
* @ see org . jsmpp . PDUSender # sendEnquireLinkResp ( java . io . OutputStream , int ) */
public byte [ ] sendEnquireLinkResp ( OutputStream os , int sequenceNumber ) throws IOException { } } | byte [ ] b = pduComposer . enquireLinkResp ( sequenceNumber ) ; writeAndFlush ( os , b ) ; return b ; |
public class MemberEnter { /** * Create a fresh environment for a variable ' s initializer .
* If the variable is a field , the owner of the environment ' s scope
* is be the variable itself , otherwise the owner is the method
* enclosing the variable definition .
* @ param tree The variable definition .
* @ ... | Env < AttrContext > localEnv = env . dupto ( new AttrContextEnv ( tree , env . info . dup ( ) ) ) ; if ( tree . sym . owner . kind == TYP ) { localEnv . info . scope = env . info . scope . dupUnshared ( tree . sym ) ; } if ( ( tree . mods . flags & STATIC ) != 0 || ( ( env . enclClass . sym . flags ( ) & INTERFACE ) !=... |
public class UrlOperations { /** * Extract userinfo from the absolute URL argument , that is , " username @ " , or
* " username : password @ " if present .
* @ param url the URL from which to extract the userinfo
* @ return the userinfo found , not including the " @ " , or null if no userinfo
* is found */
publ... | String lcUrl = url . toLowerCase ( ) ; if ( lcUrl . startsWith ( DNS_SCHEME ) ) { return null ; } for ( String scheme : ALL_SCHEMES ) { if ( lcUrl . startsWith ( scheme ) ) { int authorityIdx = scheme . length ( ) ; Matcher m = USERINFO_REGEX_SIMPLE . matcher ( lcUrl . substring ( authorityIdx ) ) ; if ( m . find ( ) )... |
public class Billing { /** * < pre >
* Billing configurations for sending metrics to the consumer project .
* There can be multiple consumer destinations per service , each one must have
* a different monitored resource type . A metric can be used in at most
* one consumer destination .
* < / pre >
* < code... | return consumerDestinations_ . get ( index ) ; |
public class FormulaFactory { /** * Creates a new literal instance with a given name and phase .
* Literal names should not start with { @ code @ RESERVED } - these are reserved for internal literals .
* @ param name the literal name
* @ param phase the literal phase
* @ return a new literal with the given name... | if ( phase ) return this . variable ( name ) ; else { Literal lit = this . negLiterals . get ( name ) ; if ( lit == null ) { lit = new Literal ( name , false , this ) ; this . negLiterals . put ( name , lit ) ; } return lit ; } |
public class Block { /** * A list of child blocks of the current block . For example a LINE object has child blocks for each WORD block
* that ' s part of the line of text . There aren ' t Relationship objects in the list for relationships that don ' t
* exist , such as when the current block has no child blocks . ... | if ( relationships == null ) { this . relationships = null ; return ; } this . relationships = new java . util . ArrayList < Relationship > ( relationships ) ; |
public class DevicesInner { /** * Downloads the updates on a data box edge / gateway device .
* @ param deviceName The device name .
* @ param resourceGroupName The resource group name .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceResponse } object... | return beginDownloadUpdatesWithServiceResponseAsync ( deviceName , resourceGroupName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class KAMStoreSchemaServiceImpl { /** * { @ inheritDoc } */
@ Override public void deleteFromKAMCatalog ( final String kamName ) throws SQLException { } } | KAMCatalogDao catalogDAO = null ; try { catalogDAO = createCatalogDao ( ) ; catalogDAO . deleteFromCatalog ( kamName ) ; } finally { if ( catalogDAO != null ) { closeCatalogDao ( catalogDAO ) ; } } |
public class UpdateAppProfileRequest { /** * Creates the request protobuf . This method is considered an internal implementation detail and
* not meant to be used by applications . */
@ InternalApi public com . google . bigtable . admin . v2 . UpdateAppProfileRequest toProto ( String projectId ) { } } | String name = NameUtil . formatAppProfileName ( projectId , instanceId , appProfileId ) ; proto . getAppProfileBuilder ( ) . setName ( name ) ; return proto . build ( ) ; |
public class PopupMenuItemHttpMessageContainer { /** * Tells whether or not the button should be enabled for the state of the given message container . Called from
* { @ code isEnableForMessageContainer ( MessageContainer ) } .
* By default , is only enabled if both methods { @ code isButtonEnabledForNumberOfSelect... | boolean enabled = isButtonEnabledForNumberOfSelectedMessages ( httpMessageContainer ) ; if ( enabled ) { enabled = isButtonEnabledForSelectedMessages ( httpMessageContainer ) ; } return enabled ; |
public class GDLLoader { /** * Adds a list of predicates to the current predicates using AND conjunctions
* @ param newPredicates predicates to be added */
private void addPredicates ( List < Predicate > newPredicates ) { } } | for ( Predicate newPredicate : newPredicates ) { if ( this . predicates == null ) { this . predicates = newPredicate ; } else { this . predicates = new And ( this . predicates , newPredicate ) ; } } |
public class XCARespondingGatewayAuditor { /** * Audits an ITI - 39 Cross Gateway Retrieve event for XCA Responding Gateway actors .
* @ param eventOutcome The event outcome indicator
* @ param initiatingGatewayUserId The Active Participant UserID for the document consumer ( if using WS - Addressing )
* @ param i... | if ( ! isAuditorEnabled ( ) ) { return ; } ExportEvent exportEvent = new ExportEvent ( true , eventOutcome , new IHETransactionEventTypeCodes . CrossGatewayRetrieve ( ) , purposesOfUse ) ; exportEvent . setAuditSourceId ( getAuditSourceId ( ) , getAuditEnterpriseSiteId ( ) ) ; exportEvent . addSourceActiveParticipant (... |
public class ConnectionWatcher { /** * @ param hosts
* @ return void
* @ throws IOException
* @ throws InterruptedException
* @ Description : 连接ZK
* @ author liaoqiqi
* @ date 2013-6-14 */
public void connect ( String hosts ) throws IOException , InterruptedException { } } | internalHost = hosts ; zk = new ZooKeeper ( internalHost , SESSION_TIMEOUT , this ) ; // 连接有超时哦
connectedSignal . await ( CONNECT_TIMEOUT , TimeUnit . MILLISECONDS ) ; LOGGER . info ( "zookeeper: " + hosts + " , connected." ) ; |
public class NewChunk { /** * Compute a sparse float buffer */
private byte [ ] bufD ( final int valsz ) { } } | int log = 0 ; while ( ( 1 << log ) < valsz ) ++ log ; assert ( 1 << log ) == valsz ; final int ridsz = _len >= 65535 ? 4 : 2 ; final int elmsz = ridsz + valsz ; int off = CXDChunk . OFF ; byte [ ] buf = MemoryManager . malloc1 ( off + _sparseLen * elmsz , true ) ; for ( int i = 0 ; i < _sparseLen ; i ++ , off += elmsz ... |
public class GenerateEsas { /** * This method will find the appropriate JAR ( s ) to the supplied set of file paths .
* @ param content The file paths to add the JAR ( s ) to
* @ param fd The feature definition containing this JAR
* @ param br The bundle repository to be queried to find the JAR
* @ param fr The... | // type = bundle , need to query the bundle repository for
// this feature def , to find which files are being used
// ( could be in a different location or an iFix ) .
// type = jar , basically same as type = bundle here
// type = boot . jar , basically same as type = bundle here
File b = br . selectBundle ( fr . getL... |
public class TargetFullFeatureStage { /** * Creates a PDU with { @ link FixedFormatSenseData } that must be sent to the initiator after receiving a
* Command
* Descriptor Block with an illegal field .
* @ param senseKeySpecificData
* contains a list of all illegal fields
* @ param additionalSenseCodeAndQualif... | // create the whole sense data
FixedFormatSenseData senseData = new FixedFormatSenseData ( false , // valid
ErrorType . CURRENT , // error type
false , // file mark
false , // end of medium
false , // incorrect length indicator
SenseKey . ILLEGAL_REQUEST , // sense key
new FourByteInformation ( ) , // information
new F... |
public class StateAssignmentOperation { /** * TODO rewrite based on operator id */
private Tuple2 < List < KeyedStateHandle > , List < KeyedStateHandle > > reAssignSubKeyedStates ( OperatorState operatorState , List < KeyGroupRange > keyGroupPartitions , int subTaskIndex , int newParallelism , int oldParallelism ) { } ... | List < KeyedStateHandle > subManagedKeyedState ; List < KeyedStateHandle > subRawKeyedState ; if ( newParallelism == oldParallelism ) { if ( operatorState . getState ( subTaskIndex ) != null ) { subManagedKeyedState = operatorState . getState ( subTaskIndex ) . getManagedKeyedState ( ) . asList ( ) ; subRawKeyedState =... |
public class ZooCheckDb { /** * private static final String DB _ NAME = " StackServerFault " ; */
public static void main ( String [ ] args ) { } } | String dbName ; if ( args . length == 0 ) { dbName = DB_NAME ; } else { dbName = args [ 0 ] ; } if ( ! ZooHelper . getDataStoreManager ( ) . dbExists ( dbName ) ) { err . println ( "ERROR Database not found: " + dbName ) ; return ; } out . println ( "Checking database: " + dbName ) ; ZooJdoProperties props = new ZooJdo... |
public class PausablePriorityBlockingQueue { /** * makes findbugs happy , but unused */
private void readObject ( ObjectInputStream ois ) { } } | try { ois . defaultReadObject ( ) ; pauseLock = new ReentrantLock ( ) ; pauseLock . newCondition ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } |
public class ConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Configuration configuration , ProtocolMarshaller protocolMarshaller ) { } } | if ( configuration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( configuration . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( configuration . getCreated ( ) , CREATED_BINDING ) ; protocolMarshaller . marshall ( configura... |
public class TransmittableThreadLocal { /** * see { @ link InheritableThreadLocal # set } */
@ Override public final void set ( T value ) { } } | super . set ( value ) ; // may set null to remove value
if ( null == value ) removeValue ( ) ; else addValue ( ) ; |
public class BaseMessageTransport { /** * Using this transport , process this internal message and convert to the external format .
* ( I ' m getting this message ready to send externally )
* @ param messageOut The message to send .
* @ param messageOutProcessor The message out processor .
* @ return Error code... | String strMessageInfoType = MessageInfoTypeModel . REQUEST ; String strMessageProcessType = MessageTypeModel . MESSAGE_OUT ; if ( messageOut . getMessageHeader ( ) != null ) { strMessageInfoType = ( String ) messageOut . getMessageHeader ( ) . get ( TrxMessageHeader . MESSAGE_INFO_TYPE ) ; strMessageProcessType = ( Str... |
public class PlatformDetector { /** * Parses the { @ code / etc / redhat - release } and returns a { @ link LinuxRelease } containing the
* ID and like [ " rhel " , " fedora " , ID ] . Currently only supported for CentOS , Fedora , and RHEL .
* Other variants will return { @ code null } . */
private static LinuxRel... | BufferedReader reader = null ; try { reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( file ) , "utf-8" ) ) ; // There is only a single line in this file .
String line = reader . readLine ( ) ; if ( line != null ) { line = line . toLowerCase ( Locale . US ) ; String id ; String version = null ... |
public class RidUtils { /** * Resolve rid from almost all possible objects .
* Even if simple string provided , value will be checked for correctness .
* Note : not saved object proxy , document or vertex will contain fake id and will be accepted
* ( but query result against such id will be empty ) .
* @ param ... | Preconditions . checkNotNull ( value , "Not null value required" ) ; final String res ; if ( value instanceof ORID ) { res = value . toString ( ) ; } else if ( value instanceof OIdentifiable ) { // ODocument , Vertex support
res = ( ( OIdentifiable ) value ) . getIdentity ( ) . toString ( ) ; } else if ( value instance... |
public class JobLeaderService { /** * Start the job leader service with the given services .
* @ param initialOwnerAddress to be used for establishing connections ( source address )
* @ param initialRpcService to be used to create rpc connections
* @ param initialHighAvailabilityServices to create leader retrieva... | if ( JobLeaderService . State . CREATED != state ) { throw new IllegalStateException ( "The service has already been started." ) ; } else { LOG . info ( "Start job leader service." ) ; this . ownerAddress = Preconditions . checkNotNull ( initialOwnerAddress ) ; this . rpcService = Preconditions . checkNotNull ( initial... |
public class LocalPDBDirectory { /** * Gets the directory in which the file for a given MMCIF file would live ,
* creating it if necessary .
* The obsolete parameter is necessary to avoid additional server queries .
* @ param pdbId
* @ param obsolete Whether the pdbId is obsolete or not
* @ return File pointi... | File dir = null ; if ( obsolete ) { // obsolete is always split
String middle = pdbId . substring ( 1 , 3 ) . toLowerCase ( ) ; dir = new File ( obsoleteDirPath , middle ) ; } else { String middle = pdbId . substring ( 1 , 3 ) . toLowerCase ( ) ; dir = new File ( splitDirPath , middle ) ; } if ( ! dir . exists ( ) ) { ... |
public class GateioTradeService { /** * Submits a Limit Order to be executed on the Gateio Exchange for the desired market defined by
* { @ code CurrencyPair } . WARNING - Gateio will return true regardless of whether or not an order
* actually gets created . The reason for this is that orders are simply submitted ... | return String . valueOf ( super . placeGateioLimitOrder ( limitOrder ) ) ; |
public class AzkabanExecutorServer { /** * Configure Metric Reporting as per azkaban . properties settings */
private void configureMetricReports ( ) throws MetricException { } } | final Props props = getAzkabanProps ( ) ; if ( props != null && props . getBoolean ( "executor.metric.reports" , false ) ) { logger . info ( "Starting to configure Metric Reports" ) ; final MetricReportManager metricManager = MetricReportManager . getInstance ( ) ; final IMetricEmitter metricEmitter = new InMemoryMetri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.