signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Application { /** * Get the codebase for this application . * < pre > * Tries to get the codebase in the following order : * 1 . From the applet codebase . * 2 . From the jnlp codebase . * 3 . From the codebase param . * 4 . From the server param * 5 . From the current host name * 6 . Local...
URL urlCodeBase = null ; if ( applet != null ) applet = applet . getApplet ( ) ; // Get the Applet if this is an applet . else if ( Application . getRootApplet ( ) != null ) // If they didn ' t pass me an applet , get the applet from the static reference . applet = Application . getRootApplet ( ) . getApplet ( ) ; if (...
public class AnimaQuery { /** * Build a paging statement * @ param pageRow page param * @ return paging sql */ private String buildPageSQL ( String sql , PageRow pageRow ) { } }
SQLParams sqlParams = SQLParams . builder ( ) . modelClass ( this . modelClass ) . selectColumns ( this . selectColumns ) . tableName ( this . tableName ) . pkName ( this . primaryKeyColumn ) . conditionSQL ( this . conditionSQL ) . excludedColumns ( this . excludedColumns ) . customSQL ( sql ) . orderBy ( this . order...
public class ServletLogContext { /** * Sets the transaction id in the logging context * @ param transactionId The transaction id */ public static void putTransactionId ( final String transactionId ) { } }
if ( ( transactionId != null ) && ( 0 < transactionId . length ( ) ) ) { MDC . put ( TRANSACTION_ID , transactionId ) ; }
public class A_CmsStaticExportHandler { /** * Deletes the given file from the RFS if it exists , * also deletes all parameter variations of the file . < p > * @ param rfsFilePath the path of the RFS file to delete * @ param vfsName the VFS name of the file to delete ( required for logging ) */ protected void purg...
File rfsFile = new File ( rfsFilePath ) ; // first delete the base file deleteFile ( rfsFile , vfsName ) ; // now delete the file parameter variations // get the parent folder File parent = rfsFile . getParentFile ( ) ; if ( parent != null ) { // list all files in the parent folder that are variations of the base file ...
public class TextIntWritable { /** * Returns the a negative value if the provided { @ code TextIntWritable } has * a lexicographically less text value or if its position is less , or * returns a positive value if the provided { @ code TextIntWritable } has text * with a lexicographically greater value or if its p...
int c = t . compareTo ( o . t ) ; if ( c != 0 ) return c ; return position - o . position ;
public class AssertSoapFaultBuilder { /** * Sets the Spring bean application context . * @ param applicationContext */ public AssertSoapFaultBuilder withApplicationContext ( ApplicationContext applicationContext ) { } }
if ( applicationContext . containsBean ( "soapFaultValidator" ) ) { validator ( applicationContext . getBean ( "soapFaultValidator" , SoapFaultValidator . class ) ) ; } return this ;
public class BuildObligationPolicyDatabase { /** * Handle a method with a WillCloseWhenClosed parameter annotation . */ private void handleWillCloseWhenClosed ( XMethod xmethod , Obligation deletedObligation ) { } }
if ( deletedObligation == null ) { if ( DEBUG_ANNOTATIONS ) { System . out . println ( "Method " + xmethod . toString ( ) + " is marked @WillCloseWhenClosed, " + "but its parameter is not an obligation" ) ; } return ; } // See what type of obligation is being created . Obligation createdObligation = null ; if ( "<init>...
public class XMLOutputter { /** * Writes the specified < code > String < / code > as PCDATA . * @ param text the PCDATA text to be written , not < code > null < / code > . * @ throws IllegalStateException if < code > getState ( ) ! = { @ link # START _ TAG _ OPEN } & amp ; & amp ; * getState ( ) ! = { @ link # WI...
// Check state if ( _state != XMLEventListenerStates . START_TAG_OPEN && _state != XMLEventListenerStates . WITHIN_ELEMENT ) { throw new IllegalStateException ( "getState() == " + _state ) ; // Check arguments } else if ( text == null ) { throw new IllegalArgumentException ( "text == null" ) ; } // Temporarily set the ...
public class ItemStateReader { /** * Read and set ItemState data . * @ param in * ObjectReader . * @ return ItemState object . * @ throws UnknownClassIdException * If read Class ID is not expected or do not exist . * @ throws IOException * If an I / O error has occurred . */ public ItemState read ( Object...
// read id int key ; if ( ( key = in . readInt ( ) ) != SerializationConstants . ITEM_STATE ) { throw new UnknownClassIdException ( "There is unexpected class [" + key + "]" ) ; } ItemState is = null ; try { int state = in . readInt ( ) ; boolean isPersisted = in . readBoolean ( ) ; boolean eventFire = in . readBoolean...
public class GVRVertexBuffer { /** * Updates a vertex attribute from an integer buffer . * All of the entries of the input buffer are copied into * the storage for the named vertex attribute . Other vertex * attributes are not affected . * The attribute name must be one of the attributes named * in the descri...
if ( ! NativeVertexBuffer . setIntVec ( getNative ( ) , attributeName , data , stride , offset ) ) { throw new IllegalArgumentException ( "Attribute name " + attributeName + " cannot be updated" ) ; }
public class WebDriverWaitUtils { /** * Waits until element is either invisible or not present on the DOM . * @ param elementLocator * identifier of element to be found */ public static void waitUntilElementIsInvisible ( final String elementLocator ) { } }
logger . entering ( elementLocator ) ; By by = HtmlElementUtils . resolveByType ( elementLocator ) ; ExpectedCondition < Boolean > condition = ExpectedConditions . invisibilityOfElementLocated ( by ) ; waitForCondition ( condition ) ; logger . exiting ( ) ;
public class JCDiagnostic { /** * Methods for javax . tools . Diagnostic */ public Diagnostic . Kind getKind ( ) { } }
switch ( type ) { case NOTE : return Diagnostic . Kind . NOTE ; case WARNING : return flags . contains ( DiagnosticFlag . MANDATORY ) ? Diagnostic . Kind . MANDATORY_WARNING : Diagnostic . Kind . WARNING ; case ERROR : return Diagnostic . Kind . ERROR ; default : return Diagnostic . Kind . OTHER ; }
public class NonExceptionPostdominatorsAnalysisFactory { /** * ( non - Javadoc ) * @ see * edu . umd . cs . findbugs . classfile . IAnalysisEngine # analyze ( edu . umd . cs . findbugs * . classfile . IAnalysisCache , java . lang . Object ) */ @ Override public NonExceptionPostdominatorsAnalysis analyze ( IAnalys...
CFG cfg = getCFG ( analysisCache , descriptor ) ; ReverseDepthFirstSearch rdfs = getReverseDepthFirstSearch ( analysisCache , descriptor ) ; NonExceptionPostdominatorsAnalysis analysis = new NonExceptionPostdominatorsAnalysis ( cfg , rdfs , getDepthFirstSearch ( analysisCache , descriptor ) ) ; Dataflow < java . util ....
public class PlaceManager { /** * Called when a body object enters this place . */ protected void bodyEntered ( final int bodyOid ) { } }
log . debug ( "Body entered" , "where" , where ( ) , "oid" , bodyOid ) ; // let our delegates know what ' s up applyToDelegates ( new DelegateOp ( PlaceManagerDelegate . class ) { @ Override public void apply ( PlaceManagerDelegate delegate ) { delegate . bodyEntered ( bodyOid ) ; } } ) ; // if we were on the road to s...
public class Duration { /** * Returns a copy of this duration with the specified duration subtracted . * The duration amount is measured in terms of the specified unit . * Only a subset of units are accepted by this method . * The unit must either have an { @ linkplain TemporalUnit # isDurationEstimated ( ) exact...
return ( amountToSubtract == Long . MIN_VALUE ? plus ( Long . MAX_VALUE , unit ) . plus ( 1 , unit ) : plus ( - amountToSubtract , unit ) ) ;
public class XMLStreamEvents { /** * Return true if the given character is considered as a white space . */ public static boolean isSpaceChar ( char c ) { } }
if ( c == 0x20 ) return true ; if ( c > 0xD ) return false ; if ( c < 0x9 ) return false ; return isSpace [ c - 9 ] ;
public class UIData { /** * Invoke the specified phase on all facets of all UIColumn children of this component . Note that no methods are * called on the UIColumn child objects themselves . * @ param context * is the current faces context . * @ param processAction * specifies a JSF phase : decode , validate ...
for ( int i = 0 , childCount = getChildCount ( ) ; i < childCount ; i ++ ) { UIComponent child = getChildren ( ) . get ( i ) ; if ( child instanceof UIColumn ) { if ( ! _ComponentUtils . isRendered ( context , child ) ) { // Column is not visible continue ; } if ( child . getFacetCount ( ) > 0 ) { for ( UIComponent fac...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcShapeModel ( ) { } }
if ( ifcShapeModelEClass == null ) { ifcShapeModelEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 511 ) ; } return ifcShapeModelEClass ;
public class HybridizationRatioDescriptor { /** * Calculate sp3 / sp2 hybridization ratio in the supplied { @ link IAtomContainer } . * @ param container The AtomContainer for which this descriptor is to be calculated . * @ return The ratio of sp3 to sp2 carbons */ @ Override public DescriptorValue calculate ( IAto...
try { IAtomContainer clone = ( IAtomContainer ) container . clone ( ) ; AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( clone ) ; int nsp2 = 0 ; int nsp3 = 0 ; for ( IAtom atom : clone . atoms ( ) ) { if ( ! atom . getSymbol ( ) . equals ( "C" ) ) continue ; if ( atom . getHybridization ( ) == Hybridiza...
public class TaskBuilder { /** * 设置需要执行的任务 * @ param action Callable * @ return TaskBuilder */ public TaskBuilder < Result > action ( final Callable < Result > action ) { } }
if ( action instanceof TaskCallable ) { this . action = ( TaskCallable < Result > ) action ; } else { this . action = new WrappedCallable < Result > ( action ) ; } return this ;
public class LoginValidator { /** * 是否合法用户 * @ param username * 用户名 * @ param password * 密码md5 * @ return 是否合法 */ public static boolean isValid ( String username , String password ) { } }
return StringUtils . isNotEmpty ( username ) && StringUtils . isNotEmpty ( password ) && UserWebConstant . USERMAP . containsKey ( username ) && UserWebConstant . USERMAP . get ( username ) . getPasswordMd5 ( ) . equals ( password ) ;
public class WebAppTypeImpl { /** * Returns all < code > context - param < / code > elements * @ return list of < code > context - param < / code > */ public List < ParamValueType < WebAppType < T > > > getAllContextParam ( ) { } }
List < ParamValueType < WebAppType < T > > > list = new ArrayList < ParamValueType < WebAppType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "context-param" ) ; for ( Node node : nodeList ) { ParamValueType < WebAppType < T > > type = new ParamValueTypeImpl < WebAppType < T > > ( this , "context-param" , ...
public class IniFile { /** * Returns the specified integer property from the specified section . * @ param pstrSection the INI section name . * @ param pstrProp the property to be retrieved . * @ return the integer property value . */ public Integer getIntegerProperty ( String pstrSection , String pstrProp ) { } ...
Integer intRet = null ; String strVal = null ; INIProperty objProp = null ; INISection objSec = null ; objSec = ( INISection ) this . mhmapSections . get ( pstrSection ) ; if ( objSec != null ) { objProp = objSec . getProperty ( pstrProp ) ; try { if ( objProp != null ) { strVal = objProp . getPropValue ( ) ; if ( strV...
public class LocalDateTime { /** * Get the date time as a < code > java . util . Date < / code > using the specified time zone . * The < code > Date < / code > object created has exactly the same fields as this * date - time , except when the time would be invalid due to a daylight savings * gap . In that case , ...
final Calendar calendar = Calendar . getInstance ( timeZone ) ; calendar . clear ( ) ; calendar . set ( getYear ( ) , getMonthOfYear ( ) - 1 , getDayOfMonth ( ) , getHourOfDay ( ) , getMinuteOfHour ( ) , getSecondOfMinute ( ) ) ; Date date = calendar . getTime ( ) ; date . setTime ( date . getTime ( ) + getMillisOfSeco...
public class PhysicalTable { /** * Move the position of the record . * @ exception DBException File exception . */ public int doMove ( int iRelPosition ) throws DBException { } }
try { BaseBuffer buffer = m_pTable . move ( iRelPosition , this ) ; this . doSetHandle ( buffer , DBConstants . DATA_SOURCE_HANDLE ) ; int iRecordStatus = DBConstants . RECORD_NORMAL ; if ( buffer == null ) if ( ( iRelPosition < 0 ) || ( iRelPosition == DBConstants . LAST_RECORD ) ) iRecordStatus |= DBConstants . RECOR...
public class MimeUtils { /** * Returns the registered extension for the given MIME type . Note that some * MIME types map to multiple extensions . This call will return the most * common extension for the given MIME type . * @ param mimeType A MIME type ( i . e . text / plain ) * @ return The extension for the ...
if ( mimeType == null || mimeType . length ( ) == 0 ) { return null ; } return mimeTypeToExtensionMap . get ( mimeType ) ;
public class Mail { /** * set the value to The name of the e - mail message recipient . * @ param strTo value to set * @ throws ApplicationException */ public void setTo ( Object to ) throws ApplicationException { } }
if ( StringUtil . isEmpty ( to ) ) return ; try { smtp . addTo ( to ) ; } catch ( Exception e ) { throw new ApplicationException ( "attribute [to] of the tag [mail] is invalid" , e . getMessage ( ) ) ; }
public class InsertIntoClauseParser { /** * Parse insert into . * @ param insertStatement insert statement */ public void parse ( final InsertStatement insertStatement ) { } }
lexerEngine . unsupportedIfEqual ( getUnsupportedKeywordsBeforeInto ( ) ) ; lexerEngine . skipUntil ( DefaultKeyword . INTO ) ; lexerEngine . nextToken ( ) ; tableReferencesClauseParser . parse ( insertStatement , true ) ; skipBetweenTableAndValues ( insertStatement ) ;
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcShadingDeviceTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class RgbaColor { /** * palettes */ public RgbaColor [ ] getPaletteVaryLightness ( int count ) { } }
// a max of 80 and an offset of 10 keeps us away from the // edges float [ ] spread = getSpreadInRange ( l ( ) , count , 80 , 10 ) ; RgbaColor [ ] ret = new RgbaColor [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { ret [ i ] = withLightness ( spread [ i ] ) ; } return ret ;
public class druidGParser { /** * druidG . g : 441:1 : regexFilter returns [ Filter filter ] : ( a = ID WS LIKE WS b = ( SINGLE _ QUOTE _ STRING ) ) ; */ public final Filter regexFilter ( ) throws RecognitionException { } }
Filter filter = null ; Token a = null ; Token b = null ; filter = new Filter ( "regex" ) ; try { // druidG . g : 443:2 : ( ( a = ID WS LIKE WS b = ( SINGLE _ QUOTE _ STRING ) ) ) // druidG . g : 443:4 : ( a = ID WS LIKE WS b = ( SINGLE _ QUOTE _ STRING ) ) { // druidG . g : 443:4 : ( a = ID WS LIKE WS b = ( SINGLE _ QU...
public class CommandClass { /** * Restores details about this command class from a persistence context . * @ param ctx the persistence context * @ param nodeId the node ID associated with this command class * @ return a Map with the command class properties */ public Map < String , Object > restore ( PersistenceC...
Map < String , Object > map = ctx . getCommandClassMap ( nodeId , getId ( ) ) ; this . version = ( int ) map . get ( "version" ) ; return map ;
public class RampImport { /** * Marshal from an array of source types to an array of dest types . */ public Class < ? > marshalType ( Class < ? > sourceType ) { } }
if ( sourceType == null ) { return null ; } Class < ? > targetType = getTargetType ( getTargetLoader ( ) , sourceType ) ; if ( targetType != null ) { return targetType ; } else { return sourceType ; }
public class ComputeNodesImpl { /** * Gets the Remote Desktop Protocol file for the specified compute node . * Before you can access a node by using the RDP file , you must create a user account on the node . This API can only be invoked on pools created with a cloud service configuration . For pools created with a v...
return ServiceFuture . fromHeaderResponse ( getRemoteDesktopWithServiceResponseAsync ( poolId , nodeId ) , serviceCallback ) ;
public class GetIndicesVersionResponse { /** * Computes a unique hash based on the version of the shards . */ private long getIndexVersion ( List < ShardIndexVersion > shards ) { } }
long version = 1 ; // order shards per their id before computing the hash Collections . sort ( shards , new Comparator < ShardIndexVersion > ( ) { @ Override public int compare ( ShardIndexVersion o1 , ShardIndexVersion o2 ) { return o1 . getShardRouting ( ) . id ( ) - o2 . getShardRouting ( ) . id ( ) ; } } ) ; // com...
public class SpringContext { /** * Get application context for configuration class . */ public static synchronized AbstractApplicationContext getContext ( Class < ? > springConfigurationClass ) { } }
if ( ! CONTEXTS . containsKey ( springConfigurationClass ) ) { AbstractApplicationContext context = new AnnotationConfigApplicationContext ( springConfigurationClass ) ; context . registerShutdownHook ( ) ; CONTEXTS . put ( springConfigurationClass , context ) ; } return CONTEXTS . get ( springConfigurationClass ) ;
public class AdductionPBMechanism { /** * Initiates the process for the given mechanism . The atoms and bonds to apply are mapped between * reactants and products . * @ param atomContainerSet * @ param atomList The list of atoms taking part in the mechanism . Only allowed three atoms * @ param bondList The list...
CDKAtomTypeMatcher atMatcher = CDKAtomTypeMatcher . getInstance ( atomContainerSet . getBuilder ( ) ) ; if ( atomContainerSet . getAtomContainerCount ( ) != 2 ) { throw new CDKException ( "AdductionPBMechanism expects two IAtomContainer's" ) ; } if ( atomList . size ( ) != 3 ) { throw new CDKException ( "AdductionPBMec...
public class ChannelServiceImpl { /** * < pre > * 根据PipelineID找到对应的Channel * 优化设想 : * 应该通过变长参数达到后期扩展的方便性 * < / pre > */ public List < Channel > listByPipelineIds ( Long ... pipelineIds ) { } }
List < Channel > channels = new ArrayList < Channel > ( ) ; try { List < Pipeline > pipelines = pipelineService . listByIds ( pipelineIds ) ; List < Long > channelIds = new ArrayList < Long > ( ) ; for ( Pipeline pipeline : pipelines ) { if ( ! channelIds . contains ( pipeline . getChannelId ( ) ) ) { channelIds . add ...
public class SqlFilterManagerImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . filter . SqlFilter # doQuery ( jp . co . future . uroborosql . context . SqlContext , java . sql . PreparedStatement , java . sql . ResultSet ) */ @ Override public ResultSet doQuery ( final SqlContext sqlContext , fina...
if ( getFilters ( ) . isEmpty ( ) ) { return resultSet ; } ResultSet rs = resultSet ; for ( final SqlFilter filter : getFilters ( ) ) { rs = filter . doQuery ( sqlContext , preparedStatement , rs ) ; } return rs ;
public class DatabaseHashMap { /** * loadOneValue * For multirow db , attempts to get the requested attr from the db * Returns null if attr doesn ' t exist or we ' re not running multirow * After PM90293 , we consider populatedAppData as well * populatedAppData is true when session is new or when the entire ses...
Object value = null ; if ( _smc . isUsingMultirow ( ) && ! ( ( DatabaseSession ) sess ) . getPopulatedAppData ( ) ) { // PM90293 value = getValue ( attrName , sess ) ; } return value ;
public class ContainerTx { /** * d111555 */ private final void initialize_beanO_vectors ( ) // d173022.2 { } }
// ensure allocation not just done in another thread via an enlist call if ( ivBeanOsEnlistedInTx == false ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Lazy beanOs vector creation" ) ; // ArrayLists and HashMaps are created with the java default values // for perform...
public class RecastRegion { /** * / @ see rcCompactHeightfield , rcBuildRegions , rcBuildRegionsMonotone */ public static void buildDistanceField ( Context ctx , CompactHeightfield chf ) { } }
ctx . startTimer ( "BUILD_DISTANCEFIELD" ) ; int [ ] src = new int [ chf . spanCount ] ; ctx . startTimer ( "DISTANCEFIELD_DIST" ) ; int maxDist = calculateDistanceField ( chf , src ) ; chf . maxDistance = maxDist ; ctx . stopTimer ( "DISTANCEFIELD_DIST" ) ; ctx . startTimer ( "DISTANCEFIELD_BLUR" ) ; // Blur src = box...
public class Elements2 { /** * Given an executable element in a supertype , returns its ExecutableType when it is viewed as a * member of a subtype . */ static ExecutableType getExecutableElementAsMemberOf ( Types types , ExecutableElement executableElement , TypeElement subTypeElement ) { } }
checkNotNull ( types ) ; checkNotNull ( executableElement ) ; checkNotNull ( subTypeElement ) ; TypeMirror subTypeMirror = subTypeElement . asType ( ) ; if ( ! subTypeMirror . getKind ( ) . equals ( TypeKind . DECLARED ) ) { throw new IllegalStateException ( "Expected subTypeElement.asType() to return a class/interface...
public class IslamicCalendar { /** * Override Calendar to compute several fields specific to the Islamic * calendar system . These are : * < ul > < li > ERA * < li > YEAR * < li > MONTH * < li > DAY _ OF _ MONTH * < li > DAY _ OF _ YEAR * < li > EXTENDED _ YEAR < / ul > * The DAY _ OF _ WEEK and DOW _ L...
int year = 0 , month = 0 , dayOfMonth = 0 , dayOfYear = 0 ; long monthStart ; long days = julianDay - CIVIL_EPOC ; if ( cType == CalculationType . ISLAMIC_CIVIL || cType == CalculationType . ISLAMIC_TBLA ) { if ( cType == CalculationType . ISLAMIC_TBLA ) { days = julianDay - ASTRONOMICAL_EPOC ; } // Use the civil calen...
public class HOSECodeGenerator { /** * Gets the element rank for a given element symbol as given in Bremser ' s * publication . * @ param symbol The element symbol for which the rank is to be determined * @ return The element rank */ private double getElementRank ( String symbol ) { } }
for ( int f = 0 ; f < rankedSymbols . length ; f ++ ) { if ( rankedSymbols [ f ] . equals ( symbol ) ) { return symbolRankings [ f ] ; } } IIsotope isotope = isotopeFac . getMajorIsotope ( symbol ) ; if ( isotope . getMassNumber ( ) != null ) { return ( ( double ) 800000 - isotope . getMassNumber ( ) ) ; } return 80000...
public class JMessageClient { /** * Set user ' s group message blocking * @ param payload GroupShieldPayload * @ param username Necessary * @ return No content * @ throws APIConnectionException connect exception * @ throws APIRequestException request exception */ public ResponseWrapper setGroupShield ( GroupS...
return _userClient . setGroupShield ( payload , username ) ;
public class CareWebShellEx { /** * Registers the plugin with the specified id and path . If a tree path is absent , the plugin is * associated with the tab itself . * @ param path Format is & lt ; tab name & gt ; \ & lt ; tree node path & gt ; * @ param id Unique id of plugin * @ param propertySource Optional ...
return register ( path , pluginById ( id ) , propertySource ) ;
public class IndexSummaryManager { /** * for testing only */ @ VisibleForTesting Long getTimeToNextResize ( TimeUnit timeUnit ) { } }
if ( future == null ) return null ; return future . getDelay ( timeUnit ) ;
public class WorkspaceBasedKey { /** * { @ inheritDoc } */ public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } }
super . readExternal ( in ) ; byte [ ] data = new byte [ in . readInt ( ) ] ; in . readFully ( data ) ; workspaceUniqueName = new String ( data , Constants . DEFAULT_ENCODING ) ;
public class ServerSocketChannelAcceptor { /** * Unbind our listening sockets . */ public void shutdown ( ) { } }
for ( ServerSocketChannel ssocket : _ssockets ) { try { ssocket . socket ( ) . close ( ) ; } catch ( IOException ioe ) { log . warning ( "Failed to close listening socket: " + ssocket , ioe ) ; } }
public class CompilerUtil { /** * Formats the specified setter method and parameters into a string for display . * For example : < code > setXXX ( arg1 , ar2 ) < / code > * @ param setterMethodName * the method name * @ param args * the method arguments * @ return the formatted string */ private static Stri...
StringBuilder sb = new StringBuilder ( CompilerOptions . class . getName ( ) ) ; sb . append ( "." ) . append ( setterMethodName ) . append ( "(" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ Joiner . on ( "," ) . appendTo ( sb , args ) . append ( ")" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ return sb . toString...
public class RestAPIDocGenerator { /** * Generates the REST API documentation . * @ param args args [ 0 ] contains the directory into which the generated files are placed * @ throws IOException if any file operation failed */ public static void main ( String [ ] args ) throws IOException { } }
String outputDirectory = args [ 0 ] ; for ( final RestAPIVersion apiVersion : RestAPIVersion . values ( ) ) { if ( apiVersion == RestAPIVersion . V0 ) { // this version exists only for testing purposes continue ; } createHtmlFile ( new DocumentingDispatcherRestEndpoint ( ) , apiVersion , Paths . get ( outputDirectory ,...
public class CmsAliasTableController { /** * Copies a list of rows . < p > * @ param data the original data * @ return the copied data */ List < CmsAliasTableRow > copyData ( List < CmsAliasTableRow > data ) { } }
List < CmsAliasTableRow > result = new ArrayList < CmsAliasTableRow > ( ) ; for ( CmsAliasTableRow row : data ) { CmsAliasTableRow copiedRow = row . copy ( ) ; result . add ( copiedRow ) ; } return result ;
public class DeleteTagsForDomainRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteTagsForDomainRequest deleteTagsForDomainRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteTagsForDomainRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteTagsForDomainRequest . getDomainName ( ) , DOMAINNAME_BINDING ) ; protocolMarshaller . marshall ( deleteTagsForDomainRequest . getTagsToDelete ( ) , TAG...
public class MP4Reader { /** * Create tag for metadata event . * Information mostly from http : / / www . kaourantin . net / 2007/08 / what - just - happened - to - video - on - web _ 20 . html * < pre > * width : Display width in pixels . * height : Display height in pixels . * duration : Duration in seconds...
log . debug ( "Creating onMetaData" ) ; // Create tag for onMetaData event IoBuffer buf = IoBuffer . allocate ( 1024 ) ; buf . setAutoExpand ( true ) ; Output out = new Output ( buf ) ; out . writeString ( "onMetaData" ) ; Map < Object , Object > props = new HashMap < Object , Object > ( ) ; // Duration property props ...
public class JQLBuilder { /** * Builds the JQL . * @ param method * the method * @ param preparedJql * the prepared jql * @ return the jql */ public static JQL buildJQL ( final SQLiteModelMethod method , String preparedJql ) { } }
Map < JQLDynamicStatementType , String > dynamicReplace = new HashMap < > ( ) ; final JQL result = new JQL ( ) ; // for each method ' s parameter forEachParameter ( method , new OnMethodParameterListener ( ) { @ Override public void onMethodParameter ( VariableElement item ) { if ( method . getEntity ( ) . getElement (...
public class Router { public void removeTarget ( T target ) { } }
for ( MethodlessRouter < T > r : routers . values ( ) ) r . removeTarget ( target ) ; anyMethodRouter . removeTarget ( target ) ;
public class ExpressionUtils { /** * Turns expressions of the form ConstantExpression ( 40 ) + ConstantExpression ( 2) * into the simplified ConstantExpression ( 42 ) at compile time . * @ param be the binary expression * @ param targetType the type of the result * @ return the transformed expression or the ori...
ClassNode wrapperType = ClassHelper . getWrapper ( targetType ) ; if ( isTypeOrArrayOfType ( targetType , ClassHelper . STRING_TYPE , false ) ) { if ( be . getOperation ( ) . getType ( ) == PLUS ) { Expression left = transformInlineConstants ( be . getLeftExpression ( ) , targetType ) ; Expression right = transformInli...
public class AbstractMappableValidator { /** * Disposes all rules and result handlers that are mapped to each other . */ private void disposeRulesAndResultHandlers ( ) { } }
for ( final Map . Entry < R , List < RH > > entry : rulesToResultHandlers . entrySet ( ) ) { // Dispose rule final R rule = entry . getKey ( ) ; if ( rule instanceof Disposable ) { ( ( Disposable ) rule ) . dispose ( ) ; } // Dispose result handlers final List < RH > resultHandlers = entry . getValue ( ) ; if ( resultH...
public class SerializeInterceptor { /** * Method to get the file content of the upload file based on the mime type * @ param requestElements the request elements * @ return byte [ ] the upload file content * @ throws FMSException */ private byte [ ] getUploadFileContent ( RequestElements requestElements ) throws ...
Attachable attachable = ( Attachable ) requestElements . getEntity ( ) ; InputStream docContent = requestElements . getUploadRequestElements ( ) . getDocContent ( ) ; // gets the mime value form the filename String mime = getMime ( attachable . getFileName ( ) , "." ) ; // if null then gets the mime value from content ...
public class OptionsImpl { /** * Loads the Options properties from the aggregator properties file * into the specified properties object . If the properties file * does not exist , then try to load from the bundle . * @ param props * The properties object to load . May be initialized with default * values . ...
// try to load the properties file first from the user ' s home directory File file = getPropsFile ( ) ; if ( file != null ) { // Try to load the file from the user ' s home directory if ( file . exists ( ) ) { try { URL url = file . toURI ( ) . toURL ( ) ; loadFromUrl ( props , url ) ; } catch ( MalformedURLException ...
public class GetUserDefinedFunctionsResult { /** * A list of requested function definitions . * @ param userDefinedFunctions * A list of requested function definitions . */ public void setUserDefinedFunctions ( java . util . Collection < UserDefinedFunction > userDefinedFunctions ) { } }
if ( userDefinedFunctions == null ) { this . userDefinedFunctions = null ; return ; } this . userDefinedFunctions = new java . util . ArrayList < UserDefinedFunction > ( userDefinedFunctions ) ;
public class DoubleLaunchChecker { /** * Ignore the problem and go back to using Hudson . */ @ RequirePOST public void doIgnore ( StaplerRequest req , StaplerResponse rsp ) throws IOException { } }
ignore = true ; Jenkins . getInstance ( ) . servletContext . setAttribute ( "app" , Jenkins . getInstance ( ) ) ; rsp . sendRedirect2 ( req . getContextPath ( ) + '/' ) ;
public class Character { /** * Returns the number of Unicode code points in a subarray of the * { @ code char } array argument . The { @ code offset } * argument is the index of the first { @ code char } of the * subarray and the { @ code count } argument specifies the * length of the subarray in { @ code char ...
if ( count > a . length - offset || offset < 0 || count < 0 ) { throw new IndexOutOfBoundsException ( ) ; } return codePointCountImpl ( a , offset , count ) ;
public class MsgPackVisualizer { @ Override void readArrayItem ( ) throws IOException { } }
indent = indent + "- " ; super . readArrayItem ( ) ; indent = indent . substring ( 0 , indent . length ( ) - 2 ) ;
public class SRTServletResponse { /** * Get the Cookies that have been set in this response . */ public Cookie [ ] getCookies ( ) { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15 logger . logp ( Level . FINE , CLASS_NAME , "getCookies" , "[" + this + "]" ) ; } return ( _response . getCookies ( ) ) ;
public class CmsJspStandardContextBean { /** * Initializes the mapping configuration . < p > */ private void initMetaMappings ( ) { } }
if ( m_metaMappings == null ) { m_metaMappings = new HashMap < String , MetaMapping > ( ) ; try { initPage ( ) ; CmsMacroResolver resolver = new CmsMacroResolver ( ) ; resolver . setKeepEmptyMacros ( true ) ; resolver . setCmsObject ( m_cms ) ; resolver . setMessages ( OpenCms . getWorkplaceManager ( ) . getMessages ( ...
public class AmazonSNSClient { /** * Sets the attributes for an endpoint for a device on one of the supported push notification services , such as GCM * and APNS . For more information , see < a href = " https : / / docs . aws . amazon . com / sns / latest / dg / SNSMobilePush . html " > Using * Amazon SNS Mobile P...
request = beforeClientExecution ( request ) ; return executeSetEndpointAttributes ( request ) ;
public class IdpMetadataGenerator { /** * Provides set discovery request url or generates a default when none was provided . Primarily value set on * extenedMetadata property idpDiscoveryURL is used , when empty local property customDiscoveryURL is used , when * empty URL is automatically generated . * @ param en...
if ( extendedMetadata != null && extendedMetadata . getIdpDiscoveryURL ( ) != null && extendedMetadata . getIdpDiscoveryURL ( ) . length ( ) > 0 ) { return extendedMetadata . getIdpDiscoveryURL ( ) ; } else { return getServerURL ( entityBaseURL , entityAlias , getSAMLDiscoveryPath ( ) ) ; }
public class FileSystemResourceReader { /** * ( non - Javadoc ) * @ see * net . jawr . web . resource . handler . reader . ResourceBrowser # getFilePath ( java . * lang . String ) */ @ Override public String getFilePath ( String resourcePath ) { } }
String path = resourcePath . replace ( '/' , File . separatorChar ) ; return new File ( baseDir , path ) . getAbsolutePath ( ) ;
public class TransmittableChannelMessage { /** * Combine the CommandByte and the serialized message packet together to form a Firmata supported * byte packet to be sent over the SerialPort . To form the CommandByte for a ChannelMessage , we need to * pad the command with the channel we want to handle the command ( ...
ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( 32 ) ; outputStream . write ( ( byte ) ( commandByte + ( channelByte & 0x0F ) ) ) ; if ( serialize ( outputStream ) ) { return outputStream . toByteArray ( ) ; } return null ;
public class ContainerBase { /** * { @ inheritDoc } * @ see org . jboss . shrinkwrap . api . Archive # merge ( org . jboss . shrinkwrap . api . Archive ) */ @ Override public T merge ( Archive < ? > source ) throws IllegalArgumentException { } }
this . getArchive ( ) . merge ( source ) ; return covarientReturn ( ) ;
public class Async { /** * Removes messages from queue . * @ param queueName queue name * @ param filter filter selector as in JMS specification . * See : < a href = " http : / / docs . oracle . com / cd / E19798-01/821-1841 / bncer / index . html " > JMS Message Selectors < / a > * @ return number of messages ...
try { return getQueueControl ( queueName ) . removeMessages ( filter ) ; } catch ( Exception e ) { throw new AsyncException ( e ) ; }
public class OnlineLDAsvi { /** * The " forgetfulness " factor in the learning rate . Larger values increase * the rate at which old information is " forgotten " * @ param kappa the forgetfulness factor in [ 0.5 , 1] */ public void setKappa ( double kappa ) { } }
if ( kappa < 0.5 || kappa > 1.0 || Double . isNaN ( kappa ) ) throw new IllegalArgumentException ( "Kapp must be in [0.5, 1], not " + kappa ) ; this . kappa = kappa ;
public class CharNormalizer { /** * Character Normalization ( and exclusion ) . * @ return Normalized character , the space to exclude the character . */ public static char normalize ( char ch ) { } }
// this is even cheaper than the hashmap lookup . because it covers most use cases , it ' s worth the check . if ( ch <= 127 ) { // ascii ( basic latin ) if ( ch < 'A' || ( ch < 'a' && ch > 'Z' ) || ch > 'z' ) { return ' ' ; } else { return ch ; } } Character result = NORMALIZE_MAP . get ( ch ) ; return result == null ...
public class ResourcesInner { /** * Deletes a resource by ID . * @ param resourceId The fully qualified ID of the resource , including the resource name and resource type . Use the format , / subscriptions / { guid } / resourceGroups / { resource - group - name } / { resource - provider - namespace } / { resource - t...
if ( resourceId == null ) { throw new IllegalArgumentException ( "Parameter resourceId is required and cannot be null." ) ; } if ( apiVersion == null ) { throw new IllegalArgumentException ( "Parameter apiVersion is required and cannot be null." ) ; } return service . beginDeleteById ( resourceId , apiVersion , this . ...
public class WhitelistUrlFilter { /** * Initialize " allowUrls " parameter from web . xml . * @ param filterConfig A filter configuration object used by a servlet container * to pass information to a filter during initialization . */ public void init ( final FilterConfig filterConfig ) { } }
final String allowParam = filterConfig . getInitParameter ( "allowUrls" ) ; if ( StringUtils . isNotBlank ( allowParam ) ) { this . allowUrls = allowParam . split ( "," ) ; }
public class Long2ObjectHashMap { /** * Compact the { @ link Map } backing arrays by rehashing with a capacity just larger than current size * and giving consideration to the load factor . */ public void compact ( ) { } }
final int idealCapacity = ( int ) Math . round ( size ( ) * ( 1.0d / loadFactor ) ) ; rehash ( QuickMath . nextPowerOfTwo ( idealCapacity ) ) ;
public class GraphSearch { /** * Configures the search * @ param policy way to select arcs * @ param enforce true if a decision is an arc enforcing * false if a decision is an arc removal */ public GraphSearch configure ( int policy , boolean enforce ) { } }
if ( enforce ) { decisionType = GraphAssignment . graph_enforcer ; } else { decisionType = GraphAssignment . graph_remover ; } mode = policy ; return this ;
public class Element { /** * Selects the frame represented by the element , but only if the element is * present and displayed . If these conditions are not met , the move action * will be logged , but skipped and the test will continue . */ public void selectFrame ( ) { } }
String cantSelect = "Unable to focus on frame " ; String action = "Focusing on frame " + prettyOutput ( ) ; String expected = "Frame " + prettyOutput ( ) + " is present, displayed, and focused" ; try { // wait for element to be present if ( isNotPresent ( action , expected , cantSelect ) ) { return ; } // wait for elem...
public class PermissionUtils { /** * < p > Takes a set of permissions and determines if all of them are granted . < / p > * < p > Use { @ link Manifest . permission } to reference permission constants . < / p > * @ param context * the permissible { @ link Context } * @ param permissions * the set of { @ link ...
for ( String permission : permissions ) { if ( ContextUtils . discover ( context ) . checkCallingOrSelfPermission ( permission ) == PackageManager . PERMISSION_DENIED ) { return false ; } } return true ;
public class StorageSnippets { /** * [ VARIABLE " my _ blob _ name2 " ] */ public List < Boolean > batchDelete ( String bucketName , String blobName1 , String blobName2 ) { } }
// [ START batchDelete ] BlobId firstBlob = BlobId . of ( bucketName , blobName1 ) ; BlobId secondBlob = BlobId . of ( bucketName , blobName2 ) ; List < Boolean > deleted = storage . delete ( firstBlob , secondBlob ) ; // [ END batchDelete ] return deleted ;
public class SleepBuilder { /** * Timeout after with { @ code SleepBuilder . build ( ) } is awaked * @ param timeout after with sleeper should awake * @ param timeUnit of passed timeout * @ return { @ code SleepBuilder } with comparer */ public SleepBuilder < T > withTimeout ( long timeout , TimeUnit timeUnit ) {...
this . timeout = timeUnit . toMillis ( timeout ) ; return this ;
public class EventJournalReadOperation { /** * { @ inheritDoc } * On every invocation this method reads from the event journal until * it has collected the minimum required number of response items . * Returns { @ code true } if there are currently not enough * elements in the response and the operation should ...
if ( resultSet == null ) { resultSet = createResultSet ( ) ; sequence = startSequence ; } final EventJournal < J > journal = getJournal ( ) ; final int partitionId = getPartitionId ( ) ; journal . cleanup ( namespace , partitionId ) ; sequence = clampToBounds ( journal , partitionId , sequence ) ; if ( minSize == 0 ) {...
public class DocBookBuildUtilities { /** * This function scans the supplied XML node and it ' s children for id attributes , collecting them in the usedIdAttributes * parameter . * @ param docBookVersion * @ param topic The topic that we are collecting attribute ID ' s for . * @ param node The current node bein...
final NamedNodeMap attributes = node . getAttributes ( ) ; if ( attributes != null ) { final Node idAttribute ; if ( docBookVersion == DocBookVersion . DOCBOOK_50 ) { idAttribute = attributes . getNamedItem ( "xml:id" ) ; } else { idAttribute = attributes . getNamedItem ( "id" ) ; } if ( idAttribute != null ) { final S...
public class TableFormatter { /** * Print the table to the give PrintStream . * @ param stream the print stream to write to */ public void print ( @ NonNull PrintStream stream ) { } }
String horizontalBar = StringUtils . repeat ( "─" , longestCell ) ; String hline = middleCMBar ( horizontalBar , longestRow ) ; longestRow = Math . max ( longestRow , header . size ( ) ) ; if ( ! StringUtils . isNullOrBlank ( title ) ) { stream . println ( StringUtils . center ( title , ( longestCell * longestRow ) + l...
public class AbstractInteraction { /** * Trigger . * @ param listeners * the listeners * @ param type * the type */ protected boolean trigger ( List < InteractionListener > listeners , Type type , Throwable e ) { } }
if ( listeners . isEmpty ( ) ) return false ; InteractionEvent event = createInteractionEvent ( type , e ) ; for ( InteractionListener listener : listeners ) { listener . onEvent ( event ) ; } if ( event instanceof AfterFailInteractionEvent ) return ( ( AfterFailInteractionEvent ) event ) . isRetry ( ) ; return false ;
public class SpringConfigProcessor { /** * findRegistedModules . * @ param registry a { @ link org . beangle . commons . inject . bind . BindRegistry } object . * @ return a { @ link java . util . Map } object . */ protected Map < String , BeanDefinition > registerModules ( BindRegistry registry ) { } }
Stopwatch watch = new Stopwatch ( true ) ; List < String > modules = registry . getBeanNames ( BindModule . class ) ; Map < String , BeanDefinition > newBeanDefinitions = CollectUtils . newHashMap ( ) ; for ( String name : modules ) { Class < ? > beanClass = registry . getBeanType ( name ) ; BeanConfig config = null ; ...
public class SecureCredentialsManager { /** * Checks the result after showing the LockScreen to the user . * Must be called from the { @ link Activity # onActivityResult ( int , int , Intent ) } method with the received parameters . * It ' s safe to call this method even if { @ link SecureCredentialsManager # requi...
if ( requestCode != authenticationRequestCode || decryptCallback == null ) { return false ; } if ( resultCode == Activity . RESULT_OK ) { continueGetCredentials ( decryptCallback ) ; } else { decryptCallback . onFailure ( new CredentialsManagerException ( "The user didn't pass the authentication challenge." ) ) ; decry...
public class hqlLexer { /** * $ ANTLR start " ALL " */ public final void mALL ( ) throws RecognitionException { } }
try { int _type = ALL ; int _channel = DEFAULT_TOKEN_CHANNEL ; // hql . g : 7:5 : ( ' all ' ) // hql . g : 7:7 : ' all ' { match ( "all" ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class CmsVaadinUtils { /** * Gives item id from path . < p > * @ param cnt to be used * @ param path to obtain item id from * @ return item id */ public static String getPathItemId ( Container cnt , String path ) { } }
for ( String id : Arrays . asList ( path , CmsFileUtil . toggleTrailingSeparator ( path ) ) ) { if ( cnt . containsId ( id ) ) { return id ; } } return null ;
public class PassBookmarkExample { /** * Create a company node */ private StatementResult addCompany ( final Transaction tx , final String name ) { } }
return tx . run ( "CREATE (:Company {name: $name})" , parameters ( "name" , name ) ) ;
public class ConverterUtils { /** * { @ link # clearContent ( Workbook ) } with new { @ link ConverterUtils # newWorkbook ( InputStream ) } . */ static OutputStream clearContent ( InputStream workbook ) { } }
ByteArrayOutputStream xlsx = new ByteArrayOutputStream ( ) ; try { clearContent ( ConverterUtils . newWorkbook ( workbook ) ) . write ( xlsx ) ; } catch ( IOException e ) { throw new CalculationEngineException ( e ) ; } return xlsx ;
public class ScoreSettingsService { /** * Initialize quality score settings * If quality widget settings are present merge it with default score settings * Initialize settings for children scores in quality widget */ private void initQualityScoreSettings ( ) { } }
QualityScoreSettings qualityScoreSettings = this . scoreSettings . getQualityWidget ( ) ; if ( null != qualityScoreSettings ) { qualityScoreSettings . setCriteria ( Utils . mergeCriteria ( this . scoreSettings . getCriteria ( ) , qualityScoreSettings . getCriteria ( ) ) ) ; initQualityScoreChildrenSettings ( qualitySco...
public class Dur { /** * Compares this duration with another , acording to their length . * @ param arg0 another duration instance * @ return a postive value if this duration is longer , zero if the duration * lengths are equal , otherwise a negative value */ public final int compareTo ( final Dur arg0 ) { } }
int result ; if ( isNegative ( ) != arg0 . isNegative ( ) ) { // return Boolean . valueOf ( isNegative ( ) ) . compareTo ( Boolean . valueOf ( arg0 . isNegative ( ) ) ) ; // for pre - java 1.5 compatibility . . if ( isNegative ( ) ) { return Integer . MIN_VALUE ; } else { return Integer . MAX_VALUE ; } } else if ( getW...
public class AbstractParamDialog { /** * This method initializes btnCancel * @ return javax . swing . JButton */ protected JButton getBtnCancel ( ) { } }
if ( btnCancel == null ) { btnCancel = new JButton ( ) ; btnCancel . setName ( "btnCancel" ) ; btnCancel . setText ( Constant . messages . getString ( "all.button.cancel" ) ) ; btnCancel . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent e ) { exitResult = JOptionPane . ...
public class TypefaceHelper { /** * Initialize the instance . * @ param application the application context . */ public static synchronized void initialize ( Application application ) { } }
if ( sHelper != null ) { Log . v ( TAG , "already initialized" ) ; } sHelper = new TypefaceHelper ( application ) ;
public class StageMonitor { /** * 监听指定的processId节点的变化 */ private void syncStage ( final Long processId ) { } }
// 1 . 根据pipelineId + processId构造对应的path String path = null ; try { path = StagePathUtils . getProcess ( getPipelineId ( ) , processId ) ; // 2 . 监听当前的process列表的变化 IZkConnection connection = zookeeper . getConnection ( ) ; // zkclient包装的是一个持久化的zk , 分布式lock只需要一次性的watcher , 需要调用原始的zk链接进行操作 ZooKeeper orginZk = ( ( ZooKeep...
public class Gauge { /** * Defines if the averaging functionality will be enabled . */ public void setAveragingEnabled ( final boolean ENABLED ) { } }
if ( null == averagingEnabled ) { _averagingEnabled = ENABLED ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { averagingEnabled . set ( ENABLED ) ; }
public class SarlArtifactImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case SarlPackage . SARL_ARTIFACT__EXTENDS : setExtends ( ( JvmParameterizedTypeReference ) null ) ; return ; } super . eUnset ( featureID ) ;