signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AbstractAggarwalYuOutlier { /** * Method to get the ids in the given subspace .
* @ param subspace Subspace to process
* @ param ranges List of DBID ranges
* @ return ids */
protected DBIDs computeSubspace ( int [ ] subspace , ArrayList < ArrayList < DBIDs > > ranges ) { } } | HashSetModifiableDBIDs ids = DBIDUtil . newHashSet ( ranges . get ( subspace [ 0 ] ) . get ( subspace [ 1 ] ) ) ; // intersect all selected dimensions
for ( int i = 2 , e = subspace . length - 1 ; i < e ; i += 2 ) { DBIDs current = ranges . get ( subspace [ i ] ) . get ( subspace [ i + 1 ] - GENE_OFFSET ) ; ids . retainAll ( current ) ; if ( ids . isEmpty ( ) ) { break ; } } return ids ; |
public class PurchaseScheduledInstancesRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < PurchaseScheduledInstancesRequest > getDryRunRequest ( ) { } } | Request < PurchaseScheduledInstancesRequest > request = new PurchaseScheduledInstancesRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class EnhancedBigtableStub { /** * Creates a callable chain to handle streaming ReadRows RPCs . The chain will :
* < ul >
* < li > Convert a { @ link Query } into a { @ link com . google . bigtable . v2 . ReadRowsRequest } and
* dispatch the RPC .
* < li > Upon receiving the response stream , it will merge the { @ link
* com . google . bigtable . v2 . ReadRowsResponse . CellChunk } s in logical rows . The actual row
* implementation can be configured in by the { @ code rowAdapter } parameter .
* < li > Retry / resume on failure .
* < li > Filter out marker rows .
* < / ul > */
public < RowT > ServerStreamingCallable < Query , RowT > createReadRowsCallable ( RowAdapter < RowT > rowAdapter ) { } } | return createReadRowsCallable ( settings . readRowsSettings ( ) , rowAdapter ) ; |
public class ElementMatchers { /** * Matches a { @ link ByteCodeElement } that is accessible to a given { @ link java . lang . Class } .
* @ param type The type that a matched byte code element is expected to be accessible to .
* @ param < T > The type of the matched object .
* @ return A matcher for a byte code element to be accessible to a given { @ code type } . */
public static < T extends ByteCodeElement > ElementMatcher . Junction < T > isAccessibleTo ( TypeDescription type ) { } } | return new AccessibilityMatcher < T > ( type ) ; |
public class JDBC4ResultSet { /** * ResultSet object as a java . math . BigDecimal with full precision . */
@ Override public BigDecimal getBigDecimal ( int columnIndex ) throws SQLException { } } | checkColumnBounds ( columnIndex ) ; try { final VoltType type = table . getColumnType ( columnIndex - 1 ) ; BigDecimal decimalValue = null ; switch ( type ) { case TINYINT : decimalValue = new BigDecimal ( table . getLong ( columnIndex - 1 ) ) ; break ; case SMALLINT : decimalValue = new BigDecimal ( table . getLong ( columnIndex - 1 ) ) ; break ; case INTEGER : decimalValue = new BigDecimal ( table . getLong ( columnIndex - 1 ) ) ; break ; case BIGINT : decimalValue = new BigDecimal ( table . getLong ( columnIndex - 1 ) ) ; break ; case FLOAT : decimalValue = new BigDecimal ( table . getDouble ( columnIndex - 1 ) ) ; break ; case DECIMAL : decimalValue = table . getDecimalAsBigDecimal ( columnIndex - 1 ) ; break ; default : throw new IllegalArgumentException ( "Cannot get BigDecimal value for column type '" + type + "'" ) ; } return table . wasNull ( ) ? null : decimalValue ; } catch ( Exception x ) { throw SQLError . get ( x ) ; } |
public class MultiPoint { /** * Return true if any of the points intersect the given geometry . */
public boolean intersects ( Geometry geometry ) { } } | if ( isEmpty ( ) ) { return false ; } for ( Point point : points ) { if ( point . intersects ( geometry ) ) { return true ; } } return false ; |
public class ItemRef { /** * Deletes an item specified by this reference
* < pre >
* StorageRef storage = new StorageRef ( " your _ app _ key " , " your _ token " ) ;
* TableRef tableRef = storage . table ( " your _ table " ) ;
* ItemRef itemRef = tableRef . item ( new ItemAttribute ( " your _ primary _ key _ value " ) ,
* new ItemAttribute ( " your _ secondary _ key _ value " ) ) ;
* itemRef . del ( new OnItemSnapshot ( ) {
* & # 064 ; Override
* public void run ( ItemSnapshot itemSnapshot ) {
* if ( itemSnapshot ! = null ) {
* Log . d ( " ItemRef " , " Item deleted : " + itemSnapshot . val ( ) ) ;
* } , new OnError ( ) {
* & # 064 ; Override
* public void run ( Integer integer , String errorMessage ) {
* Log . e ( " ItemRef " , " Error deleting item : " + errorMessage ) ;
* < / pre >
* @ param onItemSnapshot
* The callback to call with the snapshot of affected item as an argument , when the operation is completed .
* @ param onError
* The callback to call if an exception occurred */
public void del ( final OnItemSnapshot onItemSnapshot , final OnError onError ) { } } | TableMetadata tm = context . getTableMeta ( this . table . name ) ; if ( tm == null ) { this . table . meta ( new OnTableMetadata ( ) { @ Override public void run ( TableMetadata tableMetadata ) { _del ( onItemSnapshot , onError ) ; } } , onError ) ; } else { this . _del ( onItemSnapshot , onError ) ; } return ; |
public class DavidBoxParserImpl { /** * { @ inheritDoc } */
public < T extends DavidBoxResponse > T parse ( Class < T > responseTargetClass , String xmlString ) throws TheDavidBoxClientException { } } | T response ; try { String xmlForParsing = prepareXmlForParsing ( xmlString ) ; response = ( T ) serializer . read ( responseTargetClass , xmlForParsing ) ; } catch ( Exception e ) { throw new TheDavidBoxClientException ( e ) ; } return response ; |
public class SimpleIOHandler { /** * Binds property .
* This method also throws exceptions related to binding .
* @ param triple A java object that represents an RDF Triple - domain - property - range .
* @ param model that is being populated . */
private void bindValue ( Triple triple , Model model ) { } } | if ( log . isDebugEnabled ( ) ) log . debug ( String . valueOf ( triple ) ) ; BioPAXElement domain = model . getByID ( triple . domain ) ; PropertyEditor editor = this . getEditorMap ( ) . getEditorForProperty ( triple . property , domain . getModelInterface ( ) ) ; bindValue ( triple . range , editor , domain , model ) ; |
public class CmsJspTagUserTracking { /** * Returns if the given resource is subscribed to the user or groups . < p >
* @ param cms the current users context
* @ param fileName the file name to track
* @ param subFolder flag indicating if sub folders should be included
* @ param user the user that should be used for the check
* @ param groups the groups that should be used for the check
* @ param req the current request
* @ return < code > true < / code > if the given resource is subscribed to the user or groups , otherwise < code > false < / code >
* @ throws CmsException if something goes wrong */
protected static boolean isResourceSubscribed ( CmsObject cms , String fileName , boolean subFolder , CmsUser user , List < CmsGroup > groups , HttpServletRequest req ) throws CmsException { } } | CmsResource checkResource = cms . readResource ( fileName ) ; HttpSession session = req . getSession ( true ) ; String sessionKey = generateSessionKey ( SESSION_PREFIX_SUBSCRIBED , fileName , subFolder , user , groups ) ; // try to get the subscribed resources from a session attribute
@ SuppressWarnings ( "unchecked" ) List < CmsResource > subscribedResources = ( List < CmsResource > ) session . getAttribute ( sessionKey ) ; if ( subscribedResources == null ) { // first call , read subscribed resources and store them to session attribute
CmsSubscriptionFilter filter = new CmsSubscriptionFilter ( ) ; filter . setParentPath ( CmsResource . getFolderPath ( checkResource . getRootPath ( ) ) ) ; filter . setIncludeSubfolders ( subFolder ) ; filter . setUser ( user ) ; filter . setGroups ( groups ) ; filter . setMode ( CmsSubscriptionReadMode . ALL ) ; subscribedResources = OpenCms . getSubscriptionManager ( ) . readSubscribedResources ( cms , filter ) ; session . setAttribute ( sessionKey , subscribedResources ) ; } return subscribedResources . contains ( checkResource ) ; |
public class UserStub { /** * Get random stub matching this user type
* @ param userType User type
* @ return Random stub */
public static UserStub getStubWithRandomParams ( UserTypeVal userType ) { } } | // Java coerces the return type as a Tuple2 of Objects - - but it ' s declared as a Tuple2 of Doubles !
// Oh the joys of type erasure .
Tuple2 < Double , Double > tuple = SocialNetworkUtilities . getRandomGeographicalLocation ( ) ; return new UserStub ( userType , new Tuple2 < > ( ( Double ) tuple . _1 ( ) , ( Double ) tuple . _2 ( ) ) , SocialNetworkUtilities . getRandomIsSecret ( ) ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getDataObjectFontDescriptorEncEnv ( ) { } } | if ( dataObjectFontDescriptorEncEnvEEnum == null ) { dataObjectFontDescriptorEncEnvEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 81 ) ; } return dataObjectFontDescriptorEncEnvEEnum ; |
public class TransformationDescription { /** * Adds a transformation step to this description */
public void addStep ( String operationName , List < String > sourceFields , String targetField , Map < String , String > parameters ) { } } | TransformationStep step = new TransformationStep ( ) ; step . setOperationName ( operationName ) ; step . setSourceFields ( sourceFields . toArray ( new String [ sourceFields . size ( ) ] ) ) ; step . setTargetField ( targetField ) ; step . setOperationParams ( parameters ) ; steps . add ( step ) ; |
public class ScriptUtils { /** * Render a script using the given parameter values */
public static String generateScript ( Script script , Map < String , Object > parameterValues ) { } } | StringWriter stringWriter = new StringWriter ( ) ; try { Template template = new Template ( null , new StringReader ( script . getContent ( ) ) , new Configuration ( VERSION ) ) ; template . process ( parameterValues , stringWriter ) ; } catch ( TemplateException | IOException e ) { throw new GenerateScriptException ( "Error processing parameters for script [" + script . getName ( ) + "]. " + e . getMessage ( ) ) ; } return stringWriter . toString ( ) ; |
public class Props { /** * Convert a URI - formatted string value to URI object */
public URI getUri ( final String name , final String defaultValue ) { } } | try { return getUri ( name , new URI ( defaultValue ) ) ; } catch ( final URISyntaxException e ) { throw new IllegalArgumentException ( e . getMessage ( ) ) ; } |
public class Math { /** * Returns the root of a function known to lie between x1 and x2 by
* Brent ' s method . The root will be refined until its accuracy is tol .
* The method is guaranteed to converge as long as the function can be
* evaluated within the initial interval known to contain a root .
* @ param func the function to be evaluated .
* @ param x1 the left end of search interval .
* @ param x2 the right end of search interval .
* @ param tol the accuracy tolerance .
* @ return the root . */
public static double root ( Function func , double x1 , double x2 , double tol ) { } } | return root ( func , x1 , x2 , tol , 100 ) ; |
public class CrossReferenceImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case XtextPackage . CROSS_REFERENCE__TYPE : setType ( ( TypeRef ) null ) ; return ; case XtextPackage . CROSS_REFERENCE__TERMINAL : setTerminal ( ( AbstractElement ) null ) ; return ; } super . eUnset ( featureID ) ; |
public class ResourceHandle { /** * a resource is valid if not ' null ' and resolvable */
public boolean isValid ( ) { } } | if ( valid == null ) { valid = ( this . resource != null ) ; if ( valid ) { valid = ( getResourceResolver ( ) . getResource ( getPath ( ) ) != null ) ; } } return valid ; |
public class NetworkInterfacesInner { /** * Get the specified network interface ip configuration in a virtual machine scale set .
* @ param resourceGroupName The name of the resource group .
* @ param virtualMachineScaleSetName The name of the virtual machine scale set .
* @ param virtualmachineIndex The virtual machine index .
* @ param networkInterfaceName The name of the network interface .
* @ param expand Expands referenced resources .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < List < NetworkInterfaceIPConfigurationInner > > listVirtualMachineScaleSetIpConfigurationsAsync ( final String resourceGroupName , final String virtualMachineScaleSetName , final String virtualmachineIndex , final String networkInterfaceName , final String expand , final ListOperationCallback < NetworkInterfaceIPConfigurationInner > serviceCallback ) { } } | return AzureServiceFuture . fromPageResponse ( listVirtualMachineScaleSetIpConfigurationsSinglePageAsync ( resourceGroupName , virtualMachineScaleSetName , virtualmachineIndex , networkInterfaceName , expand ) , new Func1 < String , Observable < ServiceResponse < Page < NetworkInterfaceIPConfigurationInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < NetworkInterfaceIPConfigurationInner > > > call ( String nextPageLink ) { return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ; |
public class UniPeriod { /** * D : days
* H : hours
* M : minutes
* S : seconds */
public String format ( String pattern ) { } } | long remain = diffInSeconds ; final Matcher daysMatcher = DAYS . matcher ( pattern ) ; if ( daysMatcher . find ( ) ) { final String daysFound = daysMatcher . group ( 1 ) ; final int d = ( int ) ( remain / DAY_IN_SECONDS ) ; remain = remain - d * DAY_IN_SECONDS ; final String f = String . format ( "%%0%dd" , daysFound . length ( ) ) ; pattern = pattern . replaceAll ( daysFound , String . format ( f , d ) ) ; } if ( pattern . contains ( "H" ) ) { final int h = ( int ) ( remain / HOUR_IN_SECONDS ) ; remain = remain - h * HOUR_IN_SECONDS ; pattern = pattern . replaceAll ( "H" , String . format ( "%02d" , h ) ) ; } if ( pattern . contains ( "M" ) ) { final int m = ( int ) ( remain / MINUTE_IN_SECONDS ) ; remain = remain - m * MINUTE_IN_SECONDS ; pattern = pattern . replaceAll ( "M" , String . format ( "%02d" , m ) ) ; } if ( pattern . contains ( "S" ) ) { pattern = pattern . replaceAll ( "S" , String . format ( "%02d" , remain ) ) ; } return pattern ; |
public class HpackDecoder { /** * because we use a ring buffer type construct , and don ' t actually shuffle
* items in the array , we need to figure out he real index to use .
* package private for unit tests
* @ param index The index from the hpack
* @ return the real index into the array */
int getRealIndex ( int index ) throws HpackException { } } | // the index is one based , but our table is zero based , hence - 1
// also because of our ring buffer setup the indexes are reversed
// index = 1 is at position firstSlotPosition + filledSlots
int newIndex = ( firstSlotPosition + ( filledTableSlots - index ) ) % headerTable . length ; if ( newIndex < 0 ) { throw UndertowMessages . MESSAGES . invalidHpackIndex ( index ) ; } return newIndex ; |
public class ModelsImpl { /** * Adds an intent classifier to the application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param name Name of the new entity extractor .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the UUID object */
public Observable < ServiceResponse < UUID > > addIntentWithServiceResponseAsync ( UUID appId , String versionId , String name ) { } } | if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgumentException ( "Parameter versionId is required and cannot be null." ) ; } ModelCreateObject intentCreateObject = new ModelCreateObject ( ) ; intentCreateObject . withName ( name ) ; String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . addIntent ( appId , versionId , this . client . acceptLanguage ( ) , intentCreateObject , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < UUID > > > ( ) { @ Override public Observable < ServiceResponse < UUID > > call ( Response < ResponseBody > response ) { try { ServiceResponse < UUID > clientResponse = addIntentDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class OneSEVPAs { /** * Calculates the equivalence ( " & lt ; = & gt ; " ) of two SEVPA , and stores the result in a given mutable SEVPA .
* @ param sevpa1
* the first SEVPA
* @ param sevpa2
* the second SEVPA
* @ param alphabet
* the input alphabet
* @ return a new SEVPA representing the conjunction of the specified SEVPA */
public static < L1 , L2 , I > OneSEVPA < Pair < L1 , L2 > , I > equiv ( final OneSEVPA < L1 , I > sevpa1 , final OneSEVPA < L2 , I > sevpa2 , final VPDAlphabet < I > alphabet ) { } } | return combine ( sevpa1 , sevpa2 , alphabet , AcceptanceCombiner . EQUIV ) ; |
public class OpenJPAEnhancerMojo { /** * Locates and returns a list of class files found under specified class
* directory .
* @ return list of class files .
* @ throws MojoExecutionException if there was an error scanning class file
* resources . */
protected List < File > findEntityClassFiles ( ) throws MojoExecutionException { } } | try { return FileUtils . getFiles ( classes , includes , excludes ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "Error while scanning for '" + includes + "' in " + "'" + classes . getAbsolutePath ( ) + "'." , e ) ; } |
public class DateTimeExtensions { /** * Formats this time with the provided { @ link java . time . format . DateTimeFormatter } pattern .
* @ param self a LocalDateTime
* @ param pattern the formatting pattern
* @ return a formatted String
* @ see java . time . format . DateTimeFormatter
* @ since 2.5.0 */
public static String format ( final LocalTime self , String pattern ) { } } | return self . format ( DateTimeFormatter . ofPattern ( pattern ) ) ; |
public class VFSStoreResource { /** * The method writes the context ( from the input stream ) to a temporary file
* ( same file URL , but with extension { @ link # EXTENSION _ TEMP } ) .
* @ param _ in input stream defined the content of the file
* @ param _ size length of the content ( or negative meaning that the length
* is not known ; then the content gets the length of readable
* bytes from the input stream )
* @ param _ fileName name of the file
* @ return size of the created temporary file object
* @ throws EFapsException on error */
@ Override public long write ( final InputStream _in , final long _size , final String _fileName ) throws EFapsException { } } | try { long size = _size ; final FileObject tmpFile = this . manager . resolveFile ( this . manager . getBaseFile ( ) , this . storeFileName + VFSStoreResource . EXTENSION_TEMP ) ; if ( ! tmpFile . exists ( ) ) { tmpFile . createFile ( ) ; } final FileContent content = tmpFile . getContent ( ) ; OutputStream out = content . getOutputStream ( false ) ; if ( getCompress ( ) . equals ( Compress . GZIP ) ) { out = new GZIPOutputStream ( out ) ; } else if ( getCompress ( ) . equals ( Compress . ZIP ) ) { out = new ZipOutputStream ( out ) ; } // if size is unkown !
if ( _size < 0 ) { int length = 1 ; size = 0 ; while ( length > 0 ) { length = _in . read ( this . buffer ) ; if ( length > 0 ) { out . write ( this . buffer , 0 , length ) ; size += length ; } } } else { Long length = _size ; while ( length > 0 ) { final int readLength = length . intValue ( ) < this . buffer . length ? length . intValue ( ) : this . buffer . length ; _in . read ( this . buffer , 0 , readLength ) ; out . write ( this . buffer , 0 , readLength ) ; length -= readLength ; } } if ( getCompress ( ) . equals ( Compress . GZIP ) || getCompress ( ) . equals ( Compress . ZIP ) ) { out . close ( ) ; } tmpFile . close ( ) ; setFileInfo ( _fileName , size ) ; return size ; } catch ( final IOException e ) { VFSStoreResource . LOG . error ( "write of content failed" , e ) ; throw new EFapsException ( VFSStoreResource . class , "write.IOException" , e ) ; } |
public class ExecuteSqlRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ExecuteSqlRequest executeSqlRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( executeSqlRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( executeSqlRequest . getAwsSecretStoreArn ( ) , AWSSECRETSTOREARN_BINDING ) ; protocolMarshaller . marshall ( executeSqlRequest . getDatabase ( ) , DATABASE_BINDING ) ; protocolMarshaller . marshall ( executeSqlRequest . getDbClusterOrInstanceArn ( ) , DBCLUSTERORINSTANCEARN_BINDING ) ; protocolMarshaller . marshall ( executeSqlRequest . getSchema ( ) , SCHEMA_BINDING ) ; protocolMarshaller . marshall ( executeSqlRequest . getSqlStatements ( ) , SQLSTATEMENTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CPOptionValuePersistenceImpl { /** * Returns the first cp option value in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching cp option value
* @ throws NoSuchCPOptionValueException if a matching cp option value could not be found */
@ Override public CPOptionValue findByUuid_C_First ( String uuid , long companyId , OrderByComparator < CPOptionValue > orderByComparator ) throws NoSuchCPOptionValueException { } } | CPOptionValue cpOptionValue = fetchByUuid_C_First ( uuid , companyId , orderByComparator ) ; if ( cpOptionValue != null ) { return cpOptionValue ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", companyId=" ) ; msg . append ( companyId ) ; msg . append ( "}" ) ; throw new NoSuchCPOptionValueException ( msg . toString ( ) ) ; |
public class HijriCalendar { /** * / * [ deutsch ]
* < p > Ermittelt das aktuelle Kalenderdatum in der Systemzeit . < / p >
* < p > Bequeme Abk & uuml ; rzung f & uuml ; r :
* { @ code SystemClock . inLocalView ( ) . now ( HijriCalendar . family ( ) , variant , startOfDay ) . toDate ( ) ) } . < / p >
* @ param variant calendar variant
* @ param startOfDay determines the exact time of day when the calendar date will change ( usually in the evening )
* @ return current calendar date in system time zone using the system clock
* @ see SystemClock # inLocalView ( )
* @ see net . time4j . ZonalClock # now ( CalendarFamily , String , StartOfDay )
* @ see StartOfDay # EVENING
* @ since 3.23/4.19 */
public static HijriCalendar nowInSystemTime ( String variant , StartOfDay startOfDay ) { } } | return SystemClock . inLocalView ( ) . now ( HijriCalendar . family ( ) , variant , startOfDay ) . toDate ( ) ; |
public class CmsFadeAnimation { /** * Fades the given element out of view executing the callback afterwards . < p >
* @ param element the element to fade out
* @ param callback the callback
* @ param duration the animation duration
* @ return the running animation object */
public static CmsFadeAnimation fadeOut ( Element element , Command callback , int duration ) { } } | CmsFadeAnimation animation = new CmsFadeAnimation ( element , false , callback ) ; animation . run ( duration ) ; return animation ; |
public class ServiceDirectoryFuture { /** * Get the Directory Request Response .
* { @ inheritDoc } */
@ Override public synchronized Response get ( long timeout , TimeUnit unit ) throws InterruptedException , ExecutionException , TimeoutException { } } | long now = System . currentTimeMillis ( ) ; long mills = unit . toMillis ( timeout ) ; long toWait = mills ; if ( this . completed ) { return this . getResult ( ) ; } else if ( toWait <= 0 ) { throw new TimeoutException ( "Timeout is smaller than 0." ) ; } else { for ( ; ; ) { wait ( toWait ) ; if ( this . completed ) { return this . getResult ( ) ; } long gap = System . currentTimeMillis ( ) - now ; toWait = toWait - gap ; if ( toWait <= 0 ) { throw new TimeoutException ( ) ; } } } |
public class GlobusGSSManagerImpl { /** * for initiators */
public GSSContext createContext ( GSSName peer , Oid mech , GSSCredential cred , int lifetime ) throws GSSException { } } | checkMechanism ( mech ) ; GlobusGSSCredentialImpl globusCred = null ; if ( cred == null ) { globusCred = ( GlobusGSSCredentialImpl ) createCredential ( GSSCredential . INITIATE_ONLY ) ; } else if ( cred instanceof GlobusGSSCredentialImpl ) { globusCred = ( GlobusGSSCredentialImpl ) cred ; } else { throw new GSSException ( GSSException . NO_CRED ) ; } GSSContext ctx = new GlobusGSSContextImpl ( peer , globusCred ) ; ctx . requestLifetime ( lifetime ) ; return ctx ; |
public class IOSafeTerminalAdapter { /** * Creates a wrapper around a Terminal that exposes it as a IOSafeTerminal . If any IOExceptions occur , they will be
* wrapped by a RuntimeException and re - thrown .
* @ param terminal Terminal to wrap
* @ return IOSafeTerminal wrapping the supplied terminal */
public static IOSafeTerminal createRuntimeExceptionConvertingAdapter ( Terminal terminal ) { } } | if ( terminal instanceof ExtendedTerminal ) { // also handle Runtime - type :
return createRuntimeExceptionConvertingAdapter ( ( ExtendedTerminal ) terminal ) ; } else { return new IOSafeTerminalAdapter ( terminal , new ConvertToRuntimeException ( ) ) ; } |
public class WeeklyOpeningHours { /** * Removes all opening hours that span more than one day and puts them as an extra range into the other day . Example : ' Fri
* 18:00-03:00 , Sat 09:00-18:00 ' will be converted to ' Fri 18:00-24:00 , Sat 00:00-03:00 + 09:00-18:00 ' .
* @ return Weekly opening hours with all opening hours inside the day . */
public WeeklyOpeningHours normalize ( ) { } } | final List < DayOpeningHours > days = new ArrayList < > ( ) ; for ( final DayOpeningHours doh : weeklyOpeningHours ) { final List < DayOpeningHours > normalized = doh . normalize ( ) ; for ( final DayOpeningHours normalizedDay : normalized ) { final int idx = days . indexOf ( normalizedDay ) ; if ( idx < 0 ) { days . add ( normalizedDay ) ; } else { final DayOpeningHours found = days . get ( idx ) ; final DayOpeningHours replacement = found . add ( normalizedDay ) ; days . set ( idx , replacement ) ; } } } Collections . sort ( days ) ; return new WeeklyOpeningHours ( days . toArray ( new DayOpeningHours [ days . size ( ) ] ) ) ; |
public class PoiAPI { /** * 创建门店
* @ param accessToken accessToken
* @ param poi poi
* @ return result */
public static BaseResult addPoi ( String accessToken , Poi poi ) { } } | return addPoi ( accessToken , JsonUtil . toJSONString ( poi ) ) ; |
public class Configurator { /** * Configure using the specified filename .
* @ param filename the filename of the properties file used for configuration .
* @ param isExternalFile the filename is from assets or external storage . */
public void configure ( String filename , boolean isExternalFile ) { } } | try { Properties properties ; InputStream inputStream ; if ( ! isExternalFile ) { Resources resources = context . getResources ( ) ; AssetManager assetManager = resources . getAssets ( ) ; inputStream = assetManager . open ( filename ) ; } else { inputStream = new FileInputStream ( filename ) ; } properties = loadProperties ( inputStream ) ; inputStream . close ( ) ; startConfiguration ( properties ) ; } catch ( IOException e ) { Log . e ( TAG , "Failed to open file. " + filename + " " + e ) ; } |
public class HashUserRealm { public void readExternal ( java . io . ObjectInput in ) throws java . io . IOException , ClassNotFoundException { } } | _realmName = ( String ) in . readObject ( ) ; _config = ( String ) in . readObject ( ) ; if ( _config != null ) load ( _config ) ; |
public class CmsClientProperty { /** * Helper method for removing empty properties from a map . < p >
* @ param props the map from which to remove empty properties */
public static void removeEmptyProperties ( Map < String , CmsClientProperty > props ) { } } | Iterator < Map . Entry < String , CmsClientProperty > > iter = props . entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Map . Entry < String , CmsClientProperty > entry = iter . next ( ) ; CmsClientProperty value = entry . getValue ( ) ; if ( value . isEmpty ( ) ) { iter . remove ( ) ; } } |
public class Lz4FrameEncoder { /** * Close this { @ link Lz4FrameEncoder } and so finish the encoding .
* The given { @ link ChannelFuture } will be notified once the operation
* completes and will also be returned . */
public ChannelFuture close ( final ChannelPromise promise ) { } } | ChannelHandlerContext ctx = ctx ( ) ; EventExecutor executor = ctx . executor ( ) ; if ( executor . inEventLoop ( ) ) { return finishEncode ( ctx , promise ) ; } else { executor . execute ( new Runnable ( ) { @ Override public void run ( ) { ChannelFuture f = finishEncode ( ctx ( ) , promise ) ; f . addListener ( new ChannelPromiseNotifier ( promise ) ) ; } } ) ; return promise ; } |
public class ListBonusPaymentsResult { /** * A successful request to the ListBonusPayments operation returns a list of BonusPayment objects .
* @ param bonusPayments
* A successful request to the ListBonusPayments operation returns a list of BonusPayment objects . */
public void setBonusPayments ( java . util . Collection < BonusPayment > bonusPayments ) { } } | if ( bonusPayments == null ) { this . bonusPayments = null ; return ; } this . bonusPayments = new java . util . ArrayList < BonusPayment > ( bonusPayments ) ; |
public class Bidi { /** * Return the index of the character past the end of the nth logical run in
* this line , as an offset from the start of the line . For example , this
* will return the length of the line for the last run on the line .
* @ param run the index of the run , between 0 and < code > countRuns ( ) < / code >
* @ return the limit of the run
* @ throws IllegalStateException if this call is not preceded by a successful
* call to < code > setPara < / code > or < code > setLine < / code >
* @ throws IllegalArgumentException if < code > run < / code > is not in
* the range < code > 0 & lt ; = run & lt ; countRuns ( ) < / code > */
public int getRunLimit ( int run ) { } } | verifyValidParaOrLine ( ) ; BidiLine . getRuns ( this ) ; verifyRange ( run , 0 , runCount ) ; getLogicalToVisualRunsMap ( ) ; int idx = logicalToVisualRunsMap [ run ] ; int len = idx == 0 ? runs [ idx ] . limit : runs [ idx ] . limit - runs [ idx - 1 ] . limit ; return runs [ idx ] . start + len ; |
public class AdminDisableProviderForUserRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AdminDisableProviderForUserRequest adminDisableProviderForUserRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( adminDisableProviderForUserRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( adminDisableProviderForUserRequest . getUserPoolId ( ) , USERPOOLID_BINDING ) ; protocolMarshaller . marshall ( adminDisableProviderForUserRequest . getUser ( ) , USER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class GetSpeechSynthesisTaskRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetSpeechSynthesisTaskRequest getSpeechSynthesisTaskRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getSpeechSynthesisTaskRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getSpeechSynthesisTaskRequest . getTaskId ( ) , TASKID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class IBAN { /** * Converts a plain to a pretty printed IBAN
* @ param value
* plain iban
* @ return pretty printed IBAN */
private static String addSpaces ( String value ) { } } | final int length = value . length ( ) ; final int lastPossibleBlock = length - 4 ; final StringBuilder sb = new StringBuilder ( length + ( length - 1 ) / 4 ) ; int i ; for ( i = 0 ; i < lastPossibleBlock ; i += 4 ) { sb . append ( value , i , i + 4 ) ; sb . append ( ' ' ) ; } sb . append ( value , i , length ) ; return sb . toString ( ) ; |
public class HsftpFileSystem { /** * Set up SSL resources */
private static void setupSsl ( Configuration conf ) { } } | Configuration sslConf = new Configuration ( false ) ; sslConf . addResource ( conf . get ( "dfs.https.client.keystore.resource" , "ssl-client.xml" ) ) ; System . setProperty ( "javax.net.ssl.trustStore" , sslConf . get ( "ssl.client.truststore.location" , "" ) ) ; System . setProperty ( "javax.net.ssl.trustStorePassword" , sslConf . get ( "ssl.client.truststore.password" , "" ) ) ; System . setProperty ( "javax.net.ssl.trustStoreType" , sslConf . get ( "ssl.client.truststore.type" , "jks" ) ) ; System . setProperty ( "javax.net.ssl.keyStore" , sslConf . get ( "ssl.client.keystore.location" , "" ) ) ; System . setProperty ( "javax.net.ssl.keyStorePassword" , sslConf . get ( "ssl.client.keystore.password" , "" ) ) ; System . setProperty ( "javax.net.ssl.keyPassword" , sslConf . get ( "ssl.client.keystore.keypassword" , "" ) ) ; System . setProperty ( "javax.net.ssl.keyStoreType" , sslConf . get ( "ssl.client.keystore.type" , "jks" ) ) ; |
public class PluginGroup { /** * Returns a new { @ link PluginGroup } which holds the { @ link Plugin } s loaded from the classpath .
* { @ code null } is returned if there is no { @ link Plugin } whose target equals to the specified
* { @ code target } .
* @ param target the { @ link PluginTarget } which would be loaded */
@ Nullable static PluginGroup loadPlugins ( PluginTarget target , CentralDogmaConfig config ) { } } | return loadPlugins ( PluginGroup . class . getClassLoader ( ) , target , config ) ; |
public class AsyncAppender { /** * Sets the number of messages allowed in the event buffer
* before the calling thread is blocked ( if blocking is true )
* or until messages are summarized and discarded . Changing
* the size will not affect messages already in the buffer .
* @ param size buffer size , must be positive . */
public void setBufferSize ( final int size ) { } } | // log4j 1.2 would throw exception if size was negative
// and deadlock if size was zero .
if ( size < 0 ) { throw new java . lang . NegativeArraySizeException ( "size" ) ; } synchronized ( buffer ) { // don ' t let size be zero .
bufferSize = ( size < 1 ) ? 1 : size ; buffer . notifyAll ( ) ; } |
public class ApiOvhEmaildomain { /** * Get this object properties
* REST : GET / email / domain / { domain } / task / filter / { id }
* @ param domain [ required ] Name of your domain name
* @ param id [ required ] Id of task */
public OvhTaskFilter domain_task_filter_id_GET ( String domain , Long id ) throws IOException { } } | String qPath = "/email/domain/{domain}/task/filter/{id}" ; StringBuilder sb = path ( qPath , domain , id ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhTaskFilter . class ) ; |
public class SslConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SslConfiguration sslConfiguration , ProtocolMarshaller protocolMarshaller ) { } } | if ( sslConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sslConfiguration . getCertificate ( ) , CERTIFICATE_BINDING ) ; protocolMarshaller . marshall ( sslConfiguration . getPrivateKey ( ) , PRIVATEKEY_BINDING ) ; protocolMarshaller . marshall ( sslConfiguration . getChain ( ) , CHAIN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class MaterialStepper { /** * Specific method to add { @ link MaterialStep } s to the stepper . */
public void add ( MaterialStep step ) { } } | this . add ( ( Widget ) step ) ; step . setAxis ( getAxis ( ) ) ; registerHandler ( step . addSelectionHandler ( this ) ) ; totalSteps ++ ; |
public class ConditionalCheck { /** * Ensures that a passed parameter of the calling method is not empty , using the passed expression to evaluate the
* emptiness .
* @ param condition
* condition must be { @ code true } ^ so that the check will be performed
* @ param expression
* the result of the expression to verify the emptiness of a reference ( { @ code true } means empty ,
* { @ code false } means not empty )
* @ param name
* name of object reference ( in source code )
* @ throws IllegalEmptyArgumentException
* if the given argument { @ code reference } is empty */
@ ArgumentsChecked @ Throws ( { } } | IllegalNullArgumentException . class , IllegalEmptyArgumentException . class } ) public static void notEmpty ( final boolean condition , final boolean expression , @ Nullable final String name ) { if ( condition ) { Check . notEmpty ( expression , name ) ; } |
public class RedisEncoder { /** * Write full constructed array message . */
private void writeArrayMessage ( ByteBufAllocator allocator , ArrayRedisMessage msg , List < Object > out ) { } } | if ( msg . isNull ( ) ) { writeArrayHeader ( allocator , msg . isNull ( ) , RedisConstants . NULL_VALUE , out ) ; } else { writeArrayHeader ( allocator , msg . isNull ( ) , msg . children ( ) . size ( ) , out ) ; for ( RedisMessage child : msg . children ( ) ) { writeRedisMessage ( allocator , child , out ) ; } } |
public class FileMessageSet { /** * Append this message to the message set
* @ param messages message to append
* @ return the written size and first offset
* @ throws IOException file write exception */
public long [ ] append ( MessageSet messages ) throws IOException { } } | checkMutable ( ) ; long written = 0L ; while ( written < messages . getSizeInBytes ( ) ) written += messages . writeTo ( channel , 0 , messages . getSizeInBytes ( ) ) ; long beforeOffset = setSize . getAndAdd ( written ) ; return new long [ ] { written , beforeOffset } ; |
public class SDDL { /** * Gets size in terms of number of bytes .
* @ return size . */
public int getSize ( ) { } } | return 20 + ( sacl == null ? 0 : sacl . getSize ( ) ) + ( dacl == null ? 0 : dacl . getSize ( ) ) + ( owner == null ? 0 : owner . getSize ( ) ) + ( group == null ? 0 : group . getSize ( ) ) ; |
public class Parsable { /** * Store a newly parsed value in the result set */
void setRootDissection ( final String type , final String value ) { } } | LOG . debug ( "Got root dissection: type={}" , type ) ; // The root name is an empty string
final ParsedField parsedfield = new ParsedField ( type , "" , value ) ; cache . put ( parsedfield . getId ( ) , parsedfield ) ; toBeParsed . add ( parsedfield ) ; |
public class Type { /** * Constructs a new instance corresponding to the specified SQL type .
* @ param sqlType
* the corresponding SQL type
* @ return a new instance corresponding to the specified SQL type */
public static Type newInstance ( int sqlType ) { } } | switch ( sqlType ) { case ( java . sql . Types . INTEGER ) : return INTEGER ; case ( java . sql . Types . BIGINT ) : return BIGINT ; case ( java . sql . Types . DOUBLE ) : return DOUBLE ; case ( java . sql . Types . VARCHAR ) : return VARCHAR ; } throw new UnsupportedOperationException ( "Unspported SQL type: " + sqlType ) ; |
public class FullKeyMapper { /** * Adds to the specified Lucene { @ link Document } the full row key formed by the specified partition key and the
* clustering key .
* @ param document A Lucene { @ link Document } .
* @ param partitionKey A partition key .
* @ param clusteringKey A clustering key . */
public void addFields ( Document document , DecoratedKey partitionKey , CellName clusteringKey ) { } } | ByteBuffer fullKey = byteBuffer ( partitionKey , clusteringKey ) ; Field field = new StringField ( FIELD_NAME , ByteBufferUtils . toString ( fullKey ) , Store . NO ) ; document . add ( field ) ; |
public class DataDictionaryGenerator { /** * Field | Type | Null | Key | Default | Remarks
* id | int ( 11 ) | NO | PRI | NULL | remarks here */
protected void genCell ( int columnMaxLen , String preChar , String value , String fillChar , String postChar , StringBuilder ret ) { } } | ret . append ( preChar ) ; ret . append ( value ) ; for ( int i = 0 , n = columnMaxLen - value . length ( ) + 1 ; i < n ; i ++ ) { ret . append ( fillChar ) ; // 值后的填充字符 , 值为 " " 、 " - "
} ret . append ( postChar ) ; |
public class AlbumUtils { /** * Get the MD5 value of string .
* @ param content the target string .
* @ return the MD5 value . */
public static String getMD5ForString ( String content ) { } } | StringBuilder md5Buffer = new StringBuilder ( ) ; try { MessageDigest digest = MessageDigest . getInstance ( "MD5" ) ; byte [ ] tempBytes = digest . digest ( content . getBytes ( ) ) ; int digital ; for ( int i = 0 ; i < tempBytes . length ; i ++ ) { digital = tempBytes [ i ] ; if ( digital < 0 ) { digital += 256 ; } if ( digital < 16 ) { md5Buffer . append ( "0" ) ; } md5Buffer . append ( Integer . toHexString ( digital ) ) ; } } catch ( Exception ignored ) { return Integer . toString ( content . hashCode ( ) ) ; } return md5Buffer . toString ( ) ; |
public class BDTImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . BDT__DOC_NAME : setDocName ( ( String ) newValue ) ; return ; case AfplibPackage . BDT__RESERVED : setReserved ( ( Integer ) newValue ) ; return ; case AfplibPackage . BDT__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class ProvisionedProductPlanDetails { /** * Parameters specified by the administrator that are required for provisioning the product .
* @ param provisioningParameters
* Parameters specified by the administrator that are required for provisioning the product . */
public void setProvisioningParameters ( java . util . Collection < UpdateProvisioningParameter > provisioningParameters ) { } } | if ( provisioningParameters == null ) { this . provisioningParameters = null ; return ; } this . provisioningParameters = new java . util . ArrayList < UpdateProvisioningParameter > ( provisioningParameters ) ; |
public class LocationStepQueryNode { /** * { @ inheritDoc }
* @ throws RepositoryException */
public Object accept ( QueryNodeVisitor visitor , Object data ) throws RepositoryException { } } | return visitor . visit ( this , data ) ; |
public class NiftyOpenSslServerContext { /** * Sets the SSL session ticket keys of this context . */
public void setTicketKeys ( SessionTicketKey [ ] keys ) { } } | if ( keys == null ) { throw new NullPointerException ( "keys" ) ; } SSLContext . setSessionTicketKeys ( ctx , keys ) ; |
public class JdbcCpoAdapter { /** * DOCUMENT ME !
* @ param obj DOCUMENT ME !
* @ param type DOCUMENT ME !
* @ param name DOCUMENT ME !
* @ param c DOCUMENT ME !
* @ return DOCUMENT ME !
* @ throws CpoException DOCUMENT ME ! */
protected < T > String getGroupType ( T obj , String type , String name , Connection c ) throws CpoException { } } | String retType = type ; long objCount ; if ( JdbcCpoAdapter . PERSIST_GROUP . equals ( retType ) ) { objCount = existsObject ( name , obj , c , null ) ; if ( objCount == 0 ) { retType = JdbcCpoAdapter . CREATE_GROUP ; } else if ( objCount == 1 ) { retType = JdbcCpoAdapter . UPDATE_GROUP ; } else { throw new CpoException ( "Persist can only UPDATE one record. Your EXISTS function returned 2 or more." ) ; } } return retType ; |
public class DataCubeIo { /** * Hand off a batch to the DbHarness layer , retrying on FullQueueException . */
private Future < ? > runBatch ( Batch < T > batch ) throws InterruptedException { } } | while ( true ) { try { runBatchMeter . mark ( ) ; if ( perRollupMetrics ) { batch . getMap ( ) . forEach ( ( addr , op ) -> { if ( addr . getSourceRollup ( ) . isPresent ( ) ) { updateRollupHistogram ( rollupWriteSize , addr . getSourceRollup ( ) . get ( ) , "rollupWriteSize" , op ) ; } } ) ; } return db . runBatchAsync ( batch , flushErrorHandler ) ; } catch ( FullQueueException e ) { asyncQueueBackoffMeter . mark ( ) ; // Sleeping and retrying like this means batches may be flushed out of order
log . debug ( "Async queue is full, retrying soon" ) ; Thread . sleep ( 100 ) ; } } |
public class AbstractInstanceRegistry { /** * Get the N instances that are most recently registered .
* @ return */
@ Override public List < Pair < Long , String > > getLastNRegisteredInstances ( ) { } } | List < Pair < Long , String > > list = new ArrayList < Pair < Long , String > > ( ) ; synchronized ( recentRegisteredQueue ) { for ( Pair < Long , String > aRecentRegisteredQueue : recentRegisteredQueue ) { list . add ( aRecentRegisteredQueue ) ; } } Collections . reverse ( list ) ; return list ; |
public class SoftAllocationUrl { /** * Get Resource Url for AddSoftAllocations
* @ return String Resource Url */
public static MozuUrl addSoftAllocationsUrl ( ) { } } | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/softallocations/" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; |
public class DiscriminationProcessImpl { /** * add a discriminatorNode to the linked list .
* @ param dn */
private void addDiscriminatorNode ( DiscriminatorNode dn ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "addDiscriminatorNode, weight=" + dn . weight ) ; } if ( discriminators == null ) { // add it as the first node
discriminators = dn ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addDiscriminatorNode" ) ; } return ; } DiscriminatorNode thisDN = discriminators ; if ( thisDN . weight > dn . weight ) { // add it as the first node
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Adding disc first in list" ) ; } thisDN . prev = dn ; dn . next = thisDN ; discriminators = dn ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addDiscriminatorNode" ) ; } return ; } DiscriminatorNode lastDN = discriminators ; while ( thisDN . next != null ) { // somewhere in the middle
lastDN = thisDN ; thisDN = thisDN . next ; if ( thisDN . weight > dn . weight ) { // put it in the middle
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Adding disc before " + thisDN . disc . getChannel ( ) . getName ( ) ) ; } thisDN . prev = dn ; dn . next = thisDN ; lastDN . next = dn ; dn . prev = lastDN ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addDiscriminatorNode" ) ; } return ; } } // guess its at the end
thisDN . next = dn ; dn . prev = thisDN ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addDiscriminatorNode" ) ; } |
public class StreamingJsonSerializer { /** * / * ( non - Javadoc )
* @ see org . ektorp . impl . JsonSerializer # toJson ( java . lang . Object ) */
public String toJson ( Object o ) { } } | try { String json = objectMapper . writeValueAsString ( o ) ; LOG . debug ( json ) ; return json ; } catch ( Exception e ) { throw Exceptions . propagate ( e ) ; } |
public class CurrentMetricResult { /** * The < code > Collections < / code > for the < code > CurrentMetricResult < / code > object .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCollections ( java . util . Collection ) } or { @ link # withCollections ( java . util . Collection ) } if you want to
* override the existing values .
* @ param collections
* The < code > Collections < / code > for the < code > CurrentMetricResult < / code > object .
* @ return Returns a reference to this object so that method calls can be chained together . */
public CurrentMetricResult withCollections ( CurrentMetricData ... collections ) { } } | if ( this . collections == null ) { setCollections ( new java . util . ArrayList < CurrentMetricData > ( collections . length ) ) ; } for ( CurrentMetricData ele : collections ) { this . collections . add ( ele ) ; } return this ; |
public class Sendinblue { /** * Get a particular campaign detail .
* @ param { Object } data contains json objects as a key value pair from HashMap .
* @ options data { Integer } id : Unique Id of the campaign [ Mandatory ] */
public String get_campaign_v2 ( Map < String , Object > data ) { } } | String id = data . get ( "id" ) . toString ( ) ; return get ( "campaign/" + id + "/detailsv2/" , EMPTY_STRING ) ; |
public class FctConvertersToFromString { /** * < p > Lazy get CnvTfsInteger . < / p >
* @ return requested CnvTfsInteger
* @ throws Exception - an exception */
protected final CnvTfsInteger lazyGetCnvTfsInteger ( ) throws Exception { } } | CnvTfsInteger convrt = ( CnvTfsInteger ) this . convertersMap . get ( CnvTfsInteger . class . getSimpleName ( ) ) ; if ( convrt == null ) { convrt = new CnvTfsInteger ( ) ; this . convertersMap . put ( CnvTfsInteger . class . getSimpleName ( ) , convrt ) ; } return convrt ; |
public class ConfigureForm { /** * Determines who should get replies to items .
* @ return Who should get the reply */
public ItemReply getItemReply ( ) { } } | String value = getFieldValue ( ConfigureNodeFields . itemreply ) ; if ( value == null ) return null ; else return ItemReply . valueOf ( value ) ; |
public class ServletOutputStreamImpl { /** * { @ inheritDoc } */
public void close ( ) throws IOException { } } | if ( servletRequestContext . getOriginalRequest ( ) . getDispatcherType ( ) == DispatcherType . INCLUDE || servletRequestContext . getOriginalResponse ( ) . isTreatAsCommitted ( ) ) { return ; } if ( listener == null ) { if ( anyAreSet ( state , FLAG_CLOSED ) ) return ; setFlags ( FLAG_CLOSED ) ; clearFlags ( FLAG_READY ) ; if ( allAreClear ( state , FLAG_WRITE_STARTED ) && channel == null && servletRequestContext . getOriginalResponse ( ) . getHeader ( Headers . CONTENT_LENGTH_STRING ) == null ) { if ( servletRequestContext . getOriginalResponse ( ) . getHeader ( Headers . TRANSFER_ENCODING_STRING ) == null && servletRequestContext . getExchange ( ) . getAttachment ( HttpAttachments . RESPONSE_TRAILER_SUPPLIER ) == null && servletRequestContext . getExchange ( ) . getAttachment ( HttpAttachments . RESPONSE_TRAILERS ) == null ) { if ( buffer == null ) { servletRequestContext . getExchange ( ) . getResponseHeaders ( ) . put ( Headers . CONTENT_LENGTH , "0" ) ; } else { servletRequestContext . getExchange ( ) . getResponseHeaders ( ) . put ( Headers . CONTENT_LENGTH , Integer . toString ( buffer . position ( ) ) ) ; } } } try { if ( buffer != null ) { writeBufferBlocking ( true ) ; } if ( channel == null ) { channel = servletRequestContext . getExchange ( ) . getResponseChannel ( ) ; } setFlags ( FLAG_DELEGATE_SHUTDOWN ) ; StreamSinkChannel channel = this . channel ; if ( channel != null ) { // mock requests
channel . shutdownWrites ( ) ; Channels . flushBlocking ( channel ) ; } } catch ( IOException | RuntimeException | Error e ) { IoUtils . safeClose ( this . channel ) ; throw e ; } finally { if ( pooledBuffer != null ) { pooledBuffer . close ( ) ; buffer = null ; } else { buffer = null ; } } } else { closeAsync ( ) ; } |
public class JBBPParser { /** * Parse a byte array content .
* @ param array a byte array which content should be parsed , it must not be
* null
* @ return the parsed content as the root structure
* @ throws IOException it will be thrown for transport errors */
public JBBPFieldStruct parse ( final byte [ ] array ) throws IOException { } } | JBBPUtils . assertNotNull ( array , "Array must not be null" ) ; return this . parse ( new ByteArrayInputStream ( array ) , null , null ) ; |
public class PaymentProtocol { /** * Create a standard pay to address output for usage in { @ link # createPaymentRequest } and
* { @ link # createPaymentMessage } .
* @ param amount amount to pay , or null
* @ param address address to pay to
* @ return output */
public static Protos . Output createPayToAddressOutput ( @ Nullable Coin amount , Address address ) { } } | Protos . Output . Builder output = Protos . Output . newBuilder ( ) ; if ( amount != null ) { final NetworkParameters params = address . getParameters ( ) ; if ( params . hasMaxMoney ( ) && amount . compareTo ( params . getMaxMoney ( ) ) > 0 ) throw new IllegalArgumentException ( "Amount too big: " + amount ) ; output . setAmount ( amount . value ) ; } else { output . setAmount ( 0 ) ; } output . setScript ( ByteString . copyFrom ( ScriptBuilder . createOutputScript ( address ) . getProgram ( ) ) ) ; return output . build ( ) ; |
public class GetLicenseConfigurationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetLicenseConfigurationRequest getLicenseConfigurationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getLicenseConfigurationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getLicenseConfigurationRequest . getLicenseConfigurationArn ( ) , LICENSECONFIGURATIONARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class BeansImpl { /** * If not already created , a new < code > decorators < / code > element with the given value will be created .
* Otherwise , the existing < code > decorators < / code > element will be returned .
* @ return a new or existing instance of < code > Decorators < Beans < T > > < / code > */
public Decorators < Beans < T > > getOrCreateDecorators ( ) { } } | Node node = childNode . getOrCreate ( "decorators" ) ; Decorators < Beans < T > > decorators = new DecoratorsImpl < Beans < T > > ( this , "decorators" , childNode , node ) ; return decorators ; |
public class Where { /** * Same as { @ link # in ( String , Iterable ) } except with a NOT IN clause . */
public Where < T , ID > notIn ( String columnName , Iterable < ? > objects ) throws SQLException { } } | addClause ( new In ( columnName , findColumnFieldType ( columnName ) , objects , false ) ) ; return this ; |
public class NestedClassWriterImpl { /** * { @ inheritDoc } */
protected void addSummaryLink ( LinkInfoImpl . Kind context , ClassDoc cd , ProgramElementDoc member , Content tdSummary ) { } } | Content memberLink = HtmlTree . SPAN ( HtmlStyle . memberNameLink , writer . getLink ( new LinkInfoImpl ( configuration , context , ( ClassDoc ) member ) ) ) ; Content code = HtmlTree . CODE ( memberLink ) ; tdSummary . addContent ( code ) ; |
public class BoneCP { /** * Release a connection by placing the connection back in the pool .
* @ param connectionHandle Connection being released .
* @ throws SQLException */
protected void internalReleaseConnection ( ConnectionHandle connectionHandle ) throws SQLException { } } | if ( ! this . cachedPoolStrategy ) { connectionHandle . clearStatementCaches ( false ) ; } if ( connectionHandle . getReplayLog ( ) != null ) { connectionHandle . getReplayLog ( ) . clear ( ) ; connectionHandle . recoveryResult . getReplaceTarget ( ) . clear ( ) ; } if ( connectionHandle . isExpired ( ) || ( ! this . poolShuttingDown && connectionHandle . isPossiblyBroken ( ) && ! isConnectionHandleAlive ( connectionHandle ) ) ) { if ( connectionHandle . isExpired ( ) ) { connectionHandle . internalClose ( ) ; } ConnectionPartition connectionPartition = connectionHandle . getOriginatingPartition ( ) ; postDestroyConnection ( connectionHandle ) ; maybeSignalForMoreConnections ( connectionPartition ) ; connectionHandle . clearStatementCaches ( true ) ; return ; // don ' t place back in queue - connection is broken or expired .
} connectionHandle . setConnectionLastUsedInMs ( System . currentTimeMillis ( ) ) ; if ( ! this . poolShuttingDown ) { putConnectionBackInPartition ( connectionHandle ) ; } else { connectionHandle . internalClose ( ) ; } |
public class cmppolicylabel { /** * Use this API to fetch filtered set of cmppolicylabel resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static cmppolicylabel [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | cmppolicylabel obj = new cmppolicylabel ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; cmppolicylabel [ ] response = ( cmppolicylabel [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class CipherUtil { /** * Encrypts the content with the specified key using the default algorithm .
* @ param key The cryptographic key .
* @ param content The content to encrypt .
* @ return The encrypted content .
* @ throws Exception Unspecified exception . */
public static String encrypt ( Key key , String content ) throws Exception { } } | try { Cipher cipher = Cipher . getInstance ( CRYPTO_ALGORITHM ) ; cipher . init ( Cipher . ENCRYPT_MODE , key ) ; return Base64 . encodeBase64String ( cipher . doFinal ( content . getBytes ( ) ) ) ; } catch ( Exception e ) { log . error ( "Error while encrypting" , e ) ; throw e ; } |
public class DateTime { /** * 转换字符串为Date
* @ param dateStr 日期字符串
* @ param parser { @ link FastDateFormat }
* @ return { @ link Date } */
private static Date parse ( String dateStr , DateParser parser ) { } } | Assert . notNull ( parser , "Parser or DateFromat must be not null !" ) ; Assert . notBlank ( dateStr , "Date String must be not blank !" ) ; try { return parser . parse ( dateStr ) ; } catch ( Exception e ) { throw new DateException ( "Parse [{}] with format [{}] error!" , dateStr , parser . getPattern ( ) , e ) ; } |
public class ThreadCpuStats { /** * Utility function that dumps the cpu usages for the threads to stdout . Output will be sorted
* based on the 1 - minute usage from highest to lowest .
* @ param out stream where output will be written
* @ param cmp order to use for the results */
public void printThreadCpuUsages ( OutputStream out , CpuUsageComparator cmp ) { } } | final PrintWriter writer = getPrintWriter ( out ) ; final Map < String , Object > threadCpuUsages = getThreadCpuUsages ( cmp ) ; writer . printf ( "Time: %s%n%n" , new Date ( ( Long ) threadCpuUsages . get ( CURRENT_TIME ) ) ) ; final long uptimeMillis = ( Long ) threadCpuUsages . get ( UPTIME_MS ) ; final long uptimeNanos = TimeUnit . NANOSECONDS . convert ( uptimeMillis , TimeUnit . MILLISECONDS ) ; writer . printf ( "Uptime: %s%n%n" , toDuration ( uptimeNanos ) ) ; @ SuppressWarnings ( "unchecked" ) final Map < String , Long > jvmUsageTime = ( Map < String , Long > ) threadCpuUsages . get ( JVM_USAGE_TIME ) ; writer . println ( "JVM Usage Time: " ) ; writer . printf ( "%11s %11s %11s %11s %7s %s%n" , "1-min" , "5-min" , "15-min" , "overall" , "id" , "name" ) ; writer . printf ( "%11s %11s %11s %11s %7s %s%n" , toDuration ( jvmUsageTime . get ( ONE_MIN ) ) , toDuration ( jvmUsageTime . get ( FIVE_MIN ) ) , toDuration ( jvmUsageTime . get ( FIFTEEN_MIN ) ) , toDuration ( jvmUsageTime . get ( OVERALL ) ) , "-" , "jvm" ) ; writer . println ( ) ; @ SuppressWarnings ( "unchecked" ) final Map < String , Double > jvmUsagePerc = ( Map < String , Double > ) threadCpuUsages . get ( JVM_USAGE_PERCENT ) ; writer . println ( "JVM Usage Percent: " ) ; writer . printf ( "%11s %11s %11s %11s %7s %s%n" , "1-min" , "5-min" , "15-min" , "overall" , "id" , "name" ) ; writer . printf ( "%10.2f%% %10.2f%% %10.2f%% %10.2f%% %7s %s%n" , jvmUsagePerc . get ( ONE_MIN ) , jvmUsagePerc . get ( FIVE_MIN ) , jvmUsagePerc . get ( FIFTEEN_MIN ) , jvmUsagePerc . get ( OVERALL ) , "-" , "jvm" ) ; writer . println ( ) ; writer . println ( "Breakdown by thread (100% = total cpu usage for jvm):" ) ; writer . printf ( "%11s %11s %11s %11s %7s %s%n" , "1-min" , "5-min" , "15-min" , "overall" , "id" , "name" ) ; @ SuppressWarnings ( "unchecked" ) List < Map < String , Object > > threads = ( List < Map < String , Object > > ) threadCpuUsages . get ( THREADS ) ; for ( Map < String , Object > thread : threads ) { writer . printf ( "%10.2f%% %10.2f%% %10.2f%% %10.2f%% %7d %s%n" , thread . get ( ONE_MIN ) , thread . get ( FIVE_MIN ) , thread . get ( FIFTEEN_MIN ) , thread . get ( OVERALL ) , thread . get ( ID ) , thread . get ( NAME ) ) ; } writer . println ( ) ; writer . flush ( ) ; |
public class Assert { /** * Asserts that two { @ link Object objects } are the same { @ link Object } as determined by the identity comparison .
* The assertion holds if and only if the two { @ link Object objects } are the same { @ link Object } in memory .
* @ param obj1 { @ link Object left operand } in the identity comparison .
* @ param obj2 { @ link Object right operand } in the identity comparison .
* @ param message { @ link Supplier } containing the message used in the { @ link IdentityException } thrown
* if the assertion fails .
* @ throws org . cp . elements . lang . IdentityException if the two { @ link Object objects } are not the same .
* @ see java . lang . Object */
public static void same ( Object obj1 , Object obj2 , Supplier < String > message ) { } } | if ( obj1 != obj2 ) { throw new IdentityException ( message . get ( ) ) ; } |
public class IssueDescriptionReader { /** * Extracts the stacktrace MD5 custom field value from the issue .
* @ param pIssue
* the issue
* @ return the stacktrace MD5
* @ throws IssueParseException
* issue doesn ' t contains a stack trace md5 custom field */
private String getStacktraceMD5 ( final Issue pIssue ) throws IssueParseException { } } | final int stackCfId = ConfigurationManager . getInstance ( ) . CHILIPROJECT_STACKTRACE_MD5_CF_ID ; final Predicate findStacktraceMD5 = new CustomFieldIdPredicate ( stackCfId ) ; final CustomField field = ( CustomField ) CollectionUtils . find ( pIssue . getCustomFields ( ) , findStacktraceMD5 ) ; if ( null == field ) { throw new IssueParseException ( String . format ( "Issue %d doesn't contains a custom_field id=%d" , pIssue . getId ( ) , stackCfId ) ) ; } return field . getValue ( ) ; |
public class FileParameter { /** * Save an file as a given destination file .
* @ param destFile the destination file
* @ param overwrite whether to overwrite if it already exists
* @ return a saved file
* @ throws IOException if an I / O error has occurred */
public File saveAs ( File destFile , boolean overwrite ) throws IOException { } } | if ( destFile == null ) { throw new IllegalArgumentException ( "destFile can not be null" ) ; } try { destFile = determineDestinationFile ( destFile , overwrite ) ; final byte [ ] buffer = new byte [ DEFAULT_BUFFER_SIZE ] ; int len ; try ( InputStream input = getInputStream ( ) ; OutputStream output = new FileOutputStream ( destFile ) ) { while ( ( len = input . read ( buffer ) ) != - 1 ) { output . write ( buffer , 0 , len ) ; } } } catch ( Exception e ) { throw new IOException ( "Could not save as file " + destFile , e ) ; } setSavedFile ( destFile ) ; return destFile ; |
public class BuildDatabase { /** * Get a List of all the Topic nodes in the Database .
* @ return A list of ITopicNode objects . */
public List < ITopicNode > getAllTopicNodes ( ) { } } | final ArrayList < ITopicNode > topicNodes = new ArrayList < ITopicNode > ( ) ; for ( final Entry < Integer , List < ITopicNode > > topicEntry : topics . entrySet ( ) ) { topicNodes . addAll ( topicEntry . getValue ( ) ) ; } return topicNodes ; |
public class BinomialDistributionTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case BpsimPackage . BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY : return getProbability ( ) ; case BpsimPackage . BINOMIAL_DISTRIBUTION_TYPE__TRIALS : return getTrials ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class BlockBox { /** * Lay out inline boxes inside of this block */
protected void layoutInline ( ) { } } | int x1 = fleft . getWidth ( floatY ) - floatXl ; // available width with considering floats
int x2 = fright . getWidth ( floatY ) - floatXr ; if ( x1 < 0 ) x1 = 0 ; if ( x2 < 0 ) x2 = 0 ; int wlimit = getAvailableContentWidth ( ) ; int minx1 = 0 - floatXl ; // maximal available width if there were no floats
int minx2 = 0 - floatXr ; if ( minx1 < 0 ) minx1 = 0 ; if ( minx2 < 0 ) minx2 = 0 ; int x = x1 ; // current x
int y = 0 ; // current y
int lnstr = 0 ; // the index of the first subbox on current line
int lastbreak = 0 ; // last possible position of a line break
// apply indentation
x += indent ; // line boxes
Vector < LineBox > lines = new Vector < LineBox > ( ) ; LineBox curline = firstLine ; if ( curline == null ) curline = new LineBox ( this , 0 , 0 ) ; lines . add ( curline ) ; for ( int i = 0 ; i < getSubBoxNumber ( ) ; i ++ ) { Box subbox = getSubBox ( i ) ; // if we find a block here , it must be an out - of - flow box
// make the positioning and continue
if ( subbox . isBlock ( ) ) { BlockBox sb = ( BlockBox ) subbox ; BlockLayoutStatus stat = new BlockLayoutStatus ( ) ; stat . inlineWidth = x - x1 ; stat . y = y ; stat . maxh = 0 ; boolean atstart = ( x <= x1 ) ; // check if the line has already started
// clear set - try to find the first possible Y value
if ( sb . getClearing ( ) != CLEAR_NONE ) { int ny = stat . y ; if ( sb . getClearing ( ) == CLEAR_LEFT ) ny = fleft . getMaxY ( ) - floatY ; else if ( sb . getClearing ( ) == CLEAR_RIGHT ) ny = fright . getMaxY ( ) - floatY ; else if ( sb . getClearing ( ) == CLEAR_BOTH ) ny = Math . max ( fleft . getMaxY ( ) , fright . getMaxY ( ) ) - floatY ; if ( stat . y < ny ) stat . y = ny ; } if ( sb . getFloating ( ) == FLOAT_LEFT || sb . getFloating ( ) == FLOAT_RIGHT ) // floating boxes
{ layoutBlockFloating ( sb , wlimit , stat ) ; // if there were some boxes before the float on the line , move them behind
if ( sb . getFloating ( ) == FLOAT_LEFT && stat . inlineWidth > 0 && curline . getStart ( ) < i ) { for ( int j = curline . getStart ( ) ; j < i ; j ++ ) { Box child = getSubBox ( j ) ; if ( ! child . isBlock ( ) ) child . moveRight ( sb . getWidth ( ) ) ; } x += sb . getWidth ( ) ; } } else // absolute or fixed positioning
{ layoutBlockPositioned ( sb , stat ) ; } // in case the block was floating , we need to update the bounds
x1 = fleft . getWidth ( y + floatY ) - floatXl ; x2 = fright . getWidth ( y + floatY ) - floatXr ; if ( x1 < 0 ) x1 = 0 ; if ( x2 < 0 ) x2 = 0 ; // if the line hasn ' t started yet , update its start
if ( atstart && x < x1 ) x = x1 ; // continue with next subboxes
continue ; } // process inline elements
if ( subbox . canSplitBefore ( ) ) lastbreak = i ; boolean split ; do // repeat while the box is being split to sub - boxes
{ split = false ; int space = wlimit - x1 - x2 ; // total space on the line
boolean narrowed = ( x1 > minx1 || x2 > minx2 ) ; // the space is narrowed by floats and it may be enough space somewhere below
// force : we ' re at the leftmost position or the line cannot be broken
// if there is no space on the line because of the floats , do not force
boolean f = ( x == x1 || lastbreak == lnstr || ! allowsWrapping ( ) ) && ! narrowed ; // do the layout
boolean fit = false ; if ( space >= INFLOW_SPACE_THRESHOLD || ! narrowed ) fit = subbox . doLayout ( wlimit - x - x2 , f , x == x1 ) ; if ( fit ) // positioning succeeded , at least a part fit - - set the x coordinate
{ if ( subbox . isInFlow ( ) ) { subbox . setPosition ( x , 0 ) ; // y position will be determined during the line box vertical alignment
x += subbox . getWidth ( ) ; } // update current line metrics
curline . considerBox ( ( Inline ) subbox ) ; } // check line overflows
boolean over = ( x > wlimit - x2 ) ; // space overflow ?
boolean linebreak = ( subbox instanceof Inline && ( ( Inline ) subbox ) . finishedByLineBreak ( ) ) ; // finished by a line break ?
if ( ! fit && narrowed && ( x == x1 || lastbreak == lnstr ) ) // failed because of no space caused by floats
{ // finish the line if there are already some boxes on the line
if ( lnstr < i ) { lnstr = i ; // new line starts here
curline . setEnd ( lnstr ) ; // finish the old line
curline = new LineBox ( this , lnstr , y ) ; // create the new line
lines . add ( curline ) ; } // go to the new line
y += getLineHeight ( ) ; curline . setY ( y ) ; x1 = fleft . getWidth ( y + floatY ) - floatXl ; x2 = fright . getWidth ( y + floatY ) - floatXr ; if ( x1 < 0 ) x1 = 0 ; if ( x2 < 0 ) x2 = 0 ; x = x1 ; // force repeating the same once again unless line height is non - positive ( prevent infinite loop )
if ( getLineHeight ( ) > 0 ) split = true ; } else if ( ( ! fit && lastbreak > lnstr ) // line overflow and the line can be broken
|| ( fit && ( over || linebreak || subbox . getRest ( ) != null ) ) ) // or something fit but something has left
{ // the width and height for text alignment
curline . setWidth ( x - x1 ) ; curline . setLimits ( x1 , x2 ) ; // go to the new line
y += curline . getMaxBoxHeight ( ) ; x1 = fleft . getWidth ( y + floatY ) - floatXl ; x2 = fright . getWidth ( y + floatY ) - floatXr ; if ( x1 < 0 ) x1 = 0 ; if ( x2 < 0 ) x2 = 0 ; x = x1 ; // create a new line
if ( ! fit ) // not fit - try again with a new line
{ lnstr = i ; // new line starts here
curline . setEnd ( lnstr ) ; // finish the old line
curline = new LineBox ( this , lnstr , y ) ; // create the new line
lines . add ( curline ) ; split = true ; // force repeating the same once again
} else if ( over || linebreak || subbox . getRest ( ) != null ) // something fit but not everything placed or line exceeded - create a new empty line
{ if ( subbox . getRest ( ) != null ) insertSubBox ( i + 1 , subbox . getRest ( ) ) ; // insert a new subbox with the rest
lnstr = i + 1 ; // new line starts with the next subbox
curline . setEnd ( lnstr ) ; // finish the old line
curline = new LineBox ( this , lnstr , y ) ; // create the new line
lines . add ( curline ) ; } } } while ( split ) ; if ( subbox . canSplitAfter ( ) ) lastbreak = i + 1 ; } // block height
if ( ! hasFixedHeight ( ) ) { y += curline . getMaxBoxHeight ( ) ; // last unfinished line
if ( encloseFloats ( ) ) { // enclose all floating boxes we own
int mfy = getFloatHeight ( ) - floatY ; if ( mfy > y ) y = mfy ; } // the total height is the last Y coordinate
setContentHeight ( y ) ; updateSizes ( ) ; updateChildSizes ( ) ; } setSize ( totalWidth ( ) , totalHeight ( ) ) ; // finish the last line
curline . setWidth ( x - x1 ) ; curline . setLimits ( x1 , x2 ) ; curline . setEnd ( getSubBoxNumber ( ) ) ; // align the lines according to the real box width
for ( Iterator < LineBox > it = lines . iterator ( ) ; it . hasNext ( ) ; ) { LineBox line = it . next ( ) ; alignLineHorizontally ( line , ! it . hasNext ( ) ) ; alignLineVertically ( line ) ; } |
public class SortControlDirContextProcessor { /** * @ see org . springframework . ldap . control .
* AbstractFallbackRequestAndResponseControlDirContextProcessor
* # handleResponse ( java . lang . Object ) */
protected void handleResponse ( Object control ) { } } | this . sorted = ( Boolean ) invokeMethod ( "isSorted" , responseControlClass , control ) ; this . resultCode = ( Integer ) invokeMethod ( "getResultCode" , responseControlClass , control ) ; |
public class CPOptionUtil { /** * Returns the first cp option in the ordered set where groupId = & # 63 ; .
* @ param groupId the group ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching cp option , or < code > null < / code > if a matching cp option could not be found */
public static CPOption fetchByGroupId_First ( long groupId , OrderByComparator < CPOption > orderByComparator ) { } } | return getPersistence ( ) . fetchByGroupId_First ( groupId , orderByComparator ) ; |
public class MultifactorAuthenticationTrustRecord { /** * New instance of authentication trust record .
* @ param principal the principal
* @ param geography the geography
* @ param fingerprint the device fingerprint
* @ return the authentication trust record */
public static MultifactorAuthenticationTrustRecord newInstance ( final String principal , final String geography , final String fingerprint ) { } } | val r = new MultifactorAuthenticationTrustRecord ( ) ; r . setRecordDate ( LocalDateTime . now ( ) . truncatedTo ( ChronoUnit . SECONDS ) ) ; r . setPrincipal ( principal ) ; r . setDeviceFingerprint ( fingerprint ) ; r . setName ( principal . concat ( "-" ) . concat ( LocalDate . now ( ) . toString ( ) ) . concat ( "-" ) . concat ( geography ) ) ; return r ; |
public class Composition { /** * syntactic sugar */
public CompositionEventComponent addEvent ( ) { } } | CompositionEventComponent t = new CompositionEventComponent ( ) ; if ( this . event == null ) this . event = new ArrayList < CompositionEventComponent > ( ) ; this . event . add ( t ) ; return t ; |
public class RendererModel { /** * Registers rendering parameters from { @ link IGenerator } s
* with this model .
* @ param generator */
public void registerParameters ( IGenerator < ? extends IChemObject > generator ) { } } | for ( IGeneratorParameter < ? > param : generator . getParameters ( ) ) { try { renderingParameters . put ( param . getClass ( ) . getName ( ) , param . getClass ( ) . newInstance ( ) ) ; } catch ( InstantiationException | IllegalAccessException e ) { throw new IllegalStateException ( "Could not create a copy of rendering parameter." ) ; } } |
public class Parser { /** * 11.6 Additive Expression */
private ParseTree parseAdditiveExpression ( ) { } } | SourcePosition start = getTreeStartLocation ( ) ; ParseTree left = parseMultiplicativeExpression ( ) ; while ( peekAdditiveOperator ( ) ) { Token operator = nextToken ( ) ; ParseTree right = parseMultiplicativeExpression ( ) ; left = new BinaryOperatorTree ( getTreeLocation ( start ) , left , operator , right ) ; } return left ; |
public class RedisInner { /** * Checks that the redis cache name is valid and is not already in use .
* @ param parameters Parameters supplied to the CheckNameAvailability Redis operation . The only supported resource type is ' Microsoft . Cache / redis '
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < Void > checkNameAvailabilityAsync ( CheckNameAvailabilityParameters parameters , final ServiceCallback < Void > serviceCallback ) { } } | return ServiceFuture . fromResponse ( checkNameAvailabilityWithServiceResponseAsync ( parameters ) , serviceCallback ) ; |
public class Request { /** * set a request param and return modified request
* @ param name : name of teh request param
* @ param value : value of teh request param
* @ return : Request Object with request param name , value set */
public Request setParam ( String name , String value ) { } } | this . params . put ( name , value ) ; return this ; |
public class LoggingConfiguration { /** * An array of Amazon Kinesis Data Firehose ARNs .
* @ param logDestinationConfigs
* An array of Amazon Kinesis Data Firehose ARNs . */
public void setLogDestinationConfigs ( java . util . Collection < String > logDestinationConfigs ) { } } | if ( logDestinationConfigs == null ) { this . logDestinationConfigs = null ; return ; } this . logDestinationConfigs = new java . util . ArrayList < String > ( logDestinationConfigs ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.