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 g...
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 +...
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 ...
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 ...
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 ...
Graphic graphic = null ; PolygonSymbolizerWrapper polygonSymbolizerWrapper = adapt ( PolygonSymbolizerWrapper . class ) ; if ( polygonSymbolizerWrapper != null ) { graphic = polygonSymbolizerWrapper . getFillGraphicFill ( ) ; if ( graphic == null ) { graphic = sf . createDefaultGraphic ( ) ; } polygonSymbolizerWrapper ...
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 ...
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 . customStrateg...
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 +...
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 . encode...
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 * Ac...
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...
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 ...
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 serv...
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 real...
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...
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 ty...
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 ...
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 ...
// 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 ( method...
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 , realloc...
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 <...
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 connec...
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...
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 , "getShare...
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 (...
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 = head...
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 . c...
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 {...
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 ) { ret...
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 im...
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 ...
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 IllegalArgumentExcep...
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 comput...
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 == ...
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 = ...
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 = cl...
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 > { @ lin...
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 MultiPoi...
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 ...
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 < m...
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 ( CmsPublis...
// 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" ) . ...
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 { ...
// 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 ) { ( ( CssDocumentHan...
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 i...
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 :...
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...
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 . Co...
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 f...
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 { @...
sourceWriter . print ( "public <POJO> " ) ; sourceWriter . print ( AbstractPojoDescriptorImpl . class . getSimpleName ( ) ) ; sourceWriter . println ( "<POJO> createDescriptor(Class<POJO> pojoType) {" ) ; sourceWriter . indent ( ) ; PojoDescriptorGeneratorConfiguration configuration = getConfiguration ( ) ; TypeOracle ...
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 t...
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 ...
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 Unauthori...
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.HTODDyna...
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 ge...
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 us...
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 < ? >...
Multimap < Type , Class < ? > > defaultFactoryToBind = ArrayListMultimap . create ( ) ; bindings . entrySet ( ) . stream ( ) . filter ( entry -> isCandidate ( entry . getKey ( ) . getTypeLiteral ( ) . getType ( ) ) ) . forEach ( entry -> defaultFactoryToBind . put ( entry . getKey ( ) . getTypeLiteral ( ) . getType ( )...
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 { resour...
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 ( targ...
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 magnit...
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 t...
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 ,...
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 pai...
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 !...
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 requeste...
com . squareup . okhttp . Call call = getCharactersCharacterIdCalendarEventIdAttendeesValidateBeforeCall ( characterId , eventId , datasource , ifNoneMatch , token , null ) ; Type localVarReturnType = new TypeToken < List < CharacterCalendarAttendeesResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call...
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 [ ] serie...
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 simil...
// 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 > ( ...
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...
// 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_ME...
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 ( Stri...
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 b...
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...
// 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 ) ...
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 * @ th...
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 Str...
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 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 } cla...
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...
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_ded...
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 ) ;