signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createINR ( ) */ @ Override public InformationRequestMessage createINR ( ) { } }
InformationRequestMessage msg = new InformationRequestMessageImpl ( _INR_HOLDER . mandatoryCodes , _INR_HOLDER . mandatoryVariableCodes , _INR_HOLDER . optionalCodes , _INR_HOLDER . mandatoryCodeToIndex , _INR_HOLDER . mandatoryVariableCodeToIndex , _INR_HOLDER . optionalCodeToIndex ) ; return msg ;
public class ConfigEvaluator { /** * Process and evaluate a raw String value . */ private Object convertStringToSingleValue ( String rawValue , ExtendedAttributeDefinition attrDef , EvaluationContext context , boolean ignoreWarnings ) throws ConfigEvaluatorException { } }
String value = processString ( rawValue , attrDef , context , ignoreWarnings ) ; return evaluateString ( value , attrDef , context ) ;
public class BackedHashMap { /** * doTimeBasedWrites - called periodically when time - based - writes is configured */ public void doTimeBasedWrites ( boolean forceWrite ) { } }
// create local variable - JIT performance improvement final boolean isTraceOn = com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINER ) ) { LoggingUtil . SESSION_LOGGER_WAS . entering ( methodClassName , methodNames [ DO_TIME_BASED_WRITES ] ) ; } BackedSession cachedSession ; Object currentKey ; if ( forceWrite ) { if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ DO_TIME_BASED_WRITES ] , "Entered for forceWrite request" ) ; } } long now = System . currentTimeMillis ( ) ; long writeInterval = _smc . getPropertyWriterInterval ( ) * 1000 ; // convert seconds to milliseconds Enumeration vEnum = tableKeys ( ) ; if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ DO_TIME_BASED_WRITES ] , "!!!!!!!!!!PropertyWriteThread Loop STARTS Here!!!!!!!!!!!!! " ) ; } while ( vEnum . hasMoreElements ( ) ) { // LoggingUtil . SESSION _ LOGGER _ WAS . logp ( Level . FINE , methodClassName , methodName , " Look at next Cache Element " ) ; currentKey = ( Object ) vEnum . nextElement ( ) ; cachedSession = ( BackedSession ) super . get ( currentKey ) ; if ( cachedSession != null ) { // LoggingUtil . SESSION _ LOGGER _ WAS . logp ( Level . FINE , methodClassName , methodName , " Cache element NOT NULL " ) ; long lastWrite = cachedSession . getLastWriteTime ( ) ; long lastAccess = cachedSession . getCurrentAccessTime ( ) ; // English Translation for the test below : // If lastWrite is - 1 // then the session must have just been read into // the cache . . . Don ' t know when the lastWrite was or // if something has changed since the read . . Therefore // do the write . This shouldn ' t happen often . // If the Write Interval has elapsed and the session has been // changed then do the write . This should be the normal case . if ( ( lastWrite == - 1 ) || ( ( ( ( now - lastWrite ) > writeInterval ) || forceWrite ) && ( lastAccess > lastWrite ) ) ) { /* * commented out in old code * / / LoggingUtil . SESSION _ LOGGER _ WAS . debug ( SessionContext . tc , SessionConstants . doTimeBasedWrites + " Passed test . . . consider doing the write " ) ; * end of commented out code */ // Hold synchronized lock while we check if this session is // executing in the servlet service method . New request threads // for this session will call the incrementInServiceMethodCount ( ) // method . That method also does a " synchronized " on the session // object , therefore guaranteeing that no new requests will update the // session object until this write completes . synchronized ( cachedSession ) { // Now that we have the session Object locked , check that the // session is still valid . It is possible that the servlet // called the session . invalidate ( ) method under a different // thread after we got the keys from the cache . Since // sessionData . invalidate ( ) does a sync on the session , it is now // safe to check . . . // Also , account for the case where the session was aged out // of the cache after we got the keys above . . . // We will never get here for a Timed Out invalidation since // the Invalidation time must be at least twice the Write Interval // and the write will always be done before an invalidation condition // can occur . // cachedSession = ( DatabaseSessionData ) ( ( BackedHashtable ) mSessions ) . superGet ( currentKey ) ; if ( cachedSession . isValid ( ) ) { String id = cachedSession . getId ( ) ; // if the refCount ! = 0 , it is still active in the service method if ( cachedSession . getRefCount ( ) != 0 ) { // skip the entry . . The next time this thread runs // it will get tried again . . . cachedSession . deferWriteUntilNextTick ++ ; if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ DO_TIME_BASED_WRITES ] , "Defer write until next time since session is in the service method " + cachedSession . deferWriteUntilNextTick + " " + id ) ; } // Failed to write on 5 tries . Force the write to database ! ! if ( cachedSession . deferWriteUntilNextTick > 5 ) { if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ DO_TIME_BASED_WRITES ] , "Failed to write on 5 tries. Force the write to database!! " + " " + id ) ; } cachedSession . setLastWriteTime ( now ) ; // cachedSession . sync ( ) ; cachedSession . flush ( ) ; cachedSession . deferWriteUntilNextTick = 0 ; } } else { if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ DO_TIME_BASED_WRITES ] , "Do the session Write and update lastWriteTime " + id ) ; } // It is important to note that lastWriteTime is being // updated to the current time ( now ) , though lastAccess may // contain a value up to Now - WriteInterval . After this // write completes it is possible that the Session is // used again . The Write of LastAccess will not take // place again until WriteInterval elapses again . So , in order // for this session not to be inadvertently invalidated // by a different clone , it is necessary that the invalidation // time be AT LEAST 2 TIMES the WriteInterval . This should // be enforced in the GUI . cachedSession . setLastWriteTime ( now ) ; cachedSession . flush ( ) ; // do the write cachedSession . deferWriteUntilNextTick = 0 ; } } else { if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ DO_TIME_BASED_WRITES ] , "Session no longer in Cache!" ) ; } } } // end of synchronized } else { // Database Write did NOT occur // LoggingUtil . SESSION _ LOGGER _ WAS . logp ( Level . FINE , methodClassName , methodName , " Database Write did NOT occur ! " ) ; } } else { if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ DO_TIME_BASED_WRITES ] , "The Cache element is NULL" ) ; } } } if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ DO_TIME_BASED_WRITES ] , "!!!!!!!!!! PropertyWriteThread Loop ENDS Here!!!!!!!!!!!!!" ) ; }
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcAnnotationFillAreaOccurrence ( ) { } }
if ( ifcAnnotationFillAreaOccurrenceEClass == null ) { ifcAnnotationFillAreaOccurrenceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 15 ) ; } return ifcAnnotationFillAreaOccurrenceEClass ;
public class AcpService { /** * 功能 : 前台交易构造HTTP POST自动提交表单 < br > * @ param action 表单提交地址 < br > * @ param hiddens 以MAP形式存储的表单键值 < br > * @ param encoding 上送请求报文域encoding字段的值 < br > * @ return 构造好的HTTP POST交易表单 < br > */ public static String createAutoFormHtml ( String reqUrl , Map < String , String > hiddens , String encoding ) { } }
StringBuffer sf = new StringBuffer ( ) ; sf . append ( "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=" + encoding + "\"/></head><body>" ) ; sf . append ( "<form id = \"pay_form\" action=\"" + reqUrl + "\" method=\"post\">" ) ; if ( null != hiddens && 0 != hiddens . size ( ) ) { Set < Entry < String , String > > set = hiddens . entrySet ( ) ; Iterator < Entry < String , String > > it = set . iterator ( ) ; while ( it . hasNext ( ) ) { Entry < String , String > ey = it . next ( ) ; String key = ey . getKey ( ) ; String value = ey . getValue ( ) ; sf . append ( "<input type=\"hidden\" name=\"" + key + "\" id=\"" + key + "\" value=\"" + value + "\"/>" ) ; } } sf . append ( "</form>" ) ; sf . append ( "</body>" ) ; sf . append ( "<script type=\"text/javascript\">" ) ; sf . append ( "document.all.pay_form.submit();" ) ; sf . append ( "</script>" ) ; sf . append ( "</html>" ) ; return sf . toString ( ) ;
public class SyncAgentsInner { /** * Gets a sync agent . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server on which the sync agent is hosted . * @ param syncAgentName The name of the sync agent . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the SyncAgentInner object if successful . */ public SyncAgentInner get ( String resourceGroupName , String serverName , String syncAgentName ) { } }
return getWithServiceResponseAsync ( resourceGroupName , serverName , syncAgentName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class FullScreenImageGalleryActivity { /** * region Helper Methods */ private void bindViews ( ) { } }
viewPager = ( ViewPager ) findViewById ( R . id . vp ) ; toolbar = ( Toolbar ) findViewById ( R . id . toolbar ) ;
public class ListNetworks { /** * Login using ovh . conf * @ throws IOException */ public static void main ( String [ ] args ) throws IOException { } }
ApiOvhCore core = new ApiOvhCore ( ) ; ApiOvhCloud cloud = new ApiOvhCloud ( core ) ; ArrayList < String > projects = cloud . project_GET ( ) ; for ( String project : projects ) { System . out . println ( project ) ; ArrayList < OvhNetwork > networds = cloud . project_serviceName_network_private_GET ( project ) ; List < String > debug = networds . stream ( ) . map ( ApiOvhUtils :: objectJsonBody ) . collect ( Collectors . toList ( ) ) ; // String txt = ApiOvhUtils . objectJsonBody ( payload ) ; System . out . println ( debug ) ; } // project _ serviceName _ network _ private _ GET
public class CoreOAuthConsumerSupport { /** * Selects a proxy for the given URL . * @ param requestTokenURL The URL * @ return The proxy . */ protected Proxy selectProxy ( URL requestTokenURL ) { } }
try { List < Proxy > selectedProxies = getProxySelector ( ) . select ( requestTokenURL . toURI ( ) ) ; return selectedProxies . isEmpty ( ) ? Proxy . NO_PROXY : selectedProxies . get ( 0 ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( e ) ; }
public class AbstractBlockingQueue { /** * Returns the number of additional elements that this queue can ideally * ( in the absence of memory or resource constraints ) accept without * blocking , or < tt > Integer . MAX _ VALUE < / tt > if there is no intrinsic * limit . * < p > Note that you < em > cannot < / em > always tell if an attempt to insert * an element will succeed by inspecting < tt > remainingCapacity < / tt > * because it may be the case that another thread is about to * insert or remove an element . * @ return the remaining capacity */ public int remainingCapacity ( ) { } }
int readLocation = this . readLocation ; int writeLocation = this . writeLocation ; if ( writeLocation < readLocation ) writeLocation += capacity ; return ( capacity - 1 ) - ( writeLocation - readLocation ) ;
public class JFapByteBuffer { /** * Puts a short into the byte buffer . * @ param item */ public synchronized void putShort ( short item ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putShort" , Short . valueOf ( item ) ) ; checkValid ( ) ; getCurrentByteBuffer ( 2 ) . putShort ( item ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putShort" ) ;
public class ConfigHandler { /** * Helper method to decode and analyze the chunk . * @ param chunk the chunk to analyze . */ private void decodeChunk ( InetSocketAddress address , final ByteBuf chunk ) { } }
responseContent . writeBytes ( chunk ) ; String currentChunk = responseContent . toString ( CharsetUtil . UTF_8 ) ; int separatorIndex = currentChunk . indexOf ( "\n\n\n\n" ) ; if ( separatorIndex > 0 ) { String rawConfig = currentChunk . substring ( 0 , separatorIndex ) . trim ( ) . replace ( "$HOST" , address . getAddress ( ) . getHostAddress ( ) ) ; NetworkAddress origin = NetworkAddress . create ( address . getAddress ( ) . getHostAddress ( ) ) ; CouchbaseBucketConfig config = ( CouchbaseBucketConfig ) BucketConfigParser . parse ( rawConfig , environment , origin ) ; synchronized ( currentBucketConfigRev ) { if ( config . rev ( ) > currentBucketConfigRev . get ( ) ) { LOGGER . trace ( "Publishing bucket config: {}" , RedactableArgument . system ( rawConfig ) ) ; currentBucketConfigRev . set ( config . rev ( ) ) ; configStream . onNext ( config ) ; } else { LOGGER . trace ( "Ignoring config, since rev has not changed." ) ; } } responseContent . clear ( ) ; responseContent . writeBytes ( currentChunk . substring ( separatorIndex + 4 ) . getBytes ( CharsetUtil . UTF_8 ) ) ; }
public class AtomicBiInteger { /** * Atomically adds the given deltas to the current hi and lo values . * @ param deltaHi the delta to apply to the hi value * @ param deltaLo the delta to apply to the lo value */ public void add ( int deltaHi , int deltaLo ) { } }
while ( true ) { long encoded = get ( ) ; long update = encode ( getHi ( encoded ) + deltaHi , getLo ( encoded ) + deltaLo ) ; if ( compareAndSet ( encoded , update ) ) return ; }
public class KeyPairFactory { /** * Factory method for creating a new { @ link KeyPairGenerator } from the given parameters . * @ param algorithm * the algorithm * @ param keySize * the key size * @ param secureRandom * the secure random * @ return the new { @ link KeyPairGenerator } from the given parameters * @ throws NoSuchAlgorithmException * is thrown if no Provider supports a KeyPairGeneratorSpi implementation for the * specified algorithm */ public static KeyPairGenerator newKeyPairGenerator ( final String algorithm , final int keySize , final SecureRandom secureRandom ) throws NoSuchAlgorithmException { } }
final KeyPairGenerator generator = KeyPairGenerator . getInstance ( algorithm ) ; generator . initialize ( keySize , secureRandom ) ; return generator ;
public class QueryReferenceBroker { /** * Retrieve a single Reference . * This implementation retrieves a referenced object from the data backend * if < b > cascade - retrieve < / b > is true or if < b > forced < / b > is true . * @ param obj - object that will have it ' s field set with a referenced object . * @ param cld - the ClassDescriptor describring obj * @ param rds - the ObjectReferenceDescriptor of the reference attribute to be loaded * @ param forced - if set to true , the reference is loaded even if the rds differs . */ public void retrieveProxyReference ( Object obj , ClassDescriptor cld , ObjectReferenceDescriptor rds , boolean forced ) { } }
PersistentField refField ; Object refObj = null ; pb . getInternalCache ( ) . enableMaterializationCache ( ) ; try { Identity id = getReferencedObjectIdentity ( obj , rds , cld ) ; if ( id != null ) { refObj = pb . createProxy ( rds . getItemClass ( ) , id ) ; } refField = rds . getPersistentField ( ) ; refField . set ( obj , refObj ) ; if ( ( refObj != null ) && prefetchProxies && ( m_retrievalTasks != null ) && ( rds . getProxyPrefetchingLimit ( ) > 0 ) ) { IndirectionHandler handler = ProxyHelper . getIndirectionHandler ( refObj ) ; if ( ( handler != null ) && addRetrievalTask ( obj , rds ) ) { new PBMaterializationListener ( obj , m_retrievalTasks , rds , rds . getProxyPrefetchingLimit ( ) ) ; } } pb . getInternalCache ( ) . disableMaterializationCache ( ) ; } catch ( RuntimeException e ) { pb . getInternalCache ( ) . doLocalClear ( ) ; throw e ; }
public class Database { /** * Find documents using an index * @ param selectorJson String representation of a JSON object describing criteria used to * select documents . For example : * { @ code " { \ " selector \ " : { < your data here > } } " } . * @ param classOfT The class of Java objects to be returned * @ param < T > the type of the Java object to be returned * @ return List of classOfT objects * @ see # findByIndex ( String , Class , FindByIndexOptions ) * @ see < a * href = " https : / / console . bluemix . net / docs / services / Cloudant / api / cloudant _ query . html # selector - syntax " * target = " _ blank " > selector syntax < / a > * @ deprecated Use { @ link # query ( String , Class ) } instead */ @ Deprecated public < T > List < T > findByIndex ( String selectorJson , Class < T > classOfT ) { } }
return findByIndex ( selectorJson , classOfT , new FindByIndexOptions ( ) ) ;
public class XMLHelper { /** * Helper program : Extracts the specified XPATH expression * from an XML - String . * @ param node the node * @ param xPath the x path * @ return NodeList * @ throws XPathExpressionException the x path expression exception */ public static Node getElementB ( Node node , String xPath ) throws XPathExpressionException { } }
XPathExpression expr = xpath . compile ( xPath ) ; return getElementB ( node , expr ) ;
public class SafeDatasetCommit { /** * Commit the output data of a dataset . */ private void commitDataset ( Collection < TaskState > taskStates , DataPublisher publisher ) { } }
try { publisher . publish ( taskStates ) ; } catch ( Throwable t ) { log . error ( "Failed to commit dataset" , t ) ; setTaskFailureException ( taskStates , t ) ; }
public class GosuRefactorUtil { /** * Finds a bounding parent of any of the possible types passed in from the list of locations , starting at the position * given . */ public static IParsedElement boundingParent ( List < IParseTree > locations , int position , Class < ? extends IParsedElement > ... possibleTypes ) { } }
IParseTree location = IParseTree . Search . getDeepestLocation ( locations , position , true ) ; IParsedElement pe = null ; if ( location != null ) { pe = location . getParsedElement ( ) ; while ( pe != null && ! isOneOfTypes ( pe , possibleTypes ) ) { pe = pe . getParent ( ) ; } } return pe ;
public class UIContextImpl { /** * Sets the component in this UIC which is to be the focus of the client browser cursor . The id of the component is * used to find the focussed element in the rendered html . Since id could be different in different contexts the * context of the component is also needed . * @ param component - the component that sould be the cursor focus in the rendered UI . * @ param uic - the context that the component exists in . */ @ Override public void setFocussed ( final WComponent component , final UIContext uic ) { } }
this . focussed = component ; this . focussedUIC = uic ;
public class DJBarChartBuilder { /** * Adds the specified serie column to the dataset with custom label . * @ param column the serie column * @ param label column the custom label */ public DJBarChartBuilder addSerie ( AbstractColumn column , String label ) { } }
getDataset ( ) . addSerie ( column , label ) ; return this ;
public class Functions { /** * Swap the input pair and return the swapped pair . * @ return A function that gets the swapped pair { @ code Iterable } */ public static < S , T > Function < Pair < S , T > , Pair < T , S > > swappedPair ( ) { } }
return ( Function < Pair < S , T > , Pair < T , S > > ) ( Function < ? , ? > ) SWAPPED_PAIR_FUNCTION ;
public class ApiOvhPackxdsl { /** * Get this object properties * REST : GET / pack / xdsl / { packName } / exchangeAccount / services / { domain } * @ param packName [ required ] The internal name of your pack * @ param domain [ required ] */ public OvhExchangeAccountService packName_exchangeAccount_services_domain_GET ( String packName , String domain ) throws IOException { } }
String qPath = "/pack/xdsl/{packName}/exchangeAccount/services/{domain}" ; StringBuilder sb = path ( qPath , packName , domain ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhExchangeAccountService . class ) ;
public class AbstractTheDavidboxOperation { /** * { @ inheritDoc } */ public LinkedHashMap < String , String > buildHttpArguments ( ) { } }
// Init http arguments LinkedHashMap < String , String > httpArguments = new LinkedHashMap < String , String > ( ) ; return httpArguments ;
public class Positions { /** * Get a writable position of type { @ code type } . No checking can be done to ensure that { @ code type } conforms to * { @ code T } . * @ param type not { @ code null } * @ return Position . Writable */ public static < T > Position . Writable < T > writable ( final Type type ) { } }
return writable ( type , noop ( ) ) ;
public class TypeReferenceService { /** * This performs the same function as { @ link TypeReferenceService # getPackageUseFrequencies ( ProjectModel , Set , Set , int , boolean ) } , * however it is designed to use a { @ link ProjectModelTraversal } instead of only { @ link ProjectModel } . * This is useful for cases where the { @ link ProjectModelTraversal } needs to use a custom { @ link TraversalStrategy } . */ public Map < String , Integer > getPackageUseFrequencies ( ProjectModelTraversal projectTraversal , Set < String > includeTags , Set < String > excludeTags , int nameDepth , boolean recursive ) { } }
Map < String , Integer > packageUseCount = new HashMap < > ( ) ; getPackageUseFrequencies ( packageUseCount , projectTraversal , includeTags , excludeTags , nameDepth , recursive ) ; return packageUseCount ;
public class XNElement { /** * Returns the content of the first child which has the given name . * @ param name the child name * @ param namespace the namespace URI * @ return the content or null if no such child */ public String childValue ( String name , String namespace ) { } }
for ( XNElement e : children ) { if ( Objects . equals ( e . name , name ) && Objects . equals ( e . namespace , namespace ) ) { return e . content ; } } return null ;
public class ProductSearchClient { /** * Asynchronous API that imports a list of reference images to specified product sets based on a * list of image information . * < p > The [ google . longrunning . Operation ] [ google . longrunning . Operation ] API can be used to keep * track of the progress and results of the request . ` Operation . metadata ` contains * ` BatchOperationMetadata ` . ( progress ) ` Operation . response ` contains ` ImportProductSetsResponse ` . * ( results ) * < p > The input source of this method is a csv file on Google Cloud Storage . For the format of the * csv file please see * [ ImportProductSetsGcsSource . csv _ file _ uri ] [ google . cloud . vision . v1 . ImportProductSetsGcsSource . csv _ file _ uri ] . * < p > Sample code : * < pre > < code > * try ( ProductSearchClient productSearchClient = ProductSearchClient . create ( ) ) { * LocationName parent = LocationName . of ( " [ PROJECT ] " , " [ LOCATION ] " ) ; * ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig . newBuilder ( ) . build ( ) ; * ImportProductSetsRequest request = ImportProductSetsRequest . newBuilder ( ) * . setParent ( parent . toString ( ) ) * . setInputConfig ( inputConfig ) * . build ( ) ; * ImportProductSetsResponse response = productSearchClient . importProductSetsAsync ( request ) . get ( ) ; * < / code > < / pre > * @ param request The request object containing all of the parameters for the API call . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi ( "The surface for long-running operations is not stable yet and may change in the future." ) public final OperationFuture < ImportProductSetsResponse , BatchOperationMetadata > importProductSetsAsync ( ImportProductSetsRequest request ) { } }
return importProductSetsOperationCallable ( ) . futureCall ( request ) ;
public class AtomicSparseVector { /** * { @ inheritDoc } */ public double getAndAdd ( int index , double delta ) { } }
writeLock . lock ( ) ; double value = vector . get ( index ) ; vector . set ( index , value + delta ) ; writeLock . unlock ( ) ; return value ;
public class CalendarPath { /** * Method to construct the less than or equals expression for date * @ param value the date value * @ return Expression */ public Expression < java . sql . Date > lte ( java . sql . Date value ) { } }
SimpleDateFormat formatter = getDateFormatter ( ) ; String valueString = "'" + formatter . format ( value ) + "'" ; return new Expression < java . sql . Date > ( this , Operation . lte , valueString ) ;
public class Base64 { /** * Encodes up to the first three bytes of array < var > threeBytes < / var > and * returns a four - byte array in Base64 notation . The actual number of * significant bytes in your array is given by < var > numSigBytes < / var > . The * array < var > threeBytes < / var > needs only be as big as < var > numSigBytes < / var > . * Code can reuse a byte array by passing a four - byte array as < var > b4 < / var > . * @ param b4 * A reusable byte array to reduce array instantiation * @ param threeBytes * the array to convert * @ param numSigBytes * the number of significant bytes in your array * @ return four byte array in Base64 notation . * @ since 1.5.1 */ @ Nonnull @ ReturnsMutableObject ( "passed parameter" ) static byte [ ] _encode3to4 ( @ Nonnull final byte [ ] b4 , @ Nonnull final byte [ ] threeBytes , @ Nonnegative final int numSigBytes , final int options ) { } }
_encode3to4 ( threeBytes , 0 , numSigBytes , b4 , 0 , options ) ; return b4 ;
public class FormTool { /** * Constructs an option entry for a select menu with the specified * name , value , item , and selected value . */ public String fixedOption ( String name , String value , String item , Object selectedValue ) { } }
StringBuilder buf = new StringBuilder ( ) ; buf . append ( "<option value=\"" ) . append ( value ) . append ( "\"" ) ; if ( selectedValue . equals ( value ) ) { buf . append ( " selected" ) ; } buf . append ( ">" ) . append ( item ) . append ( "</option>" ) ; return buf . toString ( ) ;
public class StorableIntrospector { /** * Returns a new modifiable mapping of method signatures to methods . * @ return map of { @ link # createSig signatures } to methods */ private static Map < String , Method > gatherAllDeclaredMethods ( Class clazz ) { } }
Map < String , Method > methods = new HashMap < String , Method > ( ) ; gatherAllDeclaredMethods ( methods , clazz ) ; return methods ;
public class FileDownloadNotificationHelper { /** * Clear and cancel all notifications which inside this helper { @ link # notificationArray } . */ public void clear ( ) { } }
@ SuppressWarnings ( "unchecked" ) SparseArray < BaseNotificationItem > cloneArray = ( SparseArray < BaseNotificationItem > ) notificationArray . clone ( ) ; notificationArray . clear ( ) ; for ( int i = 0 ; i < cloneArray . size ( ) ; i ++ ) { final BaseNotificationItem n = cloneArray . get ( cloneArray . keyAt ( i ) ) ; n . cancel ( ) ; }
public class EmailSettingsApi { /** * Get inbound settings . * Returns inbound settings . * @ return ApiResponse & lt ; GetInboundResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < GetInboundResponse > getInboundSettingsWithHttpInfo ( ) throws ApiException { } }
com . squareup . okhttp . Call call = getInboundSettingsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetInboundResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class ExpectedConditions { /** * An expectation for checking that there is at least one element present on a web page . * @ param locator used to find the element * @ return the list of WebElements once they are located */ public static ExpectedCondition < List < WebElement > > presenceOfAllElementsLocatedBy ( final By locator ) { } }
return new ExpectedCondition < List < WebElement > > ( ) { @ Override public List < WebElement > apply ( WebDriver driver ) { List < WebElement > elements = driver . findElements ( locator ) ; return elements . size ( ) > 0 ? elements : null ; } @ Override public String toString ( ) { return "presence of any elements located by " + locator ; } } ;
public class Int2ObjectCache { /** * Overloaded version of { @ link Map # containsKey ( Object ) } that takes a primitive int key . * @ param key for indexing the { @ link Map } * @ return true if the key is found otherwise false . */ public boolean containsKey ( final int key ) { } }
boolean found = false ; @ DoNotSub final int setNumber = Hashing . hash ( key , mask ) ; @ DoNotSub final int setBeginIndex = setNumber << setSizeShift ; for ( @ DoNotSub int i = setBeginIndex , setEndIndex = setBeginIndex + setSize ; i < setEndIndex ; i ++ ) { if ( null == values [ i ] ) { break ; } if ( key == keys [ i ] ) { found = true ; break ; } } return found ;
public class Database { public DbHistory [ ] get_class_property_history ( String classname , String propname ) throws DevFailed { } }
return databaseDAO . get_class_property_history ( this , classname , propname ) ;
public class HttpClientBuilder { /** * Configures a key store for the current SSL host ( see * { @ link # ssl ( String ) } ) . If set , SSL server validation will be used ( i . e . * the server certificate will be requested and validated ) . * @ param urlURL from which to obtain key store * @ param passwordkey store password * @ return this * @ see # ssl ( String ) * @ see # trustKeyStore ( URL , String ) */ public HttpClientBuilder keyStore ( URL url , String password ) { } }
if ( sslHostConfig == null ) { throw new IllegalStateException ( "ssl(String) must be called before this" ) ; } sslHostConfig . keyStoreUrl = url ; sslHostConfig . keyStorePassword = password ; return this ;
public class APSPSolver { /** * Draw a graph representing this { @ link APSPSolver } ' s { @ link ConstraintNetwork } . This method depends on the Prefuse library . */ public void draw ( ) { } }
// Now plot the STP with the Utility . PlotSTPTemporalModule class PlotSTPTemporalModule view ; Toolkit tk = Toolkit . getDefaultToolkit ( ) ; int xSize = ( ( int ) tk . getScreenSize ( ) . getWidth ( ) ) ; int ySize = ( ( int ) tk . getScreenSize ( ) . getHeight ( ) ) ; // int ySize = 500; // GIVE tm TO VISIUALIZER view = new PlotSTPTemporalModule ( this , xSize , ySize ) ; JFrame myFrame = new JFrame ( "Simple Temporal Network" ) ; Container pane = myFrame . getContentPane ( ) ; pane . setLayout ( new BorderLayout ( ) ) ; pane . add ( view , BorderLayout . NORTH ) ; myFrame . setDefaultCloseOperation ( JFrame . DISPOSE_ON_CLOSE ) ; myFrame . setSize ( xSize , ySize ) ; myFrame . pack ( ) ; myFrame . setVisible ( true ) ; view . touchLBUBNodes ( ) ; // End STP plotting
public class JMStats { /** * Cal double . * @ param < N > the type parameter * @ param numberList the number list * @ param calFunction the cal function * @ return the double */ public static < N extends Number > double cal ( List < N > numberList , Function < DoubleStream , OptionalDouble > calFunction ) { } }
return JMCollections . isNullOrEmpty ( numberList ) ? 0 : calFunction . apply ( numberList . stream ( ) . mapToDouble ( Number :: doubleValue ) ) . orElse ( 0 ) ;
public class XMLConfiguration { protected void initListener ( XmlParser . Node node ) { } }
String className = node . getString ( "listener-class" , false , true ) ; Object listener = null ; try { Class listenerClass = getWebApplicationContext ( ) . loadClass ( className ) ; listener = listenerClass . newInstance ( ) ; } catch ( Exception e ) { log . warn ( "Could not instantiate listener " + className , e ) ; return ; } if ( ! ( listener instanceof EventListener ) ) { log . warn ( "Not an EventListener: " + listener ) ; return ; } boolean known = false ; try { getWebApplicationContext ( ) . addEventListener ( ( EventListener ) listener ) ; known = true ; } catch ( Exception e ) { LogSupport . ignore ( log , e ) ; } try { getWebApplicationHandler ( ) . addEventListener ( ( EventListener ) listener ) ; known = true ; } catch ( Exception e ) { LogSupport . ignore ( log , e ) ; } if ( ! known ) log . warn ( "Unknown: " + listener ) ;
public class ParamSupport { /** * simply send our name and value to our parent < transform > tag */ @ Override public int doEndTag ( ) throws JspException { } }
Tag t = findAncestorWithClass ( this , TransformSupport . class ) ; if ( t == null ) { throw new JspTagException ( Resources . getMessage ( "PARAM_OUTSIDE_TRANSFORM" ) ) ; } TransformSupport parent = ( TransformSupport ) t ; Object value = this . value ; if ( value == null ) { if ( bodyContent == null || bodyContent . getString ( ) == null ) { value = "" ; } else { value = bodyContent . getString ( ) . trim ( ) ; } } parent . addParameter ( name , value ) ; return EVAL_PAGE ;
public class GoogleMapsTileMath { /** * Create a transform that converts meters to tile - relative pixels * @ param tx The x coordinate of the tile * @ param ty The y coordinate of the tile * @ param zoomLevel the zoom level * @ return AffineTransform with meters to pixels transformation */ public AffineTransform metersToTilePixelsTransform ( int tx , int ty , int zoomLevel ) { } }
AffineTransform result = new AffineTransform ( ) ; double scale = 1.0 / resolution ( zoomLevel ) ; int nTiles = 2 << ( zoomLevel - 1 ) ; int px = tx * - 256 ; int py = ( nTiles - ty ) * - 256 ; // flip y for upper - left origin result . scale ( 1 , - 1 ) ; result . translate ( px , py ) ; result . scale ( scale , scale ) ; result . translate ( originShift , originShift ) ; return result ;
public class IonReaderBinaryUserX { /** * Facet support */ @ Override public < T > T asFacet ( Class < T > facetType ) { } }
if ( facetType == SpanProvider . class ) { return facetType . cast ( new SpanProviderFacet ( ) ) ; } // TODO amzn / ion - java / issues / 17 support seeking over InputStream if ( _input instanceof FromByteArray ) { if ( facetType == SeekableReader . class ) { return facetType . cast ( new SeekableReaderFacet ( ) ) ; } if ( facetType == RawValueSpanProvider . class ) { return facetType . cast ( new RawValueSpanProviderFacet ( ) ) ; } } if ( facetType == _Private_ByteTransferReader . class ) { // This is a rather sketchy use of Facets , since the availability // of the facet depends upon the current state of this subject , // and that can change over time . // TODO amzn / ion - java / issues / 16 Our { @ link # transferCurrentValue } doesn ' t handle // field names and annotations . // Ensure there ' s a contiguous buffer we can copy . if ( _input instanceof UnifiedInputStreamX . FromByteArray && getTypeAnnotationSymbols ( ) . length == 0 && ! isInStruct ( ) ) { return facetType . cast ( new ByteTransferReaderFacet ( ) ) ; } } return super . asFacet ( facetType ) ;
public class SslUtils { /** * Creates an { @ link SSLContext } that allows all requests , regardless of certificate issues . * @ return an all - accepting { @ link SSLContext } */ public static SSLContext acceptingSslContext ( ) { } }
try { SSLContext sslContext = SSLContext . getInstance ( "SSL" ) ; sslContext . init ( null , TRUST_MANAGERS , new SecureRandom ( ) ) ; return sslContext ; } catch ( NoSuchAlgorithmException | KeyManagementException ex ) { throw new RuntimeException ( "Unable to create issue-ignoring SSLContext: " + ex . getMessage ( ) , ex ) ; }
public class GameSessionConnectionInfoMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GameSessionConnectionInfo gameSessionConnectionInfo , ProtocolMarshaller protocolMarshaller ) { } }
if ( gameSessionConnectionInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( gameSessionConnectionInfo . getGameSessionArn ( ) , GAMESESSIONARN_BINDING ) ; protocolMarshaller . marshall ( gameSessionConnectionInfo . getIpAddress ( ) , IPADDRESS_BINDING ) ; protocolMarshaller . marshall ( gameSessionConnectionInfo . getPort ( ) , PORT_BINDING ) ; protocolMarshaller . marshall ( gameSessionConnectionInfo . getMatchedPlayerSessions ( ) , MATCHEDPLAYERSESSIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class UserDataHelper { /** * Configures the agent from VMWare . * @ param logger a logger * @ return the agent ' s data , or null if they could not be parsed */ public AgentProperties findParametersForVmware ( Logger logger ) { } }
logger . info ( "User data are being retrieved for VMWare..." ) ; AgentProperties result = null ; File propertiesFile = new File ( "/tmp/roboconf.properties" ) ; try { int retries = 30 ; while ( ( ! propertiesFile . exists ( ) || ! propertiesFile . canRead ( ) ) && retries -- > 0 ) { logger . fine ( "Agent tries to read properties file " + propertiesFile + ": trial #" + ( 30 - retries ) ) ; try { Thread . sleep ( 2000 ) ; } catch ( InterruptedException e ) { throw new IOException ( "Cannot read properties file: " + e ) ; } } result = AgentProperties . readIaasProperties ( Utils . readPropertiesFile ( propertiesFile ) ) ; /* * HACK for specific IaaS configurations ( using properties file in a VMWare - like manner ) * Try to pick IP address . . . in the case we are on OpenStack or any IaaS with amazon - compatible API * Some configurations ( with floating IPs ) do not provide network interfaces exposing public IPs ! */ InputStream in = null ; try { URL userDataUrl = new URL ( "http://169.254.169.254/latest/meta-data/public-ipv4" ) ; in = userDataUrl . openStream ( ) ; ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; Utils . copyStreamSafely ( in , os ) ; String ip = os . toString ( "UTF-8" ) ; if ( ! AgentUtils . isValidIP ( ip ) ) { // Failed retrieving public IP : try private one instead Utils . closeQuietly ( in ) ; userDataUrl = new URL ( "http://169.254.169.254/latest/meta-data/local-ipv4" ) ; in = userDataUrl . openStream ( ) ; os = new ByteArrayOutputStream ( ) ; Utils . copyStreamSafely ( in , os ) ; ip = os . toString ( "UTF-8" ) ; } if ( AgentUtils . isValidIP ( ip ) ) result . setIpAddress ( os . toString ( "UTF-8" ) ) ; } catch ( IOException e ) { Utils . logException ( logger , e ) ; } finally { Utils . closeQuietly ( in ) ; } /* HACK ends here ( see comment above ) . Removing it is harmless on classical VMWare configurations . */ } catch ( IOException e ) { logger . fine ( "Agent failed to read properties file " + propertiesFile ) ; result = null ; } return result ;
public class XID { /** * Serializes an XID object binarily to a data output stream . * @ param id * XID to be serialized . * @ param dos * Data output stream to store XID serialization . */ public static void write ( XID id , DataOutputStream dos ) throws IOException { } }
dos . writeLong ( id . uuid . getMostSignificantBits ( ) ) ; dos . writeLong ( id . uuid . getLeastSignificantBits ( ) ) ;
public class CmsXsltUtil { /** * Converts a delimiter separated format string int o colgroup html fragment . < p > * @ param formatString the formatstring to convert * @ param delimiter the delimiter the formats ( l , r or c ) are delimited with * @ return the resulting colgroup HTML */ private static String getColGroup ( String formatString , String delimiter ) { } }
StringBuffer colgroup = new StringBuffer ( 128 ) ; String [ ] formatStrings = formatString . split ( delimiter ) ; colgroup . append ( "<colgroup>" ) ; for ( int i = 0 ; i < formatStrings . length ; i ++ ) { colgroup . append ( "<col align=\"" ) ; char align = formatStrings [ i ] . trim ( ) . charAt ( 0 ) ; switch ( align ) { case 'l' : colgroup . append ( "left" ) ; break ; case 'c' : colgroup . append ( "center" ) ; break ; case 'r' : colgroup . append ( "right" ) ; break ; default : throw new RuntimeException ( "invalid format option" ) ; } colgroup . append ( "\"/>" ) ; } return colgroup . append ( "</colgroup>" ) . toString ( ) ;
public class MetricUtils { /** * make taskId = 0 and streamId empty . */ public static String task2compName ( String old ) { } }
String [ ] parts = old . split ( DELIM ) ; if ( parts . length >= 7 ) { parts [ 0 ] = MetaType . COMPONENT . getV ( ) + parts [ 0 ] . charAt ( 1 ) ; parts [ parts . length - 3 ] = EMPTY ; parts [ parts . length - 4 ] = "0" ; } return concat ( parts ) ;
public class MathFunctions { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > convert radians to degrees . < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > The number argument ( containing the radians ) is the one to which this function is appended , < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > in accordance to a post - fix notation . < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > e . g . < b > n . numberProperty ( " radians " ) . math ( ) . degrees ( ) < / b > < / i > < / div > * < br / > */ public JcNumber degrees ( ) { } }
JcNumber ret = new JcNumber ( null , this . argument , new FunctionInstance ( FUNCTION . Math . DEGREES , 1 ) ) ; QueryRecorder . recordInvocationConditional ( this , "degrees" , ret ) ; return ret ;
public class EnvelopesApi { /** * Retrieves the current metadata of a ChunkedUpload . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param chunkedUploadId ( required ) * @ return ChunkedUploadResponse */ public ChunkedUploadResponse getChunkedUpload ( String accountId , String chunkedUploadId ) throws ApiException { } }
return getChunkedUpload ( accountId , chunkedUploadId , null ) ;
public class NarGnuConfigureMojo { /** * JDK 1.4 compatibility */ private static String arraysToString ( final Object [ ] a ) { } }
if ( a == null ) { return "null" ; } final int iMax = a . length - 1 ; if ( iMax == - 1 ) { return "[]" ; } final StringBuilder b = new StringBuilder ( ) ; b . append ( '[' ) ; for ( int i = 0 ; ; i ++ ) { b . append ( String . valueOf ( a [ i ] ) ) ; if ( i == iMax ) { return b . append ( ']' ) . toString ( ) ; } b . append ( ", " ) ; }
public class CreatePhoneCountryConstantsClass { /** * read phone trunk an exit code map from property file . * @ return map of country code and combined string of trunk an exit code */ public static Map < String , String > readPhoneTrunkAndExitCodes ( final Locale plocale ) { } }
final PhoneCountryTrunkAndExitCodesConstants phoneTrunkAndExitCodes = GWT . create ( PhoneCountryTrunkAndExitCodesConstants . class ) ; return phoneTrunkAndExitCodes . phoneTrunkAndExitCodes ( ) ;
public class ComponentWrapper { /** * Wraps the specified { @ link Window } into a UI . Adds the specified pop - up * window to a simple , empty vertical layout . * @ param window the pop - up window to wrap * @ return an application displaying that pop - up window */ public UI wrapWindow ( Window window ) { } }
final UI ui = wrapLayout ( new VerticalLayout ( ) ) ; ui . addWindow ( window ) ; return ui ;
public class PBaseValueEqual { /** * In where null or empty values means that no predicate is added to the query . * That is , only add the IN predicate if the values are not null or empty . * Without this we typically need to code an < code > if < / code > block to only add * the IN predicate if the collection is not empty like : * < h3 > Without inOrEmpty ( ) < / h3 > * < pre > { @ code * List < String > names = Arrays . asList ( " foo " , " bar " ) ; * QCustomer query = new QCustomer ( ) * . registered . before ( LocalDate . now ( ) ) * / / conditionally add the IN expression to the query * if ( names ! = null & & ! names . isEmpty ( ) ) { * query . name . in ( names ) * query . findList ( ) ; * } < / pre > * < h3 > Using inOrEmpty ( ) < / h3 > * < pre > { @ code * List < String > names = Arrays . asList ( " foo " , " bar " ) ; * new QCustomer ( ) * . registered . before ( LocalDate . now ( ) ) * . name . inOrEmpty ( names ) * . findList ( ) ; * } < / pre > */ public final R inOrEmpty ( Collection < T > values ) { } }
expr ( ) . inOrEmpty ( _name , values ) ; return _root ;
public class MethodDelegation { /** * Delegates any intercepted method to invoke a non - { @ code static } method on the instance of the supplied field . To be * considered a valid delegation target , a method must be visible and accessible to the instrumented type . This is the * case if the method ' s declaring type is either public or in the same package as the instrumented type and if the method * is either public or non - private and in the same package as the instrumented type . Private methods can only be used as * a delegation target if the delegation is targeting the instrumented type . * @ param name The field ' s name . * @ param fieldLocatorFactory The field locator factory to use . * @ param methodGraphCompiler The method graph compiler to use . * @ return A delegation that redirects invocations to a method of the specified field ' s instance . */ public static MethodDelegation toField ( String name , FieldLocator . Factory fieldLocatorFactory , MethodGraph . Compiler methodGraphCompiler ) { } }
return withDefaultConfiguration ( ) . toField ( name , fieldLocatorFactory , methodGraphCompiler ) ;
public class MappedParametrizedObjectEntry { /** * Parse named parameter as Long . * @ param name * parameter name * @ return Long value * @ throws RepositoryConfigurationException */ public Long getParameterLong ( String name ) throws RepositoryConfigurationException { } }
try { return StringNumberParser . parseLong ( getParameterValue ( name ) ) ; } catch ( NumberFormatException e ) { throw new RepositoryConfigurationException ( name + ": unparseable Long. " + e , e ) ; }
public class ntp_sync { /** * < pre > * Converts API response of bulk operation into object and returns the object array in case of get request . * < / pre > */ protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } }
ntp_sync_responses result = ( ntp_sync_responses ) service . get_payload_formatter ( ) . string_to_resource ( ntp_sync_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result . message , result . errorcode , ( base_response [ ] ) result . ntp_sync_response_array ) ; } ntp_sync [ ] result_ntp_sync = new ntp_sync [ result . ntp_sync_response_array . length ] ; for ( int i = 0 ; i < result . ntp_sync_response_array . length ; i ++ ) { result_ntp_sync [ i ] = result . ntp_sync_response_array [ i ] . ntp_sync [ 0 ] ; } return result_ntp_sync ;
public class CommunicationManager { /** * Removes specified torrent from storage . * @ param torrentHash specified torrent hash */ public void removeTorrent ( String torrentHash ) { } }
logger . debug ( "Stopping seeding " + torrentHash ) ; final Pair < SharedTorrent , LoadedTorrent > torrents = torrentsStorage . remove ( torrentHash ) ; SharedTorrent torrent = torrents . first ( ) ; if ( torrent != null ) { torrent . setClientState ( ClientState . DONE ) ; torrent . closeFully ( ) ; } List < SharingPeer > peers = getPeersForTorrent ( torrentHash ) ; for ( SharingPeer peer : peers ) { peer . unbind ( true ) ; } sendStopEvent ( torrents . second ( ) , torrentHash ) ;
public class PropertyService { /** * Determines , based on the name of a property , if we expect the value might contain a password . * @ param name property name . * @ return true if the property value might be expected to contain a password , otherwise false . */ public static final boolean isPassword ( String name ) { } }
return PASSWORD_PROPS . contains ( name ) || name . toLowerCase ( ) . contains ( DataSourceDef . password . name ( ) ) ;
public class LayerDrawable { /** * Sets the drawable for the layer at the specified index . * @ param index The index of the layer to modify , must be in the range { @ code * 0 . . . getNumberOfLayers ( ) - 1 } . * @ param drawable The drawable to set for the layer . * @ attr ref android . R . styleable # LayerDrawableItem _ drawable * @ see # getDrawable ( int ) */ public void setDrawable ( int index , Drawable drawable ) { } }
if ( index >= mLayerState . mNum ) { throw new IndexOutOfBoundsException ( ) ; } final ChildDrawable [ ] layers = mLayerState . mChildren ; final ChildDrawable childDrawable = layers [ index ] ; if ( childDrawable . mDrawable != null ) { if ( drawable != null ) { final Rect bounds = childDrawable . mDrawable . getBounds ( ) ; drawable . setBounds ( bounds ) ; } childDrawable . mDrawable . setCallback ( null ) ; } if ( drawable != null ) { drawable . setCallback ( this ) ; } childDrawable . mDrawable = drawable ; mLayerState . invalidateCache ( ) ; refreshChildPadding ( index , childDrawable ) ;
public class CmsValueCompareBean { /** * Gets the value for the first version . < p > * @ return the value for the first version */ @ Column ( header = "V1 (%(v1))" , order = 40 ) public String getV1 ( ) { } }
return CmsValueCompareBean . formatContentValueForDiffTable ( m_cms , m_elemComp , m_elemComp . getVersion1 ( ) ) ;
public class br_replicateconfig { /** * < pre > * Use this operation to replicate Repeater config in bulk . * < / pre > */ public static br_replicateconfig [ ] replicate ( nitro_service client , br_replicateconfig [ ] resources ) throws Exception { } }
if ( resources == null ) throw new Exception ( "Null resource array" ) ; if ( resources . length == 1 ) return ( ( br_replicateconfig [ ] ) resources [ 0 ] . perform_operation ( client , "replicate" ) ) ; return ( ( br_replicateconfig [ ] ) perform_operation_bulk_request ( client , resources , "replicate" ) ) ;
public class ThriftRangeUtils { /** * Returns the computed token range splits of the specified token range . * @ param deepTokenRange the token range to be splitted . * @ return the list of token range splits , which are also token ranges . */ public List < DeepTokenRange > getSplits ( DeepTokenRange deepTokenRange ) { } }
String start = tokenAsString ( ( Comparable ) deepTokenRange . getStartToken ( ) ) ; String end = tokenAsString ( ( Comparable ) deepTokenRange . getEndToken ( ) ) ; List < String > endpoints = deepTokenRange . getReplicas ( ) ; for ( String endpoint : endpoints ) { try { ThriftClient client = ThriftClient . build ( endpoint , rpcPort , keyspace ) ; List < CfSplit > splits = client . describe_splits_ex ( columnFamily , start , end , splitSize ) ; client . close ( ) ; return deepTokenRanges ( splits , endpoints ) ; } catch ( TException e ) { LOG . warn ( "Endpoint %s failed while splitting range %s" , endpoint , deepTokenRange ) ; } } throw new DeepGenericException ( "No available replicas for splitting range " + deepTokenRange ) ;
public class UserProfileExample { /** * Add an action to the user profile . * This method demonstrates how we can use a keyAsColumn map field ( the * actions field of the UserActionsModel ) to add values to the map without * having to do a get / update / put operation . When doing the put , it won ' t * remove columns that exist in the row that aren ' t in the new map we are * putting . It will just add the additional columns we are now putting to the * row . * @ param firstName * The first name of the user we are updating * @ param lastName * The last name of the user we are updating * @ param actionType * A string representing the action type which is the key of the map * @ param actionValue * A string representing the action value . */ public void addAction ( String firstName , String lastName , String actionType , String actionValue ) { } }
// Create a new UserActionsModel , and add a new actions map to it with a // single action value . Even if one exists in this row , since it has a lone // keyAsColumn field , it won ' t remove any actions that already exist in the // actions column family . UserActionsModel actionsModel = UserActionsModel . newBuilder ( ) . setLastName ( lastName ) . setFirstName ( firstName ) . setActions ( new HashMap < String , String > ( ) ) . build ( ) ; actionsModel . getActions ( ) . put ( actionType , actionValue ) ; // Perform the put . userActionsDao . put ( actionsModel ) ;
public class ExceptionParser { /** * Tries to detect if Throwable is caused by broken connection . If detected * returns level , else return SEVERE . * @ param level * @ param thr * @ return */ public static final Level brokenConnection ( Level level , Throwable thr ) { } }
if ( thr instanceof EOFException ) { return level ; } if ( thr instanceof ClosedChannelException ) { return level ; } if ( ( thr instanceof IOException ) && ( "Broken pipe" . equals ( thr . getMessage ( ) ) || "Connection reset by peer" . equals ( thr . getMessage ( ) ) ) ) { return level ; } if ( ( thr instanceof ConnectException ) && ( "Connection timed out" . equals ( thr . getMessage ( ) ) || "Connection refused" . equals ( thr . getMessage ( ) ) ) ) { return level ; } Throwable cause = thr . getCause ( ) ; if ( cause != null ) { return brokenConnection ( level , cause ) ; } return Level . SEVERE ;
public class Application { /** * Checks if a given method exists in a given class * @ param controllerMethod The method to check * @ param controllerClass The class to check * @ return True if the method exists , false otherwise */ private static boolean methodExists ( String controllerMethod , Class < ? > controllerClass ) { } }
Objects . requireNonNull ( controllerMethod , Required . CONTROLLER_METHOD . toString ( ) ) ; Objects . requireNonNull ( controllerClass , Required . CONTROLLER_CLASS . toString ( ) ) ; return Arrays . stream ( controllerClass . getMethods ( ) ) . anyMatch ( method -> method . getName ( ) . equals ( controllerMethod ) ) ;
public class ManagementLocksInner { /** * Gets a management lock at the subscription level . * @ param lockName The name of the lock to get . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ManagementLockObjectInner object */ public Observable < ServiceResponse < ManagementLockObjectInner > > getAtSubscriptionLevelWithServiceResponseAsync ( String lockName ) { } }
if ( lockName == null ) { throw new IllegalArgumentException ( "Parameter lockName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . getAtSubscriptionLevel ( lockName , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < ManagementLockObjectInner > > > ( ) { @ Override public Observable < ServiceResponse < ManagementLockObjectInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < ManagementLockObjectInner > clientResponse = getAtSubscriptionLevelDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class CqlIdentifier { /** * Creates an identifier from its { @ link CqlIdentifier CQL form } . */ @ NonNull public static CqlIdentifier fromCql ( @ NonNull String cql ) { } }
Preconditions . checkNotNull ( cql , "cql must not be null" ) ; final String internal ; if ( Strings . isDoubleQuoted ( cql ) ) { internal = Strings . unDoubleQuote ( cql ) ; } else { internal = cql . toLowerCase ( ) ; Preconditions . checkArgument ( ! Strings . needsDoubleQuotes ( internal ) , "Invalid CQL form [%s]: needs double quotes" , cql ) ; } return fromInternal ( internal ) ;
public class PropertiesManagers { /** * Build a new manager for the given properties file . * @ param < T > * the type of key used for the new manager * @ param file * the file system location of the properties represented here * @ param keyType * the enumeration of keys in the properties file * @ param evaluator * the evaluator to convert nested property references into fully * evaluated strings * @ param executor * a service to handle potentially long running tasks , such as * interacting with the file system * @ param retrievers * a set of retrievers that will be used to resolve extra * property references ( i . e . if a nested value reference is found * in a properties file and there is no property to match it , the * given retrievers will be used ) * @ return a new manager */ public static < T extends Enum < T > & Defaultable > PropertiesManager < T > newManager ( File file , Class < T > keyType , Evaluator evaluator , ExecutorService executor , final Retriever ... retrievers ) { } }
Translator < T > translator = getEnumTranslator ( keyType ) ; return new PropertiesManager < T > ( file , getDefaultProperties ( keyType , translator ) , translator , evaluator , executor ) { @ Override protected Retriever createRetriever ( ) { return new AddOnRetriever ( true , super . createRetriever ( ) , retrievers ) ; } } ;
public class MultipartConfigTypeImpl { /** * Returns the < code > max - request - size < / code > element * @ return the node defined for the element < code > max - request - size < / code > */ public Long getMaxRequestSize ( ) { } }
if ( childNode . getTextValueForPatternName ( "max-request-size" ) != null && ! childNode . getTextValueForPatternName ( "max-request-size" ) . equals ( "null" ) ) { return Long . valueOf ( childNode . getTextValueForPatternName ( "max-request-size" ) ) ; } return null ;
public class Utils { /** * Generate a list of scope names . * @ param scopes * An array of { @ link Scope } . If { @ code null } is given , * { @ code null } is returned . * @ return * A string containing scope names using white spaces as * the delimiter . * @ since 2.5 */ public static String stringifyScopeNames ( Scope [ ] scopes ) { } }
if ( scopes == null ) { return null ; } String [ ] array = new String [ scopes . length ] ; for ( int i = 0 ; i < scopes . length ; ++ i ) { array [ i ] = ( scopes [ i ] == null ) ? null : scopes [ i ] . getName ( ) ; } return join ( array , " " ) ;
public class ImageBuilder { /** * Build a local image with its local path . * @ param jrImage the local image params * @ param skipImagesFolder skip imagesFolder prefix addition * @ return the JavaFX image object */ private Image buildLocalImage ( final AbstractBaseImage jrImage , final boolean skipImagesFolder ) { } }
final StringBuilder sb = new StringBuilder ( ) ; if ( jrImage . path ( ) != null && ! jrImage . path ( ) . isEmpty ( ) ) { sb . append ( jrImage . path ( ) ) . append ( Resources . PATH_SEP ) ; } sb . append ( jrImage . name ( ) ) ; if ( jrImage . extension ( ) != null ) { sb . append ( jrImage . extension ( ) ) ; } return loadImage ( sb . toString ( ) , skipImagesFolder ) ;
public class CommonOps_DSCC { /** * Computes the minimum of each row in the input matrix and returns the results in a vector : < br > * < br > * b < sub > j < / sub > = min ( i = 1 : n ; a < sub > ji < / sub > ) * @ param input Input matrix * @ param output Optional storage for output . Reshaped into a column vector . Modified . * @ param gw work space * @ return Vector containing the minimum of each row */ public static DMatrixRMaj minRows ( DMatrixSparseCSC input , @ Nullable DMatrixRMaj output , @ Nullable IGrowArray gw ) { } }
if ( output == null ) { output = new DMatrixRMaj ( input . numRows , 1 ) ; } else { output . reshape ( input . numRows , 1 ) ; } if ( gw == null ) gw = new IGrowArray ( input . numRows ) ; else { gw . reshape ( input . numRows ) ; Arrays . fill ( gw . data , 0 , input . numRows , 0 ) ; } Arrays . fill ( output . data , 0 , input . numRows , Double . MAX_VALUE ) ; Arrays . fill ( gw . data , 0 , input . numRows , 0 ) ; for ( int col = 0 ; col < input . numCols ; col ++ ) { int idx0 = input . col_idx [ col ] ; int idx1 = input . col_idx [ col + 1 ] ; for ( int i = idx0 ; i < idx1 ; i ++ ) { int row = input . nz_rows [ i ] ; double v = input . nz_values [ i ] ; if ( output . data [ row ] > v ) { output . data [ row ] = v ; } gw . data [ row ] ++ ; } } for ( int row = 0 ; row < input . numRows ; row ++ ) { // consider the zeros now if a row wasn ' t filled in all the way if ( gw . data [ row ] != input . numCols ) { if ( output . data [ row ] > 0 ) { output . data [ row ] = 0 ; } } } return output ;
public class LogicBindings { /** * A boolean binding that is ` true ` only when all dependent observable boolean values * are ` true ` . * This can be useful in cases where the * { @ link Bindings # and ( javafx . beans . value . ObservableBooleanValue , javafx . beans . value . ObservableBooleanValue ) } * with 2 arguments isn ' t enough . * @ param values variable number of observable boolean values that are used for the binding * @ return the boolean binding */ @ SafeVarargs public static BooleanBinding and ( ObservableValue < Boolean > ... values ) { } }
return Bindings . createBooleanBinding ( ( ) -> ! Arrays . stream ( values ) . filter ( observable -> ! observable . getValue ( ) ) . findAny ( ) . isPresent ( ) , values ) ;
public class AbstractNGramExtractor { /** * Count tuples counter . * @ param hString the h string * @ return the counter */ public Counter < Tuple > countTuples ( @ NonNull HString hString ) { } }
return getValueCalculator ( ) . adjust ( Counters . newCounter ( streamTuples ( hString ) ) ) ;
public class Options { /** * Create the options string sent with a connect message . * If includeAuth is true the auth information is included : * If the server URIs have auth info it is used . Otherwise the userInfo is used . * @ param serverURI the current server uri * @ param includeAuth tells the options to build a connection string that includes auth information * @ param nonce if the client is supposed to sign the nonce for authentication * @ return the options String , basically JSON */ public String buildProtocolConnectOptionsString ( String serverURI , boolean includeAuth , byte [ ] nonce ) { } }
StringBuilder connectString = new StringBuilder ( ) ; connectString . append ( "{" ) ; appendOption ( connectString , Options . OPTION_LANG , Nats . CLIENT_LANGUAGE , true , false ) ; appendOption ( connectString , Options . OPTION_VERSION , Nats . CLIENT_VERSION , true , true ) ; if ( this . connectionName != null ) { appendOption ( connectString , Options . OPTION_NAME , this . connectionName , true , true ) ; } appendOption ( connectString , Options . OPTION_PROTOCOL , "1" , false , true ) ; appendOption ( connectString , Options . OPTION_VERBOSE , String . valueOf ( this . isVerbose ( ) ) , false , true ) ; appendOption ( connectString , Options . OPTION_PEDANTIC , String . valueOf ( this . isPedantic ( ) ) , false , true ) ; appendOption ( connectString , Options . OPTION_TLS_REQUIRED , String . valueOf ( this . isTLSRequired ( ) ) , false , true ) ; appendOption ( connectString , Options . OPTION_ECHO , String . valueOf ( ! this . isNoEcho ( ) ) , false , true ) ; if ( includeAuth && nonce != null && this . getAuthHandler ( ) != null ) { char [ ] nkey = this . getAuthHandler ( ) . getID ( ) ; byte [ ] sig = this . getAuthHandler ( ) . sign ( nonce ) ; char [ ] jwt = this . getAuthHandler ( ) . getJWT ( ) ; if ( sig == null ) { sig = new byte [ 0 ] ; } if ( jwt == null ) { jwt = new char [ 0 ] ; } if ( nkey == null ) { nkey = new char [ 0 ] ; } String encodedSig = Base64 . getUrlEncoder ( ) . withoutPadding ( ) . encodeToString ( sig ) ; appendOption ( connectString , Options . OPTION_NKEY , new String ( nkey ) , true , true ) ; // public key to string is ok appendOption ( connectString , Options . OPTION_SIG , encodedSig , true , true ) ; appendOption ( connectString , Options . OPTION_JWT , new String ( jwt ) , true , true ) ; // public JWT to string is ok } else if ( includeAuth ) { String uriUser = null ; String uriPass = null ; String uriToken = null ; // Values from URI override options try { URI uri = this . createURIForServer ( serverURI ) ; String userInfo = uri . getUserInfo ( ) ; if ( userInfo != null ) { String [ ] info = userInfo . split ( ":" ) ; if ( info . length == 2 ) { uriUser = info [ 0 ] ; uriPass = info [ 1 ] ; } else { uriToken = userInfo ; } } } catch ( URISyntaxException e ) { uriUser = uriToken = uriPass = null ; } if ( uriUser != null ) { appendOption ( connectString , Options . OPTION_USER , uriUser , true , true ) ; } else if ( this . username != null ) { appendOption ( connectString , Options . OPTION_USER , this . username , true , true ) ; } if ( uriPass != null ) { appendOption ( connectString , Options . OPTION_PASSWORD , uriPass , true , true ) ; } else if ( this . password != null ) { appendOption ( connectString , Options . OPTION_PASSWORD , this . password , true , true ) ; } if ( uriToken != null ) { appendOption ( connectString , Options . OPTION_AUTH_TOKEN , uriToken , true , true ) ; } else if ( this . token != null ) { appendOption ( connectString , Options . OPTION_AUTH_TOKEN , this . token , true , true ) ; } } connectString . append ( "}" ) ; return connectString . toString ( ) ;
public class ShowCumulatedProducersAction { /** * Checks whether given decorator stat lines contain something besides cumulated stat . * @ param decorator { @ link ProducerDecoratorBean } */ private boolean hasAnyStat ( ProducerDecoratorBean decorator ) { } }
for ( ProducerAO producer : decorator . getProducers ( ) ) { for ( StatLineAO line : producer . getLines ( ) ) { if ( ! CUMULATED_STAT_NAME_VALUE . equals ( line . getStatName ( ) ) ) { return true ; } } } return false ;
public class AtomixAgent { /** * Configures and creates a new logger for the given namespace . * @ param namespace the namespace from which to create the logger configuration * @ return a new agent logger */ static Logger createLogger ( Namespace namespace ) { } }
String logConfig = namespace . getString ( "log_config" ) ; if ( logConfig != null ) { System . setProperty ( "logback.configurationFile" , logConfig ) ; } System . setProperty ( "atomix.log.directory" , namespace . getString ( "log_dir" ) ) ; System . setProperty ( "atomix.log.level" , namespace . getString ( "log_level" ) ) ; System . setProperty ( "atomix.log.console.level" , namespace . getString ( "console_log_level" ) ) ; System . setProperty ( "atomix.log.file.level" , namespace . getString ( "file_log_level" ) ) ; return LoggerFactory . getLogger ( AtomixAgent . class ) ;
public class AdminSysteminfoAction { @ Execute public HtmlResponse index ( ) { } }
return asHtml ( path_AdminSysteminfo_AdminSysteminfoJsp ) . renderWith ( data -> { registerEnvItems ( data ) ; registerPropItems ( data ) ; registerFessPropItems ( data ) ; registerBugReportItems ( data ) ; } ) ;
public class GraphicalModel { /** * Add a binary factor , where we just want to hard - code the value of the factor . * @ param a The index of the first variable . * @ param b The index of the second variable . * @ param value A mapping from assignments of the two variables , to a factor value . * @ return a reference to the created factor . This can be safely ignored , as the factor is already saved in the model */ public Factor addStaticBinaryFactor ( int a , int b , BiFunction < Integer , Integer , Double > value ) { } }
int [ ] variableDims = getVariableSizes ( ) ; assert a < variableDims . length ; assert b < variableDims . length ; return addStaticFactor ( new int [ ] { a , b } , new int [ ] { variableDims [ a ] , variableDims [ b ] } , assignment -> value . apply ( assignment [ 0 ] , assignment [ 1 ] ) ) ;
public class SourceInfoProtoFileParser { private void doCustomOption ( final CustomOptionContext ctx , final ParserRuleContext parentCtx ) { } }
locationBuilder . addLocation ( ) . setAllSpan ( parentCtx ) ; locationBuilder . addOptionLocation ( ) . setAllSpan ( parentCtx ) . comments ( parentCtx ) . addOptionNameLocation ( ) . setAllSpan ( ctx . customOptionName ( ) ) ; for ( final CustomOptionNamePartContext namePart : ctx . customOptionName ( ) . customOptionNamePart ( ) ) { locationBuilder . addLocationForPrimitive ( UninterpretedOption . NAME_FIELD_NUMBER ) . setAllSpan ( namePart ) . addLocationForPrimitive ( UninterpretedOption . NamePart . NAME_PART_FIELD_NUMBER ) . setAllSpan ( namePart . customOptionNamePartId ( ) == null ? namePart . identifier ( ) : namePart . customOptionNamePartId ( ) ) ; } // exit OptionName scope locationBuilder . popScope ( ) ; // customOption value locations : can be scalar or aggregate ! final CustomOptionValueContext customOptionValue = ctx . customOptionValue ( ) ; int valuePath ; if ( customOptionValue . optionAggregateValue ( ) != null ) { valuePath = UninterpretedOption . AGGREGATE_VALUE_FIELD_NUMBER ; } else { final OptionScalarValueContext optionScalarValue = customOptionValue . optionScalarValue ( ) ; if ( optionScalarValue . doubleValue ( ) != null ) { valuePath = UninterpretedOption . DOUBLE_VALUE_FIELD_NUMBER ; } else if ( optionScalarValue . identifier ( ) != null ) { valuePath = UninterpretedOption . IDENTIFIER_VALUE_FIELD_NUMBER ; } else if ( optionScalarValue . StringLiteral ( ) != null || optionScalarValue . BooleanLiteral ( ) != null ) { valuePath = UninterpretedOption . STRING_VALUE_FIELD_NUMBER ; } else if ( optionScalarValue . NegativeIntegerLiteral ( ) != null ) { valuePath = UninterpretedOption . NEGATIVE_INT_VALUE_FIELD_NUMBER ; } else if ( optionScalarValue . IntegerLiteral ( ) != null ) { valuePath = UninterpretedOption . POSITIVE_INT_VALUE_FIELD_NUMBER ; } else { // we shouldn ' t arrive here ! throw new RuntimeException ( "custom option value has unidentified type!" ) ; } } locationBuilder . addLocationForPrimitive ( valuePath ) . setAllSpan ( customOptionValue ) // exit Option scope . popScope ( ) ; // should the aggregate locations be added here ? BTW , protoc fails on // aggregates !
public class Tile { /** * Defines the text size that will be used for the title , * subtitle and text in the different skins . * @ param SIZE */ public void setTextSize ( final TextSize SIZE ) { } }
if ( null == textSize ) { _textSize = SIZE ; fireTileEvent ( REDRAW_EVENT ) ; } else { textSize . set ( SIZE ) ; }
public class ConfigurationContext { /** * Usual extension registration from { @ link ru . vyarus . dropwizard . guice . GuiceBundle . Builder # extensions ( Class [ ] ) } * or { @ link ru . vyarus . dropwizard . guice . module . installer . bundle . GuiceyBootstrap # extensions ( Class [ ] ) } . * @ param extensions extensions to register */ public void registerExtensions ( final Class < ? > ... extensions ) { } }
for ( Class < ? > extension : extensions ) { register ( ConfigItem . Extension , extension ) ; }
public class CPOptionUtil { /** * Returns the last cp option in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp option , or < code > null < / code > if a matching cp option could not be found */ public static CPOption fetchByUuid_Last ( String uuid , OrderByComparator < CPOption > orderByComparator ) { } }
return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ;
public class ContentSpecProcessor { /** * Does the post Validation step on a Content Spec . * @ param processorData The data to be used during processing . * @ return True if the content spec is valid . */ protected boolean doSecondValidationPass ( final ProcessorData processorData ) { } }
// Validate the content specification now that we have most of the data from the REST API LOG . info ( "Starting second validation pass..." ) ; final ContentSpec contentSpec = processorData . getContentSpec ( ) ; return validator . postValidateContentSpec ( contentSpec , processorData . getUsername ( ) ) ;
public class GroupElement { /** * Creates a new group element in PRECOMP representation . * @ param curve The curve . * @ param ypx The $ y + x $ value . * @ param ymx The $ y - x $ value . * @ param xy2d The $ 2 * d * x * y $ value . * @ return The group element in PRECOMP representation . */ public static org . mariadb . jdbc . internal . com . send . authentication . ed25519 . math . GroupElement precomp ( final Curve curve , final FieldElement ypx , final FieldElement ymx , final FieldElement xy2d ) { } }
return new org . mariadb . jdbc . internal . com . send . authentication . ed25519 . math . GroupElement ( curve , Representation . PRECOMP , ypx , ymx , xy2d , null ) ;
public class TransmissionData { /** * Returns true iff this transmission is a user request . * @ return Returns true iff this transmission is a user request . */ protected boolean isUserRequest ( ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isUserRequest" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isUserRequest" , "" + isUserRequest ) ; return isUserRequest ;
public class Sources { /** * Gets a source that joins the given sources end to end . * When closed , the returned source will ensure the wrapped sources are * all closed . * @ param sources the iterator of sources to join . * @ param < T > the type . * @ return the joined source . */ public static < T > Source < T > join ( Source < T > ... sources ) { } }
return join ( Arrays . asList ( sources ) ) ;
public class LogHelper { /** * Check if logging is enabled for the passed logger based on the error level * provider by the passed object * @ param aLogger * The logger . May not be < code > null < / code > . * @ param aErrorLevelProvider * The error level provider . May not be < code > null < / code > . * @ return < code > true < / code > if the respective log level is allowed , * < code > false < / code > if not */ public static boolean isEnabled ( @ Nonnull final Logger aLogger , @ Nonnull final IHasErrorLevel aErrorLevelProvider ) { } }
return isEnabled ( aLogger , aErrorLevelProvider . getErrorLevel ( ) ) ;
public class DefaultInputResolver { /** * Internal methods */ @ SuppressWarnings ( "resource" ) private static WstxInputSource sourceFromSS ( WstxInputSource parent , ReaderConfig cfg , String refName , int xmlVersion , StreamSource ssrc ) throws IOException , XMLStreamException { } }
InputBootstrapper bs ; Reader r = ssrc . getReader ( ) ; String pubId = ssrc . getPublicId ( ) ; String sysId0 = ssrc . getSystemId ( ) ; URL ctxt = ( parent == null ) ? null : parent . getSource ( ) ; URL url = ( sysId0 == null || sysId0 . length ( ) == 0 ) ? null : URLUtil . urlFromSystemId ( sysId0 , ctxt ) ; final SystemId systemId = SystemId . construct ( sysId0 , ( url == null ) ? ctxt : url ) ; if ( r == null ) { InputStream in = ssrc . getInputStream ( ) ; if ( in == null ) { // Need to try just resolving the system id then if ( url == null ) { throw new IllegalArgumentException ( "Can not create Stax reader for a StreamSource -- neither reader, input stream nor system id was set." ) ; } in = URLUtil . inputStreamFromURL ( url ) ; } bs = StreamBootstrapper . getInstance ( pubId , systemId , in ) ; } else { bs = ReaderBootstrapper . getInstance ( pubId , systemId , r , null ) ; } Reader r2 = bs . bootstrapInput ( cfg , false , xmlVersion ) ; return InputSourceFactory . constructEntitySource ( cfg , parent , refName , bs , pubId , systemId , xmlVersion , r2 ) ;
public class LocationDBResourceStore { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . ResourceStore # retrieveResource ( org . archive . wayback . core . SearchResult ) */ public Resource retrieveResource ( CaptureSearchResult result ) throws ResourceNotAvailableException { } }
// extract ARC filename String fileName = result . getFile ( ) ; if ( fileName == null || fileName . length ( ) < 1 ) { throw new ResourceNotAvailableException ( "No ARC/WARC name in search result..." , fileName ) ; } String urls [ ] ; try { urls = db . nameToUrls ( fileName ) ; } catch ( IOException e1 ) { // e1 . printStackTrace ( ) ; throw new ResourceNotAvailableException ( e1 . getLocalizedMessage ( ) , fileName ) ; } if ( urls == null || urls . length == 0 ) { String msg = "Unable to locate(" + fileName + ")" ; LOGGER . info ( msg ) ; throw new ResourceNotAvailableException ( msg , fileName ) ; } final long offset = result . getOffset ( ) ; String errMsg = "Unable to retrieve" ; Exception origException = null ; Resource r = null ; // TODO : attempt multiple threads ? for ( String url : urls ) { try { r = ResourceFactory . getResource ( url , offset ) ; // TODO : attempt to grab the first few KB ? The underlying // InputStreams support mark ( ) , so we could reset ( ) after . // wait for now , currently this will parse HTTP headers , // which means we ' ve already read some } catch ( IOException e ) { errMsg = url + " - " + e ; origException = e ; LOGGER . info ( "Unable to retrieve " + errMsg ) ; } if ( r != null ) { break ; } } if ( r == null ) { throw new ResourceNotAvailableException ( errMsg , fileName , origException ) ; } return r ;
public class PrefsConfig { /** * Sets the value of the specified preference , overriding the value defined in the * configuration files shipped with the application . */ public void setValue ( String name , float value ) { } }
Float oldValue = null ; if ( _prefs . get ( name , null ) != null || _props . getProperty ( name ) != null ) { oldValue = Float . valueOf ( _prefs . getFloat ( name , super . getValue ( name , 0f ) ) ) ; } _prefs . putFloat ( name , value ) ; _propsup . firePropertyChange ( name , oldValue , Float . valueOf ( value ) ) ;
public class ElemForEach { /** * This function is called after everything else has been * recomposed , and allows the template to set remaining * values that may be based on some other property that * depends on recomposition . * NEEDSDOC @ param sroot * @ throws TransformerException */ public void compose ( StylesheetRoot sroot ) throws TransformerException { } }
super . compose ( sroot ) ; int length = getSortElemCount ( ) ; for ( int i = 0 ; i < length ; i ++ ) { getSortElem ( i ) . compose ( sroot ) ; } java . util . Vector vnames = sroot . getComposeState ( ) . getVariableNames ( ) ; if ( null != m_selectExpression ) m_selectExpression . fixupVariables ( vnames , sroot . getComposeState ( ) . getGlobalsSize ( ) ) ; else { m_selectExpression = getStylesheetRoot ( ) . m_selectDefault . getExpression ( ) ; }
public class snmp_user { /** * < pre > * Use this operation to modify SNMP User . * < / pre > */ public static snmp_user update ( nitro_service client , snmp_user resource ) throws Exception { } }
resource . validate ( "modify" ) ; return ( ( snmp_user [ ] ) resource . update_resource ( client ) ) [ 0 ] ;
public class Section { /** * This method will handle creating the tagId attribute . The tagId attribute indentifies the * tag in the generated HTML . There is a lookup table created in JavaScript mapping the < coe > tagId < / code > * to the actual name . The tagId is also run through the naming service so it can be scoped . Some tags will * write that < code > tagid < / code > out as the < code > id < / code > attribute of the HTML tag being generated . * @ param buffer * @ return String */ private final String renderTagId ( InternalStringBuilder buffer ) throws JspException { } }
assert ( _name != null ) ; // @ todo : this is busted . It should be writing out inline . String realName = rewriteName ( _name ) ; String idScript = mapLegacyTagId ( _name , realName ) ; // some tags will output the id attribute themselves so they don ' t write this out renderAttribute ( buffer , "id" , realName ) ; return idScript ;
public class ASTHelpers { /** * Returns the target type of the tree at the given { @ link VisitorState } ' s path , or else { @ code * null } . * < p > For example , the target type of an assignment expression is the variable ' s type , and the * target type of a return statement is the enclosing method ' s type . */ @ Nullable public static TargetType targetType ( VisitorState state ) { } }
if ( ! ( state . getPath ( ) . getLeaf ( ) instanceof ExpressionTree ) ) { return null ; } TreePath parent = state . getPath ( ) ; ExpressionTree current ; do { current = ( ExpressionTree ) parent . getLeaf ( ) ; parent = parent . getParentPath ( ) ; } while ( parent != null && parent . getLeaf ( ) . getKind ( ) == Kind . PARENTHESIZED ) ; if ( parent == null ) { return null ; } Type type = new TargetTypeVisitor ( current , state , parent ) . visit ( parent . getLeaf ( ) , null ) ; if ( type == null ) { return null ; } return TargetType . create ( type , parent ) ;
public class CommandFactory { /** * This command accelerates the ball with the given power in the given direction . * @ param power Power is between minpower ( - 100 ) and maxpower ( + 100 ) . * @ param direction Direction is relative to the body of the player . */ public void addKickCommand ( int power , int direction ) { } }
StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(kick " ) ; buf . append ( power ) ; buf . append ( ' ' ) ; buf . append ( direction ) ; buf . append ( ')' ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ;