signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class MpJwtAppSetupUtils { /** * All of the test apps following the same naming convention . We can build the class names
* @ param app1 - test app 1
* @ param app2 - test app 2
* @ param app3 - test app 3 if it exists
* @ return
* @ throws Exception */
public List < String > createAppClassListBuildApp... | List < String > classList = createAppClassListBuildAppNames ( app1 , app2 ) ; classList . add ( "com.ibm.ws.jaxrs.fat.microProfileApp." + app2 + ".MicroProfileApp" + app3 ) ; return classList ; |
public class ArrayListBenchmark { /** * Sets up the benchmark .
* @ throws Exception if the setup fails */
@ Setup ( Level . Trial ) public void setup ( ) throws Exception { } } | test = benchmarks . get ( list + "-" + type ) ; if ( test == null ) { throw new RuntimeException ( "Can't find requested test " + list + " " + type ) ; } test . setSize ( size ) ; test . setRandomSeed ( size ) ; // TODO Use iteration some how
test . setup ( ) ; |
public class AbstractSearch { /** * Adds the performance to the cache and the current list of performances .
* @ param performancethe performance to add
* @ param foldsthe number of folds */
public void addPerformance ( Performance performance , int folds ) { } } | m_Performances . add ( performance ) ; m_Cache . add ( folds , performance ) ; m_Trace . add ( new AbstractMap . SimpleEntry < Integer , Performance > ( folds , performance ) ) ; |
public class ProductTemplate { /** * Sets the builtInTargeting value for this ProductTemplate .
* @ param builtInTargeting * Targeting to be included in the created { @ link ProposalLineItem } .
* Any type targeted cannot also be used for segmentation .
* < p > This attribute is optional .
* Note : if { @ link ... | this . builtInTargeting = builtInTargeting ; |
public class CreateFpgaImageRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < CreateFpgaImageRequest > getDryRunRequest ( ) { } } | Request < CreateFpgaImageRequest > request = new CreateFpgaImageRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class LocalDateRange { /** * Obtains the length of this range in days .
* This returns the number of days between the start and end dates .
* If the range is too large , the length will be { @ code Integer . MAX _ VALUE } .
* Unbounded ranges return { @ code Integer . MAX _ VALUE } .
* @ return the lengt... | if ( isUnboundedStart ( ) || isUnboundedEnd ( ) ) { return Integer . MAX_VALUE ; } long length = end . toEpochDay ( ) - start . toEpochDay ( ) ; return length > Integer . MAX_VALUE ? Integer . MAX_VALUE : ( int ) length ; |
public class FNMRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . FNMRG__CHAR_BOX_WD : setCharBoxWd ( CHAR_BOX_WD_EDEFAULT ) ; return ; case AfplibPackage . FNMRG__CHAR_BOX_HT : setCharBoxHt ( CHAR_BOX_HT_EDEFAULT ) ; return ; case AfplibPackage . FNMRG__PAT_DOSET : setPatDOset ( PAT_DOSET_EDEFAULT ) ; return ; } super . eUnset ( featureID ... |
public class Graphics { /** * Indicate if we should antialias as we draw primitives
* @ param anti
* True if we should antialias */
public void setAntiAlias ( boolean anti ) { } } | predraw ( ) ; antialias = anti ; LSR . setAntiAlias ( anti ) ; if ( anti ) { GL . glEnable ( SGL . GL_POLYGON_SMOOTH ) ; } else { GL . glDisable ( SGL . GL_POLYGON_SMOOTH ) ; } postdraw ( ) ; |
public class QueryRecord { /** * Set the default key order .
* @ param String strKeyName the current index .
* @ return The key area you are set to . */
public KeyArea setKeyArea ( String strKeyName ) { } } | KeyArea keyArea = super . setKeyArea ( strKeyName ) ; if ( this . isManualQuery ( ) ) { // Manual table - Special , set target table to this same key
TableLink tableLink = ( TableLink ) m_LinkageList . elementAt ( 0 ) ; Record record = tableLink . getLeftRecord ( ) ; if ( keyArea != null ) { // Find the closest matchin... |
public class CmsEditorBase { /** * Registers the types and entities of the given content definition . < p >
* @ param definition the content definition */
public void registerContentDefinition ( CmsContentDefinition definition ) { } } | m_widgetService . addConfigurations ( definition . getConfigurations ( ) ) ; CmsType baseType = definition . getTypes ( ) . get ( definition . getEntityTypeName ( ) ) ; m_entityBackend . registerTypes ( baseType , definition . getTypes ( ) ) ; m_entityBackend . registerEntity ( definition . getEntity ( ) ) ; |
public class PHPObject { /** * < p > parse . < / p >
* @ param container a { @ link com . greenpepper . phpsud . container . PHPContainer } object .
* @ param className a { @ link java . lang . String } object .
* @ param s a { @ link java . lang . String } object .
* @ return a { @ link java . lang . String } ... | try { String expr = PHPInterpeter . saveObject ( className + "::parse('" + s + "')" ) ; return container . get ( expr ) ; } catch ( PHPException e ) { LOGGER . error ( "Error when calling parse " + e . toString ( ) ) ; } return null ; |
public class DefaultMonetaryAmountFormat { /** * Split into ( potential ) plus , minus patterns */
private String [ ] splitIntoPlusMinusPatterns ( AmountFormatContext amountFormatContext , String pattern ) { } } | DecimalFormatSymbols decimalFormatSymbols = amountFormatContext . get ( DecimalFormatSymbols . class ) ; char patternSeparator = decimalFormatSymbols != null ? decimalFormatSymbols . getPatternSeparator ( ) : SUBPATTERN_BOUNDARY ; return pattern . split ( String . valueOf ( patternSeparator ) ) ; |
public class TemporaryTokenCache { /** * Validate a short lived token and returning the associated context
* The token is removed if found and valid .
* @ param key cacheKey
* @ param token temporary token to validate
* @ return an optional . The context will be absent if either the token is invalid of the cont... | Object context = validateTokenAndGetContext ( key , token ) . second ( ) ; return null != context ? Optional . of ( context ) : Optional . absent ( ) ; |
public class DatatypeConverter { /** * Parse duration time units .
* Note that we don ' t differentiate between confirmed and unconfirmed
* durations . Unrecognised duration types are default the supplied default value .
* @ param value BigInteger value
* @ param defaultValue if value is null , use this value a... | TimeUnit result = defaultValue ; if ( value != null ) { switch ( value . intValue ( ) ) { case 3 : case 35 : { result = TimeUnit . MINUTES ; break ; } case 4 : case 36 : { result = TimeUnit . ELAPSED_MINUTES ; break ; } case 5 : case 37 : { result = TimeUnit . HOURS ; break ; } case 6 : case 38 : { result = TimeUnit . ... |
public class ExpressionBuilderImpl { /** * Create an expression but does not change the container .
* @ param expression the textual representation of the expression .
* @ return the expression . */
@ Pure protected XExpression fromString ( String expression ) { } } | if ( ! Strings . isEmpty ( expression ) ) { ResourceSet resourceSet = this . context . eResource ( ) . getResourceSet ( ) ; URI uri = computeUnusedUri ( resourceSet ) ; Resource resource = getResourceFactory ( ) . createResource ( uri ) ; resourceSet . getResources ( ) . add ( resource ) ; try ( StringInputStream is = ... |
public class Document { /** * Adds the keywords to a Document .
* @ param keywords
* adds the keywords to the document
* @ return < CODE > true < / CODE > if successful , < CODE > false < / CODE > otherwise */
public boolean addKeywords ( String keywords ) { } } | try { return add ( new Meta ( Element . KEYWORDS , keywords ) ) ; } catch ( DocumentException de ) { throw new ExceptionConverter ( de ) ; } |
public class AVIMImageMessage { /** * 获取文件的metaData
* @ return */
@ Override public Map < String , Object > getFileMetaData ( ) { } } | if ( file == null ) { file = new HashMap < String , Object > ( ) ; } if ( file . containsKey ( FILE_META ) ) { return ( Map < String , Object > ) file . get ( FILE_META ) ; } if ( localFile != null ) { Map < String , Object > meta = AVIMFileMessageAccessor . getImageMeta ( localFile ) ; meta . put ( FILE_SIZE , actualF... |
public class AbstractParser { /** * Method used to get log format
* @ return list of tag and length for the log format
* @ throws CommunicationException communication error */
protected List < TagAndLength > getLogFormat ( ) throws CommunicationException { } } | List < TagAndLength > ret = new ArrayList < TagAndLength > ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "GET log format" ) ; } // Get log format
byte [ ] data = template . get ( ) . getProvider ( ) . transceive ( new CommandApdu ( CommandEnum . GET_DATA , 0x9F , 0x4F , 0 ) . toBytes ( ) ) ; if ( Response... |
public class A_CmsTreeTabDataPreloader { /** * Finds the common root folder for a collection of resources . < p >
* @ param resources the collection of resources
* @ throws CmsException if something goes wrong */
protected void findRoot ( Collection < CmsResource > resources ) throws CmsException { } } | m_commonRoot = getCommonSite ( resources ) ; String commonPath = getCommonAncestorPath ( resources ) ; try { m_rootResource = m_cms . readResource ( m_commonRoot , m_filter ) ; } catch ( CmsVfsResourceNotFoundException e ) { String currentPath = commonPath ; String lastWorkingPath = null ; while ( m_cms . existsResourc... |
public class PeerManager { /** * Invokes a node action on a specific node < em > without < / em > executing { @ link
* NodeAction # isApplicable } to determine whether the action is applicable . */
public void invokeNodeAction ( String nodeName , NodeAction action ) { } } | PeerNode peer = _peers . get ( nodeName ) ; if ( peer != null ) { if ( peer . nodeobj != null ) { peer . nodeobj . peerService . invokeAction ( flattenAction ( action ) ) ; } else { log . warning ( "Dropped NodeAction" , "nodeName" , nodeName , "action" , action ) ; } } else if ( Objects . equal ( nodeName , _nodeName ... |
public class TabularDataConverter { /** * Check for a full table data representation and do some sanity checks */
private boolean checkForFullTabularDataRepresentation ( JSONObject pValue , TabularType pType ) { } } | if ( pValue . containsKey ( "indexNames" ) && pValue . containsKey ( "values" ) && pValue . size ( ) == 2 ) { Object jsonVal = pValue . get ( "indexNames" ) ; if ( ! ( jsonVal instanceof JSONArray ) ) { throw new IllegalArgumentException ( "Index names for tabular data must given as JSON array, not " + jsonVal . getCla... |
public class CPMeasurementUnitPersistenceImpl { /** * Returns all the cp measurement units where groupId = & # 63 ; and type = & # 63 ; .
* @ param groupId the group ID
* @ param type the type
* @ return the matching cp measurement units */
@ Override public List < CPMeasurementUnit > findByG_T ( long groupId , i... | return findByG_T ( groupId , type , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class Keep { /** * setter for normalizedText - sets
* @ generated
* @ param v value to set into the feature */
public void setNormalizedText ( String v ) { } } | if ( Keep_Type . featOkTst && ( ( Keep_Type ) jcasType ) . casFeat_normalizedText == null ) jcasType . jcas . throwFeatMissing ( "normalizedText" , "ch.epfl.bbp.uima.types.Keep" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Keep_Type ) jcasType ) . casFeatCode_normalizedText , v ) ; |
public class NShortPath { /** * 初始化 , 主要分配内存
* @ param inGraph 输入图
* @ param nValueKind 希望的N值 */
private void initNShortPath ( Graph inGraph , int nValueKind ) { } } | graph = inGraph ; N = nValueKind ; // 获取顶点的数目
vertexCount = inGraph . vertexes . length ; fromArray = new CQueue [ vertexCount - 1 ] [ ] ; // 不包含起点
weightArray = new double [ vertexCount - 1 ] [ ] ; // 每个节点的最小堆
for ( int i = 0 ; i < vertexCount - 1 ; i ++ ) { fromArray [ i ] = new CQueue [ nValueKind ] ; weightArray [ ... |
public class ClassUtility { /** * Return the Class object for the given type .
* @ param type the given type to cast into Class
* @ return the Class casted object */
public static Class < ? > getClassFromType ( final Type type ) { } } | Class < ? > returnClass = null ; if ( type instanceof Class < ? > ) { returnClass = ( Class < ? > ) type ; } else if ( type instanceof ParameterizedType ) { returnClass = getClassFromType ( ( ( ParameterizedType ) type ) . getRawType ( ) ) ; } return returnClass ; |
public class ConsistentHashPartitionFilter { /** * Returns a map of { @ link ServiceEndPoint } objects indexed by their ID . */
private Map < String , ServiceEndPoint > indexById ( Iterable < ServiceEndPoint > endPoints ) { } } | Map < String , ServiceEndPoint > map = Maps . newHashMap ( ) ; for ( ServiceEndPoint endPoint : endPoints ) { map . put ( endPoint . getId ( ) , endPoint ) ; } return map ; |
public class CmsAttributeHandler { /** * Changes the attribute value . < p >
* @ param valueIndex the attribute value index
* @ param value the value */
private void changeEntityValue ( String value , int valueIndex ) { } } | if ( getEntityType ( ) . isChoice ( ) ) { CmsEntity choice = m_entity . getAttribute ( CmsType . CHOICE_ATTRIBUTE_NAME ) . getComplexValues ( ) . get ( valueIndex ) ; String attributeName = getChoiceName ( valueIndex ) ; if ( attributeName != null ) { choice . setAttributeValue ( attributeName , value , 0 ) ; } } else ... |
public class JolokiaServer { /** * Create the HttpServer to use . Can be overridden if a custom or already existing HttpServer should be
* used
* @ return HttpServer to use
* @ throws IOException if something fails during the initialisation */
private HttpServer createHttpServer ( JolokiaServerConfig pConfig ) th... | int port = pConfig . getPort ( ) ; InetAddress address = pConfig . getAddress ( ) ; InetSocketAddress socketAddress = new InetSocketAddress ( address , port ) ; HttpServer server = pConfig . useHttps ( ) ? createHttpsServer ( socketAddress , pConfig ) : HttpServer . create ( socketAddress , pConfig . getBacklog ( ) ) ;... |
public class DataUri { /** * @ throws IOException , MalformedURLException */
protected void init ( IRI uri ) throws IOException , MalformedURLException { } } | if ( ! uri . getScheme ( ) . equals ( "data" ) ) { throw new IllegalArgumentException ( "The input did not start with data:." ) ; } if ( uri . getRawFragment ( ) != null ) { throw new MalformedURLException ( "Fragment is not allowed for data: URIs according to RFC 2397. But if strictly comply with RFC 3986, ignore this... |
public class PageViewKit { /** * 获取web - inf下面的pageviews目录中pathRefRootViews子目录下面的静态页面
* @ param pathRefRootViews 目录 : 加入到 / WEB - INF / pageviews / pathRefRootViews下
* @ param pageName 页面名称
* @ return */
public static String getHTMLPageViewFromWebInf ( String pathRefRootViews , String pageName ) { } } | return getPageView ( WEBINF_DIR , PAGE_VIEW_PATH + pathRefRootViews , pageName , HTML ) ; |
public class NagiosNotifier { /** * logs message with status code 2 - critical */
@ Override public void sendError ( String message ) { } } | System . out . print ( "Critical: " + message ) ; System . exit ( 2 ) ; |
public class ValidationControl { /** * validates the text value using the list of validators provided by the user
* { { @ link # setValidators ( ValidatorBase . . . ) }
* @ return true if the value is valid else false */
@ Override public boolean validate ( ) { } } | for ( ValidatorBase validator : validators ) { // source control must be set to allow validators re - usability
validator . setSrcControl ( control ) ; validator . validate ( ) ; if ( validator . getHasErrors ( ) ) { activeValidator . set ( validator ) ; return false ; } } activeValidator . set ( null ) ; return true ; |
public class DataSiftClient { /** * Validate the given CSDL string against the DataSift API
* @ param csdl the CSDL to validate
* @ return the results of the validation , use { @ link com . datasift . client . core . Validation # isSuccessful ( ) } to check if
* validation was successful or not */
public FutureDa... | FutureData < Validation > future = new FutureData < Validation > ( ) ; URI uri = newParams ( ) . forURL ( config . newAPIEndpointURI ( VALIDATE ) ) ; POST request = config . http ( ) . POST ( uri , new PageReader ( newRequestCallback ( future , new Validation ( ) , config ) ) ) . form ( "csdl" , csdl ) ; performRequest... |
public class Node { /** * Gets the specified property or null if the property is not configured for this Node .
* @ param clazz the type of the property
* @ return null if the property is not configured
* @ since 2.37 */
@ CheckForNull public < T extends NodeProperty > T getNodeProperty ( Class < T > clazz ) { } ... | for ( NodeProperty p : getNodeProperties ( ) ) { if ( clazz . isInstance ( p ) ) { return clazz . cast ( p ) ; } } return null ; |
public class TangramEngine { /** * Remove all cells in a card with target index
* @ param removeIdx target card ' s index
* @ since 2.1.0 */
protected void removeBatchBy ( int removeIdx ) { } } | if ( mGroupBasicAdapter != null ) { Pair < Range < Integer > , Card > cardPair = mGroupBasicAdapter . getCardRange ( removeIdx ) ; if ( cardPair != null ) { removeBatchBy ( cardPair . second ) ; } } |
public class RxComapiClient { /** * Initialise ComapiImpl client instance .
* @ param application Application context .
* @ param adapter Observables to callbacks adapter .
* @ return Observable returning client instance . */
< T extends RxComapiClient > Observable < T > initialise ( @ NonNull final Application a... | return super . initialise ( application , instance , adapter ) ; |
public class FileSystemUtil { /** * Performs the os command .
* @ param cmdAttribs the command line parameters
* @ param max The maximum limit for the lines returned
* @ param timeout The timeout amount in milliseconds or no timeout if the value
* is zero or less
* @ return the lines returned by the command ,... | // this method does what it can to avoid the ' Too many open files ' error
// based on trial and error and these links :
// http : / / bugs . sun . com / bugdatabase / view _ bug . do ? bug _ id = 4784692
// http : / / bugs . sun . com / bugdatabase / view _ bug . do ? bug _ id = 4801027
// http : / / forum . java . su... |
public class BasicModMixer { /** * This Method now takes the current Period ( e . g . 856 < < 4 ) and calculates the
* playerTuning to be used . I . e . a value like 2 , which means every second sample in the
* current instrument is to be played . A value of 0.5 means , every sample is played twice .
* As we use ... | if ( newPeriod <= 0 ) aktMemo . currentTuning = 0 ; else if ( frequencyTableType == Helpers . XM_LINEAR_TABLE ) { final int xm_period_value = newPeriod >> 2 ; int newFrequency = Helpers . lintab [ xm_period_value % 768 ] >> ( xm_period_value / 768 ) ; aktMemo . currentTuning = ( int ) ( ( ( long ) newFrequency << Helpe... |
public class FileManagerImpl { /** * / * Add a new block to the beginning of a free list data structure */
private void add_block_to_freelist ( Block block , int ql_index ) { } } | block . next = ql_heads [ ql_index ] . first_block ; ql_heads [ ql_index ] . first_block = block ; ql_heads [ ql_index ] . length ++ ; if ( ql_heads [ ql_index ] . length == 1 ) { nonempty_lists ++ ; } |
public class GetIntegrationResponsesResult { /** * The elements from this collection .
* @ param items
* The elements from this collection . */
public void setItems ( java . util . Collection < IntegrationResponse > items ) { } } | if ( items == null ) { this . items = null ; return ; } this . items = new java . util . ArrayList < IntegrationResponse > ( items ) ; |
public class AbstractObjectFactory { /** * Creates an object given the fully qualified class name , initialized with the specified constructor arguments
* corresponding to the parameter types that specifies the exact signature of the constructor used to construct
* the object .
* @ param < T > the Class type of t... | return ( T ) create ( ClassUtils . loadClass ( objectTypeName ) , parameterTypes , args ) ; |
public class GitlabAPI { /** * Creates a Group
* @ param name The name of the group
* @ param path The path for the group
* @ return The GitLab Group
* @ throws IOException on gitlab api call error */
public GitlabGroup createGroup ( String name , String path ) throws IOException { } } | return createGroup ( name , path , null , null , null ) ; |
public class BshClassManager { /** * Get a resource stream using the BeanShell classpath
* @ param path should be an absolute path */
public InputStream getResourceAsStream ( String path ) { } } | Object in = null ; if ( externalClassLoader != null ) // classloader wants no leading slash
in = externalClassLoader . getResourceAsStream ( path . substring ( 1 ) ) ; if ( in == null ) return Interpreter . class . getResourceAsStream ( path ) ; return ( InputStream ) in ; |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcTendonAnchorTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class FeedItemAttributeValue { /** * Sets the moneyWithCurrencyValue value for this FeedItemAttributeValue .
* @ param moneyWithCurrencyValue * MoneyWithCurrency value . Should be set if feedAttributeId refers
* to a feed attribute of type
* PRICE . Leave empty to clear an existing PRICE attribute
* valu... | this . moneyWithCurrencyValue = moneyWithCurrencyValue ; |
public class Palette { /** * Generate jet color palette .
* @ param n the number of colors in the palette .
* @ param alpha the parameter in [ 0,1 ] for transparency . */
public static Color [ ] jet ( int n , float alpha ) { } } | int m = ( int ) Math . ceil ( n / 4 ) ; float [ ] u = new float [ 3 * m ] ; for ( int i = 0 ; i < u . length ; i ++ ) { if ( i == 0 ) { u [ i ] = 0.0f ; } else if ( i <= m ) { u [ i ] = i / ( float ) m ; } else if ( i <= 2 * m - 1 ) { u [ i ] = 1.0f ; } else { u [ i ] = ( 3 * m - i ) / ( float ) m ; } } int m2 = m / 2 ... |
public class JMStats { /** * Sum number .
* @ param < N > the type parameter
* @ param numberList the number list
* @ return the number */
public static < N extends Number > Number sum ( List < N > numberList ) { } } | return cal ( numberList , doubleStream -> OptionalDouble . of ( doubleStream . sum ( ) ) ) ; |
public class ApiOvhDbaaslogs { /** * Returns details of specified input
* REST : GET / dbaas / logs / { serviceName } / input / { inputId }
* @ param serviceName [ required ] Service name
* @ param inputId [ required ] Input ID */
public OvhInput serviceName_input_inputId_GET ( String serviceName , String inputId... | String qPath = "/dbaas/logs/{serviceName}/input/{inputId}" ; StringBuilder sb = path ( qPath , serviceName , inputId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhInput . class ) ; |
public class JMStats { /** * Cal stats number .
* @ param statsString the stats string
* @ param numberStream the number stream
* @ return the number */
public static Number calStats ( String statsString , LongStream numberStream ) { } } | return StatsField . valueOfAlias ( statsString ) . calStats ( numberStream ) ; |
public class LineHeightProperty { /** * The used value of the property is this < code > value < / code > multiplied by the
* element ' s font size . Negative values are illegal . */
public CssSetter with ( Double value ) { } } | return new SimpleCssSetter ( CSS_PROPERTY , value != null ? "" + value : null ) ; |
public class SecurityContext { /** * Wrap the given executor so that it takes authentication - information and context are inherited to tasks when they
* are submitted . */
public static ExecutorService getSecurityContextAwareExecutor ( ExecutorService original ) { } } | SubjectAwareExecutorService subjectAwareExecutor = new SubjectAwareExecutorService ( original ) ; return ThreadLocalUtil . contextAwareExecutor ( subjectAwareExecutor ) ; |
public class StringHtmlEncoder { /** * Encodes complete component by calling { @ link UIComponent # encodeAll ( FacesContext ) } .
* @ param component component
* @ param context { @ link FacesContext }
* @ return the rendered string .
* @ throws IOException thrown by writer */
public static String encodeCompon... | return encodeComponentWithSurroundingDiv ( context , component , null ) ; |
public class JsonFluentAssert { /** * Creates an assert object that only compares given node .
* The path is denoted by JSON path , for example .
* < code >
* assertThatJson ( " { \ " root \ " : { \ " test \ " : [ 1,2,3 ] } } " ) . node ( " root . test [ 0 ] " ) . isEqualTo ( " 1 " ) ;
* < / code >
* @ param ... | return new JsonFluentAssert ( actual , path . copy ( newPath ) , description , configuration ) ; |
public class ChildViewHolder { /** * Returns the adapter position of the Child associated with this ChildViewHolder
* @ return The adapter position of the Child if it still exists in the adapter .
* RecyclerView . NO _ POSITION if item has been removed from the adapter ,
* RecyclerView . Adapter . notifyDataSetCh... | int flatPosition = getAdapterPosition ( ) ; if ( mExpandableAdapter == null || flatPosition == RecyclerView . NO_POSITION ) { return RecyclerView . NO_POSITION ; } return mExpandableAdapter . getChildPosition ( flatPosition ) ; |
public class UnsafeRow { /** * Copies this row , returning a self - contained UnsafeRow that stores its data in an internal
* byte array rather than referencing data stored in a data page . */
@ Override public UnsafeRow copy ( ) { } } | UnsafeRow rowCopy = new UnsafeRow ( numFields ) ; final byte [ ] rowDataCopy = new byte [ sizeInBytes ] ; Platform . copyMemory ( baseObject , baseOffset , rowDataCopy , Platform . BYTE_ARRAY_OFFSET , sizeInBytes ) ; rowCopy . pointTo ( rowDataCopy , Platform . BYTE_ARRAY_OFFSET , sizeInBytes ) ; return rowCopy ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcProjectOrderRecordTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class JOGLTypeConversions { /** * Convert polygon modes from GL constants .
* @ param g The GL constant .
* @ return The value . */
public static JCGLPolygonMode polygonModeFromGL ( final int g ) { } } | switch ( g ) { case GL2GL3 . GL_FILL : return JCGLPolygonMode . POLYGON_FILL ; case GL2GL3 . GL_LINE : return JCGLPolygonMode . POLYGON_LINES ; case GL2GL3 . GL_POINT : return JCGLPolygonMode . POLYGON_POINTS ; default : throw new UnreachableCodeException ( ) ; } |
public class EntryAction { /** * If thread is a synchronous call , wait until operation is complete .
* There is a little chance that the call back completes before we get
* here as well as some other operation changing the entry again . */
public void asyncOperationStarted ( ) { } } | if ( syncThread == Thread . currentThread ( ) ) { synchronized ( entry ) { while ( entry . isProcessing ( ) ) { try { entry . wait ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; } } } } else { entryLocked = false ; } |
public class CmsAvailableRoleOrPrincipalTable { /** * Filters the table according to given search string . < p >
* @ param search string to be looked for . */
public void filterTable ( String search ) { } } | m_container . removeAllContainerFilters ( ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( search ) ) { if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( m_dialog . getFurtherColumnId ( ) ) ) { m_container . addContainerFilter ( new Or ( new SimpleStringFilter ( PROP_NAME , search , true , false ) ) ) ; } else { m_co... |
public class RollupConfig { /** * Fetches the RollupInterval corresponding to the rollup or pre - agg table
* name .
* @ param table The name of the table to fetch
* @ return The RollupInterval object matching the table
* @ throws IllegalArgumentException if the table is null or empty
* @ throws NoSuchRollupF... | if ( table == null || table . isEmpty ( ) ) { throw new IllegalArgumentException ( "The table name cannot be null or empty" ) ; } final RollupInterval rollup = reverse_intervals . get ( table ) ; if ( rollup == null ) { throw new NoSuchRollupForTableException ( table ) ; } return rollup ; |
public class XmlChangeSetReader { /** * Read a < code > RuleSet < / code > from a < code > Reader < / code > .
* @ param reader
* The reader containing the rule - set .
* @ return The rule - set . */
public ChangeSet read ( final Reader reader ) throws SAXException , IOException { } } | return ( ChangeSet ) this . parser . read ( reader ) ; |
public class UdpConnection { /** * { @ inheritDoc } */
@ Override public void send ( final SipMessage msg ) { } } | final DatagramPacket pkt = new DatagramPacket ( toByteBuf ( msg ) , getRemoteAddress ( ) ) ; channel ( ) . writeAndFlush ( pkt ) ; |
public class MatrixIO { /** * Converts the format of the input { @ code matrix } , returning a temporary
* file containing the matrix ' s data in the desired format .
* @ param matrix a file containing a matrix to convert
* @ param current the format of the { @ code matrix } file
* @ param desired the format of... | return convertFormat ( matrix , current , desired , false ) ; |
public class XpathUtils { /** * Same as { @ link # asLong ( String , Node ) } but allows an xpath to be passed
* in explicitly for reuse . */
public static Long asLong ( String expression , Node node , XPath xpath ) throws XPathExpressionException { } } | String longString = evaluateAsString ( expression , node , xpath ) ; return ( isEmptyString ( longString ) ) ? null : Long . parseLong ( longString ) ; |
public class VectorMath { /** * Adds the values from a { @ code CompactSparseVector } to a { @ code Vector } .
* Only the non - zero indices will be traversed to save time .
* @ param destination The vector to write new values to .
* @ param source The vector to read values from . */
private static void subtractS... | int [ ] otherIndices = ( ( SparseVector ) source ) . getNonZeroIndices ( ) ; for ( int index : otherIndices ) destination . add ( index , - 1 * source . get ( index ) ) ; |
public class DefaultNodeManager { /** * Deploys a network . */
private void doDeployNetwork ( final Message < JsonObject > message ) { } } | Object network = message . body ( ) . getValue ( "network" ) ; if ( network != null ) { if ( network instanceof String ) { doDeployNetwork ( ( String ) network , message ) ; } else if ( network instanceof JsonObject ) { JsonObject jsonNetwork = ( JsonObject ) network ; try { NetworkConfig config = serializer . deserial... |
public class BackupPlanMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BackupPlan backupPlan , ProtocolMarshaller protocolMarshaller ) { } } | if ( backupPlan == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( backupPlan . getBackupPlanName ( ) , BACKUPPLANNAME_BINDING ) ; protocolMarshaller . marshall ( backupPlan . getRules ( ) , RULES_BINDING ) ; } catch ( Exception e ) { throw ... |
public class StageStateMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StageState stageState , ProtocolMarshaller protocolMarshaller ) { } } | if ( stageState == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stageState . getStageName ( ) , STAGENAME_BINDING ) ; protocolMarshaller . marshall ( stageState . getInboundTransitionState ( ) , INBOUNDTRANSITIONSTATE_BINDING ) ; protocol... |
public class EJSContainer { /** * d140003.20 return signature change */
private EJBMethodInfoImpl mapMethodInfo ( EJSDeployedSupport s , EJSWrapperBase wrapper , int methodId , String methodSignature ) { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d532639.2
if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "mapMethodInfo(" + methodId + "," + methodSignature + ")" ) ; EJBMethodInfoImpl rtnInfo = null ; // d122418-1 / / d140003.20
s . methodId = methodId ; // 130230 d140003.19
s . ... |
public class PseudoClassSpecifierChecker { /** * Add { @ code : only - child } elements .
* @ see < a href = " http : / / www . w3 . org / TR / css3 - selectors / # only - child - pseudo " > < code > : only - child < / code > pseudo - class < / a > */
private void addOnlyChildElements ( ) { } } | for ( Node node : nodes ) { Index index = helper . getIndexInParent ( node , false ) ; if ( index . size == 1 ) result . add ( node ) ; } |
public class NetworkManager { /** * Unwatches a component instance ' s status and context . */
private void unwatchInstance ( final InstanceContext instance , final CountingCompletionHandler < Void > counter ) { } } | Handler < MapEvent < String , String > > watchHandler = watchHandlers . remove ( instance . address ( ) ) ; if ( watchHandler != null ) { data . unwatch ( instance . status ( ) , watchHandler , new Handler < AsyncResult < Void > > ( ) { @ Override public void handle ( AsyncResult < Void > result ) { data . remove ( ins... |
public class MinSimilarityAffinityMatrixCreator { /** * { @ inheritDoc } */
public MatrixFile calculate ( MatrixFile input , boolean useColumns ) { } } | File matrixFile = input . getFile ( ) ; MatrixIO . Format format = input . getFormat ( ) ; // IMPLEMENTATION NOTE : since the user has requested the matrix be dealt
// with as a file , we need to keep the matrix on disk . However , the
// input matrix format may not be conducive to efficiently comparing
// rows with ea... |
public class LocaleSelectorImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setLangCode ( String newLangCode ) { } } | String oldLangCode = langCode ; langCode = newLangCode ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . LOCALE_SELECTOR__LANG_CODE , oldLangCode , langCode ) ) ; |
public class ResourceManager { /** * Find the resources in { @ link # resourcesGraph } matching the given { @ code query } .
* @ param query a location eventually containing wildcards
* @ param locationResolver the { @ link LocationResolver } to perform the matching of graph nodes against the given
* { @ code que... | graphLockRead . lock ( ) ; try { List < Resource < L > > result = new ArrayList < Resource < L > > ( ) ; GraphIterator < Resource < L > , DefaultEdge > it = new BreadthFirstIterator < Resource < L > , DefaultEdge > ( this . resourcesGraph ) ; while ( it . hasNext ( ) ) { Resource < L > resource = it . next ( ) ; if ( l... |
public class BMSClient { /** * Initializes the SDK with supplied parameters .
* This method should be called before you send the first request
* @ param context Android application context
* @ param bluemixRegion Specifies the Bluemix region to use . Use values in BMSClient . REGION * static props .
* @ throws ... | this . bluemixRegionSuffix = bluemixRegion ; // Change this if we ever support retries with multiple regions
if ( null == this . authorizationManager ) { this . authorizationManager = new DummyAuthorizationManager ( context ) ; } Request . setCookieManager ( cookieManager ) ; cookieManager . setCookiePolicy ( CookiePol... |
public class NonLockingAltContainer { /** * this is called directly from tests but shouldn ' t be accessed otherwise . */
@ Override public void dispatch ( final KeyedMessage message , final boolean block ) throws IllegalArgumentException , ContainerException { } } | if ( ! isRunningLazy ) { LOGGER . debug ( "Dispacth called on stopped container" ) ; statCollector . messageFailed ( false ) ; } if ( message == null ) return ; // No . We didn ' t process the null message
if ( message . message == null ) throw new IllegalArgumentException ( "the container for " + clusterId + " attempt... |
public class snmpview { /** * Use this API to delete snmpview . */
public static base_response delete ( nitro_service client , snmpview resource ) throws Exception { } } | snmpview deleteresource = new snmpview ( ) ; deleteresource . name = resource . name ; deleteresource . subtree = resource . subtree ; return deleteresource . delete_resource ( client ) ; |
public class VelocityTemplateGroup { /** * Public */
public VelocityTemplate addTemplate ( VelocityTemplate template ) { } } | addTemplateProperties ( template ) ; this . templates . add ( template ) ; return template ; |
public class DeviceImpl { /** * Get status
* @ return status
* @ throws DevFailed */
public String getStatus ( ) throws DevFailed { } } | MDC . setContextMap ( contextMap ) ; xlogger . entry ( ) ; if ( initImpl . isInitInProgress ( ) ) { // set status while init is in progress
final String tmp = statusImpl . updateStatus ( DeviceState . getDeviceState ( getState ( ) ) ) ; if ( tmp . equals ( Constants . INIT_IN_PROGRESS ) ) { status = tmp ; } else { stat... |
public class FieldCoordinates { /** * Creates new field coordinates
* @ param parentType the container of the field
* @ param fieldName the field name
* @ return new field coordinates represented by the two parameters */
public static FieldCoordinates coordinates ( String parentType , String fieldName ) { } } | assertValidName ( parentType ) ; assertValidName ( fieldName ) ; return new FieldCoordinates ( parentType , fieldName ) ; |
public class ProtoNetworkBuilder { /** * Build a { @ link Set } of { @ link AnnotationPair } objects from a { @ link Map }
* of { @ link Annotation } values .
* @ param protoNetwork { @ link ProtoNetwork } , the proto network
* @ param annotationMap { @ link Map } , the annotations map
* @ return { @ link Set }... | // build annotation value to annotation definition map
Set < AnnotationPair > valueDefinitions = new LinkedHashSet < AnnotationPair > ( ) ; AnnotationValueTable avt = protoNetwork . getAnnotationValueTable ( ) ; AnnotationDefinitionTable adt = protoNetwork . getAnnotationDefinitionTable ( ) ; Set < Annotation > annotat... |
public class ClusterManager { /** * Checks if a pending request can be fulfilled . */
private void checkPendingRequests ( ) { } } | final Iterator < Map . Entry < JobID , PendingRequestsMap > > it = this . pendingRequestsOfJob . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final List < AllocatedResource > allocatedResources = new ArrayList < AllocatedResource > ( ) ; final Map . Entry < JobID , PendingRequestsMap > entry = it . next (... |
public class ProjectTaskScreen { /** * Add button ( s ) to the toolbar . */
public void addToolbarButtons ( ToolScreen toolScreen ) { } } | super . addToolbarButtons ( toolScreen ) ; new SCannedBox ( toolScreen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , toolScreen , null , ScreenConstants . DEFAULT_DISPLAY , null , ProjectTask . PROJECT_PREDECESSOR_DETAIL_SCREEN , MenuConstants . FORMDETAIL , ProjectTask . PROJECT... |
public class AbstractSQLUpdateClause { /** * Populate the UPDATE clause with the properties of the given bean using the given Mapper .
* @ param obj object to use for population
* @ param mapper mapper to use
* @ return the current object */
@ SuppressWarnings ( { } } | "rawtypes" , "unchecked" } ) @ WithBridgeMethods ( value = SQLUpdateClause . class , castRequired = true ) public < T > C populate ( T obj , Mapper < T > mapper ) { Collection < ? extends Path < ? > > primaryKeyColumns = entity . getPrimaryKey ( ) != null ? entity . getPrimaryKey ( ) . getLocalColumns ( ) : Collections... |
public class TreeMap { /** * Customized deserialization .
* @ param objectInputStreamIn containing the TreeMap .
* @ throws java . io . IOException
* @ throws java . lang . ClassNotFoundException */
private void readObject ( java . io . ObjectInputStream objectInputStreamIn ) throws java . io . IOException , java... | if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "readObject" , "objectInputStreamIn=" + objectInputStreamIn + "(java.io.ObjectInputStream)" ) ; objectInputStreamIn . defaultReadObject ( ) ; availableSize = size ; // Start as last commited .
managedObjectsToAdd = ne... |
public class StaleIpPermission { /** * The security group pairs . Returns the ID of the referenced security group and VPC , and the ID and status of the
* VPC peering connection .
* @ param userIdGroupPairs
* The security group pairs . Returns the ID of the referenced security group and VPC , and the ID and statu... | if ( userIdGroupPairs == null ) { this . userIdGroupPairs = null ; return ; } this . userIdGroupPairs = new com . amazonaws . internal . SdkInternalList < UserIdGroupPair > ( userIdGroupPairs ) ; |
public class MD5Digest { /** * Static method to get an MD5Digest from a human - readable string representation
* @ param md5String
* @ return a filled out MD5Digest */
public static MD5Digest fromString ( String md5String ) { } } | byte [ ] bytes ; try { bytes = Hex . decodeHex ( md5String . toCharArray ( ) ) ; return new MD5Digest ( md5String , bytes ) ; } catch ( DecoderException e ) { throw new IllegalArgumentException ( "Unable to convert md5string" , e ) ; } |
public class List { /** * Gets the value of the listItemOrX property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is why there is not a < CODE > set < / CODE > method ... | if ( listItemOrX == null ) { listItemOrX = new ArrayList < Object > ( ) ; } return this . listItemOrX ; |
public class PromisesArray { /** * Map promises results to new promises
* @ param fun mapping function
* @ param < R > type of result promises
* @ return PromisesArray */
public < R > PromisesArray < R > map ( final Function < T , Promise < R > > fun ) { } } | return mapSourcePromises ( srcPromise -> new Promise < R > ( resolver -> { srcPromise . then ( t -> { Promise < R > mapped = fun . apply ( t ) ; mapped . then ( t2 -> resolver . result ( t2 ) ) ; mapped . failure ( e -> resolver . error ( e ) ) ; } ) ; srcPromise . failure ( e -> resolver . error ( e ) ) ; } ) ) ; |
public class CheckpointCoordinator { /** * Adds the given master hook to the checkpoint coordinator . This method does nothing , if
* the checkpoint coordinator already contained a hook with the same ID ( as defined via
* { @ link MasterTriggerRestoreHook # getIdentifier ( ) } ) .
* @ param hook The hook to add .... | checkNotNull ( hook ) ; final String id = hook . getIdentifier ( ) ; checkArgument ( ! StringUtils . isNullOrWhitespaceOnly ( id ) , "The hook has a null or empty id" ) ; synchronized ( lock ) { if ( ! masterHooks . containsKey ( id ) ) { masterHooks . put ( id , hook ) ; return true ; } else { return false ; } } |
public class ImplicitObjectUtil { /** * Load the output form bean into the request .
* @ param request the request
* @ param bean the output form bean */
public static void loadOutputFormBean ( ServletRequest request , Object bean ) { } } | if ( bean != null ) request . setAttribute ( OUTPUT_FORM_BEAN_OBJECT_KEY , bean ) ; |
public class JsonParser { /** * Returns the next value from the JSON stream as a parse tree .
* @ throws JsonParseException if there is an IOException or if the specified
* text is not valid JSON */
public static JsonElement parseReader ( JsonReader reader ) throws JsonIOException , JsonSyntaxException { } } | boolean lenient = reader . isLenient ( ) ; reader . setLenient ( true ) ; try { return Streams . parse ( reader ) ; } catch ( StackOverflowError e ) { throw new JsonParseException ( "Failed parsing JSON source: " + reader + " to Json" , e ) ; } catch ( OutOfMemoryError e ) { throw new JsonParseException ( "Failed parsi... |
public class PointInTimeRecoverySpecificationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( PointInTimeRecoverySpecification pointInTimeRecoverySpecification , ProtocolMarshaller protocolMarshaller ) { } } | if ( pointInTimeRecoverySpecification == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( pointInTimeRecoverySpecification . getPointInTimeRecoveryEnabled ( ) , POINTINTIMERECOVERYENABLED_BINDING ) ; } catch ( Exception e ) { throw new SdkCli... |
public class CommandLine { /** * Delegates to { @ link # call ( Callable , PrintStream , PrintStream , Help . Ansi , String . . . ) } with { @ code System . err } for
* diagnostic error messages and { @ link Help . Ansi # AUTO } .
* @ param callable the command to call when { @ linkplain # parseArgs ( String . . . ... | return call ( callable , out , System . err , Help . Ansi . AUTO , args ) ; |
public class TasksImpl { /** * Terminates the specified task .
* When the task has been terminated , it moves to the completed state . For multi - instance tasks , the terminate task operation applies synchronously to the primary task ; subtasks are then terminated asynchronously in the background .
* @ param jobId... | terminateWithServiceResponseAsync ( jobId , taskId , taskTerminateOptions ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class AWSGreengrassClient { /** * Retrieves information about a core definition version .
* @ param getCoreDefinitionVersionRequest
* @ return Result of the GetCoreDefinitionVersion operation returned by the service .
* @ throws BadRequestException
* invalid request
* @ sample AWSGreengrass . GetCoreDe... | request = beforeClientExecution ( request ) ; return executeGetCoreDefinitionVersion ( request ) ; |
public class CrystalBuilder { /** * Apply the NCS operators in the given Structure adding new chains as needed .
* All chains are ( re ) assigned ids of the form : original _ chain _ id + ncs _ operator _ index + { @ value # NCS _ CHAINID _ SUFFIX _ CHAR } .
* @ param structure
* the structure to expand
* @ par... | PDBCrystallographicInfo xtalInfo = structure . getCrystallographicInfo ( ) ; if ( xtalInfo == null ) return ; if ( xtalInfo . getNcsOperators ( ) == null || xtalInfo . getNcsOperators ( ) . length == 0 ) return ; List < Chain > chainsToAdd = new ArrayList < > ( ) ; Matrix4d identity = new Matrix4d ( ) ; identity . setI... |
public class BitUtil { /** * Returns the popcount or cardinality of the two sets after an intersection .
* Neither array is modified . */
public static long pop_intersect ( long [ ] arr1 , long [ ] arr2 , int wordOffset , int numWords ) { } } | long popCount = 0 ; for ( int i = wordOffset , end = wordOffset + numWords ; i < end ; ++ i ) { popCount += Long . bitCount ( arr1 [ i ] & arr2 [ i ] ) ; } return popCount ; |
public class EmbeddedProcessFactory { /** * Create an embedded host controller with an already established module loader .
* @ param moduleLoader the module loader . Cannot be { @ code null }
* @ param jbossHomeDir the location of the root of server installation . Cannot be { @ code null } or empty .
* @ param cm... | return createHostController ( Configuration . Builder . of ( jbossHomeDir ) . setModuleLoader ( moduleLoader ) . setCommandArguments ( cmdargs ) . build ( ) ) ; |
public class RecurrenceUtility { /** * Converts the string representation of the days bit field into an integer .
* @ param days string bit field
* @ return integer bit field */
public static Integer getDays ( String days ) { } } | Integer result = null ; if ( days != null ) { result = Integer . valueOf ( Integer . parseInt ( days , 2 ) ) ; } return ( result ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.