signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Scheduler { public static Collection < TimeSlot > calculateAvailableSots ( Collection < TimeInterval > takenTimeSlots , Date date , int intervalSeconds , Time startTime , Time endTime ) { } }
Day day = new Day ( date ) ; Collection < TimeSlot > allTimeSlots = calculateTimeSots ( day , intervalSeconds , startTime , endTime ) ; if ( takenTimeSlots == null || takenTimeSlots . isEmpty ( ) ) return allTimeSlots ; TimeSlot timeSlot = null ; TreeSet < TimeSlot > availableSlots = new TreeSet < TimeSlot > ( ) ; for ( Iterator < TimeSlot > i = allTimeSlots . iterator ( ) ; i . hasNext ( ) ; ) { timeSlot = i . next ( ) ; if ( ! takenTimeSlots . contains ( timeSlot ) ) { availableSlots . add ( timeSlot ) ; } } return availableSlots ;
public class Route53AutoNamingRegistrationClient { /** * These are convenience methods to help cleanup things like integration test data . * @ param serviceId service id from AWS to delete */ public void deleteService ( String serviceId ) { } }
DeleteServiceRequest deleteServiceRequest = new DeleteServiceRequest ( ) . withId ( serviceId ) ; getDiscoveryClient ( ) . deleteService ( deleteServiceRequest ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcBoundaryEdgeCondition ( ) { } }
if ( ifcBoundaryEdgeConditionEClass == null ) { ifcBoundaryEdgeConditionEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 49 ) ; } return ifcBoundaryEdgeConditionEClass ;
public class ThreadDumps { /** * Dumps all of the threads ' current information to an output stream . * @ param out an output stream . * @ throws UnsupportedEncodingException if the utf - 8 encoding is not supported . */ @ edu . umd . cs . findbugs . annotations . SuppressWarnings ( value = { } }
"VA_FORMAT_STRING_USES_NEWLINE" } , justification = "We don't want platform specific" ) public static void threadDump ( OutputStream out ) throws UnsupportedEncodingException { final PrintWriter writer = new PrintWriter ( new OutputStreamWriter ( out , "utf-8" ) , true ) ; ThreadMXBean mbean = ManagementFactory . getThreadMXBean ( ) ; ThreadInfo [ ] threads ; try { threads = mbean . dumpAllThreads ( mbean . isObjectMonitorUsageSupported ( ) , mbean . isSynchronizerUsageSupported ( ) ) ; } catch ( UnsupportedOperationException x ) { SupportLogFormatter . printStackTrace ( x , writer ) ; threads = new ThreadInfo [ 0 ] ; } Arrays . sort ( threads , new Comparator < ThreadInfo > ( ) { @ Override public int compare ( ThreadInfo t1 , ThreadInfo t2 ) { return t1 . getThreadName ( ) . compareTo ( t2 . getThreadName ( ) ) ; } } ) ; for ( ThreadInfo t : threads ) { printThreadInfo ( writer , t , mbean ) ; } // Print any information about deadlocks . long [ ] deadLocks ; try { deadLocks = mbean . findDeadlockedThreads ( ) ; } catch ( UnsupportedOperationException x ) { SupportLogFormatter . printStackTrace ( x , writer ) ; deadLocks = null ; } if ( deadLocks != null && deadLocks . length != 0 ) { writer . println ( " Deadlock Found " ) ; ThreadInfo [ ] deadLockThreads = mbean . getThreadInfo ( deadLocks ) ; for ( ThreadInfo threadInfo : deadLockThreads ) { StackTraceElement [ ] elements = threadInfo . getStackTrace ( ) ; for ( StackTraceElement element : elements ) { writer . println ( element . toString ( ) ) ; } } } writer . println ( ) ; writer . flush ( ) ;
public class dnskey { /** * Use this API to create dnskey . */ public static base_response create ( nitro_service client , dnskey resource ) throws Exception { } }
dnskey createresource = new dnskey ( ) ; createresource . zonename = resource . zonename ; createresource . keytype = resource . keytype ; createresource . algorithm = resource . algorithm ; createresource . keysize = resource . keysize ; createresource . filenameprefix = resource . filenameprefix ; return createresource . perform_operation ( client , "create" ) ;
public class ChannelFrameworkImpl { /** * Setter method for the number of chain restart attempts . * @ param value * @ throws NumberFormatException * if the value is not a number or is less than zero */ public void setChainStartRetryAttempts ( Object value ) throws NumberFormatException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Setting chain start retry attempts [" + value + "]" ) ; } try { int num = MetatypeUtils . parseInteger ( PROPERTY_CONFIG_ALIAS , PROPERTY_CHAIN_START_RETRY_ATTEMPTS , value , chainStartRetryAttempts ) ; if ( - 1 <= num ) { this . chainStartRetryAttempts = num ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Value too low" ) ; } } } catch ( NumberFormatException nfe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Vaue is not a number" ) ; } }
public class ApiOvhDomain { /** * Get this object properties * REST : GET / domain / zone / { zoneName } / record / { id } * @ param zoneName [ required ] The internal name of your zone * @ param id [ required ] Id of the object */ public OvhRecord zone_zoneName_record_id_GET ( String zoneName , Long id ) throws IOException { } }
String qPath = "/domain/zone/{zoneName}/record/{id}" ; StringBuilder sb = path ( qPath , zoneName , id ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhRecord . class ) ;
public class PropertyFilter { /** * Return the value of a property via reflection . * @ param obj * Object to retrieve a value from . * @ param property * Name of the property . * @ return Value returned via the getter of the property . */ protected final Object getProperty ( final Object obj , final String property ) { } }
if ( ( obj == null ) || ( property == null ) || ( property . trim ( ) . length ( ) == 0 ) ) { return null ; } final String [ ] getterNames = createGetterNames ( property ) ; for ( int i = 0 ; i < getterNames . length ; i ++ ) { final String getter = getterNames [ i ] ; try { final Class cl = obj . getClass ( ) ; final Method m = cl . getMethod ( getter , new Class [ ] { } ) ; return m . invoke ( obj , new Object [ ] { } ) ; } catch ( final IllegalAccessException e ) { throw new RuntimeException ( "Accessing " + getter + " method of property '" + property + "' failed (private? protected?)! [" + obj . getClass ( ) + "]" , e ) ; } catch ( final InvocationTargetException e ) { throw new RuntimeException ( "Exception within " + getter + " method of property '" + property + "'! [" + obj . getClass ( ) + "]" , e . getCause ( ) ) ; } catch ( final NoSuchMethodException e ) { if ( i == getter . length ( ) - 1 ) { throw new RuntimeException ( "No " + getter + " method found for property! '" + property + "'! [" + obj . getClass ( ) + "]" , e ) ; } } } throw new IllegalStateException ( "No getters defined in 'createGetterNames()'!" ) ;
public class CollectionBindings { /** * Creates a number binding that contains the sum of the numbers of the given observable list of numbers . * @ param numbers the observable list of numbers . * @ return a number binding . */ public static NumberBinding sum ( final ObservableList < ? extends Number > numbers ) { } }
return Bindings . createDoubleBinding ( ( ) -> numbers . stream ( ) . mapToDouble ( Number :: doubleValue ) . sum ( ) , numbers ) ;
public class XMLBuilder { /** * Converts attribute map to Attributes class instance . */ private Attributes toAttributes ( Map < String , String > attrs ) { } }
AttributesImpl impl = new AttributesImpl ( ) ; for ( Map . Entry < String , String > attr : attrs . entrySet ( ) ) { impl . addAttribute ( "" , attr . getKey ( ) , "" , "CDATA" , attr . getValue ( ) ) ; } return impl ;
public class DefaultRewriteContentHandler { /** * Extracts link metadata from the DOM elements attributes and resolves them to a { @ link Link } object . * @ param element DOM element * @ return Link metadata */ private Link getAnchorLink ( Element element ) { } }
SyntheticLinkResource resource = new SyntheticLinkResource ( resourceResolver ) ; ValueMap resourceProps = resource . getValueMap ( ) ; // get link metadata from data element boolean foundMetadata = getAnchorMetadataFromData ( resourceProps , element ) ; if ( ! foundMetadata ) { // support for legacy metadata stored in single " data " attribute foundMetadata = getAnchorLegacyMetadataFromSingleData ( resourceProps , element ) ; if ( ! foundMetadata ) { // support for legacy metadata stored in rel attribute getAnchorLegacyMetadataFromRel ( resourceProps , element ) ; } } // build anchor via linkhandler return linkHandler . get ( resource ) . build ( ) ;
public class BoxDeveloperEditionAPIConnection { /** * Authenticates the API connection for Box Developer Edition . */ public void authenticate ( ) { } }
URL url ; try { url = new URL ( this . getTokenURL ( ) ) ; } catch ( MalformedURLException e ) { assert false : "An invalid token URL indicates a bug in the SDK." ; throw new RuntimeException ( "An invalid token URL indicates a bug in the SDK." , e ) ; } String jwtAssertion = this . constructJWTAssertion ( ) ; String urlParameters = String . format ( JWT_GRANT_TYPE , this . getClientID ( ) , this . getClientSecret ( ) , jwtAssertion ) ; BoxAPIRequest request = new BoxAPIRequest ( this , url , "POST" ) ; request . shouldAuthenticate ( false ) ; request . setBody ( urlParameters ) ; String json ; try { BoxJSONResponse response = ( BoxJSONResponse ) request . send ( ) ; json = response . getJSON ( ) ; } catch ( BoxAPIException ex ) { // Use the Date advertised by the Box server as the current time to synchronize clocks List < String > responseDates = ex . getHeaders ( ) . get ( "Date" ) ; NumericDate currentTime ; if ( responseDates != null ) { String responseDate = responseDates . get ( 0 ) ; SimpleDateFormat dateFormat = new SimpleDateFormat ( "EEE, d MMM yyyy HH:mm:ss zzz" ) ; try { Date date = dateFormat . parse ( responseDate ) ; currentTime = NumericDate . fromMilliseconds ( date . getTime ( ) ) ; } catch ( ParseException e ) { currentTime = NumericDate . now ( ) ; } } else { currentTime = NumericDate . now ( ) ; } // Reconstruct the JWT assertion , which regenerates the jti claim , with the new " current " time jwtAssertion = this . constructJWTAssertion ( currentTime ) ; urlParameters = String . format ( JWT_GRANT_TYPE , this . getClientID ( ) , this . getClientSecret ( ) , jwtAssertion ) ; // Re - send the updated request request = new BoxAPIRequest ( this , url , "POST" ) ; request . shouldAuthenticate ( false ) ; request . setBody ( urlParameters ) ; BoxJSONResponse response = ( BoxJSONResponse ) request . send ( ) ; json = response . getJSON ( ) ; } JsonObject jsonObject = JsonObject . readFrom ( json ) ; this . setAccessToken ( jsonObject . get ( "access_token" ) . asString ( ) ) ; this . setLastRefresh ( System . currentTimeMillis ( ) ) ; this . setExpires ( jsonObject . get ( "expires_in" ) . asLong ( ) * 1000 ) ; // if token cache is specified , save to cache if ( this . accessTokenCache != null ) { String key = this . getAccessTokenCacheKey ( ) ; JsonObject accessTokenCacheInfo = new JsonObject ( ) . add ( "accessToken" , this . getAccessToken ( ) ) . add ( "lastRefresh" , this . getLastRefresh ( ) ) . add ( "expires" , this . getExpires ( ) ) ; this . accessTokenCache . put ( key , accessTokenCacheInfo . toString ( ) ) ; }
public class CopyingConverter { /** * Create a { @ link CopyingConverter } instance that instantiates the target type using the default constructor . * @ param target type which must have an accessible no - arg constructor * @ param < TARGET > * @ return CopyingConverter instance */ public static < TARGET > CopyingConverter < Object , TARGET > forTargetType ( final Class < TARGET > target ) { } }
final Typed < TARGET > targetType = TypeUtils . wrap ( target ) ; return new Fluent < TARGET > ( requireDefaultConstructor ( target ) ) { @ Override public Typed < TARGET > getTargetType ( ) { return targetType ; } } ;
public class DefaultNotifier { /** * ~ Methods * * * * * */ @ Override public void sendNotification ( NotificationContext notificationContext ) { } }
SystemAssert . requireArgument ( notificationContext != null , "Notification context cannot be null." ) ; Map < String , String > additionalFields = new HashMap < > ( ) ; additionalFields . put ( "Notification status" , "Notification created." ) ; _createAnnotation ( notificationContext , additionalFields ) ; sendAdditionalNotification ( notificationContext ) ; _dispose ( ) ;
public class PropertiesRecord { /** * Add the behaviors to sync this property to this virtual field . */ public void addPropertiesFieldBehavior ( BaseField fldDisplay , String strProperty ) { } }
BaseField fldProperties = this . getField ( PropertiesRecord . PROPERTIES ) ; FieldListener listener = new CopyConvertersHandler ( new PropertiesConverter ( fldProperties , strProperty ) ) ; listener . setRespondsToMode ( DBConstants . INIT_MOVE , false ) ; listener . setRespondsToMode ( DBConstants . READ_MOVE , false ) ; fldDisplay . addListener ( listener ) ; listener = new CopyConvertersHandler ( fldDisplay , new PropertiesConverter ( fldProperties , strProperty ) ) ; fldProperties . addListener ( listener ) ;
public class SYMPART { /** * / * returns tile number between 0 and 8 * returns - 1 if out of any tile , function does * not depend on objFct ! */ public int findTileSYMPART ( double x1 , double x2 ) { } }
int dim ; double [ ] x = new double [ 2 ] ; double h1 ; double omega = Math . PI / 4.0 ; double si = Math . sin ( omega ) ; double co = Math . cos ( omega ) ; x [ 0 ] = x1 ; x [ 1 ] = x2 ; // rotate ( 2 , x ) ; for ( dim = 0 ; dim + 1 < 2 ; dim += 2 ) { h1 = x [ dim ] ; x [ dim ] = co * h1 - si * x [ dim + 1 ] ; x [ dim + 1 ] = si * h1 + co * x [ dim + 1 ] ; } TupleTwo < Integer , Integer > tt = findTile ( x [ 0 ] , x [ 1 ] ) ; int i = tt . _1 ( ) ; int j = tt . _2 ( ) ; // restrict to 9 tiles if ( Math . abs ( i ) > 1 || Math . abs ( j ) > 1 ) return - 1 ; return ( i + 1 ) * 3 + ( j + 1 ) ;
public class Mutations { /** * Converts position from coordinates in seq1 ( before mutation ) to coordinates in seq2 ( after mutation ) using this * alignment ( mutations ) . * If letter in provided position is marked as deleted ( deletion ) in this mutations , this method will return { @ code * ( - 1 - imagePosition ) } , where { @ code imagePosition } is a position of letter right after that place where target * nucleotide was removed according to this alignment . * @ param seq1Position position in seq1 * @ return position in seq2 */ public int convertToSeq2Position ( int seq1Position ) { } }
int p , result = seq1Position ; for ( int mut : mutations ) { p = getPosition ( mut ) ; if ( p > seq1Position ) return result ; switch ( mut & MUTATION_TYPE_MASK ) { case RAW_MUTATION_TYPE_DELETION : if ( p == seq1Position ) return - result - 1 ; -- result ; break ; case RAW_MUTATION_TYPE_INSERTION : ++ result ; break ; } } return result ;
public class AWSIotClient { /** * Accepts a pending certificate transfer . The default state of the certificate is INACTIVE . * To check for pending certificate transfers , call < a > ListCertificates < / a > to enumerate your certificates . * @ param acceptCertificateTransferRequest * The input for the AcceptCertificateTransfer operation . * @ return Result of the AcceptCertificateTransfer operation returned by the service . * @ throws ResourceNotFoundException * The specified resource does not exist . * @ throws TransferAlreadyCompletedException * You can ' t revert the certificate transfer because the transfer is already complete . * @ throws InvalidRequestException * The request is not valid . * @ throws ThrottlingException * The rate exceeds the limit . * @ throws UnauthorizedException * You are not authorized to perform this operation . * @ throws ServiceUnavailableException * The service is temporarily unavailable . * @ throws InternalFailureException * An unexpected error has occurred . * @ sample AWSIot . AcceptCertificateTransfer */ @ Override public AcceptCertificateTransferResult acceptCertificateTransfer ( AcceptCertificateTransferRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeAcceptCertificateTransfer ( request ) ;
public class CompositeBundlePathMappingBuilder { /** * Adds paths to the file path mapping * @ param bundlePathMapping * the bundle path mapping * @ param paths * the paths to add */ private void addFilePathMapping ( BundlePathMapping bundlePathMapping , Set < String > paths ) { } }
for ( String path : paths ) { addFilePathMapping ( bundlePathMapping , path ) ; }
public class Gpio { /** * < p > Priority , Interrupt and Thread Functions < / p > * This function registers a function to received interrupts on the specified pin . The edgeType parameter is either * INT _ EDGE _ FALLING , INT _ EDGE _ RISING , INT _ EDGE _ BOTH or INT _ EDGE _ SETUP . If it is INT _ EDGE _ SETUP then no * initialisation of the pin will happen – it ’ s assumed that you have already setup the pin elsewhere * ( e . g . with the gpio program ) , but if you specify one of the other types , then the pin will be exported and * initialised as specified . This is accomplished via a suitable call to the gpio utility program , so it need to * be available * The pin number is supplied in the current mode – native wiringPi , BCM _ GPIO , physical or Sys modes . * This function will work in any mode , and does not need root privileges to work . * The function will be called when the interrupt triggers . When it is triggered , it ’ s cleared in the dispatcher * before calling your function , so if a subsequent interrupt fires before you finish your handler , then it won ’ t * be missed . ( However it can only track one more interrupt , if more than one interrupt fires while one is being * handled then they will be ignored ) * This function is run at a high priority ( if the program is run using sudo , or as root ) and executes * concurrently with the main program . It has full access to all the global variables , open file handles * and so on . * @ see < a * href = " http : / / wiringpi . com / reference / priority - interrupts - and - threads / " > http : / / wiringpi . com / reference / priority - interrupts - and - threads / < / a > * @ param pin The GPIO pin number . < / br > < i > ( Depending on how wiringPi was initialized , this may * be the wiringPi pin number or the Broadcom GPIO pin number . ) < / i > * @ param edgeType The type of pin edge event to watch for : INT _ EDGE _ FALLING , INT _ EDGE _ RISING , INT _ EDGE _ BOTH or INT _ EDGE _ SETUP . * @ param callback The callback interface implemented by the consumer . The ' callback ' method of this interface * will be invoked when the wiringPiISR issues a callback signal . * @ return The return value is - 1 if an error occurred ( and errno will be set appropriately ) , 0 * if it timed out , or 1 on a successful interrupt event . */ public static int wiringPiISR ( int pin , int edgeType , GpioInterruptCallback callback ) { } }
// if there is not collection in the array at this pin location , then initialize an array list if ( isrCallbacks [ pin ] == null ) { isrCallbacks [ pin ] = new ArrayList < > ( ) ; } // add provided callback interface to ISR callbacks collection isrCallbacks [ pin ] . add ( callback ) ; return _wiringPiISR ( pin , edgeType ) ;
public class Gmap3DemoAppManifest { /** * Load all services and entities found in ( the packages and subpackages within ) these modules */ @ Override public List < Class < ? > > getModules ( ) { } }
return Arrays . asList ( Gmap3ApplibModule . class , Gmap3ServiceModule . class , Gmap3UiModule . class , Gmap3DemoFixtureModule . class , Gmap3DemoAppModule . class ) ;
public class InternalXbaseParser { /** * InternalXbase . g : 67:1 : ruleXExpression : ( ruleXAssignment ) ; */ public final void ruleXExpression ( ) throws RecognitionException { } }
int stackSize = keepStackSize ( ) ; try { // InternalXbase . g : 71:2 : ( ( ruleXAssignment ) ) // InternalXbase . g : 72:2 : ( ruleXAssignment ) { // InternalXbase . g : 72:2 : ( ruleXAssignment ) // InternalXbase . g : 73:3 : ruleXAssignment { if ( state . backtracking == 0 ) { before ( grammarAccess . getXExpressionAccess ( ) . getXAssignmentParserRuleCall ( ) ) ; } pushFollow ( FOLLOW_2 ) ; ruleXAssignment ( ) ; state . _fsp -- ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { after ( grammarAccess . getXExpressionAccess ( ) . getXAssignmentParserRuleCall ( ) ) ; } } } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { restoreStackSize ( stackSize ) ; } return ;
public class PaymentIntentParams { /** * Create the parameters necessary for confirming a PaymentIntent while attaching * { @ link PaymentMethodCreateParams } data * @ param paymentMethodCreateParams params for the PaymentMethod that will be attached to this * PaymentIntent * @ param clientSecret client secret from the PaymentIntent that is to be confirmed * @ param returnUrl the URL the customer should be redirected to after the authorization * process * @ param savePaymentMethod Set to { @ code true } to save this PaymentIntent ’ s payment method to * the associated Customer , if the payment method is not already * attached . This parameter only applies to the payment method passed * in the same request or the current payment method attached to the * PaymentIntent and must be specified again if a new payment method is * added . * @ return params that can be use to confirm a PaymentIntent */ @ NonNull public static PaymentIntentParams createConfirmPaymentIntentWithPaymentMethodCreateParams ( @ Nullable PaymentMethodCreateParams paymentMethodCreateParams , @ NonNull String clientSecret , @ NonNull String returnUrl , boolean savePaymentMethod ) { } }
return new PaymentIntentParams ( ) . setPaymentMethodCreateParams ( paymentMethodCreateParams ) . setClientSecret ( clientSecret ) . setReturnUrl ( returnUrl ) . setSavePaymentMethod ( savePaymentMethod ) ;
public class AbstractMaterialDialogBuilder { /** * Sets the listener , which should be notified , when the dialog has been shown . * @ param listener * The listener , which should be set , as an instance of the type { @ link * DialogInterface . OnShowListener } , or null , if no listener should be set */ public BuilderType setOnShowListener ( @ Nullable final DialogInterface . OnShowListener listener ) { } }
getProduct ( ) . setOnShowListener ( listener ) ; return self ( ) ;
public class RowColumnOps { /** * Swaps the rows < tt > j < / tt > and < tt > k < / tt > in the given matrix . * @ param A the matrix to perform he update on * @ param j the first row to swap * @ param k the second row to swap * @ param start the first column that will be included in the swap ( inclusive ) * @ param to the last column to be included in the swap ( exclusive ) */ public static void swapRow ( Matrix A , int j , int k , int start , int to ) { } }
double t ; for ( int i = start ; i < to ; i ++ ) { t = A . get ( j , i ) ; A . set ( j , i , A . get ( k , i ) ) ; A . set ( k , i , t ) ; }
public class Sets { /** * Sets target content to be the same as source without clearing the target . * @ param < T > * @ param source * @ param target */ public static final < T > void assign ( Set < T > source , Set < T > target ) { } }
target . retainAll ( source ) ; target . addAll ( source ) ;
public class NormalizerSerializer { /** * Serialize a normalizer to the given file path * @ param normalizer the normalizer * @ param path the destination file path * @ throws IOException */ public void write ( @ NonNull Normalizer normalizer , @ NonNull String path ) throws IOException { } }
try ( OutputStream out = new BufferedOutputStream ( new FileOutputStream ( path ) ) ) { write ( normalizer , out ) ; }
public class CachedGroupMapping { /** * Gets a list of groups for the given user . * @ param user user name * @ return the list of groups that the user belongs to */ public List < String > getGroups ( String user ) throws IOException { } }
if ( ! mCacheEnabled ) { return mService . getGroups ( user ) ; } try { return mCache . get ( user ) ; } catch ( ExecutionException e ) { throw new IOException ( e ) ; }
public class SRTPCryptoContext { /** * Authenticate a packet . Calculated authentication tag is returned . * @ param pkt * the RTP packet to be authenticated * @ param rocIn * Roll - Over - Counter */ private void authenticatePacketHMCSHA1 ( RawPacket pkt , int rocIn ) { } }
ByteBuffer buf = pkt . getBuffer ( ) ; buf . rewind ( ) ; int len = buf . remaining ( ) ; buf . get ( tempBuffer , 0 , len ) ; mac . update ( tempBuffer , 0 , len ) ; rbStore [ 0 ] = ( byte ) ( rocIn >> 24 ) ; rbStore [ 1 ] = ( byte ) ( rocIn >> 16 ) ; rbStore [ 2 ] = ( byte ) ( rocIn >> 8 ) ; rbStore [ 3 ] = ( byte ) rocIn ; mac . update ( rbStore , 0 , rbStore . length ) ; mac . doFinal ( tagStore , 0 ) ;
public class XsdAsmElements { /** * Creates some class specific methods that all implementations of { @ link XsdAbstractElement } should have , which are : * Constructor ( ElementVisitor visitor ) - Assigns the argument to the visitor field ; * Constructor ( Element parent ) - Assigns the argument to the parent field and obtains the visitor of the parent ; * Constructor ( Element parent , ElementVisitor visitor , boolean performsVisit ) - * An alternative constructor to avoid the visit method call ; * of ( { @ link Consumer } consumer ) - Method used to avoid variable extraction in order to allow cleaner code ; * dynamic ( { @ link Consumer } consumer ) - Method used to indicate that the changes on the fluent interface performed * inside the Consumer code are a dynamic aspect of the result and are bound to change ; * self ( ) - Returns this ; * getName ( ) - Returns the name of the element ; * getParent ( ) - Returns the parent field ; * getVisitor ( ) - Returns the visitor field ; * _ _ ( ) - Returns the parent and calls the respective visitParent method . * @ param classWriter The { @ link ClassWriter } on which the methods should be written . * @ param className The class name . * @ param apiName The name of the generated fluent interface . * @ param performVisits Indicates if the visit method call should be performed in the * Constructor ( Element parent , ElementVisitor visitor , boolean performsVisit ) method . */ static void generateClassMethods ( ClassWriter classWriter , String typeName , String className , String apiName , boolean performVisits ) { } }
String classType = getFullClassTypeName ( typeName , apiName ) ; String classTypeDesc = getFullClassTypeNameDesc ( typeName , apiName ) ; String name = firstToLower ( className ) ; FieldVisitor fVisitor = classWriter . visitField ( ACC_PROTECTED + ACC_FINAL , "parent" , elementTypeDesc , "TZ;" , null ) ; fVisitor . visitEnd ( ) ; fVisitor = classWriter . visitField ( ACC_PROTECTED + ACC_FINAL , "visitor" , elementVisitorTypeDesc , null , null ) ; fVisitor . visitEnd ( ) ; MethodVisitor mVisitor = classWriter . visitMethod ( ACC_PUBLIC , CONSTRUCTOR , "(" + elementVisitorTypeDesc + ")V" , null , null ) ; mVisitor . visitLocalVariable ( "visitor" , elementVisitorTypeDesc , null , new Label ( ) , new Label ( ) , 1 ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKESPECIAL , JAVA_OBJECT , CONSTRUCTOR , "()V" , false ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitVarInsn ( ALOAD , 1 ) ; mVisitor . visitFieldInsn ( PUTFIELD , classType , "visitor" , elementVisitorTypeDesc ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitInsn ( ACONST_NULL ) ; mVisitor . visitFieldInsn ( PUTFIELD , classType , "parent" , elementTypeDesc ) ; if ( performVisits ) { mVisitor . visitVarInsn ( ALOAD , 1 ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKEVIRTUAL , elementVisitorType , "visitElement" + getCleanName ( className ) , "(" + classTypeDesc + ")V" , false ) ; } mVisitor . visitInsn ( RETURN ) ; mVisitor . visitMaxs ( 2 , 2 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PUBLIC , CONSTRUCTOR , "(" + elementTypeDesc + ")V" , "(TZ;)V" , null ) ; mVisitor . visitLocalVariable ( "parent" , elementTypeDesc , null , new Label ( ) , new Label ( ) , 1 ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKESPECIAL , JAVA_OBJECT , CONSTRUCTOR , "()V" , false ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitVarInsn ( ALOAD , 1 ) ; mVisitor . visitFieldInsn ( PUTFIELD , classType , "parent" , elementTypeDesc ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitVarInsn ( ALOAD , 1 ) ; mVisitor . visitMethodInsn ( INVOKEINTERFACE , elementType , "getVisitor" , "()" + elementVisitorTypeDesc , true ) ; mVisitor . visitFieldInsn ( PUTFIELD , classType , "visitor" , elementVisitorTypeDesc ) ; if ( performVisits ) { mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitFieldInsn ( GETFIELD , classType , "visitor" , elementVisitorTypeDesc ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKEVIRTUAL , elementVisitorType , "visitElement" + getCleanName ( className ) , "(" + classTypeDesc + ")V" , false ) ; } mVisitor . visitInsn ( RETURN ) ; mVisitor . visitMaxs ( 2 , 2 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PROTECTED , CONSTRUCTOR , "(" + elementTypeDesc + elementVisitorTypeDesc + "Z)V" , "(TZ;" + elementVisitorTypeDesc + "Z)V" , null ) ; mVisitor . visitLocalVariable ( "parent" , elementTypeDesc , null , new Label ( ) , new Label ( ) , 1 ) ; mVisitor . visitLocalVariable ( "visitor" , elementVisitorTypeDesc , null , new Label ( ) , new Label ( ) , 2 ) ; mVisitor . visitLocalVariable ( "shouldVisit" , "Z" , null , new Label ( ) , new Label ( ) , 3 ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKESPECIAL , JAVA_OBJECT , CONSTRUCTOR , "()V" , false ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitVarInsn ( ALOAD , 1 ) ; mVisitor . visitFieldInsn ( PUTFIELD , classType , "parent" , elementTypeDesc ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitVarInsn ( ALOAD , 2 ) ; mVisitor . visitFieldInsn ( PUTFIELD , classType , "visitor" , elementVisitorTypeDesc ) ; if ( performVisits ) { mVisitor . visitVarInsn ( ILOAD , 3 ) ; Label l0 = new Label ( ) ; mVisitor . visitJumpInsn ( IFEQ , l0 ) ; mVisitor . visitVarInsn ( ALOAD , 2 ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKEVIRTUAL , elementVisitorType , "visitElement" + getCleanName ( className ) , "(" + classTypeDesc + ")V" , false ) ; mVisitor . visitLabel ( l0 ) ; mVisitor . visitFrame ( Opcodes . F_FULL , 4 , new Object [ ] { classType , elementType , elementVisitorType , Opcodes . INTEGER } , 0 , new Object [ ] { } ) ; } mVisitor . visitInsn ( RETURN ) ; mVisitor . visitMaxs ( 2 , 4 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PUBLIC , "__" , "()" + elementTypeDesc , "()TZ;" , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitFieldInsn ( GETFIELD , classType , "visitor" , elementVisitorTypeDesc ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKEVIRTUAL , elementVisitorType , "visitParent" + getCleanName ( typeName ) , "(" + classTypeDesc + ")V" , false ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitFieldInsn ( GETFIELD , classType , "parent" , elementTypeDesc ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 2 , 1 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PUBLIC + ACC_FINAL , "dynamic" , "(Ljava/util/function/Consumer;)" + classTypeDesc , "(Ljava/util/function/Consumer<L" + classType + "<TZ;>;>;)L" + classType + "<TZ;>;" , null ) ; mVisitor . visitLocalVariable ( "consumer" , "Ljava/util/function/Consumer;" , null , new Label ( ) , new Label ( ) , 1 ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitFieldInsn ( GETFIELD , classType , "visitor" , elementVisitorTypeDesc ) ; mVisitor . visitMethodInsn ( INVOKEVIRTUAL , elementVisitorType , "visitOpenDynamic" , "()V" , false ) ; mVisitor . visitVarInsn ( ALOAD , 1 ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKEINTERFACE , "java/util/function/Consumer" , "accept" , "(" + JAVA_OBJECT_DESC + ")V" , true ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitFieldInsn ( GETFIELD , classType , "visitor" , elementVisitorTypeDesc ) ; mVisitor . visitMethodInsn ( INVOKEVIRTUAL , elementVisitorType , "visitCloseDynamic" , "()V" , false ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 2 , 2 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PUBLIC + ACC_FINAL , "of" , "(Ljava/util/function/Consumer;)" + classTypeDesc , "(Ljava/util/function/Consumer<L" + classType + "<TZ;>;>;)L" + classType + "<TZ;>;" , null ) ; mVisitor . visitLocalVariable ( "consumer" , "Ljava/util/function/Consumer;" , null , new Label ( ) , new Label ( ) , 1 ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 1 ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKEINTERFACE , "java/util/function/Consumer" , "accept" , "(" + JAVA_OBJECT_DESC + ")V" , true ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 2 , 2 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PUBLIC , "getParent" , "()" + elementTypeDesc , "()TZ;" , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitFieldInsn ( GETFIELD , classType , "parent" , elementTypeDesc ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 1 , 1 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PUBLIC + ACC_FINAL , "getVisitor" , "()" + elementVisitorTypeDesc , null , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitFieldInsn ( GETFIELD , classType , "visitor" , elementVisitorTypeDesc ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 1 , 1 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PUBLIC , "getName" , "()" + JAVA_STRING_DESC , null , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitLdcInsn ( name ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 1 , 1 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PUBLIC + ACC_FINAL , "self" , "()" + classTypeDesc , "()L" + classType + "<TZ;>;" , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 1 , 1 ) ; mVisitor . visitEnd ( ) ; mVisitor = classWriter . visitMethod ( ACC_PUBLIC + ACC_BRIDGE + ACC_SYNTHETIC , "self" , "()" + elementTypeDesc , null , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKEVIRTUAL , classType , "self" , "()" + classTypeDesc , false ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 1 , 1 ) ; mVisitor . visitEnd ( ) ;
public class JsHdrsImpl { /** * Set the boolean ' value ' of one of the flags in the FLAGS field of th message . * @ param flagBit A byte with a single bit set on , marking the position * of the required flag . * @ param value true if the required flag is to be set on , otherwise false */ private final void setFlagValue ( byte flagBit , boolean value ) { } }
if ( value ) { flags = ( byte ) ( getFlags ( ) | flagBit ) ; } else { flags = ( byte ) ( getFlags ( ) & ( ~ flagBit ) ) ; }
public class DefaultJsonReader { /** * { @ inheritDoc } */ @ Override public String nextValue ( ) { } }
int p = peeked ; if ( p == PEEKED_NONE ) { p = doPeek ( ) ; } if ( p == PEEKED_NULL ) { peeked = PEEKED_NONE ; return "null" ; } JsonWriter writer = new DefaultJsonWriter ( new StringBuilder ( ) ) ; writer . setLenient ( true ) ; int count = 0 ; do { p = peeked ; if ( p == PEEKED_NONE ) { p = doPeek ( ) ; } if ( p == PEEKED_BEGIN_ARRAY ) { push ( JsonScope . EMPTY_ARRAY ) ; count ++ ; writer . beginArray ( ) ; } else if ( p == PEEKED_BEGIN_OBJECT ) { push ( JsonScope . EMPTY_OBJECT ) ; count ++ ; writer . beginObject ( ) ; } else if ( p == PEEKED_END_ARRAY ) { stackSize -- ; count -- ; writer . endArray ( ) ; } else if ( p == PEEKED_END_OBJECT ) { stackSize -- ; count -- ; writer . endObject ( ) ; } else if ( p == PEEKED_UNQUOTED_NAME ) { writer . name ( nextUnquotedValue ( ) ) ; } else if ( p == PEEKED_SINGLE_QUOTED_NAME ) { writer . name ( nextQuotedValue ( '\'' ) ) ; } else if ( p == PEEKED_DOUBLE_QUOTED_NAME ) { writer . name ( nextQuotedValue ( '"' ) ) ; } else if ( p == PEEKED_UNQUOTED ) { writer . value ( nextUnquotedValue ( ) ) ; } else if ( p == PEEKED_SINGLE_QUOTED ) { writer . value ( nextQuotedValue ( '\'' ) ) ; } else if ( p == PEEKED_DOUBLE_QUOTED ) { writer . value ( nextQuotedValue ( '"' ) ) ; } else if ( p == PEEKED_NUMBER ) { writer . value ( new String ( buffer , pos , peekedNumberLength ) ) ; pos += peekedNumberLength ; } else if ( p == PEEKED_TRUE ) { writer . value ( true ) ; } else if ( p == PEEKED_FALSE ) { writer . value ( false ) ; } else if ( p == PEEKED_LONG ) { writer . value ( peekedLong ) ; } else if ( p == PEEKED_BUFFERED ) { writer . value ( peekedString ) ; } else if ( p == PEEKED_NULL ) { writer . nullValue ( ) ; } peeked = PEEKED_NONE ; } while ( count != 0 ) ; writer . close ( ) ; return writer . getOutput ( ) ;
public class SpatialAnchorsAccountsInner { /** * Creating or Updating a Spatial Anchors Account . * @ param resourceGroupName Name of an Azure resource group . * @ param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account . * @ param spatialAnchorsAccount Spatial Anchors Account parameter . * @ 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 < SpatialAnchorsAccountInner > createAsync ( String resourceGroupName , String spatialAnchorsAccountName , SpatialAnchorsAccountInner spatialAnchorsAccount , final ServiceCallback < SpatialAnchorsAccountInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( createWithServiceResponseAsync ( resourceGroupName , spatialAnchorsAccountName , spatialAnchorsAccount ) , serviceCallback ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcRelSpaceBoundary2ndLevel ( ) { } }
if ( ifcRelSpaceBoundary2ndLevelEClass == null ) { ifcRelSpaceBoundary2ndLevelEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 562 ) ; } return ifcRelSpaceBoundary2ndLevelEClass ;
public class RandomSplitter { /** * { @ inheritDoc } */ @ Override public TemporalDataModelIF < U , I > [ ] split ( final TemporalDataModelIF < U , I > data ) { } }
@ SuppressWarnings ( "unchecked" ) final TemporalDataModelIF < U , I > [ ] splits = new TemporalDataModelIF [ 2 ] ; splits [ 0 ] = new TemporalDataModel < > ( ) ; // training splits [ 1 ] = new TemporalDataModel < > ( ) ; // test if ( perUser ) { for ( U user : data . getUsers ( ) ) { if ( doSplitPerItems ) { List < I > items = new ArrayList < > ( ) ; data . getUserItems ( user ) . forEach ( items :: add ) ; Collections . shuffle ( items , rnd ) ; int splitPoint = Math . round ( percentageTraining * items . size ( ) ) ; for ( int i = 0 ; i < items . size ( ) ; i ++ ) { I item = items . get ( i ) ; Double pref = data . getUserItemPreference ( user , item ) ; Iterable < Long > time = data . getUserItemTimestamps ( user , item ) ; TemporalDataModelIF < U , I > datamodel = splits [ 0 ] ; // training if ( i > splitPoint ) { datamodel = splits [ 1 ] ; // test } if ( pref != null ) { datamodel . addPreference ( user , item , pref ) ; } if ( time != null ) { for ( Long t : time ) { datamodel . addTimestamp ( user , item , t ) ; } } } } else { List < Pair < I , Long > > itemsTime = new ArrayList < > ( ) ; for ( I i : data . getUserItems ( user ) ) { for ( Long t : data . getUserItemTimestamps ( user , i ) ) { itemsTime . add ( new Pair < > ( i , t ) ) ; } } Collections . shuffle ( itemsTime , rnd ) ; int splitPoint = Math . round ( percentageTraining * itemsTime . size ( ) ) ; for ( int i = 0 ; i < itemsTime . size ( ) ; i ++ ) { Pair < I , Long > it = itemsTime . get ( i ) ; I item = it . getFirst ( ) ; Long time = it . getSecond ( ) ; Double pref = data . getUserItemPreference ( user , item ) ; TemporalDataModelIF < U , I > datamodel = splits [ 0 ] ; // training if ( i > splitPoint ) { datamodel = splits [ 1 ] ; // test } if ( pref != null ) { datamodel . addPreference ( user , item , pref ) ; } if ( time != null ) { datamodel . addTimestamp ( user , item , time ) ; } } } } } else { for ( U user : data . getUsers ( ) ) { for ( I item : data . getUserItems ( user ) ) { Double pref = data . getUserItemPreference ( user , item ) ; Iterable < Long > time = data . getUserItemTimestamps ( user , item ) ; if ( doSplitPerItems ) { TemporalDataModelIF < U , I > datamodel = splits [ 0 ] ; // training if ( rnd . nextDouble ( ) > percentageTraining ) { datamodel = splits [ 1 ] ; // test } if ( pref != null ) { datamodel . addPreference ( user , item , pref ) ; } if ( time != null ) { for ( Long t : time ) { datamodel . addTimestamp ( user , item , t ) ; } } } else if ( time != null ) { for ( Long t : time ) { TemporalDataModelIF < U , I > datamodel = splits [ 0 ] ; // training if ( rnd . nextDouble ( ) > percentageTraining ) { datamodel = splits [ 1 ] ; // test } if ( pref != null ) { datamodel . addPreference ( user , item , pref ) ; } datamodel . addTimestamp ( user , item , t ) ; } } else { TemporalDataModelIF < U , I > datamodel = splits [ 0 ] ; // training if ( rnd . nextDouble ( ) > percentageTraining ) { datamodel = splits [ 1 ] ; // test } if ( pref != null ) { datamodel . addPreference ( user , item , pref ) ; } } } } } return splits ;
public class DeviceManagerClient { /** * Updates a device registry configuration . * < p > Sample code : * < pre > < code > * try ( DeviceManagerClient deviceManagerClient = DeviceManagerClient . create ( ) ) { * DeviceRegistry deviceRegistry = DeviceRegistry . newBuilder ( ) . build ( ) ; * FieldMask updateMask = FieldMask . newBuilder ( ) . build ( ) ; * DeviceRegistry response = deviceManagerClient . updateDeviceRegistry ( deviceRegistry , updateMask ) ; * < / code > < / pre > * @ param deviceRegistry The new values for the device registry . The ` id ` field must be empty , and * the ` name ` field must indicate the path of the resource . For example , * ` projects / example - project / locations / us - central1 / registries / my - registry ` . * @ param updateMask Only updates the ` device _ registry ` fields indicated by this mask . The field * mask must not be empty , and it must not contain fields that are immutable or only set by * the server . Mutable top - level fields : ` event _ notification _ config ` , ` http _ config ` , * ` mqtt _ config ` , and ` state _ notification _ config ` . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final DeviceRegistry updateDeviceRegistry ( DeviceRegistry deviceRegistry , FieldMask updateMask ) { } }
UpdateDeviceRegistryRequest request = UpdateDeviceRegistryRequest . newBuilder ( ) . setDeviceRegistry ( deviceRegistry ) . setUpdateMask ( updateMask ) . build ( ) ; return updateDeviceRegistry ( request ) ;
public class AdminToolIntegrityUtil { /** * checks for integrity errors * @ return empty list or errors */ public List < MenuIntegrityError > checkMenuIntegrity ( ) { } }
List < MenuIntegrityError > errorList = new ArrayList < > ( ) ; Map < String , MenuEntry > links = new HashMap < > ( ) ; Map < String , MenuEntry > templates = new HashMap < > ( ) ; // check for duplicates , but only if menu has no submenu , otherwise o // link will be generated for ( AdminComponent comp : adminTool . getComponents ( ) ) { if ( null != comp . getMainMenu ( ) ) { comp . getMainMenu ( ) . flattened ( ) . forEach ( menu -> { if ( links . containsKey ( menu . getName ( ) ) && CollectionUtils . isEmpty ( menu . getSubmenu ( ) ) ) { findErrorAndAddEntry ( "duplicate link name on menu item" , MSG_KEY_DUPLICATE_LINK , errorList , menu , links . get ( menu . getName ( ) ) ) ; } else { links . put ( menu . getName ( ) , menu ) ; } if ( templates . containsKey ( menu . getTarget ( ) ) && CollectionUtils . isEmpty ( menu . getSubmenu ( ) ) ) { findErrorAndAddEntry ( "duplicate template reference on menu item" , MSG_KEY_DUPLICATE_TPL_REF , errorList , menu , templates . get ( menu . getTarget ( ) ) ) ; } else { templates . put ( menu . getTarget ( ) , menu ) ; } if ( config . isInternationalizationEnabled ( ) && StringUtils . isEmpty ( menu . getResouceMessageKey ( ) ) ) { findErrorAndAddEntry ( "missing message resource key on menu item" , MSG_KEY_MISSING_RESOURCE_KEY , errorList , menu , templates . get ( menu . getTarget ( ) ) ) ; } } ) ; } else { findErrorAndAddEntry ( String . format ( "the component '%s' has no main menu" , comp . getDisplayName ( ) ) , MSG_KEY_COMPONENT_NO_MAINMENU , errorList , null , null ) ; } } links . clear ( ) ; templates . clear ( ) ; return errorList ;
public class FileUtils { /** * Recursively copies a directory . * @ param sourceDir the source directory * @ param destDir the destination directory , which does not need to already exist * @ param copyOption options to be used for copying files */ public static void recursivelyCopyDirectory ( final File sourceDir , final File destDir , final StandardCopyOption copyOption ) throws IOException { } }
checkNotNull ( sourceDir ) ; checkNotNull ( destDir ) ; checkArgument ( sourceDir . isDirectory ( ) , "Source directory does not exist" ) ; java . nio . file . Files . createDirectories ( destDir . toPath ( ) ) ; walkFileTree ( sourceDir . toPath ( ) , new CopyFileVisitor ( sourceDir . toPath ( ) , destDir . toPath ( ) , copyOption ) ) ;
public class CPSpecificationOptionUtil { /** * Removes the cp specification option where groupId = & # 63 ; and key = & # 63 ; from the database . * @ param groupId the group ID * @ param key the key * @ return the cp specification option that was removed */ public static CPSpecificationOption removeByG_K ( long groupId , String key ) throws com . liferay . commerce . product . exception . NoSuchCPSpecificationOptionException { } }
return getPersistence ( ) . removeByG_K ( groupId , key ) ;
public class StatisticsUtil { /** * Aggregates statistical information . * @ param data a list of statistical information * @ return the aggregate of all */ public static Statistics statisticsOf ( List < Statistics > data ) { } }
if ( data . isEmpty ( ) ) return null ; Iterator < Statistics > iterator = data . iterator ( ) ; if ( ! iterator . hasNext ( ) ) { return null ; } Statistics first = null ; while ( first == null && iterator . hasNext ( ) ) { first = iterator . next ( ) ; } if ( first == null ) return null ; int count = first . getCount ( ) ; double min = first . getMinimum ( ) . doubleValue ( ) ; double max = first . getMaximum ( ) . doubleValue ( ) ; double total = first . getAverage ( ) * first . getCount ( ) ; double totalSquare = ( first . getStdDev ( ) * first . getStdDev ( ) + first . getAverage ( ) * first . getAverage ( ) ) * first . getCount ( ) ; while ( iterator . hasNext ( ) ) { Statistics stats = iterator . next ( ) ; if ( stats . getMaximum ( ) . doubleValue ( ) > max ) max = stats . getMaximum ( ) . doubleValue ( ) ; if ( stats . getMinimum ( ) . doubleValue ( ) < min ) min = stats . getMinimum ( ) . doubleValue ( ) ; total += stats . getAverage ( ) * stats . getCount ( ) ; totalSquare += ( stats . getStdDev ( ) * stats . getStdDev ( ) + stats . getAverage ( ) * stats . getAverage ( ) ) * stats . getCount ( ) ; count += stats . getCount ( ) ; } double average = total / count ; double stdDev = Math . sqrt ( totalSquare / count - average * average ) ; return new StatisticsImpl ( count , min , max , average , stdDev ) ;
public class FunctionParamBuilder { /** * Add parameters of the given type to the end of the param list . * @ return False if this is called after optional params are added . */ public boolean addRequiredParams ( JSType ... types ) { } }
if ( hasOptionalOrVarArgs ( ) ) { return false ; } for ( JSType type : types ) { newParameter ( type ) ; } return true ;
public class KTypeHashSet { /** * { @ inheritDoc } */ @ Override public < T extends KTypeProcedure < ? super KType > > T forEach ( T procedure ) { } }
if ( hasEmptyKey ) { procedure . apply ( Intrinsics . < KType > empty ( ) ) ; } final KType [ ] keys = Intrinsics . < KType [ ] > cast ( this . keys ) ; for ( int slot = 0 , max = this . mask ; slot <= max ; slot ++ ) { KType existing ; if ( ! Intrinsics . isEmpty ( existing = keys [ slot ] ) ) { procedure . apply ( existing ) ; } } return procedure ;
public class GenericMethod { /** * Sets the value of parameter with parameterName to parameterValue . This method * does not preserve the initial insertion order . * @ param parameterName name of the parameter * @ param parameterValue value of the parameter * @ since 2.0 */ public void setParameter ( String parameterName , String parameterValue ) { } }
log . trace ( "enter PostMethod.setParameter(String, String)" ) ; removeParameter ( parameterName ) ; addParameter ( parameterName , parameterValue ) ;
public class CompatibilityMap { /** * Turn an CompatibilityMap into its encoded form * @ return the encoded form as a byte array */ public byte [ ] toEncodedForm ( ) { } }
if ( encodedForm == null ) { encodedForm = new byte [ encodedSize ( ) ] ; ArrayUtil . writeLong ( encodedForm , 0 , accessSchemaId ) ; encode ( encodedForm , new int [ ] { 8 , encodedForm . length } ) ; } return encodedForm ;
public class DDPBroadcastReceiver { /** * Override this to hook into what happens when DDP connect happens * Default behavior is to feed in the resume token if available * @ param ddp DDP singleton */ protected void onDDPConnect ( DDPStateSingleton ddp ) { } }
if ( ! ddp . isLoggedIn ( ) ) { // override this to handle first time connection ( usually to subscribe ) // if we have a login resume token , use it String resumeToken = ddp . getResumeToken ( ) ; if ( resumeToken != null ) { ddp . login ( resumeToken ) ; } }
public class ThrottleableTransport { /** * Only executed if the Allow Throttling checkbox is set in the input ' s configuration . * @ param throttleState current processing system state */ @ Subscribe public void updateThrottleState ( ThrottleState throttleState ) { } }
// Only run if throttling is enabled . if ( ! throttlingAllowed ) { return ; } // check if we are throttled final boolean throttled = determineIfThrottled ( throttleState ) ; if ( currentlyThrottled . get ( ) ) { // no need to unblock if ( throttled ) { return ; } // sanity check if ( blockLatch == null ) { log . error ( "Expected to see a transport throttle latch, but it is missing. This is a bug, continuing anyway." ) ; return ; } currentlyThrottled . set ( false ) ; handleChangedThrottledState ( false ) ; blockLatch . countDown ( ) ; } else if ( throttled ) { currentlyThrottled . set ( true ) ; handleChangedThrottledState ( true ) ; blockLatch = new CountDownLatch ( 1 ) ; }
public class StartupDatabaseConnection { /** * Separates all key / value pairs of given text string . * < b > Evaluation algorithm : < / b > < br / > * Separates the text by all found commas ( only if in front of the comma is no back slash ) . This are the key / value * pairs . A key / value pair is separated by the first equal ( ' = ' ) sign . * @ param _ text text string to convert to a key / value map * @ return Map of strings with all found key / value pairs */ public static Map < String , String > convertToMap ( final String _text ) { } }
final Map < String , String > properties = new HashMap < > ( ) ; if ( StringUtils . isNotEmpty ( _text ) ) { // separated all key / value pairs final Pattern pattern = Pattern . compile ( "(([^\\\\,])|(\\\\,)|(\\\\))*" ) ; final Matcher matcher = pattern . matcher ( _text ) ; while ( matcher . find ( ) ) { final String group = matcher . group ( ) . trim ( ) ; if ( group . length ( ) > 0 ) { // separated key from value final int index = group . indexOf ( '=' ) ; final String key = index > 0 ? group . substring ( 0 , index ) . trim ( ) : group . trim ( ) ; final String value = index > 0 ? group . substring ( index + 1 ) . trim ( ) : "" ; properties . put ( key , value ) ; } } } return properties ;
public class DObject { /** * Requests that the specified attribute be changed to the specified value . Normally the * generated setter methods should be used but in rare cases a caller may wish to update * distributed fields in a generic manner . */ public void changeAttribute ( String name , Object value ) { } }
Accessor acc = getAccessor ( name ) ; requestAttributeChange ( name , value , acc . get ( this ) ) ; acc . set ( this , value ) ;
public class KTypeVTypeHashMap { /** * Puts all key / value pairs from a given iterable into this map . */ @ Override public int putAll ( Iterable < ? extends KTypeVTypeCursor < ? extends KType , ? extends VType > > iterable ) { } }
final int count = size ( ) ; for ( KTypeVTypeCursor < ? extends KType , ? extends VType > c : iterable ) { put ( c . key , c . value ) ; } return size ( ) - count ;
public class SelectorProvider { /** * Returns the system - wide default selector provider for this invocation of * the Java virtual machine . * < p > The first invocation of this method locates the default provider * object as follows : < / p > * < ol > * < li > < p > If the system property * < tt > java . nio . channels . spi . SelectorProvider < / tt > is defined then it is * taken to be the fully - qualified name of a concrete provider class . * The class is loaded and instantiated ; if this process fails then an * unspecified error is thrown . < / p > < / li > * < li > < p > If a provider class has been installed in a jar file that is * visible to the system class loader , and that jar file contains a * provider - configuration file named * < tt > java . nio . channels . spi . SelectorProvider < / tt > in the resource * directory < tt > META - INF / services < / tt > , then the first class name * specified in that file is taken . The class is loaded and * instantiated ; if this process fails then an unspecified error is * thrown . < / p > < / li > * < li > < p > Finally , if no provider has been specified by any of the above * means then the system - default provider class is instantiated and the * result is returned . < / p > < / li > * < / ol > * < p > Subsequent invocations of this method return the provider that was * returned by the first invocation . < / p > * @ return The system - wide default selector provider */ public static SelectorProvider provider ( ) { } }
synchronized ( lock ) { if ( provider != null ) return provider ; /* return AccessController . doPrivileged ( new PrivilegedAction < SelectorProvider > ( ) { public SelectorProvider run ( ) { if ( loadProviderFromProperty ( ) ) return provider ; if ( loadProviderAsService ( ) ) return provider ; provider = sun . nio . ch . DefaultSelectorProvider . create ( ) ; return provider ; */ if ( loadProviderFromProperty ( ) ) { return provider ; } if ( loadProviderAsService ( ) ) { return provider ; } provider = sun . nio . ch . DefaultSelectorProvider . create ( ) ; return provider ; }
public class Normalizer2Impl { /** * buffer = = NULL : isNormalized / quickCheck / spanQuickCheckYes */ public int makeFCD ( CharSequence s , int src , int limit , ReorderingBuffer buffer ) { } }
// Note : In this function we use buffer - > appendZeroCC ( ) because we track // the lead and trail combining classes here , rather than leaving it to // the ReorderingBuffer . // The exception is the call to decomposeShort ( ) which uses the buffer // in the normal way . // Tracks the last FCD - safe boundary , before lccc = 0 or after properly - ordered tccc < = 1. // Similar to the prevBoundary in the compose ( ) implementation . int prevBoundary = src ; int prevSrc ; int c = 0 ; int prevFCD16 = 0 ; int fcd16 = 0 ; for ( ; ; ) { // count code units with lccc = = 0 for ( prevSrc = src ; src != limit ; ) { if ( ( c = s . charAt ( src ) ) < MIN_CCC_LCCC_CP ) { prevFCD16 = ~ c ; ++ src ; } else if ( ! singleLeadMightHaveNonZeroFCD16 ( c ) ) { prevFCD16 = 0 ; ++ src ; } else { if ( UTF16 . isSurrogate ( ( char ) c ) ) { char c2 ; if ( UTF16Plus . isSurrogateLead ( c ) ) { if ( ( src + 1 ) != limit && Character . isLowSurrogate ( c2 = s . charAt ( src + 1 ) ) ) { c = Character . toCodePoint ( ( char ) c , c2 ) ; } } else /* trail surrogate */ { if ( prevSrc < src && Character . isHighSurrogate ( c2 = s . charAt ( src - 1 ) ) ) { -- src ; c = Character . toCodePoint ( c2 , ( char ) c ) ; } } } if ( ( fcd16 = getFCD16FromNormData ( c ) ) <= 0xff ) { prevFCD16 = fcd16 ; src += Character . charCount ( c ) ; } else { break ; } } } // copy these code units all at once if ( src != prevSrc ) { if ( src == limit ) { if ( buffer != null ) { buffer . flushAndAppendZeroCC ( s , prevSrc , src ) ; } break ; } prevBoundary = src ; // We know that the previous character ' s lccc = = 0. if ( prevFCD16 < 0 ) { // Fetching the fcd16 value was deferred for this below - U + 0300 code point . int prev = ~ prevFCD16 ; prevFCD16 = prev < 0x180 ? tccc180 [ prev ] : getFCD16FromNormData ( prev ) ; if ( prevFCD16 > 1 ) { -- prevBoundary ; } } else { int p = src - 1 ; if ( Character . isLowSurrogate ( s . charAt ( p ) ) && prevSrc < p && Character . isHighSurrogate ( s . charAt ( p - 1 ) ) ) { -- p ; // Need to fetch the previous character ' s FCD value because // prevFCD16 was just for the trail surrogate code point . prevFCD16 = getFCD16FromNormData ( Character . toCodePoint ( s . charAt ( p ) , s . charAt ( p + 1 ) ) ) ; // Still known to have lccc = = 0 because its lead surrogate unit had lccc = = 0. } if ( prevFCD16 > 1 ) { prevBoundary = p ; } } if ( buffer != null ) { // The last lccc = = 0 character is excluded from the // flush - and - append call in case it needs to be modified . buffer . flushAndAppendZeroCC ( s , prevSrc , prevBoundary ) ; buffer . append ( s , prevBoundary , src ) ; } // The start of the current character ( c ) . prevSrc = src ; } else if ( src == limit ) { break ; } src += Character . charCount ( c ) ; // The current character ( c ) at [ prevSrc . . src [ has a non - zero lead combining class . // Check for proper order , and decompose locally if necessary . if ( ( prevFCD16 & 0xff ) <= ( fcd16 >> 8 ) ) { // proper order : prev tccc < = current lccc if ( ( fcd16 & 0xff ) <= 1 ) { prevBoundary = src ; } if ( buffer != null ) { buffer . appendZeroCC ( c ) ; } prevFCD16 = fcd16 ; continue ; } else if ( buffer == null ) { return prevBoundary ; // quick check " no " } else { /* * Back out the part of the source that we copied or appended * already but is now going to be decomposed . * prevSrc is set to after what was copied / appended . */ buffer . removeSuffix ( prevSrc - prevBoundary ) ; /* * Find the part of the source that needs to be decomposed , * up to the next safe boundary . */ src = findNextFCDBoundary ( s , src , limit ) ; /* * The source text does not fulfill the conditions for FCD . * Decompose and reorder a limited piece of the text . */ decomposeShort ( s , prevBoundary , src , buffer ) ; prevBoundary = src ; prevFCD16 = 0 ; } } return src ;
public class NavigationTelemetry { /** * Called when a new { @ link DirectionsRoute } is given in * { @ link MapboxNavigation # startNavigation ( DirectionsRoute ) } . * At this point , navigation has already begun and the { @ link SessionState } * needs to be updated . * @ param directionsRoute new route passed to { @ link MapboxNavigation } */ void updateSessionRoute ( DirectionsRoute directionsRoute ) { } }
SessionState . Builder navigationBuilder = navigationSessionState . toBuilder ( ) . tripIdentifier ( TelemetryUtils . obtainUniversalUniqueIdentifier ( ) ) ; navigationBuilder . currentDirectionRoute ( directionsRoute ) ; eventDispatcher . addMetricEventListeners ( this ) ; if ( isOffRoute ) { // If we are off - route , update the reroute count navigationBuilder . rerouteCount ( navigationSessionState . rerouteCount ( ) + 1 ) ; boolean hasRouteOptions = directionsRoute . routeOptions ( ) != null ; navigationBuilder . requestIdentifier ( hasRouteOptions ? directionsRoute . routeOptions ( ) . requestUuid ( ) : null ) ; navigationSessionState = navigationBuilder . build ( ) ; updateLastRerouteEvent ( directionsRoute ) ; lastRerouteDate = new Date ( ) ; isOffRoute = false ; } else { // Not current off - route - update the session navigationSessionState = navigationBuilder . build ( ) ; }
public class DiagnosticsInner { /** * Get Site Analysis . * Get Site Analysis . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param siteName Site Name * @ param diagnosticCategory Diagnostic Category * @ param analysisName Analysis Name * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws DefaultErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the DiagnosticAnalysisInner object if successful . */ public DiagnosticAnalysisInner getSiteAnalysis ( String resourceGroupName , String siteName , String diagnosticCategory , String analysisName ) { } }
return getSiteAnalysisWithServiceResponseAsync ( resourceGroupName , siteName , diagnosticCategory , analysisName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class DataPointMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DataPoint dataPoint , ProtocolMarshaller protocolMarshaller ) { } }
if ( dataPoint == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( dataPoint . getTimestamp ( ) , TIMESTAMP_BINDING ) ; protocolMarshaller . marshall ( dataPoint . getValue ( ) , VALUE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class XmlParser { /** * This is just to work around the fact that casting java . util . List < ca . uhn . fhir . model . api . ExtensionDt > to * java . util . List < ? extends org . hl7 . fhir . instance . model . api . IBaseExtension < ? , ? > > seems to be * rejected by the compiler some of the time . */ private < Q extends IBaseExtension < ? , ? > > List < IBaseExtension < ? , ? > > toBaseExtensionList ( final List < Q > theList ) { } }
List < IBaseExtension < ? , ? > > retVal = new ArrayList < IBaseExtension < ? , ? > > ( theList . size ( ) ) ; retVal . addAll ( theList ) ; return retVal ;
public class AgentSession { /** * Allows the addition of a new key - value pair to the agent ' s meta data , if the value is * new data , the revised meta data will be rebroadcast in an agent ' s presence broadcast . * @ param key the meta data key * @ param val the non - null meta data value * @ throws XMPPException if an exception occurs . * @ throws SmackException * @ throws InterruptedException */ public void setMetaData ( String key , String val ) throws XMPPException , SmackException , InterruptedException { } }
synchronized ( this . metaData ) { List < String > oldVals = metaData . get ( key ) ; if ( oldVals == null || ! oldVals . get ( 0 ) . equals ( val ) ) { oldVals . set ( 0 , val ) ; setStatus ( presenceMode , maxChats ) ; } }
public class WMultiTextFieldRenderer { /** * Paints the given WMultiTextField . * @ param component the WMultiTextField to paint . * @ param renderContext the RenderContext to paint to . */ @ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } }
WMultiTextField textField = ( WMultiTextField ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; boolean readOnly = textField . isReadOnly ( ) ; String [ ] values = textField . getTextInputs ( ) ; xml . appendTagOpen ( "ui:multitextfield" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , component . isTracking ( ) , "true" ) ; xml . appendOptionalAttribute ( "hidden" , textField . isHidden ( ) , "true" ) ; if ( readOnly ) { xml . appendAttribute ( "readOnly" , "true" ) ; } else { int cols = textField . getColumns ( ) ; int minLength = textField . getMinLength ( ) ; int maxLength = textField . getMaxLength ( ) ; int maxInputs = textField . getMaxInputs ( ) ; String pattern = textField . getPattern ( ) ; xml . appendOptionalAttribute ( "disabled" , textField . isDisabled ( ) , "true" ) ; xml . appendOptionalAttribute ( "required" , textField . isMandatory ( ) , "true" ) ; xml . appendOptionalAttribute ( "toolTip" , textField . getToolTip ( ) ) ; xml . appendOptionalAttribute ( "accessibleText" , textField . getAccessibleText ( ) ) ; xml . appendOptionalAttribute ( "size" , cols > 0 , cols ) ; xml . appendOptionalAttribute ( "minLength" , minLength > 0 , minLength ) ; xml . appendOptionalAttribute ( "maxLength" , maxLength > 0 , maxLength ) ; xml . appendOptionalAttribute ( "max" , maxInputs > 0 , maxInputs ) ; xml . appendOptionalAttribute ( "pattern" , ! Util . empty ( pattern ) , pattern ) ; // NOTE : do not use HtmlRenderUtil . getEffectivePlaceholder for placeholder - we do not want to echo " required " in every field . String placeholder = textField . getPlaceholder ( ) ; xml . appendOptionalAttribute ( "placeholder" , ! Util . empty ( placeholder ) , placeholder ) ; xml . appendOptionalAttribute ( "title" , I18nUtilities . format ( null , InternalMessages . DEFAULT_MULTITEXTFIELD_TIP ) ) ; } xml . appendClose ( ) ; if ( values != null ) { for ( String value : values ) { xml . appendTag ( "ui:value" ) ; xml . appendEscaped ( value ) ; xml . appendEndTag ( "ui:value" ) ; } } if ( ! readOnly ) { DiagnosticRenderUtil . renderDiagnostics ( textField , renderContext ) ; } xml . appendEndTag ( "ui:multitextfield" ) ;
public class AWSApplicationDiscoveryClient { /** * Retrieves attributes for a list of configuration item IDs . * < note > * All of the supplied IDs must be for the same asset type from one of the following : * < ul > * < li > * server * < / li > * < li > * application * < / li > * < li > * process * < / li > * < li > * connection * < / li > * < / ul > * Output fields are specific to the asset type specified . For example , the output for a < i > server < / i > configuration * item includes a list of attributes about the server , such as host name , operating system , number of network * cards , etc . * For a complete list of outputs for each asset type , see < a href = * " http : / / docs . aws . amazon . com / application - discovery / latest / APIReference / discovery - api - queries . html # DescribeConfigurations " * > Using the DescribeConfigurations Action < / a > . * < / note > * @ param describeConfigurationsRequest * @ return Result of the DescribeConfigurations operation returned by the service . * @ throws AuthorizationErrorException * The AWS user account does not have permission to perform the action . Check the IAM policy associated with * this account . * @ throws InvalidParameterException * One or more parameters are not valid . Verify the parameters and try again . * @ throws InvalidParameterValueException * The value of one or more parameters are either invalid or out of range . Verify the parameter values and * try again . * @ throws ServerInternalErrorException * The server experienced an internal error . Try again . * @ sample AWSApplicationDiscovery . DescribeConfigurations */ @ Override public DescribeConfigurationsResult describeConfigurations ( DescribeConfigurationsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeConfigurations ( request ) ;
public class FileUtil { /** * 判断是否为文件 , 如果file为null , 则返回false * @ param path 文件 * @ param isFollowLinks 是否跟踪软链 ( 快捷方式 ) * @ return 如果为文件true */ public static boolean isFile ( Path path , boolean isFollowLinks ) { } }
if ( null == path ) { return false ; } final LinkOption [ ] options = isFollowLinks ? new LinkOption [ 0 ] : new LinkOption [ ] { LinkOption . NOFOLLOW_LINKS } ; return Files . isRegularFile ( path , options ) ;
public class DRL6Lexer { /** * $ ANTLR end synpred1 _ DRL6Lexer */ public final boolean synpred1_DRL6Lexer ( ) { } }
state . backtracking ++ ; int start = input . mark ( ) ; try { synpred1_DRL6Lexer_fragment ( ) ; // can never throw exception } catch ( RecognitionException re ) { System . err . println ( "impossible: " + re ) ; } boolean success = ! state . failed ; input . rewind ( start ) ; state . backtracking -- ; state . failed = false ; return success ;
public class BindingsHelper { /** * Provides a mechanism for reading the system property for disabling short * form default bindings . < p > * com . ibm . websphere . ejbcontainer . disableShortDefaultBindings < p > * This property can be used to identify applications for which Short form * default jndi bindings are to be disabled . * @ param appName A string representing the applicationName we are to be * checking to see if ShortDefaultindings are disabled for . * @ return true if short default interface bindings are enabled , and false * if the property indicated they were to be disabled for * the specified application name . */ public static Boolean shortDefaultBindingsEnabled ( String appName ) { } }
if ( ContainerProperties . DisableShortDefaultBindings != null ) { if ( ContainerProperties . DisableShortDefaultBindings . size ( ) == 0 ) { // The user specified a " * " which means simple bindings are // disabled for all applications . if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Short form default binding disabled for application : " + appName ) ; return Boolean . FALSE ; } else { for ( String disabledApp : ContainerProperties . DisableShortDefaultBindings ) { if ( appName . equalsIgnoreCase ( disabledApp ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Short form default binding explicity disabled for application : " + appName ) ; return Boolean . FALSE ; } } } } // Default is Short Form Default Bindings are Enabled return Boolean . TRUE ;
public class FTPArchiveClient { /** * Creates the listener . * @ return the copy stream listener */ private static CopyStreamListener createListener ( ) { } }
return new CopyStreamListener ( ) { private long megsTotal = 0 ; // @ Override @ Override public void bytesTransferred ( CopyStreamEvent event ) { bytesTransferred ( event . getTotalBytesTransferred ( ) , event . getBytesTransferred ( ) , event . getStreamSize ( ) ) ; } // @ Override @ Override public void bytesTransferred ( long totalBytesTransferred , int bytesTransferred , long streamSize ) { long megs = totalBytesTransferred / 1000000 ; for ( long l = megsTotal ; l < megs ; l ++ ) { System . err . print ( "#" ) ; } megsTotal = megs ; } } ;
public class StorageSnippets { /** * [ VARIABLE 42] */ public Blob getBlobFromStringsWithMetageneration ( String bucketName , String blobName , long blobMetageneration ) { } }
// [ START getBlobFromStringsWithMetageneration ] Blob blob = storage . get ( bucketName , blobName , BlobGetOption . metagenerationMatch ( blobMetageneration ) ) ; // [ END getBlobFromStringsWithMetageneration ] return blob ;
public class MutateInBuilder { /** * Insert into an existing array at a specific position * ( denoted in the path , eg . " sub . array [ 2 ] " ) . * @ param path the path ( including array position ) where to insert the value . * @ param value the value to insert in the array . */ public < T > MutateInBuilder arrayInsert ( String path , T value ) { } }
asyncBuilder . arrayInsert ( path , value ) ; return this ;
public class AbstractEndpointBuilder { /** * Initializes the endpoint . * @ return */ public AbstractEndpointBuilder < T > initialize ( ) { } }
if ( getEndpoint ( ) instanceof InitializingBean ) { try { ( ( InitializingBean ) getEndpoint ( ) ) . afterPropertiesSet ( ) ; } catch ( Exception e ) { throw new CitrusRuntimeException ( "Failed to initialize endpoint" , e ) ; } } return this ;
public class MementoResource { /** * Create a response builder for a TimeGate response . * @ param mementos the list of memento ranges * @ param req the LDP request * @ param baseUrl the base URL * @ return a response builder object */ public ResponseBuilder getTimeGateBuilder ( final SortedSet < Instant > mementos , final TrellisRequest req , final String baseUrl ) { } }
final String identifier = fromUri ( baseUrl ) . path ( req . getPath ( ) ) . build ( ) . toString ( ) ; return status ( FOUND ) . location ( fromUri ( identifier + "?version=" + req . getDatetime ( ) . getInstant ( ) . getEpochSecond ( ) ) . build ( ) ) . link ( identifier , ORIGINAL + " " + TIMEGATE ) . links ( getMementoLinks ( identifier , mementos ) . map ( this :: filterLinkParams ) . toArray ( Link [ ] :: new ) ) . header ( VARY , ACCEPT_DATETIME ) ;
public class Promise { /** * Returns a new Promise that is completed when all of the given Promise * complete . If any of the given Promise complete exceptionally , then the * returned Promise also does so , with a Promise holding this exception as * its cause . * @ param promises * array of Promises * @ return a new Promise that is completed when all of the given Promises * complete */ public static final Promise all ( Collection < Promise > promises ) { } }
if ( promises == null || promises . isEmpty ( ) ) { return Promise . resolve ( ) ; } Promise [ ] array = new Promise [ promises . size ( ) ] ; promises . toArray ( array ) ; return all ( array ) ;
public class WebJars { /** * Checks whether the given file is a WebJar or not ( http : / / www . webjars . org / documentation ) . * The check is based on the presence of { @ literal META - INF / resources / webjars / } directory in the jar file . * @ param file the file . * @ return { @ literal true } if it ' s a bundle , { @ literal false } otherwise . */ public static boolean isWebJar ( File file ) { } }
Set < String > found = new LinkedHashSet < > ( ) ; if ( file . isFile ( ) && file . getName ( ) . endsWith ( ".jar" ) ) { JarFile jar = null ; try { jar = new JarFile ( file ) ; // Fast return if the base structure is not there if ( jar . getEntry ( WEBJAR_LOCATION ) == null ) { return false ; } Enumeration < JarEntry > entries = jar . entries ( ) ; while ( entries . hasMoreElements ( ) ) { JarEntry entry = entries . nextElement ( ) ; Matcher matcher = WEBJAR_REGEX . matcher ( entry . getName ( ) ) ; if ( matcher . matches ( ) ) { found . add ( matcher . group ( 1 ) + "-" + matcher . group ( 2 ) ) ; } } } catch ( IOException e ) { LoggerFactory . getLogger ( DependencyCopy . class ) . error ( "Cannot check if the file {} is a webjar, " + "cannot open it" , file . getName ( ) , e ) ; return false ; } finally { final JarFile finalJar = jar ; IOUtils . closeQuietly ( new Closeable ( ) { @ Override public void close ( ) throws IOException { if ( finalJar != null ) { finalJar . close ( ) ; } } } ) ; } for ( String lib : found ) { LoggerFactory . getLogger ( DependencyCopy . class ) . info ( "Web Library found in {} : {}" , file . getName ( ) , lib ) ; } return ! found . isEmpty ( ) ; } return false ;
public class CheckFormatMojo { /** * Checks the formatting of the given { @ code file } . The file is read using the given { @ code encoding } and the * violations are reported to the given { @ code violationHandler } . * @ param file the file to check * @ param encoding the encoding to use for reading the { @ code file } * @ param violationHandler the { @ link XmlFormatViolationHandler } to report violations * @ throws MojoExecutionException if there is any lover level exception reading or parsing the file . */ private void check ( File file , String encoding , XmlFormatViolationHandler violationHandler ) throws MojoExecutionException { } }
Reader in = null ; try { in = new InputStreamReader ( new FileInputStream ( file ) , encoding ) ; SAXParser saxParser = saxParserFactory . newSAXParser ( ) ; IndentCheckSaxHandler handler = new IndentCheckSaxHandler ( file , indentSize , violationHandler ) ; saxParser . parse ( new InputSource ( in ) , handler ) ; } catch ( Exception e ) { throw new MojoExecutionException ( "Could not process file " + file . getAbsolutePath ( ) , e ) ; } finally { if ( in != null ) { try { in . close ( ) ; } catch ( IOException e ) { getLog ( ) . error ( "Could not close Reader for " + file . getAbsolutePath ( ) , e ) ; } } }
public class Repartitioner { /** * Randomly shuffle partitions between nodes within every zone . * @ param nextCandidateCluster cluster object . * @ param randomSwapAttempts See RebalanceCLI . * @ param randomSwapSuccesses See RebalanceCLI . * @ param randomSwapZoneIds The set of zoneIds to consider . Each zone is done * independently . * @ param storeDefs List of store definitions * @ return updated cluster */ public static Cluster randomShufflePartitions ( final Cluster nextCandidateCluster , final int randomSwapAttempts , final int randomSwapSuccesses , final List < Integer > randomSwapZoneIds , List < StoreDefinition > storeDefs ) { } }
List < Integer > zoneIds = null ; if ( randomSwapZoneIds . isEmpty ( ) ) { zoneIds = new ArrayList < Integer > ( nextCandidateCluster . getZoneIds ( ) ) ; } else { zoneIds = new ArrayList < Integer > ( randomSwapZoneIds ) ; } List < Integer > nodeIds = new ArrayList < Integer > ( ) ; Cluster returnCluster = Cluster . cloneCluster ( nextCandidateCluster ) ; double currentUtility = new PartitionBalance ( returnCluster , storeDefs ) . getUtility ( ) ; int successes = 0 ; for ( int i = 0 ; i < randomSwapAttempts ; i ++ ) { // Iterate over zone ids to decide which node ids to include for // intra - zone swapping . // In future , if there is a need to support inter - zone swapping , // then just remove the // zone specific logic that populates nodeIdSet and add all nodes // from across all zones . int zoneIdOffset = i % zoneIds . size ( ) ; Set < Integer > nodeIdSet = nextCandidateCluster . getNodeIdsInZone ( zoneIds . get ( zoneIdOffset ) ) ; nodeIds = new ArrayList < Integer > ( nodeIdSet ) ; Collections . shuffle ( zoneIds , new Random ( System . currentTimeMillis ( ) ) ) ; Cluster shuffleResults = swapRandomPartitionsAmongNodes ( returnCluster , nodeIds ) ; double nextUtility = new PartitionBalance ( shuffleResults , storeDefs ) . getUtility ( ) ; if ( nextUtility < currentUtility ) { System . out . println ( "Swap improved max-min ratio: " + currentUtility + " -> " + nextUtility + " (improvement " + successes + " on swap attempt " + i + ")" ) ; successes ++ ; returnCluster = shuffleResults ; currentUtility = nextUtility ; } if ( successes >= randomSwapSuccesses ) { // Enough successes , move on . break ; } } return returnCluster ;
public class MySQLManager { /** * Creates an instance of MySQLManager that exposes DBforMySQL resource management API entry points . * @ param credentials the credentials to use * @ param subscriptionId the subscription UUID * @ return the MySQLManager */ public static MySQLManager authenticate ( AzureTokenCredentials credentials , String subscriptionId ) { } }
return new MySQLManager ( new RestClient . Builder ( ) . withBaseUrl ( credentials . environment ( ) , AzureEnvironment . Endpoint . RESOURCE_MANAGER ) . withCredentials ( credentials ) . withSerializerAdapter ( new AzureJacksonAdapter ( ) ) . withResponseBuilderFactory ( new AzureResponseBuilder . Factory ( ) ) . build ( ) , subscriptionId ) ;
public class BuildsInner { /** * Patch the build properties . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param buildId The build ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the BuildInner object */ public Observable < ServiceResponse < BuildInner > > beginUpdateWithServiceResponseAsync ( String resourceGroupName , String registryName , String buildId ) { } }
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( registryName == null ) { throw new IllegalArgumentException ( "Parameter registryName is required and cannot be null." ) ; } if ( buildId == null ) { throw new IllegalArgumentException ( "Parameter buildId is required and cannot be null." ) ; } final String apiVersion = "2018-02-01-preview" ; final Boolean isArchiveEnabled = null ; BuildUpdateParameters buildUpdateParameters = new BuildUpdateParameters ( ) ; buildUpdateParameters . withIsArchiveEnabled ( null ) ; return service . beginUpdate ( this . client . subscriptionId ( ) , resourceGroupName , registryName , buildId , apiVersion , this . client . acceptLanguage ( ) , buildUpdateParameters , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < BuildInner > > > ( ) { @ Override public Observable < ServiceResponse < BuildInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < BuildInner > clientResponse = beginUpdateDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class ConvertBufferedImage { /** * Draws the component into a BufferedImage . * @ param compThe component being drawn into an image . * @ param storage if not null the component is drawn into it , if null a new BufferedImage is created . * @ return image of the component */ public static BufferedImage convertTo ( JComponent comp , BufferedImage storage ) { } }
if ( storage == null ) storage = new BufferedImage ( comp . getWidth ( ) , comp . getHeight ( ) , BufferedImage . TYPE_INT_RGB ) ; Graphics2D g2 = storage . createGraphics ( ) ; comp . paintComponents ( g2 ) ; return storage ;
public class IPAddressSection { /** * Starting from the first host bit according to the prefix , if the section is a sequence of zeros in both low and high values , * followed by a sequence where low values are zero and high values are 1 , then the section is a subnet prefix . * Note that this includes sections where hosts are all zeros , or sections where hosts are full range of values , * so the sequence of zeros can be empty and the sequence of where low values are zero and high values are 1 can be empty as well . * However , if they are both empty , then this returns false , there must be at least one bit in the sequence . */ protected static boolean isPrefixSubnet ( IPAddressSegment sectionSegments [ ] , Integer networkPrefixLength , IPAddressNetwork < ? , ? , ? , ? , ? > network , boolean fullRangeOnly ) { } }
int segmentCount = sectionSegments . length ; if ( segmentCount == 0 ) { return false ; } IPAddressSegment seg = sectionSegments [ 0 ] ; return ParsedAddressGrouping . isPrefixSubnet ( ( segmentIndex ) -> sectionSegments [ segmentIndex ] . getSegmentValue ( ) , ( segmentIndex ) -> sectionSegments [ segmentIndex ] . getUpperSegmentValue ( ) , segmentCount , seg . getByteCount ( ) , seg . getBitCount ( ) , seg . getMaxSegmentValue ( ) , networkPrefixLength , network . getPrefixConfiguration ( ) , fullRangeOnly ) ;
public class AbstractObjectTarget { /** * { @ inheritDoc } */ public Set < String > getPropertyNames ( ) { } }
List < PropertyDescriptor > properties = getWriteableProperties ( m_itemClass ) ; Set < String > propertyNames = new HashSet < String > ( properties . size ( ) ) ; for ( PropertyDescriptor pd : properties ) { propertyNames . add ( pd . getName ( ) ) ; } return propertyNames ;
public class MutableDocument { /** * Set a dictionary as a content . Allowed value types are List , Date , Map , Number , null , String , * Array , Blob , and Dictionary . The List and Map must contain only the above types . * Setting the new dictionary content will replace the current data including the existing Array * and Dictionary objects . * @ param data the dictionary object . * @ return this Document instance */ @ NonNull @ Override public MutableDocument setData ( Map < String , Object > data ) { } }
( ( MutableDictionary ) internalDict ) . setData ( data ) ; return this ;
public class AFPChainer { /** * return the root mean square of the distance matrix between the residues * from the segments that form the given AFP list * this value can be a measurement ( 2 ) for the connectivity of the AFPs * and its calculation is quicker than the measurement ( 1 ) , rmsd * currently only deal with AFP pair * | - d1 - - | * | - - d2 - - - | * | - - - d3 - - - - | * this module is optimized * @ param afp1 * @ param afp2 * @ return */ private static double calAfpDis ( int afp1 , int afp2 , FatCatParameters params , AFPChain afpChain ) { } }
List < AFP > afpSet = afpChain . getAfpSet ( ) ; Matrix disTable1 = afpChain . getDisTable1 ( ) ; Matrix disTable2 = afpChain . getDisTable2 ( ) ; int fragLen = params . getFragLen ( ) ; double afpDisCut = params . getAfpDisCut ( ) ; double disCut = params . getDisCut ( ) ; double fragLenSq = params . getFragLenSq ( ) ; int i , j , ai , bi , aj , bj ; double d ; double rms = 0 ; for ( i = 0 ; i < fragLen ; i ++ ) { ai = afpSet . get ( afp1 ) . getP1 ( ) + i ; bi = afpSet . get ( afp1 ) . getP2 ( ) + i ; for ( j = 0 ; j < fragLen ; j ++ ) { aj = afpSet . get ( afp2 ) . getP1 ( ) + j ; bj = afpSet . get ( afp2 ) . getP2 ( ) + j ; d = disTable1 . get ( aj , ai ) - disTable2 . get ( bj , bi ) ; rms += d * d ; if ( rms > afpDisCut ) { return ( disCut ) ; } } } return ( Math . sqrt ( rms / fragLenSq ) ) ;
public class MappingUtil { /** * Remove the given item * @ param columnFamily * column family of the item * @ param item * the item to remove * @ throws Exception * errors */ public < T , K > void remove ( ColumnFamily < K , String > columnFamily , T item ) throws Exception { } }
@ SuppressWarnings ( { "unchecked" } ) Class < T > clazz = ( Class < T > ) item . getClass ( ) ; Mapping < T > mapping = getMapping ( clazz ) ; @ SuppressWarnings ( { "unchecked" } ) Class < K > idFieldClass = ( Class < K > ) mapping . getIdFieldClass ( ) ; // safe - // after // erasure , // this is // all // just // Class // anyway MutationBatch mutationBatch = keyspace . prepareMutationBatch ( ) ; mutationBatch . withRow ( columnFamily , mapping . getIdValue ( item , idFieldClass ) ) . delete ( ) ; mutationBatch . execute ( ) ;
public class PrefixedProperties { /** * ( non - Javadoc ) * @ see java . util . Properties # loadFromXML ( java . io . InputStream ) */ @ Override public void loadFromXML ( final InputStream in ) throws IOException { } }
lock . writeLock ( ) . lock ( ) ; try { properties . loadFromXML ( in ) ; } finally { lock . writeLock ( ) . unlock ( ) ; }
public class MinibatchLbfgs { /** * Creates a minibatch LBFGS trainer that iterates over { @ code batchIterations } * minibatches , where each batch contains { @ code examplesPerMinibatch } examples * and is optimized with LBFGS for { @ code iterationsPerMinibatch } . * @ param numVectorsInApproximation * @ param l2Regularization * @ param batchIterations * @ param examplesPerMinibatch * @ param iterationsPerMinibatch * @ param log * @ return */ public static MinibatchLbfgs createFixedSchedule ( int numVectorsInApproximation , double l2Regularization , int batchIterations , int examplesPerMinibatch , int iterationsPerMinibatch , LogFunction log ) { } }
int [ ] minibatchSizeSchedule = new int [ batchIterations ] ; int [ ] maxIterationsPerMinibatch = new int [ batchIterations ] ; Arrays . fill ( minibatchSizeSchedule , examplesPerMinibatch ) ; Arrays . fill ( maxIterationsPerMinibatch , iterationsPerMinibatch ) ; return new MinibatchLbfgs ( numVectorsInApproximation , l2Regularization , minibatchSizeSchedule , maxIterationsPerMinibatch , log ) ;
import java . io . * ; import java . lang . * ; import java . util . * ; import java . math . * ; class Main { /** * Java function to determine the minimum number of operations required * to make two numbers equal . * Examples : * > > > min _ steps _ to _ equate _ numbers ( 2 , 4) * > > > min _ steps _ to _ equate _ numbers ( 4 , 10) * > > > min _ steps _ to _ equate _ numbers ( 1 , 4) */ public static int min_steps_to_equate_numbers ( int num1 , int num2 ) { } // Function to return the greatest common divisor static int gcd ( int a , int b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } }
if ( num1 > num2 ) { int temp = num1 ; num1 = num2 ; num2 = temp ; } num2 = num2 / gcd ( num1 , num2 ) ; return num2 - 1 ;
public class ChangeTracker { /** * ( See issues iOS # 1020 , # 1267 , Android # 978) */ private boolean isCloudantAuthError ( Response response ) { } }
String server = response . header ( "Server" ) ; // Cloudant could send ` CouchDB / ad97a06 ( Erlang OTP / 17 ) ` as Server header value // Another cloudant server value example : ` CouchDB / 1.0.2 ` if ( server == null || server . indexOf ( "CouchDB/" ) == - 1 ) // ( Accurate as of 5/2016) return false ; // Note : 401 ( UNAUTHORIZED ) might not be caused by Cloudant // Before adding fix for 401 , we need a test environment . return response . code ( ) == Status . FORBIDDEN ;
public class ApiOvhMetrics { /** * Modify a token * REST : PUT / metrics / { serviceName } / token / { tokenId } * @ param description [ required ] New description for your token * @ param serviceName [ required ] Name of your service * @ param tokenId [ required ] ID of the desired token * API beta */ public OvhToken serviceName_token_tokenId_PUT ( String serviceName , String tokenId , String description ) throws IOException { } }
String qPath = "/metrics/{serviceName}/token/{tokenId}" ; StringBuilder sb = path ( qPath , serviceName , tokenId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "description" , description ) ; String resp = exec ( qPath , "PUT" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhToken . class ) ;
public class CommercePriceListAccountRelPersistenceImpl { /** * Returns the first commerce price list account rel in the ordered set where commercePriceListId = & # 63 ; . * @ param commercePriceListId the commerce price list ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce price list account rel * @ throws NoSuchPriceListAccountRelException if a matching commerce price list account rel could not be found */ @ Override public CommercePriceListAccountRel findByCommercePriceListId_First ( long commercePriceListId , OrderByComparator < CommercePriceListAccountRel > orderByComparator ) throws NoSuchPriceListAccountRelException { } }
CommercePriceListAccountRel commercePriceListAccountRel = fetchByCommercePriceListId_First ( commercePriceListId , orderByComparator ) ; if ( commercePriceListAccountRel != null ) { return commercePriceListAccountRel ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commercePriceListId=" ) ; msg . append ( commercePriceListId ) ; msg . append ( "}" ) ; throw new NoSuchPriceListAccountRelException ( msg . toString ( ) ) ;
public class PushSync { /** * List of SNS platform application ARNs that could be used by clients . * @ return List of SNS platform application ARNs that could be used by clients . */ public java . util . List < String > getApplicationArns ( ) { } }
if ( applicationArns == null ) { applicationArns = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return applicationArns ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link DoorType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link DoorType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/tunnel/2.0" , name = "Door" , substitutionHeadNamespace = "http://www.opengis.net/citygml/tunnel/2.0" , substitutionHeadName = "_Opening" ) public JAXBElement < DoorType > createDoor ( DoorType value ) { } }
return new JAXBElement < DoorType > ( _Door_QNAME , DoorType . class , null , value ) ;
public class BaseSerializer { /** * Serialize a list of IReducers */ public String serializeReducerList ( List < IAssociativeReducer > list ) { } }
ObjectMapper om = getObjectMapper ( ) ; try { return om . writeValueAsString ( new ListWrappers . ReducerList ( list ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class AbstrCFMLScriptTransformer { /** * Liest ein while Statement ein . < br / > * EBNF : < br / > * < code > spaces condition spaces " ) " spaces block ; < / code > * @ return while Statement * @ throws TemplateException */ private final While whileStatement ( Data data ) throws TemplateException { } }
int pos = data . srcCode . getPos ( ) ; // id String id = variableDec ( data , false ) ; if ( id == null ) { data . srcCode . setPos ( pos ) ; return null ; } if ( id . equalsIgnoreCase ( "while" ) ) { id = null ; data . srcCode . removeSpace ( ) ; if ( ! data . srcCode . forwardIfCurrent ( '(' ) ) { data . srcCode . setPos ( pos ) ; return null ; } } else { data . srcCode . removeSpace ( ) ; if ( ! data . srcCode . forwardIfCurrent ( ':' ) ) { data . srcCode . setPos ( pos ) ; return null ; } data . srcCode . removeSpace ( ) ; if ( ! data . srcCode . forwardIfCurrent ( "while" , '(' ) ) { data . srcCode . setPos ( pos ) ; return null ; } } Position line = data . srcCode . getPosition ( ) ; Body body = new BodyBase ( data . factory ) ; While whil = new While ( condition ( data ) , body , line , null , id ) ; if ( ! data . srcCode . forwardIfCurrent ( ')' ) ) throw new TemplateException ( data . srcCode , "while statement must end with a [)]" ) ; Body prior = data . setParent ( body ) ; statement ( data , body , CTX_WHILE ) ; data . setParent ( prior ) ; whil . setEnd ( data . srcCode . getPosition ( ) ) ; return whil ;
public class VerificationConditionGenerator { private Context translateStatementBlock ( WyilFile . Stmt . Block block , Context context ) { } }
for ( int i = 0 ; i != block . size ( ) ; ++ i ) { WyilFile . Stmt stmt = block . get ( i ) ; context = translateStatement ( stmt , context ) ; if ( stmt instanceof WyilFile . Stmt . Return ) { return null ; } } return context ;
public class JMEmbeddedElasticsearch { /** * ( non - Javadoc ) * @ see org . elasticsearch . node . Node # start ( ) */ @ Override public Node start ( ) { } }
try { Node node = super . start ( ) ; JMThread . sleep ( 1000 ) ; return node ; } catch ( NodeValidationException e ) { return JMExceptionManager . handleExceptionAndThrowRuntimeEx ( log , e , "start" ) ; }
public class EventsHelper { /** * Bind a function to the mouseup event of each matched element . * @ param jsScope * Scope to use * @ return the jQuery code */ public static ChainableStatement mouseup ( JsScope jsScope ) { } }
return new DefaultChainableStatement ( MouseEvent . MOUSEUP . getEventLabel ( ) , jsScope . render ( ) ) ;
public class Json { /** * Proxy method for getting the Parser and calling parse ( ) . * @ param data JSON byte array to be parsed . * @ param type Deserialized type for the JSON data * @ param < T > Deserialzed object type * @ return The JSON data deserialized */ public static < T > T parse ( byte [ ] data , Type type ) { } }
return Holder . parser . parse ( data , type ) ;
public class KieServerHttpRequest { /** * Set the ' Content - Type ' request header to the given value and charset * @ param contentType * @ param charset * @ return this request */ public KieServerHttpRequest contentType ( final String contentType , final String charset ) { } }
if ( charset != null && charset . length ( ) > 0 ) { final String separator = "; " + PARAM_CHARSET + '=' ; return header ( CONTENT_TYPE , contentType + separator + charset ) ; } else return header ( CONTENT_TYPE , contentType ) ;
public class Vector { /** * Subtracts a vector from this one . * @ param vec The other vector * @ return the same vector */ public Vector subtract ( Vector vec ) { } }
x -= vec . x ; y -= vec . y ; z -= vec . z ; return this ;
public class ApiOvhTelephony { /** * Alter this object properties * REST : PUT / telephony / { billingAccount } / line / { serviceName } / phone * @ param body [ required ] New object properties * @ param billingAccount [ required ] The name of your billingAccount * @ param serviceName [ required ] */ public void billingAccount_line_serviceName_phone_PUT ( String billingAccount , String serviceName , OvhPhone body ) throws IOException { } }
String qPath = "/telephony/{billingAccount}/line/{serviceName}/phone" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class SingletonGrid { @ Override public ImmutableSet < Cell < V > > cells ( ) { } }
return ImmutableSet . < Cell < V > > of ( cell ) ;
public class CmsLocaleManager { /** * Adds a locale to the list of available locales . < p > * @ param localeName the locale to add */ public void addAvailableLocale ( String localeName ) { } }
Locale locale = getLocale ( localeName ) ; // add full variation ( language / country / variant ) if ( ! m_availableLocales . contains ( locale ) ) { m_availableLocales . add ( locale ) ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_I18N_CONFIG_ADD_LOCALE_1 , locale ) ) ; } } // add variation with only language and country locale = new Locale ( locale . getLanguage ( ) , locale . getCountry ( ) ) ; if ( ! m_availableLocales . contains ( locale ) ) { m_availableLocales . add ( locale ) ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_I18N_CONFIG_ADD_LOCALE_1 , locale ) ) ; } } // add variation with language only locale = new Locale ( locale . getLanguage ( ) ) ; if ( ! m_availableLocales . contains ( locale ) ) { m_availableLocales . add ( locale ) ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_I18N_CONFIG_ADD_LOCALE_1 , locale ) ) ; } }
public class WeekDay { /** * Returns the corresponding day constant to the specified * java . util . Calendar . DAY _ OF _ WEEK property . * @ param calDay a property value of java . util . Calendar . DAY _ OF _ WEEK * @ return a string , or null if an invalid DAY _ OF _ WEEK property is * specified */ public static WeekDay getDay ( final int calDay ) { } }
WeekDay day = null ; switch ( calDay ) { case Calendar . SUNDAY : day = SU ; break ; case Calendar . MONDAY : day = MO ; break ; case Calendar . TUESDAY : day = TU ; break ; case Calendar . WEDNESDAY : day = WE ; break ; case Calendar . THURSDAY : day = TH ; break ; case Calendar . FRIDAY : day = FR ; break ; case Calendar . SATURDAY : day = SA ; break ; default : break ; } return day ;
public class AuthzFacadeImpl { /** * ( non - Javadoc ) * @ see com . att . authz . facade . AuthzFacade # requestNS ( com . att . authz . env . AuthzTrans , javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse ) */ @ Override public Result < Void > deleteNS ( AuthzTrans trans , HttpServletRequest req , HttpServletResponse resp , String ns ) { } }
TimeTaken tt = trans . start ( DELETE_NS + ' ' + ns , Env . SUB | Env . ALWAYS ) ; try { Result < Void > rp = service . deleteNS ( trans , ns ) ; switch ( rp . status ) { case OK : setContentType ( resp , nsRequestDF . getOutType ( ) ) ; return Result . ok ( ) ; default : return Result . err ( rp ) ; } } catch ( Exception e ) { trans . error ( ) . log ( e , IN , DELETE_NS ) ; return Result . err ( e ) ; } finally { tt . done ( ) ; }
public class AccountsInner { /** * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account . The response includes a link to the next page , if any . * @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account . * @ param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts . * @ param filter OData filter . Optional . * @ param top The number of items to return . Optional . * @ param skip The number of items to skip over before returning elements . Optional . * @ param expand OData expansion . Expand related resources in line with the retrieved resources , e . g . Categories / $ expand = Products would expand Product data in line with each Category entry . Optional . * @ param select OData Select statement . Limits the properties on each entry to just those requested , e . g . Categories ? $ select = CategoryName , Description . Optional . * @ param orderby OrderBy clause . One or more comma - separated expressions with an optional " asc " ( the default ) or " desc " depending on the order you ' d like the values sorted , e . g . Categories ? $ orderby = CategoryName desc . Optional . * @ param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response , e . g . Categories ? $ count = true . Optional . * @ param search A free form search . A free - text search expression to match for whether a particular entry should be included in the feed , e . g . Categories ? $ search = blue OR green . Optional . * @ param format The desired return format . Return the response in particular formatxii without access to request headers for standard content - type negotiation ( e . g Orders ? $ format = json ) . Optional . * @ 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 < DataLakeStoreAccountInfoInner > > listDataLakeStoreAccountsAsync ( final String resourceGroupName , final String accountName , final String filter , final Integer top , final Integer skip , final String expand , final String select , final String orderby , final Boolean count , final String search , final String format , final ListOperationCallback < DataLakeStoreAccountInfoInner > serviceCallback ) { } }
return AzureServiceFuture . fromPageResponse ( listDataLakeStoreAccountsSinglePageAsync ( resourceGroupName , accountName , filter , top , skip , expand , select , orderby , count , search , format ) , new Func1 < String , Observable < ServiceResponse < Page < DataLakeStoreAccountInfoInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DataLakeStoreAccountInfoInner > > > call ( String nextPageLink ) { return listDataLakeStoreAccountsNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ;