signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class EqualityInference { /** * Attempts to rewrite an Expression in terms of the symbols allowed by the symbol scope
* given the known equalities . Returns null if unsuccessful .
* This method allows rewriting non - deterministic expressions . */
public Expression rewriteExpressionAllowNonDeterministic ( Expression expression , Predicate < Symbol > symbolScope ) { } }
|
return rewriteExpression ( expression , symbolScope , true ) ;
|
public class TokenInputStream { /** * main function */
public void putToken ( byte [ ] buf , int off , int len ) { } }
|
if ( buf == null || len <= 0 ) { return ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "put token: " + len ) ; } byte [ ] localBuf = buf ; if ( off != 0 ) { localBuf = new byte [ len ] ; System . arraycopy ( buf , off , localBuf , 0 , len ) ; } synchronized ( this ) { if ( this . buff == null || this . buff != null && this . buff . length == this . index ) { this . buff = localBuf ; this . index = 0 ; } else { this . tokens . add ( localBuf ) ; } notify ( ) ; }
|
public class NodeSequence { /** * If this NodeSequence has a cache , and that cache is
* fully populated then this method returns true , otherwise
* if there is no cache or it is not complete it returns false . */
private boolean cacheComplete ( ) { } }
|
final boolean complete ; if ( m_cache != null ) { complete = m_cache . isComplete ( ) ; } else { complete = false ; } return complete ;
|
public class DescribeDirectConnectGatewayAssociationsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeDirectConnectGatewayAssociationsRequest describeDirectConnectGatewayAssociationsRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( describeDirectConnectGatewayAssociationsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeDirectConnectGatewayAssociationsRequest . getAssociationId ( ) , ASSOCIATIONID_BINDING ) ; protocolMarshaller . marshall ( describeDirectConnectGatewayAssociationsRequest . getAssociatedGatewayId ( ) , ASSOCIATEDGATEWAYID_BINDING ) ; protocolMarshaller . marshall ( describeDirectConnectGatewayAssociationsRequest . getDirectConnectGatewayId ( ) , DIRECTCONNECTGATEWAYID_BINDING ) ; protocolMarshaller . marshall ( describeDirectConnectGatewayAssociationsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( describeDirectConnectGatewayAssociationsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( describeDirectConnectGatewayAssociationsRequest . getVirtualGatewayId ( ) , VIRTUALGATEWAYID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class PageFlowUtils { /** * Get a URI for the " begin " action in the PageFlowController associated with the given
* request URI .
* @ return a String that is the URI for the " begin " action in the PageFlowController associated
* with the given request URI . */
public static String getBeginActionURI ( String requestURI ) { } }
|
// Translate this to a request for the begin action ( " begin . do " ) for this PageFlowController .
InternalStringBuilder retVal = new InternalStringBuilder ( ) ; int lastSlash = requestURI . lastIndexOf ( '/' ) ; if ( lastSlash != - 1 ) { retVal . append ( requestURI . substring ( 0 , lastSlash ) ) ; } retVal . append ( '/' ) . append ( BEGIN_ACTION_NAME ) . append ( ACTION_EXTENSION ) ; return retVal . toString ( ) ;
|
public class PlatformBitmapFactory { /** * Creates a bitmap with the specified width and height . Its initial density is
* determined from the given DisplayMetrics .
* @ param display Display metrics for the display this bitmap will be drawn on
* @ param width The width of the bitmap
* @ param height The height of the bitmap
* @ param config The bitmap config to create
* @ param hasAlpha If the bitmap is ARGB _ 8888 this flag can be used to mark the bitmap as opaque
* Doing so will clear the bitmap in black instead of transparent
* @ param callerContext the Tag to track who create the Bitmap
* @ return a reference to the bitmap
* @ throws IllegalArgumentException if the width or height are < = 0
* @ throws TooManyBitmapsException if the pool is full
* @ throws java . lang . OutOfMemoryError if the Bitmap cannot be allocated */
private CloseableReference < Bitmap > createBitmap ( DisplayMetrics display , int width , int height , Bitmap . Config config , boolean hasAlpha , @ Nullable Object callerContext ) { } }
|
checkWidthHeight ( width , height ) ; CloseableReference < Bitmap > bitmapRef = createBitmapInternal ( width , height , config ) ; Bitmap bitmap = bitmapRef . get ( ) ; if ( display != null ) { bitmap . setDensity ( display . densityDpi ) ; } if ( Build . VERSION . SDK_INT >= 12 ) { bitmap . setHasAlpha ( hasAlpha ) ; } if ( config == Bitmap . Config . ARGB_8888 && ! hasAlpha ) { bitmap . eraseColor ( 0xff000000 ) ; } return bitmapRef ;
|
public class TinyUUID { /** * Liefert eine verkuerzte Darstellung einer UUID als String . Die Laenge
* reduziert sich dadurch auf 22 Zeichen . Diese kann z . B . dazu genutzt
* werden , um eine UUID platzsparend abzuspeichern , wenn man dazu nicht
* das Ergebnis aus { @ link # toBytes ( ) } ( 16 Bytes ) verwenden will .
* Damit der resultierende String auch URL - safe ist , werden die Zeichen
* ' / ' und ' + ' durch ' _ ' und ' - ' ersetzt .
* @ return 22 Zeichen , z . B . " ix9de14vQgGKwXZUaruCzw " */
public String toShortString ( ) { } }
|
String s = Base64 . getEncoder ( ) . withoutPadding ( ) . encodeToString ( toBytes ( ) ) ; return s . replace ( '/' , '_' ) . replace ( '+' , '-' ) ;
|
public class BoxWebHook { /** * Adds a { @ link BoxWebHook } to a provided { @ link BoxResource } .
* @ param target
* { @ link BoxResource } web resource
* @ param address
* { @ link URL } where the notification should send to
* @ param triggers
* events this { @ link BoxWebHook } is interested in
* @ return created { @ link BoxWebHook }
* @ see # create ( BoxResource , URL , Set ) */
public static BoxWebHook . Info create ( BoxResource target , URL address , BoxWebHook . Trigger ... triggers ) { } }
|
return create ( target , address , new HashSet < Trigger > ( Arrays . asList ( triggers ) ) ) ;
|
public class ArrayPropertiesDetail { /** * A summary of the number of array job children in each available job status . This parameter is returned for parent
* array jobs .
* @ param statusSummary
* A summary of the number of array job children in each available job status . This parameter is returned for
* parent array jobs .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ArrayPropertiesDetail withStatusSummary ( java . util . Map < String , Integer > statusSummary ) { } }
|
setStatusSummary ( statusSummary ) ; return this ;
|
public class MappedParametrizedObjectEntry { /** * Parse named parameter as Double .
* @ param name
* parameter name
* @ param defaultValue
* default Double value
* @ return Double value */
public Double getParameterDouble ( String name , Double defaultValue ) { } }
|
String value = getParameterValue ( name , null ) ; if ( value != null ) { try { return StringNumberParser . parseDouble ( value ) ; } catch ( NumberFormatException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occurred: " + e . getMessage ( ) ) ; } } } return defaultValue ;
|
public class WriterUtils { /** * Get the staging { @ link Path } for { @ link org . apache . gobblin . writer . DataWriter } that has attemptId in the path . */
public static Path getWriterStagingDir ( State state , int numBranches , int branchId , String attemptId ) { } }
|
Preconditions . checkArgument ( attemptId != null && ! attemptId . isEmpty ( ) , "AttemptId cannot be null or empty: " + attemptId ) ; return new Path ( getWriterStagingDir ( state , numBranches , branchId ) , attemptId ) ;
|
public class GeneralStorable { /** * Returns the value belonging to the given field as long
* @ param index
* the index of the requested field
* @ return the requested value
* @ throws IOException */
public double getValueAsDouble ( int index ) throws IOException { } }
|
if ( index >= structure . valueSizes . size ( ) ) { throw new IOException ( "Index " + index + " is out of range." ) ; } return Bytes . toDouble ( value , structure . valueByteOffsets . get ( index ) ) ;
|
public class XDMClientChildSbb { /** * SUBSCRIBE callbacks */
public void onNotify ( Notify ntfy , SubscriptionClientChildSbbLocalObject subscriptionChild ) { } }
|
// compile diff
if ( ntfy . getStatus ( ) . equals ( SubscriptionStatus . terminated ) ) { try { final String notifier = ntfy . getNotifier ( ) ; subscriptionChild . remove ( ) ; getParent ( ) . subscriptionTerminated ( ( XDMClientChildSbbLocalObject ) this . sbbContext . getSbbLocalObject ( ) , notifier , ntfy . getTerminationReason ( ) ) ; } catch ( Exception e ) { tracer . severe ( "Unexpected exception on callback!" , e ) ; } } else { // cast is safe , cause we expect diff and check MIME
XcapDiff diff = null ; if ( ntfy != null ) { try { diff = ( XcapDiff ) xcapDiffJaxbContext . createUnmarshaller ( ) . unmarshal ( new StringReader ( ntfy . getContent ( ) ) ) ; } catch ( Exception e ) { tracer . severe ( "Failed to parse diff!" , e ) ; } } getParent ( ) . subscriptionNotification ( diff , ntfy . getStatus ( ) ) ; }
|
public class VdmUILabelProvider { /** * ( non - Javadoc )
* @ see IBaseLabelProvider # dispose */
public void dispose ( ) { } }
|
if ( fLabelDecorators != null ) { for ( int i = 0 ; i < fLabelDecorators . size ( ) ; i ++ ) { ILabelDecorator decorator = ( ILabelDecorator ) fLabelDecorators . get ( i ) ; decorator . dispose ( ) ; } fLabelDecorators = null ; } // fStorageLabelProvider . dispose ( ) ;
fImageLabelProvider . dispose ( ) ; // for ( Image img : images )
// if ( ! img . isDisposed ( ) )
// img . dispose ( ) ;
|
public class Base64Util { /** * public static void encode ( StringBuilder cb , long data )
* cb . append ( Base64Util . encode ( data > > 60 ) ) ;
* cb . append ( Base64Util . encode ( data > > 54 ) ) ;
* cb . append ( Base64Util . encode ( data > > 48 ) ) ;
* cb . append ( Base64Util . encode ( data > > 42 ) ) ;
* cb . append ( Base64Util . encode ( data > > 36 ) ) ;
* cb . append ( Base64Util . encode ( data > > 30 ) ) ;
* cb . append ( Base64Util . encode ( data > > 24 ) ) ;
* cb . append ( Base64Util . encode ( data > > 18 ) ) ;
* cb . append ( Base64Util . encode ( data > > 12 ) ) ;
* cb . append ( Base64Util . encode ( data > > 6 ) ) ;
* cb . append ( Base64Util . encode ( data ) ) ; */
public static void encode ( StringBuilder sb , long data ) { } }
|
for ( int i = 58 ; i > 0 ; i -= 6 ) { sb . append ( encode ( data >> i ) ) ; } sb . append ( encode ( data << 2 ) ) ;
|
public class FunctionTypeBuilder { /** * Infer whether the function is a normal function , a constructor , or an interface . */
FunctionTypeBuilder inferKind ( @ Nullable JSDocInfo info ) { } }
|
if ( info != null ) { if ( ! NodeUtil . isMethodDeclaration ( errorRoot ) ) { isConstructor = info . isConstructor ( ) ; isInterface = info . isInterface ( ) ; isRecord = info . usesImplicitMatch ( ) ; makesStructs = info . makesStructs ( ) ; makesDicts = info . makesDicts ( ) ; } isAbstract = info . isAbstract ( ) ; } if ( isClass ) { // If a CLASS literal has not been explicitly declared an interface , it ' s a constructor .
// If it ' s not expicitly @ dict or @ unrestricted then it ' s @ struct .
isConstructor = ! isInterface ; makesStructs = info == null || ( ! makesDicts && ! info . makesUnrestricted ( ) ) ; } if ( makesStructs && ! ( isConstructor || isInterface ) ) { reportWarning ( CONSTRUCTOR_REQUIRED , "@struct" , formatFnName ( ) ) ; } else if ( makesDicts && ! isConstructor ) { reportWarning ( CONSTRUCTOR_REQUIRED , "@dict" , formatFnName ( ) ) ; } return this ;
|
public class AbstractFileClient { /** * Given a ZipInputStream to an asset within the repo get an input stream to the license attachment within the
* asset .
* @ param zis ZipInputStream to the container for the asset ( i . e . ZipInputStream to an ESA file inside a repo ) .
* @ param assetId The id of the asset
* @ param attachmentId The id of the license to get an input stream to .
* @ return
* @ throws IOException */
protected InputStream getInputStreamToLicenseInsideZip ( final ZipInputStream zis , final String assetId , final String attachmentId ) throws IOException { } }
|
InputStream is = null ; try { ZipEntry ze = zis . getNextEntry ( ) ; while ( ze != null ) { if ( ze . isDirectory ( ) ) { // do nothing
} else { String name = getName ( ze . getName ( ) . replace ( "/" , File . separator ) ) ; String licId = assetId . concat ( String . format ( "#licenses" + File . separator + "%s" , name ) ) ; if ( licId . equals ( attachmentId ) ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; byte [ ] buffer = new byte [ 1024 ] ; int read ; int total = 0 ; while ( ( read = zis . read ( buffer ) ) != - 1 ) { baos . write ( buffer , 0 , read ) ; total += read ; } // ZipEntry sometimes returns - 1 when unable to get original size , in this case we want to proceed
if ( ze . getSize ( ) != - 1 && total != ze . getSize ( ) ) { throw new IOException ( "The size of the retrieved license was wrong. Expected : " + ze . getSize ( ) + " bytes, but actually was " + total + " bytes." ) ; } byte [ ] content = baos . toByteArray ( ) ; is = new ByteArrayInputStream ( content ) ; } } ze = zis . getNextEntry ( ) ; } } finally { zis . closeEntry ( ) ; zis . close ( ) ; } return is ;
|
public class ExecHandler { /** * Extract a list of operation signatures which match a certain operation name . The returned list
* can contain multiple signature in case of overloaded JMX operations .
* @ param pServer server from where to fetch the MBean info for a given request ' s object name
* @ param pRequest the JMX request
* @ param pOperation the operation whose signature should be extracted
* @ return a list of signature . If the operation is overloaded , this contains mutliple entries ,
* otherwise only a single entry is contained */
private List < MBeanParameterInfo [ ] > extractMBeanParameterInfos ( MBeanServerConnection pServer , JmxExecRequest pRequest , String pOperation ) throws InstanceNotFoundException , ReflectionException , IOException { } }
|
try { MBeanInfo mBeanInfo = pServer . getMBeanInfo ( pRequest . getObjectName ( ) ) ; List < MBeanParameterInfo [ ] > paramInfos = new ArrayList < MBeanParameterInfo [ ] > ( ) ; for ( MBeanOperationInfo opInfo : mBeanInfo . getOperations ( ) ) { if ( opInfo . getName ( ) . equals ( pOperation ) ) { paramInfos . add ( opInfo . getSignature ( ) ) ; } } if ( paramInfos . size ( ) == 0 ) { throw new IllegalArgumentException ( "No operation " + pOperation + " found on MBean " + pRequest . getObjectNameAsString ( ) ) ; } return paramInfos ; } catch ( IntrospectionException e ) { throw new IllegalStateException ( "Cannot extract MBeanInfo for " + pRequest . getObjectNameAsString ( ) , e ) ; }
|
public class PathNormalizer { /** * Removes the URL prefix defined in the configuration from a path . If the
* prefix contains a variant information , it adds it to the name .
* @ param path
* the path
* @ return the path without the prefix */
public static String removeVariantPrefixFromPath ( String path ) { } }
|
String resultPath = path ; // Remove first slash
if ( path . charAt ( 0 ) == '/' ) { resultPath = path . substring ( 1 ) ; } // eval the existence of a suffix
String prefix = resultPath . substring ( 0 , resultPath . indexOf ( "/" ) ) ; // The prefix also contains variant information after a ' . '
if ( prefix . indexOf ( '.' ) != - 1 ) { String variantPrefix = prefix . substring ( prefix . indexOf ( '.' ) + 1 ) ; String suffix = '@' + variantPrefix + resultPath . substring ( resultPath . lastIndexOf ( '.' ) ) ; resultPath = resultPath . substring ( resultPath . indexOf ( "/" ) , resultPath . lastIndexOf ( '.' ) ) + suffix ; } else resultPath = resultPath . substring ( resultPath . indexOf ( "/" ) ) ; return resultPath ;
|
public class IntegerToOneHotTransform { /** * The output column names
* This will often be the same as the input
* @ return the output column names */
@ Override public String [ ] outputColumnNames ( ) { } }
|
List < String > l = transform ( inputSchema ) . getColumnNames ( ) ; return l . toArray ( new String [ l . size ( ) ] ) ;
|
public class DrawerUIUtils { /** * Util method to theme the drawer item view ' s background ( and foreground if possible )
* @ param ctx the context to use
* @ param view the view to theme
* @ param selected _ color the selected color to use
* @ param animate true if we want to animate the StateListDrawable */
public static void themeDrawerItem ( Context ctx , View view , int selected_color , boolean animate ) { } }
|
boolean legacyStyle = getBooleanStyleable ( ctx , R . styleable . MaterialDrawer_material_drawer_legacy_style , false ) ; Drawable selected ; Drawable unselected ; if ( legacyStyle ) { // Material 1.0 styling
selected = new ColorDrawable ( selected_color ) ; unselected = UIUtils . getSelectableBackground ( ctx ) ; } else { // Material 2.0 styling
int cornerRadius = ctx . getResources ( ) . getDimensionPixelSize ( R . dimen . material_drawer_item_corner_radius ) ; int paddingTopBottom = ctx . getResources ( ) . getDimensionPixelSize ( R . dimen . material_drawer_item_background_padding_top_bottom ) ; int paddingStartEnd = ctx . getResources ( ) . getDimensionPixelSize ( R . dimen . material_drawer_item_background_padding_start_end ) ; // define normal selected background
GradientDrawable gradientDrawable = new GradientDrawable ( ) ; gradientDrawable . setColor ( selected_color ) ; gradientDrawable . setCornerRadius ( cornerRadius ) ; selected = new InsetDrawable ( gradientDrawable , paddingStartEnd , paddingTopBottom , paddingStartEnd , paddingTopBottom ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { // define mask for ripple
GradientDrawable gradientMask = new GradientDrawable ( ) ; gradientMask . setColor ( Color . BLACK ) ; gradientMask . setCornerRadius ( cornerRadius ) ; Drawable mask = new InsetDrawable ( gradientMask , paddingStartEnd , paddingTopBottom , paddingStartEnd , paddingTopBottom ) ; unselected = new RippleDrawable ( new ColorStateList ( new int [ ] [ ] { new int [ ] { } } , new int [ ] { UIUtils . getThemeColor ( ctx , R . attr . colorControlHighlight ) } ) , null , mask ) ; } else { // define touch drawable
GradientDrawable touchDrawable = new GradientDrawable ( ) ; touchDrawable . setColor ( UIUtils . getThemeColor ( ctx , R . attr . colorControlHighlight ) ) ; touchDrawable . setCornerRadius ( cornerRadius ) ; Drawable touchInsetDrawable = new InsetDrawable ( touchDrawable , paddingStartEnd , paddingTopBottom , paddingStartEnd , paddingTopBottom ) ; StateListDrawable unselectedStates = new StateListDrawable ( ) ; // if possible and wanted we enable animating across states
if ( animate ) { int duration = ctx . getResources ( ) . getInteger ( android . R . integer . config_shortAnimTime ) ; unselectedStates . setEnterFadeDuration ( duration ) ; unselectedStates . setExitFadeDuration ( duration ) ; } unselectedStates . addState ( new int [ ] { android . R . attr . state_pressed } , touchInsetDrawable ) ; unselectedStates . addState ( new int [ ] { } , new ColorDrawable ( Color . TRANSPARENT ) ) ; unselected = unselectedStates ; } } StateListDrawable states = new StateListDrawable ( ) ; // if possible and wanted we enable animating across states
if ( animate ) { int duration = ctx . getResources ( ) . getInteger ( android . R . integer . config_shortAnimTime ) ; states . setEnterFadeDuration ( duration ) ; states . setExitFadeDuration ( duration ) ; } if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . M ) { states . addState ( new int [ ] { android . R . attr . state_selected } , selected ) ; states . addState ( new int [ ] { } , new ColorDrawable ( Color . TRANSPARENT ) ) ; ViewCompat . setBackground ( view , states ) ; view . setForeground ( unselected ) ; } else { states . addState ( new int [ ] { android . R . attr . state_selected } , selected ) ; states . addState ( new int [ ] { } , unselected ) ; ViewCompat . setBackground ( view , states ) ; }
|
public class PhoneNumberUtil { /** * format phone number in common national format with cursor position handling .
* @ param pphoneNumberData phone number to format with cursor position
* @ return formated phone number as String with new cursor position */
public final ValueWithPos < String > formatCommonNationalWithPos ( final ValueWithPos < PhoneNumberData > pphoneNumberData ) { } }
|
if ( pphoneNumberData == null ) { return null ; } int cursor = pphoneNumberData . getPos ( ) ; final StringBuilder resultNumber = new StringBuilder ( ) ; if ( isPhoneNumberNotEmpty ( pphoneNumberData . getValue ( ) ) ) { PhoneCountryData phoneCountryData = null ; for ( final PhoneCountryCodeData country : CreatePhoneCountryConstantsClass . create ( ) . countryCodeData ( ) ) { if ( StringUtils . equals ( country . getCountryCode ( ) , pphoneNumberData . getValue ( ) . getCountryCode ( ) ) ) { phoneCountryData = country . getPhoneCountryData ( ) ; break ; } } if ( phoneCountryData == null ) { return null ; } if ( cursor > 0 ) { cursor -= StringUtils . length ( pphoneNumberData . getValue ( ) . getCountryCode ( ) ) ; cursor += StringUtils . length ( phoneCountryData . getTrunkCode ( ) ) ; } resultNumber . append ( phoneCountryData . getTrunkCode ( ) ) ; if ( resultNumber . length ( ) <= cursor ) { cursor ++ ; } resultNumber . append ( ' ' ) ; if ( StringUtils . isNotBlank ( pphoneNumberData . getValue ( ) . getAreaCode ( ) ) ) { final ValueWithPos < String > areaCode = this . groupIntoParts ( new ValueWithPos < > ( pphoneNumberData . getValue ( ) . getAreaCode ( ) , cursor ) , resultNumber . length ( ) , 2 ) ; cursor = areaCode . getPos ( ) ; resultNumber . append ( areaCode . getValue ( ) ) ; } if ( resultNumber . length ( ) <= cursor ) { cursor += 3 ; } resultNumber . append ( " / " ) ; final ValueWithPos < String > lineNumber = this . groupIntoParts ( new ValueWithPos < > ( pphoneNumberData . getValue ( ) . getLineNumber ( ) , cursor ) , resultNumber . length ( ) , 2 ) ; cursor = lineNumber . getPos ( ) ; resultNumber . append ( lineNumber . getValue ( ) ) ; if ( StringUtils . isNotBlank ( pphoneNumberData . getValue ( ) . getExtension ( ) ) ) { if ( resultNumber . length ( ) <= cursor ) { cursor += 3 ; } resultNumber . append ( " - " ) ; final ValueWithPos < String > extension = this . groupIntoParts ( new ValueWithPos < > ( pphoneNumberData . getValue ( ) . getExtension ( ) , cursor ) , resultNumber . length ( ) , 2 ) ; cursor = extension . getPos ( ) ; resultNumber . append ( extension . getValue ( ) ) ; } } return new ValueWithPos < > ( StringUtils . trimToNull ( resultNumber . toString ( ) ) , cursor ) ;
|
public class CmsSitemapToolbar { /** * Enables / disables the new clipboard button . < p >
* @ param enabled < code > true < / code > to enable the button
* @ param disabledReason the reason , why the button is disabled */
public void setClipboardEnabled ( boolean enabled , String disabledReason ) { } }
|
if ( m_clipboardButton != null ) { if ( enabled ) { m_clipboardButton . enable ( ) ; } else { m_clipboardButton . disable ( disabledReason ) ; } }
|
public class SizeRange { /** * Used to build out a string a http box api friendly range string .
* @ return String that is uses as a rest parameter . */
public String buildRangeString ( ) { } }
|
String lowerBoundString = "" ; if ( this . lowerBoundBytes > - 1 ) { lowerBoundString = String . valueOf ( this . lowerBoundBytes ) ; } String upperBoundString = "" ; if ( this . upperBoundBytes > - 1 ) { upperBoundString = String . valueOf ( this . upperBoundBytes ) ; } String rangeString = String . format ( "%s,%s" , lowerBoundString , upperBoundString ) ; if ( rangeString == "," ) { rangeString = null ; } return rangeString ;
|
public class App { /** * Initializes the app in non - atomic way .
* Then starts serving requests immediately when routes are configured . */
public static synchronized void run ( String [ ] args , String ... extraArgs ) { } }
|
AppStarter . startUp ( args , extraArgs ) ; // no implicit classpath scanning here
boot ( ) ; // finish initialization and start the application
onAppReady ( ) ; boot ( ) ;
|
public class LocalDate { /** * Returns a copy of this date with the specified field set to a new value .
* For example , if the field type is < code > monthOfYear < / code > then the
* month of year field will be changed in the returned instance .
* If the field type is null , then < code > this < / code > is returned .
* These two lines are equivalent :
* < pre >
* LocalDate updated = dt . withDayOfMonth ( 6 ) ;
* LocalDate updated = dt . withField ( DateTimeFieldType . dayOfMonth ( ) , 6 ) ;
* < / pre >
* @ param fieldType the field type to set , not null
* @ param value the value to set
* @ return a copy of this date with the field set
* @ throws IllegalArgumentException if the field is null or unsupported */
public LocalDate withField ( DateTimeFieldType fieldType , int value ) { } }
|
if ( fieldType == null ) { throw new IllegalArgumentException ( "Field must not be null" ) ; } if ( isSupported ( fieldType ) == false ) { throw new IllegalArgumentException ( "Field '" + fieldType + "' is not supported" ) ; } long instant = fieldType . getField ( getChronology ( ) ) . set ( getLocalMillis ( ) , value ) ; return withLocalMillis ( instant ) ;
|
public class DescribeGameSessionQueuesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeGameSessionQueuesRequest describeGameSessionQueuesRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( describeGameSessionQueuesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeGameSessionQueuesRequest . getNames ( ) , NAMES_BINDING ) ; protocolMarshaller . marshall ( describeGameSessionQueuesRequest . getLimit ( ) , LIMIT_BINDING ) ; protocolMarshaller . marshall ( describeGameSessionQueuesRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class ClassReader { /** * Read a class file . */
private void readClassFile ( ClassSymbol c ) throws IOException { } }
|
int magic = nextInt ( ) ; if ( magic != JAVA_MAGIC ) throw badClassFile ( "illegal.start.of.class.file" ) ; minorVersion = nextChar ( ) ; majorVersion = nextChar ( ) ; int maxMajor = Target . MAX ( ) . majorVersion ; int maxMinor = Target . MAX ( ) . minorVersion ; if ( majorVersion > maxMajor || majorVersion * 1000 + minorVersion < Target . MIN ( ) . majorVersion * 1000 + Target . MIN ( ) . minorVersion ) { if ( majorVersion == ( maxMajor + 1 ) ) log . warning ( "big.major.version" , currentClassFile , majorVersion , maxMajor ) ; else throw badClassFile ( "wrong.version" , Integer . toString ( majorVersion ) , Integer . toString ( minorVersion ) , Integer . toString ( maxMajor ) , Integer . toString ( maxMinor ) ) ; } else if ( checkClassFile && majorVersion == maxMajor && minorVersion > maxMinor ) { printCCF ( "found.later.version" , Integer . toString ( minorVersion ) ) ; } indexPool ( ) ; if ( signatureBuffer . length < bp ) { int ns = Integer . highestOneBit ( bp ) << 1 ; signatureBuffer = new byte [ ns ] ; } readClass ( c ) ;
|
public class Shape { /** * Sets the dash array with individual dash lengths .
* @ param dash length of dash
* @ param dashes if specified , length of remaining dashes
* @ return this Line */
public T setDashArray ( final double dash , final double ... dashes ) { } }
|
getAttributes ( ) . setDashArray ( new DashArray ( dash , dashes ) ) ; return cast ( ) ;
|
public class Messenger { /** * Send Audio message
* @ param peer destination peer
* @ param duration audio duration
* @ param descriptor File Descriptor */
@ ObjectiveCName ( "sendAudioWithPeer:withName:withDuration:withDescriptor:" ) public void sendAudio ( @ NotNull Peer peer , @ NotNull String fileName , int duration , @ NotNull String descriptor ) { } }
|
modules . getMessagesModule ( ) . sendAudio ( peer , fileName , duration , descriptor ) ;
|
public class DefaultJsonReader { /** * { @ inheritDoc } */
@ Override public void nextNull ( ) { } }
|
int p = peeked ; if ( p == PEEKED_NONE ) { p = doPeek ( ) ; } if ( p == PEEKED_NULL ) { peeked = PEEKED_NONE ; } else { throw new IllegalStateException ( "Expected null but was " + peek ( ) + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; }
|
public class Pages { /** * Remove count pages from the beginning */
public void shrink ( int count ) { } }
|
char [ ] keepAllocated ; if ( count == 0 ) { throw new IllegalArgumentException ( ) ; } if ( count > lastNo ) { throw new IllegalArgumentException ( count + " vs " + lastNo ) ; } lastNo -= count ; keepAllocated = pages [ 0 ] ; System . arraycopy ( pages , count , pages , 0 , lastNo + 1 ) ; pages [ lastNo + 1 ] = keepAllocated ; for ( int i = lastNo + 2 ; i < pages . length ; i ++ ) { pages [ i ] = null ; }
|
public class InternalSARLParser { /** * InternalSARL . g : 13217:1 : ruleOpPostfix returns [ AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ] : ( kw = ' + + ' | kw = ' - - ' ) ; */
public final AntlrDatatypeRuleToken ruleOpPostfix ( ) throws RecognitionException { } }
|
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ; Token kw = null ; enterRule ( ) ; try { // InternalSARL . g : 13223:2 : ( ( kw = ' + + ' | kw = ' - - ' ) )
// InternalSARL . g : 13224:2 : ( kw = ' + + ' | kw = ' - - ' )
{ // InternalSARL . g : 13224:2 : ( kw = ' + + ' | kw = ' - - ' )
int alt315 = 2 ; int LA315_0 = input . LA ( 1 ) ; if ( ( LA315_0 == 125 ) ) { alt315 = 1 ; } else if ( ( LA315_0 == 126 ) ) { alt315 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 315 , 0 , input ) ; throw nvae ; } switch ( alt315 ) { case 1 : // InternalSARL . g : 13225:3 : kw = ' + + '
{ kw = ( Token ) match ( input , 125 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpPostfixAccess ( ) . getPlusSignPlusSignKeyword_0 ( ) ) ; } } break ; case 2 : // InternalSARL . g : 13231:3 : kw = ' - - '
{ kw = ( Token ) match ( input , 126 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getOpPostfixAccess ( ) . getHyphenMinusHyphenMinusKeyword_1 ( ) ) ; } } break ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
|
public class CPOptionValueUtil { /** * Returns a range of all the cp option values where companyId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CPOptionValueModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param companyId the company ID
* @ param start the lower bound of the range of cp option values
* @ param end the upper bound of the range of cp option values ( not inclusive )
* @ return the range of matching cp option values */
public static List < CPOptionValue > findByCompanyId ( long companyId , int start , int end ) { } }
|
return getPersistence ( ) . findByCompanyId ( companyId , start , end ) ;
|
public class JAASSystem { /** * Method to initialize the cache of JAAS systems .
* @ throws CacheReloadException on error */
public static void initialize ( ) throws CacheReloadException { } }
|
if ( InfinispanCache . get ( ) . exists ( JAASSystem . IDCACHE ) ) { InfinispanCache . get ( ) . < Long , JAASSystem > getCache ( JAASSystem . IDCACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < Long , JAASSystem > getCache ( JAASSystem . IDCACHE ) . addListener ( new CacheLogListener ( JAASSystem . LOG ) ) ; } if ( InfinispanCache . get ( ) . exists ( JAASSystem . NAMECACHE ) ) { InfinispanCache . get ( ) . < String , JAASSystem > getCache ( JAASSystem . NAMECACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < String , JAASSystem > getCache ( JAASSystem . NAMECACHE ) . addListener ( new CacheLogListener ( JAASSystem . LOG ) ) ; } JAASSystem . getJAASSystemFromDB ( JAASSystem . SQL_SELECT , null ) ;
|
public class GrpcTransportOptions { /** * Returns a channel provider from the given default provider . */
@ BetaApi public static TransportChannelProvider setUpChannelProvider ( InstantiatingGrpcChannelProvider . Builder providerBuilder , ServiceOptions < ? , ? > serviceOptions ) { } }
|
providerBuilder . setEndpoint ( serviceOptions . getHost ( ) ) ; return providerBuilder . build ( ) ;
|
public class WktConversionUtils { /** * Converts the given Well - Known Text and SRID to the appropriate function
* call for the database .
* @ param wkt
* the Well - Known Text string .
* @ param srid
* the SRID string which may be an empty string .
* @ param database
* the database instance .
* @ param generator
* the SQL generator .
* @ return the string that converts the WKT to a database - specific geometry . */
public static String convertToFunction ( final String wkt , final String srid , final Database database , final WktInsertOrUpdateGenerator generator ) { } }
|
if ( wkt == null || wkt . equals ( "" ) ) { throw new IllegalArgumentException ( "The Well-Known Text cannot be null or empty" ) ; } if ( generator == null ) { throw new IllegalArgumentException ( "The generator cannot be null or empty" ) ; } final String geomFromTextFunction = generator . getGeomFromWktFunction ( ) ; String function = geomFromTextFunction + "('" + wkt + "'" ; if ( srid != null && ! srid . equals ( "" ) ) { function += ", " + srid ; } else if ( generator . isSridRequiredInFunction ( database ) ) { throw new IllegalArgumentException ( "An SRID was not provided with '" + wkt + "' but is required in call to '" + geomFromTextFunction + "'" ) ; } function += ")" ; return function ;
|
public class UtlProperties { /** * < p > Evaluate null if value is string " null " . < / p >
* @ param pProperties properties
* @ param pPropName properties
* @ return String string or NULL */
public final String evalPropVal ( final LinkedProperties pProperties , final String pPropName ) { } }
|
String result = pProperties . getProperty ( pPropName ) ; if ( constNull ( ) . equals ( result ) ) { return null ; } return result ;
|
public class EventsHelper { /** * Bind a function to the mouseenter event of each matched element .
* @ param jsScope
* Scope to use
* @ return the jQuery code */
public static ChainableStatement mouseenter ( JsScope jsScope ) { } }
|
return new DefaultChainableStatement ( MouseEvent . MOUSEENTER . getEventLabel ( ) , jsScope . render ( ) ) ;
|
public class DateTimeFormatter { /** * Returns a copy of this formatter with a new override chronology .
* This returns a formatter with similar state to this formatter but
* with the override chronology set .
* By default , a formatter has no override chronology , returning null .
* If an override is added , then any date that is printed or parsed will be affected .
* When printing , if the { @ code Temporal } object contains a date then it will
* be converted to a date in the override chronology .
* Any time or zone will be retained unless overridden .
* The converted result will behave in a manner equivalent to an implementation
* of { @ code ChronoLocalDate } , { @ code ChronoLocalDateTime } or { @ code ChronoZonedDateTime } .
* When parsing , the override chronology will be used to interpret the
* { @ linkplain ChronoField fields } into a date unless the
* formatter directly parses a valid chronology .
* This instance is immutable and unaffected by this method call .
* @ param chrono the new chronology , not null
* @ return a formatter based on this formatter with the requested override chronology , not null */
public DateTimeFormatter withChronology ( Chronology chrono ) { } }
|
if ( Jdk8Methods . equals ( this . chrono , chrono ) ) { return this ; } return new DateTimeFormatter ( printerParser , locale , decimalStyle , resolverStyle , resolverFields , chrono , zone ) ;
|
public class EnableSarlMavenNatureAction { /** * Enable the SARL Maven nature .
* @ param project the project . */
protected void enableNature ( IProject project ) { } }
|
final IFile pom = project . getFile ( IMavenConstants . POM_FILE_NAME ) ; final Job job ; if ( pom . exists ( ) ) { job = createJobForMavenProject ( project ) ; } else { job = createJobForJavaProject ( project ) ; } if ( job != null ) { job . schedule ( ) ; }
|
public class CxDxServerSessionImpl { /** * ( non - Javadoc )
* @ see org . jdiameter . api . cxdx . ServerCxDxSession # sendRegistrationTerminationRequest ( org . jdiameter . api . cxdx . events . JRegistrationTerminationRequest ) */
@ Override public void sendRegistrationTerminationRequest ( JRegistrationTerminationRequest request ) throws InternalException , IllegalDiameterStateException , RouteException , OverloadException { } }
|
send ( Event . Type . SEND_MESSAGE , request , null ) ;
|
public class GroovyScript2RestLoader { /** * Get working repository name . Returns the repository name from configuration
* if it previously configured and returns the name of current repository in other case .
* @ return String
* repository name
* @ throws RepositoryException */
private String getWorkingRepositoryName ( ) throws RepositoryException { } }
|
if ( observationListenerConfiguration . getRepository ( ) == null ) { return repositoryService . getCurrentRepository ( ) . getConfiguration ( ) . getName ( ) ; } else { return observationListenerConfiguration . getRepository ( ) ; }
|
public class AbstractMain { /** * This method should be invoked from the static main - method .
* @ param args are the commandline - arguments .
* @ return the exit code or { @ code 0 } on success . */
public int run ( String ... args ) { } }
|
CliParser parser = getParserBuilder ( ) . build ( this ) ; try { CliModeObject mode = parser . parseParameters ( args ) ; if ( this . help ) { assert ( mode . getId ( ) . equals ( CliMode . ID_HELP ) ) ; printHelp ( parser ) ; return 0 ; } validate ( mode ) ; return run ( mode ) ; } catch ( Exception e ) { return handleError ( e , parser ) ; } finally { getStandardOutput ( ) . flush ( ) ; getStandardError ( ) . flush ( ) ; }
|
public class Tracers { /** * 0 : 开始
* @ param request 调用请求 */
public static void startRpc ( SofaRequest request ) { } }
|
if ( openTrace ) { try { tracer . startRpc ( request ) ; } catch ( Exception e ) { if ( LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( "" , e ) ; } } }
|
public class UserPreferences { /** * Gets the file chooser with the given id . Its current directory will be
* tracked and restored on subsequent calls .
* @ param id
* @ return the file chooser with the given id */
public static JFileChooser getFileChooser ( final String id ) { } }
|
JFileChooser chooser = new JFileChooser ( ) ; track ( chooser , "FileChooser." + id + ".path" ) ; return chooser ;
|
public class TypeExtractor { /** * Infers the cast types for one intensional predicate
* No side - effect on alreadyKnownCastTypes */
private ImmutableList < TermType > inferCastTypes ( Predicate predicate , Collection < CQIE > samePredicateRules , ImmutableMap < CQIE , ImmutableList < Optional < TermType > > > termTypeMap , Map < Predicate , ImmutableList < TermType > > alreadyKnownCastTypes , DBMetadata metadata ) { } }
|
if ( samePredicateRules . isEmpty ( ) ) { ImmutableList . Builder < TermType > defaultTypeBuilder = ImmutableList . builder ( ) ; RelationID tableId = relation2Predicate . createRelationFromPredicateName ( metadata . getQuotedIDFactory ( ) , predicate ) ; Optional < RelationDefinition > td = Optional . ofNullable ( metadata . getRelation ( tableId ) ) ; IntStream . range ( 0 , predicate . getArity ( ) ) . forEach ( i -> { if ( td . isPresent ( ) ) { Attribute attribute = td . get ( ) . getAttribute ( i + 1 ) ; // get type from metadata
defaultTypeBuilder . add ( attribute . getTermType ( ) ) ; } else { defaultTypeBuilder . add ( literalType ) ; } } ) ; return defaultTypeBuilder . build ( ) ; } ImmutableMultimap < Integer , TermType > collectedProposedCastTypes = collectProposedCastTypes ( samePredicateRules , termTypeMap , alreadyKnownCastTypes ) ; return collectedProposedCastTypes . keySet ( ) . stream ( ) // 0 to n
. sorted ( ) . map ( i -> collectedProposedCastTypes . get ( i ) . stream ( ) . reduce ( // Neutral
null , ( type1 , type2 ) -> type1 == null ? type2 : unifyCastTypes ( type1 , type2 ) ) ) . map ( type -> { if ( type != null ) { return type ; } throw new IllegalStateException ( "Every argument is expected to have a COL_TYPE" ) ; } ) . collect ( ImmutableCollectors . toList ( ) ) ;
|
public class CmsJspTagFormatter { /** * Initializes this formatter tag . < p >
* @ throws JspException in case something goes wrong */
protected void init ( ) throws JspException { } }
|
// initialize OpenCms access objects
m_controller = CmsFlexController . getController ( pageContext . getRequest ( ) ) ; m_cms = m_controller . getCmsObject ( ) ; try { // get the resource name from the selected container
m_element = OpenCms . getADEManager ( ) . getCurrentElement ( pageContext . getRequest ( ) ) ; m_element . initResource ( m_cms ) ; if ( m_cms . getRequestContext ( ) . getCurrentProject ( ) . isOnlineProject ( ) && ! m_element . isReleasedAndNotExpired ( ) ) { throw new CmsException ( Messages . get ( ) . container ( Messages . ERR_RESOURCE_IS_NOT_RELEASE_OR_EXPIRED_1 , m_element . getResource ( ) . getRootPath ( ) ) ) ; } if ( m_locale == null ) { // no locale set , use locale from users request context
m_locale = m_cms . getRequestContext ( ) . getLocale ( ) ; } // load content and store it
CmsJspContentAccessBean bean ; if ( ( m_element . isInMemoryOnly ( ) || m_element . isTemporaryContent ( ) ) && ( m_element . getResource ( ) instanceof CmsFile ) ) { I_CmsXmlDocument xmlContent = CmsXmlContentFactory . unmarshal ( m_cms , m_element . getResource ( ) , pageContext . getRequest ( ) ) ; bean = new CmsJspContentAccessBean ( m_cms , m_locale , xmlContent ) ; } else { bean = new CmsJspContentAccessBean ( m_cms , m_locale , m_element . getResource ( ) ) ; } storeAttribute ( getVar ( ) , bean ) ; if ( m_value != null ) { // if the optional " val " parameter has been set , store the value map of the content in the page context scope
storeAttribute ( getVal ( ) , bean . getValue ( ) ) ; } if ( m_rdfa != null ) { // if the optional " rdfa " parameter has been set , store the rdfa map of the content in the page context scope
storeAttribute ( getRdfa ( ) , bean . getRdfa ( ) ) ; } } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; m_controller . setThrowable ( e , m_cms . getRequestContext ( ) . getUri ( ) ) ; throw new JspException ( e ) ; }
|
public class DeleteHapgRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteHapgRequest deleteHapgRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( deleteHapgRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteHapgRequest . getHapgArn ( ) , HAPGARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class KrakenImpl { /** * Parse and execute SQL . */
public Object execSync ( String sql , Object [ ] params ) { } }
|
QueryBuilderKraken query = QueryParserKraken . parse ( this , sql ) ; return _services . run ( 10 , TimeUnit . SECONDS , result -> query . build ( result . then ( ( q , r ) -> q . exec ( r , params ) ) ) ) ;
|
public class PathTrie { /** * delete a path from the trie
* @ param path the path to be deleted */
public void deletePath ( String path ) { } }
|
if ( path == null ) { return ; } String [ ] pathComponents = path . split ( "/" ) ; TrieNode parent = rootNode ; String part = null ; if ( pathComponents . length <= 1 ) { throw new IllegalArgumentException ( "Invalid path " + path ) ; } for ( int i = 1 ; i < pathComponents . length ; i ++ ) { part = pathComponents [ i ] ; if ( parent . getChild ( part ) == null ) { // the path does not exist
return ; } parent = parent . getChild ( part ) ; LOG . info ( parent ) ; } TrieNode realParent = parent . getParent ( ) ; realParent . deleteChild ( part ) ;
|
public class UpdateGlobalTableSettingsRequest { /** * Represents the settings for a global table in a region that will be modified .
* @ param replicaSettingsUpdate
* Represents the settings for a global table in a region that will be modified . */
public void setReplicaSettingsUpdate ( java . util . Collection < ReplicaSettingsUpdate > replicaSettingsUpdate ) { } }
|
if ( replicaSettingsUpdate == null ) { this . replicaSettingsUpdate = null ; return ; } this . replicaSettingsUpdate = new java . util . ArrayList < ReplicaSettingsUpdate > ( replicaSettingsUpdate ) ;
|
public class CmsSerialDateValue { /** * Convert the information from the wrapper to a JSON object .
* @ return the serial date information as JSON . */
public JSONObject toJson ( ) { } }
|
try { JSONObject result = new JSONObject ( ) ; if ( null != getStart ( ) ) { result . put ( JsonKey . START , dateToJson ( getStart ( ) ) ) ; } if ( null != getEnd ( ) ) { result . put ( JsonKey . END , dateToJson ( getEnd ( ) ) ) ; } if ( isWholeDay ( ) ) { result . put ( JsonKey . WHOLE_DAY , true ) ; } JSONObject pattern = patternToJson ( ) ; result . put ( JsonKey . PATTERN , pattern ) ; SortedSet < Date > exceptions = getExceptions ( ) ; if ( ! exceptions . isEmpty ( ) ) { result . put ( JsonKey . EXCEPTIONS , datesToJson ( exceptions ) ) ; } switch ( getEndType ( ) ) { case DATE : result . put ( JsonKey . SERIES_ENDDATE , dateToJson ( getSeriesEndDate ( ) ) ) ; break ; case TIMES : result . put ( JsonKey . SERIES_OCCURRENCES , String . valueOf ( getOccurrences ( ) ) ) ; break ; case SINGLE : default : break ; } if ( ! isCurrentTillEnd ( ) ) { result . put ( JsonKey . CURRENT_TILL_END , false ) ; } if ( null != getParentSeriesId ( ) ) { result . put ( JsonKey . PARENT_SERIES , getParentSeriesId ( ) . getStringValue ( ) ) ; } return result ; } catch ( JSONException e ) { LOG . error ( "Could not convert Serial date value to JSON." , e ) ; return null ; }
|
public class JsonPath { /** * Parses the given JSON input using the provided { @ link Configuration } and
* returns a { @ link DocumentContext } for path evaluation
* @ param json input
* @ return a read context */
public static DocumentContext parse ( InputStream json , Configuration configuration ) { } }
|
return new ParseContextImpl ( configuration ) . parse ( json ) ;
|
public class TldScanner { /** * Scan for TLDs in JARs in / WEB - INF / lib .
* @ throws IOException */
public void scanJars ( ) throws IOException { } }
|
ClassLoader webappLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; ClassLoader parentLoader = webappLoader . getParent ( ) ; ResourceDelegatingBundleClassLoader classLoader = null ; if ( webappLoader instanceof ResourceDelegatingBundleClassLoader ) { classLoader = ( ResourceDelegatingBundleClassLoader ) webappLoader ; } else if ( parentLoader instanceof ResourceDelegatingBundleClassLoader ) { classLoader = ( ResourceDelegatingBundleClassLoader ) parentLoader ; } else if ( isTomcatWebLoader ( ) ) { ClassLoader parent = ( ( org . apache . catalina . loader . WebappClassLoader ) webappLoader ) . getParent ( ) ; if ( parent instanceof ResourceDelegatingBundleClassLoader ) { classLoader = ( ResourceDelegatingBundleClassLoader ) parent ; } } List < Bundle > bundles = classLoader == null ? Collections . < Bundle > emptyList ( ) : classLoader . getBundles ( ) ; for ( Bundle bundle : bundles ) { Collection < Enumeration < URL > > enumerations ; BundleWiring bundleWiring = bundle . adapt ( BundleWiring . class ) ; if ( bundleWiring == null ) { Enumeration < URL > urls = bundle . findEntries ( "META-INF" , "*.tld" , true ) ; enumerations = Collections . singleton ( urls ) ; } else { Collection < String > resources = bundleWiring . listResources ( "META-INF" , "*.tld" , BundleWiring . LISTRESOURCES_RECURSE ) ; enumerations = new ArrayList < > ( resources . size ( ) ) ; for ( String resource : resources ) { Enumeration < URL > urls = bundle . getResources ( resource ) ; enumerations . add ( urls ) ; } } for ( Enumeration < URL > urls : enumerations ) { if ( urls != null ) { while ( urls . hasMoreElements ( ) ) { URL url = urls . nextElement ( ) ; LOG . info ( "found TLD {}" , url ) ; TldResourcePath tldResourcePath = new TldResourcePath ( url , null , null ) ; try { parseTld ( tldResourcePath ) ; } catch ( SAXException e ) { throw new IOException ( e ) ; } } } } }
|
public class JBEANBOX { /** * Equal to " @ VALUE " annotation */
public static BeanBox value ( Object value ) { } }
|
return new BeanBox ( ) . setTarget ( value ) . setPureValue ( true ) . setRequired ( true ) ;
|
public class FeatureState { /** * The list of users associated with the feature state .
* @ return The user list , never < code > null < / code >
* @ deprecated This method will be removed soon . Use { @ link # getParameter ( String ) } instead to read the corresponding
* strategy parameter . */
@ Deprecated public List < String > getUsers ( ) { } }
|
String value = getParameter ( UsernameActivationStrategy . PARAM_USERS ) ; if ( Strings . isNotBlank ( value ) ) { return Strings . splitAndTrim ( value , "," ) ; } return Collections . emptyList ( ) ;
|
public class DbxRequestUtil { /** * Convenience function for making HTTP POST requests . Like startPostNoAuth but takes byte [ ] instead of params . */
public static HttpRequestor . Response startPostRaw ( DbxRequestConfig requestConfig , String sdkUserAgentIdentifier , String host , String path , byte [ ] body , /* @ Nullable */
List < HttpRequestor . Header > headers ) throws NetworkIOException { } }
|
String uri = buildUri ( host , path ) ; headers = copyHeaders ( headers ) ; headers = addUserAgentHeader ( headers , requestConfig , sdkUserAgentIdentifier ) ; headers . add ( new HttpRequestor . Header ( "Content-Length" , Integer . toString ( body . length ) ) ) ; try { HttpRequestor . Uploader uploader = requestConfig . getHttpRequestor ( ) . startPost ( uri , headers ) ; try { uploader . upload ( body ) ; return uploader . finish ( ) ; } finally { uploader . close ( ) ; } } catch ( IOException ex ) { throw new NetworkIOException ( ex ) ; }
|
public class LineOptions { /** * Creates LineOptions out of a Feature .
* @ param feature feature to be converted */
@ Nullable static LineOptions fromFeature ( @ NonNull Feature feature ) { } }
|
if ( feature . geometry ( ) == null ) { throw new RuntimeException ( "geometry field is required" ) ; } if ( ! ( feature . geometry ( ) instanceof LineString ) ) { return null ; } LineOptions options = new LineOptions ( ) ; options . geometry = ( LineString ) feature . geometry ( ) ; if ( feature . hasProperty ( PROPERTY_LINE_JOIN ) ) { options . lineJoin = feature . getProperty ( PROPERTY_LINE_JOIN ) . getAsString ( ) ; } if ( feature . hasProperty ( PROPERTY_LINE_OPACITY ) ) { options . lineOpacity = feature . getProperty ( PROPERTY_LINE_OPACITY ) . getAsFloat ( ) ; } if ( feature . hasProperty ( PROPERTY_LINE_COLOR ) ) { options . lineColor = feature . getProperty ( PROPERTY_LINE_COLOR ) . getAsString ( ) ; } if ( feature . hasProperty ( PROPERTY_LINE_WIDTH ) ) { options . lineWidth = feature . getProperty ( PROPERTY_LINE_WIDTH ) . getAsFloat ( ) ; } if ( feature . hasProperty ( PROPERTY_LINE_GAP_WIDTH ) ) { options . lineGapWidth = feature . getProperty ( PROPERTY_LINE_GAP_WIDTH ) . getAsFloat ( ) ; } if ( feature . hasProperty ( PROPERTY_LINE_OFFSET ) ) { options . lineOffset = feature . getProperty ( PROPERTY_LINE_OFFSET ) . getAsFloat ( ) ; } if ( feature . hasProperty ( PROPERTY_LINE_BLUR ) ) { options . lineBlur = feature . getProperty ( PROPERTY_LINE_BLUR ) . getAsFloat ( ) ; } if ( feature . hasProperty ( PROPERTY_LINE_PATTERN ) ) { options . linePattern = feature . getProperty ( PROPERTY_LINE_PATTERN ) . getAsString ( ) ; } if ( feature . hasProperty ( PROPERTY_IS_DRAGGABLE ) ) { options . isDraggable = feature . getProperty ( PROPERTY_IS_DRAGGABLE ) . getAsBoolean ( ) ; } return options ;
|
public class IterableOfProtosSubject { /** * Specifies that extra repeated field elements for these explicitly specified top - level field
* numbers should be ignored . Sub - fields must be specified explicitly ( via { @ link
* FieldDescriptor } ) if their extra elements are to be ignored as well .
* < p > Use { @ link # ignoringExtraRepeatedFieldElements ( ) } instead to ignore these for all fields .
* @ see # ignoringExtraRepeatedFieldElements ( ) for details . */
public IterableOfProtosFluentAssertion < M > ignoringExtraRepeatedFieldElementsOfFields ( int firstFieldNumber , int ... rest ) { } }
|
return usingConfig ( config . ignoringExtraRepeatedFieldElementsOfFields ( asList ( firstFieldNumber , rest ) ) ) ;
|
public class AnnotationMappingInfo { /** * XML ( テキスト ) として返す 。
* < p > JAXB標準の設定でXMLを作成します 。 < / p >
* @ since 1.1
* @ return XML情報 。 */
public String toXml ( ) { } }
|
StringWriter writer = new StringWriter ( ) ; JAXB . marshal ( this , writer ) ; writer . flush ( ) ; return writer . toString ( ) ;
|
public class EventImpl { /** * Fire an event containing a DevFailed .
* @ param devFailed the failed object to be sent .
* @ param eventSocket
* @ throws DevFailed */
protected void pushDevFailedEvent ( final DevFailed devFailed , ZMQ . Socket eventSocket ) throws DevFailed { } }
|
xlogger . entry ( ) ; eventTrigger . updateProperties ( ) ; eventTrigger . setError ( devFailed ) ; if ( isSendEvent ( ) ) { try { synchronized ( eventSocket ) { EventUtilities . sendToSocket ( eventSocket , fullName , counter ++ , true , EventUtilities . marshall ( devFailed ) ) ; } } catch ( final org . zeromq . ZMQException e ) { throw DevFailedUtils . newDevFailed ( e ) ; } } xlogger . exit ( ) ;
|
public class ConfigReference { /** * any failure to resolve has to start with a ConfigReference . */
@ Override AbstractConfigValue resolveSubstitutions ( ResolveContext context ) { } }
|
context . source ( ) . replace ( this , ResolveReplacer . cycleResolveReplacer ) ; try { AbstractConfigValue v ; try { v = context . source ( ) . lookupSubst ( context , expr , prefixLength ) ; } catch ( NotPossibleToResolve e ) { if ( expr . optional ( ) ) v = null ; else throw new ConfigException . UnresolvedSubstitution ( origin ( ) , expr + " was part of a cycle of substitutions involving " + e . traceString ( ) , e ) ; } if ( v == null && ! expr . optional ( ) ) { throw new ConfigException . UnresolvedSubstitution ( origin ( ) , expr . toString ( ) ) ; } return v ; } finally { context . source ( ) . unreplace ( this ) ; }
|
public class BucketTimeSeries { /** * Resets the values from [ fromIndex , endIndex ) .
* @ param fromIndex the index to start from ( included )
* @ param endIndex the index to end ( excluded ) */
protected void fill ( int fromIndex , int endIndex ) { } }
|
fromIndex = fromIndex == - 1 ? 0 : fromIndex ; endIndex = endIndex == - 1 || endIndex > this . timeSeries . length ? this . timeSeries . length : endIndex ; final T val ; if ( applyZero ( ) ) { val = zero ( ) ; } else { val = null ; } // set the values
for ( int i = fromIndex ; i < endIndex ; i ++ ) { set ( i , val ) ; }
|
public class BinaryErrorLogger { /** * Creates a { @ code BinaryErrorLogger } . The { @ code stringifier } is a means of rendering the
* aligned items as strings . If you don ' t care , choose { @ link Functions # toStringFunction ( ) } . */
public static < ItemT extends HasDocID > BinaryErrorLogger < ItemT , ItemT > forStringifierAndOutputDir ( Function < ? super ItemT , String > stringifier , File outputDirectory ) { } }
|
outputDirectory . mkdirs ( ) ; return new BinaryErrorLogger < ItemT , ItemT > ( outputDirectory , stringifier , stringifier ) ;
|
public class UserManager { /** * If a user is already known to be authenticated for one reason or other , this method can be
* used to give them the appropriate authentication cookies to effect their login .
* @ param expires the number of days in which to expire the session cookie , 0 means expire at
* the end of the browser session . */
public void effectLogin ( User user , int expires , HttpServletRequest req , HttpServletResponse rsp ) throws PersistenceException { } }
|
String authcode = _repository . registerSession ( user , Math . max ( expires , 1 ) ) ; Cookie acookie = new Cookie ( _userAuthCookie , authcode ) ; // strip the hostname from the server and use that as the domain unless configured not to
if ( ! "false" . equalsIgnoreCase ( _config . getProperty ( "auth_cookie.strip_hostname" ) ) ) { CookieUtil . widenDomain ( req , acookie ) ; } acookie . setPath ( "/" ) ; acookie . setMaxAge ( ( expires > 0 ) ? ( expires * 24 * 60 * 60 ) : - 1 ) ; if ( USERMGR_DEBUG ) { log . info ( "Setting cookie " + acookie + "." ) ; } rsp . addCookie ( acookie ) ;
|
public class LogRecordServiceImpl { /** * < pre >
* 用于DO对象转化为Model对象
* < / pre >
* @ param channelDO
* @ return Channel */
private LogRecord doToModel ( LogRecordDO logRecordDo ) { } }
|
LogRecord logRecord = new LogRecord ( ) ; try { logRecord . setId ( logRecordDo . getId ( ) ) ; if ( logRecordDo . getPipelineId ( ) > 0 && logRecordDo . getChannelId ( ) > 0 ) { try { Channel channel = channelService . findByPipelineId ( logRecordDo . getPipelineId ( ) ) ; logRecord . setChannel ( channel ) ; for ( Pipeline pipeline : channel . getPipelines ( ) ) { if ( pipeline . getId ( ) . equals ( logRecordDo . getPipelineId ( ) ) ) { logRecord . setPipeline ( pipeline ) ; } } } catch ( Exception e ) { // 可能历史的log记录对应的channel / pipeline已经被删除了 , 直接忽略吧
Channel channel = new Channel ( ) ; channel . setId ( 0l ) ; logRecord . setChannel ( channel ) ; Pipeline pipeline = new Pipeline ( ) ; pipeline . setId ( 0l ) ; logRecord . setPipeline ( pipeline ) ; } } else { Channel channel = new Channel ( ) ; channel . setId ( - 1l ) ; logRecord . setChannel ( channel ) ; Pipeline pipeline = new Pipeline ( ) ; pipeline . setId ( - 1l ) ; logRecord . setPipeline ( pipeline ) ; } logRecord . setTitle ( logRecordDo . getTitle ( ) ) ; logRecord . setNid ( logRecordDo . getNid ( ) ) ; logRecord . setMessage ( logRecordDo . getMessage ( ) ) ; logRecord . setGmtCreate ( logRecordDo . getGmtCreate ( ) ) ; logRecord . setGmtModified ( logRecordDo . getGmtModified ( ) ) ; } catch ( Exception e ) { logger . error ( "ERROR ## " ) ; throw new ManagerException ( e ) ; } return logRecord ;
|
public class Response { /** * Resolve the { @ link URI } s of the href elements of this response object against the given { @ link URI } .
* < strong > Note : < / strong > This will only resolve the href URIs of the response object itself . It will not resolve any URI value of any property . If you need
* to resolve those you should do that against the the URI you get from { @ link # getHRef ( ) } .
* @ param uri
* The { @ link URI } to resolve against . */
public void resolveHRefs ( URI uri ) { } }
|
if ( mLocation != null && ! mLocation . isAbsolute ( ) ) { mLocation = uri . resolve ( mLocation ) ; } List < URI > hrefs = mHrefs ; for ( int i = 0 , count = hrefs . size ( ) ; i < count ; ++ i ) { URI href = hrefs . get ( i ) ; if ( ! href . isAbsolute ( ) ) { hrefs . set ( i , uri . resolve ( href ) ) ; } }
|
public class FloatList { /** * This is equivalent to :
* < pre >
* < code >
* if ( isEmpty ( ) ) {
* return identity ;
* float result = identity ;
* for ( int i = 0 ; i < size ; i + + ) {
* result = accumulator . applyAsFloat ( result , elementData [ i ] ) ;
* return result ;
* < / code >
* < / pre >
* @ param identity
* @ param accumulator
* @ return */
public < E extends Exception > float reduce ( final float identity , final Try . FloatBinaryOperator < E > accumulator ) throws E { } }
|
if ( isEmpty ( ) ) { return identity ; } float result = identity ; for ( int i = 0 ; i < size ; i ++ ) { result = accumulator . applyAsFloat ( result , elementData [ i ] ) ; } return result ;
|
public class DotmlMojo { /** * when we are using DOTML files , we need to transform them to DOT files first . */
protected File transformInputFile ( File from ) throws MojoExecutionException { } }
|
// create a temp file
File tempFile ; try { tempFile = File . createTempFile ( "dotml-tmp" , ".xml" ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "error creating temp file to hold DOTML to DOT translation" , e ) ; } // perform an XSLT transform from the input file to the temp file
Source xml = new StreamSource ( from ) ; Result result = new StreamResult ( tempFile ) ; try { Source xslt = new StreamSource ( getClass ( ) . getClassLoader ( ) . getResourceAsStream ( "dotml/dotml2dot.xsl" ) ) ; transformerFactory . newTransformer ( xslt ) . transform ( xml , result ) ; } catch ( TransformerException e ) { throw new MojoExecutionException ( String . format ( "error transforming %s from DOTML to DOT file" , from ) , e ) ; } // return the temp file
return tempFile ;
|
public class PrimitiveCastExtensions { /** * Decodes a { @ code CharSequence } into a { @ code byte } .
* < p > In opposite to the functions of { @ link Byte } , this function is
* null - safe and does not generate a { @ link NumberFormatException } .
* If the given string cannot by parsed , { @ code 0 } is replied .
* < p > See { @ link Byte # decode ( String ) } for details on the accepted formats
* for the input string of characters .
* @ param value a value of { @ code CharSequence } type .
* @ return the equivalent value to { @ code value } of { @ code byte } type .
* @ since 0.9
* @ see Byte # decode ( String ) */
@ Pure public static byte byteValue ( CharSequence value ) { } }
|
try { return Byte . decode ( value . toString ( ) ) ; } catch ( Throwable exception ) { // Silent exception .
} return 0 ;
|
public class FilterBuilder { /** * Adds the specified Filter to the composition of Filters joined using the OR operator .
* @ param filter the Filter to add to the composition joined using the OR operator .
* @ return this FilterBuilder instance .
* @ see org . cp . elements . lang . Filter */
public FilterBuilder < T > addWithOr ( final Filter < T > filter ) { } }
|
filterInstance = ComposableFilter . or ( filterInstance , filter ) ; return this ;
|
public class BrokerHelper { /** * Returns an Array with an Objects PK VALUES if convertToSql is true , any
* associated java - to - sql conversions are applied . If the Object is a Proxy
* or a VirtualProxy NO conversion is necessary .
* @ param objectOrProxy
* @ param convertToSql
* @ return Object [ ]
* @ throws PersistenceBrokerException */
public ValueContainer [ ] getKeyValues ( ClassDescriptor cld , Object objectOrProxy , boolean convertToSql ) throws PersistenceBrokerException { } }
|
IndirectionHandler handler = ProxyHelper . getIndirectionHandler ( objectOrProxy ) ; if ( handler != null ) { return getKeyValues ( cld , handler . getIdentity ( ) , convertToSql ) ; // BRJ : convert Identity
} else { ClassDescriptor realCld = getRealClassDescriptor ( cld , objectOrProxy ) ; return getValuesForObject ( realCld . getPkFields ( ) , objectOrProxy , convertToSql ) ; }
|
public class RunInstancesRequest { /** * The license configurations .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setLicenseSpecifications ( java . util . Collection ) } or
* { @ link # withLicenseSpecifications ( java . util . Collection ) } if you want to override the existing values .
* @ param licenseSpecifications
* The license configurations .
* @ return Returns a reference to this object so that method calls can be chained together . */
public RunInstancesRequest withLicenseSpecifications ( LicenseConfigurationRequest ... licenseSpecifications ) { } }
|
if ( this . licenseSpecifications == null ) { setLicenseSpecifications ( new com . amazonaws . internal . SdkInternalList < LicenseConfigurationRequest > ( licenseSpecifications . length ) ) ; } for ( LicenseConfigurationRequest ele : licenseSpecifications ) { this . licenseSpecifications . add ( ele ) ; } return this ;
|
public class UserSettingsImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < ObjectIDMPluginConfiguration > getObjectIDMs ( ) { } }
|
return ( EList < ObjectIDMPluginConfiguration > ) eGet ( StorePackage . Literals . USER_SETTINGS__OBJECT_ID_MS , true ) ;
|
public class AmazonElasticLoadBalancingClient { /** * Describes the certificates for the specified HTTPS listener .
* @ param describeListenerCertificatesRequest
* @ return Result of the DescribeListenerCertificates operation returned by the service .
* @ throws ListenerNotFoundException
* The specified listener does not exist .
* @ sample AmazonElasticLoadBalancing . DescribeListenerCertificates
* @ see < a
* href = " http : / / docs . aws . amazon . com / goto / WebAPI / elasticloadbalancingv2-2015-12-01 / DescribeListenerCertificates "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeListenerCertificatesResult describeListenerCertificates ( DescribeListenerCertificatesRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeListenerCertificates ( request ) ;
|
public class CollectionLiteralsTypeComputer { /** * Entry point from the { @ link XbaseTypeComputer } . */
public void computeType ( XSetLiteral literal , ITypeComputationState state ) { } }
|
JvmGenericType setType = findDeclaredType ( Set . class , state ) ; if ( setType == null ) { handleCollectionTypeNotAvailable ( literal , state , Set . class ) ; return ; } JvmGenericType mapType = findDeclaredType ( Map . class , state ) ; for ( ITypeExpectation expectation : state . getExpectations ( ) ) { computeType ( literal , setType , mapType , expectation , state ) ; }
|
public class ConstantInterfaceMethodInfo { /** * Will return either a new ConstantInterfaceMethodInfo object or
* one already in the constant pool .
* If it is a new ConstantInterfaceMethodInfo , it will be inserted
* into the pool . */
static ConstantInterfaceMethodInfo make ( ConstantPool cp , ConstantClassInfo parentClass , ConstantNameAndTypeInfo nameAndType ) { } }
|
ConstantInfo ci = new ConstantInterfaceMethodInfo ( parentClass , nameAndType ) ; return ( ConstantInterfaceMethodInfo ) cp . addConstant ( ci ) ;
|
public class EurekaLoadBalancer { /** * This function is called from ConnectionPool to retrieve which server to
* communicate
* @ param key can bel null
* @ return */
@ Override public Server chooseServer ( Object key ) { } }
|
Server server = super . chooseServer ( key ) ; if ( server == null ) { return null ; } server . setPort ( port ) ; return server ;
|
public class DefaultDispatchChallengeHandler { /** * Return the Node corresponding to ( " matching " ) a location , or < code > null < / code > if none can be found .
* @ param location the location at which to find a Node
* @ return the Node corresponding to ( " matching " ) a location , or < code > null < / code > if none can be found . */
private Node < ChallengeHandler , UriElement > findBestMatchingNode ( String location ) { } }
|
List < Token < UriElement > > tokens = tokenize ( location ) ; int tokenIdx = 0 ; return rootNode . findBestMatchingNode ( tokens , tokenIdx ) ;
|
public class Constraint { /** * Generates the foreign key declaration for a given Constraint object . */
private void getFKStatement ( StringBuffer a ) { } }
|
if ( ! getName ( ) . isReservedName ( ) ) { a . append ( Tokens . T_CONSTRAINT ) . append ( ' ' ) ; a . append ( getName ( ) . statementName ) ; a . append ( ' ' ) ; } a . append ( Tokens . T_FOREIGN ) . append ( ' ' ) . append ( Tokens . T_KEY ) ; int [ ] col = getRefColumns ( ) ; getColumnList ( getRef ( ) , col , col . length , a ) ; a . append ( ' ' ) . append ( Tokens . T_REFERENCES ) . append ( ' ' ) ; a . append ( getMain ( ) . getName ( ) . getSchemaQualifiedStatementName ( ) ) ; col = getMainColumns ( ) ; getColumnList ( getMain ( ) , col , col . length , a ) ; if ( getDeleteAction ( ) != Constraint . NO_ACTION ) { a . append ( ' ' ) . append ( Tokens . T_ON ) . append ( ' ' ) . append ( Tokens . T_DELETE ) . append ( ' ' ) ; a . append ( getDeleteActionString ( ) ) ; } if ( getUpdateAction ( ) != Constraint . NO_ACTION ) { a . append ( ' ' ) . append ( Tokens . T_ON ) . append ( ' ' ) . append ( Tokens . T_UPDATE ) . append ( ' ' ) ; a . append ( getUpdateActionString ( ) ) ; }
|
public class RuleFactory { /** * Create rule from applying operator to stack .
* @ param symbol symbol
* @ param stack stack
* @ return new instance */
public Rule getRule ( final String symbol , final Stack stack ) { } }
|
if ( AND_RULE . equals ( symbol ) ) { return AndRule . getRule ( stack ) ; } if ( OR_RULE . equals ( symbol ) ) { return OrRule . getRule ( stack ) ; } if ( NOT_RULE . equals ( symbol ) ) { return NotRule . getRule ( stack ) ; } if ( NOT_EQUALS_RULE . equals ( symbol ) ) { return NotEqualsRule . getRule ( stack ) ; } if ( EQUALS_RULE . equals ( symbol ) ) { return EqualsRule . getRule ( stack ) ; } if ( PARTIAL_TEXT_MATCH_RULE . equals ( symbol ) ) { return PartialTextMatchRule . getRule ( stack ) ; } if ( RULES . contains ( LIKE_RULE ) && LIKE_RULE . equalsIgnoreCase ( symbol ) ) { return LikeRule . getRule ( stack ) ; } if ( EXISTS_RULE . equalsIgnoreCase ( symbol ) ) { return ExistsRule . getRule ( stack ) ; } if ( LESS_THAN_RULE . equals ( symbol ) ) { return InequalityRule . getRule ( LESS_THAN_RULE , stack ) ; } if ( GREATER_THAN_RULE . equals ( symbol ) ) { return InequalityRule . getRule ( GREATER_THAN_RULE , stack ) ; } if ( LESS_THAN_EQUALS_RULE . equals ( symbol ) ) { return InequalityRule . getRule ( LESS_THAN_EQUALS_RULE , stack ) ; } if ( GREATER_THAN_EQUALS_RULE . equals ( symbol ) ) { return InequalityRule . getRule ( GREATER_THAN_EQUALS_RULE , stack ) ; } throw new IllegalArgumentException ( "Invalid rule: " + symbol ) ;
|
public class AmazonRoute53Client { /** * Gets information about a specified hosted zone including the four name servers assigned to the hosted zone .
* @ param getHostedZoneRequest
* A request to get information about a specified hosted zone .
* @ return Result of the GetHostedZone operation returned by the service .
* @ throws NoSuchHostedZoneException
* No hosted zone exists with the ID that you specified .
* @ throws InvalidInputException
* The input is not valid .
* @ sample AmazonRoute53 . GetHostedZone
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / route53-2013-04-01 / GetHostedZone " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public GetHostedZoneResult getHostedZone ( GetHostedZoneRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeGetHostedZone ( request ) ;
|
public class ReferenceCountedOpenSslEngine { /** * Attempt to call { @ link SSL # shutdownSSL ( long ) } .
* @ return { @ code false } if the call to { @ link SSL # shutdownSSL ( long ) } was not attempted or returned an error . */
private boolean doSSLShutdown ( ) { } }
|
if ( SSL . isInInit ( ssl ) != 0 ) { // Only try to call SSL _ shutdown if we are not in the init state anymore .
// Otherwise we will see ' error : 140E0197 : SSL routines : SSL _ shutdown : shutdown while in init ' in our logs .
// See also http : / / hg . nginx . org / nginx / rev / 062c189fee20
return false ; } int err = SSL . shutdownSSL ( ssl ) ; if ( err < 0 ) { int sslErr = SSL . getError ( ssl , err ) ; if ( sslErr == SSL . SSL_ERROR_SYSCALL || sslErr == SSL . SSL_ERROR_SSL ) { if ( logger . isDebugEnabled ( ) ) { int error = SSL . getLastErrorNumber ( ) ; logger . debug ( "SSL_shutdown failed: OpenSSL error: {} {}" , error , SSL . getErrorString ( error ) ) ; } // There was an internal error - - shutdown
shutdown ( ) ; return false ; } SSL . clearError ( ) ; } return true ;
|
public class Model { /** * Sets attribute value as < code > java . sql . Time < / code > .
* If there is a { @ link Converter } registered for the attribute that converts from Class < code > S < / code > to Class
* < code > java . sql . Time < / code > , given the value is an instance of < code > S < / code > , then it will be used ,
* otherwise performs a conversion using { @ link Convert # toTime ( Object ) } .
* @ param attributeName name of attribute .
* @ param value value
* @ return reference to this model . */
public < T extends Model > T setTime ( String attributeName , Object value ) { } }
|
Converter < Object , Time > converter = modelRegistryLocal . converterForValue ( attributeName , value , Time . class ) ; return setRaw ( attributeName , converter != null ? converter . convert ( value ) : Convert . toTime ( value ) ) ;
|
public class ServletWrapper { /** * Method setUnavailableUntil .
* @ param time
* @ param isInit */
private void setUnavailableUntil ( long time , boolean isInit ) // PM01373
{ } }
|
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setUnavailableUntil" , "setUnavailableUntil() : " + time ) ; if ( isInit ) { state = UNINITIALIZED_STATE ; // PM01373
} else { state = UNAVAILABLE_STATE ; } unavailableUntil = time ; evtSource . onServletUnavailableForService ( getServletEvent ( ) ) ;
|
public class XVariableDeclarationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setWriteable ( boolean newWriteable ) { } }
|
boolean oldWriteable = writeable ; writeable = newWriteable ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XbasePackage . XVARIABLE_DECLARATION__WRITEABLE , oldWriteable , writeable ) ) ;
|
public class EnumDictionary { /** * Convenience method to be invoked by JNI . */
static < T extends Enum < T > > T get ( Class < T > clazz , int v ) { } }
|
return get ( clazz ) . constant ( v ) ;
|
public class OnlineLDAsvi { /** * Performs the main iteration to determine the topic distribution of the
* given document against the current model parameters . The non zero values
* of phi will be stored in { @ code indexMap } and { @ code phiCols }
* @ param doc the document to get the topic assignments for
* @ param indexMap the array of integers to store the non zero document
* indices in
* @ param phiCols the array to store the normalized non zero values of phi
* in , where each value corresponds to the associated index in
* { @ code indexMap }
* @ param K the number of topics
* @ param gamma _ d the initial value of γ that will be altered to the topic assignments , but not normalized
* @ param ELogTheta _ d the expectation from γ per topic
* @ param ExpELogTheta _ d the exponentiated vector for { @ code ELogTheta _ d } */
private void computePhi ( final Vec doc , int [ ] indexMap , double [ ] phiCols , int K , final Vec gamma_d , final Vec ELogTheta_d , final Vec ExpELogTheta_d ) { } }
|
// φ ^ k _ dn ∝ exp { E [ logθdk ] + E [ logβk , wdn ] } , k ∈ { 1 , . . . , K }
/* * we have the exp versions of each , and exp ( log ( x ) + log ( y ) ) = x y
* so we can just use the doc product between the vectors per
* document to get the normalization constan Z
* When we update γ we multiply by the word , so non presnet words
* have no impact . So we don ' t need ALL of the columbs from φ , but
* only the columns for which we have non zero words . */
/* * normalized for each topic column ( len K ) of the words in this doc .
* We only need to concern oursleves with the non zeros
* Beacse we need to update several iterations , we will work with
* the inernal stricture dirrectly instead of using expensitve
* get / set on a Sparse Vector */
int pos = 0 ; final SparseVector updateVec = new SparseVector ( indexMap , phiCols , W , doc . nnz ( ) ) ; for ( IndexValue iv : doc ) { int wordIndex = iv . getIndex ( ) ; double sum = 0 ; for ( int i = 0 ; i < ExpELogTheta_d . length ( ) ; i ++ ) sum += ExpELogTheta_d . get ( i ) * ExpELogBeta . get ( i ) . get ( wordIndex ) ; indexMap [ pos ] = wordIndex ; phiCols [ pos ] = iv . getValue ( ) / ( sum + 1e-15 ) ; pos ++ ; } // iterate till convergence or we hit arbitrary 100 limit ( dont usually see more than 70)
for ( int iter = 0 ; iter < 100 ; iter ++ ) { double meanAbsChange = 0 ; double gamma_d_sum = 0 ; // γtk = α + w φ _ twk n _ tw
for ( int k = 0 ; k < K ; k ++ ) { final double origGamma_dk = gamma_d . get ( k ) ; double gamma_dtk = alpha ; gamma_dtk += ExpELogTheta_d . get ( k ) * updateVec . dot ( ExpELogBeta . get ( k ) ) ; gamma_d . set ( k , gamma_dtk ) ; meanAbsChange += Math . abs ( gamma_dtk - origGamma_dk ) ; gamma_d_sum += gamma_dtk ; } // update Eq [ log θtk ] and our exponentated copy of it
expandPsiMinusPsiSum ( gamma_d , gamma_d_sum , ELogTheta_d ) ; for ( int i = 0 ; i < ELogTheta_d . length ( ) ; i ++ ) ExpELogTheta_d . set ( i , FastMath . exp ( ELogTheta_d . get ( i ) ) ) ; // update our column norm norms
int indx = 0 ; for ( IndexValue iv : doc ) { int wordIndex = iv . getIndex ( ) ; double sum = 0 ; for ( int i = 0 ; i < ExpELogTheta_d . length ( ) ; i ++ ) sum += ExpELogTheta_d . get ( i ) * ExpELogBeta . get ( i ) . get ( wordIndex ) ; phiCols [ indx ] = iv . getValue ( ) / ( sum + 1e-15 ) ; indx ++ ; } /* * / / original papser uses a tighter bound , but our approximation
* isn ' t that good - and this seems to work well enough
* 0.01 even seems to work , but need to try that more before
* switching */
if ( meanAbsChange < 0.001 * K ) break ; }
|
public class GrailsLocaleUtils { /** * Returns the set of available locale suffixes
* @ return the set of available locale suffixes */
public static Set < String > getAvailableLocaleSuffixes ( ) { } }
|
Set < String > availableLocaleSuffixes = new HashSet < String > ( ) ; Locale [ ] availableLocales = Locale . getAvailableLocales ( ) ; for ( int i = 0 ; i < availableLocales . length ; i ++ ) { Locale locale = availableLocales [ i ] ; StringBuffer sb = new StringBuffer ( ) ; if ( locale != null ) { String language = locale . getLanguage ( ) ; String country = locale . getCountry ( ) ; String variant = locale . getVariant ( ) ; if ( variant != "" ) { sb . append ( language ) . append ( '_' ) . append ( country ) . append ( '_' ) . append ( variant ) ; } else if ( country != "" ) { sb . append ( language ) . append ( '_' ) . append ( country ) ; } else { sb . append ( language ) ; } } availableLocaleSuffixes . add ( sb . toString ( ) ) ; } return availableLocaleSuffixes ;
|
public class DataStatistics { /** * Caches the given statistics . They are later retrievable under the given identifier .
* @ param statistics The statistics to cache .
* @ param identifier The identifier which may be later used to retrieve the statistics . */
public void cacheBaseStatistics ( BaseStatistics statistics , String identifier ) { } }
|
synchronized ( this . baseStatisticsCache ) { this . baseStatisticsCache . put ( identifier , statistics ) ; }
|
public class JDBC4CallableStatement { /** * Returns an object representing the value of OUT parameter parameterName and uses map for the custom mapping of the parameter value . */
@ Override public Object getObject ( String parameterName , Map < String , Class < ? > > map ) throws SQLException { } }
|
checkClosed ( ) ; throw SQLError . noSupport ( ) ;
|
public class CQJDBCStorageConnection { /** * { @ inheritDoc } */
@ Override public void rename ( NodeData data ) throws RepositoryException , UnsupportedOperationException , InvalidItemStateException , IllegalStateException { } }
|
currentItem = data ; try { setOperationType ( TYPE_RENAME ) ; super . rename ( data ) ; } finally { currentItem = null ; }
|
public class Matrix4x3d { /** * Exchange the values of < code > this < / code > matrix with the given < code > other < / code > matrix .
* @ param other
* the other matrix to exchange the values with
* @ return this */
public Matrix4x3d swap ( Matrix4x3d other ) { } }
|
double tmp ; tmp = m00 ; m00 = other . m00 ; other . m00 = tmp ; tmp = m01 ; m01 = other . m01 ; other . m01 = tmp ; tmp = m02 ; m02 = other . m02 ; other . m02 = tmp ; tmp = m10 ; m10 = other . m10 ; other . m10 = tmp ; tmp = m11 ; m11 = other . m11 ; other . m11 = tmp ; tmp = m12 ; m12 = other . m12 ; other . m12 = tmp ; tmp = m20 ; m20 = other . m20 ; other . m20 = tmp ; tmp = m21 ; m21 = other . m21 ; other . m21 = tmp ; tmp = m22 ; m22 = other . m22 ; other . m22 = tmp ; tmp = m30 ; m30 = other . m30 ; other . m30 = tmp ; tmp = m31 ; m31 = other . m31 ; other . m31 = tmp ; tmp = m32 ; m32 = other . m32 ; other . m32 = tmp ; int props = properties ; this . properties = other . properties ; other . properties = props ; return this ;
|
public class AutoPrefixerPostProcessor { /** * ( non - Javadoc )
* @ see net . jawr . web . resource . bundle . postprocess .
* AbstractChainedResourceBundlePostProcessor
* # doPostProcessBundle ( net . jawr . web
* . resource . bundle . postprocess . BundleProcessingStatus ,
* java . lang . StringBuffer ) */
@ Override protected StringBuffer doPostProcessBundle ( BundleProcessingStatus status , StringBuffer bundleData ) throws IOException { } }
|
if ( jsEngine == null ) { initialize ( status . getJawrConfig ( ) ) ; } StopWatch stopWatch = new StopWatch ( ) ; stopWatch . start ( "Processing Autoprefixer on '" + status . getLastPathAdded ( ) + "'" ) ; String cssSource = bundleData . toString ( ) ; String res = null ; try { res = ( String ) jsEngine . invokeFunction ( "process" , cssSource , options ) ; } catch ( NoSuchMethodException | ScriptException e ) { throw new BundlingProcessException ( e ) ; } stopWatch . stop ( ) ; if ( PERF_LOGGER . isDebugEnabled ( ) ) { PERF_LOGGER . debug ( stopWatch . shortSummary ( ) ) ; } return new StringBuffer ( res ) ;
|
public class RegisteredServicesEndpoint { /** * Fetch service either by numeric id or service id pattern .
* @ param id the id
* @ return the registered service */
@ ReadOperation ( produces = { } }
|
ActuatorMediaType . V2_JSON , "application/vnd.cas.services+yaml" , MediaType . APPLICATION_JSON_VALUE } ) public RegisteredService fetchService ( @ Selector final String id ) { if ( NumberUtils . isDigits ( id ) ) { return this . servicesManager . findServiceBy ( Long . parseLong ( id ) ) ; } return this . servicesManager . findServiceBy ( id ) ;
|
public class ProcessDefinitionEntity { /** * Updates all modifiable fields from another process definition entity .
* @ param updatingProcessDefinition */
@ Override public void updateModifiableFieldsFromEntity ( ProcessDefinitionEntity updatingProcessDefinition ) { } }
|
if ( this . key . equals ( updatingProcessDefinition . key ) && this . deploymentId . equals ( updatingProcessDefinition . deploymentId ) ) { // TODO : add a guard once the mismatch between revisions in deployment cache and database has been resolved
this . revision = updatingProcessDefinition . revision ; this . suspensionState = updatingProcessDefinition . suspensionState ; this . historyTimeToLive = updatingProcessDefinition . historyTimeToLive ; } else { LOG . logUpdateUnrelatedProcessDefinitionEntity ( this . key , updatingProcessDefinition . key , this . deploymentId , updatingProcessDefinition . deploymentId ) ; }
|
public class ListManagementImageListsImpl { /** * Returns the details of the image list with list Id equal to list Id passed .
* @ param listId List Id of the image list .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ImageList object */
public Observable < ImageList > getDetailsAsync ( String listId ) { } }
|
return getDetailsWithServiceResponseAsync ( listId ) . map ( new Func1 < ServiceResponse < ImageList > , ImageList > ( ) { @ Override public ImageList call ( ServiceResponse < ImageList > response ) { return response . body ( ) ; } } ) ;
|
class Main { /** * Identify the greatest prime divisor of a given integer . It assumes that input is greater than 1 and is not a prime number .
* @ param num An integer that is greater than 1 and is not a prime number .
* @ return The largest prime factor of num . */
public static int greatestPrimeDivisor ( int num ) { } /** * Check is a number is prime or not .
* @ param x An integer to be checked .
* @ return true if the integer is a prime number , else false . */
public static boolean checkPrime ( int x ) { if ( x == 2 ) { return true ; } if ( x < 2 || x % 2 == 0 ) { return false ; } for ( int n = 3 ; n <= Math . sqrt ( x ) + 2 ; n += 2 ) { if ( x % n == 0 ) { return false ; } } return true ; } public static void main ( String [ ] args ) { System . out . println ( greatestPrimeDivisor ( 13195 ) ) ; // Output : 29
System . out . println ( greatestPrimeDivisor ( 2048 ) ) ; // Output : 2
} }
|
int highestPrime = 1 ; for ( int i = 2 ; i <= num ; i ++ ) { if ( num % i == 0 && checkPrime ( i ) ) { highestPrime = Math . max ( highestPrime , i ) ; } } return highestPrime ;
|
public class ResourceGeneratorReaderProxyFactory { /** * Returns the array of interfaces implemented by the ResourceGenerator
* @ param generator
* the generator
* @ return the array of interfaces implemented by the ResourceGenerator */
private static Class < ? > [ ] getGeneratorInterfaces ( ResourceGenerator generator ) { } }
|
Set < Class < ? > > interfaces = new HashSet < > ( ) ; addInterfaces ( generator , interfaces ) ; return ( Class [ ] ) interfaces . toArray ( new Class [ ] { } ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.