signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class IotHubResourcesInner { /** * Get the statistics from an IoT hub . * Get the statistics from an IoT hub . * @ param resourceGroupName The name of the resource group that contains the IoT hub . * @ param resourceName The name of the IoT hub . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorDetailsException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the RegistryStatisticsInner object if successful . */ public RegistryStatisticsInner getStats ( String resourceGroupName , String resourceName ) { } }
return getStatsWithServiceResponseAsync ( resourceGroupName , resourceName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class KeyVaultCredentials { /** * Extracts the challenge off the authentication header . * @ param authenticateHeader * the authentication header containing all the challenges . * @ param authChallengePrefix * the authentication challenge name . * @ return a challenge map . */ private static Map < String , String > extractChallenge ( String authenticateHeader , String authChallengePrefix ) { } }
if ( ! isValidChallenge ( authenticateHeader , authChallengePrefix ) ) { return null ; } authenticateHeader = authenticateHeader . toLowerCase ( ) . replace ( authChallengePrefix . toLowerCase ( ) , "" ) ; String [ ] challenges = authenticateHeader . split ( ", " ) ; Map < String , String > challengeMap = new HashMap < String , String > ( ) ; for ( String pair : challenges ) { String [ ] keyValue = pair . split ( "=" ) ; challengeMap . put ( keyValue [ 0 ] . replaceAll ( "\"" , "" ) , keyValue [ 1 ] . replaceAll ( "\"" , "" ) ) ; } return challengeMap ;
public class PropertiesReader { /** * Loads properties from a properties file on the classpath . */ private static Properties loadPropertiesFromClasspath ( String propertiesFile ) { } }
Properties properties = new Properties ( ) ; try ( InputStream is = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( propertiesFile ) ) { properties . load ( is ) ; } catch ( IOException e ) { throw new RuntimeException ( "failed to load properties" , e ) ; } return properties ;
public class RsaEncryptedConverter { /** * Decode this array . * @ param rgbValue * @ return * @ throws NoSuchAlgorithmException */ public byte [ ] decodeBytes ( byte [ ] rgbValue ) throws NoSuchAlgorithmException { } }
rgbValue = super . decodeBytes ( rgbValue ) ; // Base64 encoding rgbValue = this . decrypt ( rgbValue ) ; return rgbValue ;
public class ExpressionBuilderFragment { /** * Replies a keyword for declaring a container . * @ param grammarContainer the container description . * @ return the keyword , never < code > null < / code > nor an empty string . */ protected String ensureContainerKeyword ( EObject grammarContainer ) { } }
final Iterator < Keyword > iterator = Iterators . filter ( grammarContainer . eContents ( ) . iterator ( ) , Keyword . class ) ; if ( iterator . hasNext ( ) ) { return iterator . next ( ) . getValue ( ) ; } return getExpressionConfig ( ) . getFieldContainerDeclarationKeyword ( ) ;
public class JSDocInfoBuilder { /** * Records that the { @ link JSDocInfo } being built should have its * { @ link JSDocInfo # isHidden ( ) } flag set to { @ code true } . * @ return { @ code true } if the hiddenness was recorded and { @ code false } * if it was already defined */ public boolean recordHiddenness ( ) { } }
if ( ! currentInfo . isHidden ( ) ) { currentInfo . setHidden ( true ) ; populated = true ; return true ; } else { return false ; }
public class ObjectType { /** * We treat this as the unknown type if any of its implicit prototype * properties is unknown . */ @ Override public boolean isUnknownType ( ) { } }
// If the object is unknown now , check the supertype again , // because it might have been resolved since the last check . if ( unknown ) { ObjectType implicitProto = getImplicitPrototype ( ) ; if ( implicitProto == null || implicitProto . isNativeObjectType ( ) ) { unknown = false ; for ( ObjectType interfaceType : getCtorExtendedInterfaces ( ) ) { if ( interfaceType . isUnknownType ( ) ) { unknown = true ; break ; } } } else { unknown = implicitProto . isUnknownType ( ) ; } } return unknown ;
public class NavMesh { /** * Returns closest point on polygon . * @ param ref * @ param pos * @ return */ float [ ] closestPointOnDetailEdges ( MeshTile tile , Poly poly , float [ ] pos , boolean onlyBoundary ) { } }
int ANY_BOUNDARY_EDGE = ( DT_DETAIL_EDGE_BOUNDARY << 0 ) | ( DT_DETAIL_EDGE_BOUNDARY << 2 ) | ( DT_DETAIL_EDGE_BOUNDARY << 4 ) ; int ip = poly . index ; PolyDetail pd = tile . data . detailMeshes [ ip ] ; float dmin = Float . MAX_VALUE ; float tmin = 0 ; float [ ] pmin = null ; float [ ] pmax = null ; for ( int i = 0 ; i < pd . triCount ; i ++ ) { int ti = ( pd . triBase + i ) * 4 ; int [ ] tris = tile . data . detailTris ; if ( onlyBoundary && ( tris [ ti + 3 ] & ANY_BOUNDARY_EDGE ) == 0 ) { continue ; } float [ ] [ ] v = new float [ 3 ] [ ] ; for ( int j = 0 ; j < 3 ; ++ j ) { if ( tris [ ti + j ] < poly . vertCount ) { int index = poly . verts [ tris [ ti + j ] ] * 3 ; v [ j ] = new float [ ] { tile . data . verts [ index ] , tile . data . verts [ index + 1 ] , tile . data . verts [ index + 2 ] } ; } else { int index = ( pd . vertBase + ( tris [ ti + j ] - poly . vertCount ) ) * 3 ; v [ j ] = new float [ ] { tile . data . detailVerts [ index ] , tile . data . detailVerts [ index + 1 ] , tile . data . detailVerts [ index + 2 ] } ; } } for ( int k = 0 , j = 2 ; k < 3 ; j = k ++ ) { if ( ( getDetailTriEdgeFlags ( tris [ 3 ] , j ) & DT_DETAIL_EDGE_BOUNDARY ) == 0 && ( onlyBoundary || tris [ j ] < tris [ k ] ) ) { // Only looking at boundary edges and this is internal , or // this is an inner edge that we will see again or have already seen . continue ; } Tupple2 < Float , Float > dt = distancePtSegSqr2D ( pos , v [ j ] , v [ k ] ) ; float d = dt . first ; float t = dt . second ; if ( d < dmin ) { dmin = d ; tmin = t ; pmin = v [ j ] ; pmax = v [ k ] ; } } } return vLerp ( pmin , pmax , tmin ) ;
public class DataSetComparator { /** * - - Private methods */ public void shouldBeEmpty ( IDataSet dataSet , String tableName , AssertionErrorCollector errorCollector ) throws DataSetException { } }
final SortedTable tableState = new SortedTable ( dataSet . getTable ( tableName ) ) ; int rowCount = tableState . getRowCount ( ) ; if ( rowCount != 0 ) { errorCollector . collect ( new AssertionError ( tableName + " expected to be empty, but was <" + rowCount + ">." ) ) ; }
public class WasAssociatedWith { /** * Gets the value of the plan property . * @ return * possible object is * { @ link org . openprovenance . prov . sql . IDRef } */ @ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { } }
CascadeType . ALL } ) @ JoinColumn ( name = "PLAN" ) public org . openprovenance . prov . model . QualifiedName getPlan ( ) { return plan ;
public class PutEventsRequestEntryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PutEventsRequestEntry putEventsRequestEntry , ProtocolMarshaller protocolMarshaller ) { } }
if ( putEventsRequestEntry == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putEventsRequestEntry . getTime ( ) , TIME_BINDING ) ; protocolMarshaller . marshall ( putEventsRequestEntry . getSource ( ) , SOURCE_BINDING ) ; protocolMarshaller . marshall ( putEventsRequestEntry . getResources ( ) , RESOURCES_BINDING ) ; protocolMarshaller . marshall ( putEventsRequestEntry . getDetailType ( ) , DETAILTYPE_BINDING ) ; protocolMarshaller . marshall ( putEventsRequestEntry . getDetail ( ) , DETAIL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class JpaControllerManagement { /** * Returns the configured minimum polling interval . * @ return current { @ link TenantConfigurationKey # MIN _ POLLING _ TIME _ INTERVAL } . */ @ Override public String getMinPollingTime ( ) { } }
return systemSecurityContext . runAsSystem ( ( ) -> tenantConfigurationManagement . getConfigurationValue ( TenantConfigurationKey . MIN_POLLING_TIME_INTERVAL , String . class ) . getValue ( ) ) ;
public class ProposalLineItem { /** * Gets the targeting value for this ProposalLineItem . * @ return targeting * Contains the targeting criteria for the { @ code ProposalLineItem } . * This attribute is * optional during creation and defaults to the { @ link * Product # targeting product ' s targeting } . */ public com . google . api . ads . admanager . axis . v201805 . Targeting getTargeting ( ) { } }
return targeting ;
public class RedmineJSONBuilder { /** * Converts object to a " simple " json . * @ param tag * object tag . * @ param object * object to convert . * @ param writer * object writer . * @ return object String representation . * @ throws RedmineInternalError * if conversion fails . */ public static < T > String toSimpleJSON ( String tag , T object , JsonObjectWriter < T > writer ) throws RedmineInternalError { } }
final StringWriter swriter = new StringWriter ( ) ; final JSONWriter jsWriter = new JSONWriter ( swriter ) ; try { jsWriter . object ( ) ; jsWriter . key ( tag ) ; jsWriter . object ( ) ; writer . write ( jsWriter , object ) ; jsWriter . endObject ( ) ; jsWriter . endObject ( ) ; } catch ( JSONException e ) { throw new RedmineInternalError ( "Unexpected JSONException" , e ) ; } return swriter . toString ( ) ;
public class SkillRequestTimestampVerifier { /** * Validates if the provided date is inclusively within the verifier tolerance , either in the * past or future , of the current system time . This method will throw a { @ link SecurityException } if the * tolerance is not in the expected range , or if the request is null or does not contain a timestamp value . * { @ inheritDoc } */ public void verify ( HttpServletRequest servletRequest , byte [ ] serializedRequestEnvelope , RequestEnvelope deserializedRequestEnvelope ) { } }
if ( deserializedRequestEnvelope == null ) { throw new SecurityException ( "Incoming request did not contain a request envelope" ) ; } Request request = deserializedRequestEnvelope . getRequest ( ) ; if ( request == null || request . getTimestamp ( ) == null ) { throw new SecurityException ( "Incoming request was null or did not contain a timestamp to evaluate" ) ; } long requestTimestamp = request . getTimestamp ( ) . toInstant ( ) . toEpochMilli ( ) ; long delta = Math . abs ( System . currentTimeMillis ( ) - requestTimestamp ) ; boolean withinTolerance = delta <= toleranceInMilliseconds ; if ( ! withinTolerance ) { throw new SecurityException ( String . format ( "Request with id %s and timestamp %s failed timestamp validation" + " with a delta of %s" , request . getRequestId ( ) , requestTimestamp , delta ) ) ; }
public class UserAvatarResolver { /** * Resolve an avatar image URL string for the user . * Note that this method must be called from an HTTP request to be reliable ; else use { @ link # resolveOrNull } . * @ param u user * @ param avatarSize the preferred image size , " [ width ] x [ height ] " * @ return a URL string for a user Avatar image . */ public static String resolve ( User u , String avatarSize ) { } }
String avatar = resolveOrNull ( u , avatarSize ) ; return avatar != null ? avatar : Jenkins . getInstance ( ) . getRootUrl ( ) + Functions . getResourcePath ( ) + "/images/" + avatarSize + "/user.png" ;
public class appfwpolicylabel { /** * Use this API to add appfwpolicylabel . */ public static base_response add ( nitro_service client , appfwpolicylabel resource ) throws Exception { } }
appfwpolicylabel addresource = new appfwpolicylabel ( ) ; addresource . labelname = resource . labelname ; addresource . policylabeltype = resource . policylabeltype ; return addresource . add_resource ( client ) ;
public class MSwingUtilities { /** * Affiche une boîte de dialogue de confirmation . * @ param component Component * @ param message String * @ return boolean */ public static boolean showConfirmation ( Component component , String message ) { } }
return JOptionPane . showConfirmDialog ( SwingUtilities . getWindowAncestor ( component ) , message , UIManager . getString ( "OptionPane.titleText" ) , JOptionPane . OK_OPTION | JOptionPane . CANCEL_OPTION ) == JOptionPane . OK_OPTION ;
public class AnnotatedHttpServiceTypeUtil { /** * Normalizes the specified container { @ link Class } . Throws { @ link IllegalArgumentException } * if it is not able to be normalized . */ static Class < ? > normalizeContainerType ( Class < ? > containerType ) { } }
if ( containerType == Iterable . class || containerType == List . class || containerType == Collection . class ) { return ArrayList . class ; } if ( containerType == Set . class ) { return LinkedHashSet . class ; } if ( List . class . isAssignableFrom ( containerType ) || Set . class . isAssignableFrom ( containerType ) ) { try { // Only if there is a default constructor . containerType . getConstructor ( ) ; return containerType ; } catch ( Throwable cause ) { throw new IllegalArgumentException ( "Unsupported container type: " + containerType . getName ( ) , cause ) ; } } throw new IllegalArgumentException ( "Unsupported container type: " + containerType . getName ( ) ) ;
public class GeneralSettingsPanel { /** * http : / / stackoverflow . com / questions / 252893 / how - do - you - change - the - classpath - within - java */ @ SuppressWarnings ( "unchecked" ) private void addURL ( URL url ) throws Exception { } }
URLClassLoader classLoader = ( URLClassLoader ) ClassLoader . getSystemClassLoader ( ) ; Class clazz = URLClassLoader . class ; Method method = clazz . getDeclaredMethod ( "addURL" , new Class [ ] { URL . class } ) ; method . setAccessible ( true ) ; method . invoke ( classLoader , new Object [ ] { url } ) ;
public class NavMesh { /** * Find the space at a given location * @ param x The x coordinate at which to find the space * @ param y The y coordinate at which to find the space * @ return The space at the given location */ public Space findSpace ( float x , float y ) { } }
for ( int i = 0 ; i < spaces . size ( ) ; i ++ ) { Space space = getSpace ( i ) ; if ( space . contains ( x , y ) ) { return space ; } } return null ;
public class FileUtils { /** * SD is available . * @ return true , otherwise is false . */ public static boolean storageAvailable ( ) { } }
if ( Environment . getExternalStorageState ( ) . equals ( Environment . MEDIA_MOUNTED ) ) { File sd = new File ( Environment . getExternalStorageDirectory ( ) . getAbsolutePath ( ) ) ; return sd . canWrite ( ) ; } else { return false ; }
public class Less { /** * Compile the less data from a string . * @ param baseURL * the baseURL for import of external less data . * @ param lessData * the input less data * @ param compress * true , if the CSS data should be compressed without any extra formating characters . * @ return the resulting less data * @ throws LessException * if any error occur on compiling . */ public static String compile ( URL baseURL , String lessData , boolean compress ) throws LessException { } }
return compile ( baseURL , lessData , compress , new ReaderFactory ( ) ) ;
public class ListMultipartUploadsResult { /** * A list of in - progress multipart uploads . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUploadsList ( java . util . Collection ) } or { @ link # withUploadsList ( java . util . Collection ) } if you want to * override the existing values . * @ param uploadsList * A list of in - progress multipart uploads . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListMultipartUploadsResult withUploadsList ( UploadListElement ... uploadsList ) { } }
if ( this . uploadsList == null ) { setUploadsList ( new java . util . ArrayList < UploadListElement > ( uploadsList . length ) ) ; } for ( UploadListElement ele : uploadsList ) { this . uploadsList . add ( ele ) ; } return this ;
public class LabeledPoint { /** * get the value of that named property */ @ Override public Object getMember ( String name ) { } }
switch ( name ) { case "getFeatures" : return F_getFeatures ; case "getLabel" : return F_getLabel ; case "parse" : return F_parse ; } return super . getMember ( name ) ;
public class BeanPropertyMap { /** * Returns the property value specified by ' key ' within this map . */ public Object getProperty ( PropertyKey key ) { } }
if ( ! isValidKey ( key ) ) throw new IllegalArgumentException ( "Key " + key + " is not valid for " + getMapClass ( ) ) ; // Check local properties first if ( _properties . containsKey ( key ) ) return _properties . get ( key ) ; // Return the value of the annotation type instance ( if any ) if ( _annot != null ) return key . extractValue ( _annot ) ; // Call up to superclass , for delegation model / default value return super . getProperty ( key ) ;
public class SQLDatabaseFactory { /** * Open or create a database file , and return a connection to it , optionally backed by a * SQLCipher enabled database . * If the database file does not exist , it will be created , and any intermediate directories * will be created as necessary . * @ param dbFile full file path of the db file * @ param provider Key provider object storing the SQLCipher key * Supply a NullKeyProvider to use a non - encrypted database . * @ return { @ code SQLDatabase } for the given filename * @ throws IOException if the file cannot be opened , or the database files or its intermediate * directories cannot be created . * @ throws SQLException if the database cannot be opened . */ public static SQLDatabase openSQLDatabase ( File dbFile , KeyProvider provider ) throws IOException , SQLException { } }
Misc . checkNotNull ( dbFile , "dbFile" ) ; File dbDirectory = dbFile . getParentFile ( ) ; if ( ! dbDirectory . mkdirs ( ) ) { logger . info ( String . format ( Locale . ENGLISH , "Did not create directories for path: %s directories may already exist" , dbFile ) ) ; } Misc . checkArgument ( dbDirectory . isDirectory ( ) , "Input path is not a valid directory" ) ; Misc . checkArgument ( dbDirectory . canWrite ( ) , "Datastore directory is not writable" ) ; return internalOpenSQLDatabase ( dbFile , provider ) ;
public class MapConverter { /** * getFloat . * @ param data a { @ link java . util . Map } object . * @ param name a { @ link java . lang . String } object . * @ return a { @ link java . lang . Float } object . */ public Float getFloat ( Map < String , Object > data , String name ) { } }
return get ( data , name , Float . class ) ;
public class CSLTool { /** * Sets the name of the output file * @ param outputFile the file name or null if output should be written * to standard out */ @ OptionDesc ( longName = "output" , shortName = "o" , description = "write output to FILE instead of stdout" , argumentName = "FILE" , argumentType = ArgumentType . STRING ) public void setOutputFile ( String outputFile ) { } }
this . outputFile = outputFile ;
public class SolarTime { /** * / * [ deutsch ] * < p > Berechnet den Moment der h & ouml ; chsten Position der Sonne an der Position dieser Instanz . < / p > * < p > Hinweis : Die Transit - Zeit besagt nicht , ob die Sonne & uuml ; ber oder unter dem Horizont ist . < / p > * @ return noon function applicable on any calendar date * @ since 3.34/4.29 */ public ChronoFunction < CalendarDate , Moment > transitAtNoon ( ) { } }
return date -> transitAtNoon ( toLMT ( date ) , this . longitude , this . calculator ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcCoolingTowerType ( ) { } }
if ( ifcCoolingTowerTypeEClass == null ) { ifcCoolingTowerTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 146 ) ; } return ifcCoolingTowerTypeEClass ;
public class DefaultJobLifecycleListenerImpl { /** * { @ inheritDoc } */ @ Override public void onStatusChange ( JobExecutionState state , RunningState previousStatus , RunningState newStatus ) { } }
if ( _log . isPresent ( ) ) { _log . get ( ) . info ( "JobExection status change for " + state . getJobSpec ( ) . toShortString ( ) + ": " + previousStatus + " --> " + newStatus ) ; }
public class ScreenField { /** * Output this screen using HTML . * @ exception DBException File exception . */ public void printScreenFieldData ( ScreenField sField , PrintWriter out , int iPrintOptions ) { } }
this . getScreenFieldView ( ) . printScreenFieldData ( sField , out , iPrintOptions ) ;
public class QrcodeAPI { /** * 创建二维码 * @ param actionName 二维码类型 , QR _ SCENE为临时 , QR _ LIMIT _ SCENE为永久 * @ param sceneId 场景值ID , 临时二维码时为32位非0整型 , 永久二维码时最大值为100000 ( 目前参数只支持1 - - 100000) * @ param sceneStr 场景值ID ( 字符串形式的ID ) , 字符串类型 , 长度限制为1到64 , 仅永久二维码支持此字段 * @ param expireSeconds 该二维码有效时间 , 以秒为单位 。 最大不超过2592000 ( 即30天 ) , 此字段如果不填 , 则默认有效期为30秒 * @ return 二维码对象 */ public QrcodeResponse createQrcode ( QrcodeType actionName , String sceneId , String sceneStr , Integer expireSeconds ) { } }
BeanUtil . requireNonNull ( actionName , "actionName is null" ) ; BeanUtil . requireNonNull ( sceneId , "actionInfo is null" ) ; LOG . debug ( "创建二维码信息....." ) ; QrcodeResponse response = null ; String url = BASE_API_URL + "cgi-bin/qrcode/create?access_token=#" ; Map < String , Object > param = new HashMap < String , Object > ( ) ; param . put ( "action_name" , actionName ) ; Map < String , Object > actionInfo = new HashMap < String , Object > ( ) ; Map < String , Object > scene = new HashMap < String , Object > ( ) ; if ( StrUtil . isNotBlank ( sceneId ) ) scene . put ( "scene_id" , sceneId ) ; if ( StrUtil . isNotBlank ( sceneStr ) ) scene . put ( "scene_str" , sceneStr ) ; actionInfo . put ( "scene" , scene ) ; param . put ( "action_info" , actionInfo ) ; if ( BeanUtil . nonNull ( expireSeconds ) && 0 != expireSeconds ) { param . put ( "expire_seconds" , expireSeconds ) ; } BaseResponse r = executePost ( url , JSONUtil . toJson ( param ) ) ; String resultJson = isSuccess ( r . getErrcode ( ) ) ? r . getErrmsg ( ) : r . toJsonString ( ) ; response = JSONUtil . toBean ( resultJson , QrcodeResponse . class ) ; return response ;
public class CommonsMultipartFileParameter { /** * Save an uploaded file as a given destination file . * @ param destFile the destination file * @ param overwrite whether to overwrite if it already exists * @ return a saved file * @ throws IOException if an I / O error has occurred */ @ Override public File saveAs ( File destFile , boolean overwrite ) throws IOException { } }
if ( destFile == null ) { throw new IllegalArgumentException ( "destFile can not be null" ) ; } validateFile ( ) ; try { destFile = determineDestinationFile ( destFile , overwrite ) ; fileItem . write ( destFile ) ; } catch ( FileUploadException e ) { throw new IllegalStateException ( e . getMessage ( ) ) ; } catch ( Exception e ) { throw new IOException ( "Could not save as file " + destFile , e ) ; } setSavedFile ( destFile ) ; return destFile ;
public class VimGenerator2 { /** * Generate the Vim strings of characters . * @ param it the receiver of the generated elements . */ protected void generateStrings ( IStyleAppendable it ) { } }
appendComment ( it , "Strings constants" ) ; // $ NON - NLS - 1 $ appendMatch ( it , "sarlSpecialError" , "\\\\." , true ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ appendMatch ( it , "sarlSpecialCharError" , "[^']" , true ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ appendMatch ( it , "sarlSpecialChar" , "\\\\\\([4-9]\\d\\|[0-3]\\d\\d\\|[\"\\\\'ntbrf]\\|u\\x\\{4\\}\\)" , true ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ appendRegion ( it , true , "sarlString" , "\"" , "\"" , // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ / / $ NON - NLS - 3 $ "sarlSpecialChar" , "sarlSpecialError" , "@Spell" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ / / $ NON - NLS - 3 $ appendRegion ( it , true , "sarlString" , "'" , "'" , // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ / / $ NON - NLS - 3 $ "sarlSpecialChar" , "sarlSpecialError" , "@Spell" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ / / $ NON - NLS - 3 $ appendCluster ( it , "sarlString" ) ; // $ NON - NLS - 1 $ hilight ( "sarlString" , VimSyntaxGroup . CONSTANT ) ; // $ NON - NLS - 1 $ it . newLine ( ) ;
public class ClassUtility { /** * Extract the searched type from a ParamterizedType . * @ param superType the base class hosting the generic type * @ param typeSearched the searched type , the returned class shall be a subclass of it * @ return the searched type or null */ private static Class < ? > searchIntoParameterzedType ( final Type superType , final Class < ? > typeSearched ) { } }
if ( superType instanceof ParameterizedType ) { for ( final Type genericType : ( ( ParameterizedType ) superType ) . getActualTypeArguments ( ) ) { if ( genericType instanceof Class < ? > && typeSearched . isAssignableFrom ( ( Class < ? > ) genericType ) ) { return ( Class < ? > ) genericType ; } else if ( genericType instanceof ParameterizedType && typeSearched . isAssignableFrom ( ( Class < ? > ) ( ( ParameterizedType ) genericType ) . getRawType ( ) ) ) { return ( Class < ? > ) ( ( ParameterizedType ) genericType ) . getRawType ( ) ; } } } return null ;
public class Choice8 { /** * { @ inheritDoc } */ @ Override public < I > Choice8 < A , B , C , D , E , F , G , I > fmap ( Function < ? super H , ? extends I > fn ) { } }
return Monad . super . < I > fmap ( fn ) . coerce ( ) ;
public class AGNES { /** * Update the scratch distance matrix . * @ param end Active set size * @ param mat Matrix view * @ param builder Hierarchy builder ( to get cluster sizes ) * @ param mindist Distance that was used for merging * @ param x First matrix position * @ param y Second matrix position * @ param sizex Old size of first cluster * @ param sizey Old size of second cluster */ protected void updateMatrix ( int end , MatrixParadigm mat , PointerHierarchyRepresentationBuilder builder , double mindist , int x , int y , final int sizex , final int sizey ) { } }
// Update distance matrix . Note : y < x final int xbase = MatrixParadigm . triangleSize ( x ) ; final int ybase = MatrixParadigm . triangleSize ( y ) ; double [ ] scratch = mat . matrix ; DBIDArrayIter ij = mat . ix ; // Write to ( y , j ) , with j < y int j = 0 ; for ( ; j < y ; j ++ ) { if ( builder . isLinked ( ij . seek ( j ) ) ) { continue ; } assert ( j < y ) ; // Otherwise , ybase + j is the wrong position ! final int yb = ybase + j ; scratch [ yb ] = linkage . combine ( sizex , scratch [ xbase + j ] , sizey , scratch [ yb ] , builder . getSize ( ij ) , mindist ) ; } j ++ ; // Skip y // Write to ( j , y ) , with y < j < x int jbase = MatrixParadigm . triangleSize ( j ) ; for ( ; j < x ; jbase += j ++ ) { if ( builder . isLinked ( ij . seek ( j ) ) ) { continue ; } final int jb = jbase + y ; scratch [ jb ] = linkage . combine ( sizex , scratch [ xbase + j ] , sizey , scratch [ jb ] , builder . getSize ( ij ) , mindist ) ; } jbase += j ++ ; // Skip x // Write to ( j , y ) , with y < x < j for ( ; j < end ; jbase += j ++ ) { if ( builder . isLinked ( ij . seek ( j ) ) ) { continue ; } final int jb = jbase + y ; scratch [ jb ] = linkage . combine ( sizex , scratch [ jbase + x ] , sizey , scratch [ jb ] , builder . getSize ( ij ) , mindist ) ; }
public class FutureImpl { /** * The get ( ) method throws this exception wrapped as the cause of an ExecutionException . < br > * Multiple calls are ignored . < br > * Calls after cancel are ignored . * @ param e Exception */ public void set ( final Exception e ) { } }
if ( this . value . compareAndSet ( null , e ) ) { this . listeners . clear ( ) ; this . cdl . countDown ( ) ; }
public class RESTAssert { /** * assert that string matches [ + - ] ? [ 0-9 ] * * @ param string the string to check * @ param status the status code to throw * @ throws WebApplicationException with given status code */ public static void assertInt ( final String string , final StatusType status ) { } }
RESTAssert . assertNotEmpty ( string ) ; RESTAssert . assertPattern ( string , "[+-]?[0-9]*" , status ) ;
public class WDataTable { /** * For rendering purposes only - has no effect on model . * @ param index the sort column index , or - 1 for no sort . * @ param ascending true for ascending order , false for descending */ protected void setSort ( final int index , final boolean ascending ) { } }
TableModel model = getOrCreateComponentModel ( ) ; model . sortColIndex = index ; model . sortAscending = ascending ;
public class Instrumented { /** * Returns a { @ link com . codahale . metrics . Timer . Context } only if { @ link org . apache . gobblin . metrics . MetricContext } is defined . * @ param context an Optional & lt ; { @ link org . apache . gobblin . metrics . MetricContext } $ gt ; * @ param name name of the timer . * @ return an Optional & lt ; { @ link com . codahale . metrics . Timer . Context } $ gt ; */ public static Optional < Timer . Context > timerContext ( Optional < MetricContext > context , final String name ) { } }
return context . transform ( new Function < MetricContext , Timer . Context > ( ) { @ Override public Timer . Context apply ( @ Nonnull MetricContext input ) { return input . timer ( name ) . time ( ) ; } } ) ;
public class CmsLoginController { /** * Returns the link to the login form . < p > * @ param cms the current cms context * @ return the login form link */ public static String getFormLink ( CmsObject cms ) { } }
return OpenCms . getLinkManager ( ) . substituteLinkForUnknownTarget ( cms , CmsWorkplaceLoginHandler . LOGIN_HANDLER , false ) ;
public class CouchDBUtils { /** * Gets the context . * @ param httpHost * the http host * @ return the context */ public static HttpContext getContext ( HttpHost httpHost ) { } }
AuthCache authCache = new BasicAuthCache ( ) ; authCache . put ( httpHost , new BasicScheme ( ) ) ; HttpContext context = new BasicHttpContext ( ) ; context . setAttribute ( ClientContext . AUTH_CACHE , authCache ) ; return context ;
public class ContextUtils { /** * Get the { @ link android . media . MediaRouter } service for this context . * @ param context the context . * @ return the { @ link android . media . MediaRouter } */ @ TargetApi ( Build . VERSION_CODES . JELLY_BEAN ) public static MediaRouter getMediaRouter ( Context context ) { } }
return ( MediaRouter ) context . getSystemService ( Context . MEDIA_ROUTER_SERVICE ) ;
public class LongHashPartition { /** * Update the address in array for given key . */ private void updateIndex ( long key , int hashCode , long address , int size , MemorySegment dataSegment , int currentPositionInSegment ) throws IOException { } }
assert ( numKeys <= numBuckets / 2 ) ; int bucketId = hashCode & numBucketsMask ; // each bucket occupied 16 bytes ( long key + long pointer to data address ) int bucketOffset = bucketId * SPARSE_BUCKET_ELEMENT_SIZE_IN_BYTES ; MemorySegment segment = buckets [ bucketOffset >>> segmentSizeBits ] ; int segOffset = bucketOffset & segmentSizeMask ; long currAddress ; while ( true ) { currAddress = segment . getLong ( segOffset + 8 ) ; if ( segment . getLong ( segOffset ) != key && currAddress != INVALID_ADDRESS ) { // hash conflicts , the bucket is occupied by another key // TODO test Conflict resolution : // now : + 1 + 1 + 1 . . . cache friendly but more conflict , so we set factor to 0.5 // other1 : + 1 + 2 + 3 . . . less conflict , factor can be 0.75 // other2 : Secondary hashCode . . . less and less conflict , but need compute hash again bucketId = ( bucketId + 1 ) & numBucketsMask ; if ( segOffset + SPARSE_BUCKET_ELEMENT_SIZE_IN_BYTES < segmentSize ) { // if the new bucket still in current segment , we only need to update offset // within this segment segOffset += SPARSE_BUCKET_ELEMENT_SIZE_IN_BYTES ; } else { // otherwise , we should re - calculate segment and offset bucketOffset = bucketId * 16 ; segment = buckets [ bucketOffset >>> segmentSizeBits ] ; segOffset = bucketOffset & segmentSizeMask ; } } else { break ; } } if ( currAddress == INVALID_ADDRESS ) { // this is the first value for this key , put the address in array . segment . putLong ( segOffset , key ) ; segment . putLong ( segOffset + 8 , address ) ; numKeys += 1 ; // dataSegment may be null if we only have to rehash bucket area if ( dataSegment != null ) { dataSegment . putLong ( currentPositionInSegment , toAddrAndLen ( INVALID_ADDRESS , size ) ) ; } if ( numKeys * 2 > numBuckets ) { resize ( ) ; } } else { // there are some values for this key , put the address in the front of them . dataSegment . putLong ( currentPositionInSegment , toAddrAndLen ( currAddress , size ) ) ; segment . putLong ( segOffset + 8 , address ) ; }
public class JaxbConfigurationReader { /** * Creates a custom component based on an element which specified just a class name and an optional set of * properties . * @ param < E > * @ param customElementType the JAXB custom element type * @ param expectedClazz an expected class or interface that the component should honor * @ param configuration the DataCleaner configuration ( may be temporary ) in use * @ param initialize whether or not to call any initialize methods on the component ( reference data should not be * initialized , while eg . custom task runners support this . * @ return the custom component */ private < E > E createCustomElement ( final CustomElementType customElementType , final Class < E > expectedClazz , final DataCleanerConfiguration configuration , final boolean initialize ) { } }
final InjectionManager injectionManager = configuration . getEnvironment ( ) . getInjectionManagerFactory ( ) . getInjectionManager ( configuration ) ; return createCustomElementInternal ( customElementType , expectedClazz , injectionManager , initialize ) ;
public class CmsAliasView { /** * Gets the buttons which should be displayed in the button bar of the popup containing this view . < p > * @ return the buttons for the popup button bar */ public List < CmsPushButton > getButtonBar ( ) { } }
List < CmsPushButton > buttons = new ArrayList < CmsPushButton > ( ) ; buttons . add ( m_cancelButton ) ; buttons . add ( m_saveButton ) ; buttons . add ( m_downloadButton ) ; buttons . add ( m_uploadButton ) ; return buttons ;
public class AbstractAttribute { /** * Simple encoding method that returns the text - encoded version of * this attribute with no formatting . * @ return the text - encoded XML */ @ Override public String encode ( ) { } }
ReadableByteArrayOutputStream out = new ReadableByteArrayOutputStream ( ) ; encode ( out ) ; return out . toString ( ) ;
public class PDFDomTree { /** * Creates a new empty HTML document tree . * @ throws ParserConfigurationException */ protected void createDocument ( ) throws ParserConfigurationException { } }
DocumentBuilderFactory builderFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder = builderFactory . newDocumentBuilder ( ) ; DocumentType doctype = builder . getDOMImplementation ( ) . createDocumentType ( "html" , "-//W3C//DTD XHTML 1.1//EN" , "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ) ; doc = builder . getDOMImplementation ( ) . createDocument ( "http://www.w3.org/1999/xhtml" , "html" , doctype ) ; head = doc . createElement ( "head" ) ; Element meta = doc . createElement ( "meta" ) ; meta . setAttribute ( "http-equiv" , "content-type" ) ; meta . setAttribute ( "content" , "text/html;charset=utf-8" ) ; head . appendChild ( meta ) ; title = doc . createElement ( "title" ) ; title . setTextContent ( "PDF Document" ) ; head . appendChild ( title ) ; globalStyle = doc . createElement ( "style" ) ; globalStyle . setAttribute ( "type" , "text/css" ) ; // globalStyle . setTextContent ( createGlobalStyle ( ) ) ; head . appendChild ( globalStyle ) ; body = doc . createElement ( "body" ) ; Element root = doc . getDocumentElement ( ) ; root . appendChild ( head ) ; root . appendChild ( body ) ;
public class FbBot { /** * This method will be invoked after { @ link FbBot # askTimeForMeeting ( Event ) } . You can * call { @ link Bot # stopConversation ( Event ) } to end the conversation . * @ param event */ @ Controller public void askWhetherToRepeat ( Event event ) { } }
if ( event . getMessage ( ) . getText ( ) . contains ( "yes" ) ) { reply ( event , "Great! I will remind you tomorrow before the meeting." ) ; } else { reply ( event , "Okay, don't forget to attend the meeting tomorrow :)" ) ; } stopConversation ( event ) ; // stop conversation
public class ProductBackendApiDecorator { /** * Get a list with all categories */ public Observable < List < String > > getAllCategories ( ) { } }
return getAllProducts ( ) . map ( products -> { Set < String > categories = new HashSet < String > ( ) ; for ( Product p : products ) { categories . add ( p . getCategory ( ) ) ; } List < String > result = new ArrayList < String > ( categories . size ( ) ) ; result . addAll ( categories ) ; return result ; } ) ;
public class JQMFlip { /** * Sets the currently selected value . * @ param fireEvents - if false then ValueChangeEvent won ' t be raised ( though ChangeEvent will be raised anyway ) . */ @ Override public void setValue ( String value , boolean fireEvents ) { } }
int newIdx = value == null ? 0 : value . equals ( getValue1 ( ) ) ? 0 : value . equals ( getValue2 ( ) ) ? 1 : 0 ; int oldIdx = getSelectedIndex ( ) ; String oldVal = fireEvents ? getValue ( ) : null ; internVal = value ; if ( oldIdx != newIdx ) { inSetValue = true ; try { setSelectedIndex ( newIdx ) ; } finally { inSetValue = false ; } } if ( fireEvents ) { boolean eq = internVal == oldVal || internVal != null && internVal . equals ( oldVal ) ; if ( ! eq ) ValueChangeEvent . fire ( this , internVal ) ; }
public class RandomGenerator { /** * Randomly chooses four atoms and alters the bonding * pattern between them according to rules described * in " Faulon , JCICS 1996 , 36 , 731 " . */ public void mutate ( IAtomContainer ac ) { } }
logger . debug ( "RandomGenerator->mutate() Start" ) ; int nrOfAtoms = ac . getAtomCount ( ) ; int x1 = 0 , x2 = 0 , y1 = 0 , y2 = 0 ; double a11 = 0 , a12 = 0 , a22 = 0 , a21 = 0 ; double b11 = 0 , lowerborder = 0 , upperborder = 0 ; IAtom ax1 = null , ax2 = null , ay1 = null , ay2 = null ; IBond b1 = null , b2 = null , b3 = null , b4 = null ; int [ ] choices = new int [ 3 ] ; int choiceCounter = 0 ; /* We need at least two non - zero bonds in order to be successful */ int nonZeroBondsCounter = 0 ; do { do { nonZeroBondsCounter = 0 ; /* Randomly choose four distinct atoms */ do { // this yields numbers between 0 and ( nrOfAtoms - 1) x1 = ( int ) ( Math . random ( ) * nrOfAtoms ) ; x2 = ( int ) ( Math . random ( ) * nrOfAtoms ) ; y1 = ( int ) ( Math . random ( ) * nrOfAtoms ) ; y2 = ( int ) ( Math . random ( ) * nrOfAtoms ) ; logger . debug ( "RandomGenerator->mutate(): x1, x2, y1, y2: " + x1 + ", " + x2 + ", " + y1 + ", " + y2 ) ; } while ( ! ( x1 != x2 && x1 != y1 && x1 != y2 && x2 != y1 && x2 != y2 && y1 != y2 ) ) ; ax1 = ac . getAtom ( x1 ) ; ay1 = ac . getAtom ( y1 ) ; ax2 = ac . getAtom ( x2 ) ; ay2 = ac . getAtom ( y2 ) ; /* Get four bonds for these four atoms */ b1 = ac . getBond ( ax1 , ay1 ) ; if ( b1 != null ) { a11 = BondManipulator . destroyBondOrder ( b1 . getOrder ( ) ) ; nonZeroBondsCounter ++ ; } else { a11 = 0 ; } b2 = ac . getBond ( ax1 , ay2 ) ; if ( b2 != null ) { a12 = BondManipulator . destroyBondOrder ( b2 . getOrder ( ) ) ; nonZeroBondsCounter ++ ; } else { a12 = 0 ; } b3 = ac . getBond ( ax2 , ay1 ) ; if ( b3 != null ) { a21 = BondManipulator . destroyBondOrder ( b3 . getOrder ( ) ) ; nonZeroBondsCounter ++ ; } else { a21 = 0 ; } b4 = ac . getBond ( ax2 , ay2 ) ; if ( b4 != null ) { a22 = BondManipulator . destroyBondOrder ( b4 . getOrder ( ) ) ; nonZeroBondsCounter ++ ; } else { a22 = 0 ; } logger . debug ( "RandomGenerator->mutate()->The old bond orders: a11, a12, a21, a22: " + + a11 + ", " + a12 + ", " + a21 + ", " + a22 ) ; } while ( nonZeroBondsCounter < 2 ) ; /* Compute the range for b11 ( see Faulons formulae for details ) */ double [ ] cmax = { 0 , a11 - a22 , a11 + a12 - 3 , a11 + a21 - 3 } ; double [ ] cmin = { 3 , a11 + a12 , a11 + a21 , a11 - a22 + 3 } ; lowerborder = MathTools . max ( cmax ) ; upperborder = MathTools . min ( cmin ) ; /* Randomly choose b11 ! = a11 in the range max > r > min */ logger . debug ( "*** New Try ***" ) ; logger . debug ( "a11 = " , a11 ) ; logger . debug ( "upperborder = " , upperborder ) ; logger . debug ( "lowerborder = " , lowerborder ) ; choiceCounter = 0 ; for ( double f = lowerborder ; f <= upperborder ; f ++ ) { if ( f != a11 ) { choices [ choiceCounter ] = ( int ) f ; choiceCounter ++ ; } } if ( choiceCounter > 0 ) { b11 = choices [ ( int ) ( Math . random ( ) * choiceCounter ) ] ; } logger . debug ( "b11 = " + b11 ) ; } while ( ! ( b11 != a11 && ( b11 >= lowerborder && b11 <= upperborder ) ) ) ; double b12 = a11 + a12 - b11 ; double b21 = a11 + a21 - b11 ; double b22 = a22 - a11 + b11 ; if ( b11 > 0 ) { if ( b1 == null ) { b1 = ac . getBuilder ( ) . newInstance ( IBond . class , ax1 , ay1 , BondManipulator . createBondOrder ( b11 ) ) ; ac . addBond ( b1 ) ; } else { b1 . setOrder ( BondManipulator . createBondOrder ( b11 ) ) ; } } else if ( b1 != null ) { ac . removeBond ( b1 ) ; } if ( b12 > 0 ) { if ( b2 == null ) { b2 = ac . getBuilder ( ) . newInstance ( IBond . class , ax1 , ay2 , BondManipulator . createBondOrder ( b12 ) ) ; ac . addBond ( b2 ) ; } else { b2 . setOrder ( BondManipulator . createBondOrder ( b12 ) ) ; } } else if ( b2 != null ) { ac . removeBond ( b2 ) ; } if ( b21 > 0 ) { if ( b3 == null ) { b3 = ac . getBuilder ( ) . newInstance ( IBond . class , ax2 , ay1 , BondManipulator . createBondOrder ( b21 ) ) ; ac . addBond ( b3 ) ; } else { b3 . setOrder ( BondManipulator . createBondOrder ( b21 ) ) ; } } else if ( b3 != null ) { ac . removeBond ( b3 ) ; } if ( b22 > 0 ) { if ( b4 == null ) { b4 = ac . getBuilder ( ) . newInstance ( IBond . class , ax2 , ay2 , BondManipulator . createBondOrder ( b22 ) ) ; ac . addBond ( b4 ) ; } else { b4 . setOrder ( BondManipulator . createBondOrder ( b22 ) ) ; } } else if ( b4 != null ) { ac . removeBond ( b4 ) ; } logger . debug ( "a11 a12 a21 a22: " + a11 + " " + a12 + " " + a21 + " " + a22 ) ; logger . debug ( "b11 b12 b21 b22: " + b11 + " " + b12 + " " + b21 + " " + b22 ) ;
public class DetailView { /** * Trigger a refresh . */ private void lazyRefresh ( ) { } }
Runnable pr = new Runnable ( ) { @ Override public void run ( ) { if ( pendingRefresh . compareAndSet ( this , null ) ) { refresh ( ) ; } } } ; pendingRefresh . set ( pr ) ; scheduleUpdate ( pr ) ;
public class CreateDocsMojo { /** * Create Excel documentation in interactive mode . * @ throws PrompterException */ private void createExcelDoc ( ) throws PrompterException { } }
ExcelDocConfiguration configuration = new ExcelDocConfiguration ( ) ; String company = prompter . prompt ( "Enter company:" , configuration . getCompany ( ) ) ; String author = prompter . prompt ( "Enter author:" , configuration . getAuthor ( ) ) ; String pageTitle = prompter . prompt ( "Enter page title:" , configuration . getPageTitle ( ) ) ; String outputFile = prompter . prompt ( "Enter output file name:" , configuration . getOutputFile ( ) ) ; String headers = prompter . prompt ( "Enter custom headers:" , configuration . getHeaders ( ) ) ; String confirm = prompter . prompt ( "Confirm Excel documentation: outputFile='target/" + outputFile + ( outputFile . endsWith ( ".xls" ) ? "" : ".xls" ) + "'\n" , Arrays . asList ( "y" , "n" ) , "y" ) ; if ( confirm . equalsIgnoreCase ( "n" ) ) { return ; } ExcelTestDocsGenerator generator = getExcelTestDocsGenerator ( ) ; generator . withOutputFile ( outputFile + ( outputFile . endsWith ( ".xls" ) ? "" : ".xls" ) ) . withPageTitle ( pageTitle ) . withAuthor ( author ) . withCompany ( company ) . useSrcDirectory ( getTestSrcDirectory ( ) ) . withCustomHeaders ( headers ) ; generator . generateDoc ( ) ; getLog ( ) . info ( "Successfully created Excel documentation: outputFile='target/" + outputFile + ( outputFile . endsWith ( ".xls" ) ? "" : ".xls" ) + "'" ) ;
public class JsonWriter { /** * Encodes { @ code value } . * @ return this writer . */ public JsonWriter value ( Boolean value ) throws IOException { } }
if ( value == null ) { return nullValue ( ) ; } writeDeferredName ( ) ; beforeValue ( ) ; out . write ( value ? "true" : "false" ) ; return this ;
public class MultiVertexGeometryImpl { /** * Checked vs . Jan 11 , 2011 */ @ Override public Point3D getXYZ ( int index ) { } }
if ( index < 0 || index >= getPointCount ( ) ) throw new IndexOutOfBoundsException ( ) ; _verifyAllStreams ( ) ; AttributeStreamOfDbl v = ( AttributeStreamOfDbl ) m_vertexAttributes [ 0 ] ; Point3D pt = new Point3D ( ) ; pt . x = v . read ( index * 2 ) ; pt . y = v . read ( index * 2 + 1 ) ; // TODO check excluded if statement componenet if ( hasAttribute ( Semantics . Z ) ) // & & ( m _ vertexAttributes [ 1 ] ! = null ) ) pt . z = m_vertexAttributes [ 1 ] . readAsDbl ( index ) ; else pt . z = VertexDescription . getDefaultValue ( Semantics . Z ) ; return pt ;
public class MeasureFactory { /** * Create a { @ link PullMeasure } to backup the last { @ link Value } of a * { @ link PushMeasure } . When the { @ link PushMeasure } send a notification * with a given { @ link Value } , this { @ link Value } is stored into a variable * so that it can be retrieved at any time through the method * { @ link PullMeasure # get ( ) } . * @ param push * a { @ link PushMeasure } to backup * @ param initialValue * the { @ link Value } to return before the next notification of * the { @ link PushMeasure } is sent * @ return a { @ link PullMeasure } allowing to retrieve the last value sent by * the { @ link PushMeasure } , or the initial value if it did not send * any */ @ SuppressWarnings ( "serial" ) public < Value > PullMeasure < Value > createPullFromPush ( final PushMeasure < Value > push , Value initialValue ) { } }
final Object [ ] cache = { initialValue } ; final MeasureListener < Value > listener = new MeasureListener < Value > ( ) { @ Override public void measureGenerated ( Value value ) { cache [ 0 ] = value ; } } ; push . register ( listener ) ; return new PullMeasure < Value > ( ) { @ Override public String getName ( ) { return push . getName ( ) ; } @ Override public String getDescription ( ) { return push . getDescription ( ) ; } @ SuppressWarnings ( "unchecked" ) @ Override public Value get ( ) { return ( Value ) cache [ 0 ] ; } @ Override protected void finalize ( ) throws Throwable { push . unregister ( listener ) ; super . finalize ( ) ; } } ;
public class DefineClassUtils { /** * " Compile " a MethodHandle that is equivalent to the following closure : * Class < ? > defineClass ( Class targetClass , String className , byte [ ] byteCode ) { * MethodHandles . Lookup targetClassLookup = MethodHandles . privateLookupIn ( targetClass , lookup ) ; * return targetClassLookup . defineClass ( byteCode ) ; */ private static MethodHandle defineClassJava9 ( MethodHandles . Lookup lookup ) throws ReflectiveOperationException { } }
// this is getting meta MethodHandle defineClass = lookup . unreflect ( MethodHandles . Lookup . class . getMethod ( "defineClass" , byte [ ] . class ) ) ; MethodHandle privateLookupIn = lookup . findStatic ( MethodHandles . class , "privateLookupIn" , MethodType . methodType ( MethodHandles . Lookup . class , Class . class , MethodHandles . Lookup . class ) ) ; // bind privateLookupIn lookup argument to this method ' s lookup // privateLookupIn = ( Class targetClass ) - > privateLookupIn ( MethodHandles . privateLookupIn ( targetClass , lookup ) ) privateLookupIn = MethodHandles . insertArguments ( privateLookupIn , 1 , lookup ) ; // defineClass = ( Class targetClass , byte [ ] byteCode ) - > privateLookupIn ( targetClass ) . defineClass ( byteCode ) defineClass = MethodHandles . filterArguments ( defineClass , 0 , privateLookupIn ) ; // add a dummy String argument to match the corresponding JDK8 version // defineClass = ( Class targetClass , byte [ ] byteCode , String className ) - > defineClass ( targetClass , byteCode ) defineClass = MethodHandles . dropArguments ( defineClass , 2 , String . class ) ; return defineClass ;
public class DFSClient { /** * Get file info : decide which rpc to call based on protocol version */ private FileStatus versionBasedGetFileInfo ( String src ) throws IOException { } }
if ( namenodeVersion >= ClientProtocol . OPTIMIZE_FILE_STATUS_VERSION ) { return HdfsFileStatus . toFileStatus ( namenode . getHdfsFileInfo ( src ) , src ) ; } else { return namenode . getFileInfo ( src ) ; }
public class AmazonCloudFormationClient { /** * Returns information about a stack drift detection operation . A stack drift detection operation detects whether a * stack ' s actual configuration differs , or has < i > drifted < / i > , from it ' s expected configuration , as defined in the * stack template and any values specified as template parameters . A stack is considered to have drifted if one or * more of its resources have drifted . For more information on stack and resource drift , see < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / using - cfn - stack - drift . html " > Detecting * Unregulated Configuration Changes to Stacks and Resources < / a > . * Use < a > DetectStackDrift < / a > to initiate a stack drift detection operation . < code > DetectStackDrift < / code > returns * a < code > StackDriftDetectionId < / code > you can use to monitor the progress of the operation using * < code > DescribeStackDriftDetectionStatus < / code > . Once the drift detection operation has completed , use * < a > DescribeStackResourceDrifts < / a > to return drift information about the stack and its resources . * @ param describeStackDriftDetectionStatusRequest * @ return Result of the DescribeStackDriftDetectionStatus operation returned by the service . * @ sample AmazonCloudFormation . DescribeStackDriftDetectionStatus * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cloudformation - 2010-05-15 / DescribeStackDriftDetectionStatus " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DescribeStackDriftDetectionStatusResult describeStackDriftDetectionStatus ( DescribeStackDriftDetectionStatusRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeStackDriftDetectionStatus ( request ) ;
public class Guid { /** * Combine multiple { @ link Guid } s into a single { @ link Guid } . * @ throws IOException */ public static Guid combine ( Guid ... guids ) throws IOException { } }
byte [ ] [ ] byteArrays = new byte [ guids . length ] [ ] ; for ( int i = 0 ; i < guids . length ; i ++ ) { byteArrays [ i ] = guids [ i ] . sha ; } return fromByteArrays ( byteArrays ) ;
public class CmsVfsService { /** * Processes a file path , which may have macros in it , so it can be opened by the XML content editor . < p > * @ param cms the current CMS context * @ param res the resource for which the context menu option has been selected * @ param pathWithMacros the file path which may contain macros * @ return the processed file path */ public static String prepareFileNameForEditor ( CmsObject cms , CmsResource res , String pathWithMacros ) { } }
String subsite = OpenCms . getADEManager ( ) . getSubSiteRoot ( cms , res . getRootPath ( ) ) ; CmsMacroResolver resolver = new CmsMacroResolver ( ) ; if ( subsite != null ) { resolver . addMacro ( "subsite" , cms . getRequestContext ( ) . removeSiteRoot ( subsite ) ) ; } resolver . addMacro ( "file" , cms . getSitePath ( res ) ) ; String path = resolver . resolveMacros ( pathWithMacros ) . replaceAll ( "/+" , "/" ) ; return path ;
public class BackendUser { /** * Perform syncronously sign up attempt . * @ param username user name user will be identified by . * @ param email user email address * @ param password user password * @ return login results . */ public static SignUpResponse signUp ( String username , String email , String password ) { } }
return signUp ( new SignUpCredentials ( username , email , password ) ) ;
public class EntityLinkOperation { /** * ( non - Javadoc ) * @ see * com . microsoft . windowsazure . services . media . entities . EntityDeleteOperation * # getUri ( ) */ @ Override public String getUri ( ) { } }
String escapedEntityId ; try { escapedEntityId = URLEncoder . encode ( primaryEntityId , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new InvalidParameterException ( "UTF-8 encoding is not supported." ) ; } return String . format ( "%s('%s')/$links/%s" , primaryEntitySet , escapedEntityId , secondaryEntitySet ) ;
public class BaseBsoneerCodec { /** * { @ inhericDoc } */ @ Override public T decode ( BsonReader reader , DecoderContext decoderContext ) { } }
T instance = instantiate ( ) ; reader . readStartDocument ( ) ; while ( reader . readBsonType ( ) != BsonType . END_OF_DOCUMENT ) { String fieldName = reader . readName ( ) ; BsoneeBaseSetter < T > bsoneeBaseSetter = settersByName . get ( fieldName ) ; if ( bsoneeBaseSetter != null ) { bsoneeBaseSetter . set ( instance , reader , decoderContext ) ; } else { // TODO Check options whether to throw an exception or not . By default we skip it : ) logger . warn ( "No setter for " + fieldName ) ; reader . skipValue ( ) ; } } reader . readEndDocument ( ) ; return instance ;
public class PropertiesUtil { /** * Returns a Collection of all property values that have keys with a certain prefix . * @ param props the Properties to reaqd * @ param prefix the prefix * @ return Collection of all property values with keys with a certain prefix */ public static Collection listPropertiesWithPrefix ( Properties props , String prefix ) { } }
final HashSet set = new HashSet ( ) ; for ( Iterator i = props . keySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { String key = ( String ) i . next ( ) ; if ( key . startsWith ( prefix ) ) { set . add ( props . getProperty ( key ) ) ; } } return set ;
public class RestletUtilMemoryRealm { /** * Maps a group defined in a component to a role defined in the application . * @ param group * The source group . * @ param role * The target role . */ public void map ( final Group group , final Role role ) { } }
this . getRoleMappings ( ) . add ( new RoleMapping ( group , role ) ) ;
public class MultiNormalizerHybrid { /** * Undo ( revert ) the normalization applied by this DataNormalization instance to the entire inputs array * @ param features The normalized array of inputs * @ param maskArrays Optional mask arrays belonging to the inputs */ @ Override public void revertFeatures ( @ NonNull INDArray [ ] features , INDArray [ ] maskArrays ) { } }
for ( int i = 0 ; i < features . length ; i ++ ) { revertFeatures ( features , maskArrays , i ) ; }
public class BranchNode { /** * Returns a list of immediate sub - queries which are part of this query . * @ return List < AbstractParsedStmt > - list of sub - queries from this query */ @ Override public void extractEphemeralTableQueries ( List < StmtEphemeralTableScan > scans ) { } }
if ( m_leftNode != null ) { m_leftNode . extractEphemeralTableQueries ( scans ) ; } if ( m_rightNode != null ) { m_rightNode . extractEphemeralTableQueries ( scans ) ; }
public class TopicsInner { /** * Regenerate key for a topic . * Regenerate a shared access key for a topic . * @ param resourceGroupName The name of the resource group within the user ' s subscription . * @ param topicName Name of the topic * @ param keyName Key name to regenerate key1 or key2 * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the TopicSharedAccessKeysInner object */ public Observable < TopicSharedAccessKeysInner > regenerateKeyAsync ( String resourceGroupName , String topicName , String keyName ) { } }
return regenerateKeyWithServiceResponseAsync ( resourceGroupName , topicName , keyName ) . map ( new Func1 < ServiceResponse < TopicSharedAccessKeysInner > , TopicSharedAccessKeysInner > ( ) { @ Override public TopicSharedAccessKeysInner call ( ServiceResponse < TopicSharedAccessKeysInner > response ) { return response . body ( ) ; } } ) ;
public class CacheUtil { /** * Gets the cache name with prefix but without Hazelcast ' s { @ link javax . cache . CacheManager } * specific prefix { @ link com . hazelcast . cache . HazelcastCacheManager # CACHE _ MANAGER _ PREFIX } . * @ param name the simple name of the cache without any prefix * @ param uri an implementation specific URI for the * Hazelcast ' s { @ link javax . cache . CacheManager } ( null means use * Hazelcast ' s { @ link javax . cache . spi . CachingProvider # getDefaultURI ( ) } ) * @ param classLoader the { @ link ClassLoader } to use for the * Hazelcast ' s { @ link javax . cache . CacheManager } ( null means use * Hazelcast ' s { @ link javax . cache . spi . CachingProvider # getDefaultClassLoader ( ) } ) * @ return the cache name with prefix but without Hazelcast ' s { @ link javax . cache . CacheManager } * specific prefix { @ link com . hazelcast . cache . HazelcastCacheManager # CACHE _ MANAGER _ PREFIX } . */ public static String getPrefixedCacheName ( String name , URI uri , ClassLoader classLoader ) { } }
String cacheNamePrefix = getPrefix ( uri , classLoader ) ; if ( cacheNamePrefix != null ) { return cacheNamePrefix + name ; } else { return name ; }
public class ContainerDefinition { /** * A list of < code > ulimits < / code > to set in the container . This parameter maps to < code > Ulimits < / code > in the < a * href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > section of the * < a href = " https : / / docs . docker . com / engine / api / v1.35 / " > Docker Remote API < / a > and the < code > - - ulimit < / code > option to * < a href = " https : / / docs . docker . com / engine / reference / run / " > docker run < / a > . Valid naming values are displayed in the * < a > Ulimit < / a > data type . This parameter requires version 1.18 of the Docker Remote API or greater on your * container instance . To check the Docker Remote API version on your container instance , log in to your container * instance and run the following command : < code > sudo docker version - - format ' { { . Server . APIVersion } } ' < / code > * < note > * This parameter is not supported for Windows containers . * < / note > * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUlimits ( java . util . Collection ) } or { @ link # withUlimits ( java . util . Collection ) } if you want to override * the existing values . * @ param ulimits * A list of < code > ulimits < / code > to set in the container . This parameter maps to < code > Ulimits < / code > in the * < a href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > * section of the < a href = " https : / / docs . docker . com / engine / api / v1.35 / " > Docker Remote API < / a > and the * < code > - - ulimit < / code > option to < a href = " https : / / docs . docker . com / engine / reference / run / " > docker run < / a > . * Valid naming values are displayed in the < a > Ulimit < / a > data type . This parameter requires version 1.18 of * the Docker Remote API or greater on your container instance . To check the Docker Remote API version on * your container instance , log in to your container instance and run the following command : * < code > sudo docker version - - format ' { { . Server . APIVersion } } ' < / code > < / p > < note > * This parameter is not supported for Windows containers . * @ return Returns a reference to this object so that method calls can be chained together . */ public ContainerDefinition withUlimits ( Ulimit ... ulimits ) { } }
if ( this . ulimits == null ) { setUlimits ( new com . amazonaws . internal . SdkInternalList < Ulimit > ( ulimits . length ) ) ; } for ( Ulimit ele : ulimits ) { this . ulimits . add ( ele ) ; } return this ;
public class DetectCircleGrid { /** * Remove grids which cannot possible match the expected shape */ static void pruneIncorrectShape ( FastQueue < Grid > grids , int numRows , int numCols ) { } }
// prune clusters which can ' t be a member calibration target for ( int i = grids . size ( ) - 1 ; i >= 0 ; i -- ) { Grid g = grids . get ( i ) ; if ( ( g . rows != numRows || g . columns != numCols ) && ( g . rows != numCols || g . columns != numRows ) ) { grids . remove ( i ) ; } }
public class AnimatorModel { /** * Update play mode routine . * @ param extrp The extrapolation value . */ private void updatePlaying ( double extrp ) { } }
current += speed * extrp ; // Last frame reached if ( Double . compare ( current , last + FRAME ) >= 0 ) { // If not reversed , done , else , reverse current = last + HALF_FRAME ; checkStatePlaying ( ) ; }
public class BannedDependencies { /** * { @ inheritDoc } */ protected Set < Artifact > checkDependencies ( Set < Artifact > theDependencies , Log log ) throws EnforcerRuleException { } }
Set < Artifact > excluded = checkDependencies ( theDependencies , excludes ) ; // anything specifically included should be removed // from the ban list . if ( excluded != null ) { Set < Artifact > included = checkDependencies ( theDependencies , includes ) ; if ( included != null ) { excluded . removeAll ( included ) ; } } return excluded ;
public class Router { /** * Specify a middleware that will be called for a matching HTTP GET * @ param regex A regular expression * @ param handlers The middleware to call */ public Router get ( @ NotNull final Pattern regex , @ NotNull final IMiddleware ... handlers ) { } }
addRegEx ( "GET" , regex , handlers , getBindings ) ; return this ;
public class VirtualFileSystem { /** * Touches the specified { @ linkplain File } , i . e . sets its { @ linkplain File # getLastModified ( ) last modified time } to * current time . * @ param txn { @ linkplain Transaction } instance * @ param file { @ linkplain File } instance * @ see # readFile ( Transaction , File ) * @ see # readFile ( Transaction , long ) * @ see # readFile ( Transaction , File , long ) * @ see # writeFile ( Transaction , File ) * @ see # writeFile ( Transaction , long ) * @ see # writeFile ( Transaction , File , long ) * @ see # writeFile ( Transaction , long , long ) * @ see # appendFile ( Transaction , File ) * @ see File # getLastModified ( ) */ public void touchFile ( @ NotNull final Transaction txn , @ NotNull final File file ) { } }
new LastModifiedTrigger ( txn , file , pathnames ) . run ( ) ;
public class TimestampInterval { /** * / * [ deutsch ] * < p > Konvertiert ein beliebiges Intervall zu einem Intervall dieses Typs . < / p > * @ param interval any kind of timestamp interval * @ return TimestampInterval * @ since 3.34/4.29 */ public static TimestampInterval from ( ChronoInterval < PlainTimestamp > interval ) { } }
if ( interval instanceof TimestampInterval ) { return TimestampInterval . class . cast ( interval ) ; } else { return new TimestampInterval ( interval . getStart ( ) , interval . getEnd ( ) ) ; }
public class PKeyArea { /** * Read the record that matches this record ' s temp key area . < p > * WARNING - This method changes the current record ' s buffer . * @ param strSeekSign - Seek sign : < p > * < pre > * " = " - Look for the first match . * " = = " - Look for an exact match ( On non - unique keys , must match primary key also ) . * " > " - Look for the first record greater than this . * " > = " - Look for the first record greater than or equal to this . * " < " - Look for the first record less than or equal to this . * " < = " - Look for the first record less than or equal to this . * < / pre > * returns : success / failure ( true / false ) . * @ param table The basetable . * @ param keyArea The key area . * @ exception DBException File exception . */ public BaseBuffer doSeek ( String strSeekSign , FieldTable table , KeyAreaInfo keyArea ) throws DBException { } }
return null ;
public class CxDxServerSessionImpl { /** * / * ( non - Javadoc ) * @ see org . jdiameter . api . cxdx . ServerCxDxSession # sendMultimediaAuthAnswer ( org . jdiameter . api . cxdx . events . JMultimediaAuthAnswer ) */ @ Override public void sendMultimediaAuthAnswer ( JMultimediaAuthAnswer answer ) throws InternalException , IllegalDiameterStateException , RouteException , OverloadException { } }
send ( Event . Type . SEND_MESSAGE , null , answer ) ;
public class ClassDescriptor { /** * return all AttributeDescriptors for the path < br > * ie : partner . addresses . street returns a Collection of 3 AttributeDescriptors * ( ObjectReferenceDescriptor , CollectionDescriptor , FieldDescriptor ) < br > * ie : partner . addresses returns a Collection of 2 AttributeDescriptors * ( ObjectReferenceDescriptor , CollectionDescriptor ) * @ param aPath the cleaned path to the attribute * @ param pathHints a Map containing the class to be used for a segment or < em > null < / em > * if no segment was used . * @ return ArrayList of AttributeDescriptors */ public ArrayList getAttributeDescriptorsForPath ( String aPath , Map pathHints ) { } }
return getAttributeDescriptorsForCleanPath ( SqlHelper . cleanPath ( aPath ) , pathHints ) ;
public class TimeOfDay { /** * Returns a copy of this time with the specified chronology . * This instance is immutable and unaffected by this method call . * This method retains the values of the fields , thus the result will * typically refer to a different instant . * The time zone of the specified chronology is ignored , as TimeOfDay * operates without a time zone . * @ param newChronology the new chronology , null means ISO * @ return a copy of this datetime with a different chronology * @ throws IllegalArgumentException if the values are invalid for the new chronology */ public TimeOfDay withChronologyRetainFields ( Chronology newChronology ) { } }
newChronology = DateTimeUtils . getChronology ( newChronology ) ; newChronology = newChronology . withUTC ( ) ; if ( newChronology == getChronology ( ) ) { return this ; } else { TimeOfDay newTimeOfDay = new TimeOfDay ( this , newChronology ) ; newChronology . validate ( newTimeOfDay , getValues ( ) ) ; return newTimeOfDay ; }
public class RuleBasedBreakIterator { /** * Dump the contents of the state table and character classes for this break iterator . * For debugging only . * @ deprecated This API is ICU internal only . * @ hide draft / provisional / internal are hidden on Android */ @ Deprecated public void dump ( java . io . PrintStream out ) { } }
if ( out == null ) { out = System . out ; } this . fRData . dump ( out ) ;
public class Setting { /** * 获取并删除键值对 , 当指定键对应值非空时 , 返回并删除这个值 , 后边的键对应的值不再查找 * @ param keys 键列表 , 常用于别名 * @ return 字符串值 * @ since 3.1.2 */ public String getAndRemoveStr ( String ... keys ) { } }
Object value = null ; for ( String key : keys ) { value = remove ( key ) ; if ( null != value ) { break ; } } return ( String ) value ;
public class Volley { /** * Creates a default instance of the worker pool and calls { @ link RequestQueue # start ( ) } on it . * @ param stack An { @ link HttpStack } to use for the network , or null for default . * @ return A started { @ link RequestQueue } instance . */ public static RequestQueue newRequestQueue ( HttpStack stack ) { } }
File cacheDir = new File ( "./" , DEFAULT_CACHE_DIR ) ; String userAgent = "volley/0" ; if ( stack == null ) { stack = new HurlStack ( ) ; } Network network = new BasicNetwork ( stack ) ; RequestQueue queue = new RequestQueue ( new DiskBasedCache ( cacheDir ) , network ) ; queue . start ( ) ; return queue ;
public class JavadocFixTool { /** * Lazily initialize the readme document , reading it from README file inside the jar */ public static void initReadme ( ) { } }
try { InputStream readmeStream = JavadocFixTool . class . getResourceAsStream ( "/README" ) ; if ( readmeStream != null ) { BufferedReader readmeReader = new BufferedReader ( new InputStreamReader ( readmeStream ) ) ; StringBuilder readmeBuilder = new StringBuilder ( ) ; String s ; while ( ( s = readmeReader . readLine ( ) ) != null ) { readmeBuilder . append ( s ) ; readmeBuilder . append ( "\n" ) ; } readme = readmeBuilder . toString ( ) ; } } catch ( IOException ignore ) { } // Ignore exception - readme not initialized
public class VirtualMachineScaleSetsInner { /** * Restarts one or more virtual machines in a VM scale set . * @ param resourceGroupName The name of the resource group . * @ param vmScaleSetName The name of the VM scale set . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the OperationStatusResponseInner object */ public Observable < OperationStatusResponseInner > beginRestartAsync ( String resourceGroupName , String vmScaleSetName ) { } }
return beginRestartWithServiceResponseAsync ( resourceGroupName , vmScaleSetName ) . map ( new Func1 < ServiceResponse < OperationStatusResponseInner > , OperationStatusResponseInner > ( ) { @ Override public OperationStatusResponseInner call ( ServiceResponse < OperationStatusResponseInner > response ) { return response . body ( ) ; } } ) ;
public class TabbedPaneDemo { /** * Sets up a validator for the specified field . * @ param field Field on which a validator should be installed . * @ return Property representing the result of the field validation and that can be used for tab - wise validation . */ private ReadableProperty < Boolean > installFieldValidation ( JTextField field ) { } }
// FieLd is valid if not empty SimpleBooleanProperty fieldResult = new SimpleBooleanProperty ( ) ; on ( new JTextFieldDocumentChangedTrigger ( field ) ) . read ( new JTextFieldTextProvider ( field ) ) . check ( new StringNotEmptyRule ( ) ) . handleWith ( new IconBooleanFeedback ( field ) ) . handleWith ( fieldResult ) . getValidator ( ) . trigger ( ) ; // Tab will be valid only if all fields are valid return fieldResult ;
public class ThreadSafety { /** * Gets the set of in - scope threadsafe type parameters from the containerOf specs on annotations . * < p > Usually only the immediately enclosing declaration is searched , but it ' s possible to have * cases like : * < pre > * { @ literal @ } MarkerAnnotation ( containerOf = " T " ) class C & lt ; T & gt ; { * class Inner extends ThreadSafeCollection & lt ; T & gt ; { } * < / pre > */ public Set < String > threadSafeTypeParametersInScope ( Symbol sym ) { } }
if ( sym == null ) { return ImmutableSet . of ( ) ; } ImmutableSet . Builder < String > result = ImmutableSet . builder ( ) ; OUTER : for ( Symbol s = sym ; s . owner != null ; s = s . owner ) { switch ( s . getKind ( ) ) { case INSTANCE_INIT : continue ; case PACKAGE : break OUTER ; default : break ; } AnnotationInfo annotation = getMarkerOrAcceptedAnnotation ( s , state ) ; if ( annotation == null ) { continue ; } for ( TypeVariableSymbol typaram : s . getTypeParameters ( ) ) { String name = typaram . getSimpleName ( ) . toString ( ) ; if ( annotation . containerOf ( ) . contains ( name ) ) { result . add ( name ) ; } } if ( s . isStatic ( ) ) { break ; } } return result . build ( ) ;
public class ComputeNodesImpl { /** * Upload Azure Batch service log files from the specified compute node to Azure Blob Storage . * This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support . The Azure Batch service log files should be shared with Azure support to aid in debugging issues with the Batch service . * @ param poolId The ID of the pool that contains the compute node . * @ param nodeId The ID of the compute node from which you want to upload the Azure Batch service log files . * @ param uploadBatchServiceLogsConfiguration The Azure Batch service log files upload configuration . * @ 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 < UploadBatchServiceLogsResult > uploadBatchServiceLogsAsync ( String poolId , String nodeId , UploadBatchServiceLogsConfiguration uploadBatchServiceLogsConfiguration , final ServiceCallback < UploadBatchServiceLogsResult > serviceCallback ) { } }
return ServiceFuture . fromHeaderResponse ( uploadBatchServiceLogsWithServiceResponseAsync ( poolId , nodeId , uploadBatchServiceLogsConfiguration ) , serviceCallback ) ;
public class DRL5Lexer { /** * $ ANTLR start " NULL _ SAFE _ DOT " */ public final void mNULL_SAFE_DOT ( ) throws RecognitionException { } }
try { int _type = NULL_SAFE_DOT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 267:15 : ( ' ! . ' ) // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 267:17 : ' ! . ' { match ( "!." ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class ApiOvhCloud { /** * Add new alert * REST : POST / cloud / project / { serviceName } / alerting * @ param monthlyThreshold [ required ] Monthly threshold for this alerting in currency * @ param email [ required ] Email to contact * @ param delay [ required ] Delay between alerts in seconds * @ param serviceName [ required ] The project id */ public OvhAlerting project_serviceName_alerting_POST ( String serviceName , OvhAlertingDelayEnum delay , String email , Long monthlyThreshold ) throws IOException { } }
String qPath = "/cloud/project/{serviceName}/alerting" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "delay" , delay ) ; addBody ( o , "email" , email ) ; addBody ( o , "monthlyThreshold" , monthlyThreshold ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhAlerting . class ) ;
public class TermsByQueryRequest { /** * Validates the request * @ return null if valid , exception otherwise */ @ Override public ActionRequestValidationException validate ( ) { } }
ActionRequestValidationException validationException = super . validate ( ) ; if ( termsEncoding != null && termsEncoding . equals ( TermsEncoding . BYTES ) ) { if ( maxTermsPerShard == null ) { validationException = ValidateActions . addValidationError ( "maxTermsPerShard not specified for terms encoding [bytes]" , validationException ) ; } } return validationException ;
public class AbstractAppender { /** * Builds a populated AppendEntries request . */ @ SuppressWarnings ( "unchecked" ) protected AppendRequest buildAppendEntriesRequest ( RaftMemberContext member , long lastIndex ) { } }
final RaftLogReader reader = member . getLogReader ( ) ; final Indexed < RaftLogEntry > prevEntry = reader . getCurrentEntry ( ) ; final DefaultRaftMember leader = raft . getLeader ( ) ; AppendRequest . Builder builder = AppendRequest . builder ( ) . withTerm ( raft . getTerm ( ) ) . withLeader ( leader != null ? leader . memberId ( ) : null ) . withPrevLogIndex ( prevEntry != null ? prevEntry . index ( ) : reader . getFirstIndex ( ) - 1 ) . withPrevLogTerm ( prevEntry != null ? prevEntry . entry ( ) . term ( ) : 0 ) . withCommitIndex ( raft . getCommitIndex ( ) ) ; // Build a list of entries to send to the member . final List < RaftLogEntry > entries = new ArrayList < > ( ) ; // Build a list of entries up to the MAX _ BATCH _ SIZE . Note that entries in the log may // be null if they ' ve been compacted and the member to which we ' re sending entries is just // joining the cluster or is otherwise far behind . Null entries are simply skipped and not // counted towards the size of the batch . // If there exists an entry in the log with size > = MAX _ BATCH _ SIZE the logic ensures that // entry will be sent in a batch of size one int size = 0 ; // Iterate through the log until the last index or the end of the log is reached . while ( reader . hasNext ( ) ) { // Otherwise , read the next entry and add it to the batch . Indexed < RaftLogEntry > entry = reader . next ( ) ; entries . add ( entry . entry ( ) ) ; size += entry . size ( ) ; if ( entry . index ( ) == lastIndex || size >= MAX_BATCH_SIZE ) { break ; } } // Add the entries to the request builder and build the request . return builder . withEntries ( entries ) . build ( ) ;
public class PlayEngine { /** * Sends an onPlayStatus message . * http : / / help . adobe . com / en _ US / FlashPlatform / reference / actionscript / 3 / flash / events / NetDataEvent . html * @ param code * @ param duration * @ param bytes */ private void sendOnPlayStatus ( String code , int duration , long bytes ) { } }
if ( log . isDebugEnabled ( ) ) { log . debug ( "Sending onPlayStatus - code: {} duration: {} bytes: {}" , code , duration , bytes ) ; } // create the buffer IoBuffer buf = IoBuffer . allocate ( 102 ) ; buf . setAutoExpand ( true ) ; Output out = new Output ( buf ) ; out . writeString ( "onPlayStatus" ) ; ObjectMap < Object , Object > args = new ObjectMap < > ( ) ; args . put ( "code" , code ) ; args . put ( "level" , Status . STATUS ) ; args . put ( "duration" , duration ) ; args . put ( "bytes" , bytes ) ; String name = currentItem . get ( ) . getName ( ) ; if ( StatusCodes . NS_PLAY_TRANSITION_COMPLETE . equals ( code ) ) { args . put ( "clientId" , streamId ) ; args . put ( "details" , name ) ; args . put ( "description" , String . format ( "Transitioned to %s" , name ) ) ; args . put ( "isFastPlay" , false ) ; } out . writeObject ( args ) ; buf . flip ( ) ; Notify event = new Notify ( buf , "onPlayStatus" ) ; if ( lastMessageTs > 0 ) { event . setTimestamp ( lastMessageTs ) ; } else { event . setTimestamp ( 0 ) ; } RTMPMessage msg = RTMPMessage . build ( event ) ; doPushMessage ( msg ) ;
public class Caster { /** * casts a Object to a Integer * @ param o Object to cast to Integer * @ param defaultValue * @ return Integer from Object */ public static Integer toInteger ( Object o , Integer defaultValue ) { } }
if ( defaultValue != null ) return Integer . valueOf ( toIntValue ( o , defaultValue . intValue ( ) ) ) ; int res = toIntValue ( o , Integer . MIN_VALUE ) ; if ( res == Integer . MIN_VALUE ) return defaultValue ; return Integer . valueOf ( res ) ;
public class Buffer { /** * Reads length - encoded string . * @ param charset the charset to use , for example ASCII * @ return the read string */ public String readStringLengthEncoded ( final Charset charset ) { } }
int length = ( int ) getLengthEncodedNumeric ( ) ; String string = new String ( buf , position , length , charset ) ; position += length ; return string ;