signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class LineItemCreativeAssociation { /** * Gets the sizes value for this LineItemCreativeAssociation .
* @ return sizes * Overrides the value set for { @ link Creative # size } , which allows
* the
* creative to be served to ad units that would otherwise
* not be compatible
* for its actual size . This ... | return sizes ; |
public class ResourceLocator { /** * 将指定类的类名中所有 . 替换为 / , 并在后面补上 . class */
static String getClassPathName ( Class < ? > c ) { } } | String strClassFullName = c . getName ( ) ; StringTokenizer st = new StringTokenizer ( strClassFullName , "." ) ; StringBuffer sb = new StringBuffer ( ) ; sb . append ( st . nextToken ( ) ) ; while ( st . hasMoreTokens ( ) ) { sb . append ( "/" ) ; sb . append ( st . nextToken ( ) ) ; } sb . append ( ".class" ) ; retur... |
public class PeriodicTable { /** * Get the phase of the element .
* @ param symbol the symbol of the element
* @ return the phase of the element */
public static String getPhase ( String symbol ) { } } | Elements e = Elements . ofString ( symbol ) ; for ( Phase p : Phase . values ( ) ) if ( p . contains ( e ) ) return p . name ( ) ; return null ; |
public class ParameterUtils { /** * 将字符串转换成Long
* @ param param number string
* @ return long or null if parameter is null or empty . */
public static Long parseLong ( String param ) { } } | try { if ( ! StringUtils . isBlank ( param ) ) { return Long . valueOf ( param ) ; } } catch ( Exception e ) { throw new IllegalArgumentException ( "Parameter " + param + " is not a number." ) ; } return null ; |
public class InternalQueries { /** * Converts array of something to non - null set .
* @ param firstItem the first required source item .
* @ param otherItems other source items to convert , can be { @ code null } .
* @ return non - null , set of something . */
@ SuppressWarnings ( "unchecked" ) @ NonNull public ... | final HashSet < String > set = new HashSet < String > ( ) ; set . add ( firstItem ) ; if ( otherItems != null ) { set . addAll ( asList ( otherItems ) ) ; } return set ; |
public class Base64Coder { /** * Encodes a byte array into Base 64 format and breaks the output into lines .
* @ param in An array containing the data bytes to be encoded .
* @ param iOff Offset of the first byte in < code > in < / code > to be processed .
* @ param iLen Number of bytes to be processed in < code ... | final int blockLen = lineLen * 3 / 4 ; if ( blockLen <= 0 ) { throw new IllegalArgumentException ( ) ; } final int lines = ( iLen + blockLen - 1 ) / blockLen ; final int bufLen = ( iLen + 2 ) / 3 * 4 + lines * lineSeparator . length ( ) ; final StringBuilder buf = new StringBuilder ( bufLen ) ; int ip = 0 ; while ( ip ... |
public class DriversView { /** * This method is called from within the constructor to initialize the form .
* WARNING : Do NOT modify this code . The content of this method is always
* regenerated by the Form Editor . */
private void initComponents ( ) { } } | fileLabel = new JLabel ( ) ; fileTextField = new ZapTextField ( ) ; browseButton = new JButton ( ) ; nameLabel = new JLabel ( ) ; nameTextField = new ZapTextField ( ) ; slotLabel = new JLabel ( ) ; slotTextField = new ZapTextField ( ) ; slotListIndexLabel = new JLabel ( ) ; slotListIndexTextField = new ZapTextField ( )... |
public class GlobalJarUploader { /** * Creates the JAR file with the global files on the driver and then uploads it to the job folder on
* ( H ) DFS .
* @ return the map to be used as the " global " resources when submitting Evaluators .
* @ throws IOException if the creation of the JAR or the upload fails */
@ O... | final Map < String , LocalResource > globalResources = new HashMap < > ( 1 ) ; if ( ! this . isUploaded ) { this . pathToGlobalJar = this . uploader . uploadToJobFolder ( makeGlobalJar ( ) ) ; this . isUploaded = true ; } final LocalResource updatedGlobalJarResource = this . uploader . makeLocalResourceForJarFile ( thi... |
public class AbstractSaml20ObjectBuilder { /** * Gets name id .
* @ param nameIdFormat the name id format
* @ param nameIdValue the name id value
* @ return the name iD */
public NameID getNameID ( final String nameIdFormat , final String nameIdValue ) { } } | val nameId = newSamlObject ( NameID . class ) ; nameId . setFormat ( nameIdFormat ) ; nameId . setValue ( nameIdValue ) ; return nameId ; |
public class SREConfigurationBlock { /** * Replies the selected SARL runtime environment .
* @ return the SARL runtime environment or < code > null < / code > if
* there is no selected SRE .
* @ see # isSystemWideDefaultSRE ( ) */
public ISREInstall getSelectedSRE ( ) { } } | if ( this . enableSystemWideSelector && this . systemSREButton . getSelection ( ) ) { return SARLRuntime . getDefaultSREInstall ( ) ; } if ( ! this . projectProviderFactories . isEmpty ( ) && this . projectSREButton . getSelection ( ) ) { return retreiveProjectSRE ( ) ; } return getSpecificSRE ( ) ; |
public class HtmlSelectManyListbox { /** * < p > Return the value of the < code > enabledClass < / code > property . < / p >
* < p > Contents : CSS style class to apply to the rendered label
* on enabled options . */
public java . lang . String getEnabledClass ( ) { } } | return ( java . lang . String ) getStateHelper ( ) . eval ( PropertyKeys . enabledClass ) ; |
public class TcpProxyBuffer { /** * This method try to write data from buffer to channel .
* Buffer changes state to READY _ TO _ READ only if all data were wrote to channel ,
* in other case you should call this method again
* @ param channel - channel
* @ throws IOException */
public void writeTo ( SocketChan... | channel . write ( buffer ) ; // only if buffer is empty
if ( buffer . remaining ( ) == 0 ) { buffer . clear ( ) ; state = BufferState . READY_TO_WRITE ; } |
public class Default { private int getInitInt ( String name ) { } } | String value = getInitParameter ( name ) ; if ( value != null && value . length ( ) > 0 ) return Integer . parseInt ( value ) ; return - 1 ; |
public class Caster { /** * cast a Object to a Float Object ( reference type )
* @ param o Object to cast
* @ return casted Float Object
* @ throws PageException */
public static Float toFloat ( Object o ) throws PageException { } } | if ( o instanceof Float ) return ( Float ) o ; return new Float ( toFloatValue ( o ) ) ; |
public class Text { @ Override public < P , E extends Exception > void accept ( ComponentVisitor < P , E > visitor , P parameter ) throws E { } } | visitor . visit ( this , parameter ) ; |
public class ScreenshotTaker { /** * Gets the proper view to use for a screenshot . */
private View getScreenshotView ( ) { } } | View decorView = viewFetcher . getRecentDecorView ( viewFetcher . getWindowDecorViews ( ) ) ; final long endTime = SystemClock . uptimeMillis ( ) + Timeout . getSmallTimeout ( ) ; while ( decorView == null ) { final boolean timedOut = SystemClock . uptimeMillis ( ) > endTime ; if ( timedOut ) { return null ; } sleeper ... |
public class ControllersInner { /** * Lists the Azure Dev Spaces Controllers in a resource group .
* Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription .
* @ param resourceGroupName Resource group to which the resource belongs .
* @ throws IllegalArgu... | return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < Page < ControllerInner > > , Page < ControllerInner > > ( ) { @ Override public Page < ControllerInner > call ( ServiceResponse < Page < ControllerInner > > response ) { return response . body ( ) ; } } ) ; |
public class Search { /** * Returns the Lucene { @ link org . apache . lucene . search . SortField } s represented by this using the specified schema .
* @ param schema the indexing schema to be used
* @ return the Lucene sort fields represented by this using { @ code schema } */
public List < org . apache . lucene... | return sort . stream ( ) . map ( s -> s . sortField ( schema ) ) . collect ( Collectors . toList ( ) ) ; |
public class LocalProperties { /** * Adds a combination of fields that are unique in these data properties .
* @ param uniqueFields The fields that are unique in these data properties . */
public void addUniqueFields ( FieldSet uniqueFields ) { } } | if ( this . uniqueFields == null ) { this . uniqueFields = new HashSet < FieldSet > ( ) ; } this . uniqueFields . add ( uniqueFields ) ; |
public class RegularExpression { /** * Converts a token to an operation . */
private Op compile ( Token tok , Op next , boolean reverse ) { } } | Op ret ; switch ( tok . type ) { case Token . DOT : ret = Op . createDot ( ) ; ret . next = next ; break ; case Token . CHAR : ret = Op . createChar ( tok . getChar ( ) ) ; ret . next = next ; break ; case Token . ANCHOR : ret = Op . createAnchor ( tok . getChar ( ) ) ; ret . next = next ; break ; case Token . RANGE : ... |
public class DatabaseDAODefaultImpl { public void delete_device_attribute ( Database database , String deviceName , String attname ) throws DevFailed { } } | if ( ! database . isAccess_checked ( ) ) checkAccess ( database ) ; String [ ] array = new String [ 2 ] ; array [ 0 ] = deviceName ; array [ 1 ] = attname ; DeviceData argIn = new DeviceData ( ) ; argIn . insert ( array ) ; command_inout ( database , "DbDeleteDeviceAttribute" , argIn ) ; |
public class SpringApplication { /** * Run the Spring application , creating and refreshing a new
* { @ link ApplicationContext } .
* @ param args the application arguments ( usually passed from a Java main method )
* @ return a running { @ link ApplicationContext } */
public ConfigurableApplicationContext run ( ... | StopWatch stopWatch = new StopWatch ( ) ; stopWatch . start ( ) ; ConfigurableApplicationContext context = null ; Collection < SpringBootExceptionReporter > exceptionReporters = new ArrayList < > ( ) ; configureHeadlessProperty ( ) ; SpringApplicationRunListeners listeners = getRunListeners ( args ) ; listeners . start... |
public class RadialMenuItem { /** * Trainsit the button to " Visible " state . */
public void show ( ) { } } | if ( isVisible ( ) ) { return ; } resetToInitialState ( ) ; setVisible ( true ) ; final Timeline phaseOne = new Timeline ( ) ; phaseOne . getKeyFrames ( ) . addAll ( new KeyFrame ( Duration . ZERO , new KeyValue ( transformRadius , fromRadius ) , new KeyValue ( transformOpacity , 0 ) ) , new KeyFrame ( new Duration ( 1... |
public class AstFactory { /** * Returns a new { @ code yield } expression .
* @ param jsType Type we expect to get back after the yield
* @ param value value to yield */
Node createYield ( JSType jsType , Node value ) { } } | Node result = IR . yield ( value ) ; if ( isAddingTypes ( ) ) { result . setJSType ( checkNotNull ( jsType ) ) ; } return result ; |
public class MerkleTree { /** * TODO : This function could be optimized into a depth first traversal of
* the two trees in parallel .
* Takes two trees and a range for which they have hashes , but are inconsistent .
* @ return FULLY _ INCONSISTENT if active is inconsistent , PARTIALLY _ INCONSISTENT if only a sub... | if ( active . depth == Byte . MAX_VALUE ) return CONSISTENT ; Token midpoint = ltree . partitioner ( ) . midpoint ( active . left , active . right ) ; TreeDifference left = new TreeDifference ( active . left , midpoint , inc ( active . depth ) ) ; TreeDifference right = new TreeDifference ( midpoint , active . right , ... |
public class JaxWsExtensionFactory { /** * { @ inheritDoc } */
@ Override public ExtensionProcessor createExtensionProcessor ( IServletContext servletContext ) throws Exception { } } | WebModuleMetaData moduleMetaData = ( ( WebAppConfigExtended ) ( servletContext . getWebAppConfig ( ) ) ) . getMetaData ( ) ; JaxWsModuleMetaData jaxWsModuleMetaData = JaxWsMetaDataManager . getJaxWsModuleMetaData ( moduleMetaData ) ; // If jaxws - 2.2 feature is enabled while the server is on the running status , WebCo... |
public class AmazonCloudFormationClient { /** * Returns the description of the specified stack set .
* @ param describeStackSetRequest
* @ return Result of the DescribeStackSet operation returned by the service .
* @ throws StackSetNotFoundException
* The specified stack set doesn ' t exist .
* @ sample Amazo... | request = beforeClientExecution ( request ) ; return executeDescribeStackSet ( request ) ; |
public class CanvasOverlay { /** * Get a { @ link DashedHorizontalLine } instance
* @ return DashedHorizontalLine */
public DashedHorizontalLine dashedHorizontalLineInstance ( ) { } } | LineObject lineObject = new LineObject ( ) ; DashedHorizontalLine dashedHorizontalLine = lineObject . dashedHorizontalLineInstance ( ) ; objectsInstance ( ) . add ( lineObject ) ; return dashedHorizontalLine ; |
public class DebugChemObject { /** * { @ inheritDoc } */
@ Override public void setProperties ( Map < Object , Object > properties ) { } } | logger . debug ( "Setting properties: " , properties ) ; super . setProperties ( properties ) ; |
public class RepositoryApi { /** * Get an archive of the complete repository by SHA ( optional ) .
* < pre > < code > GitLab Endpoint : GET / projects / : id / repository / archive < / code > < / pre >
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
*... | ArchiveFormat archiveFormat = ArchiveFormat . forValue ( format ) ; return ( getRepositoryArchive ( projectIdOrPath , sha , archiveFormat ) ) ; |
public class Async { /** * Convert a synchronous function call into an asynchronous function call through an Observable .
* < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . png " alt = " " >
* @ param < R > the result value type
* @ par... | return toAsync ( func , Schedulers . computation ( ) ) ; |
public class Jmx { /** * Add meters for the standard MXBeans provided by the jvm . This method will use
* { @ link java . lang . management . ManagementFactory # getPlatformMXBeans ( Class ) } to get the set of
* mbeans from the local jvm . */
public static void registerStandardMXBeans ( Registry registry ) { } } | for ( MemoryPoolMXBean mbean : ManagementFactory . getPlatformMXBeans ( MemoryPoolMXBean . class ) ) { registry . register ( new MemoryPoolMeter ( registry , mbean ) ) ; } for ( BufferPoolMXBean mbean : ManagementFactory . getPlatformMXBeans ( BufferPoolMXBean . class ) ) { registry . register ( new BufferPoolMeter ( r... |
public class FindIndexesVisitor { /** * ( non - Javadoc )
* @ see
* javax . lang . model . util . SimpleAnnotationValueVisitor6 # visitAnnotation ( javax
* . lang . model . element . AnnotationMirror , java . lang . Object ) */
@ Override public Void visitAnnotation ( AnnotationMirror a , String p ) { } } | if ( AnnotationAttributeType . INDEXES . getValue ( ) . equals ( p ) ) { inTasks = true ; } if ( inTasks ) { currentValue = new Pair < List < String > , Boolean > ( new ArrayList < String > ( ) , false ) ; for ( Map . Entry < ? extends ExecutableElement , ? extends AnnotationValue > entry : a . getElementValues ( ) . e... |
public class Maze2D { /** * Check if the provided point is in the maze bounds or outside .
* @ param loc point to be tested .
* @ return true if the point is in the maze . */
public boolean pointInBounds ( Point loc ) { } } | return loc . x >= 0 && loc . x < this . columns && loc . y >= 0 && loc . y < this . rows ; |
public class PropertiesUtils { /** * Load a file from an URL .
* @ param fileURL
* Property file URL - Cannot be < code > null < / code > .
* @ return Properties . */
public static Properties loadProperties ( final URL fileURL ) { } } | checkNotNull ( "fileURL" , fileURL ) ; final Properties props = new Properties ( ) ; try ( final InputStream inStream = fileURL . openStream ( ) ) { props . load ( inStream ) ; } catch ( final IOException ex ) { throw new RuntimeException ( ex ) ; } return props ; |
public class QPath { /** * Tell if the path is absolute .
* @ return boolean */
public boolean isAbsolute ( ) { } } | if ( names [ 0 ] . getIndex ( ) == 1 && names [ 0 ] . getName ( ) . length ( ) == 0 && names [ 0 ] . getNamespace ( ) . length ( ) == 0 ) return true ; else return false ; |
public class Setting { /** * 默认分组 ( 空分组 ) 中是否包含指定值
* @ param value 值
* @ return 默认分组中是否包含指定值 */
@ Override public boolean containsValue ( Object value ) { } } | return this . groupedMap . containsValue ( DEFAULT_GROUP , Convert . toStr ( value ) ) ; |
public class Diff { /** * Analyzes the start and end state and creates for every object that is different an objectdiff entry */
private void createObjectDiffs ( ) throws EDBException { } } | diff = new HashMap < String , EDBObjectDiff > ( ) ; List < EDBObject > tempList = new ArrayList < EDBObject > ( ) ; for ( EDBObject o : this . endState ) { tempList . add ( o ) ; } addModifiedOrDeletedObjects ( tempList ) ; addNewObjects ( tempList ) ; |
public class CaptchaPanel { /** * Factory method for creating a new { @ link Image } . This method is invoked in the constructor
* from the derived classes and can be overridden so users can provide their own version of a
* Button .
* @ param id
* the wicket id
* @ param imageResource
* the image resource .... | return ComponentFactory . newImage ( id , imageResource ) ; |
public class DBIDUtil { /** * Compute the set intersection of two sets .
* @ param first First set
* @ param second Second set
* @ return intersection */
public static ModifiableDBIDs intersection ( DBIDs first , DBIDs second ) { } } | // If exactly one is a Set , use it as second parameter .
if ( second instanceof SetDBIDs ) { if ( ! ( first instanceof SetDBIDs ) ) { return internalIntersection ( first , second ) ; } } else if ( first instanceof SetDBIDs ) { return internalIntersection ( second , first ) ; } // Both are the same type : both set or b... |
public class SystemHooksApi { /** * Get a Pager of all system hooks . This method requires admin access .
* < pre > < code > GitLab Endpoint : GET / hooks < / code > < / pre >
* @ param itemsPerPage the number of SystemHookEvent instances that will be fetched per page
* @ return a Pager of SystemHookEvent
* @ t... | return ( new Pager < SystemHook > ( this , SystemHook . class , itemsPerPage , null , "hooks" ) ) ; |
public class EmnistDataSetIterator { /** * Get the label assignments for the given set as a character array .
* @ param dataSet DataSet to get the label assignment for
* @ return Label assignment and given dataset */
public static char [ ] getLabelsArray ( Set dataSet ) { } } | switch ( dataSet ) { case COMPLETE : return LABELS_COMPLETE ; case MERGE : return LABELS_MERGE ; case BALANCED : return LABELS_BALANCED ; case LETTERS : return LABELS_LETTERS ; case DIGITS : case MNIST : return LABELS_DIGITS ; default : throw new UnsupportedOperationException ( "Unknown Set: " + dataSet ) ; } |
public class JCuda { /** * Copies data between host and device .
* < pre >
* cudaError _ t cudaMemcpyFromArray (
* void * dst ,
* cudaArray _ const _ t src ,
* size _ t wOffset ,
* size _ t hOffset ,
* size _ t count ,
* cudaMemcpyKind kind )
* < / pre >
* < div >
* < p > Copies data between host ... | return checkResult ( cudaMemcpyFromArrayNative ( dst , src , wOffset , hOffset , count , cudaMemcpyKind_kind ) ) ; |
public class DB { /** * Updates the excerpt for a post .
* @ param postId The post to update .
* @ param excerpt The new excerpt .
* @ return Was the post modified ?
* @ throws SQLException on database error or missing post id . */
public boolean updatePostExcerpt ( long postId , final String excerpt ) throws S... | Connection conn = null ; PreparedStatement stmt = null ; Timer . Context ctx = metrics . updatePostTimer . time ( ) ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( updatePostExcerptSQL ) ; stmt . setString ( 1 , excerpt ) ; stmt . setLong ( 2 , postId ) ; return stmt . executeUp... |
public class Element { /** * wait for timeout amount of time
* @ param callback
* @ param timeout
* @ throws WidgetTimeoutException */
protected void waitForCommand ( ITimerCallback callback , long timeout ) throws WidgetTimeoutException { } } | WaitForConditionTimer t = new WaitForConditionTimer ( getByLocator ( ) , callback ) ; t . waitUntil ( timeout ) ; |
public class SemiTransactionalHiveMetastore { /** * TODO : Allow updating statistics for 2 tables in the same transaction */
public synchronized void setTableStatistics ( Table table , PartitionStatistics tableStatistics ) { } } | setExclusive ( ( delegate , hdfsEnvironment ) -> delegate . updateTableStatistics ( table . getDatabaseName ( ) , table . getTableName ( ) , statistics -> updatePartitionStatistics ( statistics , tableStatistics ) ) ) ; |
public class DatabaseDAODefaultImpl { public void put_server_info ( Database database , DbServInfo info ) throws DevFailed { } } | if ( ! database . isAccess_checked ( ) ) checkAccess ( database ) ; String [ ] array ; array = new String [ 4 ] ; array [ 0 ] = info . name ; array [ 1 ] = info . host ; array [ 2 ] = ( info . controlled ) ? "1" : "0" ; array [ 3 ] = Integer . toString ( info . startup_level ) ; /* System . out . println ( " DbPutServe... |
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 3075:1 : ruleXListLiteral returns [ EObject current = null ] : ( ( ) otherlv _ 1 = ' # ' otherlv _ 2 = ' [ ' ( ( ( lv _ elements _ 3_0 = ruleXExpression ) ) ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) * ) ? otherlv _ 6 = ' ] ... | EObject current = null ; Token otherlv_1 = null ; Token otherlv_2 = null ; Token otherlv_4 = null ; Token otherlv_6 = null ; EObject lv_elements_3_0 = null ; EObject lv_elements_5_0 = null ; enterRule ( ) ; try { // InternalPureXbase . g : 3081:2 : ( ( ( ) otherlv _ 1 = ' # ' otherlv _ 2 = ' [ ' ( ( ( lv _ elements _ 3... |
public class SpScheduler { /** * site leaders also forward the message to its replicas . */
@ Override public void cleanupTransactionBacklogOnRepair ( ) { } } | if ( m_isLeader && m_sendToHSIds . length > 0 ) { m_mailbox . send ( m_sendToHSIds , new MPBacklogFlushMessage ( ) ) ; } Iterator < Entry < Long , TransactionState > > iter = m_outstandingTxns . entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Entry < Long , TransactionState > entry = iter . next ( ) ; Tran... |
public class SparseTensorBuilder { /** * Gets a { @ code TensorFactory } which creates { @ code SparseTensorBuilder } s .
* @ return */
public static TensorFactory getFactory ( ) { } } | return new TensorFactory ( ) { @ Override public TensorBuilder getBuilder ( int [ ] dimNums , int [ ] dimSizes ) { return new SparseTensorBuilder ( dimNums , dimSizes ) ; } } ; |
public class HibernateQueryModelDAO { private Criteria buildCriteria ( QueryModel queryModel ) { } } | Criteria criteria = getCurrentSession ( ) . createCriteria ( persistentClass ) ; if ( queryModel . getConditions ( ) != null ) { for ( Condition condition : queryModel . getConditions ( ) ) { criteria . add ( ( Criterion ) condition . getConstraint ( ) ) ; } } for ( Map . Entry < String , List < Condition > > associati... |
public class SVGScoreBar { /** * Set the fill of the score bar .
* @ param val Value
* @ param min Minimum value
* @ param max Maximum value */
public void setFill ( double val , double min , double max ) { } } | this . val = val ; this . min = min ; this . max = max ; |
public class AbstractGeneratedSQLTransform { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . processor . sqlite . transform . SQLTransform # generateWriteProperty2ContentValues ( com . squareup . javapoet . MethodSpec . Builder , java . lang . String , com . squareup . javapoet . TypeName , com . abub... | methodBuilder . addCode ( "$T.serialize$L($L)" , TypeUtility . mergeTypeNameWithSuffix ( beanClass , "Table" ) , formatter . convert ( property . getName ( ) ) , getter ( beanName , beanClass , property ) ) ; |
public class GoogleNetHttpTransport { /** * Returns a new instance of { @ link NetHttpTransport } that uses
* { @ link GoogleUtils # getCertificateTrustStore ( ) } for the trusted certificates using
* { @ link com . google . api . client . http . javanet . NetHttpTransport . Builder # trustCertificates ( KeyStore )... | return new NetHttpTransport . Builder ( ) . trustCertificates ( GoogleUtils . getCertificateTrustStore ( ) ) . build ( ) ; |
public class PayUtil { /** * ( MCH ) 生成Native支付请求URL
* @ param appid
* appid
* @ param mch _ id
* mch _ id
* @ param productid
* productid
* @ param key
* key
* @ return url */
public static String generateMchPayNativeRequestURL ( String appid , String mch_id , String productid , String key ) { } } | Map < String , String > map = new LinkedHashMap < String , String > ( ) ; map . put ( "appid" , appid ) ; map . put ( "mch_id" , mch_id ) ; map . put ( "time_stamp" , System . currentTimeMillis ( ) / 1000 + "" ) ; map . put ( "nonce_str" , UUID . randomUUID ( ) . toString ( ) . replace ( "-" , "" ) ) ; map . put ( "pro... |
public class DataGridConfigFactory { /** * Create an instance of a { @ link DataGridConfig } object given a { @ link Class } object .
* The given class must extend the { @ link DataGridConfig } base class .
* @ param clazz the class to instantiate
* @ return the new { @ link DataGridConfig } instance */
public st... | DataGridConfig config = ( DataGridConfig ) ExtensionUtil . instantiateClass ( clazz , DataGridConfig . class ) ; return config ; |
public class UnicodeSet { /** * Parses the given pattern , starting at the given position . The character
* at pattern . charAt ( pos . getIndex ( ) ) must be ' [ ' , or the parse fails .
* Parsing continues until the corresponding closing ' ] ' . If a syntax error
* is encountered between the opening and closing... | // Need to build the pattern in a temporary string because
// _ applyPattern calls add ( ) etc . , which set pat to empty .
boolean parsePositionWasNull = pos == null ; if ( parsePositionWasNull ) { pos = new ParsePosition ( 0 ) ; } StringBuilder rebuiltPat = new StringBuilder ( ) ; RuleCharacterIterator chars = new Ru... |
public class BugInstance { /** * Add a field annotation for an XField .
* @ param xfield
* the XField
* @ return this object */
@ Nonnull public BugInstance addField ( XField xfield ) { } } | return addField ( xfield . getClassName ( ) , xfield . getName ( ) , xfield . getSignature ( ) , xfield . isStatic ( ) ) ; |
public class GibbsSampler { /** * Set the assignment variable to an arbitrary initial value . */
private Assignment initializeAssignment ( FactorGraph factorGraph ) { } } | // Select the initial assignment .
// TODO : Perform a search to find an outcome with nonzero probability .
Variable [ ] variables = factorGraph . getVariables ( ) . getVariablesArray ( ) ; int [ ] varNums = factorGraph . getVariables ( ) . getVariableNumsArray ( ) ; Object [ ] values = new Object [ variables . length ... |
public class SecurityIsOffMonitor { /** * Depending on whether the user said " yes " or " no " , send him to the right place . */
@ RequirePOST public void doAct ( StaplerRequest req , StaplerResponse rsp ) throws IOException { } } | if ( req . hasParameter ( "no" ) ) { disable ( true ) ; rsp . sendRedirect ( req . getContextPath ( ) + "/manage" ) ; } else { rsp . sendRedirect ( req . getContextPath ( ) + "/configureSecurity" ) ; } |
public class CharEscapeUtil { /** * / * Output method implementations , textual */
public void writeString ( String text , boolean flush ) { } } | try { _writeString ( text ) ; if ( flush ) this . _flushBuffer ( ) ; } catch ( IOException e ) { throw new ElasticSearchException ( e ) ; } |
public class GetResponse { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . network . packet . AbstractResponsePacket # unserializeFrom ( net . timewalker . ffmq4 . utils . RawDataInputStream ) */
@ Override protected void unserializeFrom ( RawDataBuffer in ) { } } | super . unserializeFrom ( in ) ; boolean hasMessage = in . readBoolean ( ) ; if ( hasMessage ) { message = MessageSerializer . unserializeFrom ( in , false ) ; } |
public class SparseGrid { @ Override public SortedSet < Cell < V > > cells ( ) { } } | return new ForwardingSortedSet < Cell < V > > ( ) { @ Override protected SortedSet < Cell < V > > delegate ( ) { return cells ; } @ Override public boolean add ( Cell < V > element ) { return super . add ( ImmutableCell . copyOf ( element ) ) ; } @ Override public boolean addAll ( Collection < ? extends Cell < V > > co... |
public class Functions { /** * Fluent flatMap operation using primitive types
* e . g .
* < pre >
* { @ code
* import static cyclops . ReactiveSeq . flatMapLongs ;
* ReactiveSeq . ofLongs ( 1,2,3)
* . to ( flatMapLongs ( i - > LongStream . of ( i * 2 ) ) ) ;
* / / [ 2l , 4l , 6l ]
* < / pre > */
public ... | return a -> a . longs ( i -> i , s -> s . flatMap ( b ) ) ; |
public class CiLin { /** * 找出同义的词对 , 建造hashset ;
* @ return 同义词集合 */
public static HashSet buildSynonymSet ( String fileName ) { } } | try { InputStreamReader read = new InputStreamReader ( new FileInputStream ( fileName ) , "utf-8" ) ; BufferedReader bin = new BufferedReader ( read ) ; HashSet < String > synSet = new HashSet < String > ( ) ; int c = 0 ; String str = bin . readLine ( ) ; while ( str != null && str . length ( ) == 0 ) { String [ ] strs... |
public class DSConfig { /** * Remove properties up to and including the specified property . Return the property if found .
* @ param name name of the property .
* @ param defaultValue default value to use if not found .
* @ param min minimum permitted value
* @ param units units for duration type . Null if not... | Object value = null ; for ( int diff ; value == null && entry != null && ( diff = entry . getKey ( ) . compareTo ( name ) ) <= 0 ; entry = entries . pollFirstEntry ( ) ) { if ( diff == 0 ) // matched
value = entry . getValue ( ) ; else { // TODO : when we have a stricter variant of onError , apply it to unrecognized at... |
public class AWSSimpleSystemsManagementClient { /** * Returns detailed information about command execution for an invocation or plugin .
* @ param getCommandInvocationRequest
* @ return Result of the GetCommandInvocation operation returned by the service .
* @ throws InternalServerErrorException
* An error occu... | request = beforeClientExecution ( request ) ; return executeGetCommandInvocation ( request ) ; |
public class DefaultGeometryIndexShapeFactory { private Shape createVertex ( GeometryEditService editService , GeometryIndex index ) throws GeometryIndexNotFoundException { } } | Geometry geometry = editService . getGeometry ( ) ; Coordinate v = editService . getIndexService ( ) . getVertex ( geometry , index ) ; if ( ! targetSpace . equals ( RenderSpace . WORLD ) ) { v = mapPresenter . getViewPort ( ) . getTransformationService ( ) . transform ( v , RenderSpace . WORLD , targetSpace ) ; } retu... |
public class TemplateMethodsBuilder { /** * Add Template methods to @ { @ link IsVueComponent } ExposedType based on the result of the template
* parser .
* @ param exposedTypeGenerator Class generating the ExposedType
* @ param templateParserResult The result of the HTML template parsed by { @ link TemplateParse... | // Compile the resulting HTML template String
compileTemplateString ( exposedTypeGenerator , templateParserResult ) ; // Process the java expressions from the template
processTemplateExpressions ( exposedTypeGenerator , templateParserResult ) ; |
public class CmsLinkManager { /** * Returns the link for the given resource in the current project , with full server prefix . < p >
* The input link must already have been processed according to the link substitution rules .
* This method does just append the server prefix in case this is requires . < p >
* @ pa... | int paramPos = pathWithOptionalParameters . indexOf ( "?" ) ; String resourceName = paramPos > - 1 ? pathWithOptionalParameters . substring ( 0 , paramPos ) : pathWithOptionalParameters ; if ( isAbsoluteUri ( link ) && ! hasScheme ( link ) ) { // URI is absolute and contains no schema
// this indicates source and targe... |
public class appfwprofile { /** * Use this API to fetch all the appfwprofile resources that are configured on netscaler . */
public static appfwprofile [ ] get ( nitro_service service ) throws Exception { } } | appfwprofile obj = new appfwprofile ( ) ; appfwprofile [ ] response = ( appfwprofile [ ] ) obj . get_resources ( service ) ; return response ; |
public class RealTimeDaemon { /** * It runs in a loop that tries to wake every timeInterval .
* If it gets behind due to an overload , the subclass ' implementation
* of the wakeUp method is responsible for resynching itself based
* on the startDaemonTime and startWakeUpTime . */
public void alarm ( final Object ... | long sleepInterval = 0 ; do { long startWakeUpTime = System . currentTimeMillis ( ) ; try { wakeUp ( startDaemonTime , startWakeUpTime ) ; } catch ( Exception ex ) { com . ibm . ws . ffdc . FFDCFilter . processException ( ex , "com.ibm.ws.cache.RealTimeDaemon.alarm" , "83" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr .... |
public class AVIMConversationsQuery { /** * 增加一个基于地理位置的近似查询 , 当conversation的属性中有对应的地址位置与指定的地理位置间距不超过指定距离时返回
* 地球半径为6371.0 千米
* @ param key
* @ param point 指定的地理位置
* @ param maxDistance 距离 , 以千米计算
* @ return */
public AVIMConversationsQuery whereWithinKilometers ( String key , AVGeoPoint point , double maxDist... | conditions . whereWithinKilometers ( key , point , maxDistance ) ; return this ; |
public class AWSOpsWorksClient { /** * Describes a user ' s SSH information .
* < b > Required Permissions < / b > : To use this action , an IAM user must have self - management enabled or an attached
* policy that explicitly grants permissions . For more information about user permissions , see < a
* href = " ht... | request = beforeClientExecution ( request ) ; return executeDescribeMyUserProfile ( request ) ; |
public class ExpectedRecall { /** * Backward pass : dG / db ( x _ i ) = dG / dy dy / db ( x _ i ) = - dG / dy , \ forall x _ i \ in x * . */
public void backward ( ) { } } | double expectedRecallAdj = yAdj . getValue ( 0 ) ; VarTensor [ ] varBeliefsAdjs = inf . getOutputAdj ( ) . varBeliefs ; // Fill in the non - zero adjoints with the adjoint of the expected recall .
for ( Var var : vc . getVars ( ) ) { if ( var . getType ( ) == VarType . PREDICTED ) { varBeliefsAdjs [ var . getId ( ) ] .... |
public class HTODDynacache { /** * getTemplatesSize ( )
* This method is used by CacheMonitor to get the number of templates from the disk . */
public int getTemplatesSize ( ) { } } | int length = 0 ; if ( ! this . disableTemplatesSupport ) { try { rwLock . readLock ( ) . lock ( ) ; length = template_cache . size ( ) ; } finally { rwLock . readLock ( ) . unlock ( ) ; } if ( length < 0 ) { length = 0 ; } } return length ; |
public class MamManager { /** * Check if this MamManager ' s archive address supports MAM .
* @ return true if MAM is supported , < code > false < / code > otherwise .
* @ throws NoResponseException
* @ throws XMPPErrorException
* @ throws NotConnectedException
* @ throws InterruptedException
* @ since 4.2.... | // Note that this may return ' null ' but SDM ' s supportsFeature ( ) does the right thingTM then .
Jid archiveAddress = getArchiveAddress ( ) ; return serviceDiscoveryManager . supportsFeature ( archiveAddress , MamElements . NAMESPACE ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link RelationsType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "approx" ) public JAXBElement < RelationsType > createApprox ( RelationsType value ) { } } | return new JAXBElement < RelationsType > ( _Approx_QNAME , RelationsType . class , null , value ) ; |
public class WTableRenderer { /** * Paints the sort details .
* @ param table the table being rendered
* @ param xml the string builder in use */
private void paintSortDetails ( final WTable table , final XmlStringBuilder xml ) { } } | int col = table . getSortColumnIndex ( ) ; boolean ascending = table . isSortAscending ( ) ; xml . appendTagOpen ( "ui:sort" ) ; if ( col >= 0 ) { // Allow for column order
int [ ] cols = table . getColumnOrder ( ) ; if ( cols != null ) { for ( int i = 0 ; i < cols . length ; i ++ ) { if ( cols [ i ] == col ) { col = i... |
public class CommonUtils { /** * 将一个日期的日 , 时 , 分 , 秒 , 毫秒调整为最大值
* @ param date 一个日期
* @ return 被转化后的日期
* @ see # dateReservedMonth999 ( Calendar ) */
public static Date dateReservedMonth999 ( Date date ) { } } | Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( date ) ; return dateReservedMonth999 ( calendar ) ; |
public class AbstractSQLQuery { /** * Create an alias for the expression
* @ param alias alias
* @ return this as alias */
@ SuppressWarnings ( "unchecked" ) public SimpleExpression < T > as ( Path < ? > alias ) { } } | return Expressions . as ( this , ( Path ) alias ) ; |
public class Locale { /** * Replies the text that corresponds to the specified resource .
* @ param resource is the name of the resource file
* @ param key is the name of the resource into the specified file
* @ param defaultValue is the default value to replies if the resource does not contain the specified key ... | return getStringWithDefault ( ClassLoaderFinder . findClassLoader ( ) , detectResourceClass ( resource ) , key , defaultValue , params ) ; |
public class Snapshot { /** * A list of the cache nodes in the source cluster .
* @ return A list of the cache nodes in the source cluster . */
public java . util . List < NodeSnapshot > getNodeSnapshots ( ) { } } | if ( nodeSnapshots == null ) { nodeSnapshots = new com . amazonaws . internal . SdkInternalList < NodeSnapshot > ( ) ; } return nodeSnapshots ; |
public class Annotation { /** * Syncs the local object with the stored object for atomic writes ,
* overwriting the stored data if the user issued a PUT request
* < b > Note : < / b > This method also resets the { @ code changed } map to false
* for every field
* @ param meta The stored object to sync from
* ... | if ( note . start_time > 0 && ( note . start_time < start_time || start_time == 0 ) ) { start_time = note . start_time ; } // handle user - accessible stuff
if ( ! overwrite && ! changed . get ( "end_time" ) ) { end_time = note . end_time ; } if ( ! overwrite && ! changed . get ( "description" ) ) { description = note ... |
public class CommercePriceEntryPersistenceImpl { /** * Returns the last commerce price entry in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / ... | CommercePriceEntry commercePriceEntry = fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; if ( commercePriceEntry != null ) { return commercePriceEntry ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . appen... |
public class DoubleConstantField { /** * Loads this constant ' s settings from the Properties . If they don ' t exist this will do nothing . */
@ Override public void loadFromProperties ( Properties props ) { } } | String strValue = props . getProperty ( container . getSimpleName ( ) + "." + name ) ; if ( strValue == null ) return ; try { double doubleValue = Double . parseDouble ( strValue ) ; set ( doubleValue ) ; } catch ( NumberFormatException nfe ) { } |
public class StringVar { /** * Appends the given char .
* If this instance is currently uninitialized the given char is used for initialization .
* @ param c the char to append
* @ return true */
public boolean append ( char c ) { } } | return set ( get ( ) == null ? String . valueOf ( c ) : get ( ) + c ) ; |
public class CmsResourceRelationView { /** * Gets the relation beans to display . < p >
* @ return the list of relation beans to display */
private ArrayList < CmsResourceStatusRelationBean > getRelationBeans ( ) { } } | switch ( m_mode ) { case targets : return m_statusBean . getRelationTargets ( ) ; case sources : return m_statusBean . getRelationSources ( ) ; case siblings : default : return m_statusBean . getSiblings ( ) ; } |
public class ScriptPluginProviderLoader { /** * Remove any cache dir for the file */
private synchronized boolean removeScriptPluginCache ( ) { } } | if ( null != fileExpandedDir && fileExpandedDir . exists ( ) ) { debug ( "removeScriptPluginCache: " + fileExpandedDir ) ; return FileUtils . deleteDir ( fileExpandedDir ) ; } return true ; |
public class ContainerBase { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . api . container . ManifestContainer # addAsManifestResource ( java . lang . String ,
* java . lang . String ) */
@ Override public T addAsManifestResource ( String resourceName , String target ) throws IllegalArgumentException { ... | Validate . notNull ( resourceName , "ResourceName should be specified" ) ; Validate . notNull ( target , "Target should be specified" ) ; return addAsManifestResource ( fileFromResource ( resourceName ) , target ) ; |
public class TypeHelper { /** * Replaces the types in the callSiteType parameter if more specific types
* given through the arguments . This is in general the case , unless
* the argument is null . */
protected static MethodType replaceWithMoreSpecificType ( Object [ ] args , MethodType callSiteType ) { } } | for ( int i = 0 ; i < args . length ; i ++ ) { // if argument null , take the static type
if ( args [ i ] == null ) continue ; if ( callSiteType . parameterType ( i ) . isPrimitive ( ) ) continue ; Class argClass = args [ i ] . getClass ( ) ; callSiteType = callSiteType . changeParameterType ( i , argClass ) ; } return... |
public class PatternMap { /** * Returns { @ code true } if { @ code pattern } is a valid pattern . */
public static boolean isValidPattern ( String pattern ) { } } | if ( pattern == null ) { return false ; } String canon = pattern . replace ( '/' , '.' ) ; return ClassName . isQualifiedName ( canon ) || ClassName . isStarQualifiedName ( canon ) ; |
public class CmsAreaSelectPanel { /** * Shows or hides the select area . < p >
* @ param show if < code > true < / code > the select area will be shown */
private void showSelect ( boolean show ) { } } | if ( show ) { m_main . addStyleName ( I_CmsLayoutBundle . INSTANCE . selectAreaCss ( ) . showSelect ( ) ) ; return ; } m_main . removeStyleName ( I_CmsLayoutBundle . INSTANCE . selectAreaCss ( ) . showSelect ( ) ) ; |
public class ApiOvhDedicatedCloud { /** * Get this object properties
* REST : GET / dedicatedCloud / { serviceName } / vrack / { vrack }
* @ param serviceName [ required ] Domain of the service
* @ param vrack [ required ] vrack name */
public OvhDedicatedCloud serviceName_vrack_vrack_GET ( String serviceName , S... | String qPath = "/dedicatedCloud/{serviceName}/vrack/{vrack}" ; StringBuilder sb = path ( qPath , serviceName , vrack ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhDedicatedCloud . class ) ; |
public class ExpressionVisitor { /** * If the function is an extension function , register the namespace .
* @ param owner The current XPath object that owns the expression .
* @ param func The function currently being visited .
* @ return true to continue the visit in the subtree , if any . */
public boolean vis... | if ( func instanceof FuncExtFunction ) { String namespace = ( ( FuncExtFunction ) func ) . getNamespace ( ) ; m_sroot . getExtensionNamespacesManager ( ) . registerExtension ( namespace ) ; } else if ( func instanceof FuncExtFunctionAvailable ) { String arg = ( ( FuncExtFunctionAvailable ) func ) . getArg0 ( ) . toStri... |
public class IovArray { /** * Add a { @ link ByteBuf } to this { @ link IovArray } .
* @ param buf The { @ link ByteBuf } to add .
* @ return { @ code true } if the entire { @ link ByteBuf } has been added to this { @ link IovArray } . Note in the event
* that { @ link ByteBuf } is a { @ link CompositeByteBuf } {... | if ( count == IOV_MAX ) { // No more room !
return false ; } else if ( buf . nioBufferCount ( ) == 1 ) { final int len = buf . readableBytes ( ) ; if ( len == 0 ) { return true ; } if ( buf . hasMemoryAddress ( ) ) { return add ( buf . memoryAddress ( ) , buf . readerIndex ( ) , len ) ; } else { ByteBuffer nioBuffer = ... |
public class ByteBuddy { /** * Creates a new builder for subclassing the provided type . If the provided type is an interface , a new class implementing
* this interface type is created .
* When extending a class , Byte Buddy imitates all visible constructors of the subclassed type . Any constructor is implemented ... | return ( DynamicType . Builder < T > ) subclass ( TypeDescription . ForLoadedType . of ( superType ) ) ; |
public class JDBCBlob { /** * Retrieves all or part of the < code > BLOB < / code >
* value that this < code > Blob < / code > object represents , as an array of
* bytes . This < code > byte < / code > array contains up to < code > length < / code >
* consecutive bytes starting at position < code > pos < / code >... | final byte [ ] ldata = data ; checkValid ( ldata ) ; final int dlen = ldata . length ; if ( pos < MIN_POS || pos > MIN_POS + dlen ) { throw Util . outOfRangeArgument ( "pos: " + pos ) ; } pos -- ; if ( length < 0 || length > dlen - pos ) { throw Util . outOfRangeArgument ( "length: " + length ) ; } final byte [ ] out =... |
public class XmlConfiguration { /** * Create a new value object .
* @ param obj @ param node @ return @ exception NoSuchMethodException @ exception
* ClassNotFoundException @ exception InvocationTargetException */
private Object newObj ( Object obj , XmlParser . Node node ) throws NoSuchMethodException , ClassNotFo... | Class oClass = nodeClass ( node ) ; String id = node . getAttribute ( "id" ) ; int size = 0 ; int argi = node . size ( ) ; for ( int i = 0 ; i < node . size ( ) ; i ++ ) { Object o = node . get ( i ) ; if ( o instanceof String ) continue ; if ( ! ( ( XmlParser . Node ) o ) . getTag ( ) . equals ( "Arg" ) ) { argi = i ;... |
public class AllureThreadContext { /** * Returns last ( most recent ) uuid . */
public Optional < String > getCurrent ( ) { } } | final LinkedList < String > uuids = context . get ( ) ; return uuids . isEmpty ( ) ? Optional . empty ( ) : Optional . of ( uuids . getFirst ( ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.