signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class QueryCommentCloner { /** * Clones comments */
public void cloneComments ( ) { } } | QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO ( ) ; while ( ! queue . isEmpty ( ) ) { QueryQuestionComment queryComment = queue . remove ( 0 ) ; QueryQuestionComment originalParentComment = queryComment . getParentComment ( ) ; QueryReply newReply = replyMap . get ( queryComment . getQueryReply ( ) . getId ( ) ) ; if ( originalParentComment != null && ! commentMap . containsKey ( originalParentComment . getId ( ) ) ) { if ( this . cloneIds . contains ( originalParentComment . getId ( ) ) ) { iterations ++ ; if ( iterations > FAILSAFE_COUNT ) { throw new SmvcRuntimeException ( EdelfoiStatusCode . NO_PARENT_COMMENT , "Comment cloning failed because parent comment could not be found" ) ; } queue . add ( queryComment ) ; } else { this . cloneIds . remove ( queryComment . getId ( ) ) ; logger . severe ( ( ) -> String . format ( "Could not clone comment %d because parent did not exist on original list" , queryComment . getId ( ) ) ) ; } continue ; } QueryQuestionComment parentComment = originalParentComment == null ? null : commentMap . get ( originalParentComment . getId ( ) ) ; QueryQuestionComment newComment = queryQuestionCommentDAO . create ( newReply , queryPage , parentComment , queryComment . getComment ( ) , queryComment . getHidden ( ) , queryComment . getCreator ( ) , queryComment . getCreated ( ) , queryComment . getLastModifier ( ) , queryComment . getLastModified ( ) ) ; commentMap . put ( queryComment . getId ( ) , newComment ) ; } |
public class AnnotationTypeOptionalMemberWriterImpl { /** * { @ inheritDoc } */
public void addDefaultValueInfo ( Element member , Content annotationDocTree ) { } } | if ( utils . isAnnotationType ( member ) ) { ExecutableElement ee = ( ExecutableElement ) member ; AnnotationValue value = ee . getDefaultValue ( ) ; if ( value != null ) { Content dt = HtmlTree . DT ( contents . default_ ) ; Content dl = HtmlTree . DL ( dt ) ; Content dd = HtmlTree . DD ( new StringContent ( value . toString ( ) ) ) ; dl . addContent ( dd ) ; annotationDocTree . addContent ( dl ) ; } } |
public class ListSimulationApplicationsResult { /** * A list of simulation application summaries that meet the criteria of the request .
* @ param simulationApplicationSummaries
* A list of simulation application summaries that meet the criteria of the request . */
public void setSimulationApplicationSummaries ( java . util . Collection < SimulationApplicationSummary > simulationApplicationSummaries ) { } } | if ( simulationApplicationSummaries == null ) { this . simulationApplicationSummaries = null ; return ; } this . simulationApplicationSummaries = new java . util . ArrayList < SimulationApplicationSummary > ( simulationApplicationSummaries ) ; |
public class JKTableRecord { public Float getColumnValueAsFloat ( final int col ) { } } | final Object value = getColumnValue ( col ) ; if ( value == null ) { return null ; } return new Float ( value . toString ( ) ) ; |
public class AbstractDocumentQuery { /** * Matches fields where the value is between the specified start and end , inclusive
* @ param fieldName Field name to use
* @ param start Range start
* @ param end Range end
* @ param exact Use exact matcher */
@ Override public void _whereBetween ( String fieldName , Object start , Object end , boolean exact ) { } } | fieldName = ensureValidFieldName ( fieldName , false ) ; List < QueryToken > tokens = getCurrentWhereTokens ( ) ; appendOperatorIfNeeded ( tokens ) ; negateIfNeeded ( tokens , fieldName ) ; WhereParams startParams = new WhereParams ( ) ; startParams . setValue ( start ) ; startParams . setFieldName ( fieldName ) ; WhereParams endParams = new WhereParams ( ) ; endParams . setValue ( end ) ; endParams . setFieldName ( fieldName ) ; String fromParameterName = addQueryParameter ( start == null ? "*" : transformValue ( startParams , true ) ) ; String toParameterName = addQueryParameter ( end == null ? "NULL" : transformValue ( endParams , true ) ) ; WhereToken whereToken = WhereToken . create ( WhereOperator . BETWEEN , fieldName , null , new WhereToken . WhereOptions ( exact , fromParameterName , toParameterName ) ) ; tokens . add ( whereToken ) ; |
public class DescribeEventTypesResult { /** * A list of event types that match the filter criteria . Event types have a category ( < code > issue < / code > ,
* < code > accountNotification < / code > , or < code > scheduledChange < / code > ) , a service ( for example , < code > EC2 < / code > ,
* < code > RDS < / code > , < code > DATAPIPELINE < / code > , < code > BILLING < / code > ) , and a code ( in the format
* < code > AWS _ < i > SERVICE < / i > _ < i > DESCRIPTION < / i > < / code > ; for example , < code > AWS _ EC2 _ SYSTEM _ MAINTENANCE _ EVENT < / code > ) .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setEventTypes ( java . util . Collection ) } or { @ link # withEventTypes ( java . util . Collection ) } if you want to
* override the existing values .
* @ param eventTypes
* A list of event types that match the filter criteria . Event types have a category ( < code > issue < / code > ,
* < code > accountNotification < / code > , or < code > scheduledChange < / code > ) , a service ( for example ,
* < code > EC2 < / code > , < code > RDS < / code > , < code > DATAPIPELINE < / code > , < code > BILLING < / code > ) , and a code ( in the
* format < code > AWS _ < i > SERVICE < / i > _ < i > DESCRIPTION < / i > < / code > ; for example ,
* < code > AWS _ EC2 _ SYSTEM _ MAINTENANCE _ EVENT < / code > ) .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeEventTypesResult withEventTypes ( EventType ... eventTypes ) { } } | if ( this . eventTypes == null ) { setEventTypes ( new java . util . ArrayList < EventType > ( eventTypes . length ) ) ; } for ( EventType ele : eventTypes ) { this . eventTypes . add ( ele ) ; } return this ; |
public class RotateEncrypt { /** * This function takes a plain text as input and returns the encrypted
* text by rotating the alphabets by two places twice .
* That is , ' a ' turns into ' e ' , ' b ' turns into ' f ' , and so on .
* @ param text A plain string text to be encrypted .
* @ return A string where each alphabets are shifted by four places .
* For example :
* rotateEncrypt ( " hi " ) will return " lm "
* rotateEncrypt ( " asdfghjkl " ) will return " ewhjklnop "
* rotateEncrypt ( " gf " ) will return " kj "
* rotateEncrypt ( " et " ) will return " ix " */
public static String rotateEncrypt ( String text ) { } } | int rotationFactor = 4 ; // 2 places twice
String lowerAlphabet = "abcdefghijklmnopqrstuvwxyz" ; String encryptedText = "" ; for ( char charElement : text . toCharArray ( ) ) { if ( lowerAlphabet . indexOf ( charElement ) != - 1 ) { int newIndex = ( lowerAlphabet . indexOf ( charElement ) + rotationFactor ) % lowerAlphabet . length ( ) ; encryptedText += lowerAlphabet . charAt ( newIndex ) ; } else { encryptedText += charElement ; } } return encryptedText ; |
public class Snappy { /** * Returns true iff the contents of compressed buffer [ pos ( ) . . . limit ( ) )
* can be uncompressed successfully . Does not return the uncompressed data .
* Takes time proportional to the input length , but is usually at least a
* factor of four faster than actual decompression . */
public static boolean isValidCompressedBuffer ( ByteBuffer compressed ) throws IOException { } } | return impl . isValidCompressedBuffer ( compressed , compressed . position ( ) , compressed . remaining ( ) ) ; |
public class CmsObjectWrapper { /** * Returns a link to a resource after it was wrapped by the CmsObjectWrapper . < p >
* Because it is possible to change the names of resources inside the VFS by this
* < code > CmsObjectWrapper < / code > , it is necessary to change the links used in pages
* as well , so that they point to the changed name of the resource . < p >
* For example : < code > / sites / default / index . html < / code > becomes to
* < code > / sites / default / index . html . jsp < / code > , because it is a jsp page , the links
* in pages where corrected so that they point to the new name ( with extension " jsp " ) . < p >
* Used for the link processing in the class { @ link org . opencms . relations . CmsLink } . < p >
* Iterates through all configured resource wrappers till the first returns not < code > null < / code > . < p >
* @ see # restoreLink ( String )
* @ see I _ CmsResourceWrapper # rewriteLink ( CmsObject , CmsResource )
* @ param path the full path where to find the resource
* @ return the rewritten link for the resource */
public String rewriteLink ( String path ) { } } | CmsResource res = null ; try { res = readResource ( m_cms . getRequestContext ( ) . removeSiteRoot ( path ) , CmsResourceFilter . ALL ) ; if ( res != null ) { String ret = null ; // iterate through all wrappers and call " rewriteLink " till one does not return null
List < I_CmsResourceWrapper > wrappers = getWrappers ( ) ; Iterator < I_CmsResourceWrapper > iter = wrappers . iterator ( ) ; while ( iter . hasNext ( ) ) { I_CmsResourceWrapper wrapper = iter . next ( ) ; ret = wrapper . rewriteLink ( m_cms , res ) ; if ( ret != null ) { return ret ; } } } } catch ( CmsException ex ) { // noop
} return path ; |
public class CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl { /** * Sets the resource local service .
* @ param resourceLocalService the resource local service */
public void setResourceLocalService ( com . liferay . portal . kernel . service . ResourceLocalService resourceLocalService ) { } } | this . resourceLocalService = resourceLocalService ; |
public class CSSMediaRule { /** * Add a new media query .
* @ param aMediaQuery
* The media query to be added . May not be < code > null < / code > .
* @ return this for chaining */
@ Nonnull public CSSMediaRule addMediaQuery ( @ Nonnull @ Nonempty final CSSMediaQuery aMediaQuery ) { } } | ValueEnforcer . notNull ( aMediaQuery , "MediaQuery" ) ; m_aMediaQueries . add ( aMediaQuery ) ; return this ; |
public class Neighbours { /** * Finds a Bus given its name .
* @ param name The name of the Bus to find
* @ return The BusGroup or null if not found . */
private BusGroup findBus ( String name ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "findBus" , name ) ; // Cycle through the list of Buss .
for ( int i = 0 ; i < _buses . length ; ++ i ) // Check if the Bus name is the one we are looking for
if ( _buses [ i ] . getName ( ) . equals ( name ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "findBus" , _buses [ i ] ) ; return _buses [ i ] ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "findBus" , "null" ) ; return null ; |
public class StunAttributeFactory { /** * Creates a ResponseFromAddressAttribute of the specified type and with the
* specified address and port
* @ param address
* the address value of the address attribute
* @ return the newly created address attribute . */
public static ResponseAddressAttribute createResponseAddressAttribute ( TransportAddress address ) { } } | ResponseAddressAttribute attribute = new ResponseAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; |
public class GeometryServiceImpl { /** * Parse the given Well Known Text string into a geometry .
* @ param wkt
* The WKT text .
* @ return The resulting geometry , or null in case something went wrong . */
public Geometry toGeometry ( String wkt ) { } } | try { return WktService . toGeometry ( wkt ) ; } catch ( WktException e ) { return null ; } |
public class Case { /** * 连词符命名风格字符串
* @ param str
* 待转换字符串
* @ return 连词符命名风格字符串
* @ author Zhanghongdong */
public static String toHyphenLine ( String str ) { } } | if ( str == null ) { return null ; } if ( str . isEmpty ( ) ) { return str ; } // 本身连词符
if ( str . indexOf ( SEPARATOR_HYPHEN_LINE ) >= 0 ) { return str . toLowerCase ( ) ; } // 本身下划线
if ( str . indexOf ( SEPARATOR_UNDER_LINE ) >= 0 ) { return str . replace ( SEPARATOR_UNDER_LINE , SEPARATOR_HYPHEN_LINE ) . toLowerCase ( ) ; } StringBuilder sb = new StringBuilder ( ) ; boolean upperCase = false ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { char c = str . charAt ( i ) ; boolean nextUpperCase = true ; if ( i < ( str . length ( ) - 1 ) ) { nextUpperCase = Character . isUpperCase ( str . charAt ( i + 1 ) ) ; } if ( ( i >= 0 ) && Character . isUpperCase ( c ) ) { if ( ! upperCase || ! nextUpperCase ) { if ( i > 0 ) { sb . append ( SEPARATOR_HYPHEN_LINE ) ; } } upperCase = true ; } else { upperCase = false ; } sb . append ( Character . toLowerCase ( c ) ) ; } return sb . toString ( ) ; |
public class AgentMonitoring { /** * This method lists the available handlers and logs them . */
public static void listHandlers ( List < IMonitoringHandler > handlers , Logger logger ) { } } | if ( handlers . isEmpty ( ) ) { logger . info ( "No monitoring handler was found." ) ; } else { StringBuilder sb = new StringBuilder ( "Available monitoring handlers: " ) ; for ( Iterator < IMonitoringHandler > it = handlers . iterator ( ) ; it . hasNext ( ) ; ) { sb . append ( it . next ( ) . getName ( ) ) ; if ( it . hasNext ( ) ) sb . append ( ", " ) ; } sb . append ( "." ) ; logger . info ( sb . toString ( ) ) ; } |
public class ApiUtils { /** * Gets an optional enum param , returning { @ code null } if the parameter was not found .
* @ param < E > the type of the enum that will be returned
* @ param params the params
* @ param paramName the param name
* @ param enumType the type of the enum
* @ return the enum , or { @ code null }
* @ throws ApiException if the param value does not match any of the possible enum values */
public static < E extends Enum < E > > E getOptionalEnumParam ( JSONObject params , String paramName , Class < E > enumType ) throws ApiException { } } | String enumValS = params . optString ( paramName , null ) ; E enumVal = null ; if ( enumValS != null && ! enumValS . isEmpty ( ) ) { try { enumVal = Enum . valueOf ( enumType , enumValS ) ; } catch ( Exception ex ) { throw new ApiException ( ApiException . Type . ILLEGAL_PARAMETER , paramName + ": " + ex . getLocalizedMessage ( ) ) ; } } return enumVal ; |
public class Pickler { /** * Get the custom pickler fot the given class , to be able to pickle not just built in collection types .
* A custom pickler is matched on the interface or abstract base class that the object implements or inherits from .
* @ param t the class of the object to be pickled
* @ return null ( if no custom pickler found ) or a pickler registered for this class ( via { @ link Pickler # registerCustomPickler } ) */
protected IObjectPickler getCustomPickler ( Class < ? > t ) { } } | IObjectPickler pickler = customPicklers . get ( t ) ; if ( pickler != null ) { return pickler ; // exact match
} // check if there ' s a custom pickler registered for an interface or abstract base class
// that this object implements or inherits from .
for ( Entry < Class < ? > , IObjectPickler > x : customPicklers . entrySet ( ) ) { if ( x . getKey ( ) . isAssignableFrom ( t ) ) { return x . getValue ( ) ; } } return null ; |
public class ContextRefresher { /** * source names */
private StandardEnvironment copyEnvironment ( ConfigurableEnvironment input ) { } } | StandardEnvironment environment = new StandardEnvironment ( ) ; MutablePropertySources capturedPropertySources = environment . getPropertySources ( ) ; // Only copy the default property source ( s ) and the profiles over from the main
// environment ( everything else should be pristine , just like it was on startup ) .
for ( String name : DEFAULT_PROPERTY_SOURCES ) { if ( input . getPropertySources ( ) . contains ( name ) ) { if ( capturedPropertySources . contains ( name ) ) { capturedPropertySources . replace ( name , input . getPropertySources ( ) . get ( name ) ) ; } else { capturedPropertySources . addLast ( input . getPropertySources ( ) . get ( name ) ) ; } } } environment . setActiveProfiles ( input . getActiveProfiles ( ) ) ; environment . setDefaultProfiles ( input . getDefaultProfiles ( ) ) ; Map < String , Object > map = new HashMap < String , Object > ( ) ; map . put ( "spring.jmx.enabled" , false ) ; map . put ( "spring.main.sources" , "" ) ; capturedPropertySources . addFirst ( new MapPropertySource ( REFRESH_ARGS_PROPERTY_SOURCE , map ) ) ; return environment ; |
public class DateHelper { /** * Returns the earlier of two dates , handling null values . A non - null Date
* is always considered to be earlier than a null Date .
* @ param d1 Date instance
* @ param d2 Date instance
* @ return Date earliest date */
public static Date min ( Date d1 , Date d2 ) { } } | Date result ; if ( d1 == null ) { result = d2 ; } else if ( d2 == null ) { result = d1 ; } else { result = ( d1 . compareTo ( d2 ) < 0 ) ? d1 : d2 ; } return result ; |
public class CmsDriverManager { /** * Deletes all relations for the given resource matching the given filter . < p >
* @ param dbc the current db context
* @ param resource the resource to delete the relations for
* @ param filter the filter to use for deletion
* @ throws CmsException if something goes wrong
* @ see CmsSecurityManager # deleteRelationsForResource ( CmsRequestContext , CmsResource , CmsRelationFilter ) */
public void deleteRelationsForResource ( CmsDbContext dbc , CmsResource resource , CmsRelationFilter filter ) throws CmsException { } } | if ( filter . includesDefinedInContent ( ) ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_DELETE_RELATION_IN_CONTENT_2 , dbc . removeSiteRoot ( resource . getRootPath ( ) ) , filter . getTypes ( ) ) ) ; } getVfsDriver ( dbc ) . deleteRelations ( dbc , dbc . currentProject ( ) . getUuid ( ) , resource , filter ) ; setDateLastModified ( dbc , resource , System . currentTimeMillis ( ) ) ; log ( dbc , new CmsLogEntry ( dbc , resource . getStructureId ( ) , CmsLogEntryType . RESOURCE_REMOVE_RELATION , new String [ ] { resource . getRootPath ( ) , filter . toString ( ) } ) , false ) ; |
public class GenericsResolutionUtils { /** * Inner class could reference outer class generics and so this generics must be included into class context .
* Outer generics could be included into declaration like { @ code Outer < String > . Inner field } . In this case
* incoming type should be { @ link ParameterizedType } with generified owner .
* When provided type is simply a class ( or anything resolvable to class ) , then outer class generics are resolved
* as upper bound ( by declaration ) . Class may declare the same generic name and , in this case , outer generic
* will be ignored ( as not visible ) .
* During inlying context resolution , if outer generic is not declared in type we can try to guess it :
* we know outer context , and , if outer class is in outer context hierarchy , we could assume that it ' s actual
* parent class and so we could use more specific generics . This will be true for most sane cases ( often inner
* class is used inside owner ) , but other cases are still possible ( anyway , the chance that inner class will
* appear in two different hierarchies of outer class is quite small ) .
* It is very important to use returned map instead of passed in map because , incoming empty map is always replaced
* to avoid modifications of shared empty maps .
* @ param type context type
* @ param generics resolved type generics
* @ param knownGenerics map of known middle generics and possibly known outer context ( outer context may contain
* outer class generics declarations ) . May be null .
* @ return actual generics map ( incoming map may be default empty map and in this case it must be replaced ) */
public static LinkedHashMap < String , Type > fillOuterGenerics ( final Type type , final LinkedHashMap < String , Type > generics , final Map < Class < ? > , LinkedHashMap < String , Type > > knownGenerics ) { } } | final LinkedHashMap < String , Type > res ; final Type outer = TypeUtils . getOuter ( type ) ; if ( outer == null ) { // not inner class
res = generics ; } else { final LinkedHashMap < String , Type > outerGenerics ; if ( outer instanceof ParameterizedType ) { // outer generics declared in field definition ( ignorance required because provided type
// may contain unknown outer generics ( Outer < B > . Inner field ) )
outerGenerics = resolveGenerics ( outer , new IgnoreGenericsMap ( generics ) ) ; } else { final Class < ? > outerType = GenericsUtils . resolveClass ( outer , generics ) ; // either use known generics for outer class or resolve by upper bound
outerGenerics = knownGenerics != null && knownGenerics . containsKey ( outerType ) ? new LinkedHashMap < String , Type > ( knownGenerics . get ( outerType ) ) : resolveRawGenerics ( outerType ) ; } // class may declare generics with the same name and they must not be overridden
for ( TypeVariable var : GenericsUtils . resolveClass ( type , generics ) . getTypeParameters ( ) ) { outerGenerics . remove ( var . getName ( ) ) ; } if ( generics instanceof EmptyGenericsMap ) { // if outer map is empty then it was assumed that empty map could be returned
// ( outerGenerics could be empty map too )
res = outerGenerics ; } else { generics . putAll ( outerGenerics ) ; res = generics ; } } return res ; |
public class GPathResult { /** * A helper method to allow GPathResults to work with subscript operators
* @ param index an index
* @ param newValue the value to put at the given index */
public void putAt ( final int index , final Object newValue ) { } } | final GPathResult result = ( GPathResult ) getAt ( index ) ; if ( newValue instanceof Closure ) { result . replaceNode ( ( Closure ) newValue ) ; } else { result . replaceBody ( newValue ) ; } |
public class Materialize { /** * Set the color for the statusBar
* @ param statusBarColor */
public void setStatusBarColor ( int statusBarColor ) { } } | if ( mBuilder . mScrimInsetsLayout != null ) { mBuilder . mScrimInsetsLayout . setInsetForeground ( statusBarColor ) ; mBuilder . mScrimInsetsLayout . getView ( ) . invalidate ( ) ; } |
public class MoneyUtils { /** * Evaluates the { @ link MathContext } from the given { @ link MonetaryContext } .
* @ param monetaryContext the { @ link MonetaryContext }
* @ param defaultMode the default { @ link RoundingMode } , to be used if no one is set
* in { @ link MonetaryContext } .
* @ return the corresponding { @ link MathContext } */
public static MathContext getMathContext ( MonetaryContext monetaryContext , RoundingMode defaultMode ) { } } | MathContext ctx = monetaryContext . get ( MathContext . class ) ; if ( Objects . nonNull ( ctx ) ) { return ctx ; } RoundingMode roundingMode = monetaryContext . get ( RoundingMode . class ) ; if ( roundingMode == null ) { roundingMode = Optional . ofNullable ( defaultMode ) . orElse ( HALF_EVEN ) ; } return new MathContext ( monetaryContext . getPrecision ( ) , roundingMode ) ; |
public class Matrix4f { /** * Apply a symmetric orthographic projection transformation for a left - handed coordinate system
* using OpenGL ' s NDC z range of < code > [ - 1 . . + 1 ] < / code > to this matrix and store the result in < code > dest < / code > .
* This method is equivalent to calling { @ link # orthoLH ( float , float , float , float , float , float , Matrix4f ) orthoLH ( ) } with
* < code > left = - width / 2 < / code > , < code > right = + width / 2 < / code > , < code > bottom = - height / 2 < / code > and < code > top = + height / 2 < / code > .
* If < code > M < / code > is < code > this < / code > matrix and < code > O < / code > the orthographic projection matrix ,
* then the new matrix will be < code > M * O < / code > . So when transforming a
* vector < code > v < / code > with the new matrix by using < code > M * O * v < / code > , the
* orthographic projection transformation will be applied first !
* In order to set the matrix to a symmetric orthographic projection without post - multiplying it ,
* use { @ link # setOrthoSymmetricLH ( float , float , float , float ) setOrthoSymmetricLH ( ) } .
* Reference : < a href = " http : / / www . songho . ca / opengl / gl _ projectionmatrix . html # ortho " > http : / / www . songho . ca < / a >
* @ see # setOrthoSymmetricLH ( float , float , float , float )
* @ param width
* the distance between the right and left frustum edges
* @ param height
* the distance between the top and bottom frustum edges
* @ param zNear
* near clipping plane distance
* @ param zFar
* far clipping plane distance
* @ param dest
* will hold the result
* @ return dest */
public Matrix4f orthoSymmetricLH ( float width , float height , float zNear , float zFar , Matrix4f dest ) { } } | return orthoSymmetricLH ( width , height , zNear , zFar , false , dest ) ; |
public class ApikeyManager { /** * override this one to change fingerprint strategy */
protected Apikey createFromMapInternal ( @ Nullable String user , long start , long duration , @ Nullable Arr roles , Map < String , Object > nameAndValMap ) { } } | return createFromMapWithFingerprint ( user , start , duration , roles , nameAndValMap , randomFingerprint ( ) ) ; |
public class Tools { /** * Launches the default browser to display a URL .
* @ param url the URL to be displayed
* @ since 4.1 */
static void openURL ( String url ) { } } | try { openURL ( new URL ( url ) ) ; } catch ( MalformedURLException ex ) { Tools . showError ( ex ) ; } |
public class GeneratePluginConfigListener { /** * ( non - Javadoc
* @ see com . ibm . ws . container . service . state . ApplicationStateListener # applicationStarting ( com . ibm . ws . container . service . app . deploy . ApplicationInfo ) */
@ Override public void applicationStarting ( ApplicationInfo appInfo ) throws StateChangeException { } } | setFutureGeneratePluginTask ( ) ; this . appsInService ++ ; if ( smgr != null ) this . cookieNames . put ( appInfo . getName ( ) , smgr . getDefaultAffinityCookie ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "application starting, add app to cookie map. app name : " + appInfo . getName ( ) + ", cookie name : " + smgr . getDefaultAffinityCookie ( ) ) ; |
public class Strings { /** * Splits string using specified string separator and returns trimmed values . Returns null if string argument is null
* and empty list if is empty .
* @ param string source string ,
* @ param separator string used as separator .
* @ return strings list , possible empty . */
public static List < String > split ( String string , String separator ) { } } | final int separatorLength = separator . length ( ) ; final List < String > list = new ArrayList < String > ( ) ; int fromIndex = 0 ; for ( ; ; ) { int endIndex = string . indexOf ( separator , fromIndex ) ; if ( endIndex == - 1 ) { break ; } if ( fromIndex < endIndex ) { list . add ( string . substring ( fromIndex , endIndex ) . trim ( ) ) ; } fromIndex = endIndex + separatorLength ; } if ( fromIndex < string . length ( ) ) { list . add ( string . substring ( fromIndex ) . trim ( ) ) ; } return list ; |
public class JdbcRepositories { /** * fillFieldDefinitionData .
* @ param fieldDefinitionObject josn model
* @ return { @ link FieldDefinition }
* @ throws JSONException JSONException */
private static FieldDefinition fillFieldDefinitionData ( final JSONObject fieldDefinitionObject ) throws JSONException { } } | final FieldDefinition ret = new FieldDefinition ( ) ; ret . setName ( fieldDefinitionObject . getString ( NAME ) ) ; ret . setDescription ( fieldDefinitionObject . optString ( DESCRIPTION ) ) ; ret . setType ( fieldDefinitionObject . getString ( TYPE ) ) ; ret . setNullable ( fieldDefinitionObject . optBoolean ( NULLABLE ) ) ; ret . setLength ( fieldDefinitionObject . optInt ( LENGTH ) ) ; ret . setIsKey ( fieldDefinitionObject . optBoolean ( ISKEY ) ) ; if ( defaultKeyName . equals ( ret . getName ( ) ) ) { ret . setIsKey ( true ) ; } return ret ; |
public class LocalTime { /** * Obtains the current time from the specified clock .
* This will query the specified clock to obtain the current time .
* Using this method allows the use of an alternate clock for testing .
* The alternate clock may be introduced using { @ link Clock dependency injection } .
* @ param clock the clock to use , not null
* @ return the current time , not null */
public static LocalTime now ( Clock clock ) { } } | Objects . requireNonNull ( clock , "clock" ) ; // inline OffsetTime factory to avoid creating object and InstantProvider checks
final Instant now = clock . instant ( ) ; // called once
ZoneOffset offset = clock . getZone ( ) . getRules ( ) . getOffset ( now ) ; long localSecond = now . getEpochSecond ( ) + offset . getTotalSeconds ( ) ; // overflow caught later
int secsOfDay = ( int ) Math . floorMod ( localSecond , SECONDS_PER_DAY ) ; return ofNanoOfDay ( secsOfDay * NANOS_PER_SECOND + now . getNano ( ) ) ; |
public class OutputProperties { /** * Searches for the property with the specified key in the property list .
* If the key is not found in this property list , the default property list ,
* and its defaults , recursively , are then checked . The method returns
* < code > null < / code > if the property is not found .
* @ param key the property key .
* @ return the value in this property list with the specified key value . */
public String getProperty ( String key ) { } } | if ( key . startsWith ( OutputPropertiesFactory . S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL ) ) key = OutputPropertiesFactory . S_BUILTIN_EXTENSIONS_UNIVERSAL + key . substring ( OutputPropertiesFactory . S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL_LEN ) ; return m_properties . getProperty ( key ) ; |
public class DeviceProxyDAODefaultImpl { public DeviceDataHistory [ ] attribute_history ( final DeviceProxy deviceProxy , final String attname ) throws DevFailed { } } | int hist_depth = 10 ; final DbDatum data = get_property ( deviceProxy , "poll_ring_depth" ) ; if ( ! data . is_empty ( ) ) { hist_depth = data . extractLong ( ) ; } return attribute_history ( deviceProxy , attname , hist_depth ) ; |
public class DefaultGroovyMethods { /** * Create an array composed of the elements of the first array minus the
* elements of the given Iterable .
* @ param self an array
* @ param removeMe a Collection of elements to remove
* @ return an array with the supplied elements removed
* @ since 1.5.5 */
@ SuppressWarnings ( "unchecked" ) public static < T > T [ ] minus ( T [ ] self , Iterable removeMe ) { } } | return ( T [ ] ) minus ( toList ( self ) , removeMe ) . toArray ( ) ; |
public class DefaultNamespaceService { /** * Do compilation of the namespace resource .
* @ param resourceLocation { @ link String } , the resource location to compile
* @ throws IndexingFailure Thrown if an error occurred while indexing
* @ throws ResourceDownloadError Thrown if an error occurred downloading
* resource */
private String doCompile ( String resourceLocation ) throws IndexingFailure , ResourceDownloadError { } } | final ResolvedResource resolved = resourceCache . resolveResource ( NAMESPACES , resourceLocation ) ; final File resourceCopy = resolved . getCacheResourceCopy ( ) ; namespaceIndexerService . indexNamespace ( resourceLocation , resolved . getCacheResourceCopy ( ) ) ; final String indexPath = asPath ( resourceCopy . getParent ( ) , NAMESPACE_ROOT_DIRECTORY_NAME , NS_INDEX_FILE_NAME ) ; return indexPath ; |
public class ObjectMapperFactory { /** * / * package private */
static void registerModule ( final ObjectMapper objectMapper , final String className ) { } } | final Optional < Class < ? extends Module > > moduleClass = getClass ( className ) ; if ( moduleClass . isPresent ( ) ) { try { final Module module = moduleClass . get ( ) . newInstance ( ) ; objectMapper . registerModule ( module ) ; // CHECKSTYLE . OFF : IllegalCatch - Catch any exceptions thrown by reflection or the module constructor .
} catch ( final Exception e ) { // CHECKSTYLE . ON : IllegalCatch
LOGGER . warn ( String . format ( "Unable to instantiate module; module=%s" , moduleClass . get ( ) ) , e ) ; } } |
public class AuthenticationRequest { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } } | if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case CREDENTIALS : return isSetCredentials ( ) ; } throw new IllegalStateException ( ) ; |
public class SmoothieMap { /** * Replaces the entry for the specified key only if it is currently mapped to some value .
* @ param key key with which the specified value is associated
* @ param value value to be associated with the specified key
* @ return the previous value associated with the specified key , or { @ code null } if there was no
* mapping for the key . ( A { @ code null } return can also indicate that the map previously
* associated { @ code null } with the key . ) */
@ Override public final V replace ( K key , V value ) { } } | long hash , allocIndex ; Segment < K , V > segment ; V oldValue ; if ( ( allocIndex = ( segment = segment ( segmentIndex ( hash = keyHashCode ( key ) ) ) ) . find ( this , hash , key ) ) > 0 ) { oldValue = segment . readValue ( allocIndex ) ; segment . writeValue ( allocIndex , value ) ; return oldValue ; } return null ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link RectifiedGridDomainType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link RectifiedGridDomainType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "rectifiedGridDomain" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "domainSet" ) public JAXBElement < RectifiedGridDomainType > createRectifiedGridDomain ( RectifiedGridDomainType value ) { } } | return new JAXBElement < RectifiedGridDomainType > ( _RectifiedGridDomain_QNAME , RectifiedGridDomainType . class , null , value ) ; |
public class MmffAromaticTypeMapping { /** * From a provided set of cycles find the 5/6 member cycles that fit the MMFF aromaticity
* definition - { @ link # isAromaticRing ( int [ ] , int [ ] , int [ ] , boolean [ ] ) } . The cycles of size 6
* are listed first .
* @ param cycles initial set of cycles from
* @ param contribution vector of p electron contributions from each vertex
* @ param dbs vector of double - bond pairs , index stored double - bonded index
* @ return the cycles that are aromatic */
private static int [ ] [ ] findAromaticRings ( int [ ] [ ] cycles , int [ ] contribution , int [ ] dbs ) { } } | // loop control variables , the while loop continual checks all cycles
// until no changes are found
boolean found ; boolean [ ] checked = new boolean [ cycles . length ] ; // stores the aromatic atoms as a bit set and the aromatic bonds as
// a hash set . the aromatic bonds are the result of this method but the
// aromatic atoms are needed for checking each ring
final boolean [ ] aromaticAtoms = new boolean [ contribution . length ] ; final List < int [ ] > ringsOfSize6 = new ArrayList < int [ ] > ( ) ; final List < int [ ] > ringsOfSize5 = new ArrayList < int [ ] > ( ) ; do { found = false ; for ( int i = 0 ; i < cycles . length ; i ++ ) { // note paths are closed walks and repeat first / last vertex so
// the true length is one less
int [ ] cycle = cycles [ i ] ; int len = cycle . length - 1 ; if ( checked [ i ] ) continue ; if ( isAromaticRing ( cycle , contribution , dbs , aromaticAtoms ) ) { checked [ i ] = true ; found |= true ; for ( int j = 0 ; j < len ; j ++ ) { aromaticAtoms [ cycle [ j ] ] = true ; } if ( len == 6 ) ringsOfSize6 . add ( cycle ) ; else if ( len == 5 ) ringsOfSize5 . add ( cycle ) ; } } } while ( found ) ; List < int [ ] > rings = new ArrayList < int [ ] > ( ) ; rings . addAll ( ringsOfSize6 ) ; rings . addAll ( ringsOfSize5 ) ; return rings . toArray ( new int [ rings . size ( ) ] [ ] ) ; |
public class YamlShardingDataSourceFactory { /** * Create sharding data source .
* @ param yamlBytes YAML bytes for rule configuration of databases and tables sharding with data sources
* @ return sharding data source
* @ throws SQLException SQL exception
* @ throws IOException IO exception */
public static DataSource createDataSource ( final byte [ ] yamlBytes ) throws SQLException , IOException { } } | YamlRootShardingConfiguration config = YamlEngine . unmarshal ( yamlBytes , YamlRootShardingConfiguration . class ) ; return ShardingDataSourceFactory . createDataSource ( config . getDataSources ( ) , new ShardingRuleConfigurationYamlSwapper ( ) . swap ( config . getShardingRule ( ) ) , config . getProps ( ) ) ; |
public class UnionSet { /** * Triggers combining . */
@ Override public boolean removeAll ( Collection < ? > c ) { } } | combine ( ) ; if ( combined == null ) combined = new HashSet < > ( ) ; return combined . removeAll ( c ) ; |
public class SuffixBuilder { /** * Puts a key - value pair into the suffix .
* @ param key the key
* @ param value the value
* @ return this */
@ SuppressWarnings ( { } } | "null" , "unused" } ) public @ NotNull SuffixBuilder put ( @ NotNull String key , @ NotNull Object value ) { if ( key == null ) { throw new IllegalArgumentException ( "Key must not be null" ) ; } if ( value != null ) { validateValueType ( value ) ; parameterMap . put ( key , value ) ; } return this ; |
public class ExecutionContextImpl { /** * { @ inheritDoc } */
@ Override public void close ( ) { } } | // at the moment the only thing that might need to happen is to stop the timeout . . .
// however , if execution has completed normally and as designed , the timeout will already be stopped
// one day there might be more things that need closing
if ( this . timeout != null ) { this . timeout . stop ( ) ; } metricRecorder . recordTimeoutExecutionTime ( System . nanoTime ( ) - startTime ) ; this . closed = true ; |
public class Result { /** * The projecting result value at the given index as a Blob object
* @ param index The select result index .
* @ return The Blob object . */
@ Override public Blob getBlob ( int index ) { } } | check ( index ) ; final Object obj = fleeceValueToObject ( index ) ; return obj instanceof Blob ? ( Blob ) obj : null ; |
public class Cluster { /** * Cluster operations that are waiting to be started .
* @ return Cluster operations that are waiting to be started . */
public java . util . List < String > getPendingActions ( ) { } } | if ( pendingActions == null ) { pendingActions = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return pendingActions ; |
public class TypeLoader { /** * Loads the class as the given super - type .
* Examples :
* < pre >
* / / import static { @ link org . fest . reflect . core . Reflection # type ( String ) org . fest . reflect . core . Reflection . type } ;
* / / Loads the class ' org . republic . Jedi '
* Class & lt ; ? & gt ; jediType = { @ link org . fest . reflect . core . Reflection # type ( String ) type } ( " org . republic . Jedi " ) . { @ link org . fest . reflect . type . Type # load ( ) load } ( ) ;
* / / Loads the class ' org . republic . Jedi ' as ' org . republic . Person ' ( Jedi extends Person )
* Class & lt ; Person & gt ; jediType = { @ link org . fest . reflect . core . Reflection # type ( String ) type } ( " org . republic . Jedi " ) . { @ link org . fest . reflect . type . Type # loadAs ( Class ) loadAs } ( Person . class ) ;
* / / Loads the class ' org . republic . Jedi ' using a custom class loader
* Class & lt ; ? & gt ; jediType = { @ link org . fest . reflect . core . Reflection # type ( String ) type } ( " org . republic . Jedi " ) . { @ link org . fest . reflect . type . Type # withClassLoader ( ClassLoader ) withClassLoader } ( myClassLoader ) . { @ link org . fest . reflect . type . TypeLoader # load ( ) load } ( ) ;
* < / pre >
* @ param superType the given super - type .
* @ return the loaded class .
* @ throws NullPointerException if the given super - type is { @ code null } .
* @ throws ReflectionError wrapping any error that occurred during class loading . */
public @ NotNull < T > Class < ? extends T > loadAs ( @ NotNull Class < T > superType ) { } } | checkNotNull ( superType ) ; try { return checkNotNull ( loadType ( ) . asSubclass ( superType ) ) ; } catch ( Throwable t ) { String format = "Unable to load class '%s' as %s using ClassLoader %s" ; throw new ReflectionError ( String . format ( format , name , superType . getName ( ) , classLoader ) , t ) ; } |
public class TldFernClassifier { /** * Renormalizes fern . numP to avoid overflow */
public void renormalizeP ( ) { } } | int targetMax = maxP / 20 ; for ( int i = 0 ; i < managers . length ; i ++ ) { TldFernManager m = managers [ i ] ; for ( int j = 0 ; j < m . table . length ; j ++ ) { TldFernFeature f = m . table [ j ] ; if ( f == null ) continue ; f . numP = targetMax * f . numP / maxP ; } } maxP = targetMax ; |
public class CmsResourceManager { /** * Checks if there is a resource type with a given name whose id matches the given id . < p >
* This will return ' false ' if no resource type with the given name is registered . < p >
* @ param name a resource type name
* @ param id a resource type id
* @ return true if a matching resource type with the given name and id was found */
public boolean matchResourceType ( String name , int id ) { } } | if ( hasResourceType ( name ) ) { try { return getResourceType ( name ) . getTypeId ( ) == id ; } catch ( Exception e ) { // should never happen because we already checked with hasResourceType , still have to
// catch it so the compiler is happy
LOG . error ( e . getLocalizedMessage ( ) , e ) ; return false ; } } else { return false ; } |
public class References { /** * Gets an optional component reference that matches specified locator and
* matching to the specified type .
* @ param type the Class type that defined the type of the result .
* @ param locator the locator to find references by .
* @ return a matching component reference or null if nothing was found . */
public < T > T getOneOptional ( Class < T > type , Object locator ) { } } | try { List < T > components = find ( type , locator , false ) ; return components . size ( ) > 0 ? components . get ( 0 ) : null ; } catch ( Exception ex ) { return null ; } |
public class ScriptEvaluatorFactory { /** * / * ( non - Javadoc )
* @ see org . danann . cernunnos . cache . CacheHelper . Factory # createObject ( java . lang . Object ) */
public ScriptEvaluator createObject ( Tuple < ScriptEngine , String > key ) { } } | return new ScriptEvaluator ( key . first , key . second ) ; |
public class AbstractXMLSerializer { /** * This method handles the case , if all namespace context entries should be
* emitted on the root element .
* @ param aAttrMap */
protected final void handlePutNamespaceContextPrefixInRoot ( @ Nonnull final Map < QName , String > aAttrMap ) { } } | if ( m_aSettings . isEmitNamespaces ( ) && m_aNSStack . size ( ) == 1 && m_aSettings . isPutNamespaceContextPrefixesInRoot ( ) ) { // The only place where the namespace context prefixes are added to the
// root element
for ( final Map . Entry < String , String > aEntry : m_aRootNSMap . entrySet ( ) ) { aAttrMap . put ( XMLHelper . getXMLNSAttrQName ( aEntry . getKey ( ) ) , aEntry . getValue ( ) ) ; m_aNSStack . addNamespaceMapping ( aEntry . getKey ( ) , aEntry . getValue ( ) ) ; } } |
public class StringBuilders { /** * Appends in the following format : key = double quoted value .
* @ param sb a string builder
* @ param entry a map entry
* @ return { @ code key = " value " } */
public static StringBuilder appendKeyDqValue ( final StringBuilder sb , final Entry < String , String > entry ) { } } | return appendKeyDqValue ( sb , entry . getKey ( ) , entry . getValue ( ) ) ; |
public class ApnsClientBuilder { /** * < p > Sets the TLS credentials for the client under construction using the data from the given PKCS # 12 input stream .
* Clients constructed with TLS credentials will use TLS - based authentication when sending push notifications . The
* PKCS # 12 data < em > must < / em > contain a certificate / private key pair . < / p >
* < p > Clients may not have both TLS credentials and a signing key . < / p >
* @ param p12InputStream an input stream to a PKCS # 12 - formatted file containing the certificate and private key to
* be used to identify the client to the APNs server
* @ param p12Password the password to be used to decrypt the contents of the given PKCS # 12 file ; passwords may be
* blank ( i . e . { @ code " " } ) , but must not be { @ code null }
* @ throws SSLException if the given PKCS # 12 file could not be loaded or if any other SSL - related problem arises
* when constructing the context
* @ throws IOException if any IO problem occurred while attempting to read the given PKCS # 12 input stream
* @ return a reference to this builder
* @ since 0.8 */
public ApnsClientBuilder setClientCredentials ( final InputStream p12InputStream , final String p12Password ) throws SSLException , IOException { } } | final X509Certificate x509Certificate ; final PrivateKey privateKey ; try { final KeyStore . PrivateKeyEntry privateKeyEntry = P12Util . getFirstPrivateKeyEntryFromP12InputStream ( p12InputStream , p12Password ) ; final Certificate certificate = privateKeyEntry . getCertificate ( ) ; if ( ! ( certificate instanceof X509Certificate ) ) { throw new KeyStoreException ( "Found a certificate in the provided PKCS#12 file, but it was not an X.509 certificate." ) ; } x509Certificate = ( X509Certificate ) certificate ; privateKey = privateKeyEntry . getPrivateKey ( ) ; } catch ( final KeyStoreException e ) { throw new SSLException ( e ) ; } return this . setClientCredentials ( x509Certificate , privateKey , p12Password ) ; |
public class OSchemaHelper { /** * Set linked class to a current property
* @ param className class name to set as a linked class
* @ return this helper */
public OSchemaHelper linkedClass ( String className ) { } } | checkOProperty ( ) ; OClass linkedToClass = schema . getClass ( className ) ; if ( linkedToClass == null ) throw new IllegalArgumentException ( "Target OClass '" + className + "' to link to not found" ) ; if ( ! Objects . equal ( linkedToClass , lastProperty . getLinkedClass ( ) ) ) { lastProperty . setLinkedClass ( linkedToClass ) ; } return this ; |
public class Start { /** * Called by 199 API . */
public boolean begin ( Class < ? > docletClass , Iterable < String > options , Iterable < ? extends JavaFileObject > fileObjects ) { } } | this . docletClass = docletClass ; List < String > opts = new ArrayList < > ( ) ; for ( String opt : options ) opts . add ( opt ) ; return begin ( opts , fileObjects ) . isOK ( ) ; |
public class MsWordUtils { /** * 保存word文档 , 不关闭当前文档
* @ param path 路径
* @ throws IOException 异常
* @ throws NoSuchMethodException 异常
* @ throws IllegalAccessException 异常
* @ throws InvocationTargetException 异常 */
public static void writeTo ( String path ) throws IOException , NoSuchMethodException , IllegalAccessException , InvocationTargetException { } } | createXwpfDocumentIfNull ( ) ; MsUtils . writeTo ( xwpfDocument , path ) ; |
public class BasicBinder { /** * Register an UnMarshaller with the given source and target class .
* The unmarshaller is used as follows : Instances of the source can be marshalled into the target class .
* @ param source The source ( input ) class
* @ param target The target ( output ) class
* @ param converter The FromUnmarshaller to be registered */
public final < S , T > void registerUnmarshaller ( Class < S > source , Class < T > target , FromUnmarshaller < S , T > converter ) { } } | Class < ? extends Annotation > scope = matchImplementationToScope ( converter . getClass ( ) ) ; registerUnmarshaller ( new ConverterKey < S , T > ( source , target , scope == null ? DefaultBinding . class : scope ) , converter ) ; |
public class LegacyAddress { /** * Construct a { @ link LegacyAddress } from its base58 form .
* @ param params
* expected network this address is valid for , or null if if the network should be derived from the
* base58
* @ param base58
* base58 - encoded textual form of the address
* @ throws AddressFormatException
* if the given base58 doesn ' t parse or the checksum is invalid
* @ throws AddressFormatException . WrongNetwork
* if the given address is valid but for a different chain ( eg testnet vs mainnet ) */
public static LegacyAddress fromBase58 ( @ Nullable NetworkParameters params , String base58 ) throws AddressFormatException , AddressFormatException . WrongNetwork { } } | byte [ ] versionAndDataBytes = Base58 . decodeChecked ( base58 ) ; int version = versionAndDataBytes [ 0 ] & 0xFF ; byte [ ] bytes = Arrays . copyOfRange ( versionAndDataBytes , 1 , versionAndDataBytes . length ) ; if ( params == null ) { for ( NetworkParameters p : Networks . get ( ) ) { if ( version == p . getAddressHeader ( ) ) return new LegacyAddress ( p , false , bytes ) ; else if ( version == p . getP2SHHeader ( ) ) return new LegacyAddress ( p , true , bytes ) ; } throw new AddressFormatException . InvalidPrefix ( "No network found for " + base58 ) ; } else { if ( version == params . getAddressHeader ( ) ) return new LegacyAddress ( params , false , bytes ) ; else if ( version == params . getP2SHHeader ( ) ) return new LegacyAddress ( params , true , bytes ) ; throw new AddressFormatException . WrongNetwork ( version ) ; } |
public class Interceptor { /** * Performs a { @ link View # draw ( Canvas ) } call on the given { @ link View } . */
protected final void invokeDraw ( View view , Canvas canvas ) { } } | final ViewProxy proxy = ( ViewProxy ) view ; proxy . invokeDraw ( canvas ) ; |
public class ExtensionAutoUpdate { /** * Processes the given add - on changes .
* @ param caller the caller to set as parent of shown dialogues
* @ param changes the changes that will be processed */
void processAddOnChanges ( Window caller , AddOnDependencyChecker . AddOnChangesResult changes ) { } } | if ( addonsDialog != null ) { addonsDialog . setDownloadingUpdates ( ) ; } if ( getView ( ) != null ) { Set < AddOn > addOns = new HashSet < > ( changes . getUninstalls ( ) ) ; addOns . addAll ( changes . getOldVersions ( ) ) ; Set < Extension > extensions = new HashSet < > ( ) ; extensions . addAll ( changes . getUnloadExtensions ( ) ) ; extensions . addAll ( changes . getSoftUnloadExtensions ( ) ) ; if ( ! warnUnsavedResourcesOrActiveActions ( caller , addOns , extensions , true ) ) { return ; } } uninstallAddOns ( caller , changes . getUninstalls ( ) , false ) ; Set < AddOn > allAddons = new HashSet < > ( changes . getNewVersions ( ) ) ; allAddons . addAll ( changes . getInstalls ( ) ) ; for ( AddOn addOn : allAddons ) { if ( addonsDialog != null ) { addonsDialog . notifyAddOnDownloading ( addOn ) ; } downloadAddOn ( addOn ) ; } |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getColorFidelity ( ) { } } | if ( colorFidelityEClass == null ) { colorFidelityEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 503 ) ; } return colorFidelityEClass ; |
public class Value { /** * Returns an { @ code INT64 } value .
* @ param v the value , which may be null */
public static Value int64 ( @ Nullable Long v ) { } } | return new Int64Impl ( v == null , v == null ? 0 : v ) ; |
public class InterceptorTypeImpl { /** * If not already created , a new < code > post - construct < / code > element will be created and returned .
* Otherwise , the first existing < code > post - construct < / code > element will be returned .
* @ return the instance defined for the element < code > post - construct < / code > */
public LifecycleCallbackType < InterceptorType < T > > getOrCreatePostConstruct ( ) { } } | List < Node > nodeList = childNode . get ( "post-construct" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new LifecycleCallbackTypeImpl < InterceptorType < T > > ( this , "post-construct" , childNode , nodeList . get ( 0 ) ) ; } return createPostConstruct ( ) ; |
public class RxLoaderManager { /** * Get an instance of the { @ code RxLoaderManager } that is tied to the lifecycle of the given
* { @ link android . app . Fragment } . If you are using the support library , then you should use
* { @ link me . tatarka . rxloader . RxLoaderManagerCompat # get ( android . support . v4 . app . Fragment ) } }
* instead .
* @ param fragment the fragment
* @ return the { @ code RxLoaderManager } */
@ TargetApi ( Build . VERSION_CODES . JELLY_BEAN_MR1 ) public static RxLoaderManager get ( Fragment fragment ) { } } | if ( Build . VERSION . SDK_INT < Build . VERSION_CODES . JELLY_BEAN_MR1 ) { throw new UnsupportedOperationException ( "Method only valid in api 17 and above, use RxLoaderManagerCompat to support older versions (requires support library)" ) ; } RxLoaderBackendNestedFragment manager = ( RxLoaderBackendNestedFragment ) fragment . getChildFragmentManager ( ) . findFragmentByTag ( FRAGMENT_TAG ) ; if ( manager == null ) { manager = new RxLoaderBackendNestedFragment ( ) ; fragment . getChildFragmentManager ( ) . beginTransaction ( ) . add ( manager , FRAGMENT_TAG ) . commit ( ) ; } return new RxLoaderManager ( manager ) ; |
public class LiveEventsInner { /** * Updates a existing Live Event .
* @ param resourceGroupName The name of the resource group within the Azure subscription .
* @ param accountName The Media Services account name .
* @ param liveEventName The name of the Live Event .
* @ param parameters Live Event properties needed for creation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the LiveEventInner object */
public Observable < LiveEventInner > beginUpdateAsync ( String resourceGroupName , String accountName , String liveEventName , LiveEventInner parameters ) { } } | return beginUpdateWithServiceResponseAsync ( resourceGroupName , accountName , liveEventName , parameters ) . map ( new Func1 < ServiceResponse < LiveEventInner > , LiveEventInner > ( ) { @ Override public LiveEventInner call ( ServiceResponse < LiveEventInner > response ) { return response . body ( ) ; } } ) ; |
public class KeyVaultClientImpl { /** * Deletes a key of any type from storage in Azure Key Vault . The delete key operation cannot be used to remove individual versions of a key . This operation removes the cryptographic material associated with the key , which means the key is not usable for Sign / Verify , Wrap / Unwrap or Encrypt / Decrypt operations . Authorization : Requires the keys / delete permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param keyName The name of the key to delete .
* @ return the KeyBundle object if successful . */
public KeyBundle deleteKey ( String vaultBaseUrl , String keyName ) { } } | return deleteKeyWithServiceResponseAsync ( vaultBaseUrl , keyName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class XlsMapper { /** * Excelファイルの複数シートを読み込み 、 任意のクラスにマップする 。
* < p > 複数のシートの形式を一度に読み込む際に使用します 。 < / p >
* @ param xlsIn 読み込み元のExcelファイルのストリーム 。
* @ param classes マッピング先のクラスタイプの配列 。
* @ return マッピングした複数のシートの結果 。
* { @ link Configuration # isIgnoreSheetNotFound ( ) } の値がtrueで 、 シートが見つからない場合 、 マッピング結果には含まれません 。
* @ throws IllegalArgumentException { @ literal xlsIn = = null or classes = = null }
* @ throws IllegalArgumentException { @ literal calsses . length = = 0}
* @ throws IOException ファイルの読み込みに失敗した場合
* @ throws XlsMapperException マッピングに失敗した場合 */
public MultipleSheetBindingErrors < Object > loadMultipleDetail ( final InputStream xlsIn , final Class < ? > [ ] classes ) throws XlsMapperException , IOException { } } | return loader . loadMultipleDetail ( xlsIn , classes ) ; |
public class AbstractOAuth1ApiBinding { /** * Returns an { @ link FormHttpMessageConverter } to be used by the internal { @ link RestTemplate } .
* By default , the message converter is set to use " UTF - 8 " character encoding .
* Override to customize the message converter ( for example , to set supported media types or message converters for the parts of a multipart message ) .
* To remove / replace this or any of the other message converters that are registered by default , override the getMessageConverters ( ) method instead .
* @ return an { @ link FormHttpMessageConverter } to be used by the internal { @ link RestTemplate } . */
protected FormHttpMessageConverter getFormMessageConverter ( ) { } } | FormHttpMessageConverter converter = new FormHttpMessageConverter ( ) ; converter . setCharset ( Charset . forName ( "UTF-8" ) ) ; List < HttpMessageConverter < ? > > partConverters = new ArrayList < HttpMessageConverter < ? > > ( ) ; partConverters . add ( new ByteArrayHttpMessageConverter ( ) ) ; StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter ( Charset . forName ( "UTF-8" ) ) ; stringHttpMessageConverter . setWriteAcceptCharset ( false ) ; partConverters . add ( stringHttpMessageConverter ) ; partConverters . add ( new ResourceHttpMessageConverter ( ) ) ; converter . setPartConverters ( partConverters ) ; return converter ; |
public class MapOnlyJobBuilder { /** * Sets the default named output specs . By using this method one can use an arbitrary number of named outputs
* without pre - defining them beforehand . */
public void setDefaultNamedOutput ( OutputFormat outputFormat , Class keyClass , Class valueClass ) throws TupleMRException { } } | setDefaultNamedOutput ( outputFormat , keyClass , valueClass , null ) ; |
public class CmsSystemInfo { /** * Returns an absolute path ( to a directory or a file in the " real " file system ) from a path relative to
* the web application folder of OpenCms . < p >
* If the provided path is already absolute , then it is returned unchanged .
* If the provided path is a folder , the result will always end with a folder separator . < p >
* @ param path the path ( relative ) to generate an absolute path from
* @ return an absolute path ( to a directory or a file ) from a path relative to the web application folder of OpenCms */
public String getAbsoluteRfsPathRelativeToWebApplication ( String path ) { } } | if ( ( path == null ) || ( getWebApplicationRfsPath ( ) == null ) ) { return null ; } // check for absolute path is system depended , let ' s just use the standard check
File f = new File ( path ) ; if ( f . isAbsolute ( ) ) { // apparently this is an absolute path already
path = f . getAbsolutePath ( ) ; if ( f . isDirectory ( ) && ! path . endsWith ( File . separator ) ) { // make sure all folder paths end with a separator
path = path . concat ( File . separator ) ; } return path ; } return CmsFileUtil . normalizePath ( getWebApplicationRfsPath ( ) + path ) ; |
public class OperaDesktopDriver { /** * Get an item in a language independent way from its stringId .
* @ param stringId StringId as found in standard _ menu . ini */
public QuickMenuItem getQuickMenuItemByStringId ( String stringId ) { } } | String text = desktopUtils . getString ( stringId , true ) ; return desktopWindowManager . getQuickMenuItemByText ( text ) ; |
public class MessageInfo { /** * Get the table name . */
public String getTableNames ( boolean bAddQuotes ) { } } | return ( m_tableName == null ) ? Record . formatTableNames ( MESSAGE_INFO_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ; |
public class EntityType { /** * Returns all atomic attributes . In case of compound attributes ( attributes consisting of atomic
* attributes ) only the descendant atomic attributes are returned . The compound attribute itself
* is not returned .
* < p > In case EntityType extends other EntityType then the attributes of this EntityType as well
* as its parent class are returned .
* @ return atomic attributes without extended entity atomic attributes */
public Iterable < Attribute > getOwnAtomicAttributes ( ) { } } | return ( ) -> getCachedOwnAttrs ( ) . values ( ) . stream ( ) . filter ( attr -> attr . getDataType ( ) != COMPOUND ) . iterator ( ) ; |
public class Internal { /** * Returns a 2 or 4 byte qualifier based on the timestamp and the flags . If
* the timestamp is in seconds , this returns a 2 byte qualifier . If it ' s in
* milliseconds , returns a 4 byte qualifier
* @ param timestamp A Unix epoch timestamp in seconds or milliseconds
* @ param flags Flags to set on the qualifier ( length & # 38 ; | float )
* @ return A 2 or 4 byte qualifier for storage in column or compacted column
* @ since 2.0 */
public static byte [ ] buildQualifier ( final long timestamp , final short flags ) { } } | final long base_time ; if ( ( timestamp & Const . SECOND_MASK ) != 0 ) { // drop the ms timestamp to seconds to calculate the base timestamp
base_time = ( ( timestamp / 1000 ) - ( ( timestamp / 1000 ) % Const . MAX_TIMESPAN ) ) ; final int qual = ( int ) ( ( ( timestamp - ( base_time * 1000 ) << ( Const . MS_FLAG_BITS ) ) | flags ) | Const . MS_FLAG ) ; return Bytes . fromInt ( qual ) ; } else { base_time = ( timestamp - ( timestamp % Const . MAX_TIMESPAN ) ) ; final short qual = ( short ) ( ( timestamp - base_time ) << Const . FLAG_BITS | flags ) ; return Bytes . fromShort ( qual ) ; } |
public class GlobalForwardingRuleClient { /** * Creates a GlobalForwardingRule resource in the specified project using the data included in the
* request .
* < p > Sample code :
* < pre > < code >
* try ( GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient . create ( ) ) {
* ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ;
* ForwardingRule forwardingRuleResource = ForwardingRule . newBuilder ( ) . build ( ) ;
* Operation response = globalForwardingRuleClient . insertGlobalForwardingRule ( project , forwardingRuleResource ) ;
* < / code > < / pre >
* @ param project Project ID for this request .
* @ param forwardingRuleResource A ForwardingRule resource . A ForwardingRule resource specifies
* which pool of target virtual machines to forward a packet to if it matches the given
* [ IPAddress , IPProtocol , ports ] tuple . ( = = resource _ for beta . forwardingRules = = ) ( = =
* resource _ for v1 . forwardingRules = = ) ( = = resource _ for beta . globalForwardingRules = = ) ( = =
* resource _ for v1 . globalForwardingRules = = ) ( = = resource _ for beta . regionForwardingRules = = )
* ( = = resource _ for v1 . regionForwardingRules = = )
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Operation insertGlobalForwardingRule ( ProjectName project , ForwardingRule forwardingRuleResource ) { } } | InsertGlobalForwardingRuleHttpRequest request = InsertGlobalForwardingRuleHttpRequest . newBuilder ( ) . setProject ( project == null ? null : project . toString ( ) ) . setForwardingRuleResource ( forwardingRuleResource ) . build ( ) ; return insertGlobalForwardingRule ( request ) ; |
public class StandardBullhornData { /** * { @ inheritDoc } */
@ Override public < T extends EditHistoryEntity > EditHistoryListWrapper queryEntityForEditHistory ( Class < T > entityType , String where , Set < String > fieldSet , QueryParams params ) { } } | return this . handleQueryForEntityEditHistory ( entityType , where , fieldSet , params ) ; |
public class DefaultStreamFilenameGenerator { /** * Generate stream directory based on relative scope path . The base directory is
* < pre >
* streams
* < / pre >
* , e . g . a scope
* < pre >
* / application / one / two /
* < / pre >
* will generate a directory
* < pre >
* / streams / one / two /
* < / pre >
* inside the application .
* @ param scope
* Scope
* @ return Directory based on relative scope path */
private String getStreamDirectory ( IScope scope ) { } } | final StringBuilder result = new StringBuilder ( ) ; final IScope app = ScopeUtils . findApplication ( scope ) ; final String prefix = "streams/" ; while ( scope != null && scope != app ) { result . insert ( 0 , scope . getName ( ) + "/" ) ; scope = scope . getParent ( ) ; } if ( result . length ( ) == 0 ) { return prefix ; } else { result . insert ( 0 , prefix ) . append ( '/' ) ; return result . toString ( ) ; } |
public class SipCall { /** * @ see org . cafesip . sipunit . MessageListener # processEvent ( java . util . EventObject ) */
public void processEvent ( EventObject event ) // for asynchronous
// ( nonblocking ) response
// handling
{ } } | synchronized ( this ) { } // wail til message sending has finished ( transaction attribute set )
if ( event instanceof ResponseEvent ) { processResponse ( ( ResponseEvent ) event ) ; } else if ( event instanceof TimeoutEvent ) { processTimeout ( ( TimeoutEvent ) event ) ; } // note , requests don ' t come through here , they are handled via the
// listen / waitFor methods . |
public class RecurlyClient { /** * Get the subscriptions for an { @ link Account } given query params
* Returns subscriptions associated with an account
* @ param accountCode recurly account id
* @ param state { @ link SubscriptionState }
* @ param params { @ link QueryParams }
* @ return Subscriptions on the account */
public Subscriptions getAccountSubscriptions ( final String accountCode , final SubscriptionState state , final QueryParams params ) { } } | if ( state != null ) params . put ( "state" , state . getType ( ) ) ; return doGET ( Account . ACCOUNT_RESOURCE + "/" + accountCode + Subscriptions . SUBSCRIPTIONS_RESOURCE , Subscriptions . class , params ) ; |
public class FileUtils { /** * Copy the file using streams .
* @ param in source .
* @ param out destination .
* @ see java . nio . channels . FileChannel # transferTo ( long , long , java . nio . channels . WritableByteChannel )
* @ return the transferred byte count .
* @ throws IOException */
public static long copy ( FileInputStream in , FileOutputStream out ) throws IOException { } } | FileChannel source = null ; FileChannel destination = null ; try { source = in . getChannel ( ) ; destination = out . getChannel ( ) ; return source . transferTo ( 0 , source . size ( ) , destination ) ; } finally { CloseableUtils . close ( source ) ; CloseableUtils . close ( destination ) ; } |
public class SqlContextImpl { /** * バインドパラメータ配列取得
* @ return バインドパラメータ配列 */
public Parameter [ ] getBindParameters ( ) { } } | return bindNames . stream ( ) . map ( this :: getParam ) . filter ( Objects :: nonNull ) . toArray ( Parameter [ ] :: new ) ; |
public class CmsContextMenuItem { /** * Generates the HTML for a menu item . < p >
* @ param hasSubMenu signals if this menu has a sub menu
* @ return the HTML for the menu item */
protected String getMenuItemHtml ( boolean hasSubMenu ) { } } | StringBuffer html = new StringBuffer ( ) ; if ( hasSubMenu ) { // if this menu item has a sub menu show the arrow - icon behind the text of the icon
html . append ( "<div class=\"" ) ; html . append ( I_CmsLayoutBundle . INSTANCE . contextmenuCss ( ) . arrow ( ) ) . append ( " " ) . append ( I_CmsButton . ICON_FONT ) . append ( " " ) . append ( I_CmsButton . TRIANGLE_RIGHT ) ; html . append ( "\"></div>" ) ; } String iconClass = m_entry . getIconClass ( ) ; if ( iconClass == null ) { iconClass = "" ; } String iconHtml = "<div class='" + iconClass + "'></div>" ; html . append ( "<div class='" + I_CmsLayoutBundle . INSTANCE . contextmenuCss ( ) . iconBox ( ) + "'>" + iconHtml + "</div>" ) ; // add the text to the item
html . append ( "<div class=\"" ) ; html . append ( I_CmsLayoutBundle . INSTANCE . contextmenuCss ( ) . label ( ) ) ; html . append ( "\">" + getText ( ) + "</div>" ) ; return html . toString ( ) ; |
public class BigtableBufferedMutator { /** * Create a { @ link RetriesExhaustedWithDetailsException } if there were any async exceptions and
* send it to the { @ link org . apache . hadoop . hbase . client . BufferedMutator . ExceptionListener } . */
private void handleExceptions ( ) throws RetriesExhaustedWithDetailsException { } } | RetriesExhaustedWithDetailsException exceptions = getExceptions ( ) ; if ( exceptions != null ) { listener . onException ( exceptions , this ) ; } |
public class FSNamesystem { /** * Set owner for an existing file .
* @ throws IOException */
public void setOwner ( String src , String username , String group ) throws IOException { } } | INode [ ] inodes = null ; writeLock ( ) ; try { if ( isInSafeMode ( ) ) { throw new SafeModeException ( "Cannot set permission for " + src , safeMode ) ; } inodes = dir . getExistingPathINodes ( src ) ; if ( isPermissionCheckingEnabled ( inodes ) ) { FSPermissionChecker pc = checkOwner ( src , inodes ) ; if ( ! pc . isSuper ) { if ( username != null && ! pc . user . equals ( username ) ) { if ( this . permissionAuditOnly ) { // do not throw the exception , we would like to only log .
LOG . warn ( "PermissionAudit failed on " + src + ": non-super user cannot change owner." ) ; } else { throw new AccessControlException ( "Non-super user cannot change owner." ) ; } } if ( group != null && ! pc . containsGroup ( group ) ) { if ( this . permissionAuditOnly ) { // do not throw the exception , we would like to only log .
LOG . warn ( "PermissionAudit failed on " + src + ": user does not belong to " + group + " ." ) ; } else { throw new AccessControlException ( "User does not belong to " + group + " ." ) ; } } } } dir . setOwner ( src , username , group ) ; } finally { writeUnlock ( ) ; } getEditLog ( ) . logSync ( false ) ; if ( auditLog . isInfoEnabled ( ) ) { logAuditEvent ( getCurrentUGI ( ) , Server . getRemoteIp ( ) , "setOwner" , src , null , getLastINode ( inodes ) ) ; } |
public class SingleFilterAdapter { /** * Determine if the untyped filter is supported .
* @ param context a { @ link com . google . cloud . bigtable . hbase . adapters . filters . FilterAdapterContext } object .
* @ param hbaseFilter a { @ link org . apache . hadoop . hbase . filter . Filter } object .
* @ return a { @ link com . google . cloud . bigtable . hbase . adapters . filters . FilterSupportStatus } object . */
public FilterSupportStatus isSupported ( FilterAdapterContext context , Filter hbaseFilter ) { } } | Preconditions . checkArgument ( isFilterAProperSublcass ( hbaseFilter ) ) ; return adapter . isFilterSupported ( context , getTypedFilter ( hbaseFilter ) ) ; |
public class NetworkUtils { /** * Read http response from a given http connection
* @ param connection the connection to read response
* @ return the byte [ ] in response body , or new byte [ 0 ] if failed to read */
public static byte [ ] readHttpResponse ( HttpURLConnection connection ) { } } | byte [ ] res ; try { if ( connection . getResponseCode ( ) != HttpURLConnection . HTTP_OK ) { LOG . log ( Level . WARNING , "Http Response not OK: " + connection . getResponseCode ( ) ) ; } } catch ( IOException e ) { LOG . log ( Level . SEVERE , "Failed to get response code" , e ) ; return new byte [ 0 ] ; } int responseLength = connection . getContentLength ( ) ; if ( responseLength <= 0 ) { LOG . log ( Level . SEVERE , "Response length abnormal: " + responseLength ) ; return new byte [ 0 ] ; } try { res = new byte [ responseLength ] ; InputStream is = connection . getInputStream ( ) ; int off = 0 ; int bRead = 0 ; while ( off != ( responseLength - 1 ) && ( bRead = is . read ( res , off , responseLength - off ) ) != - 1 ) { off += bRead ; } return res ; } catch ( IOException e ) { LOG . log ( Level . SEVERE , "Failed to read response: " , e ) ; return new byte [ 0 ] ; } finally { try { connection . getInputStream ( ) . close ( ) ; } catch ( IOException e ) { LOG . log ( Level . SEVERE , "Failed to close InputStream: " , e ) ; return new byte [ 0 ] ; } } |
public class BehaviorTreeLibrary { /** * Dispose behavior tree obtain by this library .
* @ param treeReference the tree identifier .
* @ param behaviorTree the tree to dispose . */
public void disposeBehaviorTree ( String treeReference , BehaviorTree < ? > behaviorTree ) { } } | if ( Task . TASK_CLONER != null ) { Task . TASK_CLONER . freeTask ( behaviorTree ) ; } |
public class Documentation { /** * < pre >
* Declares a single overview page . For example :
* & lt ; pre & gt ; & lt ; code & gt ; documentation :
* summary : . . .
* overview : & amp ; # 40 ; = = include overview . md = = & amp ; # 41;
* & lt ; / code & gt ; & lt ; / pre & gt ;
* This is a shortcut for the following declaration ( using pages style ) :
* & lt ; pre & gt ; & lt ; code & gt ; documentation :
* summary : . . .
* pages :
* - name : Overview
* content : & amp ; # 40 ; = = include overview . md = = & amp ; # 41;
* & lt ; / code & gt ; & lt ; / pre & gt ;
* Note : you cannot specify both ` overview ` field and ` pages ` field .
* < / pre >
* < code > string overview = 2 ; < / code > */
public java . lang . String getOverview ( ) { } } | java . lang . Object ref = overview_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; overview_ = s ; return s ; } |
public class DatasetInfo { /** * Returns a builder for the DatasetInfo object given it ' s user - defined project and dataset ids . */
public static Builder newBuilder ( String projectId , String datasetId ) { } } | return newBuilder ( DatasetId . of ( projectId , datasetId ) ) ; |
public class CollectionPartitionsInner { /** * Retrieves the usages ( most recent storage data ) for the given collection , split by partition .
* @ param resourceGroupName Name of an Azure resource group .
* @ param accountName Cosmos DB database account name .
* @ param databaseRid Cosmos DB database rid .
* @ param collectionRid Cosmos DB collection rid .
* @ 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 < PartitionUsageInner > > listUsagesAsync ( String resourceGroupName , String accountName , String databaseRid , String collectionRid , final ServiceCallback < List < PartitionUsageInner > > serviceCallback ) { } } | return ServiceFuture . fromResponse ( listUsagesWithServiceResponseAsync ( resourceGroupName , accountName , databaseRid , collectionRid ) , serviceCallback ) ; |
public class CPDAvailabilityEstimateUtil { /** * Returns all the cpd availability estimates where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ return the matching cpd availability estimates */
public static List < CPDAvailabilityEstimate > findByUuid_C ( String uuid , long companyId ) { } } | return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ; |
public class DisksInner { /** * Grants access to a disk .
* @ param resourceGroupName The name of the resource group .
* @ param diskName The name of the managed disk that is being created . The name can ' t be changed after the disk is created . Supported characters for the name are a - z , A - Z , 0-9 and _ . The maximum name length is 80 characters .
* @ param grantAccessData Access data object supplied in the body of the get disk access operation .
* @ 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 < AccessUriInner > grantAccessAsync ( String resourceGroupName , String diskName , GrantAccessData grantAccessData , final ServiceCallback < AccessUriInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( grantAccessWithServiceResponseAsync ( resourceGroupName , diskName , grantAccessData ) , serviceCallback ) ; |
public class HillsRenderConfig { /** * call after initialization , after a set of changes to the settable properties or after forceReindex to initiate background indexing */
public HillsRenderConfig indexOnThread ( ) { } } | ShadeTileSource cache = tileSource ; if ( cache != null ) cache . applyConfiguration ( true ) ; return this ; |
public class FeatureWebSecurityConfigImpl { /** * { @ inheritDoc } */
@ Override public boolean getAllowFailOverToAppDefined ( ) { } } | WebAppSecurityConfig globalConfig = WebAppSecurityCollaboratorImpl . getGlobalWebAppSecurityConfig ( ) ; if ( globalConfig != null ) return WebAppSecurityCollaboratorImpl . getGlobalWebAppSecurityConfig ( ) . getAllowFailOverToAppDefined ( ) ; else return false ; |
public class DebtModelPluginRepository { /** * Creates a new { @ link java . io . Reader } for the XML file that contains the model contributed by the given plugin .
* @ param pluginKey the key of the plugin that contributes the XML file
* @ return the reader , that must be closed once its use is finished . */
public Reader createReaderForXMLFile ( String pluginKey ) { } } | ClassLoader classLoader = contributingPluginKeyToClassLoader . get ( pluginKey ) ; String xmlFilePath = getXMLFilePath ( pluginKey ) ; return new InputStreamReader ( classLoader . getResourceAsStream ( xmlFilePath ) , StandardCharsets . UTF_8 ) ; |
public class TaskClient { /** * Requeue pending tasks of a specific task type
* @ return returns the number of tasks that have been requeued */
public String requeuePendingTasksByTaskType ( String taskType ) { } } | Preconditions . checkArgument ( StringUtils . isNotBlank ( taskType ) , "Task type cannot be blank" ) ; return postForEntity ( "tasks/queue/requeue/{taskType}" , null , null , String . class , taskType ) ; |
public class UpdateProductPackages { /** * Runs the example .
* @ param adManagerServices the services factory .
* @ param session the session .
* @ param productPackageId the ID of the product package to update .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors . */
public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session , long productPackageId ) throws RemoteException { } } | // Get the ProductPackageService .
ProductPackageServiceInterface productPackageService = adManagerServices . get ( session , ProductPackageServiceInterface . class ) ; // Create a statement to select a single product package .
StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "id = :id" ) . orderBy ( "id ASC" ) . limit ( 1 ) . withBindVariableValue ( "id" , productPackageId ) ; // Get the product package .
ProductPackagePage page = productPackageService . getProductPackagesByStatement ( statementBuilder . toStatement ( ) ) ; ProductPackage productPackage = Iterables . getOnlyElement ( Arrays . asList ( page . getResults ( ) ) ) ; // Update the notes of the product package .
productPackage . setNotes ( "This product package is not to be sold before " + "the end of the month" ) ; // Update the product package on the server .
ProductPackage [ ] productPackages = productPackageService . updateProductPackages ( new ProductPackage [ ] { productPackage } ) ; for ( ProductPackage updatedProductPackage : productPackages ) { System . out . printf ( "Product package with ID %d and name '%s' was updated.%n" , updatedProductPackage . getId ( ) , updatedProductPackage . getName ( ) ) ; } |
public class DisplacedList { /** * Inherited from ArrayList
* @ param index
* @ param element */
@ Override public void add ( int index , T element ) { } } | if ( displacement != null ) { super . add ( index - displacement , element ) ; } else { super . add ( index , element ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.