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 defaultBeanContext . getProxyTargetBean ( getBeanType ( ) , ( Qualifier < T > ) qualifier . map ( q -> Qualifiers . byAnnotation ( getAnnotationMetadata ( ) , q ) ) . orElse ( null ) ) ;
|
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 ) ; mScreenshot3DCallback = null ;
|
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 ) ) ; } else { method . setRequestEntity ( new InputStreamRequestEntity ( new ByteArrayInputStream ( getBytes ( ) ) ) ) ; } method . setRequestHeader ( "Content-type" , c . getType ( ) ) ; method . setRequestHeader ( "Title" , getTitle ( ) ) ; method . setRequestHeader ( "Slug" , getSlug ( ) ) ; getCollection ( ) . getHttpClient ( ) . executeMethod ( method ) ; if ( inputStream != null ) { inputStream . close ( ) ; } final InputStream is = method . getResponseBodyAsStream ( ) ; if ( method . getStatusCode ( ) == 200 || method . getStatusCode ( ) == 201 ) { final Entry romeEntry = Atom10Parser . parseEntry ( new InputStreamReader ( is ) , col . getHrefResolved ( ) , Locale . US ) ; BeanUtils . copyProperties ( this , romeEntry ) ; } else { throw new ProponoException ( "ERROR HTTP status-code=" + method . getStatusCode ( ) + " status-line: " + method . getStatusLine ( ) ) ; } } catch ( final IOException ie ) { throw new ProponoException ( "ERROR: saving media entry" , ie ) ; } catch ( final JDOMException je ) { throw new ProponoException ( "ERROR: saving media entry" , je ) ; } catch ( final FeedException fe ) { throw new ProponoException ( "ERROR: saving media entry" , fe ) ; } catch ( final IllegalAccessException ae ) { throw new ProponoException ( "ERROR: saving media entry" , ae ) ; } catch ( final InvocationTargetException te ) { throw new ProponoException ( "ERROR: saving media entry" , te ) ; } final Header locationHeader = method . getResponseHeader ( "Location" ) ; if ( locationHeader == null ) { LOG . warn ( "WARNING added entry, but no location header returned" ) ; } else if ( getEditURI ( ) == null ) { final List < Link > links = getOtherLinks ( ) ; final Link link = new Link ( ) ; link . setHref ( locationHeader . getValue ( ) ) ; link . setRel ( "edit" ) ; links . add ( link ) ; setOtherLinks ( links ) ; }
|
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 RequiredModelMBean as provided by the JDK
// but maybe for other ModelMBean classes as well
Boolean isAccessible = null ; Field field = null ; try { field = findField ( clazz , "managedResource" ) ; if ( field != null ) { isAccessible = field . isAccessible ( ) ; field . setAccessible ( true ) ; Object managedResource = field . get ( object ) ; anno = managedResource . getClass ( ) . getAnnotation ( JsonMBean . class ) ; } } catch ( IllegalAccessException e ) { // Ignored silently , but we tried it at least
} finally { if ( isAccessible != null ) { field . setAccessible ( isAccessible ) ; } } } return anno ;
|
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 ( ) . substring ( ++ current ) ; String className = fileName . replace ( File . separatorChar , '.' ) . substring ( 0 , fileName . length ( ) - 6 ) ; tryClass ( className ) ; } }
|
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 ( "template-" + statusCode , template ) ;
|
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 validator of the header line . Throwing
* IllegalArgumentException or other RuntimeExceptions causes the
* parsing process to short - circuit after parsing the header line ,
* with a CSVStreamException being rethrown by this code .
* @ param lineConverter
* The validator and converter of lines , based on the header line . If
* the lineChecker returns null , the line will not be passed to the
* writer .
* @ param resultConsumer
* The consumer of the checked lines .
* @ param substituteHeaders
* A substitute set of headers or null to use the headers from the
* file . If this is null the first line of the file will be used .
* @ param < T >
* The type of the results that will be created by the lineChecker
* and pushed into the writer { @ link Consumer } .
* @ throws IOException
* If an error occurred accessing the input .
* @ throws CSVStreamException
* If an error occurred validating the input . */
public static < T > void parse ( final Reader reader , final Consumer < List < String > > headersValidator , final BiFunction < List < String > , List < String > , T > lineConverter , final Consumer < T > resultConsumer , final List < String > substituteHeaders ) throws IOException , CSVStreamException { } }
|
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 . linalg . dataset . MultiDataSet # save ( OutputStream ) } . < br >
* Note : this method will also consider all files in subdirectories ( i . e . , is recursive ) .
* @ param sc Spark context
* @ param path HDFS path of the directory containing the saved DataSet objects
* @ return Results of the validation / deletion */
public static ValidationResult deleteInvalidMultiDataSets ( JavaSparkContext sc , String path ) { } }
|
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 of all the id ' s that exist in the book .
* @ throws BuildProcessingException Thrown if an unexpected error occurs during building . */
@ SuppressWarnings ( "unchecked" ) protected void validateTopicLinks ( final BuildData buildData , final Set < String > bookIdAttributes ) throws BuildProcessingException { } }
|
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 ( ) ; /* * We only to to process topics at this point and not spec topics . So check to see if the topic has all ready been
* processed . */
if ( ! processedTopics . contains ( topic . getId ( ) ) ) { processedTopics . add ( topic . getId ( ) ) ; // Get the XRef links in the topic document
final Set < String > linkIds = new HashSet < String > ( ) ; DocBookBuildUtilities . getTopicLinkIds ( doc , linkIds ) ; final List < String > invalidLinks = new ArrayList < String > ( ) ; for ( final String linkId : linkIds ) { /* * Check if the xref linkend id exists in the book . If the Tag Starts with our error syntax then we can
* ignore it */
if ( ! bookIdAttributes . contains ( linkId ) && ! linkId . startsWith ( CommonConstants . ERROR_XREF_ID_PREFIX ) ) { invalidLinks . add ( "\"" + linkId + "\"" ) ; } } // If there were any invalid links then replace the XML with an error template and add an error message .
if ( ! invalidLinks . isEmpty ( ) ) { final String xmlStringInCDATA = DocBookBuildUtilities . convertDocumentToCDATAFormattedString ( doc , getXMLFormatProperties ( ) ) ; buildData . getErrorDatabase ( ) . addError ( topic , ErrorType . INVALID_CONTENT , "The following link(s) " + CollectionUtilities . toSeperatedString ( invalidLinks , ", " ) + " don't exist. The processed XML is <programlisting>" + xmlStringInCDATA + "</programlisting>" ) ; // Find the Topic ID
final Integer topicId = topic . getTopicId ( ) ; final List < ITopicNode > buildTopics = buildData . getBuildDatabase ( ) . getTopicNodesForTopicID ( topicId ) ; for ( final ITopicNode topicNode : buildTopics ) { DocBookBuildUtilities . setTopicNodeXMLForError ( buildData , topicNode , getErrorInvalidValidationTopicTemplate ( ) . getValue ( ) ) ; } } } }
|
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
* tag is a key - value pair .
* @ return Returns a reference to this object so that method calls can be chained together . */
public BackupRuleInput withRecoveryPointTags ( java . util . Map < String , String > recoveryPointTags ) { } }
|
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 { throw new CertificateException ( "The alias [" + alias + "] is not an instance of SecretKey" ) ; } } catch ( CertificateException e ) { throw e ; } catch ( KeyStoreException e ) { throw e ; } catch ( Exception e ) { throw new KeyStoreException ( "Unexpected error while loading the requested secret key for alias [" + alias + "] from keystore: " + keyStoreName , e ) ; }
|
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 ( Source source , JstlUriResolver uriResolver ) throws TransformerConfigurationException { } }
|
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 new TransformerConfigurationException ( "newTransformer returned null. XSLT may be invalid." ) ; } return transformer ;
|
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 三者一定要与集群中其它节点保持一致 ,
* 以免程序出现不一致行为
* < / pre > */
public static void useAsDataTransfer ( Dialect dialect , IContainerFactory containerFactory , ICache cache ) { } }
|
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 = new ActiveRecordPlugin ( new NullDataSource ( ) ) ; arp . setDialect ( dialect ) ; arp . setContainerFactory ( containerFactory ) ; arp . setCache ( cache ) ; arp . start ( ) ; DbKit . brokenConfig = arp . config ;
|
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 use with the the service
* account flow or { @ code null } if not .
* @ return valid credentials or { @ code null } */
public static Credential getServiceAccountCredential ( String serviceAccountId , String privateKeyFile , Collection < String > serviceAccountScopes ) throws GeneralSecurityException , IOException { } }
|
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 ) { long millis = record . getMillis ( ) ; return String . format ( "[%tF %<tT.%<tL]%s%n" , millis , record . getMessage ( ) ) ; } } ; ConsoleHandler handler = new ConsoleHandler ( ) ; handler . setFormatter ( formatter ) ; logger . addHandler ( handler ) ; if ( loggerEnabled ) { logger . setLevel ( Level . INFO ) ; } else { logger . setLevel ( Level . OFF ) ; } return logger ;
|
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 ) ; } m_objCurrentPhysicalRecord = NONE ; m_objCurrentLockedRecord = NONE ; m_objCurrentCacheRecord = NONE ;
|
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 ( ) ) ; nodeTypeData . accept ( removeVisitor ) ; PlainChangesLog changesLog = new PlainChangesLogImpl ( ) ; changesLog . addAll ( removeVisitor . getRemovedStates ( ) ) ; dataManager . save ( new TransactionChangesLog ( changesLog ) ) ;
|
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 void populateResponse ( final ModelNode response , final ServiceController < ? > serviceController ) { } }
|
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 ( final String planCode , final AddOn addOn ) { } }
|
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 . */
@ Nullable public static < KEYTYPE , ENUMTYPE extends Enum < ENUMTYPE > & IHasID < KEYTYPE > > ENUMTYPE getFromIDOrNull ( @ Nonnull final Class < ENUMTYPE > aClass , @ Nullable final KEYTYPE aID ) { } }
|
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 fromPackagist ( String name ) throws Exception { } }
|
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 ( deployedModule . getVirtualHostName ( ) ) ; if ( vHost == null ) throw new WebAppHostNotFoundException ( "VirtualHost not found" ) ; vHost . removeWebApplication ( deployedModule ) ; } catch ( Exception e ) { logger . logp ( Level . SEVERE , CLASS_NAME , "removeWebApplication" , "Exception" , new Object [ ] { e } ) ; /* 283348.1 */
throw e ; }
|
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 value of any pixel in the image . Set to < 0 if not known .
* @ param output
* @ return visualized gradient */
public static BufferedImage colorizeGradient ( ImageGray derivX , ImageGray derivY , double maxAbsValue , BufferedImage output ) { } }
|
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 IllegalArgumentException ( "Image type not supported" ) ; }
|
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 ( ) ) ; // anything other than an OK response earns an exception
if ( rsp . code != 210 /* OK , entry follows */
) { throw new CDDBException ( rsp . code , rsp . message ) ; } Detail detail = new Detail ( ) ; // parse the category and discid from the response string
int sidx = rsp . message . indexOf ( " " ) ; if ( sidx == - 1 ) { throw new CDDBException ( 500 , "Malformed read response: " + rsp . message ) ; } detail . category = rsp . message . substring ( 0 , sidx ) ; detail . discid = rsp . message . substring ( sidx + 1 ) ; ArrayList < String > tnames = new ArrayList < String > ( ) ; ArrayList < String > texts = new ArrayList < String > ( ) ; // now parse the contents
String input = _in . readLine ( ) ; for ( int lno = 0 ; ! input . equals ( CDDBProtocol . TERMINATOR ) ; lno ++ ) { if ( input . startsWith ( "#" ) ) { // skip comments
} else if ( input . startsWith ( "DTITLE" ) ) { if ( detail . title == null ) { detail . title = contents ( input , lno ) ; } else { detail . title += contents ( input , lno ) ; } } else if ( input . startsWith ( "DYEAR" ) ) { String yearStr = contents ( input , lno ) ; try { detail . year = Integer . parseInt ( yearStr ) ; } catch ( NumberFormatException nfEx ) { detail . year = - 1 ; } } else if ( input . startsWith ( "DGENRE" ) ) { if ( detail . genre == null ) { detail . genre = contents ( input , lno ) ; } else { detail . genre += contents ( input , lno ) ; } } else if ( input . startsWith ( "EXTD" ) ) { if ( detail . extendedData == null ) { detail . extendedData = contents ( input , lno ) ; } else { detail . extendedData += contents ( input , lno ) ; } } else if ( input . startsWith ( "TTITLE" ) ) { append ( tnames , index ( input , "TTITLE" , lno ) , contents ( input , lno ) ) ; } else if ( input . startsWith ( "EXTT" ) ) { append ( texts , index ( input , "EXTT" , lno ) , contents ( input , lno ) ) ; } // read in the next line of input
input = _in . readLine ( ) ; } // convert the lists into arrays
detail . trackNames = new String [ tnames . size ( ) ] ; tnames . toArray ( detail . trackNames ) ; detail . extendedTrackData = new String [ texts . size ( ) ] ; texts . toArray ( detail . extendedTrackData ) ; return detail ;
|
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 getOptionString ( String optName ) { } }
|
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 . substring ( matcher . start ( ) , i ) : null ; if ( url == null || ( ! mojo . isExcluded ( url ) && getTransform ( url ) != null ) ) { matcher . appendReplacement ( sb , newPath ) ; } } matcher . appendTail ( sb ) ; return sb . toString ( ) ;
|
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 points , so will
* always be zero meters .
* @ param stepPoints representing the step geometry
* @ param intersections along the step to be measured
* @ return list of measured intersection pairs
* @ since 0.13.0 */
@ NonNull public static List < Pair < StepIntersection , Double > > createDistancesToIntersections ( List < Point > stepPoints , List < StepIntersection > intersections ) { } }
|
boolean lessThanTwoStepPoints = stepPoints . size ( ) < TWO_POINTS ; boolean noIntersections = intersections . isEmpty ( ) ; if ( lessThanTwoStepPoints || noIntersections ) { return Collections . emptyList ( ) ; } LineString stepLineString = LineString . fromLngLats ( stepPoints ) ; Point firstStepPoint = stepPoints . get ( FIRST_POINT ) ; List < Pair < StepIntersection , Double > > distancesToIntersections = new ArrayList < > ( ) ; for ( StepIntersection intersection : intersections ) { Point intersectionPoint = intersection . location ( ) ; if ( firstStepPoint . equals ( intersectionPoint ) ) { distancesToIntersections . add ( new Pair < > ( intersection , ZERO_METERS ) ) ; } else { LineString beginningLineString = TurfMisc . lineSlice ( firstStepPoint , intersectionPoint , stepLineString ) ; double distanceToIntersectionInMeters = TurfMeasurement . length ( beginningLineString , TurfConstants . UNIT_METERS ) ; distancesToIntersections . add ( new Pair < > ( intersection , distanceToIntersectionInMeters ) ) ; } } return distancesToIntersections ;
|
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 plugin functions , { @ link
* com . google . template . soy . jssrc . internal . TranslateExprNodeVisitor # visitFunctionNode } needs to
* downgrade the plugin arguments from CodeChunk . WithValues to { @ link JsExpr } s for the plugin API
* to process . The result ( a JsExpr ) needs to be upgraded back to a CodeChunk . Expression that
* includes the initial statements from the original arguments . */
public final Expression withInitialStatements ( Iterable < ? extends Statement > initialStatements ) { } }
|
// 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 { @ link JsonWriter } as the one passed in .
* @ throws java . io . IOException When fails to encode the schema into json . */
private JsonWriter write ( JsonWriter writer , Schema schema , Set < String > knownRecords ) throws IOException { } }
|
// 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 unionSchema : schema . getUnionSchemas ( ) ) { write ( writer , unionSchema , knownRecords ) ; } return writer . endArray ( ) ; } // If it is a record that refers to a previously defined record , just emit the name of it
if ( schema . getType ( ) == Schema . Type . RECORD && knownRecords . contains ( schema . getRecordName ( ) ) ) { return writer . value ( schema . getRecordName ( ) ) ; } // Complex types , represented as an object with " type " property carrying the type name
writer . beginObject ( ) . name ( "type" ) . value ( schema . getType ( ) . name ( ) . toLowerCase ( ) ) ; switch ( schema . getType ( ) ) { case ENUM : // Emits all enum values as an array , keyed by " symbols "
writer . name ( "symbols" ) . beginArray ( ) ; for ( String enumValue : schema . getEnumValues ( ) ) { writer . value ( enumValue ) ; } writer . endArray ( ) ; break ; case ARRAY : // Emits the schema of the array component type , keyed by " items "
write ( writer . name ( "items" ) , schema . getComponentSchema ( ) , knownRecords ) ; break ; case MAP : // Emits schema of both key and value types , keyed by " keys " and " values " respectively
Map . Entry < Schema , Schema > mapSchema = schema . getMapSchema ( ) ; write ( writer . name ( "keys" ) , mapSchema . getKey ( ) , knownRecords ) ; write ( writer . name ( "values" ) , mapSchema . getValue ( ) , knownRecords ) ; break ; case RECORD : // Emits the name of record , keyed by " name "
knownRecords . add ( schema . getRecordName ( ) ) ; writer . name ( "name" ) . value ( schema . getRecordName ( ) ) . name ( "fields" ) . beginArray ( ) ; // Each field is an object , with field name keyed by " name " and field schema keyed by " type "
for ( Schema . Field field : schema . getFields ( ) ) { writer . beginObject ( ) . name ( "name" ) . value ( field . getName ( ) ) ; write ( writer . name ( "type" ) , field . getSchema ( ) , knownRecords ) ; writer . endObject ( ) ; } writer . endArray ( ) ; break ; } writer . endObject ( ) ; return writer ;
|
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 ) public JSONObject delete ( String path , JSONObject content , Map < String , String > headers ) throws ServiceException , JSONException { } }
|
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 ) ; userServices . deleteUser ( cuid ) ; } else if ( rel . equals ( "workgroups" ) ) { String group = getSegment ( path , 3 ) ; userServices . removeUserFromWorkgroup ( cuid , group ) ; } else if ( rel . equals ( "roles" ) ) { String role = getSegment ( path , 3 ) ; userServices . removeUserFromRole ( cuid , role ) ; } } catch ( DataAccessException ex ) { throw new ServiceException ( HTTP_500_INTERNAL_ERROR , ex . getMessage ( ) , ex ) ; } return null ;
|
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 should be considered when adding support for a new java version
if ( JAVA_VERSION . isKnown ( ) && ! isUserEnabledJavaVersion ( ) && ( JAVA_VERSION . getMajor ( ) < 7 || JAVA_VERSION . getMajor ( ) > 12 ) ) { System . err . println ( "Only Java 7, 8, 9, 10, 11 and 12 are supported, system version is " + System . getProperty ( "java.version" ) ) ; return true ; } String vmName = System . getProperty ( "java.vm.name" ) ; if ( vmName != null && vmName . equals ( "GNU libgcj" ) ) { System . err . println ( "GNU gcj is not supported" ) ; return true ; } return false ;
|
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 which have been heard from recently enough to be considered present on the network
* @ throws IllegalStateException if the { @ code DeviceFinder } is not active */
public Set < DeviceAnnouncement > getCurrentDevices ( ) { } }
|
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 > ( devices . values ( ) ) ) ;
|
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 queuePointLocalizingMEs */
public void createDestination ( DestinationDefinition destinationDefinition , Set < String > queuePointLocalizingMEs ) throws SIResourceException , SIIncorrectCallException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createDestination" , new Object [ ] { destinationDefinition , queuePointLocalizingMEs } ) ; // Try to create the local destination .
try { createRemoteDestination ( destinationDefinition , queuePointLocalizingMEs ) ; } catch ( SIIncorrectCallException e ) { // No FFDC code needed
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createDestination" , e ) ; throw e ; } catch ( RuntimeException e ) { // FFDC
FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.DestinationManager.createDestination" , "1:4910:1.508.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "createDestination" , e ) ; } throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createDestination" ) ;
|
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 unit the unit to use for time , null to wait indefinitely
* @ return a resource taken from the pool , or null if the operation times out */
@ Override @ Nullable public T acquire ( long time , TimeUnit unit ) { } }
|
// 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 . poll ( ) ; if ( resource != null ) { return resource ; } if ( mCurrentCapacity . getAndIncrement ( ) < mMaxCapacity ) { // If the resource pool is empty but capacity is not yet full , create a new resource .
return createNewResource ( ) ; } mCurrentCapacity . decrementAndGet ( ) ; // Otherwise , try to take a resource from the pool , blocking if none are available .
try { mTakeLock . lockInterruptibly ( ) ; try { while ( true ) { resource = mResources . poll ( ) ; if ( resource != null ) { return resource ; } if ( time > 0 ) { long currTimeMs = System . currentTimeMillis ( ) ; // one should use t1 - t0 < 0 , not t1 < t0 , because of the possibility of numerical overflow .
// For further detail see : https : / / docs . oracle . com / javase / 8 / docs / api / java / lang / System . html
if ( endTimeMs - currTimeMs <= 0 ) { return null ; } if ( ! mNotEmpty . await ( endTimeMs - currTimeMs , TimeUnit . MILLISECONDS ) ) { return null ; } } else { mNotEmpty . await ( ) ; } } } finally { mTakeLock . unlock ( ) ; } } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new RuntimeException ( e ) ; }
|
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 its content is deleted when the JVM starts its shutting down sequence .
* @ return A { @ link OkHttpClient } instance that can be used everywhere in the application . */
private static OkHttpClient client ( ) { } }
|
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.http2.cache-size" ) ; final long cacheSize = CACHE_SIZE_RANGE . contains ( tmp ) ? tmp : CACHE_SIZE_RANGE . lowerEndpoint ( ) ; // create the cache directory
final File cacheDir = createTempDirectory ( "coreutils-okhttp-cache-" , asFileAttribute ( fromString ( "rwx------" ) ) ) . toFile ( ) ; final Http2ClientShutdownListener shutdownListener = new Http2ClientShutdownListener ( cacheDir ) ; COREUTILS_CONTEXT . addShutdownListener ( shutdownListener , Http2ClientShutdownListener . class , "coreutils-fiber" ) ; final Cache cache = new Cache ( cacheDir , cacheSize ) ; client . setCache ( cache ) ; } catch ( IOException e ) { LOGGER . error ( "Failed to create directory cache" , e ) ; } return client ; } ) ;
|
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 > trustStoreFilePath = / path / to / trust / store
* < br > trustStorePassword = password
* Http configurations ( see { @ link HttpClientFactory } ) like http . responseMaxSize , http . idleTimeout , etc , can
* be set as :
* < br > properties . http . responseMaxSize = 10000
* < br > properties . http . idleTimeout = 3000
* A sample configuration for a secured d2 client is :
* < br > d2 . zkHosts = zk1 . host . com : 12000
* < br > d2 . ssl = true
* < br > d2 . keyStoreFilePath = / path / to / key / store
* < br > d2 . keyStorePassword = password
* < br > d2 . keyStoreType = PKCS12
* < br > d2 . trustStoreFilePath = / path / to / trust / store
* < br > d2 . trustStorePassword = password
* Http configurations ( see { @ link HttpClientFactory } ) like http . responseMaxSize , http . idleTimeout , etc , can
* be set as :
* < br > d2 . clientServicesConfig . [ client _ name ] . http . responseMaxSize = 10000
* < br > d2 . clientServicesConfig . [ client _ name ] . http . idleTimeout = 3000
* @ param srcConfig configuration
* @ return an instance of { @ link Client } */
public Client createInstance ( Config srcConfig ) { } }
|
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 ) ; } else { throw new ConfigException . Missing ( confPrefix ) ; } default : throw new RuntimeException ( "Schema not supported: " + schema . name ( ) ) ; }
|
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 ) throws IOException { } }
|
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 . lang . String ,
* com . abubusoft . kripton . processor . sharedprefs . model . PrefsProperty ) */
@ Override public void generateWriteProperty ( Builder methodBuilder , String editorName , TypeName beanClass , String beanName , PrefsProperty property ) { } }
|
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).toData(" , PrefsTypeAdapterUtils . class , TypeUtility . typeName ( property . typeAdapter . adapterClazz ) ) ; } methodBuilder . addCode ( PREFS_CONVERT + "$L" , getter ( beanName , beanClass , property ) ) ; if ( property . hasTypeAdapter ( ) ) { methodBuilder . addCode ( ")" ) ; } methodBuilder . addCode ( ");\n" ) ; if ( nullable ) { methodBuilder . endControlFlow ( ) ; }
|
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 # TextView _ minWidth */
@ TargetApi ( Build . VERSION_CODES . JELLY_BEAN ) public int getMinWidth ( ) { } }
|
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 ) ; } FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "148" , this , new Object [ ] { vc } ) ; throw new RuntimeException ( e ) ; } } SSLConnectionLink link = new SSLConnectionLink ( this ) ; // Initialize appropriate fields .
link . init ( vc ) ; return link ;
|
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 represents the datasource object being retrieved
* @ return The object to be stored in the attribute
* @ throws CpoException */
@ Override public char [ ] transformIn ( Clob clob ) throws CpoException { } }
|
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 ( ) ; retChars = caw . toCharArray ( ) ; } catch ( Exception e ) { logger . debug ( "Error in transform clob" , e ) ; throw new CpoException ( e ) ; } } return retChars ;
|
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
return Integer . parseInt ( dateStr . substring ( 20 ) ) * 10 ; } else if ( length >= 23 && length <= 26 ) { // "1999-12-31 12:34:56.123 " ~ " 1999-12-31 12:34:56.123456"
return Integer . parseInt ( dateStr . substring ( 20 , 23 ) ) * 10 ; } else { return 0 ; }
|
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 . list ( System . getProperties ( ) . keys ( ) ) ) { final String name = String . valueOf ( property ) ; if ( name . startsWith ( JnlpPage . JNLP_PREFIX ) ) { final String value = System . getProperty ( name ) ; System . setProperty ( name . substring ( JnlpPage . JNLP_PREFIX . length ( ) ) , value ) ; } } initLookAndFeel ( ) ; // une touche bleu - clair pour avoir une teinte moins grisatre
UIManager . put ( "control" , new Color ( 225 , 225 , 250 ) ) ; ShadowPopupFactory . install ( ) ; MSwingUtilities . initEscapeClosesDialogs ( ) ; // on définit le répertoire courant , car par exemple dans JavaWebStart il n ' est pas bon par défaut
System . setProperty ( "user.dir" , System . getProperty ( "user.home" ) ) ; Thread . setDefaultUncaughtExceptionHandler ( new UncaughtExceptionHandler ( ) { @ Override public void uncaughtException ( Thread t , Throwable e ) { MSwingUtilities . showException ( e ) ; } } ) ; SwingUtilities . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { try { // affichage de la frame dans le thread AWT
showFrame ( ) ; } catch ( final Throwable t ) { // NOPMD
MSwingUtilities . showException ( t ) ; exit ( ) ; } } } ) ;
|
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 declared in this class it will look for the
* method in the super class . This will continue throughout the whole class
* hierarchy . If the method is not found an { @ link IllegalArgumentException }
* is thrown .
* @ param type
* The type of the class where the method is located .
* @ param methodName
* The method names .
* @ param parameterTypes
* All parameter types of the method ( may be { @ code null } ) .
* @ return A { @ code java . lang . reflect . Method } .
* @ throws MethodNotFoundException
* If a method cannot be found in the hierarchy . */
public static Method getMethod ( Class < ? > type , String methodName , Class < ? > ... parameterTypes ) { } }
|
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 creating the { @ link SequenceFile } or
* { @ link org . apache . hadoop . mapred . SequenceFileOutputFormat # setOutputCompressionType ( org . apache . hadoop . mapred . JobConf , org . apache . hadoop . io . SequenceFile . CompressionType ) }
* to specify the { @ link CompressionType } for job - outputs .
* or */
@ Deprecated static public void setCompressionType ( Configuration job , CompressionType val ) { } }
|
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 ] }
* @ param accessors Accessors configuration .
* @ param fieldName the name of the field .
* @ param isBoolean if the field is of type ' boolean ' . For fields of type ' java . lang . Boolean ' , you should provide { @ code false } . */
public static List < String > toAllGetterNames ( AST < ? , ? , ? > ast , AnnotationValues < Accessors > accessors , CharSequence fieldName , boolean isBoolean ) { } }
|
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 CPDefinitionVirtualSetting removeByUUID_G ( String uuid , long groupId ) throws NoSuchCPDefinitionVirtualSettingException { } }
|
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
* @ param typeReference
* @ param < T >
* @ return */
public static < T > T getAggBuckets ( Map < String , ? > map , String metrics , Class < T > typeReference ) { } }
|
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 , int y ) throws ArithmeticException { } }
|
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 certificate
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the CertificateDescriptionInner object */
public Observable < ServiceResponse < CertificateDescriptionInner > > createOrUpdateWithServiceResponseAsync ( String resourceGroupName , String resourceName , String certificateName ) { } }
|
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 ( resourceName == null ) { throw new IllegalArgumentException ( "Parameter resourceName is required and cannot be null." ) ; } if ( certificateName == null ) { throw new IllegalArgumentException ( "Parameter certificateName is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } final String ifMatch = null ; final String certificate = null ; CertificateBodyDescription certificateDescription = new CertificateBodyDescription ( ) ; certificateDescription . withCertificate ( null ) ; return service . createOrUpdate ( this . client . subscriptionId ( ) , resourceGroupName , resourceName , certificateName , this . client . apiVersion ( ) , ifMatch , this . client . acceptLanguage ( ) , certificateDescription , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < CertificateDescriptionInner > > > ( ) { @ Override public Observable < ServiceResponse < CertificateDescriptionInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < CertificateDescriptionInner > clientResponse = createOrUpdateDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
|
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 Control the behavior for existing files . Options are NO _ OVERWRITE and OVERWRITE .
* @ param formatter formatter that is applied on every element of the DataSet .
* @ return The DataSink that writes the DataSet .
* @ see TextOutputFormat
* @ see DataSet # writeAsText ( String ) Output files and directories */
public DataSink < String > writeAsFormattedText ( String filePath , WriteMode writeMode , TextFormatter < T > formatter ) { } }
|
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 database access error occurs
* ( JDBC4 Clarification : )
* or this method is called on a closed connection */
public synchronized boolean isReadOnly ( ) throws SQLException { } }
|
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 , sourceSpliterator ( terminalOp . getOpFlags ( ) ) ) ;
|
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 . getParameters ( ) , PARAMETERS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
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 ) { PieModel model = mPieData . get ( i ) ; if ( model . getStartAngle ( ) <= pointerAngle && pointerAngle <= model . getEndAngle ( ) ) { if ( i != mCurrentItem ) { setCurrentItem ( i , false ) ; } break ; } }
|
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 Schematron schema
* @ param phase
* the phase in the fedora object lifecycle to which validation
* should pertain . ( Currently options are " ingest " and " store " )
* @ return StreamSource
* @ throws ObjectValidityException */
private Templates setUp ( String preprocessorPath , String fedoraschemaPath , String phase ) throws ObjectValidityException , TransformerException { } }
|
String key = fedoraschemaPath + "#" + phase ; Templates templates = generatedStyleSheets . get ( key ) ; if ( templates == null ) { rulesSource = fileToStreamSource ( fedoraschemaPath ) ; preprocessorSource = fileToStreamSource ( preprocessorPath ) ; templates = createValidatingStyleSheet ( rulesSource , preprocessorSource , phase ) ; generatedStyleSheets . put ( key , templates ) ; } return templates ;
|
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 windows is buffered until the window
* is evaluated , as the function provides no means of incremental aggregation .
* @ param function The window function .
* @ return The data stream that is the result of applying the window function to the window . */
public < R > SingleOutputStreamOperator < R > apply ( AllWindowFunction < T , R , W > function ) { } }
|
String callLocation = Utils . getCallLocationName ( ) ; function = input . getExecutionEnvironment ( ) . clean ( function ) ; TypeInformation < R > resultType = getAllWindowFunctionReturnType ( function , getInputType ( ) ) ; return apply ( new InternalIterableAllWindowFunction < > ( function ) , resultType , callLocation ) ;
|
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 & ~ Integer . lowestOneBit ( mask ) ; return new HamtPMap < > ( child . key , newHash , child . value , newMask , deleteChild ( children , 0 ) ) ; } else { return new HamtPMap < > ( child . key , newHash , child . value , mask , replaceChild ( children , 0 , newChild ) ) ; }
|
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 ( ) . getParentPath ( ) . getLeaf ( ) ; if ( ! ( parent instanceof VariableTree ) ) { return Optional . empty ( ) ; } VariableTree varTree = ( VariableTree ) parent ; VarSymbol varSym = ASTHelpers . getSymbol ( varTree ) ; TreePath methodPath = findEnclosingMethod ( state ) ; if ( methodPath == null ) { return Optional . empty ( ) ; } // Expect all uses to be of the form ` sb . < method > ` ( append , toString , etc . )
// We don ' t want to refactor StringBuffers that escape the current method .
// Use an array to get a boxed boolean that we can update in the anonymous class .
boolean [ ] escape = { false } ; new TreePathScanner < Void , Void > ( ) { @ Override public Void visitIdentifier ( IdentifierTree tree , Void unused ) { if ( varSym . equals ( ASTHelpers . getSymbol ( tree ) ) ) { Tree parent = getCurrentPath ( ) . getParentPath ( ) . getLeaf ( ) ; if ( parent == varTree ) { // the use of the variable in its declaration gets a pass
return null ; } // the LHS of a select ( e . g . in ` sb . append ( . . . ) ` ) does not escape
if ( ! ( parent instanceof MemberSelectTree ) || ( ( MemberSelectTree ) parent ) . getExpression ( ) != tree ) { escape [ 0 ] = true ; } } return null ; } } . scan ( methodPath , null ) ; if ( escape [ 0 ] ) { return Optional . empty ( ) ; } return Optional . of ( SuggestedFix . builder ( ) . replace ( newClassTree . getIdentifier ( ) , "StringBuilder" ) . replace ( varTree . getType ( ) , "StringBuilder" ) . build ( ) ) ;
|
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 ( AuthorizationResultStatus status ) { } }
|
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 : throw new AssertionError ( "AuthorizationResultStatus has unknown status: " + status ) ; } return result ;
|
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 request , PageFlowController pageFlow ) { } }
|
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 ) ; } return b2 ;
|
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
* { @ link Value # getType ( ) value ' s property type } in the primary type , skipping any property definitions that are protected .
* The property definition is returned if it has a matching type ( or has an { @ link PropertyType # UNDEFINED undefined property
* type } ) and the value satisfies the { @ link PropertyDefinition # getValueConstraints ( ) definition ' s constraints } . Otherwise ,
* the process continues with each of the mixin types , in the order they are named .
* If no matching property definition could be found ( and < code > checkMultiValuedDefinitions < / code > parameter is
* < code > true < / code > ) , the process is repeated except with multi - valued property definitions with the same name , property
* type , and compatible constraints , starting with the primary type and continuing with each mixin type .
* If no matching property definition could be found , and the process repeats by searching the primary type ( and then mixin
* types ) for single - valued property definitions with a compatible type , where the values can be safely cast to the
* definition ' s property type and still satisfy the definition ' s constraints .
* If no matching property definition could be found , the previous step is repeated with multi - valued property definitions .
* If no matching property definition could be found ( and the supplied property name is not the residual name ) , the whole
* process repeats for residual property definitions ( e . g . , those that are defined with a { @ link JcrNodeType # RESIDUAL _ NAME " * "
* name } ) .
* Finally , if no satisfactory property definition could be found , this method returns null .
* @ param session the session in which the constraints are to be checked ; may not be null
* @ param primaryTypeName the name of the primary type ; may not be null
* @ param mixinTypeNames the names of the mixin types ; may be null or empty if there are no mixins to include in the search
* @ param propertyName the name of the property for which the definition should be retrieved . This method will automatically
* look for residual definitions , but you can use { @ link JcrNodeType # RESIDUAL _ ITEM _ NAME } to retrieve only the best
* residual property definition ( if any ) .
* @ param value the value , or null if the property is being removed
* @ param checkMultiValuedDefinitions true if the type ' s multi - valued property definitions should be considered , or false if
* only single - value property definitions should be considered
* @ param skipProtected true if this operation is being done from within the public JCR node and property API , or false if
* this operation is being done from within internal implementations
* @ param checkTypeAndConstraints true if the type and constraints of the property definition should be checked , or false
* otherwise
* @ return the best property definition , or < code > null < / code > if no property definition allows the property with the supplied
* name , type and number of values */
JcrPropertyDefinition findPropertyDefinition ( JcrSession session , Name primaryTypeName , Collection < Name > mixinTypeNames , Name propertyName , Value value , boolean checkMultiValuedDefinitions , boolean skipProtected , boolean checkTypeAndConstraints ) { } }
|
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 name , then processing should not
* proceed . If processing did proceed , a residual definition might be found and matched . This would
* lead to a situation where a node defined a type for a named property , but contained a property with
* the same name and the wrong type . */
boolean matchedOnName = false ; // Look for a single - value property definition on the primary type that matches by name and type . . .
JcrNodeType primaryType = getNodeType ( primaryTypeName ) ; if ( primaryType != null ) { for ( JcrPropertyDefinition definition : primaryType . allSingleValuePropertyDefinitions ( propertyName ) ) { matchedOnName = true ; // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; if ( setToEmpty ) { if ( ! definition . isMandatory ( ) ) return definition ; // Otherwise this definition doesn ' t work , so continue with the next . . .
continue ; } assert value != null ; // We can use the definition if it matches the type and satisfies the constraints . . .
int type = definition . getRequiredType ( ) ; // Don ' t check constraints on reference properties
if ( type == PropertyType . REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . WEAKREFERENCE && type == value . getType ( ) ) return definition ; if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . UNDEFINED || type == value . getType ( ) ) { if ( ! checkTypeAndConstraints ) return definition ; if ( definition . satisfiesConstraints ( value , session ) ) return definition ; } } if ( matchedOnName ) { if ( value != null ) { for ( JcrPropertyDefinition definition : primaryType . allSingleValuePropertyDefinitions ( propertyName ) ) { // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; // Don ' t check constraints on reference properties
int type = definition . getRequiredType ( ) ; if ( type == PropertyType . REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == PropertyType . WEAKREFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( ! checkTypeAndConstraints ) return definition ; if ( definition . canCastToTypeAndSatisfyConstraints ( value , session ) ) return definition ; } } if ( checkMultiValuedDefinitions ) { // Look for a multi - value property definition on the primary type that matches by name and type . . .
for ( JcrPropertyDefinition definition : primaryType . allMultiValuePropertyDefinitions ( propertyName ) ) { // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; if ( setToEmpty ) { if ( ! definition . isMandatory ( ) ) return definition ; // Otherwise this definition doesn ' t work , so continue with the next . . .
continue ; } assert value != null ; // We can use the definition if it matches the type and satisfies the constraints . . .
int type = definition . getRequiredType ( ) ; // Don ' t check constraints on reference properties
if ( type == PropertyType . REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . WEAKREFERENCE && type == value . getType ( ) ) return definition ; if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . UNDEFINED || type == value . getType ( ) ) { if ( ! checkTypeAndConstraints ) return definition ; if ( definition . satisfiesConstraints ( value , session ) ) return definition ; } } if ( value != null ) { for ( JcrPropertyDefinition definition : primaryType . allMultiValuePropertyDefinitions ( propertyName ) ) { // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; assert definition . getRequiredType ( ) != PropertyType . UNDEFINED ; // Don ' t check constraints on reference properties
int type = definition . getRequiredType ( ) ; if ( type == PropertyType . REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == PropertyType . WEAKREFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( ! checkTypeAndConstraints ) return definition ; if ( definition . canCastToTypeAndSatisfyConstraints ( value , session ) ) return definition ; } } } return null ; } } // Look for a single - value property definition on the mixin types that matches by name and type . . .
List < JcrNodeType > mixinTypes = null ; if ( mixinTypeNames != null ) { mixinTypes = new LinkedList < JcrNodeType > ( ) ; for ( Name mixinTypeName : mixinTypeNames ) { JcrNodeType mixinType = getNodeType ( mixinTypeName ) ; if ( mixinType == null ) continue ; mixinTypes . add ( mixinType ) ; for ( JcrPropertyDefinition definition : mixinType . allSingleValuePropertyDefinitions ( propertyName ) ) { matchedOnName = true ; // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; if ( setToEmpty ) { if ( ! definition . isMandatory ( ) ) return definition ; // Otherwise this definition doesn ' t work , so continue with the next . . .
continue ; } assert value != null ; // We can use the definition if it matches the type and satisfies the constraints . . .
int type = definition . getRequiredType ( ) ; // Don ' t check constraints on reference properties
if ( type == PropertyType . REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . WEAKREFERENCE && type == value . getType ( ) ) return definition ; if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . UNDEFINED || type == value . getType ( ) ) { if ( ! checkTypeAndConstraints ) return definition ; if ( definition . satisfiesConstraints ( value , session ) ) return definition ; } } if ( matchedOnName ) { if ( value != null ) { for ( JcrPropertyDefinition definition : mixinType . allSingleValuePropertyDefinitions ( propertyName ) ) { // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; assert definition . getRequiredType ( ) != PropertyType . UNDEFINED ; // Don ' t check constraints on reference properties
int type = definition . getRequiredType ( ) ; if ( type == PropertyType . REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == PropertyType . WEAKREFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( ! checkTypeAndConstraints ) return definition ; if ( definition . canCastToTypeAndSatisfyConstraints ( value , session ) ) return definition ; } } if ( checkMultiValuedDefinitions ) { for ( JcrPropertyDefinition definition : mixinType . allMultiValuePropertyDefinitions ( propertyName ) ) { // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; if ( setToEmpty ) { if ( ! definition . isMandatory ( ) ) return definition ; // Otherwise this definition doesn ' t work , so continue with the next . . .
continue ; } assert value != null ; // We can use the definition if it matches the type and satisfies the constraints . . .
int type = definition . getRequiredType ( ) ; // Don ' t check constraints on reference properties
if ( type == PropertyType . REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . WEAKREFERENCE && type == value . getType ( ) ) return definition ; if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . UNDEFINED || type == value . getType ( ) ) { if ( ! checkTypeAndConstraints ) return definition ; if ( definition . satisfiesConstraints ( value , session ) ) return definition ; } } if ( value != null ) { for ( JcrPropertyDefinition definition : mixinType . allMultiValuePropertyDefinitions ( propertyName ) ) { matchedOnName = true ; // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; assert definition . getRequiredType ( ) != PropertyType . UNDEFINED ; // Don ' t check constraints on reference properties
int type = definition . getRequiredType ( ) ; if ( type == PropertyType . REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == PropertyType . WEAKREFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( ! checkTypeAndConstraints ) return definition ; if ( definition . canCastToTypeAndSatisfyConstraints ( value , session ) ) return definition ; } } } return null ; } } } if ( checkMultiValuedDefinitions ) { if ( primaryType != null ) { // Look for a multi - value property definition on the primary type that matches by name and type . . .
for ( JcrPropertyDefinition definition : primaryType . allMultiValuePropertyDefinitions ( propertyName ) ) { matchedOnName = true ; // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; if ( setToEmpty ) { if ( ! definition . isMandatory ( ) ) return definition ; // Otherwise this definition doesn ' t work , so continue with the next . . .
continue ; } assert value != null ; // We can use the definition if it matches the type and satisfies the constraints . . .
int type = definition . getRequiredType ( ) ; // Don ' t check constraints on reference properties
if ( type == PropertyType . REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . WEAKREFERENCE && type == value . getType ( ) ) return definition ; if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . UNDEFINED || type == value . getType ( ) ) { if ( ! checkTypeAndConstraints ) return definition ; if ( definition . satisfiesConstraints ( value , session ) ) return definition ; } } if ( value != null ) { for ( JcrPropertyDefinition definition : primaryType . allMultiValuePropertyDefinitions ( propertyName ) ) { matchedOnName = true ; // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; assert definition . getRequiredType ( ) != PropertyType . UNDEFINED ; // Don ' t check constraints on reference properties
int type = definition . getRequiredType ( ) ; if ( type == PropertyType . REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == PropertyType . WEAKREFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( ! checkTypeAndConstraints ) return definition ; if ( definition . canCastToTypeAndSatisfyConstraints ( value , session ) ) return definition ; } } } if ( matchedOnName ) return null ; if ( mixinTypeNames != null ) { mixinTypes = new LinkedList < JcrNodeType > ( ) ; for ( Name mixinTypeName : mixinTypeNames ) { JcrNodeType mixinType = getNodeType ( mixinTypeName ) ; if ( mixinType == null ) continue ; mixinTypes . add ( mixinType ) ; for ( JcrPropertyDefinition definition : mixinType . allMultiValuePropertyDefinitions ( propertyName ) ) { matchedOnName = true ; // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; if ( setToEmpty ) { if ( ! definition . isMandatory ( ) ) return definition ; // Otherwise this definition doesn ' t work , so continue with the next . . .
continue ; } assert value != null ; // We can use the definition if it matches the type and satisfies the constraints . . .
int type = definition . getRequiredType ( ) ; // Don ' t check constraints on reference properties
if ( type == PropertyType . REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . WEAKREFERENCE && type == value . getType ( ) ) return definition ; if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && type == value . getType ( ) ) return definition ; if ( type == PropertyType . UNDEFINED || type == value . getType ( ) ) { if ( ! checkTypeAndConstraints ) return definition ; if ( definition . satisfiesConstraints ( value , session ) ) return definition ; } } if ( value != null ) { for ( JcrPropertyDefinition definition : mixinType . allMultiValuePropertyDefinitions ( propertyName ) ) { matchedOnName = true ; // See if the definition allows the value . . .
if ( skipProtected && definition . isProtected ( ) ) return null ; assert definition . getRequiredType ( ) != PropertyType . UNDEFINED ; // Don ' t check constraints on reference properties
int type = definition . getRequiredType ( ) ; if ( type == PropertyType . REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == PropertyType . WEAKREFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( type == org . modeshape . jcr . api . PropertyType . SIMPLE_REFERENCE && definition . canCastToType ( value ) ) { return definition ; } if ( ! checkTypeAndConstraints ) return definition ; if ( definition . canCastToTypeAndSatisfyConstraints ( value , session ) ) return definition ; } } } } if ( matchedOnName ) return null ; } // Nothing was found , so look for residual property definitions . . .
if ( ! propertyName . equals ( JcrNodeType . RESIDUAL_NAME ) ) return findPropertyDefinition ( session , primaryTypeName , mixinTypeNames , JcrNodeType . RESIDUAL_NAME , value , checkMultiValuedDefinitions , skipProtected , checkTypeAndConstraints ) ; return null ;
|
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 」 のうち小さい方
int pdfBaseNum = Math . min ( dataLength , this . arDimensionNum + 1 ) ; for ( int index = 0 ; index < pdfBaseNum ; index ++ ) { this . pdfBase [ index ] = ( 1 - this . forgetability ) * this . pdfBase [ index ] + this . forgetability * ( input - this . estimatedMyu ) * Math . pow ( ( this . pastData . get ( index ) - this . estimatedMyu ) , 1 ) ; } // パラメータ推定に用いる係数配列 「 ω 」 の算出を行う 。
// 確率密度関数用の係数配列のインデックスと異なり1オリジンのため配列インデックスも1から使用している 。
for ( int yuleIndex = 1 ; yuleIndex < pdfBaseNum ; yuleIndex ++ ) { double nowPdfBase = this . pdfBase [ yuleIndex ] ; for ( int index = 1 ; index < yuleIndex ; index ++ ) { nowPdfBase = nowPdfBase - ( this . pdfBase [ yuleIndex - index ] * this . yuleWalkerAns [ index ] ) ; } double yuleResult = nowPdfBase / ( this . pdfBase [ 0 ] ) ; this . yuleWalkerAns [ yuleIndex ] = yuleResult ; } // データの推測値を算出
double estimatedValue = this . estimatedMyu ; for ( int index = 1 ; index < pdfBaseNum ; index ++ ) { double dataResult = this . pastData . get ( index ) ; double dist = this . yuleWalkerAns [ index ] * ( dataResult - this . estimatedMyu ) ; estimatedValue = estimatedValue + dist ; } if ( this . pastData . size ( ) > this . arDimensionNum ) { this . pastData . pollLast ( ) ; } // Σの最尤推定値を算出
this . estimatedSigma = ( 1 - this . forgetability ) * this . estimatedSigma + this . forgetability * Math . pow ( ( input - estimatedValue ) , 2 ) ; // 1段階学習結果スコアを算出
double firstScore = calcFirstScore ( estimatedValue , input , this . estimatedSigma , this . smoothingWindow ) ; this . scores . add ( firstScore ) ; if ( this . scores . size ( ) > this . smoothingWindow ) { this . scores . remove ( 0 ) ; } // # # 平滑化を行う 。
double movingAverage = smoothing ( this . scores , this . smoothingWindow ) ; if ( logger . isDebugEnabled ( ) == true ) { String logFormat = "CalculateResult. Input={0}, Myu={1}, Sigma={2}, Estimated={3}, Score={4}, MovingAverage={5}" ; logger . debug ( this . logHeader + MessageFormat . format ( logFormat , input , this . estimatedMyu , this . estimatedSigma , estimatedValue , firstScore , movingAverage ) ) ; } // # # オンライン忘却アルゴリズムSDARを用いて2段階学習を行う 。
// # # フィールド 「 secondFinder 」 が存在している場合 、 2段階学習結果をスコアとして返す 。
// # # 存在していない場合は本インスタンス自身が2段階目のChangeFinderのため 、 平滑化の結果をそのまま返す 。
if ( this . secondChangeFinder == null ) { return movingAverage ; } double secondScore = this . secondChangeFinder . calculateScore ( movingAverage ) ; return secondScore ;
|
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 not authorized to perform this action .
* @ throws InternalServerErrorException
* The service is temporarily unavailable .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws ResourceNotFoundException
* The requested resource was not found .
* @ throws TooManyRequestsException
* The number of requests exceeds the limit .
* @ sample AmazonWorkLink . DescribeAuditStreamConfiguration
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / worklink - 2018-09-25 / DescribeAuditStreamConfiguration "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeAuditStreamConfigurationResult describeAuditStreamConfiguration ( DescribeAuditStreamConfigurationRequest request ) { } }
|
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 ' s functionality . Note that size limits only apply when reading
* from an { @ code InputStream } , not when constructed around a raw byte array .
* If you want to read several messages from a single CodedInput , you could call { @ link # resetSizeCounter ( ) } after
* each one to avoid hitting the size limit .
* @ return the old limit . */
public int setSizeLimit ( final int limit ) { } }
|
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 ( ) . getSystemEventQueue ( ) . postEvent ( e ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.