signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AbstractBeanDefinition { /** * Resolves the proxied bean instance for this bean . * @ param beanContext The { @ link BeanContext } * @ return The proxied bean */ @ SuppressWarnings ( { } }
"unchecked" , "unused" } ) @ Internal protected final Object getProxiedBean ( BeanContext beanContext ) { DefaultBeanContext defaultBeanContext = ( DefaultBeanContext ) beanContext ; Optional < String > qualifier = getAnnotationMetadata ( ) . getAnnotationNameByStereotype ( javax . inject . Qualifier . class ) ; return...
public class JmfTr { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . utils . ras . SibTr # exception ( com . ibm . websphere . ras . TraceComponent , java . lang . Throwable ) */ public static void exception ( TraceComponent tc , Throwable t ) { } }
if ( isTracing ( ) ) SibTr . exception ( tc , t ) ;
public class ObjectFactory { /** * Create an instance of { @ link Project . Storepoints . Storepoint . Activities . Activity } */ public Project . Storepoints . Storepoint . Activities . Activity createProjectStorepointsStorepointActivitiesActivity ( ) { } }
return new Project . Storepoints . Storepoint . Activities . Activity ( ) ;
public class GVRViewManager { /** * capture 3D screenshot */ protected void capture3DScreenShot ( GVRRenderTarget renderTarget , boolean isMultiview ) { } }
if ( mScreenshot3DCallback == null ) { return ; } final Bitmap [ ] bitmaps = new Bitmap [ 6 ] ; renderSixCamerasAndReadback ( mMainScene . getMainCameraRig ( ) , bitmaps , renderTarget , isMultiview ) ; returnScreenshot3DToCaller ( mScreenshot3DCallback , bitmaps , mReadbackBufferWidth , mReadbackBufferHeight ) ; mScre...
public class ClientMediaEntry { /** * Package access , to be called by DefaultClientCollection */ @ Override void addToCollection ( final ClientCollection col ) throws ProponoException { } }
setCollection ( col ) ; final EntityEnclosingMethod method = new PostMethod ( col . getHrefResolved ( ) ) ; getCollection ( ) . addAuthentication ( method ) ; try { final Content c = getContents ( ) . get ( 0 ) ; if ( inputStream != null ) { method . setRequestEntity ( new InputStreamRequestEntity ( inputStream ) ) ; }...
public class JolokiaMBeanServer { /** * Lookup a JsonMBean annotation */ private JsonMBean extractJsonMBeanAnnotation ( Object object ) { } }
// Try directly Class < ? > clazz = object . getClass ( ) ; JsonMBean anno = clazz . getAnnotation ( JsonMBean . class ) ; if ( anno == null && ModelMBean . class . isAssignableFrom ( object . getClass ( ) ) ) { // For ModelMBean we try some heuristic to get to the managed resource // This works for all subclasses of R...
public class appfwsettings { /** * Use this API to fetch all the appfwsettings resources that are configured on netscaler . */ public static appfwsettings get ( nitro_service service ) throws Exception { } }
appfwsettings obj = new appfwsettings ( ) ; appfwsettings [ ] response = ( appfwsettings [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ;
public class InstrumentationModelFinder { /** * This will scan directory for class files , non - recursive . * @ param directory directory to scan . * @ throws IOException , NotFoundException */ private void findFiles ( File directory ) throws IOException , ClassNotFoundException { } }
File [ ] files = directory . listFiles ( new FilenameFilter ( ) { public boolean accept ( File dir , String name ) { return name . endsWith ( ".class" ) ; } } ) ; if ( files != null ) { for ( File file : files ) { int current = currentDirectoryPath . length ( ) ; String fileName = file . getCanonicalPath ( ) . substrin...
public class XMLConfigAdmin { /** * updates the ErrorTemplate * @ param template * @ throws SecurityException */ public void updateErrorTemplate ( int statusCode , String template ) throws SecurityException { } }
checkWriteAccess ( ) ; boolean hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE_DEBUGGING ) ; if ( ! hasAccess ) throw new SecurityException ( "no access to change error settings" ) ; Element error = _getRootElement ( "error" ) ; // if ( template . trim ( ) . length ( ) > 0) error . setAttribute ...
public class CSVStream { /** * Stream a CSV file from the given Reader through the header validator , line * checker , and if the line checker succeeds , send the checked / converted line to * the consumer . * @ param reader * The { @ link Reader } containing the CSV file . * @ param headersValidator * The ...
parse ( reader , headersValidator , lineConverter , resultConsumer , substituteHeaders , DEFAULT_HEADER_COUNT ) ;
public class SparkDataValidation { /** * Validate MultiDataSet objects - < b > and delete any invalid MultiDataSets < / b > - that have been previously saved to the * specified directory on HDFS by attempting to load them and checking their contents . Assumes MultiDataSets were saved * using { @ link org . nd4j . l...
return validateMultiDataSets ( sc , path , true , true , - 1 , - 1 , null , null ) ;
public class DocBookBuilder { /** * Validate all the book links in the each topic to ensure that they exist somewhere in the book . If they don ' t then the * topic XML is replaced with a generic error template . * @ param buildData Information and data structures for the build . * @ param bookIdAttributes A set ...
final List < SpecTopic > topics = buildData . getBuildDatabase ( ) . getAllSpecTopics ( ) ; final Set < Integer > processedTopics = new HashSet < Integer > ( ) ; for ( final SpecTopic specTopic : topics ) { final BaseTopicWrapper < ? > topic = specTopic . getTopic ( ) ; final Document doc = specTopic . getXMLDocument (...
public class BackupRuleInput { /** * To help organize your resources , you can assign your own metadata to the resources that you create . Each tag is a * key - value pair . * @ param recoveryPointTags * To help organize your resources , you can assign your own metadata to the resources that you create . Each *...
setRecoveryPointTags ( recoveryPointTags ) ; return this ;
public class KeyStoreServiceImpl { /** * { @ inheritDoc } */ @ Override public SecretKey getSecretKeyFromKeyStore ( String keyStoreName , String alias , @ Sensitive String keyPassword ) throws KeyStoreException , CertificateException { } }
try { WSKeyStore wsKS = ksMgr . getKeyStore ( keyStoreName ) ; if ( wsKS == null ) { throw new KeyStoreException ( "The WSKeyStore [" + keyStoreName + "] is not present in the configuration" ) ; } Key key = wsKS . getKey ( alias , keyPassword ) ; if ( key instanceof SecretKey ) { return ( SecretKey ) key ; } else { thr...
public class XmlUtil { /** * Create a new Transformer from an XSLT . * @ param source the source of the XSLT . * @ param uriResolver * @ return a new Transformer * @ throws TransformerConfigurationException if there was a problem creating the Transformer from the XSLT */ public static Transformer newTransformer...
TRANSFORMER_FACTORY . setURIResolver ( uriResolver ) ; Transformer transformer = TRANSFORMER_FACTORY . newTransformer ( source ) ; // Although newTansformer ( ) is not allowed to return null , Xalan does . // Trap that here by throwing the expected TransformerConfigurationException . if ( transformer == null ) { throw ...
public class QCryptoBlockCreateOptions { @ Nonnull public static QCryptoBlockCreateOptions qcow ( @ Nonnull QCryptoBlockOptionsQCow qcow ) { } }
QCryptoBlockCreateOptions self = new QCryptoBlockCreateOptions ( ) ; self . format = QCryptoBlockFormat . qcow ; self . qcow = qcow ; return self ;
public class ActiveRecordPlugin { /** * 用于分布式场景 , 当某个分布式节点只需要用 Model 承载和传输数据 , 而不需要实际操作数据库时 * 调用本方法可保障 IContainerFactory 、 Dialect 、 ICache 的一致性 * 本用法更加适用于 Generator 生成的继承自 base model的 Model , 更加便于传统第三方工具对 * 带有 getter 、 setter 的 model 进行各种处理 * < pre > * 警告 : Dialect 、 IContainerFactory 、 ICache 三者一定要与集群中其它节点保...
if ( dialect == null ) { throw new IllegalArgumentException ( "dialect can not be null" ) ; } if ( containerFactory == null ) { throw new IllegalArgumentException ( "containerFactory can not be null" ) ; } if ( cache == null ) { throw new IllegalArgumentException ( "cache can not be null" ) ; } ActiveRecordPlugin arp =...
public class Operand { /** * Gets the adGroupExtensionSetting value for this Operand . * @ return adGroupExtensionSetting */ public com . google . api . ads . adwords . axis . v201809 . cm . AdGroupExtensionSetting getAdGroupExtensionSetting ( ) { } }
return adGroupExtensionSetting ;
public class FloatsColumn { /** * Factory method to create FloatsColumn . */ public static FloatsColumn create ( ColumnarFloats column , ImmutableBitmap nullValueBitmap ) { } }
if ( nullValueBitmap . isEmpty ( ) ) { return new FloatsColumn ( column ) ; } else { return new FloatsColumnWithNulls ( column , nullValueBitmap ) ; }
public class DatastoreHelper { /** * Constructs credentials for the given account and key file . * @ param serviceAccountId service account ID ( typically an e - mail address ) . * @ param privateKeyFile the file name from which to get the private key . * @ param serviceAccountScopes Collection of OAuth scopes to...
return getCredentialBuilderWithoutPrivateKey ( serviceAccountId , serviceAccountScopes ) . setServiceAccountPrivateKeyFromP12File ( new File ( privateKeyFile ) ) . build ( ) ;
public class Logging { /** * TODO don ' t remove and add handler each time this method is called . . */ public static Logger getLogger ( String name ) { } }
Logger logger = Logger . getLogger ( name ) ; logger . setUseParentHandlers ( false ) ; for ( Handler handler : logger . getHandlers ( ) ) { logger . removeHandler ( handler ) ; } // TODO when output log to the standard error Formatter formatter = new Formatter ( ) { @ Override public String format ( LogRecord record )...
public class CachedRemoteTable { /** * Delete the current record . * @ param - This is a dummy param , because this call conflicts with a call in EJBHome . * @ exception Exception File exception . */ public void remove ( Object data , int iOpenMode ) throws DBException , RemoteException { } }
this . checkCurrentCacheIsPhysical ( null ) ; m_tableRemote . remove ( data , iOpenMode ) ; if ( m_objCurrentCacheRecord != null ) { if ( m_mapCache != null ) m_mapCache . set ( ( ( Integer ) m_objCurrentCacheRecord ) . intValue ( ) , NONE ) ; else if ( m_htCache != null ) m_htCache . remove ( m_objCurrentCacheRecord )...
public class JCRNodeTypeDataPersister { /** * { @ inheritDoc } */ public void removeNodeType ( NodeTypeData nodeType ) throws RepositoryException { } }
if ( ! validatate ( ) ) { return ; } validatate ( ) ; NodeData nodeTypeData = ( NodeData ) dataManager . getItemData ( nodeTypeStorageRoot , new QPathEntry ( nodeType . getName ( ) , 1 ) , ItemType . NODE ) ; ItemDataRemoveVisitor removeVisitor = new ItemDataRemoveVisitor ( dataManager , nodeTypeStorageRoot . getQPath ...
public class OggStreamDecoder { /** * Reads in a page . * @ return true if a page was read , false if we ' ve reached the end of the stream . */ protected boolean readPage ( ) throws IOException { } }
int result ; while ( ( result = _sync . pageout ( _page ) ) != 1 ) { if ( result == 0 && ! readChunk ( ) ) { return false ; } } _stream . pagein ( _page ) ; return true ;
public class ServiceStateDefinition { /** * Populate the supplied response { @ link ModelNode } with information about the supplied { @ link ServiceController } * @ param response the response to populate . * @ param serviceController the { @ link ServiceController } to use when populating the response . */ static ...
response . set ( serviceController . getState ( ) . toString ( ) ) ;
public class RecurlyClient { /** * Create an AddOn to a Plan * @ param planCode The planCode of the { @ link Plan } to create within recurly * @ param addOn The { @ link AddOn } to create within recurly * @ return the { @ link AddOn } object as identified by the passed in object */ public AddOn createPlanAddOn ( ...
return doPOST ( Plan . PLANS_RESOURCE + "/" + planCode + AddOn . ADDONS_RESOURCE , addOn , AddOn . class ) ;
public class EnumHelper { /** * Get the enum value with the passed ID * @ param < KEYTYPE > * The ID type * @ param < ENUMTYPE > * The enum type * @ param aClass * The enum class * @ param aID * The ID to search * @ return < code > null < / code > if no enum item with the given ID is present . */ @ Nu...
return getFromIDOrDefault ( aClass , aID , null ) ;
public class DefaultDataSet { /** * ( non - Javadoc ) * @ see net . sf . flatpack . DataSet # orderRows ( net . sf . flatpack . ordering . OrderBy ) */ @ Override public void orderRows ( final OrderBy ob ) { } }
if ( ob != null ) { ob . setMetaData ( getMetaData ( ) ) ; ob . setParser ( parser ) ; Collections . sort ( rows , ob ) ; goTop ( ) ; }
public class RepositoryPackage { /** * Deserializes packages from packagist . org , e . g . * http : / / packagist . org / packages / Symfony / Router . json * @ param name the package name , such as Symfony / Router * @ return the deserialized package * @ throws IOException */ public static RepositoryPackage f...
PackagistDownloader downloader = new PackagistDownloader ( ) ; return downloader . loadPackage ( name ) ;
public class WebContainer { /** * Method removeWebApplication . * @ param deployedModule * @ throws Exception */ public void removeWebApplication ( DeployedModule deployedModule ) throws Exception { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "removeWebApplication" , "Deployed Module Virtual Host Name:" , deployedModule . getVirtualHostName ( ) ) ; } try { VirtualHost vHost = getVirtualHost ( deployedM...
public class VisualizeImageData { /** * Renders two gradients on the same image using two sets of colors , on for each input image . * @ param derivX ( Input ) Image with positive and negative values . * @ param derivY ( Input ) Image with positive and negative values . * @ param maxAbsValue The largest absolute ...
if ( derivX instanceof GrayS16 ) { return colorizeGradient ( ( GrayS16 ) derivX , ( GrayS16 ) derivY , ( int ) maxAbsValue , output ) ; } else if ( derivX instanceof GrayF32 ) { return colorizeGradient ( ( GrayF32 ) derivX , ( GrayF32 ) derivY , ( float ) maxAbsValue , output ) ; } else { throw new IllegalArgumentExcep...
public class CDDB { /** * Requests the detail information for a particular disc in a particular category from the CDDB * server . * @ return A detail instance filled with the information for the requested CD . */ public Detail read ( String category , String discid ) throws IOException , CDDBException { } }
// sanity check if ( _sock == null ) { throw new CDDBException ( 500 , "Not connected" ) ; } // construct the query StringBuilder req = new StringBuilder ( "cddb read " ) ; req . append ( category ) . append ( " " ) ; req . append ( discid ) ; // make the request Response rsp = request ( req . toString ( ) ) ; // anyth...
public class CompactionManager { /** * / * Used in tests . */ public void disableAutoCompaction ( ) { } }
for ( String ksname : Schema . instance . getNonSystemKeyspaces ( ) ) { for ( ColumnFamilyStore cfs : Keyspace . open ( ksname ) . getColumnFamilyStores ( ) ) cfs . disableAutoCompaction ( ) ; }
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcCoveringTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class SaveController { /** * Fill in response headers to make this save the file instead of * displaying it . * @ param response the servlet response * @ param root the root of the dataset being saved */ private void setHeaders ( final HttpServletResponse response , final Root root ) { } }
response . setHeader ( "content-type" , "application/octet-stream" ) ; response . setHeader ( "content-disposition" , "attachment; filename=" + getSaveFilename ( root ) ) ;
public class TenantDefinition { /** * Get the value of the option with the given name , if defined , as a String . If the * option is defined , toString ( ) is called to create the String . * @ param optName Name of option to fetch . * @ return Option value as a String or null if not defined . */ public String ge...
Object optValue = m_options . get ( optName ) ; if ( optValue == null ) { return null ; } return optValue . toString ( ) ;
public class AbstractProcessor { /** * Adjust any url references in the line to use new root path . * @ param line String to modify * @ return the modified string */ public String replaceURLs ( String line ) { } }
StringBuffer sb = new StringBuffer ( ) ; Matcher matcher = URL_PATTERN . matcher ( line ) ; String newPath = "web/" + getResourceBase ( ) + "/" ; while ( matcher . find ( ) ) { char dlm = line . charAt ( matcher . start ( ) - 1 ) ; int i = line . indexOf ( dlm , matcher . end ( ) ) ; String url = i > 0 ? line . substri...
public class Enhancer { /** * Enhances the given object . * @ param t object to enhance * @ return enhanced object */ public T enhance ( T t ) { } }
if ( ! needsEnhancement ( t ) ) { return t ; } try { return getEnhancedClass ( ) . getConstructor ( baseClass ) . newInstance ( t ) ; } catch ( Exception e ) { throw new RuntimeException ( String . format ( "Could not enhance object %s (%s)" , t , t . getClass ( ) ) , e ) ; }
public class NavigationHelper { /** * Creates a list of pairs { @ link StepIntersection } and double distance in meters along a step . * Each pair represents an intersection on the given step and its distance along the step geometry . * The first intersection is the same point as the first point of the list of step...
boolean lessThanTwoStepPoints = stepPoints . size ( ) < TWO_POINTS ; boolean noIntersections = intersections . isEmpty ( ) ; if ( lessThanTwoStepPoints || noIntersections ) { return Collections . emptyList ( ) ; } LineString stepLineString = LineString . fromLngLats ( stepPoints ) ; Point firstStepPoint = stepPoints . ...
public class Expression { /** * Returns a chunk whose output expression is the same as this chunk ' s , but which includes the * given initial statements . * < p > This method is designed for interoperability with parts of the JS codegen system that do not * understand code chunks . For example , when applying pl...
// If there are no new initial statements , return the current chunk . if ( Iterables . isEmpty ( initialStatements ) ) { return this ; } // Otherwise , return a code chunk that includes all of the dependent code . return Composite . create ( ImmutableList . copyOf ( initialStatements ) , this ) ;
public class MD4 { /** * { @ inheritDoc } */ protected void engineReset ( ) { } }
a = A ; b = B ; c = C ; d = D ; msgLength = 0 ;
public class SchemaTypeAdapter { /** * Writes the given { @ link Schema } into json . * @ param writer A { @ link JsonWriter } for emitting json . * @ param schema The { @ link Schema } object to encode to json . * @ param knownRecords Set of record names that has already been encoded . * @ return The same { @ ...
// Simple type , just emit the type name as a string if ( schema . getType ( ) . isSimpleType ( ) ) { return writer . value ( schema . getType ( ) . name ( ) . toLowerCase ( ) ) ; } // Union type is an array of schemas if ( schema . getType ( ) == Schema . Type . UNION ) { writer . beginArray ( ) ; for ( Schema unionSc...
public class DoubleMatrix { /** * Aij * = array [ j ] * @ param i * @ param arr * @ param offset */ public void mulRow ( int i , double [ ] arr , int offset ) { } }
int n = cols ; for ( int j = 0 ; j < n ; j ++ ) { mul ( i , j , arr [ j + offset ] ) ; }
public class Users { /** * Delete a user or a user / group , user / role relationship . */ @ Path ( "/{cuid}/rel/{relId}" ) @ ApiOperation ( value = "Delete a user or remove a user from a workgroup or role" , notes = "If rel/{relId} is present, user is removed from workgroup or role." , response = StatusMessage . class...
String cuid = getSegment ( path , 1 ) ; String rel = getSegment ( path , 2 ) ; UserServices userServices = ServiceLocator . getUserServices ( ) ; try { if ( rel == null ) { if ( userServices . getUser ( cuid ) == null ) throw new ServiceException ( ServiceException . NOT_FOUND , "User not found: " + cuid ) ; userServic...
public class PersistenceContextProvider { /** * Use a producer method so that CDI will find this EntityManager . * @ param emf * entity manager factory * @ return entity manager */ @ Produces @ RequestScoped public EntityManager getEntityManager ( EntityManagerFactory emf ) { } }
log . debug ( "producing EntityManager" ) ; return emf . createEntityManager ( ) ;
public class InvalidKBException { /** * Thrown on commit when validation errors are found */ public static InvalidKBException validationErrors ( List < String > errors ) { } }
StringBuilder message = new StringBuilder ( ) ; message . append ( ErrorMessage . VALIDATION . getMessage ( errors . size ( ) ) ) ; for ( String s : errors ) { message . append ( s ) ; } return create ( message . toString ( ) ) ;
public class QueryParserImpl { /** * Select query */ @ Override public void exitSelect_clause ( SQLParser . Select_clauseContext ctx ) { } }
this . queryType = QueryType . SELECT ; selectClauseContext = ctx ;
public class H2O { /** * Check if the Java version is not supported * @ return true if not supported */ public static boolean checkUnsupportedJava ( ) { } }
if ( Boolean . getBoolean ( H2O . OptArgs . SYSTEM_PROP_PREFIX + "debug.noJavaVersionCheck" ) ) { return false ; } // Notes : // - make sure that the following whitelist is logically consistent with whitelist in R code - see function . h2o . check _ java _ version in connection . R // - upgrade of the javassist library...
public class IconProviderBuilder { /** * Gets the { @ link IBlockIconProvider } to use for { @ link WallComponent } . * @ param insideIcon the inside icon * @ return the icon provider builder */ private IBlockIconProvider getWallIconProvider ( ) { } }
return ( state , side ) -> { if ( side == EnumFacing . SOUTH || ( side == EnumFacing . WEST && WallComponent . isCorner ( state ) ) ) return insideIcon ; return defaultIcon ; } ;
public class DeviceFinder { /** * Get the set of DJ Link devices which currently can be seen on the network . These can be passed to * { @ link VirtualCdj # getLatestStatusFor ( DeviceUpdate ) } to find the current detailed status for that device , * as long as the Virtual CDJ is active . * @ return the devices w...
if ( ! isRunning ( ) ) { throw new IllegalStateException ( "DeviceFinder is not active" ) ; } expireDevices ( ) ; // Get rid of anything past its sell - by date . // Make a copy so callers get an immutable snapshot of the current state . return Collections . unmodifiableSet ( new HashSet < DeviceAnnouncement > ( device...
public class ServletSessionAttributePhrase { /** * { @ inheritDoc } */ public Formula getFormula ( ) { } }
Reagent [ ] reagents = new Reagent [ ] { SOURCE , ATTRIBUTE_NAME } ; return new SimpleFormula ( ServletSessionAttributePhrase . class , reagents ) ;
public class DestinationManager { /** * < p > Public method to create a remote destination when passed a destinationDefinition and * a set of localising MEs . The create is performed transactionally and completes when * the transaction commits . < / p > * @ param destinationDefinition * @ param queuePointLocali...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createDestination" , new Object [ ] { destinationDefinition , queuePointLocalizingMEs } ) ; // Try to create the local destination . try { createRemoteDestination ( destinationDefinition , queuePointLocalizingMEs ) ; } catc...
public class ResourcePool { /** * Acquires an object of type { code T } from the pool . * This method is like { @ link # acquire ( ) } , but it will time out if an object cannot be * acquired before the specified amount of time . * @ param time an amount of time to wait , < = 0 to wait indefinitely * @ param un...
// If either time or unit are null , the other should also be null . Preconditions . checkState ( ( time <= 0 ) == ( unit == null ) ) ; long endTimeMs = 0 ; if ( time > 0 ) { endTimeMs = System . currentTimeMillis ( ) + unit . toMillis ( time ) ; } // Try to take a resource without blocking T resource = mResources . po...
public class Http2Clients { /** * Creates a { @ link OkHttpClient } instance and configures it with a cache . The same instance is used across the application to * benefit from a common cache storage and to prevent cache corruption . The cache directory is created private to the user who * runs the application and ...
return COREUTILS_CONTEXT . getClient ( OkHttpClient . class , "coreutils-fiber" , ( ) -> { final OkHttpClient client = new FiberOkHttpClient ( ) ; try { // load default configuration final Config config = new Configurer ( ) . loadConfig ( null , "coreutils" ) ; final long tmp = config . getBytes ( "coreutils.clients.ht...
public class R2ClientFactory { /** * Given a { @ link Config } , create an instance of { @ link Client } * A sample configuration for https based client is : * < br > ssl = true * < br > keyStoreFilePath = / path / to / key / store * < br > keyStorePassword = password * < br > keyStoreType = PKCS12 * < br >...
Config config = srcConfig . withFallback ( FALLBACK ) ; switch ( schema ) { case HTTP : return createHttpClient ( config ) ; case D2 : String confPrefix = schema . name ( ) . toLowerCase ( ) ; if ( config . hasPath ( confPrefix ) ) { Config d2Config = config . getConfig ( confPrefix ) ; return createD2Client ( d2Config...
public class MtasSpanStartQuery { /** * ( non - Javadoc ) * @ see * org . apache . lucene . search . spans . SpanQuery # createWeight ( org . apache . lucene . * search . IndexSearcher , boolean ) */ @ Override public MtasSpanWeight createWeight ( IndexSearcher searcher , boolean needsScores , float boost ) throw...
SpanWeight spanWeight = ( ( SpanQuery ) searcher . rewrite ( clause ) ) . createWeight ( searcher , needsScores , boost ) ; return new SpanTermWeight ( spanWeight , searcher , boost ) ;
public class AbstractPrimitivePrefsTransform { /** * ( non - Javadoc ) * @ see * com . abubusoft . kripton . processor . sharedprefs . transform . PrefsTransform # * generateWriteProperty ( com . squareup . javapoet . MethodSpec . Builder , * java . lang . String , com . squareup . javapoet . TypeName , java . ...
if ( nullable ) { methodBuilder . beginControlFlow ( "if ($L!=null) " , getter ( beanName , beanClass , property ) ) ; } methodBuilder . addCode ( "$L.put" + PREFS_TYPE + "($S," , editorName , property . getPreferenceKey ( ) ) ; if ( property . hasTypeAdapter ( ) ) { methodBuilder . addCode ( "$T.getAdapter($T.class).t...
public class STGD { /** * Sets the threshold for a coefficient value to avoid regularization . While * a coefficient reaches this magnitude , regularization will not be applied . * @ param threshold the coefficient regularization threshold in * ( 0 , Infinity ] */ public void setThreshold ( double threshold ) { }...
if ( Double . isNaN ( threshold ) || threshold <= 0 ) throw new IllegalArgumentException ( "Threshold must be positive, not " + threshold ) ; this . threshold = threshold ;
public class EditText { /** * @ return the minimum width of the TextView , in pixels or - 1 if the minimum width * was set in ems instead ( using { @ link # setMinEms ( int ) } or { @ link # setEms ( int ) } ) . * @ see # setMinWidth ( int ) * @ see # setWidth ( int ) * @ attr ref android . R . styleable # Text...
if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) return mInputView . getMinWidth ( ) ; return - 1 ;
public class SSLChannel { /** * @ see com . ibm . wsspi . channelfw . Channel # getConnectionLink ( com . ibm . wsspi . channelfw . VirtualConnection ) */ @ Override public ConnectionLink getConnectionLink ( VirtualConnection vc ) { } }
// Double check that the channel was initialized . It may have been delayed . if ( ! this . isInitialized ) { try { init ( ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception caught while getting SSL connection link: " + e ) ; } FFDCFil...
public class TransformClob { /** * Transforms the datasource object into an object required by the class * @ param cpoAdapter The CpoAdapter for the datasource where the attribute is being retrieved * @ param parentObject The object that contains the attribute being retrieved . * @ param The object that represent...
char [ ] buffChars = new char [ 1024 ] ; char [ ] retChars = null ; int length ; CharArrayWriter caw = new CharArrayWriter ( ) ; if ( clob != null ) { try { Reader is = clob . getCharacterStream ( ) ; while ( ( length = is . read ( buffChars ) ) != - 1 ) { caw . write ( buffChars , 0 , length ) ; } is . close ( ) ; ret...
public class SqlDateTimeUtils { /** * Returns the milli second part of the datetime . */ private static int getMillis ( String dateStr ) { } }
int length = dateStr . length ( ) ; if ( length == 19 ) { // "1999-12-31 12:34:56 " , no milli second left return 0 ; } else if ( length == 21 ) { // "1999-12-31 12:34:56.7 " , return 7 return Integer . parseInt ( dateStr . substring ( 20 ) ) * 100 ; } else if ( length == 22 ) { // "1999-12-31 12:34:56.78 " , return 78...
public class ClientConfig { /** * < p > Use the provided JAAS login context entry key to get the authentication * credentials held by the caller < p > * @ param loginContextEntryKey JAAS login context config entry designation */ public void enableKerberosAuthentication ( final String loginContextEntryKey ) { } }
try { LoginContext lc = new LoginContext ( loginContextEntryKey ) ; lc . login ( ) ; m_subject = lc . getSubject ( ) ; } catch ( SecurityException | LoginException ex ) { throw new IllegalArgumentException ( "Cannot determine client consumer's credentials" , ex ) ; }
public class Main { /** * Méthode main . * @ param args Arguments du programme */ public static void main ( String [ ] args ) { } }
log ( "starting" ) ; // jnlp prefix to fix : // http : / / stackoverflow . com / questions / 19400725 / with - java - update - 7-45 - the - system - properties - no - more - set - from - jnlp - tag - property // https : / / bugs . openjdk . java . net / browse / JDK - 8023821 for ( final Object property : Collections ....
public class Whitebox { /** * Convenience method to get a method from a class type without having to * catch the checked exceptions otherwise required . These exceptions are * wrapped as runtime exceptions . * The method will first try to look for a declared method in the same * class . If the method is not dec...
return WhiteboxImpl . getMethod ( type , methodName , parameterTypes ) ;
public class CreateRouteRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < CreateRouteRequest > getDryRunRequest ( ) { } }
Request < CreateRouteRequest > request = new CreateRouteRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class Selection { /** * Sort the byte array in descending order using this algorithm . * @ param byteArray the array of bytes that we want to sort */ public static void sortDescending ( byte [ ] byteArray ) { } }
int index = 0 ; byte value = 0 ; for ( int i = 1 ; i < byteArray . length ; i ++ ) { index = i ; value = byteArray [ index ] ; while ( index > 0 && value > byteArray [ index - 1 ] ) { byteArray [ index ] = byteArray [ index - 1 ] ; index -- ; } byteArray [ index ] = value ; }
public class SequenceFile { /** * Set the compression type for sequence files . * @ param job the configuration to modify * @ param val the new compression type ( none , block , record ) * @ deprecated Use the one of the many SequenceFile . createWriter methods to specify * the { @ link CompressionType } while ...
job . set ( "io.seqfile.compression.type" , val . toString ( ) ) ;
public class HandlerUtil { /** * Returns all names of methods that would represent the getter for a field with the provided name . * For example if { @ code isBoolean } is true , then a field named { @ code isRunning } would produce : < br / > * { @ code [ isRunning , getRunning , isIsRunning , getIsRunning ] } *...
return toAllAccessorNames ( ast , accessors , fieldName , isBoolean , "is" , "get" , true ) ;
public class CPDefinitionVirtualSettingPersistenceImpl { /** * Removes the cp definition virtual setting where uuid = & # 63 ; and groupId = & # 63 ; from the database . * @ param uuid the uuid * @ param groupId the group ID * @ return the cp definition virtual setting that was removed */ @ Override public CPDefi...
CPDefinitionVirtualSetting cpDefinitionVirtualSetting = findByUUID_G ( uuid , groupId ) ; return remove ( cpDefinitionVirtualSetting ) ;
public class ResultUtil { /** * " key " : " demoproject " , * " doc _ count " : 30, * " successsums " : { * " doc _ count _ error _ upper _ bound " : 0, * " sum _ other _ doc _ count " : 0, * " buckets " : [ * " key " : 0, * " doc _ count " : 30 * @ param map * @ param metrics successsums - > buckets ...
if ( map != null ) { Map < String , Object > metrics_ = ( Map < String , Object > ) map . get ( metrics ) ; if ( metrics_ != null ) { return ( T ) metrics_ . get ( "buckets" ) ; } } return ( T ) null ;
public class AbstractConsoleEditor { /** * Clears the current line . * The purpose of this method is to cover cases where erase line doesn ' t respect background color ( e . g some Windows ) . */ protected void clearLine ( ) { } }
StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < terminal . getWidth ( ) ; i ++ ) { sb . append ( " " ) ; } console . out ( ) . print ( sb . toString ( ) ) ;
public class ArithmeticUtils { /** * Multiply two integers , checking for overflow . * @ param x first factor * @ param y second factor * @ return the product { @ code x * y } . * @ throws ArithmeticException if the result can not be represented as an { @ code int } . */ public static int mulAndCheck ( int x , ...
long m = ( ( long ) x ) * ( ( long ) y ) ; if ( m < Integer . MIN_VALUE || m > Integer . MAX_VALUE ) { throw new ArithmeticException ( ) ; } return ( int ) m ;
public class CertificatesInner { /** * Upload the certificate to the IoT hub . * Adds new or replaces existing certificate . * @ param resourceGroupName The name of the resource group that contains the IoT hub . * @ param resourceName The name of the IoT hub . * @ param certificateName The name of the certifica...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( resourc...
public class CausticUtil { /** * Creates a byte buffer of the desired capacity . * @ param capacity The capacity * @ return The byte buffer */ public static ByteBuffer createByteBuffer ( int capacity ) { } }
return ByteBuffer . allocateDirect ( capacity * DataType . BYTE . getByteSize ( ) ) . order ( ByteOrder . nativeOrder ( ) ) ;
public class DataSet { /** * Writes a DataSet as text file ( s ) to the specified location . * < p > For each element of the DataSet the result of { @ link TextFormatter # format ( Object ) } is written . * @ param filePath The path pointing to the location the text file is written to . * @ param writeMode Contro...
return map ( new FormattingMapper < > ( clean ( formatter ) ) ) . writeAsText ( filePath , writeMode ) ;
public class JDBCConnection { /** * Retrieves whether this < code > Connection < / code > * object is in read - only mode . * @ return < code > true < / code > if this < code > Connection < / code > object * is read - only ; < code > false < / code > otherwise * @ exception SQLException SQLException if a databa...
checkClosed ( ) ; try { return sessionProxy . isReadOnlyDefault ( ) ; } catch ( HsqlException e ) { throw Util . sqlException ( e ) ; }
public class AbstractPipeline { /** * Evaluate the pipeline with a terminal operation to produce a result . * @ param < R > the type of result * @ param terminalOp the terminal operation to be applied to the pipeline . * @ return the result */ final < R > R evaluate ( TerminalOp < E_OUT , R > terminalOp ) { } }
assert getOutputShape ( ) == terminalOp . inputShape ( ) ; if ( linkedOrConsumed ) throw new IllegalStateException ( MSG_STREAM_LINKED ) ; linkedOrConsumed = true ; return isParallel ( ) ? terminalOp . evaluateParallel ( this , sourceSpliterator ( terminalOp . getOpFlags ( ) ) ) : terminalOp . evaluateSequential ( this...
public class ConnectorMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Connector connector , ProtocolMarshaller protocolMarshaller ) { } }
if ( connector == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( connector . getConnectorArn ( ) , CONNECTORARN_BINDING ) ; protocolMarshaller . marshall ( connector . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( connector . g...
public class ASTElementFactory { /** * Build a ASTType from the provided TypeElement . * @ param typeElement required input Element * @ return ASTType constructed using teh input Element */ public synchronized ASTType getType ( final TypeElement typeElement ) { } }
return new LazyASTType ( buildPackageClass ( typeElement ) , typeElement ) { @ Override public ASTType lazyLoad ( ) { if ( ! typeCache . containsKey ( typeElement ) ) { typeCache . put ( typeElement , buildType ( typeElement ) ) ; } return typeCache . get ( typeElement ) ; } } ;
public class PieChart { /** * Calculate which pie slice is under the pointer , and set the current item * field accordingly . */ private void calcCurrentItem ( ) { } }
int pointerAngle ; // calculate the correct pointer angle , depending on clockwise drawing or not if ( mOpenClockwise ) { pointerAngle = ( mIndicatorAngle + 360 - mPieRotation ) % 360 ; } else { pointerAngle = ( mIndicatorAngle + 180 + mPieRotation ) % 360 ; } for ( int i = 0 ; i < mPieData . size ( ) ; ++ i ) { PieMod...
public class RobotUtil { /** * 模拟单击 < br > * 鼠标单击包括鼠标左键的按下和释放 * @ since 4.5.7 */ public static void click ( ) { } }
robot . mousePress ( InputEvent . BUTTON1_MASK ) ; robot . mouseRelease ( InputEvent . BUTTON1_MASK ) ; delay ( ) ;
public class DOValidatorSchematron { /** * Run setup to prepare for Schematron validation . This entails dynamically * creating the validating stylesheet using the preprocessor and the schema . * @ param preprocessorPath * the location of the Schematron preprocessor * @ param fedoraschemaPath * the URL of the...
String key = fedoraschemaPath + "#" + phase ; Templates templates = generatedStyleSheets . get ( key ) ; if ( templates == null ) { rulesSource = fileToStreamSource ( fedoraschemaPath ) ; preprocessorSource = fileToStreamSource ( preprocessorPath ) ; templates = createValidatingStyleSheet ( rulesSource , preprocessorSo...
public class AllWindowedStream { /** * Applies the given window function to each window . The window function is called for each * evaluation of the window . The output of the window function is * interpreted as a regular non - windowed stream . * < p > Note that this function requires that all data in the window...
String callLocation = Utils . getCallLocationName ( ) ; function = input . getExecutionEnvironment ( ) . clean ( function ) ; TypeInformation < R > resultType = getAllWindowFunctionReturnType ( function , getInputType ( ) ) ; return apply ( new InternalIterableAllWindowFunction < > ( function ) , resultType , callLocat...
public class HamtPMap { /** * Returns a new map with the elements from children . One element is removed from one of the * children and promoted to a root node . If there are no children , returns null . */ private static < K , V > HamtPMap < K , V > deleteRoot ( int mask , HamtPMap < K , V > [ ] children ) { } }
if ( mask == 0 ) { return null ; } HamtPMap < K , V > child = children [ 0 ] ; int hashBits = Integer . numberOfTrailingZeros ( mask ) ; int newHash = unshift ( child . hash , hashBits ) ; HamtPMap < K , V > newChild = deleteRoot ( child . mask , child . children ) ; if ( newChild == null ) { int newMask = mask & ~ Int...
public class CompareAssert { /** * { @ inheritDoc } * @ see DiffBuilder # withComparisonFormatter ( ComparisonFormatter ) */ @ Override public CompareAssert withComparisonFormatter ( ComparisonFormatter formatter ) { } }
this . formatter = formatter ; diffBuilder . withComparisonFormatter ( formatter ) ; return this ;
public class JdkObsolete { /** * current method . */ private static Optional < Fix > stringBufferFix ( VisitorState state ) { } }
Tree tree = state . getPath ( ) . getLeaf ( ) ; // expect ` new StringBuffer ( ) ` if ( ! ( tree instanceof NewClassTree ) ) { return Optional . empty ( ) ; } // expect e . g . ` StringBuffer sb = new StringBuffer ( ) ; ` NewClassTree newClassTree = ( NewClassTree ) tree ; Tree parent = state . getPath ( ) . getParentP...
public class MotownCentralSystemService { /** * Converts a { @ code AuthorizationResultStatus } to a { @ code AuthorizationStatus } . Throws an assertion error is the * status is unknown . * @ param status status to convert . * @ return converted status . */ private static AuthorizationStatus convert ( Authorizat...
AuthorizationStatus result ; switch ( status ) { case ACCEPTED : result = AuthorizationStatus . ACCEPTED ; break ; case BLOCKED : result = AuthorizationStatus . BLOCKED ; break ; case EXPIRED : result = AuthorizationStatus . EXPIRED ; break ; case INVALID : result = AuthorizationStatus . INVALID ; break ; default : thr...
public class ImplicitObjectUtil { /** * Load Page Flow related implicit objects into the request . This method will set the * Page Flow itself and any available page inputs into the request . * @ param request the request * @ param pageFlow the current page flow */ public static void loadPageFlow ( ServletRequest...
if ( pageFlow != null ) request . setAttribute ( PAGE_FLOW_IMPLICIT_OBJECT_KEY , pageFlow ) ; Map map = InternalUtils . getPageInputMap ( request ) ; request . setAttribute ( PAGE_INPUT_IMPLICIT_OBJECT_KEY , map != null ? map : Collections . EMPTY_MAP ) ;
public class SloppyMath { /** * Uses floating point so that it can represent the really big numbers that come up . * @ param x Argumet to take factorial of * @ return Factorial of argument */ public static double factorial ( int x ) { } }
double result = 1.0 ; for ( int i = x ; i > 1 ; i -- ) { result *= i ; } return result ;
public class CodecUtils { /** * hex string to byte [ ] , such as " 0001 " - > [ 0,1] * @ param str hex string * @ return byte [ ] */ public static byte [ ] hex2byte ( String str ) { } }
byte [ ] bytes = str . getBytes ( ) ; if ( ( bytes . length % 2 ) != 0 ) { throw new IllegalArgumentException ( ) ; } byte [ ] b2 = new byte [ bytes . length / 2 ] ; for ( int n = 0 ; n < bytes . length ; n += 2 ) { String item = new String ( bytes , n , 2 ) ; b2 [ n / 2 ] = ( byte ) Integer . parseInt ( item , 16 ) ; ...
public class TypicalLoginAssist { @ Override public boolean rememberMe ( RememberMeLoginOpCall opLambda ) { } }
return getCookieRememberMeKey ( ) . map ( cookieKey -> { return delegateRememberMe ( cookieKey , opLambda ) ; } ) . orElse ( false ) ;
public class DatePatternConverter { /** * { @ inheritDoc } */ @ Override public void format ( final Object obj , final StringBuilder output ) { } }
if ( obj instanceof Date ) { format ( ( Date ) obj , output ) ; } super . format ( obj , output ) ;
public class NodeTypes { /** * Searches the supplied primary node type and the mixin node types for a property definition that is the best match for the * given property name , property type , and value . * This method first attempts to find a single - valued property definition with the supplied property name and ...
boolean setToEmpty = value == null ; /* * We use this flag to indicate that there was a definition encountered with the same name . If * a named definition ( or definitions - for example the same node type could define a LONG and BOOLEAN * version of the same property ) is encountered and no match is found for the ...
public class ChangeFinder { /** * 指定した値を用いて変化点スコアを算出する 。 < br > * 算出と同時に過去状態の更新も行う 。 * @ param input 指定値 * @ return 変化点スコア */ public double calculateScore ( double input ) { } }
this . pastData . addFirst ( input ) ; int dataLength = this . pastData . size ( ) ; // # # オンライン忘却アルゴリズムSDARを用いて1段階学習を行う 。 // 最尤推定値 「 μ 」 を更新する 。 this . estimatedMyu = ( 1 - this . forgetability ) * this . estimatedMyu + this . forgetability * input ; // 確率密度関数用の係数配列を更新する 。 // 算出される個数は 「 過去データの数 」 「 自己回帰モデルの次数 + 1...
public class CacheHandler { private boolean walkInvalidList ( String className , String name , String [ ] [ ] list ) { } }
boolean isInvalidCombination = false ; for ( int i = 0 ; i != list . length ; i ++ ) { if ( className . equalsIgnoreCase ( list [ i ] [ 0 ] ) ) { if ( name . equalsIgnoreCase ( list [ i ] [ 1 ] ) ) { isInvalidCombination = true ; break ; } } } return isInvalidCombination ;
public class AmazonWorkLinkClient { /** * Describes the configuration for delivering audit streams to the customer account . * @ param describeAuditStreamConfigurationRequest * @ return Result of the DescribeAuditStreamConfiguration operation returned by the service . * @ throws UnauthorizedException * You are ...
request = beforeClientExecution ( request ) ; return executeDescribeAuditStreamConfiguration ( request ) ;
public class RootDocWrapper { /** * Append an option to the doclet options . * @ param option The option to append . */ public void appendOption ( String ... option ) { } }
options = Arrays . copyOf ( options , options . length + 1 ) ; options [ options . length - 1 ] = option ;
public class CodedInput { /** * Set the maximum message size . In order to prevent malicious messages from exhausting memory or causing integer * overflows , { @ code CodedInput } limits how large a message may be . The default limit is 64MB . You should set this * limit as small as you can without harming your app...
if ( limit < 0 ) { throw new IllegalArgumentException ( "Size limit cannot be negative: " + limit ) ; } final int oldLimit = sizeLimit ; sizeLimit = limit ; return oldLimit ;
public class ScriptEditorMouseWheelHandler { /** * For some reason the parent does not get mouse wheel */ private void forward ( MouseWheelEvent e ) { } }
e = new MouseWheelEvent ( e . getComponent ( ) . getParent ( ) , e . getID ( ) , e . getWhen ( ) , e . getModifiers ( ) , e . getX ( ) , e . getY ( ) , e . getClickCount ( ) , e . isPopupTrigger ( ) , e . getScrollType ( ) , e . getScrollAmount ( ) , e . getWheelRotation ( ) ) ; Toolkit . getDefaultToolkit ( ) . getSys...