signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class GroupService { /** * Power off groups of servers
* @ param groupFilter search servers criteria by group filter
* @ return OperationFuture wrapper for Server list */
public OperationFuture < List < Server > > powerOff ( GroupFilter groupFilter ) { } } | return serverService ( ) . powerOff ( getServerSearchCriteria ( groupFilter ) ) ; |
public class ADischargeDistributor { /** * Calculates the current subsuperficial discharge .
* The discharge takes into account the distribution
* of all the distributed discharge contributions
* in the prior timesteps .
* @ param subSuperficialDischarge the non distributed discharge value .
* @ param saturat... | distributeIncomingSubSuperficialDischarge ( subSuperficialDischarge , saturatedAreaPercentage , timeInMillis ) ; return subSuperficialDischargeArray [ indexFromTimeInMillis ( timeInMillis ) ] ; |
public class CollectionUtilities { /** * Splits the stringArray by the delimiter into an array of strings ignoring the escaped delimiters
* @ param stringArray the string to be split
* @ param delimiter the delimiter by which to split the stringArray
* @ return an array of Strings */
@ NotNull public static Strin... | if ( StringUtils . isEmpty ( stringArray ) ) { return new String [ 0 ] ; } final String regex = "(?<!\\\\)" + Pattern . quote ( delimiter ) ; return stringArray . split ( regex ) ; |
public class Tools { /** * Convert something to a double in a fast way having a good guess
* that it is a double . This is perfect for MongoDB data that * should *
* have been stored as doubles already so there is a high probability
* of easy converting .
* @ param x The object to convert to a double
* @ retu... | if ( x == null ) { return null ; } if ( x instanceof Double ) { return ( Double ) x ; } if ( x instanceof String ) { String s = x . toString ( ) ; if ( s == null || s . isEmpty ( ) ) { return null ; } } /* * This is the last and probably expensive fallback . This should be avoided by
* only passing in Doubles , Integ... |
public class IssueDescriptionReaderV1 { /** * Extracts the list of bug occurrences from the description .
* @ param pDescription
* the issue description
* @ param pStacktraceMD5
* the stacktrace MD5 hash the issue is related to
* @ return the ACRA bug occurrences listed in the description
* @ throws IssuePa... | final Map < String , Date > occur = new HashMap < String , Date > ( ) ; // escape braces { and } to use strings in regexp
final String header = IssueDescriptionUtilsV1 . getOccurrencesTableHeader ( ) ; final String escHeader = Pattern . quote ( header ) ; // regexp to find occurrences tables
final Pattern p = Pattern .... |
public class SofaRpcSerialization { /** * 客户端记录序列化请求的耗时和
* @ param requestCommand 请求对象 */
protected void recordSerializeRequest ( RequestCommand requestCommand , InvokeContext invokeContext ) { } } | if ( ! RpcInternalContext . isAttachmentEnable ( ) ) { return ; } RpcInternalContext context = null ; if ( invokeContext != null ) { // 客户端异步调用的情况下 , 上下文会放在InvokeContext中传递
context = invokeContext . get ( RemotingConstants . INVOKE_CTX_RPC_CTX ) ; } if ( context == null ) { context = RpcInternalContext . getContext ( )... |
public class RebalanceUtils { /** * Interim and final clusters ought to have same partition counts , same
* zones , and same node state . Partitions per node may of course differ .
* @ param interimCluster
* @ param finalCluster */
public static void validateInterimFinalCluster ( final Cluster interimCluster , fi... | validateClusterPartitionCounts ( interimCluster , finalCluster ) ; validateClusterZonesSame ( interimCluster , finalCluster ) ; validateClusterNodeCounts ( interimCluster , finalCluster ) ; validateClusterNodeState ( interimCluster , finalCluster ) ; return ; |
public class CompressionUtils { /** * gunzip the file to the output file .
* @ param pulledFile The source of the gz data
* @ param outFile A target file to put the contents
* @ return The result of the file copy
* @ throws IOException */
public static FileUtils . FileCopyResult gunzip ( final File pulledFile ,... | return gunzip ( Files . asByteSource ( pulledFile ) , outFile ) ; |
public class JobCoordinator { /** * Sets the job as failed with given error message .
* @ param errorMessage Error message to set for failure */
public synchronized void setJobAsFailed ( String errorMessage ) { } } | mJobInfo . setStatus ( Status . FAILED ) ; mJobInfo . setErrorMessage ( errorMessage ) ; |
public class ZipNumCluster { /** * Adjust from shorter blocks , if loaded */
public long computeTotalLines ( ) { } } | long numLines = 0 ; try { numLines = this . getNumLines ( summary . getRange ( "" , "" ) ) ; } catch ( IOException e ) { LOGGER . warning ( e . toString ( ) ) ; return 0 ; } long adjustment = getTotalAdjustment ( ) ; numLines -= ( getNumBlocks ( ) - 1 ) ; numLines *= this . getCdxLinesPerBlock ( ) ; numLines += adjustm... |
public class InputFile { /** * Use this setter to send new file .
* @ param mediaFile File to send
* @ param fileName Name of the file
* @ return This object */
public InputFile setMedia ( File mediaFile , String fileName ) { } } | this . newMediaFile = mediaFile ; this . mediaName = fileName ; this . attachName = "attach://" + fileName ; this . isNew = true ; return this ; |
public class SVGAndroidRenderer { private void updateStyleForElement ( RendererState state , SvgElementBase obj ) { } } | boolean isRootSVG = ( obj . parent == null ) ; state . style . resetNonInheritingProperties ( isRootSVG ) ; // Apply the styles defined by style attributes on the element
if ( obj . baseStyle != null ) updateStyle ( state , obj . baseStyle ) ; // Apply the styles from any CSS files or < style > elements
if ( document .... |
public class SnackBar { /** * Show this SnackBar . It will auto attach to the parent view .
* @ param parent Must be { @ linke android . widget . FrameLayout } or { @ link android . widget . RelativeLayout } */
public void show ( ViewGroup parent ) { } } | if ( mState == STATE_SHOWING || mState == STATE_DISMISSING ) return ; if ( getParent ( ) != parent ) { if ( getParent ( ) != null ) ( ( ViewGroup ) getParent ( ) ) . removeView ( this ) ; parent . addView ( this ) ; } show ( ) ; |
public class AbstractTransitionBuilder { /** * Similar to scale ( float ) , but wait until the transition is about to start to perform the evaluation .
* @ param end
* @ return self */
public T delayScale ( @ FloatRange ( from = 0.0 ) float end ) { } } | getDelayedProcessor ( ) . addProcess ( SCALE , end ) ; return self ( ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertResourceObjectIncludeObjTypeToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class WebAppPublisher { /** * Unpublish a web application .
* @ param webApp web aplication to be unpublished
* @ throws NullArgumentException if web app is null */
public void unpublish ( final WebApp webApp ) { } } | NullArgumentException . validateNotNull ( webApp , "Web app" ) ; LOG . debug ( "Unpublishing web application [{}]" , webApp ) ; final ServiceTracker < WebAppDependencyHolder , WebAppDependencyHolder > tracker = webApps . remove ( webApp ) ; if ( tracker != null ) { tracker . close ( ) ; } |
public class ServiceDirectoryConfig { /** * Get the property object as float , or return defaultVal if property is not defined .
* @ param name
* property name .
* @ param defaultVal
* default property value .
* @ return
* property value as float , return defaultVal if property is undefined . */
public floa... | if ( this . configuration . containsKey ( name ) ) { return this . configuration . getFloat ( name ) ; } else { return defaultVal ; } |
public class SyncPageLoader { /** * Constructor . */
public void init ( URL url , String strHtmlText , JEditorPane editorPane , BaseApplet applet , boolean bChangeCursor ) { } } | m_url = url ; m_editorPane = editorPane ; m_strHtmlText = strHtmlText ; m_applet = applet ; m_bChangeCursor = bChangeCursor ; |
public class SwaptionAnalyticApproximationRebonato { /** * This function calculate the partial derivative < i > d log ( S ) / d log ( L < sub > k < / sub > ) < / i > for
* a given swap rate with respect to a vector of forward rates ( on a given forward rate tenor ) .
* It also returns some useful other quantities l... | /* * Small workaround for the case that the discount curve is not set . This part will be removed later . */
AnalyticModelFromCurvesAndVols model = null ; if ( discountCurve == null ) { discountCurve = new DiscountCurveFromForwardCurve ( forwardCurve . getName ( ) ) ; model = new AnalyticModelFromCurvesAndVols ( new Cu... |
public class AND { /** * Gets intersection of the generated elements by the member constraints .
* @ param match match to process
* @ param ind mapped indices
* @ return satisfying elements */
@ Override public Collection < BioPAXElement > generate ( Match match , int ... ind ) { } } | Collection < BioPAXElement > gen = new HashSet < BioPAXElement > ( con [ 0 ] . generate ( match , ind ) ) ; for ( int i = 1 ; i < con . length ; i ++ ) { if ( gen . isEmpty ( ) ) break ; gen . retainAll ( con [ i ] . generate ( match , ind ) ) ; } return gen ; |
public class XStringForFSB { /** * Compares two strings lexicographically .
* @ param xstr the < code > String < / code > to be compared .
* @ return the value < code > 0 < / code > if the argument string is equal to
* this string ; a value less than < code > 0 < / code > if this string
* is lexicographically l... | int len1 = m_length ; int len2 = xstr . length ( ) ; int n = Math . min ( len1 , len2 ) ; FastStringBuffer fsb = fsb ( ) ; int i = m_start ; int j = 0 ; while ( n -- != 0 ) { char c1 = fsb . charAt ( i ) ; char c2 = xstr . charAt ( j ) ; if ( c1 != c2 ) { return c1 - c2 ; } i ++ ; j ++ ; } return len1 - len2 ; |
public class SQLStmt { /** * Get the text of the SQL statement represented .
* @ return String containing the text of the SQL statement represented . */
public String getText ( ) { } } | if ( sqlTextStr == null ) { sqlTextStr = new String ( sqlText , Constants . UTF8ENCODING ) ; } return sqlTextStr ; |
public class BootstrapMojo { private void copyCelerioXsd ( ) throws IOException { } } | File xsdDir = new File ( appName + "/src/main/config/celerio-maven-plugin" ) ; xsdDir . mkdirs ( ) ; File celerioXsdFile = new File ( xsdDir , "celerio.xsd" ) ; File nonamespaceXsdFile = new File ( xsdDir , "nonamespace.xsd" ) ; getLog ( ) . info ( "Copy Celerio configuration xsd files to " + appName + "/src/main/confi... |
public class PluginFileDependency { /** * Creates an instance of the class that indicates the file is within tcMenu itself . Don ' t use for
* new plugins , prefer to package arduino code in the plugin or a new library .
* @ param file the file name
* @ return a new instance */
public static PluginFileDependency ... | return new PluginFileDependency ( file , PackagingType . WITHIN_TCMENU , Map . of ( ) ) ; |
public class Util { /** * Checks whether the given resource is a Java source file .
* @ param resource
* The resource to check .
* @ return < code > true < / code > if the given resource is a Java source file ,
* < code > false < / code > otherwise . */
public static boolean isJavaFile ( IResource resource ) { ... | if ( resource == null || ( resource . getType ( ) != IResource . FILE ) ) { return false ; } String ex = resource . getFileExtension ( ) ; return "java" . equalsIgnoreCase ( ex ) ; // $ NON - NLS - 1 $ |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcRoundedRectangleProfileDef ( ) { } } | if ( ifcRoundedRectangleProfileDefEClass == null ) { ifcRoundedRectangleProfileDefEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 582 ) ; } return ifcRoundedRectangleProfileDefEClass ; |
public class DefaultServiceRegistry { /** * - - - PING / PONG HANDLING - - - */
@ Override public Promise ping ( long timeoutMillis , String nodeID ) { } } | // Local node ?
if ( this . nodeID . equals ( nodeID ) ) { Tree rsp = new Tree ( ) ; long time = System . currentTimeMillis ( ) ; rsp . put ( "time" , time ) ; rsp . put ( "arrived" , time ) ; return Promise . resolve ( rsp ) ; } // Do we have a transporter ?
if ( transporter == null ) { return Promise . reject ( new S... |
public class CmsContentService { /** * Returns the widget class name . < p >
* @ param settingsWidget the settings widget name
* @ return the widget class name */
private String getWidgetName ( String settingsWidget ) { } } | if ( WIDGET_MAPPINGS . containsKey ( settingsWidget ) ) { return WIDGET_MAPPINGS . get ( settingsWidget ) . getName ( ) ; } else { return CmsInputWidget . class . getName ( ) ; } |
public class CommonFileUtils { /** * 关闭对应的文件流
* @ param inputStream 待关闭的文件流
* @ param filePath 对应的文件名
* @ throws IOException 关闭时发生IO异常 , 则抛出 */
public static void closeFileStream ( InputStream inputStream , String filePath ) { } } | try { if ( inputStream != null ) { inputStream . close ( ) ; } } catch ( IOException e ) { LOG . error ( "close file {} occur an IOExcpetion {}" , filePath , e ) ; } |
public class AbstractXtypeRuntimeModule { /** * contributed by org . eclipse . xtext . xtext . generator . formatting . Formatter2Fragment2 */
public void configureFormatterPreferences ( Binder binder ) { } } | binder . bind ( IPreferenceValuesProvider . class ) . annotatedWith ( FormatterPreferences . class ) . to ( FormatterPreferenceValuesProvider . class ) ; |
public class TargetsMngrImpl { /** * Diagnostics */
@ Override public List < TargetUsageItem > findUsageStatistics ( String targetId ) { } } | // Get usage first
List < String > appNames ; synchronized ( LOCK ) { appNames = applicationsThatUse ( targetId ) ; } // Now , let ' s build the result
Set < TargetUsageItem > result = new HashSet < > ( ) ; for ( Map . Entry < InstanceContext , String > entry : this . instanceToCachedId . entrySet ( ) ) { if ( ! entry ... |
public class HttpBuilder { /** * Executes an asynchronous TRACE request on the configured URI ( asynchronous alias to ` trace ( Class , Consumer ) ` ) , with additional configuration
* provided by the configuration function . The result will be cast to the specified ` type ` .
* This method is generally used for Ja... | return CompletableFuture . supplyAsync ( ( ) -> trace ( type , configuration ) , getExecutor ( ) ) ; |
public class ShardingRule { /** * Get logic table names base on actual table name .
* @ param actualTableName actual table name
* @ return logic table name */
public Collection < String > getLogicTableNames ( final String actualTableName ) { } } | Collection < String > result = new LinkedList < > ( ) ; for ( TableRule each : tableRules ) { if ( each . isExisted ( actualTableName ) ) { result . add ( each . getLogicTable ( ) ) ; } } return result ; |
public class FunctionsInner { /** * Updates an existing function under an existing streaming job . This can be used to partially update ( ie . update one or two properties ) a function without affecting the rest the job or function definition .
* @ param resourceGroupName The name of the resource group that contains ... | if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( jobName... |
public class FileStorage { /** * Opens a file for reading using the properties of the event and streams
* its content as a sequence of { @ link Output } events with the
* end of record flag set in the last event . All generated events are
* considered responses to this event and therefore fired using the event
... | "PMD.AvoidInstantiatingObjectsInLoops" , "PMD.AccessorClassGeneration" , "PMD.AvoidDuplicateLiterals" } ) public void onStreamFile ( StreamFile event ) throws InterruptedException { if ( Arrays . asList ( event . options ( ) ) . contains ( StandardOpenOption . WRITE ) ) { throw new IllegalArgumentException ( "Cannot st... |
public class DefaultBindFuture { /** * Combine futures in a way that minimizes cost ( no object creation ) for the common case where
* both have already been fulfilled . */
public static BindFuture combineFutures ( BindFuture future1 , BindFuture future2 ) { } } | if ( future1 == null || future1 . isBound ( ) ) { return future2 ; } else if ( future2 == null || future2 . isBound ( ) ) { return future1 ; } else { return new CompositeBindFuture ( Arrays . asList ( future1 , future2 ) ) ; } |
public class Assert { /** * Assert that an object is not { @ code null } .
* < pre class = " code " >
* Assert . notNull ( clazz , ( ) - & gt ; " The class ' " + clazz . getName ( ) + " ' must not be null " ) ;
* < / pre >
* @ param object the object to check
* @ param messageSupplier a supplier for the excep... | if ( object == null ) { throw new IllegalArgumentException ( Assert . nullSafeGet ( messageSupplier ) ) ; } |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcPresentationLayerWithStyle ( ) { } } | if ( ifcPresentationLayerWithStyleEClass == null ) { ifcPresentationLayerWithStyleEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 448 ) ; } return ifcPresentationLayerWithStyleEClass ; |
public class AutoCompleteTextFieldComponent { /** * Sets the spinner as progress indicator . */
public void showValidationInProgress ( ) { } } | validationIcon . setValue ( null ) ; validationIcon . addStyleName ( "show-status-label" ) ; validationIcon . setStyleName ( SPUIStyleDefinitions . TARGET_FILTER_SEARCH_PROGRESS_INDICATOR_STYLE ) ; |
public class BpmnParse { /** * Parses all sequence flow of a scope .
* @ param processElement
* The ' process ' element wherein the sequence flow are defined .
* @ param scope
* The scope to which the sequence flow must be added .
* @ param compensationHandlers */
public void parseSequenceFlow ( Element proce... | for ( Element sequenceFlowElement : processElement . elements ( "sequenceFlow" ) ) { String id = sequenceFlowElement . attribute ( "id" ) ; String sourceRef = sequenceFlowElement . attribute ( "sourceRef" ) ; String destinationRef = sequenceFlowElement . attribute ( "targetRef" ) ; // check if destination is a throwing... |
public class NameSpaceAddressManager { /** * Sets the backing configuration source */
public void setConfSource ( Configurable src ) { } } | validateConfigFile ( src . getConf ( ) ) ; confSrc = src ; zkClient = new AvatarZooKeeperClient ( confSrc . getConf ( ) , null , true ) ; |
public class SibRaStaticDestinationEndpointActivation { /** * Called on deactivation of this endpoint . */
void deactivate ( ) { } } | final String methodName = "deactivate" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } super . deactivate ( ) ; synchronized ( this ) { if ( _remoteConnection != null ) { _remoteConnection . close ( ) ; } } _timer . cancel ( ) ; // PK5458... |
public class XMLPrinter { /** * Rule format based on { @ link org . sonar . api . server . rule . RulesDefinitionXmlLoader } */
private static void printAsXML ( Rule rule , StringBuilder xmlStringBuilder ) { } } | if ( rule . version != null ) { xmlStringBuilder . append ( " <!-- since " + rule . version + " -->" ) ; xmlStringBuilder . append ( LINE_SEPARATOR ) ; } xmlStringBuilder . append ( " <rule>" ) ; xmlStringBuilder . append ( LINE_SEPARATOR ) ; xmlStringBuilder . append ( " <key>" + rule . fixedRuleKey ( ) + "</key>... |
public class JcrNodeTypeManager { /** * Returns the node type with the given name ( if one exists )
* @ param nodeTypeName the name of the node type to be returned
* @ return the node type with the given name ( if one exists )
* @ see NodeTypes # getNodeType ( Name ) */
JcrNodeType getNodeType ( Name nodeTypeName... | JcrNodeType nodeType = nodeTypes ( ) . getNodeType ( nodeTypeName ) ; if ( nodeType != null ) { nodeType = nodeType . with ( context ( ) , session ) ; } return nodeType ; |
public class Tomcat { /** * Creates a Tomcat context for Fedora in
* $ CATALINA _ HOME / conf / Catalina / localhost which sets the fedora . home system
* property to the installer - provided value . */
protected void installFedoraContext ( ) throws InstallationFailedException { } } | File contextDir = new File ( getConf ( ) . getPath ( ) + File . separator + "Catalina" + File . separator + "localhost" ) ; contextDir . mkdirs ( ) ; try { String content = IOUtils . toString ( this . getClass ( ) . getResourceAsStream ( "/webapp-context/context.xml" ) ) . replace ( "${fedora.home}" , getOptions ( ) . ... |
public class BackupResourceVaultConfigsInner { /** * Updates vault security config .
* @ param vaultName The name of the recovery services vault .
* @ param resourceGroupName The name of the resource group where the recovery services vault is present .
* @ param parameters resource config request
* @ throws Ill... | return updateWithServiceResponseAsync ( vaultName , resourceGroupName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class FacesConfigTypeImpl { /** * If not already created , a new < code > referenced - bean < / code > element will be created and returned .
* Otherwise , the first existing < code > referenced - bean < / code > element will be returned .
* @ return the instance defined for the element < code > referenced -... | List < Node > nodeList = childNode . get ( "referenced-bean" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new FacesConfigReferencedBeanTypeImpl < FacesConfigType < T > > ( this , "referenced-bean" , childNode , nodeList . get ( 0 ) ) ; } return createReferencedBean ( ) ; |
public class ParentRunner { /** * Returns a { @ link Statement } : run all non - overridden { @ code @ BeforeClass } methods on this class
* and superclasses before executing { @ code statement } ; if any throws an
* Exception , stop execution and pass the exception on . */
protected Statement withBeforeClasses ( S... | List < FrameworkMethod > befores = testClass . getAnnotatedMethods ( BeforeClass . class ) ; return befores . isEmpty ( ) ? statement : new RunBefores ( statement , befores , null ) ; |
public class StatementExecutor { /** * Return the object associated with the id or null if none . This does a SQL
* { @ code SELECT col1 , col2 , . . . FROM . . . WHERE . . . = id } type query . */
public T queryForId ( DatabaseConnection databaseConnection , ID id , ObjectCache objectCache ) throws SQLException { } ... | if ( mappedQueryForId == null ) { mappedQueryForId = MappedQueryForFieldEq . build ( dao , tableInfo , null ) ; } return mappedQueryForId . execute ( databaseConnection , id , objectCache ) ; |
public class UIViewParameter { /** * < p class = " changed _ added _ 2_0 " > Call through to superclass { @ link
* UIInput # updateModel } then take the additional action of pushing
* the value into request scope if and only if the value is not a
* value expression , is valid , and the local value was set on this... | super . updateModel ( context ) ; if ( ! hasValueExpression ( ) && isValid ( ) && isLocalValueSet ( ) ) { // QUESTION should this be done even when a value expression is present ?
// ANSWER : I don ' t see why not .
context . getExternalContext ( ) . getRequestMap ( ) . put ( getName ( ) , getLocalValue ( ) ) ; } |
public class ImageIOHelper { /** * Converts < code > BufferedImage < / code > to < code > ByteBuffer < / code > .
* @ param bi Input image
* @ return pixel data */
public static ByteBuffer convertImageData ( BufferedImage bi ) { } } | DataBuffer buff = bi . getRaster ( ) . getDataBuffer ( ) ; // ClassCastException thrown if buff not instanceof DataBufferByte because raster data is not necessarily bytes .
// Convert the original buffered image to grayscale .
if ( ! ( buff instanceof DataBufferByte ) ) { BufferedImage grayscaleImage = ImageHelper . co... |
public class CronUtils { /** * Converting valid SauronSoftware cron expression to valid Quartz one .
* The conversions are the following :
* < ul > < li > add & quot ; seconds & quot ; part ; < / li >
* < li > numbers in & quot ; day of week & quot ; started from 1 , not from 0 as in Sauron ; < / li >
* < li > ... | if ( sauronExpr == null ) return null ; String [ ] exprElems = sauronExpr . trim ( ) . split ( "\\s+" ) ; if ( exprElems . length == 5 ) { // 1 . Increase number od days in " days of week "
exprElems [ 4 ] = increaseDoW ( exprElems [ 4 ] ) ; // 2 . Cut right end of an interval in repeating items
exprElems [ 0 ] = shrin... |
public class JobSchedulesImpl { /** * Deletes a job schedule from the specified account .
* When you delete a job schedule , this also deletes all jobs and tasks under that schedule . When tasks are deleted , all the files in their working directories on the compute nodes are also deleted ( the retention period is ig... | deleteWithServiceResponseAsync ( jobScheduleId , jobScheduleDeleteOptions ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class DefaultCloudController { /** * Events */
@ Override public RestCollection < Event > getEvents ( Token token , EventQueryAttribute queryAttribute , String queryValue ) { } } | final ResultIterator < Event > iterator = new ResultIterator < > ( token , V2_EVENTS , Event . class , queryAttribute , queryValue ) ; return new RestCollection < > ( iterator . getSize ( ) , iterator ) ; |
public class Record { /** * Pop the record number from the front of the list , and parse it to ensure that
* it is a valid integer .
* @ param list MPX record */
private void setRecordNumber ( LinkedList < String > list ) { } } | try { String number = list . remove ( 0 ) ; m_recordNumber = Integer . valueOf ( number ) ; } catch ( NumberFormatException ex ) { // Malformed MPX file : the record number isn ' t a valid integer
// Catch the exception here , leaving m _ recordNumber as null
// so we will skip this record entirely .
} |
public class CPDefinitionSpecificationOptionValuePersistenceImpl { /** * Returns the first cp definition specification option value in the ordered set where CPDefinitionId = & # 63 ; and CPOptionCategoryId = & # 63 ; .
* @ param CPDefinitionId the cp definition ID
* @ param CPOptionCategoryId the cp option category... | List < CPDefinitionSpecificationOptionValue > list = findByC_COC ( CPDefinitionId , CPOptionCategoryId , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class DBIDUtil { /** * Compute the set intersection of two sets .
* @ param first First set
* @ param second Second set
* @ return result . */
private static ModifiableDBIDs internalIntersection ( DBIDs first , DBIDs second ) { } } | second = second . size ( ) > 16 && ! ( second instanceof SetDBIDs ) ? newHashSet ( second ) : second ; ModifiableDBIDs inter = newHashSet ( first . size ( ) ) ; for ( DBIDIter it = first . iter ( ) ; it . valid ( ) ; it . advance ( ) ) { if ( second . contains ( it ) ) { inter . add ( it ) ; } } return inter ; |
public class GrouperEntityGroupStore { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . groups . IEntityGroupStore # findEntitiesForGroup ( org . apereo . portal . groups . IEntityGroup ) */
@ Override @ SuppressWarnings ( "unchecked" ) public Iterator findEntitiesForGroup ( IEntityGroup group ) throws Gro... | if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Searching Grouper for members of the group with key: " + group . getKey ( ) ) ; } try { // execute a search for members of the specified group
GcGetMembers getGroupsMembers = new GcGetMembers ( ) ; getGroupsMembers . addGroupName ( group . getLocalKey ( ) ) ; getGr... |
public class JavascriptRuntime { /** * Execute the specified command returning a value ( if any )
* @ param command The JavaScript command to execute
* @ return The underlying JavaScript object that was returned by the script . */
@ Override public JSObject execute ( String command ) { } } | Object returnValue = engine . executeScript ( command ) ; if ( returnValue instanceof JSObject ) { return ( JSObject ) returnValue ; } return null ; |
public class Roster { /** * Remove a subscribe listener . Also restores the previous subscription mode
* state , if the last listener got removed .
* @ param subscribeListener
* the subscribe listener to remove .
* @ return < code > true < / code > if the listener registered and got removed .
* @ since 4.2 */... | boolean removed = subscribeListeners . remove ( subscribeListener ) ; if ( removed && subscribeListeners . isEmpty ( ) ) { setSubscriptionMode ( previousSubscriptionMode ) ; } return removed ; |
public class Payload { /** * Puts a property in a JSONObject , while possibly checking for estimated payload size violation .
* @ param propertyName the name of the property to use for calculating the estimation
* @ param propertyValue the value of the property to use for calculating the estimation
* @ param obje... | try { if ( isPayloadSizeEstimatedWhenAdding ( ) ) { int maximumPayloadSize = getMaximumPayloadSize ( ) ; int estimatedPayloadSize = estimatePayloadSizeAfterAdding ( propertyName , propertyValue ) ; boolean estimatedToExceed = estimatedPayloadSize > maximumPayloadSize ; if ( estimatedToExceed ) throw new PayloadMaxSizeP... |
public class RepositoryImpl { /** * { @ inheritDoc } */
public Session login ( final Credentials credentials , String workspaceName ) throws LoginException , NoSuchWorkspaceException , RepositoryException { } } | if ( getState ( ) == OFFLINE ) { LOG . warn ( "Repository " + getName ( ) + " is OFFLINE." ) ; } ConversationState state ; PrivilegedExceptionAction < ConversationState > action = new PrivilegedExceptionAction < ConversationState > ( ) { public ConversationState run ( ) throws Exception { if ( credentials != null ) { r... |
public class BaseAverager { /** * / * ( non - Javadoc )
* @ see Averager # addElement ( java . util . Map , java . util . Map ) */
@ SuppressWarnings ( "unchecked" ) @ Override public void addElement ( Map < String , Object > e , Map < String , AggregatorFactory > a ) { } } | Object metric = e . get ( fieldName ) ; I finalMetric ; if ( a . containsKey ( fieldName ) ) { AggregatorFactory af = a . get ( fieldName ) ; finalMetric = metric != null ? ( I ) af . finalizeComputation ( metric ) : null ; } else { finalMetric = ( I ) metric ; } buckets [ index ++ ] = finalMetric ; index %= numBuckets... |
public class KTypeHashSet { /** * Ensure this container can hold at least the
* given number of elements without resizing its buffers .
* @ param expectedElements The total number of elements , inclusive . */
@ Override public void ensureCapacity ( int expectedElements ) { } } | if ( expectedElements > resizeAt || keys == null ) { final KType [ ] prevKeys = Intrinsics . < KType [ ] > cast ( this . keys ) ; allocateBuffers ( minBufferSize ( expectedElements , loadFactor ) ) ; if ( prevKeys != null && ! isEmpty ( ) ) { rehash ( prevKeys ) ; } } |
public class AbstractWisdomSourceWatcherMojo { /** * Check if we can create a model from the given source .
* @ param file { @ link File } required to be processed by this plugin .
* @ return < code > true < / code > if the < code > file < / code > implements
* { @ link org . wisdom . api . Controller } , < code ... | if ( ! WatcherUtils . isInDirectory ( file , javaSourceDir ) || ! WatcherUtils . hasExtension ( file , "java" ) ) { return false ; } // If the file has been deleted by may have been a controller , return true .
// The cleanup will be applied .
if ( ! file . isFile ( ) ) { return true ; } // Parse the Java File and chec... |
public class DateUtils { /** * Convert an Object to a Timestamp , without an Exception */
public static java . sql . Timestamp getTimestamp ( Object value ) { } } | try { return toTimestamp ( value ) ; } catch ( ParseException pe ) { pe . printStackTrace ( ) ; return null ; } |
public class PKLogResource { /** * POST request to webServiceURL / version / log */
@ Post ( "json" ) public final Representation postLogMessage ( final Representation entity ) { } } | try { LOGGER . debug ( "postLogMessage: Log {}" , entity . getText ( ) ) ; } catch ( IOException e ) { // TODO Auto - generated catch block
e . printStackTrace ( ) ; } return handleLogRequest ( entity ) ; |
public class RoadNetworkLayerConstants { /** * Set if the internal data structure used to store the road network
* may be drawn on the displayers .
* @ param draw is < code > true < / code > if the internal data structures may be
* drawn on the displayers , < code > false < / code > if the internal data structure... | final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkLayerConstants . class ) ; if ( prefs != null ) { if ( draw == null ) { prefs . remove ( "ROAD_INTERN_DRAWING" ) ; // $ NON - NLS - 1 $
} else { prefs . putBoolean ( "ROAD_INTERN_DRAWING" , draw ) ; // $ NON - NLS - 1 $
} try { prefs . flush ( ) ; ... |
public class SeaGlassStyle { /** * Initializes the given < code > Values < / code > object with the defaults
* contained in the given TreeMap .
* @ param v The Values object to be initialized
* @ param myDefaults a map of UIDefaults to use in initializing the Values .
* This map must contain only keys associate... | // a list of the different types of states used by this style . This
// list may contain only " standard " states ( those defined by Synth ) ,
// or it may contain custom states , or it may contain only " standard "
// states but list them in a non - standard order .
List < State > states = new ArrayList < State > ( ) ... |
public class BitfinexCurrencyPair { /** * Registers currency pair for use within library
* @ param currency currency ( from )
* @ param profitCurrency currency ( to )
* @ param minimalOrderSize minimal order size
* @ return registered instance of { @ link BitfinexCurrencyPair } */
public static BitfinexCurrency... | final String key = buildCacheKey ( currency , profitCurrency ) ; final BitfinexCurrencyPair newCurrency = new BitfinexCurrencyPair ( currency , profitCurrency , minimalOrderSize ) ; final BitfinexCurrencyPair oldCurrency = instances . putIfAbsent ( key , newCurrency ) ; // The currency was already registered
if ( oldCu... |
public class AtomPlacer3D { /** * Takes the given Z Matrix coordinates and converts them to cartesian coordinates .
* The first Atom end up in the origin , the second on on the x axis , and the third
* one in the XY plane . The rest is added by applying the Zmatrix distances , angles
* and dihedrals . Assign coor... | Point3d result = null ; for ( int index = 0 ; index < distances . length ; index ++ ) { if ( index == 0 ) { result = new Point3d ( 0d , 0d , 0d ) ; } else if ( index == 1 ) { result = new Point3d ( distances [ 1 ] , 0d , 0d ) ; } else if ( index == 2 ) { result = new Point3d ( - Math . cos ( ( angles [ 2 ] / 180 ) * Ma... |
public class StatusConverter { /** * Returns a { @ link io . grpc . Status . Code } from a { @ link io . opencensus . trace . Status . CanonicalCode } .
* @ param opencensusCanonicalCode the given { @ code io . opencensus . trace . Status . CanonicalCode } .
* @ return a { @ code io . grpc . Status . Code } from a ... | return grpcStatusFromOpencensusCanonicalCode ( opencensusCanonicalCode ) . getCode ( ) ; |
public class GenericWindowContainer { /** * 为一致概念 , 这里麻烦一点 , 请您调用 : { @ link # getInvocation ( ) # addModel ( String , Object ) }
* 来完成 现在是2010-08-04 , 正常情况下2010国庆后将去掉此代码 */
@ Deprecated @ Override public void addModel ( String name , Object value ) { } } | getInvocation ( ) . addModel ( name , value ) ; |
public class LabAccountsInner { /** * Create a lab in a lab account .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ param createLabProperties Properties for creating a managed lab and a default environment setting
* @ throws IllegalArgume... | createLabWithServiceResponseAsync ( resourceGroupName , labAccountName , createLabProperties ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class DuckType { /** * Causes object to implement the interfaceToImplement and returns
* an instance of the object implementing interfaceToImplement even
* if interfaceToImplement was not declared in object . getClass ( ) ' s
* implements declaration .
* This works as long as all methods declared in inte... | if ( type . isInstance ( object ) ) return type . cast ( object ) ; return type . cast ( Proxy . newProxyInstance ( type . getClassLoader ( ) , new Class [ ] { type } , new DuckType ( object ) ) ) ; |
public class ResolverConfig { /** * Parses the output of winipcfg or ipconfig . */
private void findWin ( InputStream in ) { } } | String packageName = ResolverConfig . class . getPackage ( ) . getName ( ) ; String resPackageName = packageName + ".windows.DNSServer" ; ResourceBundle res = ResourceBundle . getBundle ( resPackageName ) ; String host_name = res . getString ( "host_name" ) ; String primary_dns_suffix = res . getString ( "primary_dns_s... |
public class SQSSession { /** * This method is not supported . */
@ Override public QueueBrowser createBrowser ( Queue queue , String messageSelector ) throws JMSException { } } | throw new JMSException ( SQSMessagingClientConstants . UNSUPPORTED_METHOD ) ; |
public class CmsDriverManager { /** * Deletes an entry in the published resource table . < p >
* @ param dbc the current database context
* @ param resourceName The name of the resource to be deleted in the static export
* @ param linkType the type of resource deleted ( 0 = non - parameter , 1 = parameter )
* @... | getProjectDriver ( dbc ) . deleteStaticExportPublishedResource ( dbc , resourceName , linkType , linkParameter ) ; |
public class PMTags { /** * Builds a jpm url based on given url
* @ param session Session user . Cannot be null
* @ param url Url to be built , < b > without < / b > context path
* @ return ready to use url */
public static String url ( PMSession session , String url ) { } } | return url ( session , url , false ) ; |
public class BProgramJsProxy { /** * Where the actual Behavioral Programming synchronization point is done .
* @ param jsRWB The JavaScript object { @ code { request : . . . waitFor : . . . } }
* @ param hot { @ code True } if this should be a " hot " synchronization point .
* @ param data Optional extra data the... | Map < String , Object > jRWB = ( Map ) Context . jsToJava ( jsRWB , Map . class ) ; SyncStatement stmt = SyncStatement . make ( ) ; if ( hot != null ) { stmt = stmt . hot ( hot ) ; } Object req = jRWB . get ( "request" ) ; if ( req != null ) { if ( req instanceof BEvent ) { stmt = stmt . request ( ( BEvent ) req ) ; } ... |
public class BreakPanel { /** * Sets the location of the break buttons .
* If the location is already set and the main tool bar visibility is the same , no change is done .
* @ param location the location to set */
void setButtonsLocation ( int location ) { } } | if ( currentButtonsLocation == location ) { mainBreakButtons . setVisible ( location == 0 && isMainToolBarHidden ( ) ) ; return ; } currentButtonsLocation = location ; switch ( location ) { case 0 : requestBreakButtons . setVisible ( false ) ; responseBreakButtons . setVisible ( false ) ; setToolbarButtonsVisible ( tru... |
public class VpnTunnelClient { /** * Deletes the specified VpnTunnel resource .
* < p > Sample code :
* < pre > < code >
* try ( VpnTunnelClient vpnTunnelClient = VpnTunnelClient . create ( ) ) {
* ProjectRegionVpnTunnelName vpnTunnel = ProjectRegionVpnTunnelName . of ( " [ PROJECT ] " , " [ REGION ] " , " [ VP... | DeleteVpnTunnelHttpRequest request = DeleteVpnTunnelHttpRequest . newBuilder ( ) . setVpnTunnel ( vpnTunnel == null ? null : vpnTunnel . toString ( ) ) . build ( ) ; return deleteVpnTunnel ( request ) ; |
public class FreeVarCollector { /** * If tree refers to a class instance creation expression
* add all free variables of the freshly created class . */
public void visitNewClass ( JCNewClass tree ) { } } | ClassSymbol c = ( ClassSymbol ) tree . constructor . owner ; if ( tree . encl == null && c . hasOuterInstance ( ) && outerThisStack . head != null ) visitSymbol ( outerThisStack . head ) ; super . visitNewClass ( tree ) ; |
public class UpdateIntegrationResponseRequest { /** * A key - value map specifying response parameters that are passed to the method response from the backend . The key
* is a method response header parameter name and the mapped value is an integration response header value , a static
* value enclosed within a pair... | setResponseParameters ( responseParameters ) ; return this ; |
public class LayerUtil { /** * Transforms a list of MapElements , orders it and removes those elements that overlap .
* This operation is useful for an early elimination of elements in a list that will never
* be drawn because they overlap .
* @ param input list of MapElements
* @ return collision - free , orde... | // sort items by priority ( highest first )
Collections . sort ( input , Collections . reverseOrder ( ) ) ; // in order of priority , see if an item can be drawn , i . e . none of the items
// in the currentItemsToDraw list clashes with it .
List < MapElementContainer > output = new LinkedList < MapElementContainer > (... |
public class HelloWorldSessionListener { /** * Fires whenever a new session is created . */
public void sessionCreated ( final HttpSessionEvent event ) { } } | counter ++ ; final HttpSession session = event . getSession ( ) ; final String id = session . getId ( ) ; SESSIONS . put ( id , session ) ; |
public class GlobusGSSManagerImpl { /** * Acquires GSI GSS credentials . First , it tries to find the credentials
* in the private credential set of the current JAAS Subject . If the
* Subject is not set or credentials are not found in the Subject , it
* tries to get a default user credential ( usually an user pr... | checkMechanism ( mech ) ; if ( name != null ) { if ( name . isAnonymous ( ) ) { return new GlobusGSSCredentialImpl ( ) ; } else { throw new GSSException ( GSSException . UNAVAILABLE ) ; } } X509Credential cred = null ; Subject subject = JaasSubject . getCurrentSubject ( ) ; if ( subject != null ) { logger . debug ( "Ge... |
public class CPMeasurementUnitPersistenceImpl { /** * Clears the cache for all cp measurement units .
* The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */
@ Override public void clearCache ( ) { } } | entityCache . clearCache ( CPMeasurementUnitImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; |
public class AWSStepFunctionsClient { /** * Starts a state machine execution .
* < note >
* < code > StartExecution < / code > is idempotent . If < code > StartExecution < / code > is called with the same name and input
* as a running execution , the call will succeed and return the same response as the original ... | request = beforeClientExecution ( request ) ; return executeStartExecution ( request ) ; |
public class ClassUseWriter { /** * Add the package use information .
* @ param pkg the package that uses the given class
* @ param contentTree the content tree to which the package use information will be added */
protected void addPackageUse ( PackageDoc pkg , Content contentTree ) throws IOException { } } | Content tdFirst = HtmlTree . TD ( HtmlStyle . colFirst , getHyperLink ( pkg . name ( ) , new StringContent ( Util . getPackageName ( pkg ) ) ) ) ; contentTree . addContent ( tdFirst ) ; HtmlTree tdLast = new HtmlTree ( HtmlTag . TD ) ; tdLast . addStyle ( HtmlStyle . colLast ) ; addSummaryComment ( pkg , tdLast ) ; con... |
public class ST_BoundingCircleCenter { /** * Compute the minimum bounding circle center of a geometry
* @ param geometry Any geometry
* @ return Minimum bounding circle center point */
public static Point getCircumCenter ( Geometry geometry ) { } } | if ( geometry == null || geometry . getNumPoints ( ) == 0 ) { return null ; } return geometry . getFactory ( ) . createPoint ( new MinimumBoundingCircle ( geometry ) . getCentre ( ) ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcReinforcementDefinitionProperties ( ) { } } | if ( ifcReinforcementDefinitionPropertiesEClass == null ) { ifcReinforcementDefinitionPropertiesEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 510 ) ; } return ifcReinforcementDefinitionPropertiesEClass ; |
public class AdaptiveGrid { /** * Return the average number of solutions in the occupied hypercubes */
public double getAverageOccupation ( ) { } } | calculateOccupied ( ) ; double result ; if ( occupiedHypercubes ( ) == 0 ) { result = 0.0 ; } else { double sum = 0.0 ; for ( int value : occupied ) { sum += hypercubes [ value ] ; } result = sum / occupiedHypercubes ( ) ; } return result ; |
public class FilePath { /** * Checks if the remote path is Unix . */
boolean isUnix ( ) { } } | // if the path represents a local path , there ' no need to guess .
if ( ! isRemote ( ) ) return File . pathSeparatorChar != ';' ; // note that we can ' t use the usual File . pathSeparator and etc . , as the OS of
// the machine where this code runs and the OS that this FilePath refers to may be different .
// Windows... |
public class AmazonLexModelBuildingClient { /** * Returns a list of all of the channels associated with the specified bot .
* The < code > GetBotChannelAssociations < / code > operation requires permissions for the
* < code > lex : GetBotChannelAssociations < / code > action .
* @ param getBotChannelAssociationsR... | request = beforeClientExecution ( request ) ; return executeGetBotChannelAssociations ( request ) ; |
public class SimpleDocTreeVisitor { /** * { @ inheritDoc } This implementation calls { @ code defaultAction } .
* @ param node { @ inheritDoc }
* @ param p { @ inheritDoc }
* @ return the result of { @ code defaultAction } */
@ Override public R visitHidden ( HiddenTree node , P p ) { } } | return defaultAction ( node , p ) ; |
public class ChannelFrameworkImpl { /** * Use the criteria to narrow down the provided list of endpoints to
* a proper subset .
* @ param endPointList
* @ param criteria
* @ param getBestOnly
* @ return CFEndPoint [ ] */
private CFEndPoint [ ] commonGetEndPoints ( CFEndPoint [ ] endPointList , CFEndPointCrite... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "commonGetEndPoints" ) ; } if ( null == endPointList || 0 == endPointList . length || null == criteria ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "commonGetEndPoints" , n... |
public class InMemoryChunkAccumulator { /** * Accumulate chunks in a map
* until all chunks have been accumulated .
* You can check all chunks are present with
* { @ link ChunkAccumulator # allPresent ( String ) }
* where the parameter is the id
* After all chunks have been accumulated
* you can call { @ li... | String id = chunk . getId ( ) ; if ( ! chunks . containsKey ( id ) ) { List < NDArrayMessageChunk > list = new ArrayList < > ( ) ; list . add ( chunk ) ; chunks . put ( id , list ) ; } else { List < NDArrayMessageChunk > chunkList = chunks . get ( id ) ; chunkList . add ( chunk ) ; } log . debug ( "Accumulating chunk f... |
public class ManagementClient { /** * Updates an existing subscription .
* @ param subscriptionDescription - A { @ link SubscriptionDescription } object describing the attributes with which the subscription will be updated .
* @ return { @ link SubscriptionDescription } of the updated subscription .
* @ throws Me... | return Utils . completeFuture ( this . asyncClient . updateSubscriptionAsync ( subscriptionDescription ) ) ; |
public class IPUtil { /** * Retrieves all the IP addresses of the local computer .
* The loopback address ( 127.0.0.1 ) will not be included . */
public static Collection < InterfaceAddress > getAllIPAddresses ( ) throws SocketException { } } | ArrayList < InterfaceAddress > direcciones = new ArrayList ( ) ; InterfaceAddress ipLoopback = null ; try { Enumeration ifaces = NetworkInterface . getNetworkInterfaces ( ) ; while ( ifaces . hasMoreElements ( ) ) { NetworkInterface iface = ( NetworkInterface ) ifaces . nextElement ( ) ; for ( InterfaceAddress ips : if... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.