signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CommerceSubscriptionEntryUtil { /** * Returns the commerce subscription entries before and after the current commerce subscription entry in the ordered set where uuid = & # 63 ; .
* @ param commerceSubscriptionEntryId the primary key of the current commerce subscription entry
* @ param uuid the uuid
... | return getPersistence ( ) . findByUuid_PrevAndNext ( commerceSubscriptionEntryId , uuid , orderByComparator ) ; |
public class SVG { /** * Change the height of the document by altering the " height " attribute
* of the root { @ code < svg > } element .
* @ param value A valid SVG ' length ' attribute , such as " 100px " or " 10cm " .
* @ throws SVGParseException if { @ code value } cannot be parsed successfully .
* @ throw... | "WeakerAccess" , "unused" } ) public void setDocumentHeight ( String value ) throws SVGParseException { if ( this . rootElement == null ) throw new IllegalArgumentException ( "SVG document is empty" ) ; this . rootElement . height = SVGParser . parseLength ( value ) ; |
public class JavaMailSender { /** * Set the recipients addresses on the mime message .
* @ param email
* the source email
* @ param mimeMsg
* the mime message to fill
* @ throws MessagingException
* when the email address is not valid
* @ throws AddressException
* when the email address is not valid
*... | for ( Recipient recipient : email . getRecipients ( ) ) { mimeMsg . addRecipient ( convert ( recipient . getType ( ) ) , toInternetAddress ( recipient . getAddress ( ) ) ) ; } |
public class CPAttachmentFileEntryPersistenceImpl { /** * Returns the first cp attachment file entry in the ordered set where classNameId = & # 63 ; and classPK = & # 63 ; and type = & # 63 ; and status & ne ; & # 63 ; .
* @ param classNameId the class name ID
* @ param classPK the class pk
* @ param type the typ... | List < CPAttachmentFileEntry > list = findByC_C_T_NotST ( classNameId , classPK , type , status , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class FirewallRulesInner { /** * Gets all firewall rules in the specified redis cache .
* @ param resourceGroupName The name of the resource group .
* @ param cacheName The name of the Redis cache .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to ... | return listByRedisResourceWithServiceResponseAsync ( resourceGroupName , cacheName ) . map ( new Func1 < ServiceResponse < Page < RedisFirewallRuleInner > > , Page < RedisFirewallRuleInner > > ( ) { @ Override public Page < RedisFirewallRuleInner > call ( ServiceResponse < Page < RedisFirewallRuleInner > > response ) {... |
public class ColorParser { /** * Parse the string and convert it to a { @ link java . awt . Color } . See class description for details on the
* supported color formats .
* @ param colorString the color string encoded . */
public static Color toColor ( final String colorString ) { } } | String trimmedString = colorString . trim ( ) ; Color color = null ; if ( trimmedString . startsWith ( "#" ) ) { final int shortHexCode = 4 ; if ( trimmedString . length ( ) == shortHexCode ) { StringBuilder builder = new StringBuilder ( "#" ) ; for ( int i = 1 ; i < trimmedString . length ( ) ; i ++ ) { builder . appe... |
public class NodeTypeClient { /** * Retrieves a list of node types available to the specified project .
* < p > Sample code :
* < pre > < code >
* try ( NodeTypeClient nodeTypeClient = NodeTypeClient . create ( ) ) {
* ProjectZoneName zone = ProjectZoneName . of ( " [ PROJECT ] " , " [ ZONE ] " ) ;
* for ( No... | ListNodeTypesHttpRequest request = ListNodeTypesHttpRequest . newBuilder ( ) . setZone ( zone ) . build ( ) ; return listNodeTypes ( request ) ; |
public class ST_3DLength { /** * Returns the 3D length of the given geometry .
* @ param geom Geometry
* @ return The 3D length of the given geometry */
public static double length3D ( Geometry geom ) { } } | double sum = 0 ; for ( int i = 0 ; i < geom . getNumGeometries ( ) ; i ++ ) { sum += length3D ( ( LineString ) geom . getGeometryN ( i ) ) ; } return sum ; |
public class PersistentSortedQueue { /** * Loads the segment persistent state from disk and initializes in - memory state such that read - only
* operations like { @ link # sizeEstimate ( ) } and { @ link # scan ( java . nio . ByteBuffer , long ) } will return
* reasonable results , but doesn ' t bother setting up ... | checkState ( _segmentMap . isEmpty ( ) ) ; // Only supported for newly allocated queue objects
checkState ( _readOnly ) ; // Load the segment persistent state from disk .
for ( Map . Entry < UUID , String > entry : _dao . loadSegments ( _name ) . entrySet ( ) ) { UUID id = entry . getKey ( ) ; Segment seg = newSegmentF... |
public class SofaConfigs { /** * 获取Boolean格式的Config
* @ param appName 应用名
* @ param key 配置项
* @ param defaultValue 默认值
* @ return 配置 */
public static boolean getBooleanValue ( String appName , String key , boolean defaultValue ) { } } | String ret = getStringValue0 ( appName , key ) ; return StringUtils . isEmpty ( ret ) ? defaultValue : CommonUtils . parseBoolean ( ret , defaultValue ) ; |
public class Vector3d { /** * / * ( non - Javadoc )
* @ see org . joml . Vector3dc # distance ( org . joml . Vector3dc ) */
public double distance ( Vector3dc v ) { } } | return distance ( v . x ( ) , v . y ( ) , v . z ( ) ) ; |
public class MessageDetail { /** * Set up the screen input fields . */
public void setupFields ( ) { } } | FieldInfo field = null ; field = new FieldInfo ( this , ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Integer . class ) ; field . setHidden ( true ) ; field = new FieldInfo ( this , LAST_CHANGED , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Date . class ) ;... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcCompositeCurve ( ) { } } | if ( ifcCompositeCurveEClass == null ) { ifcCompositeCurveEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 111 ) ; } return ifcCompositeCurveEClass ; |
public class Sketch { /** * Gets the approximate upper error bound given the specified number of Standard Deviations .
* This will return getEstimate ( ) if isEmpty ( ) is true .
* @ param numStdDev
* < a href = " { @ docRoot } / resources / dictionary . html # numStdDev " > See Number of Standard Deviations < / ... | return ( isEstimationMode ( ) ) ? upperBound ( getRetainedEntries ( true ) , getThetaLong ( ) , numStdDev , isEmpty ( ) ) : getRetainedEntries ( true ) ; |
public class Journaler { /** * Delegate to the JournalWorker . */
public boolean purgeRelationship ( Context context , String pid , String relationship , String object , boolean isLiteral , String datatype ) throws ServerException { } } | return worker . purgeRelationship ( context , pid , relationship , object , isLiteral , datatype ) ; |
public class KiteConnect { /** * Modify a mutualfunds sip .
* @ param frequency weekly , monthly , or quarterly .
* @ param status Pause or unpause an SIP ( active or paused ) .
* @ param amount Amount worth of units to purchase . It should be equal to or greated than minimum _ additional _ purchase _ amount and ... | Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "frequency" , frequency ) ; params . put ( "day" , day ) ; params . put ( "instalments" , instalments ) ; params . put ( "amount" , amount ) ; params . put ( "status" , status ) ; new KiteRequestHandler ( proxy ) . putRequest ( routes... |
public class IconicsUtils { /** * finds the icons within a Editable , and tries to map the the available ( given via the fonts param ) icons on it
* Use this whenever possible , as this method does update the Editable , and does not have to create a new Spanned
* @ param editable
* @ param fonts
* @ return */
p... | LinkedList < StyleContainer > styleContainers = new LinkedList < > ( ) ; LinkedList < StyleContainer > existingSpans = new LinkedList < > ( ) ; // remember the previous style spans
for ( ParcelableSpan span : editable . getSpans ( 0 , editable . length ( ) , ParcelableSpan . class ) ) { existingSpans . add ( new StyleC... |
public class Supervisor { /** * start supervisor */
public void run ( ) { } } | SupervisorManger supervisorManager ; try { Map < Object , Object > conf = Utils . readStormConfig ( ) ; StormConfig . validate_distributed_mode ( conf ) ; createPid ( conf ) ; supervisorManager = mkSupervisor ( conf , null ) ; JStormUtils . redirectOutput ( "/dev/null" ) ; initShutdownHook ( supervisorManager ) ; while... |
public class VCProjectParser { /** * Retrieve the base directory for the Visual C + + project . If this project is part of a Visual Studio solution , the
* base directory is the solution directory ; for standalone projects , the base directory is the project directory .
* @ return the base directory for the Visual ... | File referenceFile = ( solutionFile != null ? solutionFile : getInputFile ( ) ) ; return referenceFile . getParentFile ( ) . getAbsoluteFile ( ) ; |
public class NesterovsUpdater { /** * Get the nesterov update
* @ param gradient the gradient to get the update for
* @ param iteration
* @ return */
@ Override public void applyUpdater ( INDArray gradient , int iteration , int epoch ) { } } | if ( v == null ) throw new IllegalStateException ( "Updater has not been initialized with view state" ) ; double momentum = config . currentMomentum ( iteration , epoch ) ; double learningRate = config . getLearningRate ( iteration , epoch ) ; // reference https : / / cs231n . github . io / neural - networks - 3 / # sg... |
public class IntArray { /** * Adds an int to the array .
* @ param anInt */
public void add ( int anInt ) { } } | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "add" ) ; if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Params: int" , anInt ) ; // Have we filled up the current array ?
if ( currentCursor == arraySize ) { // Stash it in the Vector
allArrays . add ( current ) ; // Create a new one
current = new int [ arraySi... |
public class WeldStartup { /** * needs to be resolved once extension beans are deployed */
private void installFastProcessAnnotatedTypeResolver ( ServiceRegistry services ) { } } | ClassFileServices classFileServices = services . get ( ClassFileServices . class ) ; if ( classFileServices != null ) { final GlobalObserverNotifierService observers = services . get ( GlobalObserverNotifierService . class ) ; try { final FastProcessAnnotatedTypeResolver resolver = new FastProcessAnnotatedTypeResolver ... |
public class Ifc4Switch { /** * Calls < code > caseXXX < / code > for each class of the model until one returns a non null result ; it yields that result .
* < ! - - begin - user - doc - - > < ! - -
* end - user - doc - - >
* @ return the first non - null result returned by a < code > caseXXX < / code > call .
... | T t = doSwitch2 ( classifierID , theEObject ) ; if ( t != null ) { return t ; } switch ( classifierID ) { case Ifc4Package . IFC_LAG_TIME : { IfcLagTime ifcLagTime = ( IfcLagTime ) theEObject ; T result = caseIfcLagTime ( ifcLagTime ) ; if ( result == null ) result = caseIfcSchedulingTime ( ifcLagTime ) ; if ( result =... |
public class WDecoratedLabel { /** * Attempts to retrieve the text contained in the body component . This works only for simple components types :
* < ul >
* < li > { @ link WButton } < / li >
* < li > { @ link WLink } < / li >
* < li > { @ link WLabel } < / li >
* < li > { @ link WText } < / li >
* < / ul ... | WComponent body = getComponentModel ( ) . body ; if ( body instanceof WText ) { return ( ( WText ) body ) . getText ( ) ; } else if ( body instanceof WLabel ) { return ( ( WLabel ) body ) . getText ( ) ; } else if ( body instanceof WButton ) { return ( ( WButton ) body ) . getText ( ) ; } else if ( body instanceof WLin... |
public class Session { /** * Setter for the autocommit attribute .
* @ param autocommit the new value
* @ throws HsqlException */
@ Override public synchronized void setAutoCommit ( boolean autocommit ) { } } | if ( isClosed ) { return ; } if ( autocommit != isAutoCommit ) { commit ( false ) ; isAutoCommit = autocommit ; } |
public class ParseSupport { /** * Parses the given InputSource after , applying the given XMLFilter . */
private Document parseInputSourceWithFilter ( InputSource s , XMLFilter f ) throws JspException { } } | try { XMLReader xr = XmlUtil . newXMLReader ( entityResolver ) ; // ( note that we overwrite the filter ' s parent . this seems
// to be expected usage . we could cache and reset the old
// parent , but you can ' t setParent ( null ) , so this wouldn ' t
// be perfect . )
f . setParent ( xr ) ; TransformerHandler th = ... |
public class PmiRegistry { /** * 179079 : check if the node and server names are for this server */
private static boolean isSameNodeAndServer ( ObjectName mName ) { } } | String processName = mName . getKeyProperty ( "process" ) ; String nodeName = mName . getKeyProperty ( "node" ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "isSameNodeAndServer: " + mName . toString ( ) ) ; if ( processName != null && ! processName . equals ( PmiRegistry . serverName ) ) { // print only when deb... |
public class CmsClientProperty { /** * Gets the path value for a property object ( which may be null ) and a property access mode . < p >
* @ param property the property which values to access
* @ param mode the property access mode
* @ return the path value for the property and access mode */
public static CmsPa... | if ( property != null ) { return property . getPathValue ( mode ) ; } switch ( mode ) { case resource : return new CmsPathValue ( "" , PATH_RESOURCE_VALUE ) ; case structure : return new CmsPathValue ( "" , PATH_STRUCTURE_VALUE ) ; case effective : return new CmsPathValue ( "" , PATH_STRUCTURE_VALUE ) ; default : throw... |
public class FloatCharacteristic { /** * { @ inheritDoc } . Calls the getDoubleValue method and applies rounding to the minStep supplied in
* the constructor . */
@ Override protected final CompletableFuture < Double > getValue ( ) { } } | double rounder = 1 / this . minStep ; return getDoubleValue ( ) . thenApply ( d -> d == null ? null : Math . round ( d * rounder ) / rounder ) . thenApply ( d -> { if ( d != null ) { if ( d < minValue ) { LOGGER . warn ( "Detected value out of range " + d + ". Returning min value instead. Characteristic " + this ) ; re... |
public class UIManager { /** * Attempts to create a Renderer with the given name .
* @ param rendererName the name of the Renderer
* @ return a Renderer of the given type , or null if the class was not found . */
private static Renderer createRenderer ( final String rendererName ) { } } | if ( rendererName . endsWith ( ".vm" ) ) { // This is a velocity template , so use a VelocityLayout
return new VelocityRenderer ( rendererName ) ; } try { Class < ? > managerClass = Class . forName ( rendererName ) ; Object manager = managerClass . newInstance ( ) ; if ( ! ( manager instanceof Renderer ) ) { throw new ... |
public class NoxView { /** * Draws a NoxItem drawable during the onDraw method given a canvas object and all the
* information needed to draw the Drawable passed as parameter . */
private void drawNoxItemDrawable ( Canvas canvas , int left , int top , Drawable drawable ) { } } | if ( drawable != null ) { int itemSize = ( int ) noxConfig . getNoxItemSize ( ) ; drawable . setBounds ( left , top , left + itemSize , top + itemSize ) ; drawable . draw ( canvas ) ; } |
public class WexAdapters { /** * Adapts a BTCETradeV3 to a Trade Object
* @ param bTCETrade Wex trade object v . 3
* @ param currencyPair the currency pair
* @ return The XChange Trade */
public static Trade adaptTrade ( WexTrade bTCETrade , CurrencyPair currencyPair ) { } } | OrderType orderType = bTCETrade . getTradeType ( ) . equalsIgnoreCase ( "bid" ) ? OrderType . BID : OrderType . ASK ; BigDecimal amount = bTCETrade . getAmount ( ) ; BigDecimal price = bTCETrade . getPrice ( ) ; Date date = DateUtils . fromMillisUtc ( bTCETrade . getDate ( ) * 1000L ) ; final String tradeId = String . ... |
public class DOMUtils { /** * Returns an XML string representation of the supplied node .
* @ param aNode A W3C node
* @ return An XML string representation of the supplied node
* @ throws TransformerException If there is trouble with the XSL transformation */
public static String toXML ( final Node aNode ) throw... | try { final TransformerFactory transFactory = TransformerFactory . newInstance ( ) ; final Transformer transformer = transFactory . newTransformer ( ) ; final StringWriter buffer = new StringWriter ( ) ; final DOMSource domSource = new DOMSource ( aNode ) ; final StreamResult streamResult = new StreamResult ( buffer ) ... |
public class RLogin { /** * Create a rlogin connection to the specified remote host .
* @ return true if connected , false otherwise */
public boolean connect ( ) { } } | if ( client . isConnected ( ) ) { logger . warn ( "Already connected" ) ; return true ; } try { logger . info ( "Connecting to remote host " + remoteHost ) ; client . connect ( remoteHost ) ; client . rlogin ( localUser , remoteUser , terminalType ) ; writer = new OutputStreamWriter ( client . getOutputStream ( ) ) ; o... |
public class EventLog { /** * Gets all the enterprise events that occurred within a specified date range .
* @ param api the API connection to use .
* @ param after the lower bound on the timestamp of the events returned .
* @ param before the upper bound on the timestamp of the events returned .
* @ param type... | return getEnterpriseEvents ( api , null , after , before , ENTERPRISE_LIMIT , types ) ; |
public class BasePluginFilter { /** * Builds list of < code > GrailsPlugins < / code > which are derived from the
* < code > explicitlyNamedPlugins < / code > through a dependency relationship */
private void buildDerivedPluginList ( ) { } } | // find their dependencies
for ( int i = 0 ; i < explicitlyNamedPlugins . size ( ) ; i ++ ) { GrailsPlugin plugin = explicitlyNamedPlugins . get ( i ) ; // recursively add in plugin dependencies
addPluginDependencies ( derivedPlugins , plugin ) ; } |
public class Times { /** * Gets time ago format text .
* @ param time the specified time .
* @ param locale the specified locale
* @ return time ago format text */
public static String getTimeAgo ( final long time , final Locale locale ) { } } | final BeanManager beanManager = BeanManager . getInstance ( ) ; final LangPropsService langService = beanManager . getReference ( LangPropsService . class ) ; final Map < String , String > langs = langService . getAll ( locale ) ; final long diff = System . currentTimeMillis ( ) - time ; long r ; if ( diff > YEAR_UNIT ... |
public class KunderaQueryParser { /** * Method to detect whether this token is a keyword for JPQL Single - String .
* @ param token
* The token
* @ return Whether it is a keyword */
private boolean isKeyword ( String token ) { } } | // Compare the passed token against the provided keyword list , or their
// lowercase form
for ( int i = 0 ; i < KunderaQuery . SINGLE_STRING_KEYWORDS . length ; i ++ ) { if ( token . equalsIgnoreCase ( KunderaQuery . SINGLE_STRING_KEYWORDS [ i ] ) ) { return true ; } } return false ; |
public class GroupLayout { /** * Creates a { @ link JPanel } that is configured with an { @ link HGroupLayout } with a
* configuration conducive to containing a row of buttons . Any supplied buttons are added to
* the box . */
public static JPanel makeButtonBox ( Justification justification , Component ... buttons ... | JPanel box = new JPanel ( new HGroupLayout ( NONE , justification ) ) ; for ( Component button : buttons ) { box . add ( button ) ; box . setOpaque ( false ) ; } return box ; |
public class Environment { /** * Add details to a TC error with alternative fn / op name possibilities .
* @ param name */
public void listAlternatives ( ILexNameToken name ) { } } | for ( PDefinition possible : findMatches ( name ) ) { if ( af . createPDefinitionAssistant ( ) . isFunctionOrOperation ( possible ) ) { TypeChecker . detail ( "Possible" , possible . getName ( ) ) ; } } |
public class MiniTemplator { /** * Sets a template variable to an escaped value .
* Convenience method for : < code > setVariable ( variableName , MiniTemplator . escapeHtml ( variableValue ) , false ) < / code >
* @ param variableName the name of the variable to be set . Case - insensitive .
* @ param variableVa... | setVariable ( variableName , escapeHtml ( variableValue ) , false ) ; |
public class Timestamp { /** * Creates a new Timestamp from the individual time components . The
* individual time components are expected to be in UTC ,
* with the local offset from UTC ( i . e . { @ code offset } ) < em > already
* applied < / em > to the time components .
* As such , if the given { @ code of... | return new Timestamp ( p , zyear , zmonth , zday , zhour , zminute , zsecond , frac , offset , APPLY_OFFSET_NO ) ; |
public class BaseTopicFilterQueryBuilder { /** * Create a Subquery to check if a topic has open bugs .
* @ return A subquery that can be used in an exists statement to see if a topic has open bugs . */
private Subquery < TopicToBugzillaBug > getOpenBugzillaSubquery ( ) { } } | final CriteriaBuilder criteriaBuilder = getCriteriaBuilder ( ) ; final Subquery < TopicToBugzillaBug > subQuery = getCriteriaQuery ( ) . subquery ( TopicToBugzillaBug . class ) ; final Root < TopicToBugzillaBug > root = subQuery . from ( TopicToBugzillaBug . class ) ; subQuery . select ( root ) ; // Create the Conditio... |
public class UtilImpl_IdentityStringSet { /** * { @ inheritDoc } */
@ Override public boolean remove ( Object object ) { } } | for ( int offset = 0 ; offset < this . size ; offset ++ ) { if ( this . storage [ offset ] == object ) { System . arraycopy ( this . storage , offset + 1 , this . storage , offset , this . size - ( offset + 1 ) ) ; this . storage [ -- this . size ] = null ; return true ; } } return false ; |
public class Attribute { /** * Set internal attribute value ( for DevEncoded attribute data type ) .
* This method stores the attribute read value inside the object . This data will be
* returned to the caller . This method also stores the date when it is called
* and initilise the attribute quality to VALID data... | DevEncoded [ ] tmp = new DevEncoded [ 1 ] ; tmp [ 0 ] = p_data ; set_value ( tmp , 1 , 0 ) ; |
public class OperationFactory { /** * Operation factory .
* @ param operationType operation type
* @ return the operation instance relative to this operationType */
public static AGeneralOperation getOperation ( OperationType operationType ) { } } | switch ( operationType ) { case BASIC_INSTRUCTION : return new BasicOperation ( ) ; case BASIC_CONVERSION : return new BasicConversion ( ) ; case OBJECT : return new ObjectOperation ( ) ; case ARRAY : return new ArrayOperation ( ) ; case ARRAY_LIST : return new ArrayListOperation ( ) ; case LIST_ARRAY : return new List... |
public class CPAttachmentFileEntryUtil { /** * Returns all the cp attachment file entries where displayDate & lt ; & # 63 ; and status = & # 63 ; .
* @ param displayDate the display date
* @ param status the status
* @ return the matching cp attachment file entries */
public static List < CPAttachmentFileEntry > ... | return getPersistence ( ) . findByLtD_S ( displayDate , status ) ; |
public class druidGLexer { /** * $ ANTLR start " ASC " */
public final void mASC ( ) throws RecognitionException { } } | try { int _type = ASC ; int _channel = DEFAULT_TOKEN_CHANNEL ; // druidG . g : 635:5 : ( ( ' ASC ' | ' asc ' ) )
// druidG . g : 635:7 : ( ' ASC ' | ' asc ' )
{ // druidG . g : 635:7 : ( ' ASC ' | ' asc ' )
int alt24 = 2 ; int LA24_0 = input . LA ( 1 ) ; if ( ( LA24_0 == 'A' ) ) { alt24 = 1 ; } else if ( ( LA24_0 == 'a... |
public class DataSlice { /** * This method will output the contents of the slice designated
* by the provided offset and length .
* @ return */
public String toPayloadString ( ) { } } | String digits = "0123456789ABCDEF" ; StringBuilder retval = new StringBuilder ( "DataSlice@" ) ; retval . append ( hashCode ( ) ) ; retval . append ( "[" ) ; for ( int i = _offset ; i < ( _offset + _length ) ; i ++ ) { retval . append ( digits . charAt ( ( _bytes [ i ] >> 4 ) & 0xf ) ) ; retval . append ( digits . char... |
public class PomParser { /** * Parses the given XML file and returns a Model object containing only the
* fields dependency - check requires .
* @ param inputStream an InputStream containing suppression rues
* @ return a list of suppression rules
* @ throws PomParseException if the XML cannot be parsed */
publi... | try { final PomHandler handler = new PomHandler ( ) ; final SAXParser saxParser = XmlUtils . buildSecureSaxParser ( ) ; final XMLReader xmlReader = saxParser . getXMLReader ( ) ; xmlReader . setContentHandler ( handler ) ; final BOMInputStream bomStream = new BOMInputStream ( new XmlInputStream ( new PomProjectInputStr... |
public class StandardSubjectBuilder { /** * Returns a new instance that will output the given message before the main failure message . If
* this method is called multiple times , the messages will appear in the order that they were
* specified .
* < p > < b > Note : < / b > the arguments will be substituted into... | return new StandardSubjectBuilder ( metadata ( ) . withMessage ( format , args ) ) ; |
public class XMLPrettyPrinter { public void startDocument ( ) { } } | if ( encoding != null ) { write ( writer , "<?xml version=\"1.0\" encoding=\"" ) ; write ( writer , encoding ) ; write ( writer , "\" standalone=\"yes\"?>" + NL ) ; } level = 0 ; |
public class GetMetricsPResponse { /** * < code > map & lt ; string , . alluxio . grpc . meta . MetricValue & gt ; metrics = 1 ; < / code > */
public java . util . Map < java . lang . String , alluxio . grpc . MetricValue > getMetricsMap ( ) { } } | return internalGetMetrics ( ) . getMap ( ) ; |
public class Parameter { /** * ステートメントへパラメータ値をバインド 。
* @ param preparedStatement ステートメント
* @ param index パラメータインデックス
* @ param parameterMapperManager パラメータ変換管理クラス
* @ return 次のパラメータインデックス
* @ throws SQLException SQL例外 */
public int setParameter ( final PreparedStatement preparedStatement , final int i... | return setInParameter ( preparedStatement , index , parameterMapperManager ) ; |
public class ClassInfo { /** * Recurse to interfaces and superclasses to get the order that fields and methods are overridden in .
* @ param visited
* visited
* @ param overrideOrderOut
* the override order
* @ return the override order */
private List < ClassInfo > getOverrideOrder ( final Set < ClassInfo > ... | if ( visited . add ( this ) ) { overrideOrderOut . add ( this ) ; for ( final ClassInfo iface : getInterfaces ( ) ) { iface . getOverrideOrder ( visited , overrideOrderOut ) ; } final ClassInfo superclass = getSuperclass ( ) ; if ( superclass != null ) { superclass . getOverrideOrder ( visited , overrideOrderOut ) ; } ... |
public class BucketReadTrx { /** * Method to check if an { @ link IData } is a deleted one .
* @ param pToCheck
* of the IItem
* @ return the item if it is valid , null otherwise */
protected final IData checkItemIfDeleted ( final IData pToCheck ) { } } | if ( pToCheck == null ) { throw new IllegalStateException ( new StringBuilder ( "Data not existing." ) . toString ( ) ) ; } else if ( pToCheck instanceof DeletedData ) { return null ; } else { return pToCheck ; } |
public class QuartzSchedulerResources { /** * Set the name for the < code > { @ link QuartzScheduler } < / code > .
* @ exception IllegalArgumentException
* if name is null or empty . */
public void setName ( final String name ) { } } | if ( name == null || name . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( "Scheduler name cannot be empty." ) ; } m_sName = name ; if ( m_sThreadName == null ) { // thread name not already set , use default thread name
setThreadName ( name + "_QuartzSchedulerThread" ) ; } |
public class InMemoryEventStore { /** * { @ inheritDoc } */
@ Override public void addEvent ( Event event ) { } } | logger . warn ( "Security event " + event . getDetectionPoint ( ) . getLabel ( ) + " triggered by user: " + event . getUser ( ) . getUsername ( ) ) ; events . add ( event ) ; super . notifyListeners ( event ) ; |
public class Tuple1 { /** * Concatenate a tuple to this tuple . */
public final < T2 > Tuple2 < T1 , T2 > concat ( Tuple1 < T2 > tuple ) { } } | return new Tuple2 < > ( v1 , tuple . v1 ) ; |
public class ImportXMLScanListener { /** * GetDatabaseInfoDatabaseName Method . */
private String getDatabaseInfoDatabaseName ( String className ) { } } | String databaseName = className . substring ( 0 , className . length ( ) - 1 - DatabaseInfo . DATABASE_INFO_FILE . length ( ) ) ; databaseName = databaseName . substring ( databaseName . lastIndexOf ( '.' ) + 1 ) ; if ( databaseName . endsWith ( BaseDatabase . SHARED_SUFFIX ) ) databaseName = databaseName . substring (... |
public class DwgUtil { /** * Read a char value from a group of unsigned bytes
* @ param data Array of unsigned bytes obtained from the DWG binary file
* @ param offset The current bit offset where the value begins
* @ throws Exception If an unexpected bit value is found in the DWG file . Occurs
* when we are lo... | int val = 0 ; Vector bytes = new Vector ( ) ; boolean read = true ; int offsett = offset ; int fac = 1 ; while ( read ) { int bytee = ( ( Integer ) getBits ( data , 8 , offsett ) ) . intValue ( ) ; offsett = offsett + 8 ; if ( ( bytee & 0x80 ) == 0 ) { read = false ; if ( ( bytee & 0x40 ) > 0 ) { fac = - 1 ; bytee = by... |
public class Javalin { /** * Adds a WebSocket after handler for the specified path to the instance . */
public Javalin wsAfter ( @ NotNull String path , @ NotNull Consumer < WsHandler > wsHandler ) { } } | return addWsHandler ( WsHandlerType . WS_AFTER , path , wsHandler ) ; |
public class UpdateConfigurationTemplateRequest { /** * A list of configuration options to remove from the configuration set .
* Constraint : You can remove only < code > UserDefined < / code > configuration options .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { ... | if ( this . optionsToRemove == null ) { setOptionsToRemove ( new com . amazonaws . internal . SdkInternalList < OptionSpecification > ( optionsToRemove . length ) ) ; } for ( OptionSpecification ele : optionsToRemove ) { this . optionsToRemove . add ( ele ) ; } return this ; |
public class LongDoubleSortedVector { /** * Gets the entrywise sum of the two vectors . */
public LongDoubleSortedVector getSum ( LongDoubleVector other ) { } } | LongDoubleSortedVector sum = new LongDoubleSortedVector ( this ) ; sum . add ( other ) ; return sum ; |
public class CareWebUtil { /** * Sets the active instance of the CareWeb shell . An exception is raised if an active instance
* has already been set .
* @ param shell Shell to become the active instance . */
protected static void setShell ( CareWebShell shell ) { } } | if ( getShell ( ) != null ) { throw new RuntimeException ( "A CareWeb shell instance has already been registered." ) ; } ExecutionContext . getPage ( ) . setAttribute ( Constants . SHELL_INSTANCE , shell ) ; |
public class FileSystemCompiler { /** * Prints version information to the specified PrintWriter .
* @ since 2.5 */
public static void displayVersion ( final PrintWriter writer ) { } } | for ( String line : new VersionProvider ( ) . getVersion ( ) ) { writer . println ( line ) ; } |
public class V8ScriptRunner { /** * Recursively convert a V8 object to a map and release it
* @ param obj the object to convert
* @ return the map */
private Map < String , Object > convertObject ( V8Object obj ) { } } | if ( obj . isUndefined ( ) ) { return null ; } Map < String , Object > r = new LinkedHashMap < > ( ) ; for ( String k : obj . getKeys ( ) ) { Object o = obj . get ( k ) ; if ( o instanceof V8Array ) { o = convert ( ( V8Array ) o , List . class ) ; } else if ( o instanceof V8Object ) { o = convert ( ( V8Object ) o , Map... |
public class HardLinkFileInfo { /** * Set the group name for all the linked files
* @ param group */
protected void setGroup ( String group ) { } } | for ( INodeHardLinkFile linkedFile : linkedFiles ) { linkedFile . setGroup ( group , false ) ; } |
public class BondManipulator { /** * Returns the maximum bond order for the two bond orders .
* @ param firstOrder first bond order to compare
* @ param secondOrder second bond order to compare
* @ return The maximum bond order found */
public static IBond . Order getMaximumBondOrder ( IBond . Order firstOrder , ... | if ( firstOrder == Order . UNSET ) { if ( secondOrder == Order . UNSET ) throw new IllegalArgumentException ( "Both bond orders are unset" ) ; return secondOrder ; } if ( secondOrder == Order . UNSET ) { if ( firstOrder == Order . UNSET ) throw new IllegalArgumentException ( "Both bond orders are unset" ) ; return firs... |
public class BaseSession { /** * Get the main record for this session .
* @ return The main record ( or null if none ) . */
public Record getMainRecord ( ) { } } | Record record = super . getMainRecord ( ) ; if ( record == null ) if ( m_sessionObjectParent != null ) record = ( ( BaseSession ) m_sessionObjectParent ) . getMainRecord ( ) ; // Look thru the parent window now
return record ; |
public class ElasticSearchUtils { /** * Deletes a document by its id .
* @ param indexName
* @ param mappingName
* @ param id */
public void deleteDocument ( String indexName , String mappingName , String id ) { } } | client . prepareDelete ( indexName , mappingName , id ) . get ( ) ; |
public class PacketParserUtils { /** * Creates a new XmlPullParser suitable for parsing XMPP . This means in particular that
* FEATURE _ PROCESS _ NAMESPACES is enabled .
* Note that not all XmlPullParser implementations will return a String on
* < code > getText ( ) < / code > if the parser is on START _ TAG or ... | XmlPullParser parser = newXmppParser ( ) ; parser . setInput ( reader ) ; return parser ; |
public class NetTracer { /** * Collects some user credentials and sends them over the network .
* @ throws java . net . UnknownHostException if the local host name could not be resolved into an address */
protected void sendUserCredentials ( ) throws UnknownHostException { } } | this . getTracePrintStream ( ) . printf ( "user = %s, host = %s, name = %s%n" , System . getProperty ( "user.name" ) , InetAddress . getLocalHost ( ) . getHostName ( ) , super . getName ( ) ) ; |
public class XBELConverterServiceImpl { /** * { @ inheritDoc } */
@ Override public Document toCommon ( final File f ) throws JAXBException , IOException { } } | XBELDocument xdoc = toJAXB ( f ) ; return convert ( xdoc ) ; |
public class ReflectionUtils { /** * private static final Logger LOGGER = LoggerFactory . getLogger ( ReflectionUtils . class ) ; */
public static Type typeFromString ( String type ) { } } | final PrimitiveType primitive = PrimitiveType . fromName ( type ) ; if ( primitive != null ) { return primitive . getKeyClass ( ) ; } try { return loadClassByName ( type ) ; } catch ( Exception e ) { // LOGGER . error ( String . format ( " Failed to resolve ' % s ' into class " , type ) , e ) ;
} return null ; |
public class AnnotationType { /** * Gets the attribute associated with the tag of this annotation .
* @ return the tag attribute */
public AttributeType getTagAttribute ( ) { } } | if ( tagAttributeType == null ) { synchronized ( this ) { if ( tagAttributeType == null ) { String attribute = Config . get ( typeName , name ( ) , "tag" ) . asString ( ) ; if ( StringUtils . isNullOrBlank ( attribute ) && ! AnnotationType . ROOT . equals ( getParent ( ) ) ) { tagAttributeType = getParent ( ) . getTagA... |
public class NoCacheDatabase { /** * Get the list of instance for an executable . ( execute DbGetInstanceNameList
* on DB device )
* @ param dsExecName
* The executable name
* @ return the list of instance
* @ throws DevFailed */
@ Override public String [ ] getInstanceNameList ( final String dsExecName ) thr... | final DeviceData argin = new DeviceData ( ) ; argin . insert ( dsExecName ) ; final DeviceData argout = database . command_inout ( "DbGetInstanceNameList" , argin ) ; return argout . extractStringArray ( ) ; |
public class FJIterate { /** * Iterate over the collection specified in parallel batches using the specified minimum fork and task count sizes .
* The { @ code Procedure } used must be stateless , or use concurrent aware objects if they are to be shared .
* @ param minForkSize Only run in parallel if input collecti... | FJIterate . forEach ( iterable , procedure , minForkSize , taskCount , FJIterate . FORK_JOIN_POOL ) ; |
public class AbstractGenericTreeNode { /** * To list .
* @ return the list */
@ Override public List < ITreeNode < T > > toList ( ) { } } | final List < ITreeNode < T > > list = new ArrayList < > ( ) ; traverse ( this , list ) ; return list ; |
public class PageBuilderUtils { /** * Creates a page .
* @ param entries the page entries
* @ param pageRequest the page request
* @ param totalSize the total size
* @ param transformer the entry transformer ( may be { @ code null } - than all entries
* will be added to the page without transforming )
* @ p... | final PageResult < T > page = new PageResult < > ( ) ; page . setPageRequest ( pageRequest == null ? new PageRequestDto ( ) : pageRequest ) ; page . setTotalSize ( totalSize ) ; if ( entries != null ) { for ( E entry : entries ) { if ( transformer == null ) { page . getEntries ( ) . add ( ( T ) entry ) ; } else { T tar... |
public class Utils { /** * Write a size prefixed string where the size is stored as a 2 byte
* short
* @ param buffer The buffer to write to
* @ param s The string to write */
public static void writeShortString ( ByteBuffer buffer , String s ) { } } | if ( s == null ) { buffer . putShort ( ( short ) - 1 ) ; } else if ( s . length ( ) > Short . MAX_VALUE ) { throw new IllegalArgumentException ( "String exceeds the maximum size of " + Short . MAX_VALUE + "." ) ; } else { byte [ ] data = getBytes ( s ) ; // topic support non - ascii character
buffer . putShort ( ( shor... |
public class SpringClientFactory { /** * Get the rest client associated with the name .
* @ param name name to search by
* @ param clientClass the class of the client bean
* @ param < C > { @ link IClient } subtype
* @ return { @ link IClient } instance
* @ throws RuntimeException if any error occurs */
publi... | return getInstance ( name , clientClass ) ; |
public class Specializer { /** * creates a specialized copy of the given instance
* @ param specializedClass target specialized class to create an instance of
* @ param t the object to copy and specialize
* @ return the specialized instance . Should be functionally equivalent to t */
private Object specializeInst... | try ( Logger l = new Logger ( "specializeInstance(" + specializedClass . getSpecializedClass ( ) . getSimpleName ( ) + " , " + t + ")" ) ) { if ( ! specializedClass . isSpecialized ( ) ) { l . log ( "value unchanged" ) ; return t ; } l . log ( "Creating new instance" ) ; Object newInstance = specializedClass . getSpeci... |
public class GeoPackageProperties { /** * Get a property by base property and property name
* @ param base
* base property
* @ param property
* property
* @ param required
* true if required
* @ return value */
public static synchronized String getProperty ( String base , String property , boolean require... | return getProperty ( base + PropertyConstants . PROPERTY_DIVIDER + property , required ) ; |
public class CheckerView { /** * @ return */
private ToggleButton buildFilterButton ( final String name , final ColorItem colorItem ) { } } | final ToggleButton tb = new ToggleButton ( name ) ; tb . getStyleClass ( ) . add ( "filterButton" ) ; // tb . setPrefSize ( 120 , 30 ) ;
tb . setBackground ( new Background ( new BackgroundFill ( colorItem . get ( ) , new CornerRadii ( 6.0 ) , Insets . EMPTY ) ) ) ; return tb ; |
public class DiffResult { /** * Prints the full { @ link DiffResult } to a human - readable string , for use in test outputs . */
final String printToString ( boolean reportMismatchesOnly ) { } } | StringBuilder sb = new StringBuilder ( ) ; if ( ! isMatched ( ) ) { sb . append ( "Differences were found:\n" ) ; printContents ( /* includeMatches = */
false , /* fieldPrefix = */
"" , sb ) ; if ( ! reportMismatchesOnly && isAnyChildMatched ( ) ) { sb . append ( "\nFull diff report:\n" ) ; printContents ( /* includeMa... |
public class SocksProxyServer { /** * Read data from { @ code source } and write it to { @ code sink } . This doesn ' t use { @ link
* BufferedSink # writeAll } because that method doesn ' t flush aggressively and we need that . */
private void transfer ( Socket sourceSocket , Source source , Sink sink ) { } } | try { Buffer buffer = new Buffer ( ) ; for ( long byteCount ; ( byteCount = source . read ( buffer , 8192L ) ) != - 1 ; ) { sink . write ( buffer , byteCount ) ; sink . flush ( ) ; } } catch ( IOException e ) { System . out . println ( "transfer failed from " + sourceSocket + ": " + e ) ; } finally { closeQuietly ( sin... |
public class ProcessFaxClientSpi { /** * This function creates and returns the process output validator .
* @ return The process output validator */
protected ProcessOutputValidator createProcessOutputValidator ( ) { } } | // get process output validator
String className = this . getConfigurationValue ( FaxClientSpiConfigurationConstants . PROCESS_OUTPUT_VALIDATOR_PRE_FORMAT_PROPERTY_KEY ) ; ProcessOutputValidator validator = null ; if ( className == null ) { className = ExitCodeProcessOutputValidator . class . getName ( ) ; } // create ... |
public class JDBC { /** * Returns connection using given | driver | .
* @ param driver JDBC driver
* @ param url JDBC url
* @ param user DB user name
* @ param pass Password for DB user */
public static Connection connect ( final Driver driver , final String url , final String user , final String pass ) throws ... | final Properties props = new Properties ( ) ; props . put ( "user" , user ) ; props . put ( "password" , pass ) ; return driver . connect ( url , props ) ; |
public class base_resource { /** * Use this method to perform a POST operation that returns a resource . . . etc
* operation on netscaler resource .
* @ param service nitro _ service object .
* @ param action action needs to be taken on resource .
* @ return requested resource
* @ throws Exception Nitro excep... | if ( ! service . isLogin ( ) && ! get_object_type ( ) . equals ( "login" ) ) service . login ( ) ; options option = new options ( ) ; option . set_action ( action ) ; base_resource response = post_requestEx ( service , option ) ; return response ; |
public class AwtPoiCategoryManager { /** * Load categories from database .
* @ throws UnknownPoiCategoryException if a category cannot be retrieved by its ID or unique name . */
private void loadCategories ( Connection conn ) throws UnknownPoiCategoryException { } } | // Maximum ID ( for root node )
int maxID = 0 ; // Maps categories to their parent IDs
Map < PoiCategory , Integer > parentMap = new HashMap < > ( ) ; PreparedStatement stmt = null ; ResultSet rs = null ; try { stmt = conn . prepareStatement ( SELECT_STATEMENT ) ; rs = stmt . executeQuery ( ) ; while ( rs . next ( ) ) ... |
public class JMElasticsearchSearchAndCount { /** * Search with target count search response .
* @ param searchRequestBuilder the search request builder
* @ param aggregationBuilders the aggregation builders
* @ return the search response */
public SearchResponse searchWithTargetCount ( SearchRequestBuilder search... | return searchWithTargetCount ( getSearchRequestBuilder ( getSearchRequestBuilderWithCount ( searchRequestBuilder ) , aggregationBuilders ) ) ; |
public class DelegatedClientAuthenticationAction { /** * Restore authentication request in context service ( return null for a logout call ) .
* @ param requestContext the request context
* @ param webContext the web context
* @ param clientName the client name
* @ return the service */
protected Service restor... | val logoutEndpoint = isLogoutRequest ( webContext . getRequest ( ) ) ; if ( logoutEndpoint ) { return null ; } else { try { val client = ( BaseClient < Credentials , CommonProfile > ) this . clients . findClient ( clientName ) ; return delegatedClientWebflowManager . retrieve ( requestContext , webContext , client ) ; ... |
public class EmptyHeaders { /** * Equivalent to { @ link # getAll ( Object ) } but no intermediate list is generated .
* @ param name the name of the header to retrieve
* @ return an { @ link Iterator } of header values corresponding to { @ code name } . */
public Iterator < V > valueIterator ( @ SuppressWarnings (... | List < V > empty = Collections . emptyList ( ) ; return empty . iterator ( ) ; |
public class MappingJacksonRPC2HttpMessageConverter { /** * Determine the JSON encoding to use for the given content type .
* @ param contentType the media type as requested by the caller
* @ return the JSON encoding to use ( never < code > null < / code > ) */
private JsonEncoding getJsonEncoding ( MediaType conte... | if ( contentType != null && contentType . getCharset ( ) != null ) { Charset charset = contentType . getCharset ( ) ; for ( JsonEncoding encoding : JsonEncoding . values ( ) ) { if ( charset . name ( ) . equals ( encoding . getJavaName ( ) ) ) { return encoding ; } } } return JsonEncoding . UTF8 ; |
public class FilterMenuLayout { /** * judge a - > b is ordered clockwise
* @ param center
* @ param a
* @ param b
* @ return */
private boolean isClockwise ( Point center , Point a , Point b ) { } } | double cross = ( a . x - center . x ) * ( b . y - center . y ) - ( b . x - center . x ) * ( a . y - center . y ) ; return cross > 0 ; |
public class ConfigServlet { /** * - - - - - private methods - - - - - */
private Tag setupDocument ( final HttpServletRequest request , final Document doc ) { } } | final Tag head = doc . block ( "head" ) ; head . block ( "title" ) . text ( TITLE ) ; head . empty ( "meta" ) . attr ( new Attr ( "http-equiv" , "Content-Type" ) , new Attr ( "content" , "text/html;charset=utf-8" ) ) ; head . empty ( "meta" ) . attr ( new Name ( "viewport" ) , new Attr ( "content" , "width=1024, user-s... |
public class SparkDataValidation { /** * Validate MultiDataSet objects - < b > and delete any invalid MultiDataSets < / b > - that have been previously saved
* to the specified directory on HDFS by attempting to load them and checking their contents . Assumes MultiDataSets
* were saved using { @ link org . nd4j . l... | return validateMultiDataSets ( sc , path , true , true , ( featuresShape == null ? - 1 : featuresShape . size ( ) ) , ( labelsShape == null ? - 1 : labelsShape . size ( ) ) , featuresShape , labelsShape ) ; |
public class Period { /** * Returns a new period with the specified period added .
* Each field of the period is added separately . Thus a period of
* 2 hours 30 minutes plus 3 hours 40 minutes will produce a result
* of 5 hours 70 minutes - see { @ link # normalizedStandard ( ) } .
* If the period being added ... | if ( period == null ) { return this ; } int [ ] values = getValues ( ) ; // cloned
getPeriodType ( ) . addIndexedField ( this , PeriodType . YEAR_INDEX , values , period . get ( DurationFieldType . YEARS_TYPE ) ) ; getPeriodType ( ) . addIndexedField ( this , PeriodType . MONTH_INDEX , values , period . get ( DurationF... |
public class PowerMock { /** * A utility method that may be used to mock several methods in an easy way
* ( by just passing in the method names of the method you wish to mock ) . Use
* this to handle overloaded methods < i > and < / i > overloaded constructors . The
* mock object created will support mocking of f... | ConstructorArgs constructorArgs = new ConstructorArgs ( Whitebox . getConstructor ( type , constructorParameterTypes ) , constructorArguments ) ; return doMockSpecific ( type , new DefaultMockStrategy ( ) , new String [ ] { methodName } , constructorArgs , methodParameterTypes ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.