signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CommandLine { /** * A method for reporting error messages in { @ link CommandLineListener # execute ( CommandLineArgument [ ] ) } implementations .
* It ensures that messages are written to the log file and / or written to stderr as appropriate .
* @ param str the error message */
public static void er... | switch ( ZAP . getProcessType ( ) ) { case cmdline : System . err . println ( str ) ; break ; default : // Ignore
} // Always write to the log
logger . error ( str ) ; |
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc )
* @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createCQM ( ) */
@ Override public CircuitGroupQueryMessage createCQM ( ) { } } | CircuitGroupQueryMessage msg = new CircuitGroupQueryMessageImpl ( _CQM_HOLDER . mandatoryCodes , _CQM_HOLDER . mandatoryVariableCodes , _CQM_HOLDER . optionalCodes , _CQM_HOLDER . mandatoryCodeToIndex , _CQM_HOLDER . mandatoryVariableCodeToIndex , _CQM_HOLDER . optionalCodeToIndex ) ; return msg ; |
public class ItemLink { /** * This method is called when a reference is being added by an active transaction
* and when a reference is being restored .
* It should only be called by the message store code .
* @ throws SevereMessageStoreException */
public final synchronized void incrementReferenceCount ( ) throws... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "incrementReferenceCount" ) ; if ( _referenceCountIsDecreasing ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot increment! Reference count has begun de... |
public class BeanUtils { /** * get the getter method corresponding to given property */
public static Method getGetterPropertyMethod ( Class < ? > type , String propertyName ) { } } | String sourceMethodName = "get" + BeanUtils . capitalizePropertyName ( propertyName ) ; Method sourceMethod = BeanUtils . getMethod ( type , sourceMethodName ) ; if ( sourceMethod == null ) { sourceMethodName = "is" + BeanUtils . capitalizePropertyName ( propertyName ) ; sourceMethod = BeanUtils . getMethod ( type , so... |
public class CachedResourceBundlesHandler { /** * ( non - Javadoc )
* @ see
* net . jawr . web . resource . bundle . ResourceBundlesHandler # streamBundleTo ( java
* . lang . String , java . io . OutputStream ) */
@ Override public void streamBundleTo ( String bundlePath , OutputStream out ) throws ResourceNotFou... | try { // byte [ ] gzip = gzipCache . get ( bundlePath ) ;
byte [ ] gzip = ( byte [ ] ) cacheMgr . get ( ZIP_CACHE_PREFIX + bundlePath ) ; // If it ' s not cached yet
if ( null == gzip ) { // Stream the stored data
ByteArrayOutputStream baOs = new ByteArrayOutputStream ( ) ; BufferedOutputStream bfOs = new BufferedOutpu... |
public class TransactionQueue { /** * Understands and applies the following integer properties .
* < ul >
* < li > max . size - setMaximumSize
* < li > max . threads - setMaximumThreads
* < li > timeout . idle - setIdleTimeout
* < li > timeout . transaction - setTransactionTimeout
* < li > tune . size - Aut... | if ( properties . containsKey ( "max.size" ) ) { setMaximumSize ( properties . getInt ( "max.size" ) ) ; } if ( properties . containsKey ( "max.threads" ) ) { setMaximumThreads ( properties . getInt ( "max.threads" ) ) ; } if ( properties . containsKey ( "timeout.idle" ) ) { setIdleTimeout ( properties . getNumber ( "t... |
public class BooleanUtilities { /** * Given a boolean in string format , it checks if it ' s ' true ' or ' false ' ( case insensitive )
* @ param booleanStr the string to check
* @ return true if booleanStr is ' true ' or ' false ' otherwise false */
public static boolean isValid ( @ Nullable final String booleanSt... | if ( StringUtils . isBlank ( booleanStr ) ) { return false ; } final String lowerCaseBoolean = getLowerCaseString ( booleanStr ) ; return lowerCaseBoolean . equals ( BooleanValues . TRUE ) || lowerCaseBoolean . equals ( BooleanValues . FALSE ) ; |
public class Configuration { /** * Returns the value associated with the given key as a long .
* @ param key
* the key pointing to the associated value
* @ param defaultValue
* the default value which is returned in case there is no value associated with the given key
* @ return the ( default ) value associat... | Object o = getRawValue ( key ) ; if ( o == null ) { return defaultValue ; } return convertToLong ( o , defaultValue ) ; |
public class BeanPath { /** * Create a new List typed path
* @ param < A >
* @ param < E >
* @ param property property name
* @ param type property type
* @ param queryType expression type
* @ return property path */
@ SuppressWarnings ( "unchecked" ) protected < A , E extends SimpleExpression < ? super A >... | return add ( new ListPath < A , E > ( type , ( Class ) queryType , forProperty ( property ) , inits ) ) ; |
public class Matrix2D { /** * Multiply the x and y coordinates of a Vertex against this matrix . */
public Vector3D mult ( Vector3D source ) { } } | Vector3D result = new Vector3D ( ) ; result . setX ( m00 * source . getX ( ) + m01 * source . getY ( ) + m02 ) ; result . setY ( m10 * source . getX ( ) + m11 * source . getY ( ) + m12 ) ; return result ; |
public class HSQLDBSingleDbJDBCConnection { /** * { @ inheritDoc } */
@ Override protected ResultSet findLastOrderNumber ( int localMaxOrderNumber , boolean increment ) throws SQLException { } } | if ( findLastOrderNumber == null ) { findLastOrderNumber = dbConnection . prepareStatement ( FIND_LAST_ORDER_NUMBER ) ; } if ( ! increment ) { ResultSet count ; int result = - 1 ; while ( result < localMaxOrderNumber - 1 ) { count = findLastOrderNumber . executeQuery ( ) ; if ( count . next ( ) ) { result = count . get... |
public class ClassGraph { /** * Convert the class name into a corresponding URL */
public String classToUrl ( ClassDoc cd , boolean rootClass ) { } } | // building relative path for context and package diagrams
if ( contextPackageName != null && rootClass ) return buildRelativePathFromClassNames ( contextPackageName , cd . containingPackage ( ) . name ( ) ) + cd . name ( ) + ".html" ; return classToUrl ( cd . qualifiedName ( ) ) ; |
public class HexUtils { /** * Read a hex string of bits and write it into a bitset
* @ param s hex string of the stored bits
* @ param ba the bitset to store the bits in
* @ param length the maximum number of bits to store */
public static void hexToBits ( String s , BitSet ba , int length ) { } } | byte [ ] b = hexToBytes ( s ) ; bytesToBits ( b , ba , length ) ; |
public class MapStoreWrapper { /** * Returns an { @ link Iterable } of all keys or { @ code null }
* if a map loader is not configured for this map .
* { @ inheritDoc } */
@ Override public Iterable < Object > loadAllKeys ( ) { } } | if ( isMapLoader ( ) ) { Iterable < Object > allKeys ; try { allKeys = mapLoader . loadAllKeys ( ) ; } catch ( AbstractMethodError e ) { // Invoke reflectively to preserve backwards binary compatibility . Removable in v4 . x
allKeys = ReflectionHelper . invokeMethod ( mapLoader , "loadAllKeys" ) ; } return allKeys ; } ... |
public class ObservableObjectValueAssert { /** * Verifies that the actual observable has the same value as the given observable .
* @ param expectedValue the observable value to compare with the actual observables current value .
* @ return { @ code this } assertion instance . */
public ObservableObjectValueAssert ... | new ObservableValueAssertions < > ( actual ) . hasSameValue ( expectedValue ) ; return this ; |
public class CommerceCountryPersistenceImpl { /** * Returns the last commerce country in the ordered set where groupId = & # 63 ; and billingAllowed = & # 63 ; and active = & # 63 ; .
* @ param groupId the group ID
* @ param billingAllowed the billing allowed
* @ param active the active
* @ param orderByCompara... | CommerceCountry commerceCountry = fetchByG_B_A_Last ( groupId , billingAllowed , active , orderByComparator ) ; if ( commerceCountry != null ) { return commerceCountry ; } StringBundler msg = new StringBundler ( 8 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; m... |
public class Filters { /** * Applies the given label to all cells in the output row . This allows the caller to determine
* which results were produced from which part of the filter .
* < p > Due to a technical limitation , it is not currently possible to apply multiple labels to a
* cell . As a result , a { @ li... | Preconditions . checkNotNull ( label ) ; return new SimpleFilter ( RowFilter . newBuilder ( ) . setApplyLabelTransformer ( label ) . build ( ) ) ; |
public class DescriptionBuilder { /** * @ return the built description */
public Description build ( ) { } } | if ( null == name ) { throw new IllegalStateException ( "name is not set" ) ; } final String title1 = null != title ? title : name ; final List < Property > properties1 = buildProperties ( ) ; final Map < String , String > mapping1 = Collections . unmodifiableMap ( mapping ) ; final Map < String , String > mapping2 = C... |
public class Query { /** * returns tweets by users located within a given radius of the given latitude / longitude , where the user ' s location is taken from their Twitter profile
* @ param location geo location
* @ param radius radius
* @ param unit Query . MILES or Query . KILOMETERS
* @ since Twitter4J 4.0.... | this . geocode = location . getLatitude ( ) + "," + location . getLongitude ( ) + "," + radius + unit . name ( ) ; |
public class RetryPolicy { /** * Special case during shutdown .
* @ param e possible instance of , or has cause for , an InterruptedException
* @ return true if it is transitively an InterruptedException */
private boolean isInterruptTransitively ( Throwable e ) { } } | do { if ( e instanceof InterruptedException ) { return true ; } e = e . getCause ( ) ; } while ( e != null ) ; return false ; |
public class LdapURL { /** * Returns the search scope used in LDAP search */
public int get_searchScope ( ) { } } | int searchScope = SearchControls . OBJECT_SCOPE ; String scopeBuf = get_scope ( ) ; if ( scopeBuf != null ) { if ( scopeBuf . compareToIgnoreCase ( "base" ) == 0 ) { searchScope = SearchControls . OBJECT_SCOPE ; } else if ( scopeBuf . compareToIgnoreCase ( "one" ) == 0 ) { searchScope = SearchControls . ONELEVEL_SCOPE ... |
public class CmsGalleryService { /** * Generates a map with all available content types . < p >
* The map uses resource type name as the key and stores the CmsTypesListInfoBean as the value .
* @ param types the resource types
* @ param creatableTypes the creatable types
* @ return the map containing the availa... | ArrayList < CmsResourceTypeBean > list = new ArrayList < CmsResourceTypeBean > ( ) ; if ( types == null ) { return list ; } Map < I_CmsResourceType , I_CmsPreviewProvider > typeProviderMapping = getPreviewProviderForTypes ( types ) ; Iterator < I_CmsResourceType > it = types . iterator ( ) ; while ( it . hasNext ( ) ) ... |
public class MatrixVectorMult_DDRM { /** * Performs a matrix vector multiply . < br >
* < br >
* c = A * b < br >
* and < br >
* c = A * b < sup > T < / sup > < br >
* < br >
* c < sub > i < / sub > = Sum { j = 1 : n , a < sub > ij < / sub > * b < sub > j < / sub > } < br >
* < br >
* where A is a matri... | if ( B . numRows == 1 ) { if ( A . numCols != B . numCols ) { throw new MatrixDimensionException ( "A and B are not compatible" ) ; } } else if ( B . numCols == 1 ) { if ( A . numCols != B . numRows ) { throw new MatrixDimensionException ( "A and B are not compatible" ) ; } } else { throw new MatrixDimensionException (... |
public class BadRequest { /** * < pre >
* Describes all violations in a client request .
* < / pre >
* < code > repeated . google . rpc . BadRequest . FieldViolation field _ violations = 1 ; < / code > */
public com . google . rpc . BadRequest . FieldViolationOrBuilder getFieldViolationsOrBuilder ( int index ) { ... | return fieldViolations_ . get ( index ) ; |
public class ThresholdMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Threshold threshold , ProtocolMarshaller protocolMarshaller ) { } } | if ( threshold == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( threshold . getComparison ( ) , COMPARISON_BINDING ) ; protocolMarshaller . marshall ( threshold . getThresholdValue ( ) , THRESHOLDVALUE_BINDING ) ; } catch ( Exception e ) {... |
public class SessionManager { /** * not called from XD */
@ Override public ISession getISession ( String id ) { } } | return ( ISession ) getSession ( id , 0 , false , null ) ; |
public class ChunkFetchSuccess { /** * Decoding uses the given ByteBuf as our data , and will retain ( ) it . */
public static ChunkFetchSuccess decode ( ByteBuf buf ) { } } | StreamChunkId streamChunkId = StreamChunkId . decode ( buf ) ; buf . retain ( ) ; NettyManagedBuffer managedBuf = new NettyManagedBuffer ( buf . duplicate ( ) ) ; return new ChunkFetchSuccess ( streamChunkId , managedBuf ) ; |
public class SF424V2_1Generator { /** * This method creates { @ link XmlObject } of type { @ link SF42421Document } by populating data from the given
* { @ link ProposalDevelopmentDocumentContract }
* @ param proposalDevelopmentDocument for which the { @ link XmlObject } needs to be created
* @ return { @ link Xm... | this . pdDoc = proposalDevelopmentDocument ; aorInfo = departmentalPersonService . getDepartmentalPerson ( pdDoc ) ; return getSF42421Doc ( ) ; |
public class AbstractControllerServer { /** * { @ inheritDoc }
* @ param consumer { @ inheritDoc }
* @ return { @ inheritDoc } */
@ Override public ClosableDataBuilder < MB > getDataBuilder ( final Object consumer , final boolean notifyChange ) { } } | return new ClosableDataBuilder < > ( getBuilderSetup ( ) , consumer , notifyChange ) ; |
public class LazyJobLogger { /** * 检查内存中的日志量是否超过阀值 , 如果超过需要批量刷盘日志 */
private void checkCapacity ( ) { } } | if ( memoryQueue . size ( ) > maxMemoryLogSize ) { // 超过阀值 , 需要批量刷盘
if ( flushing . compareAndSet ( false , true ) ) { // 这里可以采用new Thread , 因为这里只会同时new一个
new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { checkAndFlush ( ) ; } catch ( Throwable t ) { LOGGER . error ( "Capacity full flush error" , t... |
public class CmsMessageWidget { /** * Sets the icon CSS class . < p >
* @ param icon the icon
* @ param color the icon color */
public void setIcon ( FontOpenCms icon , String color ) { } } | if ( icon != null ) { m_iconCell . setInnerHTML ( icon . getHtml ( 32 , color ) ) ; } else { m_iconCell . setInnerHTML ( "" ) ; } |
public class DSIdGenerator { /** * ( non - Javadoc )
* @ see
* com . impetus . kundera . generator . AutoGenerator # generate ( com . impetus . kundera
* . client . Client , java . lang . Object ) */
@ Override public Object generate ( Client < ? > client , String dataType ) { } } | final String generatedId = "Select now() from system_schema.columns" ; ResultSet rSet = ( ( DSClient ) client ) . execute ( generatedId , null ) ; UUID uuid = rSet . iterator ( ) . next ( ) . getUUID ( 0 ) ; return uuid ; |
public class CreateDedicatedIpPoolRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateDedicatedIpPoolRequest createDedicatedIpPoolRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createDedicatedIpPoolRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createDedicatedIpPoolRequest . getPoolName ( ) , POOLNAME_BINDING ) ; protocolMarshaller . marshall ( createDedicatedIpPoolRequest . getTags ( ) , TAGS_BIND... |
public class Pair { /** * Gets a mapped presentation of the pair .
* @ return mapped presentation of the pair .
* @ since v1.1.0 */
public Map < K , V > toMap ( ) { } } | Map < K , V > result = new HashMap < K , V > ( ) ; result . put ( key , value ) ; return result ; |
public class HeterogeneousMixture { /** * from superclass */
public final int bubblePressure ( double pressureEstimate , Map < String , Double > vaporFractionsEstimate ) { } } | for ( Compound c : components ) { double fraction = vaporFractionsEstimate . get ( c . getName ( ) ) ; getVapor ( ) . setFraction ( c , fraction ) ; } setPressure ( pressureEstimate ) ; return bubblePressureImpl ( ) ; |
public class ExpressRoutePortsInner { /** * Deletes the specified ExpressRoutePort resource .
* @ param resourceGroupName The name of the resource group .
* @ param expressRoutePortName The name of the ExpressRoutePort resource .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ t... | beginDeleteWithServiceResponseAsync ( resourceGroupName , expressRoutePortName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class ArrayUtils { /** * originally licensed under ASL 2.0 */
public static Object [ ] subarray ( Object [ ] array , int startIndexInclusive , int endIndexExclusive ) { } } | int newSize = endIndexExclusive - startIndexInclusive ; Class < ? > type = array . getClass ( ) . getComponentType ( ) ; if ( newSize <= 0 ) { return ( Object [ ] ) Array . newInstance ( type , 0 ) ; } Object [ ] subarray = ( Object [ ] ) Array . newInstance ( type , newSize ) ; System . arraycopy ( array , startIndexI... |
public class Snappy { /** * Uncompress the content in the input buffer . The uncompressed data is
* written to the output buffer .
* Note that if you pass the wrong data or the range [ inputOffset ,
* inputOffset + inputLength ) that cannot be uncompressed , your JVM might
* crash due to the access violation ex... | return rawUncompress ( input , inputOffset , inputLength , output , outputOffset ) ; |
public class HttpConnection { protected void statsRequestStart ( ) { } } | if ( _statsOn ) { if ( _reqTime > 0 ) statsRequestEnd ( ) ; _requests ++ ; _tmpTime = _request . getTimeStamp ( ) ; _reqTime = _tmpTime ; _httpServer . statsGotRequest ( ) ; } |
public class Similarity { /** * Computes the Spearman rank correlation coefficient for the two { @ code
* DoubleVector } instances .
* < p > This implementation properly accounts for ties according to the
* procedure specified in < i > Nonparametric Statistics for The Behavioral
* Sciences < / i > by Sidney Sie... | // NOTE : should this code ever be on the critical path , we should
// re - implement it to operate on the Vector instances themselves
return spearmanRankCorrelationCoefficient ( a . toArray ( ) , b . toArray ( ) ) ; |
public class Calc { /** * Multiply elements of a by s ( in place )
* @ param a
* @ param s
* @ return the modified a */
public static Atom scaleEquals ( Atom a , double s ) { } } | double x = a . getX ( ) ; double y = a . getY ( ) ; double z = a . getZ ( ) ; x *= s ; y *= s ; z *= s ; // Atom b = new AtomImpl ( ) ;
a . setX ( x ) ; a . setY ( y ) ; a . setZ ( z ) ; return a ; |
public class InstallerModule { /** * Performs classpath scan to find all classes implementing or use only manually configured installers .
* { @ link FeatureInstaller } .
* @ return list of found installers or empty list */
@ SuppressWarnings ( "unchecked" ) private List < Class < ? extends FeatureInstaller > > fin... | if ( scanner != null ) { final List < Class < ? extends FeatureInstaller > > installers = Lists . newArrayList ( ) ; scanner . scan ( new ClassVisitor ( ) { @ Override public void visit ( final Class < ? > type ) { if ( FeatureUtils . is ( type , FeatureInstaller . class ) ) { installers . add ( ( Class < ? extends Fea... |
public class Actions { /** * Converts an { @ link Action4 } to a function that calls the action and returns a specified value .
* @ param action the { @ link Action4 } to convert
* @ param result the value to return from the function call
* @ return a { @ link Func4 } that calls { @ code action } and returns { @ ... | return new Func4 < T1 , T2 , T3 , T4 , R > ( ) { @ Override public R call ( T1 t1 , T2 t2 , T3 t3 , T4 t4 ) { action . call ( t1 , t2 , t3 , t4 ) ; return result ; } } ; |
public class CoreUserApiKeyAuthProviderClient { /** * Enables a user API key associated with the current user .
* @ param id The id of the API key to enable . */
protected void enableApiKeyInternal ( final ObjectId id ) { } } | final StitchAuthRequest . Builder reqBuilder = new StitchAuthRequest . Builder ( ) ; reqBuilder . withMethod ( Method . PUT ) . withPath ( routes . getApiKeyEnableRouteForId ( id . toHexString ( ) ) ) . withRefreshToken ( ) ; getRequestClient ( ) . doAuthenticatedRequest ( reqBuilder . build ( ) ) ; |
public class DonutOptions { /** * Creates the data displayed in the donut chart . */
private List < BrowserUsageData > getBrowserData ( ) { } } | List < BrowserUsageData > browserData = new ArrayList < BrowserUsageData > ( ) ; browserData . add ( getMSIEUsageData ( ) ) ; browserData . add ( getFirefoxUsageData ( ) ) ; browserData . add ( getChromeUsageData ( ) ) ; browserData . add ( getSafariUsageData ( ) ) ; browserData . add ( getOperaUsageData ( ) ) ; return... |
public class ComponentRegistry { /** * Register a component with FQCN only . This method will try to get the class version using reflections !
* @ param _ string fqcn */
public synchronized void registerComponent ( String _string ) { } } | if ( isIncluded ( _string ) ) { Class < ? > dummy ; try { dummy = Class . forName ( _string ) ; String classVersion = getVersionWithReflection ( dummy ) ; if ( classVersion != null ) { componentVersions . put ( _string , classVersion ) ; } } catch ( ClassNotFoundException ex ) { logger . trace ( "Unable to call getVers... |
public class PlainDate { /** * < p > Erzeugt ein neues Datum passend zur angegebenen absoluten Zeit . < / p >
* @ param ut unix time
* @ param offset shift of local time relative to UTC
* @ return new calendar date */
static PlainDate from ( UnixTime ut , ZonalOffset offset ) { } } | long localSeconds = ut . getPosixTime ( ) + offset . getIntegralAmount ( ) ; int localNanos = ut . getNanosecond ( ) + offset . getFractionalAmount ( ) ; if ( localNanos < 0 ) { localSeconds -- ; } else if ( localNanos >= 1000000000 ) { localSeconds ++ ; } long mjd = EpochDays . MODIFIED_JULIAN_DATE . transform ( MathU... |
public class DefaultSensorStorage { /** * Thread safe assuming that each issues for each file are only written once . */
@ Override public void store ( DefaultExternalIssue externalIssue ) { } } | if ( externalIssue . primaryLocation ( ) . inputComponent ( ) instanceof DefaultInputFile ) { DefaultInputFile defaultInputFile = ( DefaultInputFile ) externalIssue . primaryLocation ( ) . inputComponent ( ) ; defaultInputFile . setPublished ( true ) ; } moduleIssues . initAndAddExternalIssue ( externalIssue ) ; |
public class CmsLockManager { /** * Removes a resource from the lock manager . < p >
* The forceUnlock option should be used with caution . < br >
* forceUnlock will remove the lock by ignoring any rules which may cause wrong lock states . < p >
* @ param dbc the current database context
* @ param resource the ... | String resourcename = resource . getRootPath ( ) ; CmsLock lock = getLock ( dbc , resource ) . getEditionLock ( ) ; // check some abort conditions first
if ( ! lock . isNullLock ( ) ) { // the resource is locked by another user or in other project
if ( ! forceUnlock && ( ! lock . isOwnedInProjectBy ( dbc . currentUser ... |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcJunctionBoxTypeEnum createIfcJunctionBoxTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcJunctionBoxTypeEnum result = IfcJunctionBoxTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class NetworkInterfacesInner { /** * Gets information about all network interfaces in a virtual machine in a virtual machine scale set .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @... | ServiceResponse < Page < NetworkInterfaceInner > > response = listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < NetworkInterfaceInner > ( response . body ( ) ) { @ Override public Page < NetworkInterfaceInner > nextPage ( String next... |
public class BuildContext { /** * Retrieve and clear the relative root for this context .
* @ param previousValue
* previous value of the relative root to restore
* @ return value of the relative root which was replaced */
public HashResource restoreRelativeRoot ( HashResource previousValue ) { } } | HashResource value = relativeRoot ; relativeRoot = previousValue ; return value ; |
public class RtfByteArrayBuffer { /** * Copies the given byte to the internal buffer .
* @ param b */
public void write ( final int b ) { } } | buffer [ pos ] = ( byte ) b ; size ++ ; if ( ++ pos == buffer . length ) flushBuffer ( ) ; |
public class JsMessageFactoryImpl { /** * Utility method to extract the schema ids from a message buffer and , if a
* message store is supplied , check that all the necessary schemas are available .
* @ param buffer The buffer containing the schema ids
* @ param offset The offset into the buffer where the schema ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "ensureSchemasAvailable" , new Object [ ] { offset , store } ) ; // If we have a message store we need to ensure all the schemas we ' ll
// need to decode the message are restored from the store .
int temp = ArrayUtil . read... |
public class Calendar { /** * Sets the given calendar field value and the time value
* ( millisecond offset from the < a href = " # Epoch " > Epoch < / a > ) of
* this < code > Calendar < / code > undefined . This means that { @ link
* # isSet ( int ) isSet ( field ) } will return < code > false < / code > , and ... | fields [ field ] = 0 ; stamp [ field ] = UNSET ; isSet [ field ] = false ; areAllFieldsSet = areFieldsSet = false ; isTimeSet = false ; |
public class CmsEmbeddedDialogsUI { /** * Returns the dialog id extracted from the requested path . < p >
* @ param request the request
* @ return the id */
private String getDialogId ( VaadinRequest request ) { } } | String path = request . getPathInfo ( ) ; // remove the leading slash
return path != null ? path . substring ( 1 ) : null ; |
public class ReferenceCountUtil { /** * Tries to call { @ link ReferenceCounted # touch ( ) } if the specified message implements { @ link ReferenceCounted } .
* If the specified message doesn ' t implement { @ link ReferenceCounted } , this method does nothing . */
@ SuppressWarnings ( "unchecked" ) public static < ... | if ( msg instanceof ReferenceCounted ) { return ( T ) ( ( ReferenceCounted ) msg ) . touch ( ) ; } return msg ; |
public class NinjaEbeanServerLifecycle { /** * This method reads the configuration properties from
* your application . conf file and configures Ebean accordingly . */
public final void startServer ( ) { } } | logger . info ( "Starting Ebeans Module." ) ; // Setup basic parameters
boolean ebeanDdlGenerate = ninjaProperties . getBooleanWithDefault ( EBEAN_DDL_GENERATE , false ) ; boolean ebeanDdlRun = ninjaProperties . getBooleanWithDefault ( EBEAN_DDL_RUN , false ) ; String ebeanDdlInitSql = ninjaProperties . get ( EBEAN_DDL... |
public class FacebookAlbumListFragment { /** * Asynchronously requests the Page accounts associated with the linked account . Calls
* { @ link # requestPageAlbums ( Queue , List ) } when completed . */
private void requestAccounts ( ) { } } | Callback callback = new Callback ( ) { @ Override public void onCompleted ( Response response ) { FacebookSettingsActivity activity = ( FacebookSettingsActivity ) getActivity ( ) ; if ( activity == null || activity . isFinishing ( ) ) { return ; } if ( response != null && response . getError ( ) == null ) { Queue < Pag... |
public class StoreFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertSmtpProtocolToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class ReflectedHeap { /** * { @ inheritDoc } */
@ Override public Handle < K , V > insert ( K key , V value ) { } } | if ( key == null ) { throw new NullPointerException ( "Null keys not permitted" ) ; } else if ( other != this ) { throw new IllegalStateException ( "A heap cannot be used after a meld" ) ; } else if ( size % 2 == 0 ) { free = new ReflectedHandle < K , V > ( this , key , value ) ; size ++ ; return free ; } else { Reflec... |
public class FSNamesystem { /** * Modify ( block - - > datanode ) map . Possibly generate
* replication tasks , if the removed block is still valid . */
private void removeStoredBlock ( Block block , DatanodeDescriptor node ) { } } | if ( NameNode . stateChangeLog . isDebugEnabled ( ) ) { NameNode . stateChangeLog . debug ( "BLOCK* NameSystem.removeStoredBlock: " + block + " from " + node . getName ( ) ) ; } if ( ! blocksMap . removeNode ( block , node ) ) { if ( NameNode . stateChangeLog . isDebugEnabled ( ) ) { NameNode . stateChangeLog . debug (... |
public class Ascii { /** * Returns if the character sequence { @ code seq } ends with the character sequence { @ code suffix }
* ignoring the case of any ASCII alphabetic characters
* between { @ code ' a ' } and { @ code ' z ' } or { @ code ' A ' } and { @ code ' Z ' } inclusive .
* @ since NEXT */
public static... | return startsWithIgnoreCase ( seq , suffix , seq . length ( ) - suffix . length ( ) ) ; |
public class AbstractControllerConfiguration { /** * Creates a resource part of the path unified for all routes defined in the inherited class
* @ param path resource path of all defined class
* @ throws NullPointerException whether { @ code path } is { @ code null } */
protected final void setControllerPath ( Stri... | requireNonNull ( path , "Global path cannot be change to 'null'" ) ; if ( ! "" . equals ( path ) && ! "/" . equals ( path ) ) { this . controllerPath = pathCorrector . apply ( path ) ; } |
public class responderpolicy_lbvserver_binding { /** * Use this API to fetch responderpolicy _ lbvserver _ binding resources of given name . */
public static responderpolicy_lbvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | responderpolicy_lbvserver_binding obj = new responderpolicy_lbvserver_binding ( ) ; obj . set_name ( name ) ; responderpolicy_lbvserver_binding response [ ] = ( responderpolicy_lbvserver_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class ExtensionScript { /** * Gets the interface { @ code class1 } from the given { @ code script } . Might return { @ code null } if the { @ code script } does not
* implement the interface .
* First tries to get the interface directly from the { @ code script } by calling the method
* { @ code ScriptWrap... | ClassLoader previousContextClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; Thread . currentThread ( ) . setContextClassLoader ( ExtensionFactory . getAddOnLoader ( ) ) ; try { T iface = script . getInterface ( class1 ) ; if ( iface != null ) { // the script wrapper has overriden the usual scripti... |
public class CmsJspActionElement { /** * Returns an initialized { @ link CmsJspNavBuilder } instance . < p >
* @ return an initialized navigation builder instance
* @ see org . opencms . jsp . CmsJspNavBuilder */
public CmsJspNavBuilder getNavigation ( ) { } } | if ( isNotInitialized ( ) ) { return null ; } if ( m_vfsNav == null ) { m_vfsNav = new CmsJspNavBuilder ( getCmsObject ( ) ) ; } return m_vfsNav ; |
public class MapListenerAdaptors { /** * Creates a { @ link com . hazelcast . map . impl . ListenerAdapter } array
* for all event types of { @ link com . hazelcast . core . EntryEventType } .
* @ param mapListener a { @ link com . hazelcast . map . listener . MapListener } instance .
* @ return an array of { @ l... | EntryEventType [ ] values = EntryEventType . values ( ) ; ListenerAdapter [ ] listenerAdapters = new ListenerAdapter [ values . length ] ; for ( EntryEventType eventType : values ) { listenerAdapters [ eventType . ordinal ( ) ] = createListenerAdapter ( eventType , mapListener ) ; } return listenerAdapters ; |
public class ControllerRegistrar { /** * Register all methods in the specified controller classes .
* @ param controllers */
public final void init ( Class < ? extends Controller > ... controllers ) { } } | List < Class < ? > > classes = Arrays . asList ( controllers ) ; init ( classes ) ; |
public class BootstrapContextCoordinator { /** * Set the default bootstrap context
* @ param bc The bootstrap context */
public void setDefaultBootstrapContext ( CloneableBootstrapContext bc ) { } } | if ( trace ) log . tracef ( "Default BootstrapContext: %s" , bc ) ; String currentName = null ; if ( defaultBootstrapContext != null ) currentName = defaultBootstrapContext . getName ( ) ; defaultBootstrapContext = bc ; if ( bc != null ) { bootstrapContexts . put ( bc . getName ( ) , bc ) ; } else if ( currentName != n... |
public class JavaBean { /** * Create new instance of the object
* @ param aValues the map value
* @ param aClass the class to create
* @ param < T > the type class
* @ param convert the conversion implementation
* @ return the create object instance
* @ throws InstantiationException
* @ throws IllegalAcce... | T obj = ClassPath . newInstance ( aClass ) ; populate ( aValues , obj , convert ) ; return obj ; |
public class JobGraphGenerator { /** * This methods implements the pre - visiting during a depth - first traversal . It create the job vertex and
* sets local strategy .
* @ param node
* The node that is currently processed .
* @ return True , if the visitor should descend to the node ' s children , false if no... | // check if we have visited this node before . in non - tree graphs , this happens
if ( this . vertices . containsKey ( node ) || this . chainedTasks . containsKey ( node ) || this . iterations . containsKey ( node ) ) { // return false to prevent further descend
return false ; } // the vertex to be created for the cur... |
public class RaftRPC { /** * Setup custom serialization and deserialization for POJO { @ link Command } subclasses .
* See { @ code RaftAgent } for more on which { @ code Command } types are supported .
* @ param mapper instance of { @ code ObjectMapper } with which the serialization / deserialization mapping is re... | SimpleModule module = new SimpleModule ( "raftrpc-custom-command-module" , new Version ( 0 , 0 , 0 , "inline" , "io.libraft" , "raftrpc-command-module" ) ) ; module . addSerializer ( Command . class , new RaftRPCCommand . Serializer ( commandSerializer ) ) ; module . addDeserializer ( Command . class , new RaftRPCComma... |
public class DeploymentMetadataParse { /** * Transform a < code > & lt ; plugins . . . / & gt ; < / code > structure . */
protected void parseProcessEnginePlugins ( Element element , List < ProcessEnginePluginXml > plugins ) { } } | for ( Element chidElement : element . elements ( ) ) { if ( PLUGIN . equals ( chidElement . getTagName ( ) ) ) { parseProcessEnginePlugin ( chidElement , plugins ) ; } } |
public class MultiLayerNetwork { /** * This method uses provided OutputAdapter to return custom object built from INDArray
* PLEASE NOTE : This method uses dedicated Workspace for output generation to avoid redundant allocations
* @ param inputs Input arrays to the netwonk
* @ param inputMasks Optional input mask... | try ( val ws = Nd4j . getWorkspaceManager ( ) . getAndActivateWorkspace ( WS_ALL_LAYERS_ACT_CONFIG , WS_OUTPUT_MEM ) ) { if ( outputAdapter instanceof ModelAdapter ) return ( ( ModelAdapter < T > ) outputAdapter ) . apply ( this , new INDArray [ ] { inputs } , new INDArray [ ] { inputMasks } , new INDArray [ ] { labelM... |
public class OverrideHelper { /** * Returns the resolved features that are defined in the given < code > context type < / code > and its supertypes .
* Considers private methods of super types , too .
* @ param contextType the context type . Has to be contained in a resource .
* @ return the resolved features . *... | ITypeReferenceOwner owner = new StandardTypeReferenceOwner ( services , contextType . eResource ( ) . getResourceSet ( ) ) ; return getResolvedFeatures ( owner . toLightweightTypeReference ( contextType ) ) ; |
public class Buffer { /** * Reads a byte array from the buffer , looks for a 0 to end the array .
* @ return the read array */
public byte [ ] readBytesNullEnd ( ) { } } | int initialPosition = position ; int cnt = 0 ; while ( remaining ( ) > 0 && ( buf [ position ++ ] != 0 ) ) { cnt ++ ; } final byte [ ] tmpArr = new byte [ cnt ] ; System . arraycopy ( buf , initialPosition , tmpArr , 0 , cnt ) ; return tmpArr ; |
public class Mediawiki { /** * show the Version */
public static void showVersion ( ) { } } | System . err . println ( "Mediawiki-Japi Version: " + VERSION ) ; System . err . println ( ) ; System . err . println ( " github: https://github.com/WolfgangFahl/Mediawiki-Japi" ) ; System . err . println ( "" ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link InverseType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "inverse" ) public JAXBElement < InverseType > createInverse ( InverseType value ) { } } | return new JAXBElement < InverseType > ( _Inverse_QNAME , InverseType . class , null , value ) ; |
public class JBBPTextWriter { /** * Print integer value
* @ param value value to be printed
* @ return the context
* @ throws IOException it will be thrown for transport error */
public JBBPTextWriter Int ( final int value ) throws IOException { } } | ensureValueMode ( ) ; String convertedByExtras = null ; for ( final Extra e : this . extras ) { convertedByExtras = e . doConvertIntToStr ( this , value ) ; if ( convertedByExtras != null ) { break ; } } if ( convertedByExtras == null ) { final long valueToWrite ; if ( this . byteOrder == JBBPByteOrder . LITTLE_ENDIAN ... |
public class URLParser { /** * Converts a relative URL to absolute URL .
* @ param baseURL
* @ param relative
* @ return */
public static URL toAbsolute ( URL baseURL , String relative ) { } } | try { return new URL ( baseURL , relative ) ; } catch ( MalformedURLException ex ) { throw new RuntimeException ( ex ) ; } |
public class PercentileStatistics { /** * Gets percentile .
* @ param percentile the percentile
* @ return the percentile */
public synchronized Double getPercentile ( final double percentile ) { } } | if ( null == values ) return Double . NaN ; return values . parallelStream ( ) . flatMapToDouble ( x -> Arrays . stream ( x ) ) . sorted ( ) . skip ( ( int ) ( percentile * values . size ( ) ) ) . findFirst ( ) . orElse ( Double . NaN ) ; |
public class CmsHtmlWidget { /** * Returns the WYSIWYG editor configuration as a JSON object . < p >
* @ param widgetOptions the options for the wysiwyg widget
* @ param cms the OpenCms context
* @ param resource the edited resource
* @ param contentLocale the edited content locale
* @ return the configuratio... | JSONObject result = new JSONObject ( ) ; CmsEditorDisplayOptions options = OpenCms . getWorkplaceManager ( ) . getEditorDisplayOptions ( ) ; Properties displayOptions = options . getDisplayOptions ( cms ) ; try { if ( options . showElement ( "gallery.enhancedoptions" , displayOptions ) ) { result . put ( "cmsGalleryEnh... |
public class Ray3D { /** * Updates the ray orientation and position to the specified data .
* @ param ray Ray3DFloat object defining the placement data of the ray . */
public void update ( final Ray3DFloat ray ) { } } | final Point3D origin = VecToPoint ( ray . getOrigin ( ) ) ; final Point3D direction = VecToPoint ( ray . getDirection ( ) ) ; final Point3D end = origin . add ( direction . normalize ( ) . multiply ( rayLength ) ) ; super . setStartEndPoints ( origin , end ) ; |
public class MoreExecutors { /** * Creates a { @ link ScheduledExecutorService } whose { @ code submit } and { @ code
* invokeAll } methods submit { @ link ListenableFutureTask } instances to the
* given delegate executor . Those methods , as well as { @ code execute } and
* { @ code invokeAny } , are implemented... | return ( delegate instanceof ListeningScheduledExecutorService ) ? ( ListeningScheduledExecutorService ) delegate : new ScheduledListeningDecorator ( delegate ) ; |
public class AccessSet { /** * Read the related { @ link org . efaps . admin . datamodel . Type } .
* @ throws CacheReloadException on error */
private void readLinks2DMTypes ( ) throws CacheReloadException { } } | Connection con = null ; try { final List < Long > values = new ArrayList < > ( ) ; con = Context . getConnection ( ) ; PreparedStatement stmt = null ; try { stmt = con . prepareStatement ( AccessSet . SQL_SET2DMTYPE ) ; stmt . setObject ( 1 , getId ( ) ) ; final ResultSet rs = stmt . executeQuery ( ) ; while ( rs . nex... |
public class GetDevicePoolCompatibilityResult { /** * Information about compatible devices .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCompatibleDevices ( java . util . Collection ) } or { @ link # withCompatibleDevices ( java . util . Collection ) }... | if ( this . compatibleDevices == null ) { setCompatibleDevices ( new java . util . ArrayList < DevicePoolCompatibilityResult > ( compatibleDevices . length ) ) ; } for ( DevicePoolCompatibilityResult ele : compatibleDevices ) { this . compatibleDevices . add ( ele ) ; } return this ; |
public class ChannelUpdateHandler { /** * Handles a server text channel update .
* @ param jsonChannel The json channel data . */
private void handleServerTextChannel ( JsonNode jsonChannel ) { } } | long channelId = jsonChannel . get ( "id" ) . asLong ( ) ; api . getTextChannelById ( channelId ) . map ( c -> ( ( ServerTextChannelImpl ) c ) ) . ifPresent ( channel -> { String oldTopic = channel . getTopic ( ) ; String newTopic = jsonChannel . has ( "topic" ) && ! jsonChannel . get ( "topic" ) . isNull ( ) ? jsonCha... |
public class ServerCommsDiagnosticModule { /** * Dumps the particulars of a ME to ME client side conversation .
* @ param is the incident stream to log information to .
* @ param conv the conversation we want to dump . */
private void dumpMEtoMEConversation ( IncidentStream is , Conversation conv ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dumpMEtoMEConversation" , new Object [ ] { is , conv } ) ; // Get the conversation state and use it to find out what we can .
final ConversationState convState = ( ConversationState ) conv . getAttachment ( ) ; final... |
public class SessionHandle { /** * This method will close all peer connections associated with the torrent and tell the
* tracker that we ' ve stopped participating in the swarm . This operation cannot fail .
* When it completes , you will receive a torrent _ removed _ alert .
* The optional second argument optio... | if ( th . isValid ( ) ) { s . remove_torrent ( th . swig ( ) , options ) ; } |
public class XReadArgs { /** * Perform a blocking read and wait up to a { @ link Duration timeout } for a new stream message .
* @ param timeout max time to wait .
* @ return { @ code this } . */
public XReadArgs block ( Duration timeout ) { } } | LettuceAssert . notNull ( timeout , "Block timeout must not be null" ) ; return block ( timeout . toMillis ( ) ) ; |
public class DesignatedHostSslVerifier { /** * Idempotent . */
public static synchronized void setupSslVerification ( String host ) throws Exception { } } | if ( sslVerificationHosts == null ) sslVerificationHosts = new ArrayList < String > ( ) ; if ( ! sslVerificationHosts . contains ( host ) ) { TrustManagerFactory tmf = TrustManagerFactory . getInstance ( TrustManagerFactory . getDefaultAlgorithm ( ) ) ; // initialize tmf with the default trust store
tmf . init ( ( KeyS... |
public class UnifiedListenerManager { /** * Attach the { @ code listener } to this manager and enqueue the task if it isn ' t pending or
* running .
* @ param task the task will be enqueue if it isn ' t running .
* @ param listener the listener will be attach to this manager . */
public synchronized void attachAn... | attachListener ( task , listener ) ; if ( ! isTaskPendingOrRunning ( task ) ) { task . enqueue ( hostListener ) ; } |
public class JsonUtils { /** * Writes the given JSON - LD Object out to the given Writer , using
* indentation and new lines to improve readability .
* @ param writer
* The writer that is to receive the serialized JSON - LD object .
* @ param jsonObject
* The JSON - LD Object to serialize .
* @ throws JsonG... | final JsonGenerator jw = JSON_FACTORY . createGenerator ( writer ) ; jw . useDefaultPrettyPrinter ( ) ; jw . writeObject ( jsonObject ) ; |
public class SenderWorker { /** * Receives a < code > ProtocolDataUnit < / code > from the socket and appends it to the end of the receiving queue of this
* connection .
* @ return Queue with the resulting units
* @ throws IOException if an I / O error occurs .
* @ throws InternetSCSIException if any violation ... | final ProtocolDataUnit protocolDataUnit = protocolDataUnitFactory . create ( connection . getSetting ( OperationalTextKey . HEADER_DIGEST ) , connection . getSetting ( OperationalTextKey . DATA_DIGEST ) ) ; try { protocolDataUnit . read ( socketChannel ) ; } catch ( ClosedChannelException e ) { throw new InternetSCSIEx... |
public class InternalCallContextFactory { /** * Create an internal tenant callcontext
* @ param tenantRecordId tenant _ record _ id ( cannot be null )
* @ param accountRecordId account _ record _ id ( cannot be null for INSERT operations )
* @ return internal tenant callcontext */
public InternalTenantContext cre... | populateMDCContext ( null , accountRecordId , tenantRecordId ) ; if ( accountRecordId == null ) { return new InternalTenantContext ( tenantRecordId ) ; } else { final ImmutableAccountData immutableAccountData = getImmutableAccountData ( accountRecordId , tenantRecordId ) ; final DateTimeZone fixedOffsetTimeZone = immut... |
public class RaftServiceManager { /** * Applies a query entry to the state machine .
* Query entries are applied to the user { @ link PrimitiveService } for read - only operations . Because queries are
* read - only , they may only be applied on a single server in the cluster , and query entries do not go through t... | RaftSession session = raft . getSessions ( ) . getSession ( entry . entry ( ) . session ( ) ) ; // If the session is null then that indicates that the session already timed out or it never existed .
// Return with an UnknownSessionException .
if ( session == null ) { logger . warn ( "Unknown session: " + entry . entry ... |
public class ReflectCache { /** * 得到服务的自定义ClassLoader
* @ param serviceUniqueName 服务唯一名称
* @ return 服务级别ClassLoader */
public static ClassLoader getServiceClassLoader ( String serviceUniqueName ) { } } | ClassLoader appClassLoader = SERVICE_CLASSLOADER_MAP . get ( serviceUniqueName ) ; if ( appClassLoader == null ) { return ClassLoaderUtils . getCurrentClassLoader ( ) ; } else { return appClassLoader ; } |
public class PolicyTopicEvidence { /** * Sets the policyTopicEvidenceType value for this PolicyTopicEvidence .
* @ param policyTopicEvidenceType * The type of evidence for the policy topic . */
public void setPolicyTopicEvidenceType ( com . google . api . ads . adwords . axis . v201809 . cm . PolicyTopicEvidenceType ... | this . policyTopicEvidenceType = policyTopicEvidenceType ; |
public class CodeGeneratorMain { /** * Main Entry
* @ param args
* @ throws Exception */
public static void main ( String [ ] args ) throws Exception { } } | final CodeGeneratorConfig config = new CodeGeneratorConfig ( ) ; final JCommander commander = new JCommander ( config ) ; commander . parse ( args ) ; if ( config . help ) { commander . usage ( ) ; System . exit ( 0 ) ; } // make sure the logger is initialized
CodeGeneratorLoggerFactory . setLogger ( new CodeGeneratorS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.