signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class StringHelper { /** * Optimized replace method that replaces a set of characters with another
* character . This method was created for efficient unsafe character
* replacements !
* @ param sInputString
* The input string .
* @ param aSearchChars
* The characters to replace .
* @ param cReplac... | ValueEnforcer . notNull ( aSearchChars , "SearchChars" ) ; if ( hasNoText ( sInputString ) ) return "" ; final StringBuilder aSB = new StringBuilder ( sInputString . length ( ) ) ; replaceMultipleTo ( sInputString , aSearchChars , cReplacementChar , aSB ) ; return aSB . toString ( ) ; |
public class HttpChannelConfig { /** * Parse the header change limit property .
* @ param props */
private void parseHeaderChangeLimit ( Map < Object , Object > props ) { } } | Object value = props . get ( HttpConfigConstants . PROPNAME_HEADER_CHANGE_LIMIT ) ; if ( null != value ) { try { this . headerChangeLimit = convertInteger ( value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Config: header change limit is " + getHeaderChangeLimit (... |
public class DeployClient { /** * Converts a POSIX compliant program argument array to a String - to - String Map .
* @ param args Array of Strings where each element is a POSIX compliant program argument ( Ex : " - - os = Linux " ) .
* @ return Map of argument Keys and Values ( Ex : Key = " os " and Value = " Linu... | Map < String , String > kvMap = Maps . newHashMap ( ) ; for ( String arg : args ) { kvMap . putAll ( Splitter . on ( "--" ) . omitEmptyStrings ( ) . trimResults ( ) . withKeyValueSeparator ( "=" ) . split ( arg ) ) ; } return kvMap ; |
public class RemoteUserSettingFilter { /** * / * ( non - Javadoc )
* @ see javax . servlet . Filter # doFilter ( javax . servlet . ServletRequest , javax . servlet . ServletResponse , javax . servlet . FilterChain ) */
@ Override public void doFilter ( ServletRequest request , ServletResponse response , FilterChain c... | final String remoteUser = StringUtils . trimToNull ( FileUtils . readFileToString ( this . remoteUserFile ) ) ; if ( remoteUser != null ) { request = new HttpServletRequestWrapper ( ( HttpServletRequest ) request ) { /* ( non - Javadoc )
* @ see javax . servlet . http . HttpServletRequestWrapper # getRemoteUser ( ) *... |
public class EventDispatcherBase { /** * Gets the thread type used in log message for the given queue selector .
* @ param queueSelector The queue selector .
* @ return The name of the thread type . */
private String getThreadType ( DispatchQueueSelector queueSelector ) { } } | String threadType ; if ( queueSelector instanceof DiscordApi ) { threadType = "a global listener thread" ; } else if ( queueSelector == null ) { threadType = "a connection listener thread" ; } else { threadType = String . format ( "a listener thread for %s" , queueSelector ) ; } return threadType ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.drugbank.ca" , name = "protein-name" , scope = SnpAdverseDrugReactionType . class ) public JAXBElement < String > createSnpAdverseDrugReactionTypePr... | return new JAXBElement < String > ( _SnpAdverseDrugReactionTypeProteinName_QNAME , String . class , SnpAdverseDrugReactionType . class , value ) ; |
public class ProcessUtils { /** * Logs a fatal error and then exits the system .
* @ param logger the logger to log to
* @ param format the error message format string
* @ param args args for the format string */
public static void fatalError ( Logger logger , String format , Object ... args ) { } } | fatalError ( logger , null , format , args ) ; |
public class ComponentTagDeclarationLibrary { /** * Add a ComponentHandler with the specified componentType and rendererType , aliased by the tag name .
* @ see ComponentHandler
* @ see javax . faces . application . Application # createComponent ( java . lang . String )
* @ param name
* name to use , " foo " wo... | Map < String , TagHandlerFactory > map = _factories . get ( namespace ) ; if ( map == null ) { map = new HashMap < String , TagHandlerFactory > ( ) ; _factories . put ( namespace , map ) ; } map . put ( name , new ComponentHandlerFactory ( componentType , rendererType ) ) ; |
public class CoreActivity { /** * Determines the response encoding .
* @ return the response encoding */
protected String resolveResponseEncoding ( ) { } } | String encoding = getRequestRule ( ) . getEncoding ( ) ; if ( encoding == null ) { encoding = resolveRequestEncoding ( ) ; } return encoding ; |
public class ReflectUtil { /** * 获得指定类过滤后的Public方法列表
* @ param clazz 查找方法的类
* @ param excludeMethodNames 不包括的方法名列表
* @ return 过滤后的方法列表 */
public static List < Method > getPublicMethods ( Class < ? > clazz , String ... excludeMethodNames ) { } } | final HashSet < String > excludeMethodNameSet = CollectionUtil . newHashSet ( excludeMethodNames ) ; return getPublicMethods ( clazz , new Filter < Method > ( ) { @ Override public boolean accept ( Method method ) { return false == excludeMethodNameSet . contains ( method . getName ( ) ) ; } } ) ; |
public class AbstractGenerator { /** * Add collection of pages to sitemap
* @ param < T > This is the type parameter
* @ param webPages Collection of pages
* @ param mapper Mapper function which transforms some object to String . This will be passed to WebPage . of ( name )
* @ return this */
public < T > I add... | for ( T element : webPages ) { addPage ( WebPage . of ( mapper . apply ( element ) ) ) ; } return getThis ( ) ; |
public class lbmonitor { /** * Use this API to fetch lbmonitor resource of given name . */
public static lbmonitor get ( nitro_service service , String monitorname ) throws Exception { } } | lbmonitor obj = new lbmonitor ( ) ; obj . set_monitorname ( monitorname ) ; lbmonitor response = ( lbmonitor ) obj . get_resource ( service ) ; return response ; |
public class EditShape { /** * Removes a path , gets rid of all its vertices , and returns the next one */
int removePath ( int path ) { } } | int prev = getPrevPath ( path ) ; int next = getNextPath ( path ) ; int geometry = getGeometryFromPath ( path ) ; if ( prev != - 1 ) setNextPath_ ( prev , next ) ; else { setFirstPath_ ( geometry , next ) ; } if ( next != - 1 ) setPrevPath_ ( next , prev ) ; else { setLastPath_ ( geometry , prev ) ; } clearPath ( path ... |
public class ThreadSettingsApi { /** * Sets the payment public key . The payment _ public _ key is used to encrypt
* sensitive payment data sent to you .
* @ param publicKey
* the public key to set .
* @ see < a href =
* " https : / / developers . facebook . com / docs / messenger - platform / thread - settin... | PaymentSettings request = new PaymentSettings ( ) ; request . setPrivacyUrl ( publicKey ) ; FbBotMillNetworkController . postThreadSetting ( request ) ; |
public class Nodes { /** * Gets the name of the given property in JCR domain .
* @ param cmisName the name of the given property in CMIS domain .
* @ return the name of the given property in JCR domain . */
public String findJcrName ( String cmisName ) { } } | for ( Relation aList : list ) { if ( aList . cmisName . equals ( cmisName ) ) { return aList . jcrName ; } } return cmisName ; |
public class ULocale { /** * Returns the given ( canonical ) locale id minus the last part before the tags . */
private static String getFallbackString ( String fallback ) { } } | int extStart = fallback . indexOf ( '@' ) ; if ( extStart == - 1 ) { extStart = fallback . length ( ) ; } int last = fallback . lastIndexOf ( '_' , extStart ) ; if ( last == - 1 ) { last = 0 ; } else { // truncate empty segment
while ( last > 0 ) { if ( fallback . charAt ( last - 1 ) != '_' ) { break ; } last -- ; } } ... |
public class LongStream { /** * Takes elements while the predicate returns { @ code true } .
* < p > This is an intermediate operation .
* < p > Example :
* < pre >
* predicate : ( a ) - & gt ; a & lt ; 3
* stream : [ 1 , 2 , 3 , 4 , 1 , 2 , 3 , 4]
* result : [ 1 , 2]
* < / pre >
* @ param predicate the... | return new LongStream ( params , new LongTakeWhile ( iterator , predicate ) ) ; |
public class StringGroovyMethods { /** * TODO expose this for other usage scenarios , e . g . stream based stripping ? */
private static String stripMarginFromLine ( String line , char marginChar ) { } } | int length = line . length ( ) ; int index = 0 ; while ( index < length && line . charAt ( index ) <= ' ' ) index ++ ; return ( index < length && line . charAt ( index ) == marginChar ) ? line . substring ( index + 1 ) : line ; |
public class AffineTransformation { /** * Add a matrix operation to the matrix .
* Be careful to use only invertible matrices if you want an invertible affine
* transformation .
* @ param m matrix ( should be invertible ) */
public void addMatrix ( double [ ] [ ] m ) { } } | assert ( m . length == dim ) ; assert ( m [ 0 ] . length == dim ) ; // reset inverse transformation - needs recomputation .
inv = null ; // extend the matrix with an extra row and column
double [ ] [ ] ht = new double [ dim + 1 ] [ dim + 1 ] ; for ( int i = 0 ; i < dim ; i ++ ) { for ( int j = 0 ; j < dim ; j ++ ) { ht... |
public class BatchGetItemRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BatchGetItemRequest batchGetItemRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( batchGetItemRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchGetItemRequest . getRequestItems ( ) , REQUESTITEMS_BINDING ) ; protocolMarshaller . marshall ( batchGetItemRequest . getReturnConsumedCapacity ( ) , RETURNCONS... |
public class CmsXmlContentEditor { /** * Adds an optional element to the XML content or removes an optional element from the XML content . < p >
* Depends on the given action value . < p >
* @ throws JspException if including the error page fails */
public void actionToggleElement ( ) throws JspException { } } | // set editor values from request
try { setEditorValues ( getElementLocale ( ) ) ; } catch ( CmsXmlException e ) { // an error occurred while trying to set the values , stop action
showErrorPage ( e ) ; return ; } // get the necessary parameters to add / remove the element
int index = 0 ; try { index = Integer . parseI... |
public class RunsInner { /** * Gets all the runs for a registry .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ retu... | return listWithServiceResponseAsync ( resourceGroupName , registryName ) . map ( new Func1 < ServiceResponse < Page < RunInner > > , Page < RunInner > > ( ) { @ Override public Page < RunInner > call ( ServiceResponse < Page < RunInner > > response ) { return response . body ( ) ; } } ) ; |
public class RetryUtil { /** * 重试直到无异常抛出或者超过最大重试次数 */
public static < Return > Return retryUntilNoException ( Callable < Return > callable , int maxTry ) throws Throwable { } } | String errMsg = "连续重试失败" + maxTry + "次。" ; Throwable cause = null ; while ( maxTry > 0 ) { try { return callable . call ( ) ; } catch ( Throwable throwable ) { cause = throwable ; maxTry -- ; } } LOG . error ( new Throwable ( errMsg , cause ) ) ; throw cause ; |
public class JodaBeanSer { /** * Checks if the property is serialized .
* @ param prop the property to check
* @ return true if the property is seialized */
public boolean isSerialized ( MetaProperty < ? > prop ) { } } | return prop . style ( ) . isSerializable ( ) || ( prop . style ( ) . isDerived ( ) && includeDerived ) ; |
public class Level { /** * CHECKSTYLE : ON */
@ Override public int compareTo ( final Level other ) { } } | return intLevel < other . intLevel ? - 1 : ( intLevel > other . intLevel ? 1 : 0 ) ; |
public class HTCashbillServiceImp { /** * ( non - Javadoc )
* @ see com . popbill . api . HTCashbillService # Summary ( java . lang . String , java . lang . String , java . lang . String [ ] , java . lang . String [ ] , java . lang . String ) */
@ Override public HTCashbillSummary summary ( String CorpNum , String Jo... | if ( JobID . length ( ) != 18 ) throw new PopbillException ( - 99999999 , "작업아이디가 올바르지 않습니다." ) ; String uri = "/HomeTax/Cashbill/" + JobID + "/Summary" ; uri += "?TradeUsage=" + Arrays . toString ( TradeUsage ) . replaceAll ( "\\[|\\]|\\s" , "" ) ; uri += "&TradeType=" + Arrays . toString ( TradeType ) . replaceAll ( ... |
public class AbstractArrayBytesBuff { /** * 检查当前数组某区块是否超出范围
* @ param index
* @ param fieldLength */
void checkIndex ( int index , int fieldLength ) { } } | if ( isOutOfBounds ( index , fieldLength , capacity ( ) ) ) { throw new IndexOutOfBoundsException ( String . format ( "index: %d, length: %d (expected: range(0, %d))" , index , fieldLength , capacity ( ) ) ) ; } |
public class CmsRole { /** * Creates a new role based on this one for the given organizational unit . < p >
* @ param ouFqn fully qualified name of the organizational unit
* @ return a new role based on this one for the given organizational unit */
public CmsRole forOrgUnit ( String ouFqn ) { } } | CmsRole newRole = new CmsRole ( this ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( ouFqn ) ) { if ( ! ouFqn . endsWith ( CmsOrganizationalUnit . SEPARATOR ) ) { ouFqn += CmsOrganizationalUnit . SEPARATOR ; } } newRole . m_ouFqn = ouFqn ; return newRole ; |
public class BugInstance { /** * Add a source line annotation for instruction whose PC is given in the
* method that the given visitor is currently visiting . Note that if the
* method does not have line number information , then no source line
* annotation will be added .
* @ param classContext
* the ClassCo... | SourceLineAnnotation sourceLineAnnotation = SourceLineAnnotation . fromVisitedInstruction ( classContext , visitor , pc ) ; if ( sourceLineAnnotation != null ) { add ( sourceLineAnnotation ) ; } return this ; |
public class DefaultContainerBuilder { /** * if there are xml configure then add new ones ; if not , register it ;
* @ param configList
* Collection the configure collection for jdonframework . xml */
public void registerAppRoot ( String configureFileName ) throws Exception { } } | try { AppConfigureCollection existedAppConfigureFiles = ( AppConfigureCollection ) containerWrapper . lookup ( AppConfigureCollection . NAME ) ; if ( existedAppConfigureFiles == null ) { xmlcontainerRegistry . registerAppRoot ( ) ; existedAppConfigureFiles = ( AppConfigureCollection ) containerWrapper . lookup ( AppCon... |
public class ComposedTransformer { /** * { @ inheritDoc } */
@ Override protected Object primTransform ( Object anObject ) throws Exception { } } | Object current = anObject ; for ( Transformer transformer : this . transformers ) { current = transformer . transform ( current ) ; } return current ; |
public class AbstractConnectProtocol { /** * Connect to currentHost .
* @ throws SQLException exception */
public void connect ( ) throws SQLException { } } | if ( ! isClosed ( ) ) { close ( ) ; } try { connect ( ( currentHost != null ) ? currentHost . host : null , ( currentHost != null ) ? currentHost . port : 3306 ) ; } catch ( IOException ioException ) { throw ExceptionMapper . connException ( "Could not connect to " + currentHost + ". " + ioException . getMessage ( ) + ... |
public class ByteList { /** * This is equivalent to :
* < pre >
* < code >
* if ( isEmpty ( ) ) {
* return OptionalByte . empty ( ) ;
* byte result = elementData [ 0 ] ;
* for ( int i = 1 ; i < size ; i + + ) {
* result = accumulator . applyAsByte ( result , elementData [ i ] ) ;
* return OptionalByte .... | if ( isEmpty ( ) ) { return OptionalByte . empty ( ) ; } byte result = elementData [ 0 ] ; for ( int i = 1 ; i < size ; i ++ ) { result = accumulator . applyAsByte ( result , elementData [ i ] ) ; } return OptionalByte . of ( result ) ; |
public class COSDataBlocks { /** * Create a factory .
* @ param owner factory owner
* @ param name factory name - the option from { @ link Constants }
* @ return the factory , ready to be initialized
* @ throws IllegalArgumentException if the name is unknown */
static BlockFactory createFactory ( COSAPIClient o... | switch ( name ) { case COSConstants . FAST_UPLOAD_BUFFER_ARRAY : return new ArrayBlockFactory ( owner ) ; case COSConstants . FAST_UPLOAD_BUFFER_DISK : return new DiskBlockFactory ( owner ) ; default : throw new IllegalArgumentException ( "Unsupported block buffer" + " \"" + name + '"' ) ; } |
public class Functionals { /** * Converts a runnable instance into an Action0 instance .
* @ param run the Runnable to run when the Action0 is called
* @ return the Action0 wrapping the Runnable */
public static Action0 fromRunnable ( Runnable run , Worker inner ) { } } | if ( run == null ) { throw new NullPointerException ( "run" ) ; } return new ActionWrappingRunnable ( run , inner ) ; |
public class CommerceAddressLocalServiceUtil { /** * Deletes the commerce address from the database . Also notifies the appropriate model listeners .
* @ param commerceAddress the commerce address
* @ return the commerce address that was removed
* @ throws PortalException */
public static com . liferay . commerce... | return getService ( ) . deleteCommerceAddress ( commerceAddress ) ; |
public class CloudSdkDownloader { /** * Downloads / installs / updates the Cloud SDK
* @ return The cloud SDK installation directory */
public Path downloadIfNecessary ( String version , Log log , boolean requiresAppEngineComponents , boolean offline ) { } } | ManagedCloudSdk managedCloudSdk = managedCloudSdkFactory . apply ( version ) ; if ( offline ) { // in offline mode , don ' t download anything
return managedCloudSdk . getSdkHome ( ) ; } try { ProgressListener progressListener = new NoOpProgressListener ( ) ; ConsoleListener consoleListener = new CloudSdkDownloaderCons... |
public class Currency { /** * Returns the list of remaining tender currencies after a filter is applied .
* @ param filter the filter to apply to the tender currencies
* @ return a list of tender currencies */
private static List < String > getTenderCurrencies ( CurrencyFilter filter ) { } } | CurrencyMetaInfo info = CurrencyMetaInfo . getInstance ( ) ; return info . currencies ( filter . withTender ( ) ) ; |
public class AvroYarnJobSubmissionParametersSerializer { /** * Reads avro object from file .
* @ param file The file to read from
* @ return Avro object
* @ throws IOException */
AvroYarnJobSubmissionParameters fromFile ( final File file ) throws IOException { } } | try ( final FileInputStream fileInputStream = new FileInputStream ( file ) ) { // This is mainly a test hook .
return fromInputStream ( fileInputStream ) ; } |
public class MyStringUtils { /** * Gets the first group of a regex
* @ param pattern Pattern
* @ param str String to find
* @ return the matching group */
public static String regexFindFirst ( String pattern , String str ) { } } | return regexFindFirst ( Pattern . compile ( pattern ) , str , 1 ) ; |
public class BoxSession { /** * Called when this session has been refreshed with new authentication info .
* @ param info the latest info from a successful refresh . */
@ Override public void onRefreshed ( BoxAuthentication . BoxAuthenticationInfo info ) { } } | if ( sameUser ( info ) ) { BoxAuthentication . BoxAuthenticationInfo . cloneInfo ( mAuthInfo , info ) ; if ( sessionAuthListener != null ) { sessionAuthListener . onRefreshed ( info ) ; } } |
public class JsonResponse { public OptionalThing < Class < ? > [ ] > getValidatorGroups ( ) { } } | return OptionalThing . ofNullable ( validatorGroups , ( ) -> { String msg = "Not found the validator groups: " + JsonResponse . this . toString ( ) ; throw new IllegalStateException ( msg ) ; } ) ; |
public class TaskExecutor { @ Override public void onStart ( ) throws Exception { } } | try { startTaskExecutorServices ( ) ; } catch ( Exception e ) { final TaskManagerException exception = new TaskManagerException ( String . format ( "Could not start the TaskExecutor %s" , getAddress ( ) ) , e ) ; onFatalError ( exception ) ; throw exception ; } startRegistrationTimeout ( ) ; |
public class ProfilingDriver { /** * Register a duration in milliseconds for running a JDBC method .
* @ param group indication of type of command .
* @ param durationMillis duration in milliseconds */
static void register ( String group , long durationMillis ) { } } | for ( ProfilingListener listener : LISTENERS ) { listener . register ( group , durationMillis ) ; } |
public class ElementsTable { /** * Returns the module documentation level mode .
* @ return the module documentation level mode */
public ModuleMode getModuleMode ( ) { } } | switch ( accessFilter . getAccessValue ( ElementKind . MODULE ) ) { case PACKAGE : case PRIVATE : return DocletEnvironment . ModuleMode . ALL ; default : return DocletEnvironment . ModuleMode . API ; } |
public class BinaryReader { /** * Read a short from the input stream .
* @ return The number read .
* @ throws IOException if unable to read from stream . */
public short expectShort ( ) throws IOException { } } | int b1 = in . read ( ) ; if ( b1 < 0 ) { throw new IOException ( "Missing byte 1 to expected short" ) ; } int b2 = in . read ( ) ; if ( b2 < 0 ) { throw new IOException ( "Missing byte 2 to expected short" ) ; } return ( short ) unshift2bytes ( b1 , b2 ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcClassificationReference ( ) { } } | if ( ifcClassificationReferenceEClass == null ) { ifcClassificationReferenceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 97 ) ; } return ifcClassificationReferenceEClass ; |
public class JPEGDecoder { /** * Decodes the dequantizied DCT coefficients into a buffer per color component .
* The number of buffers must match the number of color channels .
* Each color channel can have a different sub sampling factor .
* @ param buffer the ShortBuffers for each color component
* @ param nu... | if ( ! insideSOS ) { throw new IllegalStateException ( "decode not started" ) ; } if ( numMCURows <= 0 || currentMCURow + numMCURows > mcuCountY ) { throw new IllegalArgumentException ( "numMCURows" ) ; } int scanN = order . length ; if ( scanN != components . length ) { throw new UnsupportedOperationException ( "for R... |
public class NavigationPreference { /** * Obtains the fragment from a specific typed array .
* @ param typedArray
* The typed array , the fragment should be obtained from , as an instance of the class
* { @ link TypedArray } . The typed array may not be null */
private void obtainFragment ( @ NonNull final TypedA... | setFragment ( typedArray . getString ( R . styleable . NavigationPreference_android_fragment ) ) ; |
public class HBaseClient { /** * Method to find entities using JPQL ( converted into FilterList . )
* @ param < E >
* parameterized entity class .
* @ param entityClass
* entity class .
* @ param metadata
* entity metadata .
* @ param f
* the f
* @ param filterClausequeue
* the filter clausequeue
... | EntityMetadata entityMetadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entityClass ) ; List < String > relationNames = entityMetadata . getRelationNames ( ) ; // columnFamily has a different meaning for HBase , so it won ' t be used
// here
String tableName = entityMetadata . getSchema ( ) ; Lis... |
public class ActiveConnectionMultimap { /** * Stores the given connection record in the list of active connections
* associated with the object having the given identifier .
* @ param identifier
* The identifier of the object being connected to .
* @ param record
* The record associated with the active connec... | synchronized ( records ) { // Get set of active connection records , creating if necessary
Set < ActiveConnectionRecord > connections = records . get ( identifier ) ; if ( connections == null ) { connections = Collections . synchronizedSet ( Collections . newSetFromMap ( new LinkedHashMap < ActiveConnectionRecord , Boo... |
public class IPv6AddressSection { /** * Applies the given mask to the network section of the address as indicated by the given prefix length .
* Useful for subnetting . Once you have zeroed a section of the network you can insert bits
* using { @ link # bitwiseOr ( IPv6AddressSection ) } or { @ link # replace ( int... | checkMaskSectionCount ( mask ) ; if ( getNetwork ( ) . getPrefixConfiguration ( ) . allPrefixedAddressesAreSubnets ( ) ) { return getSubnetSegments ( this , cacheBits ( networkPrefixLength ) , getAddressCreator ( ) , true , this :: getSegment , i -> mask . getSegment ( i ) . getSegmentValue ( ) , false ) ; } IPv6Addres... |
public class CoverageData { /** * Get the coverage data tile results for a specified tile matrix
* @ param requestProjectedBoundingBox
* request projected bounding box
* @ param tileMatrix
* tile matrix
* @ param overlappingPixels
* number of overlapping pixels used by the algorithm
* @ return tile matrix... | CoverageDataTileMatrixResults results = null ; BoundingBox paddedBoundingBox = padBoundingBox ( tileMatrix , requestProjectedBoundingBox , overlappingPixels ) ; TileResultSet tileResults = retrieveSortedTileResults ( paddedBoundingBox , tileMatrix ) ; if ( tileResults != null ) { if ( tileResults . getCount ( ) > 0 ) {... |
public class ObjectStreamClass { /** * Return a String representing the signature for a method { @ code m } .
* @ param m
* a java . lang . reflect . Method for which to compute the signature
* @ return the method ' s signature */
static String getMethodSignature ( Method m ) { } } | StringBuilder result = new StringBuilder ( ) ; result . append ( '(' ) ; for ( Class < ? > parameterType : m . getParameterTypes ( ) ) { result . append ( getSignature ( parameterType ) ) ; } result . append ( ")" ) ; result . append ( getSignature ( m . getReturnType ( ) ) ) ; return result . toString ( ) ; |
public class InferenceSpecification { /** * A list of the instance types that are used to generate inferences in real - time .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSupportedRealtimeInferenceInstanceTypes ( java . util . Collection ) } or
* { @... | if ( this . supportedRealtimeInferenceInstanceTypes == null ) { setSupportedRealtimeInferenceInstanceTypes ( new java . util . ArrayList < String > ( supportedRealtimeInferenceInstanceTypes . length ) ) ; } for ( String ele : supportedRealtimeInferenceInstanceTypes ) { this . supportedRealtimeInferenceInstanceTypes . a... |
public class RedundentExprEliminator { /** * Add the given variable to the psuedoVarRecipient . */
protected ElemVariable addVarDeclToElem ( ElemTemplateElement psuedoVarRecipient , LocPathIterator lpi , ElemVariable psuedoVar ) throws org . w3c . dom . DOMException { } } | // Create psuedo variable element
ElemTemplateElement ete = psuedoVarRecipient . getFirstChildElem ( ) ; lpi . callVisitors ( null , m_varNameCollector ) ; // If the location path contains variables , we have to insert the
// psuedo variable after the reference . ( Otherwise , we want to
// insert it as close as possib... |
public class ObjectEnvelopeTable { /** * This method have to be called to reuse all registered { @ link ObjectEnvelope }
* objects after transaction commit / flush / checkpoint call . */
private void prepareForReuse ( boolean reuse ) { } } | if ( reuse ) { // using clone to avoid ConcurentModificationException
Iterator iter = ( ( List ) mvOrderOfIds . clone ( ) ) . iterator ( ) ; while ( iter . hasNext ( ) ) { ObjectEnvelope mod = ( ObjectEnvelope ) mhtObjectEnvelopes . get ( iter . next ( ) ) ; if ( ! needsCommit || ( mod . getModificationState ( ) == Sta... |
public class WasInvalidatedBy { /** * Gets the value of the role property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is why there is not a < CODE > set < / CODE > me... | if ( role == null ) { role = AttributeList . populateKnownAttributes ( this , all , org . openprovenance . prov . model . Role . class ) ; } return this . role ; |
public class ConvolveImageNormalized { /** * Performs a 2D normalized convolution across the image .
* @ param src The original image . Not modified .
* @ param dst Where the resulting image is written to . Modified .
* @ param kernel The kernel that is being convolved . Not modified . */
public static void convo... | InputSanityCheck . checkSameShapeB ( src , dst ) ; boolean processed = BOverrideConvolveImageNormalized . invokeNativeConvolve ( kernel , src , dst ) ; if ( ! processed ) { if ( kernel . width >= src . width || kernel . width >= src . height ) { ConvolveNormalizedNaive_IL . convolve ( kernel , src , dst ) ; } else { Co... |
public class Dart { /** * Inject fields annotated with { @ link BindExtra } in the specified { @ code target } using the { @ code
* source } { @ link android . os . Bundle } as the source .
* @ param target Target class for field binding .
* @ param source Bundle source on which extras will be looked up .
* @ t... | bindNavigationModel ( target , source , Finder . BUNDLE ) ; |
public class ResourceConverter { /** * Deserializes a < a href = " http : / / jsonapi . org / format / # document - links " > JSON - API links object < / a > to a { @ code Map }
* keyed by the link name .
* The { @ code linksObject } may represent links in string form or object form ; both are supported by this met... | Map < String , Link > result = new HashMap < > ( ) ; Iterator < Map . Entry < String , JsonNode > > linkItr = linksObject . fields ( ) ; while ( linkItr . hasNext ( ) ) { Map . Entry < String , JsonNode > linkNode = linkItr . next ( ) ; Link linkObj = new Link ( ) ; linkObj . setHref ( getLink ( linkNode . getValue ( )... |
public class LinearSearch { /** * Search for the maximum element in the array .
* @ param < E > the type of elements in this array .
* @ param array array that we are searching in .
* @ return the maximum element in the array . */
public static < E extends Comparable < E > > E searchMax ( E [ ] array ) { } } | if ( array . length == 0 ) { throw new IllegalArgumentException ( "The array you provided does not have any elements" ) ; } E max = array [ 0 ] ; for ( int i = 1 ; i < array . length ; i ++ ) { if ( array [ i ] . compareTo ( max ) > 0 ) { max = array [ i ] ; } } return max ; |
public class Layout { /** * Set up the screen input fields . */
public void setupFields ( ) { } } | FieldInfo field = null ; field = new FieldInfo ( this , ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Integer . class ) ; field . setHidden ( true ) ; field = new FieldInfo ( this , LAST_CHANGED , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Date . class ) ;... |
public class StripeReader { /** * Builds ( codec . stripeLength + codec . parityLength ) inputs given some erased locations .
* Outputs :
* - the array of input streams @ param inputs
* - the list of erased locations @ param erasedLocations .
* - the list of locations that are not read @ param locationsToNotRea... | InputStream [ ] inputs = new InputStream [ codec . stripeLength + codec . parityLength ] ; boolean redo = false ; do { locationsToNotRead . clear ( ) ; List < Integer > locationsToRead = code . locationsToReadForDecode ( erasedLocations ) ; for ( int i = 0 ; i < inputs . length ; i ++ ) { boolean isErased = ( erasedLoc... |
public class TaggerUtils { /** * Creates training examples from sequential data where each example
* involves predicting a single label given the current input and
* previous label . Such examples are suitable for training
* locally - normalized sequence models , such as HMMs and MEMMs .
* @ param sequences
*... | DynamicVariableSet plate = modelVariables . getPlate ( PLATE_NAME ) ; VariableNumMap x = plate . getFixedVariables ( ) . getVariablesByName ( INPUT_FEATURES_NAME ) ; VariableNumMap xInput = plate . getFixedVariables ( ) . getVariablesByName ( INPUT_NAME ) ; VariableNumMap y = plate . getFixedVariables ( ) . getVariable... |
public class BaseLiaison { /** * from DatabaseLiaison */
public boolean tableContainsIndex ( Connection conn , String table , String index ) throws SQLException { } } | ResultSet rs = conn . getMetaData ( ) . getIndexInfo ( null , null , table , false , true ) ; while ( rs . next ( ) ) { String tname = rs . getString ( "TABLE_NAME" ) ; String iname = rs . getString ( "INDEX_NAME" ) ; if ( tname . equals ( table ) && index . equals ( iname ) ) { return true ; } } return false ; |
public class Fn { /** * Returns a stateful < code > Function < / code > which should not be used in parallel stream .
* @ param func
* @ return
* @ deprecated replaced by { @ code Functions # indexed ( IndexedFunction ) } . */
@ Deprecated static < T , R > Function < T , R > indexedd ( final IndexedFunction < T ,... | return Functions . indexed ( func ) ; |
public class BlockPlacementPolicyConfigurable { /** * returns a random integer within a modular window taking into consideration
* a sorted list of nodes to be excluded . */
protected int randomIntInWindow ( int begin , int windowSize , int n , Set < Integer > excludeSet ) { } } | final int size = Math . min ( windowSize , n ) ; if ( size <= 0 ) { return - 1 ; } int adjustment = 0 ; for ( Integer v : excludeSet ) { int vindex = ( v . intValue ( ) - begin + n ) % n ; if ( vindex < size ) { adjustment ++ ; // calculates excluded elements within window
} } if ( adjustment >= size ) { return - 1 ; }... |
public class JsonObject { /** * unhidden . */
public JsonObject accumulate ( String name , Object value ) throws JsonException { } } | checkIfFrozen ( ) ; Object current = nameValuePairs . get ( checkName ( name ) ) ; if ( current == null ) { return put ( name , value ) ; } if ( current instanceof JsonArray ) { JsonArray array = ( JsonArray ) current ; array . put ( value ) ; } else { JsonArray array = new JsonArray ( ) ; array . put ( current ) ; arr... |
public class ClassScanner { /** * Returns all the classes found in a sorted map */
public SortedMap < String , Class < ? > > getAllClassesMap ( ) { } } | Package [ ] packages = Package . getPackages ( ) ; return getClassesMap ( packages ) ; |
public class TemplatedURLFormatter { /** * Gets the TemplatedURLFormatter instance from a ServletRequest attribute .
* @ param servletRequest the current ServletRequest .
* @ return the TemplatedURLFormatter instance from the ServletRequest . */
public static TemplatedURLFormatter getTemplatedURLFormatter ( Servlet... | assert servletRequest != null : "The ServletRequest cannot be null." ; if ( servletRequest == null ) { throw new IllegalArgumentException ( "The ServletRequest cannot be null." ) ; } return ( TemplatedURLFormatter ) servletRequest . getAttribute ( TEMPLATED_URL_FORMATTER_ATTR ) ; |
public class ConnectResponse { /** * / * ( non - Javadoc )
* @ see tuwien . auto . calimero . knxnetip . servicetype . ServiceType # getStructLength ( ) */
short getStructLength ( ) { } } | int len = 2 ; if ( endpt != null && crd != null ) len += endpt . getStructLength ( ) + crd . getStructLength ( ) ; return ( short ) len ; |
public class PersistenceInitializer { /** * Starts the H2 database engine if the database mode is set to ' server ' */
private void startDbServer ( ) { } } | final String mode = Config . getInstance ( ) . getProperty ( Config . AlpineKey . DATABASE_MODE ) ; final int port = Config . getInstance ( ) . getPropertyAsInt ( Config . AlpineKey . DATABASE_PORT ) ; if ( StringUtils . isEmpty ( mode ) || ! ( "server" . equals ( mode ) || "embedded" . equals ( mode ) || "external" . ... |
public class SARLJvmModelInferrer { /** * Transform the constructor .
* @ param source the feature to transform .
* @ param container the target container of the transformation result . */
@ Override protected void transform ( final XtendConstructor source , final JvmGenericType container ) { } } | final String constructorName = container . getSimpleName ( ) ; // Special case : static constructor
if ( source . isStatic ( ) ) { final JvmOperation staticConstructor = this . typesFactory . createJvmOperation ( ) ; container . getMembers ( ) . add ( staticConstructor ) ; this . associator . associatePrimary ( source ... |
public class SeaGlassLookAndFeel { /** * Initialize the internal frame maximize button settings .
* @ param d the UI defaults map . */
private void defineInternalFrameMaximizeButton ( UIDefaults d ) { } } | String p = "InternalFrame:InternalFrameTitlePane:\"InternalFrameTitlePane.maximizeButton\"" ; String c = PAINTER_PREFIX + "TitlePaneMaximizeButtonPainter" ; d . put ( p + ".WindowNotFocused" , new TitlePaneMaximizeButtonWindowNotFocusedState ( ) ) ; d . put ( p + ".WindowMaximized" , new TitlePaneMaximizeButtonWindowMa... |
public class ClassUtil { /** * 获得ClassPath
* @ param packageName 包名称
* @ param isDecode 是否解码路径中的特殊字符 ( 例如空格和中文 )
* @ return ClassPath路径字符串集合
* @ since 4.0.11 */
public static Set < String > getClassPaths ( String packageName , boolean isDecode ) { } } | String packagePath = packageName . replace ( StrUtil . DOT , StrUtil . SLASH ) ; Enumeration < URL > resources ; try { resources = getClassLoader ( ) . getResources ( packagePath ) ; } catch ( IOException e ) { throw new UtilException ( e , "Loading classPath [{}] error!" , packagePath ) ; } final Set < String > paths ... |
public class SynchronizationManagerImpl { /** * 2 . The lock can be locked more then once - for example in InBuffer startGetMessages ( ) and then in ackMessages ( ) do put ( ) in OutBuffer and do startPutMessages ( ) */
private void unlockCompletely ( ReentrantLock lockToUnlock ) { } } | int counter = lockToUnlock . getHoldCount ( ) ; for ( int i = 0 ; i < counter ; i ++ ) { lockToUnlock . unlock ( ) ; } |
public class nsmode { /** * Use this API to disable nsmode . */
public static base_response disable ( nitro_service client , nsmode resource ) throws Exception { } } | nsmode disableresource = new nsmode ( ) ; disableresource . mode = resource . mode ; return disableresource . perform_operation ( client , "disable" ) ; |
public class CryptoPrimitives { /** * Decodes an ECDSA signature and returns a two element BigInteger array .
* @ param signature ECDSA signature bytes .
* @ return BigInteger array for the signature ' s r and s values
* @ throws Exception */
private static BigInteger [ ] decodeECDSASignature ( byte [ ] signature... | try ( ByteArrayInputStream inStream = new ByteArrayInputStream ( signature ) ) { ASN1InputStream asnInputStream = new ASN1InputStream ( inStream ) ; ASN1Primitive asn1 = asnInputStream . readObject ( ) ; BigInteger [ ] sigs = new BigInteger [ 2 ] ; int count = 0 ; if ( asn1 instanceof ASN1Sequence ) { ASN1Sequence asn1... |
public class SCoverageReportMojo { /** * { @ inheritDoc } */
@ Override public String getDescription ( Locale locale ) { } } | if ( StringUtils . isEmpty ( description ) ) { return getBundle ( locale ) . getString ( "report.scoverage.description" ) ; } return description ; |
public class CreateSpatialIndexGeneratorGeoDB { /** * { @ inheritDoc } Also ensures that the SRID is populated . */
@ Override public ValidationErrors validate ( final CreateSpatialIndexStatement statement , final Database database , final SqlGeneratorChain sqlGeneratorChain ) { } } | final ValidationErrors validationErrors = super . validate ( statement , database , sqlGeneratorChain ) ; validationErrors . checkRequiredField ( "srid" , statement . getSrid ( ) ) ; return validationErrors ; |
public class ConnectionDataGroup { /** * Creates and returns a new conversation . The conversation must be connected to
* the same remote process as the conversation group is associated with . The conversation
* will be created over a connection within this connection group .
* @ param conversationReceiveListener... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "connect" , new Object [ ] { conversationReceiveListener , usageType } ) ; // Pass in an ' empty ' JFapAddressHolder .
Conversation retConversation = doConnect ( conversationReceiveListener , usageType , new JFapAddre... |
public class StringUtils { /** * Unwraps a given string from anther string .
* < pre >
* StringUtils . unwrap ( null , null ) = null
* StringUtils . unwrap ( null , " " ) = null
* StringUtils . unwrap ( null , " 1 " ) = null
* StringUtils . unwrap ( " \ ' abc \ ' " , " \ ' " ) = " abc "
* StringUtils . unwr... | if ( isEmpty ( str ) || isEmpty ( wrapToken ) ) { return str ; } if ( startsWith ( str , wrapToken ) && endsWith ( str , wrapToken ) ) { final int startIndex = str . indexOf ( wrapToken ) ; final int endIndex = str . lastIndexOf ( wrapToken ) ; final int wrapLength = wrapToken . length ( ) ; if ( startIndex != - 1 && e... |
public class BeginSegmentImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . BEGIN_SEGMENT__SEGNAME : setSEGNAME ( SEGNAME_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class AbstractExtractor { /** * To string function t .
* @ param toStringFunction the to string function
* @ return the t */
public T toStringFunction ( @ NonNull SerializableFunction < HString , String > toStringFunction ) { } } | this . toStringFunction = toStringFunction ; return Cast . as ( this ) ; |
public class DateTimeExtensions { /** * Iterates from this to the { @ code to } { @ link java . time . temporal . Temporal } , inclusive , incrementing by one
* { @ code unit } each iteration , calling the closure once per iteration . The closure may accept a single
* { @ link java . time . temporal . Temporal } ar... | if ( isUptoEligible ( from , to ) ) { for ( Temporal i = from ; isUptoEligible ( i , to ) ; i = i . plus ( 1 , unit ) ) { closure . call ( i ) ; } } else { throw new GroovyRuntimeException ( "The argument (" + to + ") to upto() cannot be earlier than the value (" + from + ") it's called on." ) ; } |
public class CountMin4 { /** * Returns the estimated number of occurrences of an element , up to the maximum ( 15 ) .
* @ param e the element to count occurrences of
* @ return the estimated number of occurrences of the element ; possibly zero but never negative */
@ Override public int frequency ( long e ) { } } | int hash = spread ( Long . hashCode ( e ) ) ; int start = ( hash & 3 ) << 2 ; int frequency = Integer . MAX_VALUE ; for ( int i = 0 ; i < 4 ; i ++ ) { int index = indexOf ( hash , i ) ; int count = ( int ) ( ( table [ index ] >>> ( ( start + i ) << 2 ) ) & 0xfL ) ; frequency = Math . min ( frequency , count ) ; } retur... |
public class DigitsValidator { /** * / * ( non - Javadoc )
* @ see nz . co . senanque . validationengine . annotations1 . FieldValidator # validate ( java . lang . Object ) */
public void validate ( Object o ) { } } | String s = String . valueOf ( o ) ; int i = s . indexOf ( "." ) ; if ( i == - 1 ) { if ( ( m_integerDigits != - 1 && s . length ( ) > m_integerDigits ) ) { String message = m_propertyMetadata . getMessageSourceAccessor ( ) . getMessage ( m_message , new Object [ ] { m_propertyMetadata . getLabelName ( ) , m_integerDigi... |
public class ConfigResolutionStrategy { /** * Activate the strategy . */
void activate ( ) { } } | nodes ( ) . flatMap ( e -> e . allKeysRecursively ( ) ) . distinct ( ) . forEach ( key -> { activate ( key ) ; } ) ; |
public class CougarSerializerFactory { /** * If a Cougar server response contains a class the client doesn ' t know about ( which is legal and backwards compatible
* in cases ) then the default behavior of Hessian is to perform a lookup , fail , throw an exception and log it .
* This has been measured at about 25 t... | if ( missingTypes . contains ( type ) ) { return null ; } Deserializer answer = super . getDeserializer ( type ) ; if ( answer == null ) { missingTypes . add ( type ) ; } return answer ; |
public class ServerSocket { /** * Retrieve setting for SO _ TIMEOUT . 0 returns implies that the
* option is disabled ( i . e . , timeout of infinity ) .
* @ return the SO _ TIMEOUT value
* @ exception IOException if an I / O error occurs
* @ since JDK1.1
* @ see # setSoTimeout ( int ) */
public synchronized ... | if ( isClosed ( ) ) throw new SocketException ( "Socket is closed" ) ; Object o = getImpl ( ) . getOption ( SocketOptions . SO_TIMEOUT ) ; /* extra type safety */
if ( o instanceof Integer ) { return ( ( Integer ) o ) . intValue ( ) ; } else { return 0 ; } |
public class CMMLHelper { /** * Extracts a single node for the specified XPath expression .
* @ param node the node
* @ param xExpr expression
* @ param xPath the x path
* @ return Node
* @ throws XPathExpressionException the xpath expression exception */
public static Node getElement ( Node node , String xEx... | return ( Node ) xPath . compile ( xExpr ) . evaluate ( node , XPathConstants . NODE ) ; |
public class Asm { /** * Create dword ( 4 Bytes ) pointer operand . */
public static final Mem dword_ptr_abs ( long target , long disp , SEGMENT segmentPrefix ) { } } | return _ptr_build_abs ( target , disp , segmentPrefix , SIZE_DWORD ) ; |
public class FlexiBean { /** * Gets the value of the property as a { @ code long } using a default value .
* @ param propertyName the property name , not empty
* @ param defaultValue the default value for null or invalid property
* @ return the value of the property
* @ throws ClassCastException if the value is... | Object obj = get ( propertyName ) ; return obj != null ? ( ( Number ) get ( propertyName ) ) . longValue ( ) : defaultValue ; |
public class SparseWeightedDirectedTypedEdgeSet { /** * Returns the sum of the weights of the edges contained in this set . */
public double sum ( ) { } } | double sum = 0 ; for ( WeightedDirectedTypedEdge < T > e : inEdges . values ( ) ) sum += e . weight ( ) ; for ( WeightedDirectedTypedEdge < T > e : outEdges . values ( ) ) sum += e . weight ( ) ; return sum ; |
public class Error { /** * Factory method for errors list . Returns a list of error objects , given the page and size preferences .
* @ param client the client
* @ param page the page
* @ param size the page size
* @ return the list
* @ throws IOException unexpected error . */
public static ResourceList < Err... | final String resourceUri = client . getUserResourceUri ( BandwidthConstants . ERRORS_URI_PATH ) ; final ResourceList < Error > errors = new ResourceList < Error > ( page , size , resourceUri , Error . class ) ; errors . setClient ( client ) ; errors . initialize ( ) ; return errors ; |
public class AmazonGuardDutyClient { /** * Lists detectorIds of all the existing Amazon GuardDuty detector resources .
* @ param listDetectorsRequest
* @ return Result of the ListDetectors operation returned by the service .
* @ throws BadRequestException
* 400 response
* @ throws InternalServerErrorException... | request = beforeClientExecution ( request ) ; return executeListDetectors ( request ) ; |
public class StringUtilities { /** * Copy the directive to the { @ link StringBuilder } if not null .
* ( A directive is a parameter of the digest authentication process . )
* @ param directives the directives map
* @ param sb the output buffer
* @ param directive the directive name to look for */
public static... | String directiveValue = directives . get ( directive ) ; if ( directiveValue != null ) { sb . append ( directive ) . append ( " = \"" ) . append ( directiveValue ) . append ( "\", " ) ; } |
public class SeleniumDriverFixture { /** * < p > < code >
* | ensure | do | < i > type < / i > | on | < i > searchString < / i > | with | < i > some text < / i > |
* < / code > < / p >
* @ param command
* @ param target
* @ param value
* @ return */
public boolean doOnWith ( final String command , final Str... | LOG . info ( "Performing | " + command + " | " + target + " | " + value + " |" ) ; return executeDoCommand ( command , new String [ ] { unalias ( target ) , unalias ( value ) } ) ; |
public class PrcInvItemTaxCategoryLineSave { /** * < p > Process entity request . < / p >
* @ param pAddParam additional param , e . g . return this line ' s
* document in " nextEntity " for farther process
* @ param pRequestData Request Data
* @ param pEntity Entity to process
* @ return Entity processed for... | if ( pEntity . getItsPercentage ( ) . doubleValue ( ) <= 0 ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "percentage_wrong" ) ; } if ( pEntity . getTax ( ) == null ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "tax_wrong" ) ; } // Beige - Orm refresh :
pEntity . setIt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.