signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class Organizer { @ SuppressWarnings ( "unchecked" ) public static < T > void fill ( Collection < T > collection , T ... args ) { } }
|
if ( collection == null || args == null ) return ; for ( T t : args ) { collection . add ( t ) ; }
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link BvarType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "bvar" ) public JAXBElement < BvarType > createBvar ( BvarType value ) { } }
|
return new JAXBElement < BvarType > ( _Bvar_QNAME , BvarType . class , null , value ) ;
|
public class EvernoteUtil { /** * Construct a user - agent string based on the running application and
* the device and operating system information . This information is
* included in HTTP requests made to the Evernote service and assists
* in measuring traffic and diagnosing problems . */
public static String generateUserAgentString ( Context ctx ) { } }
|
String packageName = null ; int packageVersion = 0 ; try { packageName = ctx . getPackageName ( ) ; packageVersion = ctx . getPackageManager ( ) . getPackageInfo ( packageName , 0 ) . versionCode ; } catch ( PackageManager . NameNotFoundException e ) { CAT . e ( e . getMessage ( ) ) ; } String userAgent = packageName + " Android/" + packageVersion ; Locale locale = java . util . Locale . getDefault ( ) ; if ( locale == null ) { userAgent += " (" + Locale . US + ");" ; } else { userAgent += " (" + locale . toString ( ) + "); " ; } userAgent += "Android/" + Build . VERSION . RELEASE + "; " ; userAgent += Build . MODEL + "/" + Build . VERSION . SDK_INT + ";" ; return userAgent ;
|
public class ConfigPropertiesAugmenter { /** * Determine whether a property is augmentable ( so instead of overriding ,
* values are appended to the current values ) .
* @ param configKey
* the configuration key
* @ return true if the property is augmentable or not . */
protected boolean isAugmentable ( String configKey ) { } }
|
boolean rets = ( configKey . endsWith ( PropertiesBundleConstant . BUNDLE_FACTORY_CUSTOM_NAMES ) || // Bundles
configKey . endsWith ( PropertiesBundleConstant . BUNDLE_FACTORY_CUSTOM_MAPPINGS ) || // mappings
configKey . endsWith ( PropertiesBundleConstant . BUNDLE_FACTORY_CUSTOM_COMPOSITE_NAMES ) || // children
// of
// composites
configKey . equals ( PropertiesBundleConstant . CUSTOM_POSTPROCESSORS + PropertiesBundleConstant . CUSTOM_POSTPROCESSORS_NAMES ) || // Postprocessors
// definition
configKey . equals ( PropertiesBundleConstant . PROPS_PREFIX + PropertiesBundleConstant . CUSTOM_GENERATORS ) ) ; // Generators
// definition
rets = rets && configProperties . containsKey ( configKey ) ; return rets ;
|
public class ItemsCountDto { /** * Converts an integer to ItemsCountDto instance .
* @ param value
* The items count .
* @ return An itemsCountDto object .
* @ throws WebApplicationException
* If an error occurs . */
public static ItemsCountDto transformToDto ( int value ) { } }
|
if ( value < 0 ) { throw new WebApplicationException ( "Items count cannot be negative" , Status . INTERNAL_SERVER_ERROR ) ; } ItemsCountDto result = new ItemsCountDto ( ) ; result . setValue ( value ) ; return result ;
|
public class SymbolizerWrapper { /** * Set the fill ' s { @ link ExternalGraphic } path .
* < p > Currently one { @ link ExternalGraphic } per { @ link Symbolizer } is supported .
* < p > This is used for polygons .
* @ param externalGraphicPath the path to set .
* @ throws MalformedURLException */
public void setFillExternalGraphicFillPath ( String externalGraphicPath , double size ) throws MalformedURLException { } }
|
Graphic graphic = null ; PolygonSymbolizerWrapper polygonSymbolizerWrapper = adapt ( PolygonSymbolizerWrapper . class ) ; if ( polygonSymbolizerWrapper != null ) { graphic = polygonSymbolizerWrapper . getFillGraphicFill ( ) ; if ( graphic == null ) { graphic = sf . createDefaultGraphic ( ) ; } polygonSymbolizerWrapper . setFillGraphicFill ( graphic ) ; } else { return ; } graphic . graphicalSymbols ( ) . clear ( ) ; String urlStr = externalGraphicPath ; if ( ! externalGraphicPath . startsWith ( "http:" ) && ! externalGraphicPath . startsWith ( "file:" ) ) { // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
urlStr = "file:" + externalGraphicPath ; // $ NON - NLS - 1 $
} if ( fillExternalGraphicFill == null ) { fillExternalGraphicFill = sb . createExternalGraphic ( new URL ( urlStr ) , getFormat ( externalGraphicPath ) ) ; } else { setExternalGraphicPath ( externalGraphicPath , fillExternalGraphicFill ) ; } graphic . graphicalSymbols ( ) . add ( fillExternalGraphicFill ) ; FilterFactory ff = CommonFactoryFinder . getFilterFactory ( GeoTools . getDefaultHints ( ) ) ; graphic . setSize ( ff . literal ( size ) ) ;
|
public class InternalXtextParser { /** * InternalXtext . g : 370:1 : entryRuleUnorderedGroup : ruleUnorderedGroup EOF ; */
public final void entryRuleUnorderedGroup ( ) throws RecognitionException { } }
|
try { // InternalXtext . g : 371:1 : ( ruleUnorderedGroup EOF )
// InternalXtext . g : 372:1 : ruleUnorderedGroup EOF
{ before ( grammarAccess . getUnorderedGroupRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; ruleUnorderedGroup ( ) ; state . _fsp -- ; after ( grammarAccess . getUnorderedGroupRule ( ) ) ; match ( input , EOF , FollowSets000 . FOLLOW_2 ) ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return ;
|
public class AbstractInterfaceConfig { /** * Buildmkey string .
* @ param methodName the method name
* @ param key the key
* @ return the string */
private String buildmkey ( String methodName , String key ) { } }
|
return RpcConstants . HIDE_KEY_PREFIX + methodName + RpcConstants . HIDE_KEY_PREFIX + key ;
|
public class NormalizerSerializer { /** * Write the data header
* @ param stream the output stream
* @ param header the header to write
* @ throws IOException */
private void writeHeader ( OutputStream stream , Header header ) throws IOException { } }
|
DataOutputStream dos = new DataOutputStream ( stream ) ; dos . writeUTF ( HEADER ) ; // Write the current version
dos . writeInt ( 1 ) ; // Write the normalizer opType
dos . writeUTF ( header . normalizerType . toString ( ) ) ; // If the header contains a custom class opName , write that too
if ( header . customStrategyClass != null ) { dos . writeUTF ( header . customStrategyClass . getName ( ) ) ; }
|
public class PropertyData { /** * Resolves the toString generator .
* @ param file the file
* @ param lineIndex the line index */
public void resolveToStringStyle ( File file , int lineIndex ) { } }
|
if ( toStringStyle . equals ( "smart" ) ) { toStringStyle = ( bean . isImmutable ( ) ? "field" : "getter" ) ; } if ( toStringStyle . equals ( "omit" ) || toStringStyle . equals ( "getter" ) || toStringStyle . equals ( "field" ) ) { return ; } throw new BeanCodeGenException ( "Invalid toString style: " + toStringStyle + " in " + getBean ( ) . getTypeRaw ( ) + "." + getPropertyName ( ) , file , lineIndex ) ;
|
public class TLSTransportClient { /** * - - - - - helper methods - - - - - */
void sendMessage ( IMessage message ) throws IOException , AvpDataException , NotInitializedException , ParseException { } }
|
if ( ! isConnected ( ) ) { throw new IOException ( "Failed to send message over [" + socketDescription + "]" ) ; } // switch to wait for SSL handshake to workout .
if ( ! isExchangeAllowed ( ) ) { // TODO : do more ?
return ; } doTLSPreSendProcessing ( message ) ; final ByteBuffer messageBuffer = this . parser . encodeMessage ( message ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "About to send a byte buffer of size [{}] over the TLS socket [{}]" , messageBuffer . array ( ) . length , socketDescription ) ; } lock . lock ( ) ; try { this . outputStream . write ( messageBuffer . array ( ) , messageBuffer . position ( ) , messageBuffer . limit ( ) ) ; doTLSPostSendProcessing ( message ) ; } catch ( Exception e ) { logger . debug ( "Unable to send message" , e ) ; throw new IOException ( "Error while sending message: " + e ) ; } finally { lock . unlock ( ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Sent a byte buffer of size [{}] over the TLS nio socket [{}]" , messageBuffer . array ( ) . length , socketDescription ) ; }
|
public class MailApi { /** * Create a mail label Create a mail label - - - SSO Scope :
* esi - mail . organize _ mail . v1
* @ param characterId
* An EVE character ID ( required )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param token
* Access token to use if unable to set a header ( optional )
* @ param mailLabelSimple
* ( optional )
* @ return Integer
* @ throws ApiException
* If fail to call the API , e . g . server error or cannot
* deserialize the response body */
public Integer postCharactersCharacterIdMailLabels ( Integer characterId , String datasource , String token , MailLabelSimple mailLabelSimple ) throws ApiException { } }
|
ApiResponse < Integer > resp = postCharactersCharacterIdMailLabelsWithHttpInfo ( characterId , datasource , token , mailLabelSimple ) ; return resp . getData ( ) ;
|
public class Gauge { /** * Defines the behavior of the needle movement .
* The values are STANDARD and OPTIMIZED
* This is an experimental feature that only makes sense in
* gauges that use an angleRange of 360 degrees and where the
* needle should be able to use the shortest way to the target
* value . As an example one can think of a compass . If the value
* in a compass changes from 20 degrees to 290 degrees the needle
* will take the shortest way to the value , in this case this
* means it will rotate counter - clockwise .
* @ param BEHAVIOR */
public void setNeedleBehavior ( final NeedleBehavior BEHAVIOR ) { } }
|
if ( null == needleBehavior ) { _needleBehavior = null == BEHAVIOR ? NeedleBehavior . STANDARD : BEHAVIOR ; } else { needleBehavior . set ( BEHAVIOR ) ; }
|
public class SimpleDataArray { /** * Fire beforePersist events to the PersistableListener . */
protected void fireBeforePersist ( ) { } }
|
PersistableListener l = _listener ; if ( l != null ) { try { l . beforePersist ( ) ; } catch ( Exception e ) { _log . error ( "failure on calling beforePersist" , e ) ; } }
|
public class AuthenticateApi { /** * This method is specifically for handling the Servlet 3.0 method
* HttpServletRequest . logout ( ) . Per the JSR 196 spec , it will check for
* JASPI authentication and if enabled will attempt to call the JASPI provider ' s
* cleanSubject method , and will always call the main logout method .
* @ param res
* @ param resp
* @ param webAppSecConfig */
public void logoutServlet30 ( HttpServletRequest res , HttpServletResponse resp , WebAppSecurityConfig webAppSecConfig ) throws ServletException { } }
|
JaspiService jaspiService = getJaspiService ( ) ; if ( jaspiService != null ) { try { jaspiService . logout ( res , resp , webAppSecConfig ) ; } catch ( AuthenticationException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "AuthenticationException invoking JASPI service logout" , e ) ; } } logout ( res , resp , webAppSecConfig ) ;
|
public class SystemClock { /** * / * [ deutsch ]
* < p > Liefert die aktuelle seit [ 1972-01-01T00:00:00,00000Z ] verstrichene
* UTC - Zeit in Mikrosekunden . < / p >
* @ return count of microseconds since UTC epoch including leap seconds
* @ see # currentTimeInMicros ( )
* @ since 3.2/4.1 */
public long realTimeInMicros ( ) { } }
|
if ( this . monotonic || MONOTON_MODE ) { return Math . floorDiv ( this . utcNanos ( ) , 1000 ) ; } else { long millis = System . currentTimeMillis ( ) ; long utc = LeapSeconds . getInstance ( ) . enhance ( Math . floorDiv ( millis , 1000 ) ) ; return Math . multiplyExact ( utc , MIO ) + Math . floorMod ( millis , 1000 ) * 1000 ; }
|
public class StandardDdlParser { /** * Adds column reference nodes to a parent node . Returns true if column references added , false if not .
* @ param tokens the { @ link DdlTokenStream } representing the tokenized DDL content ; may not be null
* @ param parentNode the parent node
* @ param referenceType the type of the reference node to create
* @ return true if the column references were found and added to the node , or false if there were no column references found
* in the stream */
protected boolean parseColumnNameList ( DdlTokenStream tokens , AstNode parentNode , String referenceType ) { } }
|
boolean parsedColumns = false ; // CONSUME COLUMNS
List < String > columnNameList = new ArrayList < String > ( ) ; if ( tokens . matches ( L_PAREN ) ) { tokens . consume ( L_PAREN ) ; columnNameList = parseNameList ( tokens ) ; if ( ! columnNameList . isEmpty ( ) ) { parsedColumns = true ; } tokens . consume ( R_PAREN ) ; } for ( String columnName : columnNameList ) { nodeFactory ( ) . node ( columnName , parentNode , referenceType ) ; } return parsedColumns ;
|
public class Setup { /** * Returns ' to ' file or dir path relative to ' from ' dir .
* Result always uses forward slashes and has no trailing slash . */
public String getRelativePath ( File from , File to ) { } }
|
Path fromPath = Paths . get ( from . getPath ( ) ) . normalize ( ) . toAbsolutePath ( ) ; Path toPath = Paths . get ( to . getPath ( ) ) . normalize ( ) . toAbsolutePath ( ) ; return fromPath . relativize ( toPath ) . toString ( ) . replace ( '\\' , '/' ) ;
|
public class Type { /** * Returns the { @ link Type } values corresponding to the argument types of the given method
* descriptor .
* @ param methodDescriptor a method descriptor .
* @ return the { @ link Type } values corresponding to the argument types of the given method
* descriptor . */
public static Type [ ] getArgumentTypes ( final String methodDescriptor ) { } }
|
// First step : compute the number of argument types in methodDescriptor .
int numArgumentTypes = 0 ; // Skip the first character , which is always a ' ( ' .
int currentOffset = 1 ; // Parse the argument types , one at a each loop iteration .
while ( methodDescriptor . charAt ( currentOffset ) != ')' ) { while ( methodDescriptor . charAt ( currentOffset ) == '[' ) { currentOffset ++ ; } if ( methodDescriptor . charAt ( currentOffset ++ ) == 'L' ) { while ( methodDescriptor . charAt ( currentOffset ++ ) != ';' ) { // Skip the argument descriptor content .
} } ++ numArgumentTypes ; } // Second step : create a Type instance for each argument type .
Type [ ] argumentTypes = new Type [ numArgumentTypes ] ; // Skip the first character , which is always a ' ( ' .
currentOffset = 1 ; // Parse and create the argument types , one at each loop iteration .
int currentArgumentTypeIndex = 0 ; while ( methodDescriptor . charAt ( currentOffset ) != ')' ) { final int currentArgumentTypeOffset = currentOffset ; while ( methodDescriptor . charAt ( currentOffset ) == '[' ) { currentOffset ++ ; } if ( methodDescriptor . charAt ( currentOffset ++ ) == 'L' ) { while ( methodDescriptor . charAt ( currentOffset ++ ) != ';' ) { // Skip the argument descriptor content .
} } argumentTypes [ currentArgumentTypeIndex ++ ] = getType ( methodDescriptor , currentArgumentTypeOffset , currentOffset ) ; } return argumentTypes ;
|
public class Config { /** * Returns ` null ` if no allocator has been configured .
* Otherwise returns a ` Reallocator ` , possibly by adapting the configured
* ` Allocator ` if need be .
* If a ` MetricsRecorder ` has been configured , the return ` Reallocator ` will
* automatically record allocation , reallocation and deallocation latencies . */
Reallocator < T > getAdaptedReallocator ( ) { } }
|
if ( allocator == null ) { return null ; } if ( metricsRecorder == null ) { if ( allocator instanceof Reallocator ) { return ( Reallocator < T > ) allocator ; } return new ReallocatingAdaptor < > ( ( Allocator < T > ) allocator ) ; } else { if ( allocator instanceof Reallocator ) { return new TimingReallocatorAdaptor < > ( ( Reallocator < T > ) allocator , metricsRecorder ) ; } return new TimingReallocatingAdaptor < > ( ( Allocator < T > ) allocator , metricsRecorder ) ; }
|
public class TangoGroupAttribute { /** * Write a value on several attributes
* @ param value
* Can be an array
* @ throws DevFailed */
public void write ( final Object value ) throws DevFailed { } }
|
initDeviceAttributes ( ) ; for ( final DeviceAttribute deviceAttribute : deviceAttributes ) { if ( deviceAttribute != null ) { // may be null if read failed and throwExceptions is false
InsertExtractUtils . insert ( deviceAttribute , value ) ; } } group . write ( deviceAttributes ) ;
|
public class KiteConnect { /** * Cancel a mutualfunds sip .
* @ param sipId is the id of mutualfunds sip .
* @ return returns true , if cancel sip is successful else exception is thrown .
* @ throws KiteException is thrown for all Kite trade related errors .
* @ throws IOException is thrown when there is connection related error . */
public boolean cancelMFSIP ( String sipId ) throws KiteException , IOException , JSONException { } }
|
new KiteRequestHandler ( proxy ) . deleteRequest ( routes . get ( "mutualfunds.sip" ) . replace ( ":sip_id" , sipId ) , new HashMap < String , Object > ( ) , apiKey , accessToken ) ; return true ;
|
public class GeneratedDrlConstraintParserTokenManagerBase { /** * Create a TokenRange that spans exactly one token */
private static TokenRange tokenRange ( Token token ) { } }
|
JavaToken javaToken = token . javaToken ; return new TokenRange ( javaToken , javaToken ) ;
|
public class DescribePointBinaryCompare { /** * Specifies the image from which feature descriptions are to be created .
* @ param image Image being examined . */
public void setImage ( T image ) { } }
|
this . image = image ; // precompute offsets for faster computing later on
for ( int i = 0 ; i < definition . samplePoints . length ; i ++ ) { Point2D_I32 a = definition . samplePoints [ i ] ; offsets [ i ] = image . stride * a . y + a . x ; } for ( int i = 0 ; i < definition . compare . length ; i ++ ) { Point2D_I32 p = definition . compare [ i ] ; offsetsA [ i ] = offsets [ p . x ] ; offsetsB [ i ] = offsets [ p . y ] ; }
|
public class ServletUtil { /** * / * getContextAttribute ( HttpServlet . . . ) which implements ServletConfig and causes ambigous calls unless explicitly specified . . . */
public static final < T > T getContextAttribute ( HttpServlet servlet , String name , Class < T > cls , Set < GetOpts > opts , T defaultValue ) { } }
|
return getContextAttribute ( ( ServletConfig ) servlet , name , cls , opts , defaultValue ) ;
|
public class JmsManagedConnectionFactoryImpl { /** * ( non - Javadoc )
* @ see com . ibm . websphere . sib . api . jms . JmsManagedConnectionFactory # getShareDurableSubscriptions ( ) */
@ Override public String getShareDurableSubscriptions ( ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getShareDurableSubscriptions" ) ; String val = jcaConnectionFactory . getShareDurableSubscriptions ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getShareDurableSubscriptions" , val ) ; return val ;
|
public class TagRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TagRequest tagRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( tagRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( tagRequest . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( tagRequest . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class IntLinkedHashMap { /** * Maps the specified key to the specified value .
* @ param key the key .
* @ param value the value .
* @ return the value of any previous mapping with the specified key or { @ code null } if there was no such
* mapping . */
public V put ( final int key , final V value ) { } }
|
int index = ( key & 0x7FFFFFFF ) % elementData . length ; IntLinkedEntry < V > entry = elementData [ index ] ; while ( entry != null && key != entry . key ) { entry = entry . nextInSlot ; } if ( entry == null ) { // Remove eldest entry if instructed , else grow capacity if appropriate
IntLinkedEntry < V > eldest = header . after ; ++ elementCount ; if ( removeEldestEntry ( eldest ) ) { remove ( eldest . key ) ; } else { if ( elementCount > threshold ) { rehash ( ) ; index = ( key & 0x7FFFFFFF ) % elementData . length ; } } entry = createHashedEntry ( key , index ) ; } V result = entry . value ; entry . value = value ; return result ;
|
public class CustomerFeedServiceLocator { /** * For the given interface , get the stub implementation .
* If this service has no port for the given interface ,
* then ServiceException is thrown . */
public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException { } }
|
try { if ( com . google . api . ads . adwords . axis . v201809 . cm . CustomerFeedServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . adwords . axis . v201809 . cm . CustomerFeedServiceSoapBindingStub _stub = new com . google . api . ads . adwords . axis . v201809 . cm . CustomerFeedServiceSoapBindingStub ( new java . net . URL ( CustomerFeedServiceInterfacePort_address ) , this ) ; _stub . setPortName ( getCustomerFeedServiceInterfacePortWSDDServiceName ( ) ) ; return _stub ; } } catch ( java . lang . Throwable t ) { throw new javax . xml . rpc . ServiceException ( t ) ; } throw new javax . xml . rpc . ServiceException ( "There is no stub implementation for the interface: " + ( serviceEndpointInterface == null ? "null" : serviceEndpointInterface . getName ( ) ) ) ;
|
public class ClassInfo { /** * Returns information on the named filed declared by this class , or by its superclasses . See also :
* < ul >
* < li > { @ link # getDeclaredFieldInfo ( String ) }
* < li > { @ link # getFieldInfo ( ) }
* < li > { @ link # getDeclaredFieldInfo ( ) }
* < / ul >
* Requires that { @ link ClassGraph # enableFieldInfo ( ) } be called before scanning , otherwise throws
* { @ link IllegalArgumentException } .
* By default only returns information for public methods , unless { @ link ClassGraph # ignoreFieldVisibility ( ) } was
* called before the scan .
* @ param fieldName
* The field name .
* @ return the { @ link FieldInfo } object for the named field of this class or its superclases , or the empty list
* if no fields were found or visible .
* @ throws IllegalArgumentException
* if { @ link ClassGraph # enableFieldInfo ( ) } was not called prior to initiating the scan . */
public FieldInfo getFieldInfo ( final String fieldName ) { } }
|
if ( ! scanResult . scanSpec . enableFieldInfo ) { throw new IllegalArgumentException ( "Please call ClassGraph#enableFieldInfo() before #scan()" ) ; } // Implement field overriding
for ( final ClassInfo ci : getOverrideOrder ( ) ) { final FieldInfo fi = ci . getDeclaredFieldInfo ( fieldName ) ; if ( fi != null ) { return fi ; } } return null ;
|
public class ConvertKit { /** * byteArr转charArr
* @ param bytes 字节数组
* @ return 字符数组 */
public static char [ ] bytes2Chars ( final byte [ ] bytes ) { } }
|
if ( bytes == null ) return null ; int len = bytes . length ; if ( len <= 0 ) return null ; char [ ] chars = new char [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { chars [ i ] = ( char ) ( bytes [ i ] & 0xff ) ; } return chars ;
|
public class SARLLabelProvider { /** * Replies the image for the given element .
* < p > This function is a Xtext dispatch function for { @ link # imageDescriptor ( Object ) } .
* @ param element the element .
* @ return the image descriptor .
* @ see # imageDescriptor ( Object ) */
protected ImageDescriptor imageDescriptor ( SarlBehavior element ) { } }
|
final JvmDeclaredType jvmElement = this . jvmModelAssociations . getInferredType ( element ) ; return this . images . forBehavior ( element . getVisibility ( ) , this . adornments . get ( jvmElement ) ) ;
|
public class LongValueMin { /** * add a value to the aggregator
* @ param val
* an object whose string representation represents a long value . */
public void addNextValue ( Object val ) { } }
|
long newVal = Long . parseLong ( val . toString ( ) ) ; if ( this . minVal > newVal ) { this . minVal = newVal ; }
|
public class MutableDocument { /** * Set a String value for the given key
* @ param key the key .
* @ param key the String value .
* @ return this MutableDocument instance */
@ NonNull @ Override public MutableDocument setString ( @ NonNull String key , String value ) { } }
|
return setValue ( key , value ) ;
|
public class ManagementStage { /** * Adds the given group vertex to this management stage .
* @ param groupVertex
* the group vertex to be added to this management stage */
void addGroupVertex ( final ManagementGroupVertex groupVertex ) { } }
|
this . groupVertices . add ( groupVertex ) ; this . managementGraph . addGroupVertex ( groupVertex . getID ( ) , groupVertex ) ;
|
public class RoaringBitmap { /** * Efficiently builds a RoaringBitmap from unordered data
* @ param data unsorted data
* @ return a new bitmap */
public static RoaringBitmap bitmapOfUnordered ( final int ... data ) { } }
|
RoaringBitmapWriter < RoaringBitmap > writer = writer ( ) . constantMemory ( ) . doPartialRadixSort ( ) . get ( ) ; writer . addMany ( data ) ; writer . flush ( ) ; return writer . getUnderlying ( ) ;
|
public class TableManipulationConfigurationBuilder { /** * The name of the database column used to store the timestamps */
public S timestampColumnName ( String timestampColumnName ) { } }
|
attributes . attribute ( TIMESTAMP_COLUMN_NAME ) . set ( timestampColumnName ) ; return self ( ) ;
|
public class RPC { /** * On all paths , send an ACKACK back */
static AutoBuffer ackack ( AutoBuffer ab , int tnum ) { } }
|
return ab . clearForWriting ( H2O . ACK_ACK_PRIORITY ) . putTask ( UDP . udp . ackack . ordinal ( ) , tnum ) ;
|
public class CommerceCurrencyLocalServiceUtil { /** * Updates the commerce currency in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners .
* @ param commerceCurrency the commerce currency
* @ return the commerce currency that was updated */
public static com . liferay . commerce . currency . model . CommerceCurrency updateCommerceCurrency ( com . liferay . commerce . currency . model . CommerceCurrency commerceCurrency ) { } }
|
return getService ( ) . updateCommerceCurrency ( commerceCurrency ) ;
|
public class VirtualMachinesInner { /** * The operation to update a virtual machine .
* @ param resourceGroupName The name of the resource group .
* @ param vmName The name of the virtual machine .
* @ param parameters Parameters supplied to the Update Virtual Machine operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable for the request */
public Observable < VirtualMachineInner > updateAsync ( String resourceGroupName , String vmName , VirtualMachineUpdate parameters ) { } }
|
return updateWithServiceResponseAsync ( resourceGroupName , vmName , parameters ) . map ( new Func1 < ServiceResponse < VirtualMachineInner > , VirtualMachineInner > ( ) { @ Override public VirtualMachineInner call ( ServiceResponse < VirtualMachineInner > response ) { return response . body ( ) ; } } ) ;
|
public class ParaClient { /** * Formats a date in a specific format .
* @ param format the date format
* @ param loc the locale instance
* @ return a formatted date */
public String formatDate ( String format , Locale loc ) { } }
|
MultivaluedMap < String , String > params = new MultivaluedHashMap < > ( ) ; params . putSingle ( "format" , format ) ; params . putSingle ( "locale" , loc == null ? null : loc . toString ( ) ) ; return getEntity ( invokeGet ( "utils/formatdate" , params ) , String . class ) ;
|
public class OnChangeEvictingCache { /** * Try to obtain the value that is cached for the given key in the given resource .
* If no value is cached , the provider is used to compute it and store it afterwards .
* @ param resource the resource . If it is < code > null < / code > , the provider will be used to compute the value .
* @ param key the cache key . May not be < code > null < / code > .
* @ param provider the strategy to compute the value if necessary . May not be < code > null < / code > . */
@ Override public < T > T get ( Object key , Resource resource , Provider < T > provider ) { } }
|
if ( resource == null ) { return provider . get ( ) ; } CacheAdapter adapter = getOrCreate ( resource ) ; T element = adapter . < T > internalGet ( key ) ; if ( element == null ) { element = provider . get ( ) ; cacheMiss ( adapter ) ; adapter . set ( key , element ) ; } else { cacheHit ( adapter ) ; } if ( element == CacheAdapter . NULL ) { return null ; } return element ;
|
public class JsonConfig { /** * Resets all values to its default state . */
public void reset ( ) { } }
|
excludes = EMPTY_EXCLUDES ; ignoreDefaultExcludes = false ; ignoreTransientFields = false ; ignorePublicFields = true ; javascriptCompliant = false ; javaIdentifierTransformer = DEFAULT_JAVA_IDENTIFIER_TRANSFORMER ; cycleDetectionStrategy = DEFAULT_CYCLE_DETECTION_STRATEGY ; skipJavaIdentifierTransformationInMapKeys = false ; triggerEvents = false ; handleJettisonEmptyElement = false ; handleJettisonSingleElementArray = false ; arrayMode = MODE_LIST ; rootClass = null ; classMap = null ; keyMap . clear ( ) ; typeMap . clear ( ) ; beanKeyMap . clear ( ) ; beanTypeMap . clear ( ) ; jsonPropertyFilter = null ; javaPropertyFilter = null ; jsonBeanProcessorMatcher = DEFAULT_JSON_BEAN_PROCESSOR_MATCHER ; newBeanInstanceStrategy = DEFAULT_NEW_BEAN_INSTANCE_STRATEGY ; defaultValueProcessorMatcher = DEFAULT_DEFAULT_VALUE_PROCESSOR_MATCHER ; defaultValueMap . clear ( ) ; propertySetStrategy = null /* DEFAULT _ PROPERTY _ SET _ STRATEGY */
; // ignoreJPATransient = false ;
collectionType = DEFAULT_COLLECTION_TYPE ; enclosedType = null ; jsonValueProcessorMatcher = DEFAULT_JSON_VALUE_PROCESSOR_MATCHER ; javaPropertyNameProcessorMap . clear ( ) ; javaPropertyNameProcessorMatcher = DEFAULT_PROPERTY_NAME_PROCESSOR_MATCHER ; jsonPropertyNameProcessorMap . clear ( ) ; jsonPropertyNameProcessorMatcher = DEFAULT_PROPERTY_NAME_PROCESSOR_MATCHER ; beanProcessorMap . clear ( ) ; propertyExclusionClassMatcher = DEFAULT_PROPERTY_EXCLUSION_CLASS_MATCHER ; exclusionMap . clear ( ) ; ignoreFieldAnnotations . clear ( ) ; allowNonStringKeys = false ;
|
public class ElasticsearchClientV6 { /** * Fully removes a type from an index ( removes data )
* @ param index index name
* @ param type type
* @ throws IOException In case of error */
public void deleteByQuery ( String index , String type ) throws IOException { } }
|
logger . debug ( "deleteByQuery [{}]/[{}]" , index , type ) ; String deleteByQuery = "{\n" + " \"query\": {\n" + " \"match_all\": {}\n" + " }\n" + "}" ; Request request = new Request ( "POST" , "/" + index + "/" + type + "/_delete_by_query" ) ; request . setJsonEntity ( deleteByQuery ) ; Response restResponse = client . getLowLevelClient ( ) . performRequest ( request ) ; Map < String , Object > response = asMap ( restResponse ) ; logger . debug ( "reindex response: {}" , response ) ;
|
public class JtsAdapter { /** * < p > Recursively convert a { @ link Geometry } , which may be an instance of { @ link GeometryCollection } with mixed
* element types , into a flat list containing only the following { @ link Geometry } types : < / p >
* < ul >
* < li > { @ link Point } < / li >
* < li > { @ link LineString } < / li >
* < li > { @ link Polygon } < / li >
* < li > { @ link MultiPoint } < / li >
* < li > { @ link MultiLineString } < / li >
* < li > { @ link MultiPolygon } < / li >
* < / ul >
* < p > WARNING : Any other Geometry types that were not mentioned in the list above will be discarded ! < / p >
* < p > Useful for converting a generic geometry into a list of simple MVT - feature - ready geometries . < / p >
* @ param geom geometry to flatten
* @ return list of MVT - feature - ready geometries */
public static List < Geometry > flatFeatureList ( Geometry geom ) { } }
|
final List < Geometry > singleGeoms = new ArrayList < > ( ) ; final Stack < Geometry > geomStack = new Stack < > ( ) ; Geometry nextGeom ; int nextGeomCount ; geomStack . push ( geom ) ; while ( ! geomStack . isEmpty ( ) ) { nextGeom = geomStack . pop ( ) ; if ( nextGeom instanceof Point || nextGeom instanceof MultiPoint || nextGeom instanceof LineString || nextGeom instanceof MultiLineString || nextGeom instanceof Polygon || nextGeom instanceof MultiPolygon ) { singleGeoms . add ( nextGeom ) ; } else if ( nextGeom instanceof GeometryCollection ) { // Push all child geometries
nextGeomCount = nextGeom . getNumGeometries ( ) ; for ( int i = 0 ; i < nextGeomCount ; ++ i ) { geomStack . push ( nextGeom . getGeometryN ( i ) ) ; } } } return singleGeoms ;
|
public class Matchers { /** * Matches the given matchers one by one . Every successful matches updates the internal
* buffer . The consequent
* match operation is performed after the previous match has succeeded .
* @ param matchers the collection of matchers .
* @ return the matcher . */
public static Matcher < MultiResult > sequence ( final Matcher < ? > ... matchers ) { } }
|
checkNotEmpty ( matchers ) ; return new Matcher < MultiResult > ( ) { @ Override public MultiResult matches ( String input , boolean isEof ) { int matchCount = 0 ; Result [ ] results = new Result [ matchers . length ] ; Arrays . fill ( results , failure ( input , false ) ) ; int beginIndex = 0 ; for ( int i = 0 ; i < matchers . length ; i ++ ) { Result result = matchers [ i ] . matches ( input . substring ( beginIndex ) , isEof ) ; if ( result . isSuccessful ( ) ) { beginIndex += result . end ( ) ; results [ i ] = result ; if ( ++ matchCount == matchers . length ) { String group = result . group ( ) ; Result finalResult = new SimpleResult ( true , input , input . substring ( 0 , beginIndex - group . length ( ) ) , group , result . canStopMatching ( ) ) ; return new MultiResultImpl ( finalResult , Arrays . asList ( results ) ) ; } } else { break ; } } final List < Result > resultList = Arrays . asList ( results ) ; boolean canStopMatching = MultiResultImpl . canStopMatching ( resultList ) ; return new MultiResultImpl ( failure ( input , canStopMatching ) , resultList ) ; } @ Override public String toString ( ) { return String . format ( "sequence(%s)" , MultiMatcher . matchersToString ( matchers ) ) ; } } ;
|
public class CmsProjectDriver { /** * Serialize publish list to write it as byte array to the database . < p >
* @ param publishList the publish list
* @ return byte array containing the publish list data
* @ throws IOException if something goes wrong */
protected byte [ ] internalSerializePublishList ( CmsPublishList publishList ) throws IOException { } }
|
// serialize the publish list
ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; ObjectOutputStream oout = new ObjectOutputStream ( bout ) ; oout . writeObject ( publishList ) ; oout . close ( ) ; return bout . toByteArray ( ) ;
|
public class JVMMetrics { /** * Par Eden Space , Par Survivor Space , CMS Old Gen , CMS Perm Gen */
private void updateMemoryPoolMetrics ( ) { } }
|
for ( MemoryPoolMXBean memoryPoolMXBean : memoryPoolMXBeanList ) { String normalizedKeyName = memoryPoolMXBean . getName ( ) . replaceAll ( "[^\\w]" , "-" ) ; MemoryUsage peakUsage = memoryPoolMXBean . getPeakUsage ( ) ; if ( peakUsage != null ) { jvmPeakUsagePerMemoryPool . safeScope ( normalizedKeyName + "-used" ) . setValue ( ByteAmount . fromBytes ( peakUsage . getUsed ( ) ) . asMegabytes ( ) ) ; jvmPeakUsagePerMemoryPool . safeScope ( normalizedKeyName + "-committed" ) . setValue ( ByteAmount . fromBytes ( peakUsage . getCommitted ( ) ) . asMegabytes ( ) ) ; jvmPeakUsagePerMemoryPool . safeScope ( normalizedKeyName + "-max" ) . setValue ( ByteAmount . fromBytes ( peakUsage . getMax ( ) ) . asMegabytes ( ) ) ; } MemoryUsage collectionUsage = memoryPoolMXBean . getCollectionUsage ( ) ; if ( collectionUsage != null ) { jvmCollectionUsagePerMemoryPool . safeScope ( normalizedKeyName + "-used" ) . setValue ( ByteAmount . fromBytes ( collectionUsage . getUsed ( ) ) . asMegabytes ( ) ) ; jvmCollectionUsagePerMemoryPool . safeScope ( normalizedKeyName + "-committed" ) . setValue ( ByteAmount . fromBytes ( collectionUsage . getCommitted ( ) ) . asMegabytes ( ) ) ; jvmCollectionUsagePerMemoryPool . safeScope ( normalizedKeyName + "-max" ) . setValue ( ByteAmount . fromBytes ( collectionUsage . getMax ( ) ) . asMegabytes ( ) ) ; } MemoryUsage estimatedUsage = memoryPoolMXBean . getUsage ( ) ; if ( estimatedUsage != null ) { jvmEstimatedUsagePerMemoryPool . safeScope ( normalizedKeyName + "-used" ) . setValue ( ByteAmount . fromBytes ( estimatedUsage . getUsed ( ) ) . asMegabytes ( ) ) ; jvmEstimatedUsagePerMemoryPool . safeScope ( normalizedKeyName + "-committed" ) . setValue ( ByteAmount . fromBytes ( estimatedUsage . getCommitted ( ) ) . asMegabytes ( ) ) ; jvmEstimatedUsagePerMemoryPool . safeScope ( normalizedKeyName + "-max" ) . setValue ( ByteAmount . fromBytes ( estimatedUsage . getMax ( ) ) . asMegabytes ( ) ) ; } }
|
public class CssTransformer { /** * Set the system property " org . w3c . css . sac . parser " to point to your { @ link Parser } and optionally { @ link # DOCUMENTHANDLERPROPERTY } to
* point to your document handler .
* @ param css
* @ param stylerSetup
* @ param validate when true validate css input ( see { @ link CssDocumentHandler # setMustFindStylersForCssNames ( java . lang . Boolean ) } )
* @ throws ClassNotFoundException
* @ throws IllegalAccessException
* @ throws InstantiationException
* @ throws CSSException
* @ throws IOException */
public static void transform ( InputStream css , OutputStream stylerSetup , boolean validate ) throws ClassNotFoundException , IllegalAccessException , InstantiationException , CSSException , IOException { } }
|
// find and use a SAC parser and document handler
String handler = System . getProperty ( DOCUMENTHANDLERPROPERTY ) ; CssToBaseStylers ctbs = ( CssToBaseStylers ) Class . forName ( ( handler == null ) ? DEFAULTDOCUMENTHANDLER : handler ) . newInstance ( ) ; if ( ctbs instanceof CssDocumentHandler ) { ( ( CssDocumentHandler ) ctbs ) . setMustFindStylersForCssNames ( validate ) ; } Parser cssParser = new ParserFactory ( ) . makeParser ( ) ; cssParser . setDocumentHandler ( ctbs ) ; cssParser . parseStyleSheet ( new InputSource ( new InputStreamReader ( css ) ) ) ; ctbs . printStylers ( stylerSetup ) ;
|
public class Scanner { /** * or else there will be space in the buffer */
private boolean makeSpace ( ) { } }
|
clearCaches ( ) ; int offset = savedScannerPosition == - 1 ? position : savedScannerPosition ; buf . position ( offset ) ; // Gain space by compacting buffer
if ( offset > 0 ) { buf . compact ( ) ; translateSavedIndexes ( offset ) ; position -= offset ; buf . flip ( ) ; return true ; } // Gain space by growing buffer
int newSize = buf . capacity ( ) * 2 ; CharBuffer newBuf = CharBuffer . allocate ( newSize ) ; newBuf . put ( buf ) ; newBuf . flip ( ) ; translateSavedIndexes ( offset ) ; position -= offset ; buf = newBuf ; matcher . reset ( buf ) ; return true ;
|
public class ModificationQueue { /** * Returns a set of all modified keys . < br > < br >
* Useful if different actions should be taken for different keys and we
* don ' t want to iterate over the subsets multiple times .
* If only one key is to be checked { @ link # isPropertyModified } is preferred .
* Note : This method only works for regular properties , not relationship properties ( i . e . owner etc )
* @ return Set with all modified keys */
public Set < PropertyKey > getModifiedProperties ( ) { } }
|
HashSet < PropertyKey > modifiedKeys = new HashSet < > ( ) ; for ( GraphObjectModificationState state : getSortedModifications ( ) ) { for ( PropertyKey key : state . getModifiedProperties ( ) . keySet ( ) ) { if ( ! modifiedKeys . contains ( key ) ) { modifiedKeys . add ( key ) ; } } } return modifiedKeys ;
|
public class EsClient { /** * Deletes all documents .
* @ param name index name
* @ param type index type .
* @ throws IOException */
public void deleteAll ( String name , String type ) throws IOException { } }
|
CloseableHttpClient client = HttpClients . createDefault ( ) ; HttpPost method = new HttpPost ( String . format ( "http://%s:%d/%s/%s" , host , port , name , type ) ) ; try { EsRequest query = new EsRequest ( ) ; query . put ( "query" , new MatchAllQuery ( ) . build ( ) ) ; StringEntity requestEntity = new StringEntity ( query . toString ( ) , ContentType . APPLICATION_JSON ) ; method . setEntity ( requestEntity ) ; method . setHeader ( " X-HTTP-Method-Override" , "DELETE" ) ; CloseableHttpResponse resp = client . execute ( method ) ; int status = resp . getStatusLine ( ) . getStatusCode ( ) ; if ( status != HttpStatus . SC_OK ) { throw new IOException ( resp . getStatusLine ( ) . getReasonPhrase ( ) ) ; } } finally { method . releaseConnection ( ) ; }
|
public class JsonUtf8Writer { /** * Flushes and closes this writer and the underlying { @ link Sink } .
* @ throws IOException if the JSON document is incomplete . */
@ Override public void close ( ) throws IOException { } }
|
sink . close ( ) ; int size = stackSize ; if ( size > 1 || ( size == 1 && scopes [ size - 1 ] != NONEMPTY_DOCUMENT ) ) { throw new IOException ( "Incomplete document" ) ; } stackSize = 0 ;
|
public class CreateSnapshotScheduleResult { /** * A list of clusters associated with the schedule . A maximum of 100 clusters is returned .
* @ param associatedClusters
* A list of clusters associated with the schedule . A maximum of 100 clusters is returned . */
public void setAssociatedClusters ( java . util . Collection < ClusterAssociatedToSchedule > associatedClusters ) { } }
|
if ( associatedClusters == null ) { this . associatedClusters = null ; return ; } this . associatedClusters = new com . amazonaws . internal . SdkInternalList < ClusterAssociatedToSchedule > ( associatedClusters ) ;
|
public class JToggle { /** * This method should be called by your < code > Activity < / code > ' s
* { @ link Activity # onOptionsItemSelected ( android . view . MenuItem ) onOptionsItemSelected } method .
* If it returns true , your < code > onOptionsItemSelected < / code > method should return true and
* skip further processing .
* @ param item the MenuItem instance representing the selected menu item
* @ return true if the event was handled and further processing should not occur */
public boolean onOptionsItemSelected ( MenuItem item ) { } }
|
if ( item != null && item . getItemId ( ) == android . R . id . home && mDrawerIndicatorEnabled ) { toggle ( ) ; return true ; } return false ;
|
public class RestClient { /** * Gets a single asset
* @ param assetId
* The ID of the asset to obtain
* @ return The Asset
* @ throws IOException
* @ throws RequestFailureException */
@ Override public Asset getAsset ( final String assetId ) throws IOException , BadVersionException , RequestFailureException { } }
|
HttpURLConnection connection = createHttpURLConnectionToMassive ( "/assets/" + assetId ) ; connection . setRequestMethod ( "GET" ) ; testResponseCode ( connection ) ; return JSONAssetConverter . readValue ( connection . getInputStream ( ) ) ;
|
public class Binder { /** * Append to the argument list the given argument values with the specified types .
* @ param types the actual types to use , rather than getClass
* @ param values the value ( s ) to append
* @ return a new Binder */
public Binder append ( Class < ? > [ ] types , Object ... values ) { } }
|
return new Binder ( this , new Insert ( type ( ) . parameterCount ( ) , types , values ) ) ;
|
public class PojoDescriptorBuilderGenerator { /** * Generates the method { @ link AbstractPojoDescriptorBuilderLimited # createDescriptor ( Class ) } .
* @ param sourceWriter is the { @ link SourceWriter } where to { @ link SourceWriter # print ( String ) write } the source code
* to .
* @ param logger is the { @ link TreeLogger } .
* @ param simpleName is the { @ link Class # getSimpleName ( ) simple name } of the { @ link Class } to generate .
* @ param inputType is the { @ link JClassType } reflecting the input - type that triggered the generation via
* { @ link GWT # create ( Class ) } .
* @ param context is the { @ link GeneratorContext } . */
private void generateMethodCreateDescriptor ( SourceWriter sourceWriter , TreeLogger logger , String simpleName , JClassType inputType , GeneratorContext context ) { } }
|
sourceWriter . print ( "public <POJO> " ) ; sourceWriter . print ( AbstractPojoDescriptorImpl . class . getSimpleName ( ) ) ; sourceWriter . println ( "<POJO> createDescriptor(Class<POJO> pojoType) {" ) ; sourceWriter . indent ( ) ; PojoDescriptorGeneratorConfiguration configuration = getConfiguration ( ) ; TypeOracle typeOracle = context . getTypeOracle ( ) ; int typeCount = 0 ; JClassType [ ] types = typeOracle . getTypes ( ) ; for ( JClassType type : types ) { if ( configuration . isPojoTypeSupported ( type , typeOracle ) ) { typeCount ++ ; sourceWriter . print ( "if (pojoType == " ) ; sourceWriter . print ( type . getQualifiedSourceName ( ) ) ; sourceWriter . println ( ".class) {" ) ; sourceWriter . indent ( ) ; sourceWriter . print ( "return GWT.create(" ) ; sourceWriter . print ( type . getQualifiedSourceName ( ) ) ; sourceWriter . println ( ".class);" ) ; sourceWriter . outdent ( ) ; sourceWriter . print ( "} else " ) ; } } if ( typeCount > 0 ) { sourceWriter . println ( "{" ) ; sourceWriter . indent ( ) ; if ( typeCount <= 3 ) { logger . log ( Type . WARN , "Found only " + typeCount + " supported type(s)" ) ; } else { logger . log ( Type . INFO , "Found " + typeCount + " supported types." ) ; } } else { logger . log ( Type . ERROR , "No type found for criteria: " + configuration . getPojoTypeDescription ( ) ) ; } sourceWriter . println ( "return super.createDescriptor(pojoType);" ) ; if ( typeCount > 0 ) { sourceWriter . outdent ( ) ; sourceWriter . println ( "}" ) ; } generateSourceCloseBlock ( sourceWriter ) ;
|
public class SpringUtil { /** * Takes the given beanClass ( which is probably an interface ) and requests
* that Spring instantiate a bean for that class . The underlying mechanism is
* specific to us , in that we expect the beanClass to have a static String
* ' BEAN _ NAME ' , which we will then pass to Spring to get our bean .
* Ideally , you should RARELY need this method , as you ' d have all your needed
* beans injected into your class automatically by Spring . If you choose to
* use this method , please check with Jason to make sure there isn ' t a better
* way !
* @ throws org . springframework . beans . BeansException If there is a problem loading the bean or it does not have a
* ' BEAN _ NAME ' property */
public < T > T getBean ( final Class < T > beanClass ) { } }
|
if ( beanFactory == null ) throw new BeanCreationException ( "SpringUtil.getBean(...) called on a non-managed SpringUtil instance." ) ; // Figure out what ' s stored in ' BEAN _ NAME '
try { return beanFactory . getBean ( readBeanName ( beanClass ) , beanClass ) ; } catch ( final Exception ex ) { // Couldn ' t load by BEAN _ NAME , inaccessible . Let ' s load by class .
return beanFactory . getBean ( beanClass ) ; }
|
public class AmazonChimeClient { /** * Disassociates the specified phone number from the specified Amazon Chime Voice Connector .
* @ param disassociatePhoneNumbersFromVoiceConnectorRequest
* @ return Result of the DisassociatePhoneNumbersFromVoiceConnector operation returned by the service .
* @ throws UnauthorizedClientException
* The client is not currently authorized to make the request .
* @ throws NotFoundException
* One or more of the resources in the request does not exist in the system .
* @ throws ForbiddenException
* The client is permanently forbidden from making the request . For example , when a user tries to create an
* account from an unsupported region .
* @ throws BadRequestException
* The input parameters don ' t match the service ' s restrictions .
* @ throws ThrottledClientException
* The client exceeded its request rate limit .
* @ throws ServiceUnavailableException
* The service is currently unavailable .
* @ throws ServiceFailureException
* The service encountered an unexpected error .
* @ sample AmazonChime . DisassociatePhoneNumbersFromVoiceConnector
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / chime - 2018-05-01 / DisassociatePhoneNumbersFromVoiceConnector "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DisassociatePhoneNumbersFromVoiceConnectorResult disassociatePhoneNumbersFromVoiceConnector ( DisassociatePhoneNumbersFromVoiceConnectorRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDisassociatePhoneNumbersFromVoiceConnector ( request ) ;
|
public class HTODDynacache { /** * containsKey ( )
* Check whether the cache id exists in the disk or not . */
public boolean containsKey ( Object id ) { } }
|
final String methodName = "containsKey()" ; boolean found = false ; if ( ! this . invalidationBuffer . contains ( id ) ) { try { rwLock . readLock ( ) . lock ( ) ; found = object_cache . containsKey ( id ) ; } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.HTODDynacache.containsKey" , "1877" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName , "cacheName=" + this . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t ) ) ; } finally { rwLock . readLock ( ) . unlock ( ) ; } } return found ;
|
public class CmsDomUtil { /** * Returns the given element or it ' s closest ancestor with the given tag name . < p >
* Returns < code > null < / code > if no appropriate element was found . < p >
* @ param element the element
* @ param tag the tag name
* @ return the matching element */
public static Element getAncestor ( Element element , Tag tag ) { } }
|
if ( ( element == null ) || ( tag == null ) ) { return null ; } if ( element . getTagName ( ) . equalsIgnoreCase ( tag . name ( ) ) ) { return element ; } if ( element . getTagName ( ) . equalsIgnoreCase ( Tag . body . name ( ) ) ) { return null ; } return getAncestor ( element . getParentElement ( ) , tag ) ;
|
public class CmsSubscriptionManager { /** * Returns the date when the resource was last visited by the user . < p >
* @ param cms the current users context
* @ param user the user to check the date
* @ param resource the resource to check the date
* @ return the date when the resource was last visited by the user
* @ throws CmsException if something goes wrong */
public long getDateLastVisitedBy ( CmsObject cms , CmsUser user , CmsResource resource ) throws CmsException { } }
|
return m_securityManager . getDateLastVisitedBy ( cms . getRequestContext ( ) , getPoolName ( ) , user , resource ) ;
|
public class Sheet { /** * Appends an update event */
public void appendUpdateEvent ( final Object rowKey , final int colIndex , final Object rowData , final Object oldValue , final Object newValue ) { } }
|
updates . add ( new SheetUpdate ( rowKey , colIndex , rowData , oldValue , newValue ) ) ;
|
public class NumberedPaging { /** * Returns the number of the last page , if the total number of items is known .
* @ param total total number of items
* @ param pageSize the current page size
* @ return page number of the last page */
private int calcLastPage ( int total , int pageSize ) { } }
|
if ( total == 0 ) { return firstPage ; } else { final int zeroBasedPageNo = total % pageSize > 0 ? total / pageSize : total / pageSize - 1 ; return firstPage + zeroBasedPageNo ; }
|
public class UrlChain { /** * Set up parameters on GET as URL chain .
* @ param paramsOnGet The varying array of parameters on GET . ( NotNull )
* @ return The created instance of URL chain . ( NotNull ) */
public UrlChain params ( Object ... paramsOnGet ) { } }
|
final String argTitle = "paramsOnGet" ; assertArgumentNotNull ( argTitle , paramsOnGet ) ; checkWrongUrlChainUse ( argTitle , paramsOnGet ) ; this . paramsOnGet = paramsOnGet ; return this ;
|
public class DefaultFactoryCollector { /** * Filter a map containing pairs of interface / implementation in order to get only producible
* classes .
* @ param bindings map of interface / implementation
* @ return producible pairs */
private Multimap < Type , Class < ? > > filterProducibleClasses ( Map < Key < ? > , Class < ? > > bindings ) { } }
|
Multimap < Type , Class < ? > > defaultFactoryToBind = ArrayListMultimap . create ( ) ; bindings . entrySet ( ) . stream ( ) . filter ( entry -> isCandidate ( entry . getKey ( ) . getTypeLiteral ( ) . getType ( ) ) ) . forEach ( entry -> defaultFactoryToBind . put ( entry . getKey ( ) . getTypeLiteral ( ) . getType ( ) , entry . getValue ( ) ) ) ; return defaultFactoryToBind ;
|
public class AbstractConnection { /** * Triggered when a JMSException is internally catched */
public final void exceptionOccured ( JMSException exception ) { } }
|
try { synchronized ( exceptionListenerLock ) { if ( exceptionListener != null ) exceptionListener . onException ( exception ) ; } } catch ( Exception e ) { log . error ( "Exception listener failed" , e ) ; }
|
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EEnum getIfcStairFlightTypeEnum ( ) { } }
|
if ( ifcStairFlightTypeEnumEEnum == null ) { ifcStairFlightTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1070 ) ; } return ifcStairFlightTypeEnumEEnum ;
|
public class PathWrapper { /** * Creates a unique temporary file as a child of this directory .
* @ param prefix filename prefix
* @ param suffix filename suffix , defaults to . tmp
* @ return Path to the new file . */
public PathImpl createTempFile ( String prefix , String suffix ) throws IOException { } }
|
return getWrappedPath ( ) . createTempFile ( prefix , suffix ) ;
|
public class ActionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } }
|
switch ( featureID ) { case XtextPackage . ACTION__TYPE : return basicSetType ( null , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ;
|
public class NodesXMLParser { /** * Parse the project . xml formatted file and fill in the nodes found */
public void parse ( ) throws NodeFileParserException { } }
|
final ResourceXMLParser resourceXMLParser ; if ( null != file ) { resourceXMLParser = new ResourceXMLParser ( file ) ; } else { resourceXMLParser = new ResourceXMLParser ( input ) ; } // parse both node and settings
resourceXMLParser . setReceiver ( this ) ; // long start = System . currentTimeMillis ( ) ;
try { resourceXMLParser . parse ( ) ; } catch ( ResourceXMLParserException e ) { throw new NodeFileParserException ( e ) ; } catch ( IOException e ) { throw new NodeFileParserException ( e ) ; } // System . err . println ( " parse : " + ( System . currentTimeMillis ( ) - start ) ) ;
|
public class BeanBoxUtils { /** * give a class or Field or Method , return annotations */
private static Annotation [ ] getAnnotations ( Object targetClass ) { } }
|
if ( targetClass instanceof Field ) return ( ( Field ) targetClass ) . getAnnotations ( ) ; else if ( targetClass instanceof Method ) return ( ( Method ) targetClass ) . getAnnotations ( ) ; else if ( targetClass instanceof Constructor ) return ( ( Constructor < ? > ) targetClass ) . getAnnotations ( ) ; else if ( targetClass instanceof Class ) return ( ( Class < ? > ) targetClass ) . getAnnotations ( ) ; else return BeanBoxException . throwEX ( "targetClass should be Field, Method, Constructor or Class" ) ;
|
public class CodeAttribute { /** * Returns the exceptions . */
public void setAttributes ( ArrayList < Attribute > attributes ) { } }
|
if ( _attributes != attributes ) { _attributes . clear ( ) ; _attributes . addAll ( attributes ) ; }
|
public class CompactDecimalDataCache { /** * Calculate a divisor based on the magnitude and number of zeros in the
* template string .
* @ param power10
* @ param numZeros
* @ return */
private static long calculateDivisor ( long power10 , int numZeros ) { } }
|
// We craft our divisor such that when we divide by it , we get a
// number with the same number of digits as zeros found in the
// plural variant templates . If our magnitude is 10000 and we have
// two 0 ' s in our plural variants , then we want a divisor of 1000.
// Note that if we have 43560 which is of same magnitude as 10000.
// When we divide by 1000 we a quotient which rounds to 44 ( 2 digits )
long divisor = power10 ; for ( int i = 1 ; i < numZeros ; i ++ ) { divisor /= 10 ; } return divisor ;
|
public class DefaultGroovyMethods { /** * Sorts the given iterator items into a sorted iterator using the comparator . The
* original iterator will become exhausted of elements after completing this method call .
* A new iterator is produced that traverses the items in sorted order .
* @ param self the Iterator to be sorted
* @ param comparator a Comparator used for comparing items
* @ return the sorted items as an Iterator
* @ since 1.5.5 */
public static < T > Iterator < T > sort ( Iterator < T > self , Comparator < ? super T > comparator ) { } }
|
return sort ( ( Iterable < T > ) toList ( self ) , true , comparator ) . listIterator ( ) ;
|
public class ArtifactoryCollectorTask { /** * Add any new { @ link BinaryArtifact } s
* @ param enabledRepos list of enabled { @ link ArtifactoryRepo } s */
private void addNewArtifacts ( List < ArtifactoryRepo > enabledRepos ) { } }
|
long start = System . currentTimeMillis ( ) ; int count = 0 ; for ( ArtifactoryRepo repo : enabledRepos ) { for ( BinaryArtifact artifact : nullSafe ( artifactoryClient . getArtifacts ( repo . getInstanceUrl ( ) , repo . getRepoName ( ) , repo . getLastUpdated ( ) ) ) ) { if ( artifact != null && isNewArtifact ( repo , artifact ) ) { artifact . setCollectorItemId ( repo . getId ( ) ) ; binaryArtifactRepository . save ( artifact ) ; count ++ ; } } } // Iterate through list of repos and update the lastUpdated timestamp
for ( ArtifactoryRepo repo : enabledRepos ) { repo . setLastUpdated ( start ) ; } // We set the last update time so need to save it
artifactoryRepoRepository . save ( enabledRepos ) ; log ( "New artifacts" , start , count ) ;
|
public class PairCounting { /** * Computes the pair - counting Fowlkes - mallows ( flat only , non - hierarchical ! )
* E . B . Fowlkes , C . L . Mallows < br >
* A method for comparing two hierarchical clusterings < br >
* In : Journal of the American Statistical Association , Vol . 78 Issue 383
* @ return pair - counting Fowlkes - mallows */
@ Reference ( authors = "E. B. Fowlkes, C. L. Mallows" , title = "A method for comparing two hierarchical clusterings" , booktitle = "Journal of the American Statistical Association, Vol. 78 Issue 383" , url = "https://doi.org/10.2307/2288117" , bibkey = "doi:10.2307/2288117" ) public double fowlkesMallows ( ) { } }
|
return FastMath . sqrt ( precision ( ) * recall ( ) ) ;
|
public class InternalSimpleAntlrLexer { /** * $ ANTLR start " T _ _ 28" */
public final void mT__28 ( ) throws RecognitionException { } }
|
try { int _type = T__28 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalSimpleAntlr . g : 26:7 : ( ' ~ ' )
// InternalSimpleAntlr . g : 26:9 : ' ~ '
{ match ( '~' ) ; } state . type = _type ; state . channel = _channel ; } finally { }
|
public class FilterTransactions { /** * Gets map of fields and values .
* @ return Collection of field name - field value pairs . */
@ Override public Map < String , String > getValues ( ) { } }
|
HashMap < String , String > result = new HashMap < > ( ) ; if ( status != null && status != TransactionStatus . NotSpecified ) result . put ( "Status" , status . toString ( ) ) ; if ( type != null && type != TransactionType . NotSpecified ) result . put ( "Type" , type . toString ( ) ) ; if ( nature != null && nature != TransactionNature . NotSpecified ) result . put ( "Nature" , nature . toString ( ) ) ; if ( beforeDate != null ) result . put ( "BeforeDate" , Long . toString ( beforeDate ) ) ; if ( afterDate != null ) result . put ( "AfterDate" , Long . toString ( afterDate ) ) ; return result ;
|
public class CalendarApi { /** * Get attendees Get all invited attendees for a given event - - - This route
* is cached for up to 600 seconds SSO Scope :
* esi - calendar . read _ calendar _ events . v1
* @ param characterId
* An EVE character ID ( required )
* @ param eventId
* The id of the event requested ( required )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param ifNoneMatch
* ETag from a previous request . A 304 will be returned if this
* matches the current ETag ( optional )
* @ param token
* Access token to use if unable to set a header ( optional )
* @ return ApiResponse & lt ; List & lt ; CharacterCalendarAttendeesResponse & gt ; & gt ;
* @ throws ApiException
* If fail to call the API , e . g . server error or cannot
* deserialize the response body */
public ApiResponse < List < CharacterCalendarAttendeesResponse > > getCharactersCharacterIdCalendarEventIdAttendeesWithHttpInfo ( Integer characterId , Integer eventId , String datasource , String ifNoneMatch , String token ) throws ApiException { } }
|
com . squareup . okhttp . Call call = getCharactersCharacterIdCalendarEventIdAttendeesValidateBeforeCall ( characterId , eventId , datasource , ifNoneMatch , token , null ) ; Type localVarReturnType = new TypeToken < List < CharacterCalendarAttendeesResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
|
public class FnNumber { /** * Determines whether the target object is null or not .
* @ return false if the target object is null , true if not . */
public static final Function < Number , Boolean > isNotNull ( ) { } }
|
return ( Function < Number , Boolean > ) ( ( Function ) FnObject . isNotNull ( ) ) ;
|
public class KXmlParser { /** * Reads a quoted string , performing no entity escaping of the contents . */
private String readQuotedId ( boolean returnText ) throws IOException , XmlPullParserException { } }
|
int quote = peekCharacter ( ) ; char [ ] delimiter ; if ( quote == '"' ) { delimiter = DOUBLE_QUOTE ; } else if ( quote == '\'' ) { delimiter = SINGLE_QUOTE ; } else { throw new XmlPullParserException ( "Expected a quoted string" , this , null ) ; } position ++ ; return readUntil ( delimiter , returnText ) ;
|
public class EvolutionMonitor { /** * Helper method for showing the evolution monitor in a frame or dialog .
* @ param newWindow The frame or dialog used to show the evolution monitor . */
private void showWindow ( Window newWindow ) { } }
|
if ( window != null ) { window . remove ( getGUIComponent ( ) ) ; window . setVisible ( false ) ; window . dispose ( ) ; window = null ; } newWindow . add ( getGUIComponent ( ) , BorderLayout . CENTER ) ; newWindow . pack ( ) ; newWindow . setVisible ( true ) ; this . window = newWindow ;
|
public class ServerMessageBlock { /** * { @ inheritDoc }
* @ see jcifs . internal . RequestWithPath # setResolveInDfs ( boolean ) */
@ Override public void setResolveInDfs ( boolean resolve ) { } }
|
if ( resolve ) { addFlags2 ( SmbConstants . FLAGS2_RESOLVE_PATHS_IN_DFS ) ; } else { remFlags2 ( SmbConstants . FLAGS2_RESOLVE_PATHS_IN_DFS ) ; }
|
public class TSProcessor { /** * Extract subseries out of series .
* @ param series The series array .
* @ param start the fragment start .
* @ param end the fragment end .
* @ return The subseries .
* @ throws IndexOutOfBoundsException If error occurs . */
public double [ ] subseriesByCopy ( double [ ] series , int start , int end ) throws IndexOutOfBoundsException { } }
|
if ( ( start > end ) || ( start < 0 ) || ( end > series . length ) ) { throw new IndexOutOfBoundsException ( "Unable to extract subseries, series length: " + series . length + ", start: " + start + ", end: " + String . valueOf ( end - start ) ) ; } return Arrays . copyOfRange ( series , start , end ) ;
|
public class Utils { /** * Convert a number ( base10 ) to base62 encoded string
* @ param number the number to convert
* @ return the base 62 encoded string */
public static String encode ( long number ) { } }
|
char [ ] output = new char [ 32 ] ; int p = 31 ; long n = number ; while ( n > 61 ) { output [ p -- ] = encodingChars [ ( int ) ( n % 62L ) ] ; n = n / 62 ; } output [ p ] = encodingChars [ ( int ) ( n % 62L ) ] ; return new String ( output , p , 32 - p ) ;
|
public class SpectralClustering { /** * Returns a scaled { @ link Matrix } , where each row is the unit
* magnitude version of the corresponding row vector in { @ link matrix } .
* This is required so that dot product computations over a large number of
* data points can be distributed , wherease the cosine similarity cannot be . */
private Matrix scaleMatrix ( Matrix matrix ) { } }
|
// Scale every data point such that it has a dot product of 1 with
// itself . This will make further calculations easier since the dot
// product distrubutes when the cosine similarity does not .
if ( matrix instanceof SparseMatrix ) { List < SparseDoubleVector > scaledVectors = new ArrayList < SparseDoubleVector > ( matrix . rows ( ) ) ; SparseMatrix sm = ( SparseMatrix ) matrix ; for ( int r = 0 ; r < matrix . rows ( ) ; ++ r ) { SparseDoubleVector v = sm . getRowVector ( r ) ; scaledVectors . add ( new ScaledSparseDoubleVector ( v , 1 / v . magnitude ( ) ) ) ; } return Matrices . asSparseMatrix ( scaledVectors ) ; } else { List < DoubleVector > scaledVectors = new ArrayList < DoubleVector > ( matrix . rows ( ) ) ; for ( int r = 0 ; r < matrix . rows ( ) ; ++ r ) { DoubleVector v = matrix . getRowVector ( r ) ; scaledVectors . add ( new ScaledDoubleVector ( v , 1 / v . magnitude ( ) ) ) ; } return Matrices . asMatrix ( scaledVectors ) ; }
|
public class RnnLossLayer { /** * Compute the score for each example individually , after labels and input have been set .
* @ param fullNetRegTerm Regularization score term for the entire network ( or , 0.0 to not include regularization )
* @ return A column INDArray of shape [ numExamples , 1 ] , where entry i is the score of the ith example */
@ Override public INDArray computeScoreForExamples ( double fullNetRegTerm , LayerWorkspaceMgr workspaceMgr ) { } }
|
// For RNN : need to sum up the score over each time step before returning .
if ( input == null || labels == null ) throw new IllegalStateException ( "Cannot calculate score without input and labels " + layerId ( ) ) ; INDArray input2d = TimeSeriesUtils . reshape3dTo2d ( input , workspaceMgr , ArrayType . FF_WORKING_MEM ) ; INDArray labels2d = TimeSeriesUtils . reshape3dTo2d ( labels , workspaceMgr , ArrayType . FF_WORKING_MEM ) ; INDArray maskReshaped ; if ( this . maskArray != null ) { if ( this . maskArray . rank ( ) == 3 ) { maskReshaped = TimeSeriesUtils . reshapePerOutputTimeSeriesMaskTo2d ( this . maskArray , workspaceMgr , ArrayType . FF_WORKING_MEM ) ; } else { maskReshaped = TimeSeriesUtils . reshapeTimeSeriesMaskToVector ( this . maskArray , workspaceMgr , ArrayType . FF_WORKING_MEM ) ; } } else { maskReshaped = null ; } ILossFunction lossFunction = layerConf ( ) . getLossFn ( ) ; INDArray scoreArray = lossFunction . computeScoreArray ( labels2d , input2d , layerConf ( ) . getActivationFn ( ) , maskReshaped ) ; // scoreArray : shape [ minibatch * timeSeriesLength , 1]
// Reshape it to [ minibatch , timeSeriesLength ] then sum over time step
// FIXME : int cast
INDArray scoreArrayTs = TimeSeriesUtils . reshapeVectorToTimeSeriesMask ( scoreArray , ( int ) input . size ( 0 ) ) ; INDArray summedScores = scoreArrayTs . sum ( 1 ) ; if ( fullNetRegTerm != 0.0 ) { summedScores . addi ( fullNetRegTerm ) ; } return summedScores ;
|
public class Rename { /** * create a properly initialized Periodic instance by setting all the required @ Context attributes */
private Periodic newPeriodic ( ) { } }
|
Periodic periodic = new Periodic ( ) ; periodic . db = this . db ; periodic . log = this . log ; periodic . terminationGuard = this . terminationGuard ; return periodic ;
|
public class IoUtils { /** * Checks whether { @ code path } can be opened read - only . Similar to File . exists , but doesn ' t
* require read permission on the parent , so it ' ll work in more cases , and allow you to
* remove read permission from more directories . */
public static boolean canOpenReadOnly ( String path ) { } }
|
try { // Use open ( 2 ) rather than stat ( 2 ) so we require fewer permissions . http : / / b / 6485312.
FileDescriptor fd = Libcore . os . open ( path , O_RDONLY , 0 ) ; Libcore . os . close ( fd ) ; return true ; } catch ( ErrnoException errnoException ) { return false ; }
|
public class BasicCredentials { /** * Create a value suitable as the value of { @ code Authorization } header .
* @ return
* { @ code Authorization } header value for Basic authentication . */
public String format ( ) { } }
|
if ( mFormatted != null ) { return mFormatted ; } // userid : password
String credentials = String . format ( "%s:%s" , mUserId == null ? "" : mUserId , mPassword == null ? "" : mPassword ) ; // Convert the credentials into a byte array .
byte [ ] credentialsBytes = getBytes ( credentials ) ; // Encode the byte array by Base64.
String encoded = Base64 . encodeBase64String ( credentialsBytes ) ; // Build the value of Authorization header .
mFormatted = "Basic " + encoded ; return mFormatted ;
|
public class AbstractManager { protected String getMandatoryPropertyValue ( String propertyName , String description ) throws ServiceConfigurationError { } }
|
return getMandatoryPropertyValue ( getClass ( ) , propertyName , description ) ;
|
public class WebScopeManager { /** * Get the session scope from the current request scope .
* @ param bCreateIfNotExisting
* if < code > true < / code > a new session scope ( and a new HTTP session if
* required ) is created if none is existing so far .
* @ param bItsOkayToCreateANewSession
* if < code > true < / code > no warning is emitted , if a new session scope
* must be created . This is e . g . used when renewing a session .
* @ return < code > null < / code > if no session scope is present , and none should
* be created . */
@ Nullable @ DevelopersNote ( "This is only for project-internal use!" ) public static ISessionWebScope internalGetSessionScope ( final boolean bCreateIfNotExisting , final boolean bItsOkayToCreateANewSession ) { } }
|
// Try to to resolve the current request scope
final IRequestWebScope aRequestScope = getRequestScopeOrNull ( ) ; return internalGetSessionScope ( aRequestScope , bCreateIfNotExisting , bItsOkayToCreateANewSession ) ;
|
public class CmsMessageBundleEditor { /** * Creates the save and exit button UI Component .
* @ return the save and exit button . */
@ SuppressWarnings ( "serial" ) private Button createSaveExitButton ( ) { } }
|
Button saveExitBtn = CmsToolBar . createButton ( FontOpenCms . SAVE_EXIT , m_messages . key ( Messages . GUI_BUTTON_SAVE_AND_EXIT_0 ) ) ; saveExitBtn . addClickListener ( new ClickListener ( ) { public void buttonClick ( ClickEvent event ) { saveAction ( ) ; closeAction ( ) ; } } ) ; saveExitBtn . setEnabled ( false ) ; return saveExitBtn ;
|
public class AppsImpl { /** * Imports an application to LUIS , the application ' s structure should be included in in the request body .
* @ param luisApp A LUIS application structure .
* @ param importMethodOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the UUID object */
public Observable < ServiceResponse < UUID > > importMethodWithServiceResponseAsync ( LuisApp luisApp , ImportMethodAppsOptionalParameter importMethodOptionalParameter ) { } }
|
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( luisApp == null ) { throw new IllegalArgumentException ( "Parameter luisApp is required and cannot be null." ) ; } Validator . validate ( luisApp ) ; final String appName = importMethodOptionalParameter != null ? importMethodOptionalParameter . appName ( ) : null ; return importMethodWithServiceResponseAsync ( luisApp , appName ) ;
|
public class TypeHandlerUtils { /** * Transfers data from InputStream into sql . Clob
* Using default locale . If different locale is required see
* { @ link # convertClob ( java . sql . Connection , String ) }
* @ param conn connection for which sql . Clob object would be created
* @ param input InputStream
* @ return sql . Clob from InputStream
* @ throws SQLException */
public static Object convertClob ( Connection conn , InputStream input ) throws SQLException { } }
|
return convertClob ( conn , toByteArray ( input ) ) ;
|
public class MockitoAnnotations { /** * Initializes objects annotated with Mockito annotations for given testClass :
* & # 064 ; { @ link org . mockito . Mock } , & # 064 ; { @ link Spy } , & # 064 ; { @ link Captor } , & # 064 ; { @ link InjectMocks }
* See examples in javadoc for { @ link MockitoAnnotations } class . */
public static void initMocks ( Object testClass ) { } }
|
if ( testClass == null ) { throw new MockitoException ( "testClass cannot be null. For info how to use @Mock annotations see examples in javadoc for MockitoAnnotations class" ) ; } AnnotationEngine annotationEngine = new GlobalConfiguration ( ) . tryGetPluginAnnotationEngine ( ) ; annotationEngine . process ( testClass . getClass ( ) , testClass ) ;
|
public class KmeansState { /** * { @ inheritDoc } */
@ Override protected KmeansDataSet mergeState ( KmeansDataSet baseDataModel , KmeansDataSet targetDataModel , Map < String , Object > mergeConfig ) { } }
|
KmeansDataSet mergedDataModel = KmeansCalculator . mergeKmeans ( baseDataModel , targetDataModel ) ; return mergedDataModel ;
|
public class ApiOvhVrack { /** * Get this object properties
* REST : GET / vrack / { serviceName } / dedicatedCloud / { dedicatedCloud }
* @ param serviceName [ required ] The internal name of your vrack
* @ param dedicatedCloud [ required ] your dedicated cloud service */
public OvhDedicatedCloud serviceName_dedicatedCloud_dedicatedCloud_GET ( String serviceName , String dedicatedCloud ) throws IOException { } }
|
String qPath = "/vrack/{serviceName}/dedicatedCloud/{dedicatedCloud}" ; StringBuilder sb = path ( qPath , serviceName , dedicatedCloud ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhDedicatedCloud . class ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.