signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JsonApiQueryParamsParser { /** * Returns a list of all of the strings contained in parametersToParse . If * any of the strings contained in parametersToParse is a comma - delimited * list , that string will be split into substrings and each substring will * be added to the returned set ( in place of ...
Set < String > parsedParameters = new LinkedHashSet < > ( ) ; if ( parametersToParse != null && ! parametersToParse . isEmpty ( ) ) { for ( String parameterToParse : parametersToParse ) { parsedParameters . addAll ( Arrays . asList ( parameterToParse . split ( JSON_API_PARAM_DELIMITER ) ) ) ; } } return parsedParameter...
public class ApiOvhSms { /** * Create a phonebook contact . Return identifier of the phonebook contact . * REST : POST / sms / { serviceName } / phonebooks / { bookKey } / phonebookContact * @ param homeMobile [ required ] Home mobile phone number of the contact * @ param surname [ required ] Contact surname * ...
String qPath = "/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact" ; StringBuilder sb = path ( qPath , serviceName , bookKey ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "group" , group ) ; addBody ( o , "homeMobile" , homeMobile ) ; addBody ( o , "homePhone" , homePhon...
public class TerminateSessionAction { /** * Destroy application session . * Also kills all delegated authn profiles via pac4j . * @ param request the request * @ param response the response */ protected void destroyApplicationSession ( final HttpServletRequest request , final HttpServletResponse response ) { } }
LOGGER . trace ( "Destroying application session" ) ; val context = new J2EContext ( request , response , new J2ESessionStore ( ) ) ; val manager = new ProfileManager < > ( context , context . getSessionStore ( ) ) ; manager . logout ( ) ; val session = request . getSession ( false ) ; if ( session != null ) { val requ...
public class RegistriesInner { /** * Gets the quota usages for the specified container registry . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ throws IllegalArgumentException thrown if parameter...
return listUsagesWithServiceResponseAsync ( resourceGroupName , registryName ) . map ( new Func1 < ServiceResponse < RegistryUsageListResultInner > , RegistryUsageListResultInner > ( ) { @ Override public RegistryUsageListResultInner call ( ServiceResponse < RegistryUsageListResultInner > response ) { return response ....
public class WebDavServiceImpl { /** * Gives access to the current session . * @ param repoName repository name * @ param wsName workspace name * @ param lockTokens Lock tokens * @ return current session * @ throws Exception { @ link Exception } */ protected Session session ( String repoName , String wsName ,...
// To be cloud compliant we need now to ignore the provided repository name ( more details in JCR - 2138) ManageableRepository repo = repositoryService . getCurrentRepository ( ) ; if ( PropertyManager . isDevelopping ( ) && log . isWarnEnabled ( ) ) { String currentRepositoryName = repo . getConfiguration ( ) . getNam...
public class MainClassFinder { /** * Perform the given callback operation on all main classes from the given jar . * @ param < T > the result type * @ param jarFile the jar file to search * @ param classesLocation the location within the jar containing classes * @ param callback the callback * @ return the fi...
List < JarEntry > classEntries = getClassEntries ( jarFile , classesLocation ) ; Collections . sort ( classEntries , new ClassEntryComparator ( ) ) ; for ( JarEntry entry : classEntries ) { InputStream inputStream = new BufferedInputStream ( jarFile . getInputStream ( entry ) ) ; try { if ( isMainClass ( inputStream ) ...
public class Document { /** * Returns with the text for a certain line without the trailing LF . Throws an { @ link IndexOutOfBoundsException } if the zero - based { @ code lineNumber } * argument is negative or exceeds the number of lines in the document . */ public String getLineContent ( final int lineNumber ) thr...
if ( ( lineNumber < 0 ) ) { String _xifexpression = null ; if ( this . printSourceOnError ) { _xifexpression = "" ; } else { _xifexpression = ( " text was : " + this . contents ) ; } String _plus = ( Integer . valueOf ( lineNumber ) + _xifexpression ) ; throw new IndexOutOfBoundsException ( _plus ) ; } final char NL = ...
public class BitmapUtils { /** * Lazily create { @ link BitmapFactory . Options } based in given * { @ link Request } , only instantiating them if needed . */ @ Nullable static BitmapFactory . Options createBitmapOptions ( Request data ) { } }
final boolean justBounds = data . hasSize ( ) ; BitmapFactory . Options options = null ; if ( justBounds || data . config != null || data . purgeable ) { options = new BitmapFactory . Options ( ) ; options . inJustDecodeBounds = justBounds ; options . inInputShareable = data . purgeable ; options . inPurgeable = data ....
public class OpenSslSessionStats { /** * Returns the number of times a client presented a ticket derived from the primary key . */ public long ticketKeyResume ( ) { } }
Lock readerLock = context . ctxLock . readLock ( ) ; readerLock . lock ( ) ; try { return SSLContext . sessionTicketKeyResume ( context . ctx ) ; } finally { readerLock . unlock ( ) ; }
public class LoggingInterceptorSupport { /** * Logs response message from message context if any . SOAP messages get logged with envelope transformation * other messages with serialization . * @ param logMessage * @ param messageContext * @ param incoming * @ throws TransformerException */ protected void logR...
if ( messageContext . hasResponse ( ) ) { if ( messageContext . getResponse ( ) instanceof SoapMessage ) { logSoapMessage ( logMessage , ( SoapMessage ) messageContext . getResponse ( ) , incoming ) ; } else { logWebServiceMessage ( logMessage , messageContext . getResponse ( ) , incoming ) ; } }
public class Matrix4d { /** * Set the value of the matrix element at column 2 and row 2. * @ param m22 * the new value * @ return this */ public Matrix4d m22 ( double m22 ) { } }
this . m22 = m22 ; properties &= ~ PROPERTY_ORTHONORMAL ; if ( m22 != 1.0 ) properties &= ~ ( PROPERTY_IDENTITY | PROPERTY_TRANSLATION ) ; return this ;
public class DocFile { /** * Reads a line of characters from an input stream opened from a given resource . * If an IOException occurs , it is wrapped in a ResourceIOException . * @ param resource the resource for the stream * @ param in the stream * @ return the line of text , or { @ code null } if at end of s...
try { return in . readLine ( ) ; } catch ( IOException e ) { throw new ResourceIOException ( docPath , e ) ; }
public class CmsSetupXmlHelper { /** * Replaces a attibute ' s value in the given node addressed by the xPath . < p > * @ param document the document to replace the node attribute * @ param xPath the xPath to the node * @ param attribute the attribute to replace the value of * @ param value the new value to set...
Node node = document . selectSingleNode ( xPath ) ; Element e = ( Element ) node ; @ SuppressWarnings ( "unchecked" ) List < Attribute > attributes = e . attributes ( ) ; for ( Attribute a : attributes ) { if ( a . getName ( ) . equals ( attribute ) ) { a . setValue ( value ) ; return true ; } } return false ;
public class YearWeek { /** * Obtains an instance of { @ code YearWeek } from a temporal object . * This obtains a year - week based on the specified temporal . * A { @ code TemporalAccessor } represents an arbitrary set of date and time information , * which this factory converts to an instance of { @ code YearW...
if ( temporal instanceof YearWeek ) { return ( YearWeek ) temporal ; } Objects . requireNonNull ( temporal , "temporal" ) ; try { if ( ! IsoChronology . INSTANCE . equals ( Chronology . from ( temporal ) ) ) { temporal = LocalDate . from ( temporal ) ; } // need to use getLong ( ) as JDK Parsed class get ( ) doesn ' t ...
public class CaffeineCacheMetrics { /** * Record metrics on a Caffeine cache . You must call { @ link Caffeine # recordStats ( ) } prior to building the cache * for metrics to be recorded . * @ param registry The registry to bind metrics to . * @ param cache The cache to instrument . * @ param cacheName Will be...
new CaffeineCacheMetrics ( cache , cacheName , tags ) . bindTo ( registry ) ; return cache ;
public class ScreenInScreen { /** * Set up all the screen fields . */ public void setupSFields ( ) { } }
this . getRecord ( ScreenIn . SCREEN_IN_FILE ) . getField ( ScreenIn . SCREEN_ITEM_NUMBER ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( ScreenIn . SCREEN_IN_FILE ) . getField ( ScreenI...
public class TableSlice { /** * Returns a 0 based int iterator for use with , for example , get ( ) . When it returns 0 for the first row , * get will transform that to the 0th row in the selection , which may not be the 0th row in the underlying * table . */ @ Override public IntIterator iterator ( ) { } }
return new IntIterator ( ) { private int i = 0 ; @ Override public int nextInt ( ) { return i ++ ; } @ Override public int skip ( int k ) { return i + k ; } @ Override public boolean hasNext ( ) { return i < rowCount ( ) ; } } ;
public class TypeResolver { /** * Resolves the raw class for the given { @ code genericType } , using the type variable information * from the { @ code targetType } . */ public static Class < ? > resolveClass ( Type genericType , Class < ? > targetType ) { } }
if ( genericType instanceof Class ) { return ( Class < ? > ) genericType ; } else if ( genericType instanceof ParameterizedType ) { return resolveClass ( ( ( ParameterizedType ) genericType ) . getRawType ( ) , targetType ) ; } else if ( genericType instanceof GenericArrayType ) { GenericArrayType arrayType = ( Generic...
public class JDBCCallableStatement { /** * # ifdef JAVA6 */ public synchronized void setClob ( String parameterName , Reader reader ) throws SQLException { } }
super . setClob ( findParameterIndex ( parameterName ) , reader ) ;
public class AbstractResourceAdapterDeployer { /** * Apply validation to pool configuration * @ param pc The pool configuration * @ param v The validation definition */ private void applyPoolConfiguration ( PoolConfiguration pc , org . ironjacamar . common . api . metadata . common . Validation v ) { } }
if ( v != null ) { if ( v . isValidateOnMatch ( ) != null ) pc . setValidateOnMatch ( v . isValidateOnMatch ( ) . booleanValue ( ) ) ; if ( v . isBackgroundValidation ( ) != null ) pc . setBackgroundValidation ( v . isBackgroundValidation ( ) . booleanValue ( ) ) ; if ( v . getBackgroundValidationMillis ( ) != null ) p...
public class PageFlowControlContainerFactory { /** * This method will return the < code > PageFlowControlContainer < / code > that is acting as the * control container for the page flow runtime . * @ param request The current request * @ param servletContext The servlet context * @ return The < code > pageFLowC...
PageFlowControlContainer pfcc = ( PageFlowControlContainer ) getSessionVar ( request , servletContext , PAGEFLOW_CONTROL_CONTAINER ) ; if ( pfcc != null ) return pfcc ; pfcc = new PageFlowControlContainerImpl ( ) ; setSessionVar ( request , servletContext , PAGEFLOW_CONTROL_CONTAINER , pfcc ) ; return pfcc ;
public class JvmAgent { /** * Entry point for the agent , using command line attach * ( that is via - javaagent command line argument ) * @ param agentArgs arguments as given on the command line */ public static void premain ( String agentArgs , Instrumentation inst ) { } }
startAgent ( new JvmAgentConfig ( agentArgs ) , true /* register and detect lazy */ , inst ) ;
public class ConsumerSessionProxy { /** * Internal method called when a stoppable asynchronous session is stopped , the session is put into stopped state and the registered * application consumerSessionStopped ( ) method is invoked to inform the application that the session has been stopped . */ public void stoppable...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "stoppableConsumerSessionStopped" ) ; try { stopInternal ( false ) ; // No need to notify our peer as the stop came from our peer } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".processAsy...
public class BookKeeperLog { /** * Loads the metadata for the current log , as stored in ZooKeeper . * @ return A new LogMetadata object with the desired information , or null if no such node exists . * @ throws DataLogInitializationException If an Exception ( other than NoNodeException ) occurred . */ @ VisibleFor...
try { Stat storingStatIn = new Stat ( ) ; byte [ ] serializedMetadata = this . zkClient . getData ( ) . storingStatIn ( storingStatIn ) . forPath ( this . logNodePath ) ; LogMetadata result = LogMetadata . SERIALIZER . deserialize ( serializedMetadata ) ; result . withUpdateVersion ( storingStatIn . getVersion ( ) ) ; ...
public class MiniTemplatorParser { /** * Returns false if the command is not recognized and should be treatet as normal temlate text . */ private boolean processShortFormTemplateCommand ( String cmdLine , int cmdTPosBegin , int cmdTPosEnd ) throws MiniTemplator . TemplateSyntaxException { } }
int p0 = skipBlanks ( cmdLine , 0 ) ; if ( p0 >= cmdLine . length ( ) ) { return false ; } int p = p0 ; char cmd1 = cmdLine . charAt ( p ++ ) ; if ( cmd1 == '/' && p < cmdLine . length ( ) && ! Character . isWhitespace ( cmdLine . charAt ( p ) ) ) { p ++ ; } String cmd = cmdLine . substring ( p0 , p ) ; String parms = ...
public class ElementMatchers { /** * Matches any type description that is a subtype of the given type . * @ param type The type to be checked for being a subtype of the matched type . * @ param < T > The type of the matched object . * @ return A matcher that matches any type description that represents a sub type...
return new SubTypeMatcher < T > ( type ) ;
public class EJSContainer { /** * d112604.5 * Method called after first set of 25 CMP11 entities returned * during a lazy enumeration custom finder execution . Called for each set of * instances to be hydrated via the RemoteEnumerator code path . */ public void setCustomFinderAccessIntentThreadState ( boolean cfw...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d532639.2 // create a thread local context for ContainerManagedBeanO to determine CF Access Information if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setCustomFinderAccessIntentThreadState" ) ; // CMP11CustomFinderAIContext = new W...
public class EditText { /** * @ return the maximum width of the TextView , in pixels or - 1 if the maximum width * was set in ems instead ( using { @ link # setMaxEms ( int ) } or { @ link # setEms ( int ) } ) . * @ see # setMaxWidth ( int ) * @ see # setWidth ( int ) * @ attr ref android . R . styleable # Text...
if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) return mInputView . getMaxWidth ( ) ; return - 1 ;
public class DateTimeFormatterBuilder { /** * Instructs the printer to emit a field value as a decimal number , and the * parser to expect a signed decimal number . * @ param fieldType type of field to append * @ param minDigits minimum number of digits to < i > print < / i > * @ param maxDigits maximum number ...
if ( fieldType == null ) { throw new IllegalArgumentException ( "Field type must not be null" ) ; } if ( maxDigits < minDigits ) { maxDigits = minDigits ; } if ( minDigits < 0 || maxDigits <= 0 ) { throw new IllegalArgumentException ( ) ; } if ( minDigits <= 1 ) { return append0 ( new UnpaddedNumber ( fieldType , maxDi...
public class GatewayMetrics { /** * Register default Gateway Metrics to given MetricsCollector * @ param metricsCollector the MetricsCollector to register Metrics on */ public void registerMetrics ( MetricsCollector metricsCollector ) { } }
SystemConfig systemConfig = ( SystemConfig ) SingletonRegistry . INSTANCE . getSingleton ( SystemConfig . HERON_SYSTEM_CONFIG ) ; int interval = ( int ) systemConfig . getHeronMetricsExportInterval ( ) . getSeconds ( ) ; metricsCollector . registerMetric ( "__gateway-received-packets-size" , receivedPacketsSize , inter...
public class ActivityDataMap { /** * Returns the value of the named attribute from the session adapter * without storing it in the cache . * If no attribute of the given name exists , returns null . * @ param name a { @ code String } specifying the name of the attribute * @ return an { @ code Object } containin...
if ( activity . getSessionAdapter ( ) != null ) { return activity . getSessionAdapter ( ) . getAttribute ( name ) ; } else { return null ; }
public class NetworkMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Network network , ProtocolMarshaller protocolMarshaller ) { } }
if ( network == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( network . getDirection ( ) , DIRECTION_BINDING ) ; protocolMarshaller . marshall ( network . getProtocol ( ) , PROTOCOL_BINDING ) ; protocolMarshaller . marshall ( network . get...
public class DomainAccessFactory { /** * Create a domain accessor which works with a generic domain model . * @ param dbAccess the graph database connection * @ param domainName * @ param domainLabelUse - - < b > Note : < / b > Consistency may be corrupted , if you change domainLabelUse * on different creations...
return IDomainAccessFactory . INSTANCE . createGenericDomainAccess ( dbAccess , domainName , domainLabelUse ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcPointOrVertexPoint ( ) { } }
if ( ifcPointOrVertexPointEClass == null ) { ifcPointOrVertexPointEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 966 ) ; } return ifcPointOrVertexPointEClass ;
public class MapWithProtoValuesSubject { /** * Specifies that extra repeated field elements for these explicitly specified top - level field * numbers should be ignored . Sub - fields must be specified explicitly ( via { @ link * FieldDescriptor } ) if their extra elements are to be ignored as well . * < p > Use ...
return usingConfig ( config . ignoringExtraRepeatedFieldElementsOfFields ( fieldNumbers ) ) ;
public class MultiChoiceListPreference { /** * Adds a new value to the preference . By adding a value , the changes will be persisted . * @ param value * The value , which should be added , as a { @ link String } . The value may not be null */ public final void addValue ( @ NonNull final String value ) { } }
Condition . INSTANCE . ensureNotNull ( value , "The value may not be null" ) ; if ( this . values != null ) { if ( this . values . add ( value ) ) { if ( persistSet ( this . values ) ) { notifyChanged ( ) ; } } } else { Set < String > newValues = new HashSet < > ( ) ; newValues . add ( value ) ; setValues ( newValues )...
public class VelocityUtil { /** * 将Request中的数据转换为模板引擎 < br > * 取值包括Session和Request * @ param context 内容 * @ param request 请求对象 * @ return VelocityContext */ public static VelocityContext parseRequest ( VelocityContext context , javax . servlet . http . HttpServletRequest request ) { } }
final Enumeration < String > attrs = request . getAttributeNames ( ) ; if ( attrs != null ) { String attrName = null ; while ( attrs . hasMoreElements ( ) ) { attrName = attrs . nextElement ( ) ; context . put ( attrName , request . getAttribute ( attrName ) ) ; } } return context ;
public class SqlInjectionMatchSetUpdateMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SqlInjectionMatchSetUpdate sqlInjectionMatchSetUpdate , ProtocolMarshaller protocolMarshaller ) { } }
if ( sqlInjectionMatchSetUpdate == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sqlInjectionMatchSetUpdate . getAction ( ) , ACTION_BINDING ) ; protocolMarshaller . marshall ( sqlInjectionMatchSetUpdate . getSqlInjectionMatchTuple ( ) , S...
public class DataManager { /** * Populates basic application / device data if app is running for the first time . */ private void onetimeDeviceSetup ( Context context ) { } }
if ( TextUtils . isEmpty ( deviceDAO . device ( ) . getDeviceId ( ) ) ) { deviceDAO . setDeviceId ( DeviceHelper . generateDeviceId ( context ) ) ; try { deviceDAO . setInstanceId ( FirebaseInstanceId . getInstance ( ) . getId ( ) ) ; } catch ( IllegalStateException e ) { deviceDAO . setInstanceId ( "empty" ) ; } devic...
public class PersistInterfaceService { /** * If the context locking mode is activated , this method releases the lock for the given context for writing * operations . */ private void releaseContext ( String contextId ) { } }
if ( mode == ContextLockingMode . DEACTIVATED ) { return ; } synchronized ( activeWritingContexts ) { activeWritingContexts . remove ( contextId ) ; }
public class VerificationConditionGenerator { /** * Translate a break statement . This takes the current context and pushes it * into the enclosing loop scope . It will then be extracted later and used . * @ param stmt * @ param wyalFile */ private Context translateBreak ( WyilFile . Stmt . Break stmt , Context c...
LoopScope enclosingLoop = context . getEnclosingLoopScope ( ) ; enclosingLoop . addBreakContext ( context ) ; return null ;
public class FastMath { /** * Get the largest whole number smaller than x . * @ param x number from which floor is requested * @ return a double number f such that f is an integer f < = x < f + 1.0 */ public static double floor ( double x ) { } }
long y ; if ( x != x ) { // NaN return x ; } if ( x >= TWO_POWER_52 || x <= - TWO_POWER_52 ) { return x ; } y = ( long ) x ; if ( x < 0 && y != x ) { y -- ; } if ( y == 0 ) { return x * y ; } return y ;
public class WebsocketClientTransport { /** * Creates a new instance connecting to localhost * @ param port the port to connect to * @ return a new instance */ public static WebsocketClientTransport create ( int port ) { } }
TcpClient client = TcpClient . create ( ) . port ( port ) ; return create ( client ) ;
public class IzouSoundSourceDataLine { /** * Writes audio data to the mixer via this source data line . The requested * number of bytes of data are read from the specified array , * starting at the given offset into the array , and written to the data * line ' s buffer . If the caller attempts to write more data ...
if ( isMutable ) { return sourceDataLine . write ( b , off , len ) ; } else { if ( isMutedFromSystem ) { byte [ ] newArr = new byte [ b . length ] ; return sourceDataLine . write ( newArr , off , len ) ; } else { return sourceDataLine . write ( b , off , len ) ; } }
public class AmazonElastiCacheClient { /** * Creates a Redis ( cluster mode disabled ) or a Redis ( cluster mode enabled ) replication group . * A Redis ( cluster mode disabled ) replication group is a collection of clusters , where one of the clusters is a * read / write primary and the others are read - only repl...
request = beforeClientExecution ( request ) ; return executeCreateReplicationGroup ( request ) ;
public class XMLTokener { /** * Get the text in the CDATA block . * @ return The string up to the < code > ] ] & gt ; < / code > . * @ throws JSONException If the < code > ] ] & gt ; < / code > is not found . */ public String nextCDATA ( ) throws JSONException { } }
char c ; int i ; StringBuffer sb = new StringBuffer ( ) ; for ( ; ; ) { c = next ( ) ; if ( c == 0 ) { throw syntaxError ( "Unclosed CDATA" ) ; } sb . append ( c ) ; i = sb . length ( ) - 3 ; if ( i >= 0 && sb . charAt ( i ) == ']' && sb . charAt ( i + 1 ) == ']' && sb . charAt ( i + 2 ) == '>' ) { sb . setLength ( i )...
public class ChannelImpl { /** * Called by Peer when we have been hungup . This can happen when Peer * receives a HangupEvent or during a periodic sweep done by PeerMonitor to * find the status of all channels . Notify any listeners that this channel * has been hung up . */ @ Override public void notifyHangupList...
this . _isLive = false ; if ( this . hangupListener != null ) { this . hangupListener . channelHangup ( this , cause , causeText ) ; } else { logger . warn ( "Hangup listener is null" ) ; }
public class Date { /** * setter for day - sets day of the month , C * @ generated * @ param v value to set into the feature */ public void setDay ( int v ) { } }
if ( Date_Type . featOkTst && ( ( Date_Type ) jcasType ) . casFeat_day == null ) jcasType . jcas . throwFeatMissing ( "day" , "de.julielab.jules.types.Date" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( Date_Type ) jcasType ) . casFeatCode_day , v ) ;
public class Utils { /** * Convenience method for creating a new { @ link ImmutableSet } with concatenated iterable . */ @ NonNull public static < E > ImmutableSet < E > concatSet ( @ NonNull ImmutableSet < E > set , @ NonNull Iterable < E > toConcat ) { } }
return ImmutableSet . < E > builder ( ) . addAll ( set ) . addAll ( toConcat ) . build ( ) ;
public class StrictnessSelector { /** * Determines the actual strictness in the following importance order : * 1st - strictness configured when declaring stubbing ; * 2nd - strictness configured at mock level ; * 3rd - strictness configured at test level ( rule , mockito session ) * @ param stubbing stubbing to...
if ( stubbing != null && stubbing . getStrictness ( ) != null ) { return stubbing . getStrictness ( ) ; } if ( mockSettings . isLenient ( ) ) { return Strictness . LENIENT ; } return testLevelStrictness ;
public class DescribeTransitGatewaysRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DescribeTransitGatewaysRequest > getDryRunRequest ( ) { } }
Request < DescribeTransitGatewaysRequest > request = new DescribeTransitGatewaysRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class ServerStateMachine { /** * Applies a configuration entry to the internal state machine . * Configuration entries are applied to internal server state when written to the log . Thus , no significant * logic needs to take place in the handling of configuration entries . We simply release the previous con...
// Clean the configuration entry from the log . The entry will be retained until it has been stored // on all servers . log . release ( entry . getIndex ( ) ) ; return CompletableFuture . completedFuture ( null ) ;
public class MarcValueTransformers { /** * Transform value . * @ param field the MARC field where values are transformed * @ return a new MARC field with transformed values */ public MarcField transformValue ( MarcField field ) { } }
String key = field . toTagIndicatorKey ( ) ; if ( marcValueTransformerMap . isEmpty ( ) ) { return field ; } final MarcValueTransformer transformer = marcValueTransformerMap . containsKey ( key ) ? marcValueTransformerMap . get ( key ) : marcValueTransformerMap . get ( DEFAULT ) ; if ( transformer != null ) { MarcField...
public class KeyVaultClientCustomImpl { /** * Gets information about a specified certificate . * @ param vaultBaseUrl * The vault name , e . g . https : / / myvault . vault . azure . net * @ param certificateName * The name of the certificate in the given vault * @ param serviceCallback * the async ServiceC...
return getCertificateAsync ( vaultBaseUrl , certificateName , "" , serviceCallback ) ;
public class OperatorTopologyImpl { /** * Only refreshes the effective topology with deletion msgs from . * deletionDeltas queue * @ throws ParentDeadException */ private void refreshEffectiveTopology ( ) throws ParentDeadException { } }
LOG . entering ( "OperatorTopologyImpl" , "refreshEffectiveTopology" , getQualifiedName ( ) ) ; LOG . finest ( getQualifiedName ( ) + "Waiting to acquire topoLock" ) ; synchronized ( topologyLock ) { LOG . finest ( getQualifiedName ( ) + "Acquired topoLock" ) ; assert effectiveTopology != null ; final Set < GroupCommun...
public class RequestAttributeSourceFilter { /** * Add request headers to the attributes map * @ param httpServletRequest Http Servlet Request * @ param attributes Map of attributes to add additional attributes to from the Http Request */ protected void addRequestHeaders ( final HttpServletRequest httpServletRequest...
for ( final Map . Entry < String , Set < String > > headerAttributeEntry : this . headerAttributeMapping . entrySet ( ) ) { final String headerName = headerAttributeEntry . getKey ( ) ; final String value = httpServletRequest . getHeader ( headerName ) ; if ( value != null ) { for ( final String attributeName : headerA...
public class GraphHelper { /** * For the given type , finds an unique attribute and checks if there is an existing instance with the same * unique value * @ param classType * @ param instance * @ return * @ throws AtlasException */ public AtlasVertex getVertexForInstanceByUniqueAttribute ( ClassType classType...
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Checking if there is an instance with the same unique attributes for instance {}" , instance . toShortString ( ) ) ; } AtlasVertex result = null ; for ( AttributeInfo attributeInfo : classType . fieldMapping ( ) . fields . values ( ) ) { if ( attributeInfo . isUnique ) {...
public class SQLiteDatabase { /** * Query the given URL , returning a { @ link Cursor } over the result set . * @ param distinct true if you want each row to be unique , false otherwise . * @ param table The table name to compile the query against . * @ param columns A list of which columns to return . Passing nu...
return queryWithFactory ( null , distinct , table , columns , selection , selectionArgs , groupBy , having , orderBy , limit , null ) ;
public class EventBus { /** * Bind a { @ link ActEventListener eventListener } to an event type extended * from { @ link EventObject } synchronously . * @ param eventType * the target event type - should be a sub class of { @ link EventObject } * @ param eventListener * the listener - an instance of { @ link ...
return _bind ( actEventListeners , eventType , eventListener , 0 ) ;
public class DatePartitionHiveVersionFinder { /** * Create a { @ link TimestampedHiveDatasetVersion } from a { @ link Partition } . The hive table is expected * to be date partitioned by { @ link # partitionKeyName } . The partition value format must be { @ link # pattern } * @ throws IllegalArgumentException when ...
int index = Iterables . indexOf ( partition . getTable ( ) . getPartitionKeys ( ) , this . partitionKeyNamePredicate ) ; if ( index == - 1 ) { throw new IllegalArgumentException ( String . format ( "Failed to find partition key %s in the table %s" , this . partitionKeyName , partition . getTable ( ) . getCompleteName (...
public class GaliosFieldOps { /** * Implementation of multiplication with a primitive polynomial . The result will be a member of the same field * as the inputs , provided primitive is an appropriate irreducible polynomial for that field . * Uses ' Russian Peasant Multiplication ' that should be a faster algorithm ...
int r = 0 ; while ( y > 0 ) { if ( ( y & 1 ) != 0 ) { r = r ^ x ; } y = y >> 1 ; x = x << 1 ; if ( x >= domain ) { x ^= primitive ; } } return r ;
public class SignOutUserRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SignOutUserRequest signOutUserRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( signOutUserRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( signOutUserRequest . getFleetArn ( ) , FLEETARN_BINDING ) ; protocolMarshaller . marshall ( signOutUserRequest . getUsername ( ) , USERNAME_BINDING ) ; } catch ( Exce...
public class TrieIterator { /** * Internal block value calculations * Performs calculations on a data block to find codepoints in m _ nextBlock _ * after the index m _ nextBlockIndex _ that has the same value . * Note m _ * _ variables at this point is the next codepoint whose value * has not been calculated . ...
while ( m_nextBlockIndex_ < DATA_BLOCK_LENGTH_ ) { m_nextValue_ = extract ( m_trie_ . getValue ( m_nextBlock_ + m_nextBlockIndex_ ) ) ; if ( m_nextValue_ != currentValue ) { return false ; } ++ m_nextBlockIndex_ ; ++ m_nextCodepoint_ ; } return true ;
public class SQLExpressions { /** * Start a window function expression * @ param expr expression * @ return max ( expr ) */ public static < T extends Comparable > WindowOver < T > max ( Expression < T > expr ) { } }
return new WindowOver < T > ( expr . getType ( ) , Ops . AggOps . MAX_AGG , expr ) ;
public class GDLLoader { /** * Creates a cache containing a mapping from variables to query elements . The cache is filled * with elements from the user cache and / or the auto cache depending on the specified flags . * @ param userCache element user cache * @ param autoCache element auto cache * @ param includ...
Map < String , T > cache = new HashMap < > ( ) ; if ( includeUserDefined ) { cache . putAll ( userCache ) ; } if ( includeAutoGenerated ) { cache . putAll ( autoCache ) ; } return Collections . unmodifiableMap ( cache ) ;
public class SibRaCommonEndpointActivation { /** * This method will try to connect to an ME using the supplied target properties * @ param targetType - The type of target * @ param targetSignificance - Target significane ( preferred or required ) * @ param target - The name of the target * @ throws ResourceExce...
final String methodName = "connectUsingTrmWithTargetData" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { targetType , targetSignificance , target } ) ; } synchronized ( _connections ) { // At this point in the code path we c...
public class QueueContainer { /** * Tries to obtain an item by removing the head of the * queue or removing an item previously reserved by invoking * { @ link # txnOfferReserve ( String ) } with { @ code reservedOfferId } . * If the queue item does not have data in - memory it will load the * data from the queu...
QueueItem item = getItemQueue ( ) . peek ( ) ; if ( item == null ) { TxQueueItem txItem = txMap . remove ( reservedOfferId ) ; if ( txItem == null ) { return null ; } item = new QueueItem ( this , txItem . getItemId ( ) , txItem . getData ( ) ) ; return item ; } if ( store . isEnabled ( ) && item . getData ( ) == null ...
public class LookaheadChainingListener { /** * { @ inheritDoc } * @ since 2.0RC1 */ @ Override public void beginDefinitionList ( Map < String , String > parameters ) { } }
this . previousEvents . beginDefinitionList ( parameters ) ; firePreviousEvent ( ) ;
public class DebuggableScheduledThreadPoolExecutor { /** * We need this as well as the wrapper for the benefit of non - repeating tasks */ @ Override public void afterExecute ( Runnable r , Throwable t ) { } }
super . afterExecute ( r , t ) ; DebuggableThreadPoolExecutor . logExceptionsAfterExecute ( r , t ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertBeginSegmentCommandFLAG2ToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class FieldDefinitionBuilder { /** * Registers CronField in ParserDefinitionBuilder and returns its instance . * @ return ParserDefinitionBuilder instance obtained from constructor */ public CronDefinitionBuilder and ( ) { } }
cronDefinitionBuilder . register ( new FieldDefinition ( fieldName , constraints . createConstraintsInstance ( ) , optional ) ) ; return cronDefinitionBuilder ;
public class StringTextTemplate { /** * { @ inheritDoc } */ @ Override public TextTemplate interpolate ( final Map < String , ? > variables ) { } }
if ( variables != null ) { final String result = new MapVariableInterpolator ( buffer . toString ( ) , variables ) . toString ( ) ; buffer . delete ( 0 , buffer . length ( ) ) ; buffer . append ( result ) ; } return this ;
public class GZipUtils { /** * 文件压缩 * @ param path * @ param delete 是否删除原始文件 * @ throws Exception */ public static void compress ( String path , boolean delete ) throws Exception { } }
File file = new File ( path ) ; compress ( file , delete ) ;
public class CmsExplorerTypeSettings { /** * Sets if the title property should automatically be added on resource creation . < p > * @ param autoSetTitle true if title should be added , otherwise false */ public void setAutoSetTitle ( String autoSetTitle ) { } }
m_autoSetTitle = Boolean . valueOf ( autoSetTitle ) . booleanValue ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SET_AUTO_TITLE_1 , autoSetTitle ) ) ; }
public class InternalService { /** * Returns observable to add a participant to . * @ param conversationId ID of a conversation to add a participant to . * @ return Observable to get a list of conversation participants . */ public Observable < ComapiResult < List < Participant > > > getParticipants ( @ NonNull fina...
final String token = getToken ( ) ; if ( sessionController . isCreatingSession ( ) ) { return getTaskQueue ( ) . queueGetParticipants ( conversationId ) ; } else if ( TextUtils . isEmpty ( token ) ) { return Observable . error ( getSessionStateErrorDescription ( ) ) ; } else { return doGetParticipants ( token , convers...
public class CancellationTokenSource { /** * Cancels the token if it has not already been cancelled . */ public void cancel ( ) { } }
List < CancellationTokenRegistration > registrations ; synchronized ( lock ) { throwIfClosed ( ) ; if ( cancellationRequested ) { return ; } cancelScheduledCancellation ( ) ; cancellationRequested = true ; registrations = new ArrayList < > ( this . registrations ) ; } notifyListeners ( registrations ) ;
public class MerkleTreeConfig { /** * Sets the depth of the merkle tree . The depth must be between * { @ value MAX _ DEPTH } and { @ value MIN _ DEPTH } ( exclusive ) . * @ param depth the depth of the merkle tree * @ return the updated config * @ throws ConfigurationException if the { @ code depth } is greate...
if ( depth < MIN_DEPTH || depth > MAX_DEPTH ) { throw new IllegalArgumentException ( "Merkle tree depth " + depth + " is outside of the allowed range " + MIN_DEPTH + "-" + MAX_DEPTH + ". " ) ; } this . depth = depth ; return this ;
public class PreferenceActivity { /** * Sets the width of the navigation , when using the split screen layout . * @ param width * The width , which should be set , in pixels as an { @ link Integer } value . The width must * be greater than 0 */ public final void setNavigationWidth ( @ Px final int width ) { } }
Condition . INSTANCE . ensureGreater ( width , 0 , "The width must be greater than 0" ) ; this . navigationWidth = width ; adaptNavigationWidth ( ) ;
public class NodeIndexer { /** * Returns < code > true < / code > if the content of the property with the given * name should the used to create an excerpt . * @ param propertyName the name of a property . * @ return < code > true < / code > if it should be used to create an excerpt ; * < code > false < / code ...
if ( indexingConfig == null ) { return true ; } else { return indexingConfig . useInExcerpt ( node , propertyName ) ; }
public class SAMFileMerger { /** * Merge part file shards produced by { @ link KeyIgnoringAnySAMOutputFormat } into a * single file with the given header . * @ param partDirectory the directory containing part files * @ param outputFile the file to write the merged file to * @ param samOutputFormat the format (...
// First , check for the _ SUCCESS file . final Path partPath = asPath ( partDirectory ) ; final Path successPath = partPath . resolve ( "_SUCCESS" ) ; if ( ! Files . exists ( successPath ) ) { throw new NoSuchFileException ( successPath . toString ( ) , null , "Unable to find _SUCCESS file" ) ; } final Path outputPath...
public class Util { /** * Reject { @ code null } , empty , and blank strings with a good exception type and message . */ static String checkStringArgument ( String s , String name ) { } }
checkNotNull ( s , name ) ; checkArgument ( ! s . trim ( ) . isEmpty ( ) , "'" + name + "' must not be blank. Was: '" + s + "'" ) ; return s ;
public class PtoPInputHandler { /** * Method eventPrecommitAdd . * @ param msg * @ param transaction * @ throws SIStoreException * @ throws SIResourceException */ final protected void eventPrecommitAdd ( MessageItem msg , final TransactionCommon transaction ) throws SIDiscriminatorSyntaxException , SIResourceEx...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "eventPrecommitAdd" , new Object [ ] { msg , transaction } ) ; if ( ! ( _destination . isToBeDeleted ( ) ) ) { if ( msg . isTransacted ( ) && ( ! ( msg . isToBeStoredAtSendTime ( ) ) ) ) { // LockR the destination to prevent...
public class DatasourceConnectionPool { /** * do not change interface , used by argus monitor */ public Map < String , Integer > openConnections ( ) { } }
Map < String , Integer > map = new HashMap < String , Integer > ( ) ; Iterator < DCStack > it = dcs . values ( ) . iterator ( ) ; // all connections in pool DCStack dcstack ; while ( it . hasNext ( ) ) { dcstack = it . next ( ) ; Integer val = map . get ( dcstack . getDatasource ( ) . getName ( ) ) ; if ( val == null )...
public class EditorUtilities { public static void displayMessageBox ( String strMsg , final int iType , boolean bWrapText ) { } }
final String strWrappedMsg = bWrapText ? wrapText ( strMsg ) : strMsg ; Runnable logMsgBox = new Runnable ( ) { public void run ( ) { JOptionPane . showMessageDialog ( getWindow ( ) , strWrappedMsg , "" , iType ) ; } } ; if ( EventQueue . isDispatchThread ( ) ) { logMsgBox . run ( ) ; } else { try { EventQueue . invoke...
public class WordChoiceEvaluationRunner { /** * Evaluates the performance of a given { @ code SemanticSpace } on a given * { @ code WordChoiceEvaluation } using the provided similarity metric . * Returns a { @ link WordChoiceReport } detailing the performance . * @ param sspace The { @ link SemanticSpace } to tes...
Collection < MultipleChoiceQuestion > questions = test . getQuestions ( ) ; int correct = 0 ; int unanswerable = 0 ; question_loop : // Answer each question by using the vectors from the provided Semantic // Space for ( MultipleChoiceQuestion question : questions ) { String promptWord = question . getPrompt ( ) ; // ge...
public class MFPPush { /** * Checks whether push notification is supported . * @ return true if push is supported , false otherwise . */ public boolean isPushSupported ( ) { } }
String version = android . os . Build . VERSION . RELEASE . substring ( 0 , 3 ) ; return ( Double . valueOf ( version ) >= MIN_SUPPORTED_ANDRIOD_VERSION ) ;
public class GeometryColumnsSfSqlDao { /** * { @ inheritDoc } */ @ Override public int delete ( GeometryColumnsSfSql data ) throws SQLException { } }
DeleteBuilder < GeometryColumnsSfSql , TableColumnKey > db = deleteBuilder ( ) ; db . where ( ) . eq ( GeometryColumnsSfSql . COLUMN_F_TABLE_NAME , data . getFTableName ( ) ) . and ( ) . eq ( GeometryColumnsSfSql . COLUMN_F_GEOMETRY_COLUMN , data . getFGeometryColumn ( ) ) ; PreparedDelete < GeometryColumnsSfSql > dele...
public class Zipper { /** * Write a string . * @ param string The string to write . * @ throws JSONException */ private void writeString ( String string ) throws JSONException { } }
// Special case for empty strings . if ( string . length ( ) == 0 ) { zero ( ) ; write ( end , this . stringhuff ) ; } else { Kim kim = new Kim ( string ) ; // Look for the string in the strings keep . If it is found , emit its // integer and count that as a use . int integer = this . stringkeep . find ( kim ) ; if ( i...
public class ExecutionEnvironment { /** * Creates a DataSet from the given non - empty collection . Note that this operation will result * in a non - parallel data source , i . e . a data source with a parallelism of one . * < p > The returned DataSet is typed to the given TypeInformation . * @ param data The col...
return fromCollection ( data , type , Utils . getCallLocationName ( ) ) ;
public class AccessSet { /** * Read the related { @ link org . efaps . admin . datamodel . Status } . * @ throws CacheReloadException on error */ private void readLinks2Status ( ) throws CacheReloadException { } }
Connection con = null ; try { final List < Long > values = new ArrayList < > ( ) ; con = Context . getConnection ( ) ; PreparedStatement stmt = null ; try { stmt = con . prepareStatement ( AccessSet . SQL_SET2STATUS ) ; stmt . setObject ( 1 , getId ( ) ) ; final ResultSet rs = stmt . executeQuery ( ) ; while ( rs . nex...
public class MultipleSelect { /** * Returns the selected items list . If no item is selected , this method * returns an empty list . * @ return the selected items list */ public List < Option > getSelectedItems ( ) { } }
final List < Option > items = new ArrayList < > ( 0 ) ; for ( Entry < OptionElement , Option > entry : itemMap . entrySet ( ) ) { Option opt = entry . getValue ( ) ; if ( opt . isSelected ( ) ) items . add ( opt ) ; } return items ;
public class Ansi { /** * Wrapps given < code > message < / message > with special ansi control sequences and returns it */ public String colorize ( String message ) { } }
if ( SUPPORTED ) { StringBuilder buff = new StringBuilder ( start . length ( ) + message . length ( ) + END . length ( ) ) ; buff . append ( start ) . append ( message ) . append ( END ) ; return buff . toString ( ) ; } else return message ;
public class SQLRebuilder { /** * Get the names of all Fedora tables listed in the server ' s dbSpec file . * Names will be returned in ALL CAPS so that case - insensitive comparisons * can be done . */ private List < String > getFedoraTables ( ) { } }
try { InputStream in = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( DBSPEC_LOCATION ) ; List < TableSpec > specs = TableSpec . getTableSpecs ( in ) ; ArrayList < String > names = new ArrayList < String > ( ) ; for ( TableSpec spec : specs ) { names . add ( spec . getName ( ) . toUpperCase ( ) ) ; } return ...
public class PresenceSubscriber { /** * This method is the same as refreshBuddy ( duration , eventId , timeout ) except that instead of * creating the SUBSCRIBE request from parameters passed in , the given request message parameter * is used for sending out the SUBSCRIBE message . * The Request parameter passed ...
if ( parent . getBuddyList ( ) . get ( targetUri ) == null ) { setReturnCode ( SipSession . INVALID_ARGUMENT ) ; setErrorMessage ( "Buddy refresh for URI " + targetUri + " failed, uri was not found in the buddy list. Use fetchPresenceInfo() for users not in the buddy list" ) ; return false ; } return refreshSubscriptio...
public class TcpServerTransport { /** * Creates a new instance binding to localhost * @ param port the port to bind to * @ return a new instance */ public static TcpServerTransport create ( int port ) { } }
TcpServer server = TcpServer . create ( ) . port ( port ) ; return create ( server ) ;
public class BlockdevRefOrNull { /** * This overrides @ JsonUnwrapped . */ @ JsonValue public Object toJsonValue ( ) { } }
if ( definition != null ) return definition ; if ( reference != null ) return reference ; if ( _null != null ) return _null ; return null ;
public class DimFilterUtils { /** * Filter the given iterable of objects by removing any object whose ShardSpec , obtained from the converter function , * does not fit in the RangeSet of the dimFilter { @ link DimFilter # getDimensionRangeSet ( String ) } . The returned set * contains the filtered objects in the sa...
return filterShards ( dimFilter , input , converter , new HashMap < String , Optional < RangeSet < String > > > ( ) ) ;
public class CallableProcedureStatement { /** * < p > Registers the designated output parameter . * This version of the method < code > registerOutParameter < / code > should be used for a user - defined * or < code > REF < / code > output parameter . Examples of user - defined types include : * < code > STRUCT <...
CallParameter callParameter = getParameter ( parameterIndex ) ; callParameter . setOutputSqlType ( sqlType ) ; callParameter . setTypeName ( typeName ) ; callParameter . setOutput ( true ) ;
public class MimeType { /** * Returns a mime type string by parsing the file extension of a file string . If the extension is not found or * unknown the default value is returned . * @ param file path to a file with extension * @ param defaultMimeType what to return if not found * @ return mime type */ public s...
int sep = file . lastIndexOf ( '.' ) ; if ( sep != - 1 ) { String extension = file . substring ( sep + 1 , file . length ( ) ) ; String mime = mimes . get ( extension ) ; if ( mime != null ) { return mime ; } } return defaultMimeType ;
public class AmazonWebServiceRequest { /** * Sets the optional credentials provider to use for this request , overriding the default credentials * provider at the client level . * @ param credentialsProvider * The optional AWS security credentials provider to use for this request , overriding the * default cred...
setRequestCredentialsProvider ( credentialsProvider ) ; @ SuppressWarnings ( "unchecked" ) T t = ( T ) this ; return t ;