signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BaseMojo { /** * Assembles the archive file . Optionally , copies to the war application directory if the * packaging type is " war " . * @ throws Exception Unspecified exception . */ protected void assembleArchive ( ) throws Exception { } }
getLog ( ) . info ( "Assembling " + classifier + " archive" ) ; if ( resources != null && ! resources . isEmpty ( ) ) { getLog ( ) . info ( "Copying additional resources." ) ; new ResourceProcessor ( this , moduleBase , resources ) . transform ( ) ; } if ( configTemplate != null ) { getLog ( ) . info ( "Creating config...
public class CmsPriorityResourceCollector { /** * Returns a list of all resource from specified folder that have been mapped to * the currently requested uri , sorted by priority , then date ascending or descending . < p > * @ param cms the current OpenCms user context * @ param param the folder name to use * @...
CmsCollectorData data = new CmsCollectorData ( param ) ; String foldername = CmsResource . getFolderPath ( data . getFileName ( ) ) ; CmsResourceFilter filter = CmsResourceFilter . DEFAULT . addRequireType ( data . getType ( ) ) . addExcludeFlags ( CmsResource . FLAG_TEMPFILE ) ; if ( data . isExcludeTimerange ( ) && !...
public class CommerceTaxFixedRateLocalServiceUtil { /** * Updates the commerce tax fixed rate in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners . * @ param commerceTaxFixedRate the commerce tax fixed rate * @ return the commerce tax fixed rate that was updated */ pu...
return getService ( ) . updateCommerceTaxFixedRate ( commerceTaxFixedRate ) ;
public class Permission { /** * Turn permissions into text . */ public static List < String > transformText ( Context context , String ... permissions ) { } }
return transformText ( context , Arrays . asList ( permissions ) ) ;
public class Splitter { /** * Calls either of two op methods depending on start + length > size . If so * calls op with 5 parameters , otherwise op with 3 parameters . * @ param obj * @ param start * @ param length * @ return * @ throws IOException */ public int split ( T obj , int start , int length ) thro...
int count = 0 ; if ( length > 0 ) { int end = ( start + length ) % size ; if ( start < end ) { count = op ( obj , start , end ) ; } else { if ( end > 0 ) { count = op ( obj , start , size , 0 , end ) ; } else { count = op ( obj , start , size ) ; } } } assert count <= length ; return count ;
public class BinaryTokenizer { /** * @ see org . apache . hadoop . hdfs . tools . offlineEditsViewer . Tokenizer # read * @ param t a Token to read * @ return token that was just read */ @ Override public Token read ( Token t ) throws IOException { } }
t . offset = is . getChannel ( ) . position ( ) ; t . fromBinary ( in ) ; return t ;
public class Db { /** * Save record . * < pre > * Example : * Record userRole = new Record ( ) . set ( " user _ id " , 123 ) . set ( " role _ id " , 456 ) ; * Db . save ( " user _ role " , " user _ id , role _ id " , userRole ) ; * < / pre > * @ param tableName the table name of the table * @ param primar...
return MAIN . save ( tableName , primaryKey , record ) ;
public class ReportInstanceStatusRequest { /** * The reason codes that describe the health state of your instance . * < ul > * < li > * < code > instance - stuck - in - state < / code > : My instance is stuck in a state . * < / li > * < li > * < code > unresponsive < / code > : My instance is unresponsive ....
if ( reasonCodes == null ) { this . reasonCodes = null ; return ; } this . reasonCodes = new com . amazonaws . internal . SdkInternalList < String > ( reasonCodes ) ;
public class Fn { /** * Only for temporary use in sequential stream / single thread , not for parallel stream / multiple threads . * The returned Collection will clean up before it ' s returned every time when { @ code get } is called . * Don ' t save the returned Collection object or use it to save objects . * @...
return new IntFunction < C > ( ) { private C c ; @ Override public C apply ( int size ) { if ( c == null ) { c = supplier . apply ( size ) ; } else if ( c . size ( ) > 0 ) { c . clear ( ) ; } return c ; } } ;
public class ConversionSchemas { /** * A ConversionSchema builder that defaults to building { @ link # V1 } . */ public static Builder v1Builder ( String name ) { } }
return new Builder ( name , V1MarshallerSet . marshallers ( ) , V1MarshallerSet . setMarshallers ( ) , StandardUnmarshallerSet . unmarshallers ( ) , StandardUnmarshallerSet . setUnmarshallers ( ) ) ;
public class OAuth20Utils { /** * Check the client secret . * @ param registeredService the registered service * @ param clientSecret the client secret * @ return whether the secret is valid */ public static boolean checkClientSecret ( final OAuthRegisteredService registeredService , final String clientSecret ) {...
LOGGER . debug ( "Found: [{}] in secret check" , registeredService ) ; if ( StringUtils . isBlank ( registeredService . getClientSecret ( ) ) ) { LOGGER . debug ( "The client secret is not defined for the registered service [{}]" , registeredService . getName ( ) ) ; return true ; } if ( ! StringUtils . equals ( regist...
public class IfcObjectDefinitionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcRelAggregates > getDecomposes ( ) { } }
return ( EList < IfcRelAggregates > ) eGet ( Ifc4Package . Literals . IFC_OBJECT_DEFINITION__DECOMPOSES , true ) ;
public class DeviceAttribute_3DAODefaultImpl { public int getType ( ) throws DevFailed { } }
int type = - 1 ; try { final TypeCode tc = attrval . value . type ( ) ; // Special case for test if ( tc . kind ( ) . value ( ) == TCKind . _tk_enum ) { return TangoConst . Tango_DEV_STATE ; } final TypeCode tc_alias = tc . content_type ( ) ; final TypeCode tc_seq = tc_alias . content_type ( ) ; final TCKind kind = tc_...
public class ComponentImpl { /** * return element that has at least given access or null * @ param access * @ param name * @ return matching value * @ throws PageException */ public Object get ( int access , String name ) throws PageException { } }
return get ( access , KeyImpl . init ( name ) ) ;
public class Oauth2LoginConfigImpl { /** * { @ inheritDoc } */ @ Override public AuthenticationFilter getAuthFilter ( ) { } }
if ( this . authFilter == null ) { this . authFilter = SocialLoginTAI . getAuthFilter ( this . authFilterRef ) ; } return this . authFilter ;
public class CommerceOrderItemUtil { /** * Returns a range of all the commerce order items where CProductId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in ...
return getPersistence ( ) . findByCProductId ( CProductId , start , end ) ;
public class BasicBinder { /** * Initialises standard bindings for Java built in types */ private void initJdkBindings ( ) { } }
registerBinding ( AtomicBoolean . class , String . class , new AtomicBooleanStringBinding ( ) ) ; registerBinding ( AtomicInteger . class , String . class , new AtomicIntegerStringBinding ( ) ) ; registerBinding ( AtomicLong . class , String . class , new AtomicLongStringBinding ( ) ) ; registerBinding ( BigDecimal . c...
public class SourceStreamSetControl { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPPtoPOutboundTransmitControllable # getTransmitMessagesIterator ( ) */ public SIMPIterator getTransmitMessagesIterator ( int maxMsgs ) throws SIMPControllableNotFoundException , SIMPRuntimeOperati...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getTransmitMessagesIterator" ) ; assertValidControllable ( ) ; SIMPIterator msgItr = null ; try { msgItr = new SourceStreamSetXmitMessageIterator ( maxMsgs ) ; } catch ( SIResourceException e ) { FFDCFilter . processExcepti...
public class Table { /** * Create a PdfPTable based on this Table object . * @ return a PdfPTable object * @ throws BadElementException */ public PdfPTable createPdfPTable ( ) throws BadElementException { } }
if ( ! convert2pdfptable ) { throw new BadElementException ( "No error, just an old style table" ) ; } setAutoFillEmptyCells ( true ) ; complete ( ) ; PdfPTable pdfptable = new PdfPTable ( widths ) ; pdfptable . setComplete ( complete ) ; if ( isNotAddedYet ( ) ) pdfptable . setSkipFirstHeader ( true ) ; SimpleTable t_...
public class CqlNativeStorage { /** * set the value to the position of the tuple */ private void setTupleValue ( Tuple tuple , int position , Object value , AbstractType < ? > validator ) throws ExecException { } }
if ( validator instanceof CollectionType ) setCollectionTupleValues ( tuple , position , value , validator ) ; else setTupleValue ( tuple , position , value ) ;
public class LogUtil { /** * 打印请求报文 * @ param reqParam */ public static void printRequestLog ( Map < String , String > reqParam ) { } }
writeMessage ( LOG_STRING_REQ_MSG_BEGIN ) ; Iterator < Entry < String , String > > it = reqParam . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Entry < String , String > en = it . next ( ) ; writeMessage ( "[" + en . getKey ( ) + "] = [" + en . getValue ( ) + "]" ) ; } writeMessage ( LOG_STRING_REQ_MSG_EN...
public class CmsJspTagFormatter { /** * Sets the name for the optional attribute that provides direct access to the content value map . < p > * @ param val the name for the optional attribute that provides direct access to the content value map */ public void setVal ( String val ) { } }
if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( val ) ) { m_value = val . trim ( ) ; } else { m_value = val ; }
public class ExampleSegmentSuperpixels { /** * Visualizes results three ways . 1 ) Colorized segmented image where each region is given a random color . * 2 ) Each pixel is assigned the mean color through out the region . 3 ) Black pixels represent the border * between regions . */ public static < T extends ImageBa...
// Computes the mean color inside each region ImageType < T > type = color . getImageType ( ) ; ComputeRegionMeanColor < T > colorize = FactorySegmentationAlg . regionMeanColor ( type ) ; FastQueue < float [ ] > segmentColor = new ColorQueue_F32 ( type . getNumBands ( ) ) ; segmentColor . resize ( numSegments ) ; GrowQ...
public class PeerManager { /** * Initializes this peer manager and initiates the process of connecting to its peer nodes . * This will also reconfigure the ConnectionManager and ClientManager with peer related bits , * so this should not be called until < em > after < / em > the main server has set up its client ...
init ( nodeName , sharedSecret , hostName , publicHostName , region , port , nodeNamespace , false ) ;
public class SearchCollectorExample { /** * set up the query options for the collecting search */ public static void configureQueryOptions ( DatabaseClient client ) throws FailedRequestException , ForbiddenUserException , ResourceNotFoundException , ResourceNotResendableException { } }
// create a manager for writing query options QueryOptionsManager optionsMgr = client . newServerConfigManager ( ) . newQueryOptionsManager ( ) ; // create the query options String options = "<search:options " + "xmlns:search='http://marklogic.com/appservices/search'>" + "<search:constraint name='industry'>" + "<search...
public class ConsumerSessionImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . core . ConsumerSession # unlockSet ( long [ ] ) */ @ Override public void unlockSet ( SIMessageHandle [ ] msgHandles ) throws SIMPMessageNotLockedException , SISessionUnavailableException , SIConnectionLostException , SIIncor...
if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConsumerSession . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIConsumerSession . tc , "unlockSet" , new Object [ ] { this , SIMPUtils . messageHandleArrayToString ( msgHandles ) } ) ; // pass the unlockSet call on to the LCP _localConsumerPoint . processMsgSet...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcStructuralLoad ( ) { } }
if ( ifcStructuralLoadEClass == null ) { ifcStructuralLoadEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 640 ) ; } return ifcStructuralLoadEClass ;
public class DistributedCache { /** * To delete the caches which have a refcount of zero */ private static void deleteCache ( Configuration conf , MRAsyncDiskService asyncDiskService ) throws IOException { } }
List < CacheStatus > deleteSet = new LinkedList < CacheStatus > ( ) ; // try deleting cache Status with refcount of zero synchronized ( cachedArchives ) { for ( Iterator < String > it = cachedArchives . keySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { String cacheId = ( String ) it . next ( ) ; CacheStatus lcacheStat...
public class ClientConversationState { /** * Returns the SICoreConnection in use with this conversation * @ return SICoreConnection */ public SICoreConnection getSICoreConnection ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSICoreConnection" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSICoreConnection" , siCoreConnection ) ; return siCoreConnection ;
public class ReferrerURLCookieHandler { /** * Retrieve the referrer URL from the HttpServletRequest ' s cookies . * This will decode the URL and restore the host name if it was removed . * @ param req * @ return referrerURL */ @ Sensitive public String getReferrerURLFromCookies ( HttpServletRequest req , String c...
Cookie [ ] cookies = req . getCookies ( ) ; String referrerURL = CookieHelper . getCookieValue ( cookies , cookieName ) ; if ( referrerURL != null ) { StringBuffer URL = req . getRequestURL ( ) ; referrerURL = decodeURL ( referrerURL ) ; referrerURL = restoreHostNameToURL ( referrerURL , URL . toString ( ) ) ; } return...
public class SREsPreferencePage { /** * Edit the selected SRE . */ protected void editSRE ( ) { } }
final IStructuredSelection selection = ( IStructuredSelection ) this . sresList . getSelection ( ) ; final ISREInstall sre = ( ISREInstall ) selection . getFirstElement ( ) ; if ( sre == null ) { return ; } final EditSREInstallWizard wizard = new EditSREInstallWizard ( sre , this . sreArray . toArray ( new ISREInstall ...
public class CmsSitemapTreeItem { /** * Updates the in navigation properties of the displayed entry . < p > * @ param entry the sitemap entry */ public void updateInNavigation ( CmsClientSitemapEntry entry ) { } }
if ( entry . isInNavigation ( ) ) { m_inNavigationStyle . setValue ( null ) ; getListItemWidget ( ) . setTitleEditable ( true ) ; } else { m_inNavigationStyle . setValue ( CSS . notInNavigationEntry ( ) ) ; getListItemWidget ( ) . setTitleEditable ( false ) ; }
public class GeometryColumnsUtils { /** * Indicates if the < code > GEOMETRY _ COLUMNS < / code > table or view exists . * @ param database * the database to check . * @ return < code > true < / code > if the table or view exists . */ public static boolean geometryColumnsExists ( final Database database ) { } }
String geometryColumnsName = database . correctObjectName ( "geometry_columns" , Table . class ) ; DatabaseObject example = null ; if ( database instanceof DerbyDatabase || database instanceof H2Database ) { final Table tableExample = new Table ( ) ; tableExample . setName ( geometryColumnsName ) ; tableExample . setSc...
public class HtmlReport { /** * runFailure . . . set null if not error */ private List < ReportCodeLine > generateReportCodeBody ( TestMethod rootMethod , RunFailure runFailure , boolean executed ) throws IllegalTestScriptException { } }
String currentStepLabelTtId = null ; List < ReportCodeLine > result = new ArrayList < > ( rootMethod . getCodeBody ( ) . size ( ) ) ; for ( int i = 0 ; i < rootMethod . getCodeBody ( ) . size ( ) ; i ++ ) { CodeLine codeLine = rootMethod . getCodeBody ( ) . get ( i ) ; String rootTtId = Integer . toString ( i ) ; Strin...
public class HalReader { /** * Read and return HalResource * @ param reader Reader * @ return Hal resource */ public HalResource read ( final Reader reader ) { } }
final ContentRepresentation readableRepresentation = representationFactory . readRepresentation ( RepresentationFactory . HAL_JSON , reader ) ; return new HalResource ( objectMapper , readableRepresentation ) ;
public class HConnectionManager { /** * Remove the { @ link HClientPool } referenced by the { @ link CassandraHost } from * the active host pools . This does not shut down the pool , only removes it as a candidate from * future operations . * @ param cassandraHost * @ return true if the operation was successful...
HClientPool pool = hostPools . remove ( cassandraHost ) ; boolean removed = pool != null ; if ( removed ) { suspendedHostPools . put ( cassandraHost , pool ) ; } listenerHandler . fireOnSuspendHost ( cassandraHost , removed ) ; log . info ( "Suspend operation status was {} for CassandraHost {}" , removed , cassandraHos...
public class RootHeartbeat { /** * Returns the cluster with the given name , creating it if necessary . */ ClusterHeartbeat createCluster ( String clusterName ) { } }
ClusterHeartbeat cluster = _clusterMap . get ( clusterName ) ; if ( cluster == null ) { cluster = new ClusterHeartbeat ( clusterName , this ) ; _clusterMap . putIfAbsent ( clusterName , cluster ) ; cluster = _clusterMap . get ( clusterName ) ; } return cluster ;
public class DoubleArrayTrie { /** * 沿着路径转移状态 * @ param path 路径 * @ param from 起点 ( 根起点为base [ 0 ] = 1) * @ return 转移后的状态 ( 双数组下标 ) */ public int transition ( String path , int from ) { } }
int b = from ; int p ; for ( int i = 0 ; i < path . length ( ) ; ++ i ) { p = b + ( int ) ( path . charAt ( i ) ) + 1 ; if ( b == check [ p ] ) b = base [ p ] ; else return - 1 ; } p = b ; return p ;
public class DoubleColumn { /** * Maps the function across all rows , appending the results to a new NumberColumn * @ param fun function to map * @ return the NumberColumn with the results */ public DoubleColumn map ( ToDoubleFunction < Double > fun ) { } }
DoubleColumn result = DoubleColumn . create ( name ( ) ) ; for ( double t : this ) { try { result . append ( fun . applyAsDouble ( t ) ) ; } catch ( Exception e ) { result . appendMissing ( ) ; } } return result ;
public class WikipediaTemplateInfo { /** * Does the same as revisionContainsTemplateName ( ) without using a template index * @ param revId * @ param templateName * @ return * @ throws WikiApiException */ public boolean revisionContainsTemplateNameWithoutIndex ( int revId , String templateName ) throws WikiApiE...
if ( revApi == null ) { revApi = new RevisionApi ( wiki . getDatabaseConfiguration ( ) ) ; } if ( parser == null ) { // TODO switch to SWEBLE MediaWikiParserFactory pf = new MediaWikiParserFactory ( wiki . getDatabaseConfiguration ( ) . getLanguage ( ) ) ; pf . setTemplateParserClass ( ShowTemplateNamesAndParameters . ...
public class SipStandardService { /** * Find a sip Connector by it ' s ip address , port and transport * @ param ipAddress ip address of the connector to find * @ param port port of the connector to find * @ param transport transport of the connector to find * @ return the found sip connector or null if noting ...
SipConnector connectorToRemove = null ; for ( SipProtocolHandler protocolHandler : connectors ) { if ( protocolHandler . getIpAddress ( ) . equals ( ipAddress ) && protocolHandler . getPort ( ) == port && protocolHandler . getSignalingTransport ( ) . equalsIgnoreCase ( transport ) ) { connectorToRemove = protocolHandle...
public class MercatorUtils { /** * Resolution ( meters / pixel ) for given zoom level ( measured at Equator ) * @ param zoom zoomlevel . * @ param tileSize tile size . * @ return resolution . */ public static double getResolution ( int zoom , int tileSize ) { } }
// return ( 2 * Math . PI * 6378137 ) / ( this . tileSize * 2 * * zoom ) double initialResolution = 2 * Math . PI * 6378137 / tileSize ; return initialResolution / Math . pow ( 2 , zoom ) ;
public class EnableOnPhysicalHandler { /** * Called when a valid record is read from the table / query . * Enables or disables the target field ( s ) . * @ param bDisplayOption If true , display any changes . */ public void doValidRecord ( boolean bDisplayOption ) // Init this field override for other value { } }
Record record = this . getOwner ( ) ; BaseDatabase database = record . getTable ( ) . getDatabase ( ) ; m_bEnableOnValid = true ; int counter = ( int ) record . getCounterField ( ) . getValue ( ) ; String startingID = database . getProperty ( BaseDatabase . STARTING_ID ) ; String endingID = database . getProperty ( Bas...
public class ItemAttribute { /** * Returns the value of attribute * @ return the value */ @ JsonValue @ SuppressWarnings ( "unchecked" ) public < T > T get ( ) { } }
return ( T ) ( this . isString ? ( String ) this . value : ( Number ) this . value ) ;
public class OpMap { /** * Given a location step position , return the end position , i . e . the * beginning of the next step . * @ param opPos the position of a location step . * @ return the position of the next location step . */ public int getNextStepPos ( int opPos ) { } }
int stepType = getOp ( opPos ) ; if ( ( stepType >= OpCodes . AXES_START_TYPES ) && ( stepType <= OpCodes . AXES_END_TYPES ) ) { return getNextOpPos ( opPos ) ; } else if ( ( stepType >= OpCodes . FIRST_NODESET_OP ) && ( stepType <= OpCodes . LAST_NODESET_OP ) ) { int newOpPos = getNextOpPos ( opPos ) ; while ( OpCodes...
public class StopWord { /** * 判断一个词是否是停用词 * @ param word * @ return */ public static boolean is ( String word ) { } }
if ( word == null ) { return false ; } word = word . trim ( ) ; return isStopChar ( word ) || stopwords . contains ( word ) ;
public class DefaultGroovyMethods { /** * A convenience method for creating an immutable map . * @ param self a Map * @ return an immutable Map * @ see java . util . Collections # unmodifiableMap ( java . util . Map ) * @ since 1.0 */ public static < K , V > Map < K , V > asImmutable ( Map < ? extends K , ? ext...
return Collections . unmodifiableMap ( self ) ;
public class Section { /** * indexed setter for textObjects - sets an indexed value - the text objects ( figure , table , boxed text etc . ) that are associated with a particular section * @ generated * @ param i index in the array to set * @ param v value to set into the array */ public void setTextObjects ( int...
if ( Section_Type . featOkTst && ( ( Section_Type ) jcasType ) . casFeat_textObjects == null ) jcasType . jcas . throwFeatMissing ( "textObjects" , "de.julielab.jules.types.Section" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Section_Type ) jcasType ) . casFeatCode_textObjec...
public class InputElementStack { /** * Implementation of NamespaceContext : */ @ Override public final String getNamespaceURI ( String prefix ) { } }
if ( prefix == null ) { throw new IllegalArgumentException ( ErrorConsts . ERR_NULL_ARG ) ; } if ( prefix . length ( ) == 0 ) { if ( mDepth == 0 ) { // unexpected . . . but let ' s not err at this point /* 07 - Sep - 2007 , TSa : Default / " no namespace " does map to * " URI " of empty String . */ return XmlConsts ....
public class Index { /** * Gets the facets config . * @ return the facets config */ public static FacetsConfig getFacetsConfig ( ) { } }
final FacetsConfig ret = new FacetsConfig ( ) ; ret . setHierarchical ( Indexer . Dimension . DIMCREATED . name ( ) , true ) ; return ret ;
public class AWSStorageGatewayClient { /** * Updates a Server Message Block ( SMB ) file share . * < note > * To leave a file share field unchanged , set the corresponding input field to null . This operation is only * supported for file gateways . * < / note > < important > * File gateways require AWS Securi...
request = beforeClientExecution ( request ) ; return executeUpdateSMBFileShare ( request ) ;
public class SocketAdapter { /** * This method must be implemented for PoolableAdapter */ @ Override public Object openConnection ( ) throws ConnectionException , AdapterException { } }
try { int k = hostport . indexOf ( ':' ) ; if ( k < 0 ) throw new AdapterException ( "Invalid host:port specification - " + hostport ) ; connection = new SoccomClient ( hostport . substring ( 0 , k ) , Integer . parseInt ( hostport . substring ( k + 1 ) ) ) ; return connection ; } catch ( SoccomException e ) { if ( e ....
public class Utils { /** * NULL safe get ( ) */ public static < T > T get ( Map < ? , T > data , Object key ) { } }
return data == null ? null : data . get ( key ) ;
public class CustomShape { /** * 获取各个顶点的角度列表 */ private double [ ] getAngles ( double startAngle ) { } }
double [ ] angles = new double [ _corners ] ; angles [ 0 ] = startAngle ; // 角度的增量 double incremental = getAngleIncremental ( ) ; for ( int i = 1 ; i < _corners ; i ++ ) { angles [ i ] = angles [ i - 1 ] + incremental ; } return angles ;
public class TreeQuery { /** * Finds a child TreeNode based on its path . * Searches the child nodes for the first element , then that * node ' s children for the second element , etc . * @ param treeDefdefines a tree * @ param nodestarting point for the search * @ param treeMappermaps elements in the tree to...
return findByPath ( treeDef , node , path , ( treeSide , pathSide ) -> { return Objects . equals ( treeMapper . apply ( treeSide ) , pathMapper . apply ( pathSide ) ) ; } ) ;
public class SocketBar { /** * Returns the server inet address that accepted the request . */ public String getLocalHost ( ) { } }
InetAddress localAddress = addressLocal ( ) ; if ( localAddress != null ) return localAddress . getHostAddress ( ) ; else return null ;
public class Vector3f { /** * / * ( non - Javadoc ) * @ see org . joml . Vector3fc # cross ( float , float , float , org . joml . Vector3f ) */ public Vector3f cross ( float x , float y , float z , Vector3f dest ) { } }
float rx = this . y * z - this . z * y ; float ry = this . z * x - this . x * z ; float rz = this . x * y - this . y * x ; dest . x = rx ; dest . y = ry ; dest . z = rz ; return dest ;
public class ClientWindow { /** * < p class = " changed _ added _ 2_2 " > Methods that append the ClientWindow to generated * URLs must call this method to see if they are permitted to do so . If * { @ link # CLIENT _ WINDOW _ MODE _ PARAM _ NAME } is " url " without the quotes , all generated * URLs that cause a...
boolean result = false ; Map < Object , Object > attrMap = context . getAttributes ( ) ; result = ! attrMap . containsKey ( PER_USE_CLIENT_WINDOW_URL_QUERY_PARAMETER_DISABLED_KEY ) ; return result ;
public class StreamSegmentNameUtils { /** * Gets the name of the meta - Segment mapped to the given Segment Name that is responsible with storing its Rollover * information . * Existence of this file should also indicate that a Segment with this file has a rollover policy in place . * @ param segmentName The name...
Preconditions . checkArgument ( ! segmentName . endsWith ( HEADER_SUFFIX ) , "segmentName is already a segment header name" ) ; return segmentName + HEADER_SUFFIX ;
public class Configuration { public static final AlarmManager getAlarmManager ( ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getAlarmManager" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getAlarmManager" , _alarmManager ) ; return _alarmManager ;
public class MountPointInfo { /** * < code > optional string ufsType = 2 ; < / code > */ public java . lang . String getUfsType ( ) { } }
java . lang . Object ref = ufsType_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; if ( bs . isValidUtf8 ( ) ) { ufsType_ = s ; } retur...
public class Blade { /** * Add a delete route to routes * @ param path your route path * @ param handler route implement * @ return return blade instance */ public Blade delete ( @ NonNull String path , @ NonNull RouteHandler handler ) { } }
this . routeMatcher . addRoute ( path , handler , HttpMethod . DELETE ) ; return this ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcRoot ( ) { } }
if ( ifcRootEClass == null ) { ifcRootEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 498 ) ; } return ifcRootEClass ;
public class ORBManager { /** * Initialise the ORB * @ param useDb * is using tango db * @ param adminDeviceName * admin device name * @ throws DevFailed */ public static synchronized void init ( final boolean useDb , final String adminDeviceName ) throws DevFailed { } }
// Modified properties fo ORB usage . final Properties props = System . getProperties ( ) ; props . put ( "org.omg.CORBA.ORBClass" , "org.jacorb.orb.ORB" ) ; props . put ( "org.omg.CORBA.ORBSingletonClass" , "org.jacorb.orb.ORBSingleton" ) ; // register interceptors props . put ( "org.omg.PortableInterceptor.ORBInitial...
public class AstyanaxTableDAO { /** * Write the delta to the system table and invalidate caches in the specified scope . */ private void updateTableMetadata ( String table , Delta delta , Audit audit , @ Nullable InvalidationScope scope ) { } }
_backingStore . update ( _systemTable , table , TimeUUIDs . newUUID ( ) , delta , audit , scope == InvalidationScope . GLOBAL ? WriteConsistency . GLOBAL : WriteConsistency . STRONG ) ; // Synchronously notify other emodb servers of the table change . if ( scope != null ) { _tableCacheHandle . invalidate ( scope , tabl...
public class PutItemRequest { /** * One or more substitution tokens for attribute names in an expression . The following are some use cases for using * < code > ExpressionAttributeNames < / code > : * < ul > * < li > * To access an attribute whose name conflicts with a DynamoDB reserved word . * < / li > * ...
setExpressionAttributeNames ( expressionAttributeNames ) ; return this ;
public class responderpolicy_stats { /** * Use this API to fetch statistics of responderpolicy _ stats resource of given name . */ public static responderpolicy_stats get ( nitro_service service , String name ) throws Exception { } }
responderpolicy_stats obj = new responderpolicy_stats ( ) ; obj . set_name ( name ) ; responderpolicy_stats response = ( responderpolicy_stats ) obj . stat_resource ( service ) ; return response ;
public class LuceneUtil { /** * Check if the file is a segments _ N file * @ param name * @ return true if the file is a segments _ N file */ public static boolean isSegmentsFile ( String name ) { } }
return name . startsWith ( IndexFileNames . SEGMENTS ) && ! name . equals ( IndexFileNames . SEGMENTS_GEN ) ;
public class ModelUtils { /** * The binary name of the type as a String . * @ param typeElement The type element * @ return The class name */ String simpleBinaryNameFor ( TypeElement typeElement ) { } }
Name elementBinaryName = elementUtils . getBinaryName ( typeElement ) ; PackageElement packageElement = elementUtils . getPackageOf ( typeElement ) ; String packageName = packageElement . getQualifiedName ( ) . toString ( ) ; return elementBinaryName . toString ( ) . replaceFirst ( packageName + "\\." , "" ) ;
public class ConnectionContextFactory { /** * Creates a message producer using the context ' s session and destination . * @ param context the context where the new producer is stored * @ throws JMSException any error * @ throws IllegalStateException if the context is null or the context ' s session is null * o...
if ( context == null ) { throw new IllegalStateException ( "The context is null" ) ; } Session session = context . getSession ( ) ; if ( session == null ) { throw new IllegalStateException ( "The context had a null session" ) ; } Destination dest = context . getDestination ( ) ; if ( dest == null ) { throw new IllegalS...
public class FlowletProgramRunner { /** * Create a initializer to be executed during the flowlet driver initialization . */ private Service createServiceHook ( String flowletName , Iterable < ConsumerSupplier < ? > > consumerSuppliers , AtomicReference < FlowletProgramController > controller ) { } }
final List < String > streams = Lists . newArrayList ( ) ; for ( ConsumerSupplier < ? > consumerSupplier : consumerSuppliers ) { QueueName queueName = consumerSupplier . getQueueName ( ) ; if ( queueName . isStream ( ) ) { streams . add ( queueName . getSimpleName ( ) ) ; } } // If no stream , returns a no - op Service...
public class WorkspacePropertiesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( WorkspaceProperties workspaceProperties , ProtocolMarshaller protocolMarshaller ) { } }
if ( workspaceProperties == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( workspaceProperties . getRunningMode ( ) , RUNNINGMODE_BINDING ) ; protocolMarshaller . marshall ( workspaceProperties . getRunningModeAutoStopTimeoutInMinutes ( ) ,...
public class StAXDecoder { /** * Returns true if the cursor points to a character data event that consists * of all whitespace * ( non - Javadoc ) * @ see javax . xml . stream . XMLStreamReader # isWhiteSpace ( ) */ public boolean isWhiteSpace ( ) { } }
switch ( getEventType ( ) ) { case XMLStreamConstants . CHARACTERS : return this . characters . toString ( ) . trim ( ) . length ( ) == 0 ; case XMLStreamConstants . CDATA : return false ; case XMLStreamConstants . COMMENT : return false ; case XMLStreamConstants . SPACE : return true ; default : return false ; }
public class Calendar { /** * Returns a field mask indicating which calendar field values * to be used to calculate the time value . The calendar fields are * returned as a bit mask , each bit of which corresponds to a field , i . e . , * the mask value of < code > field < / code > is < code > ( 1 & lt ; & lt ; ...
// This implementation has been taken from the GregorianCalendar class . // The YEAR field must always be used regardless of its SET // state because YEAR is a mandatory field to determine the date // and the default value ( EPOCH _ YEAR ) may change through the // normalization process . int fieldMask = YEAR_MASK ; if...
public class DeleteGroupRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteGroupRequest deleteGroupRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteGroupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteGroupRequest . getGroupId ( ) , GROUPID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMes...
public class CommonsOJBLockManager { /** * Tries to acquire a lock on a resource . < br > * < br > * This method does not block , but immediatly returns . If a lock is not * available < code > false < / code > will be returned . * @ param ownerId a unique id identifying the entity that wants to acquire this *...
timeoutCheck ( ownerId ) ; OJBLock lock = atomicGetOrCreateLock ( resourceId , isolationId ) ; boolean acquired = lock . tryLock ( ownerId , targetLockLevel , reentrant ? GenericLock . COMPATIBILITY_REENTRANT : GenericLock . COMPATIBILITY_NONE , false ) ; if ( acquired ) { addOwner ( ownerId , lock ) ; } return acquire...
public class CreateTransitGatewayVpcAttachmentRequest { /** * The tags to apply to the VPC attachment . * @ param tagSpecifications * The tags to apply to the VPC attachment . */ public void setTagSpecifications ( java . util . Collection < TagSpecification > tagSpecifications ) { } }
if ( tagSpecifications == null ) { this . tagSpecifications = null ; return ; } this . tagSpecifications = new com . amazonaws . internal . SdkInternalList < TagSpecification > ( tagSpecifications ) ;
public class JarConfigurationProvider { /** * Registers the given set of property keys for the view with name * < code > propertyView < / code > and the given prefix of entities with the * given type . * @ param type the type of the entities for which the view will be * registered * @ param propertyView the n...
Map < String , Set < PropertyKey > > propertyViewMap = getPropertyViewMapForType ( type ) ; Set < PropertyKey > properties = propertyViewMap . get ( propertyView ) ; if ( properties == null ) { properties = new LinkedHashSet < > ( ) ; propertyViewMap . put ( propertyView , properties ) ; } // allow properties to overri...
public class SuspensionRecord { /** * Find all suspension records for a given user . * @ param em The EntityManager to use . * @ param user The user for which to retrieve records . * @ return A list of suspension records for the given user . An empty list if no such records exist . */ public static List < Suspens...
TypedQuery < SuspensionRecord > query = em . createNamedQuery ( "SuspensionRecord.findByUser" , SuspensionRecord . class ) ; try { query . setParameter ( "user" , user ) ; return query . getResultList ( ) ; } catch ( NoResultException ex ) { return new ArrayList < > ( 0 ) ; }
public class ConnectionSources { /** * A ConnectionSource that will wrap externally managed connection * with proxy that will omit { @ link Connection # close ( ) } or { @ link Connection # commit ( ) } calls . * This is useful to make { @ link org . sql2o . Connection } work with externally managed transactions ...
return new ConnectionSource ( ) { @ Override public Connection getConnection ( ) throws SQLException { return new NestedConnection ( connection ) ; } } ;
public class CoverageUtilities { /** * Utility method to get col and row of a coordinate from a { @ link GridGeometry2D } . * @ param coordinate the coordinate to transform . * @ param gridGeometry the gridgeometry to use . * @ param point if not < code > null < / code > , the row col values are put inside the su...
try { DirectPosition pos = new DirectPosition2D ( coordinate . x , coordinate . y ) ; GridCoordinates2D worldToGrid = gridGeometry . worldToGrid ( pos ) ; if ( point != null ) { point . x = worldToGrid . x ; point . y = worldToGrid . y ; } return new int [ ] { worldToGrid . x , worldToGrid . y } ; } catch ( InvalidGrid...
public class ThreadIdentityManager { /** * Add a ThreadIdentityService reference . This method is called by * ThreadIdentityManagerConfigurator when a ThreadIdentityService shows * up in the OSGI framework . * @ param tis */ public static void addThreadIdentityService ( ThreadIdentityService tis ) { } }
if ( tis != null ) { threadIdentityServices . add ( tis ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "A ThreadIdentityService implementation was added." , tis . getClass ( ) . getName ( ) ) ; } }
public class ProjectApi { /** * Get a Pager of project events for specific project . Sorted from newest to latest . * < pre > < code > GET / projects / : id / events < / code > < / pre > * @ param projectIdOrPath projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance , ...
return ( new Pager < Event > ( this , Event . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "events" ) ) ;
public class CommerceWishListPersistenceImpl { /** * Returns the last commerce wish list in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code...
CommerceWishList commerceWishList = fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; if ( commerceWishList != null ) { return commerceWishList ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", c...
public class AptControlInterface { /** * Returns the total number of operations for this control interface */ public int getEventSetCount ( ) { } }
int count = _eventSets . size ( ) ; if ( _superClass != null ) count += _superClass . getEventSetCount ( ) ; return count ;
public class PoolsImpl { /** * Lists all of the pools in the specified account . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; CloudPool & gt ; object */ public Observable < ServiceResponseWithHeaders < Page < CloudPool > , PoolListHea...
return listSinglePageAsync ( ) . concatMap ( new Func1 < ServiceResponseWithHeaders < Page < CloudPool > , PoolListHeaders > , Observable < ServiceResponseWithHeaders < Page < CloudPool > , PoolListHeaders > > > ( ) { @ Override public Observable < ServiceResponseWithHeaders < Page < CloudPool > , PoolListHeaders > > c...
public class ArraysUtil { /** * 2 - D Integer array to double array . * @ param array Integer array . * @ return Double array . */ public static double [ ] [ ] toDouble ( int [ ] [ ] array ) { } }
double [ ] [ ] n = new double [ array . length ] [ array [ 0 ] . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { for ( int j = 0 ; j < array [ 0 ] . length ; j ++ ) { n [ i ] [ j ] = ( double ) array [ i ] [ j ] ; } } return n ;
public class WorkflowClient { /** * Retrieve all running workflow instances for a given name and version * @ param workflowName the name of the workflow * @ param version the version of the wokflow definition . Defaults to 1. * @ return the list of running workflow instances */ public List < String > getRunningWo...
Preconditions . checkArgument ( StringUtils . isNotBlank ( workflowName ) , "Workflow name cannot be blank" ) ; WorkflowServicePb . GetRunningWorkflowsResponse workflows = stub . getRunningWorkflows ( WorkflowServicePb . GetRunningWorkflowsRequest . newBuilder ( ) . setName ( workflowName ) . setVersion ( version == nu...
public class XYPlotVisualization { /** * Setup the CSS classes for the plot . * @ param svgp Plot * @ param plot Plot to render */ private void setupCSS ( VisualizerContext context , SVGPlot svgp , XYPlot plot ) { } }
StyleLibrary style = context . getStyleLibrary ( ) ; for ( XYPlot . Curve curve : plot ) { CSSClass csscls = new CSSClass ( this , SERIESID + curve . getColor ( ) ) ; // csscls . setStatement ( SVGConstants . SVG _ STROKE _ WIDTH _ ATTRIBUTE , " 0.2 % " ) ; csscls . setStatement ( SVGConstants . SVG_FILL_ATTRIBUTE , SV...
public class EqualityInference { /** * Determines whether an Expression may be successfully applied to the equality inference */ public static Predicate < Expression > isInferenceCandidate ( ) { } }
return expression -> { expression = normalizeInPredicateToEquality ( expression ) ; if ( expression instanceof ComparisonExpression && isDeterministic ( expression ) && ! mayReturnNullOnNonNullInput ( expression ) ) { ComparisonExpression comparison = ( ComparisonExpression ) expression ; if ( comparison . getOperator ...
public class SortableHeaderRenderer { /** * Get the ascending / descending icon . */ protected Icon getHeaderRendererIcon ( boolean bCurrentOrder ) { } }
// Get current classloader ClassLoader cl = this . getClass ( ) . getClassLoader ( ) ; // Create icons try { if ( ASCENDING_ICON == null ) { ASCENDING_ICON = new ImageIcon ( cl . getResource ( "images/buttons/" + ASCENDING_ICON_NAME + ".gif" ) ) ; DESCENDING_ICON = new ImageIcon ( cl . getResource ( "images/buttons/" +...
public class DebugSubstance { /** * { @ inheritDoc } */ @ Override public Double getMultiplier ( IAtomContainer container ) { } }
logger . debug ( "Getting multiplier for atom container: " , container ) ; return super . getMultiplier ( container ) ;
public class L1CacheRepositoryDecorator { /** * Evict all entries for entity types referred to by this entity type through a bidirectional * relation . */ private void evictBiDiReferencedEntityTypes ( ) { } }
getEntityType ( ) . getMappedByAttributes ( ) . map ( Attribute :: getRefEntity ) . forEach ( l1Cache :: evictAll ) ; getEntityType ( ) . getInversedByAttributes ( ) . map ( Attribute :: getRefEntity ) . forEach ( l1Cache :: evictAll ) ;
public class AbstractGuacamoleTunnelService { /** * Creates a tunnel for the given user which connects to the given * connection , which MUST already be acquired via acquire ( ) . The given * client information will be passed to guacd when the connection is * established . * The connection will be automatically...
// Record new active connection Runnable cleanupTask = new ConnectionCleanupTask ( activeConnection ) ; activeTunnels . put ( activeConnection . getUUID ( ) . toString ( ) , activeConnection ) ; try { GuacamoleConfiguration config ; // Retrieve connection information associated with given connection record ModeledConne...
public class AmazonElasticLoadBalancingClient { /** * Deregisters the specified targets from the specified target group . After the targets are deregistered , they no * longer receive traffic from the load balancer . * @ param deregisterTargetsRequest * @ return Result of the DeregisterTargets operation returned ...
request = beforeClientExecution ( request ) ; return executeDeregisterTargets ( request ) ;
public class JDBCDriverService { /** * Declarative Services method for unsetting the SharedLibrary service * @ param lib the service */ protected void unsetSharedLib ( Library lib ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "unsetSharedLib" , lib ) ; modified ( null , false ) ;
public class AbstractTaggerTrainer { /** * ( non - Javadoc ) * @ see es . ehu . si . ixa . pipe . pos . train . Trainer # train ( opennlp . tools . util . * TrainingParameters ) */ public final POSModel train ( final TrainingParameters params ) { } }
// features if ( getPosTaggerFactory ( ) == null ) { throw new IllegalStateException ( "Classes derived from AbstractTrainer must " + " create a POSTaggerFactory features!" ) ; } // training model POSModel trainedModel = null ; POSEvaluator posEvaluator = null ; try { trainedModel = POSTaggerME . train ( this . lang , ...
public class CncOrd { /** * < p > It cancels all given buyer ' s orders . * For example buyer had not paid online after accepting ( booking ) orders . * It changes item ' s availability and orders status to given NEW or CANCELED . * @ param pRqVs additional request scoped parameters * @ param pBuyr buyer * @ ...
List < CustOrder > ords = null ; List < CuOrSe > sords = null ; String tbn = CustOrder . class . getSimpleName ( ) ; String wheStBr = "where STAT=" + pStFr . ordinal ( ) + " and BUYER=" + pBuyr . getItsId ( ) + " and PUR=" + pPurId ; Set < String > ndFlNm = new HashSet < String > ( ) ; ndFlNm . add ( "itsId" ) ; ndFlNm...
public class OFFDumpRetriever { /** * Untar an input file into an output file . * The output file is created in the output folder , having the same name * as the input file , minus the ' . tar ' extension . * @ param inputFile the input . tar file * @ param outputDir the output directory file . * @ throws IOE...
_log . info ( String . format ( "Untaring %s to dir %s." , inputFile . getAbsolutePath ( ) , outputDir . getAbsolutePath ( ) ) ) ; final List < File > untaredFiles = new LinkedList < File > ( ) ; final InputStream is = new FileInputStream ( inputFile ) ; final TarArchiveInputStream debInputStream = ( TarArchiveInputStr...
public class MinimalMetaBean { /** * Obtains an instance of the meta - bean for immutable beans . * The properties will be determined using reflection to find the * { @ link PropertyDefinition } annotation . * @ param < B > the type of the bean * @ param beanType the bean type , not null * @ param builderSupp...
if ( getters == null ) { throw new NullPointerException ( "Getter functions must not be null" ) ; } return new MinimalMetaBean < > ( beanType , fieldNames ( beanType ) , builderSupplier , Arrays . asList ( getters ) , null ) ;