signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class UpdatableResultSet { /** * { inheritDoc } . */
public void updateTime ( String columnLabel , Time value ) throws SQLException { } } | updateTime ( findColumn ( columnLabel ) , value ) ; |
public class JDBCStorageConnection { /** * Return permission values or throw an exception . We assume the node is mix : privilegeable .
* @ param cid
* Node id
* @ return list of ACL entries
* @ throws SQLException
* database error
* @ throws IllegalACLException
* if property exo : permissions is not foun... | List < AccessControlEntry > naPermissions = new ArrayList < AccessControlEntry > ( ) ; ResultSet exoPerm = findPropertyByName ( cid , Constants . EXO_PERMISSIONS . getAsString ( ) ) ; try { if ( exoPerm . next ( ) ) { do { naPermissions . add ( AccessControlEntry . parse ( new String ( exoPerm . getBytes ( COLUMN_VDATA... |
public class PartnerLogTable { /** * You ' d better be surrounded by write lock / unlock calls when you call this */
protected void addPartnerEntry ( PartnerLogData logData ) { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "addPartnerEntry" , logData ) ; final int result = _partnerLogTable . size ( ) ; _partnerLogTable . add ( result , logData ) ; // Let the entry know where it ' s been put
// Actually , fool it into thinking it ' s one entry higher to invalidate 0
logData . setIndex ( res... |
public class AppFeedItem { /** * Gets the appStore value for this AppFeedItem .
* @ return appStore * The application store that the target application belongs to . */
public com . google . api . ads . adwords . axis . v201809 . cm . AppFeedItemAppStore getAppStore ( ) { } } | return appStore ; |
public class filterpolicy { /** * Use this API to fetch filterpolicy resources of given names . */
public static filterpolicy [ ] get ( nitro_service service , String name [ ] ) throws Exception { } } | if ( name != null && name . length > 0 ) { filterpolicy response [ ] = new filterpolicy [ name . length ] ; filterpolicy obj [ ] = new filterpolicy [ name . length ] ; for ( int i = 0 ; i < name . length ; i ++ ) { obj [ i ] = new filterpolicy ( ) ; obj [ i ] . set_name ( name [ i ] ) ; response [ i ] = ( filterpolicy ... |
public class Sets { /** * Returns the difference of sets s1 and s2. */
public static < E > Set < E > diff ( Set < E > s1 , Set < E > s2 ) { } } | Set < E > s = new HashSet < E > ( ) ; for ( E o : s1 ) { if ( ! s2 . contains ( o ) ) { s . add ( o ) ; } } return s ; |
public class DefaultWelcomeFileMapping { /** * Setter
* @ param welcomeFiles welcome files */
public void setWelcomeFiles ( String [ ] welcomeFiles ) { } } | if ( welcomeFiles != null ) { this . welcomeFiles = Arrays . copyOf ( welcomeFiles , welcomeFiles . length ) ; } |
public class MtasSolrStatus { /** * Sets the key .
* @ param key
* the new key
* @ throws IOException
* Signals that an I / O exception has occurred . */
public void setKey ( String key ) throws IOException { } } | if ( this . key != null ) { throw new IOException ( "key already set" ) ; } else { this . key = Objects . requireNonNull ( key , "key required" ) ; } |
public class NIOTcpListener { /** * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . listeners . AbstractListener # stop ( ) */
@ Override public void stop ( ) { } } | if ( ! started ) return ; log . info ( "Stopping listener [" + getName ( ) + "]" ) ; // Close the listen socket
multiplexer . unregisterServerSocketHandler ( this ) ; multiplexer . stop ( ) ; multiplexer = null ; // Close remaining clients
closeRemainingClients ( ) ; started = false ; |
public class Query { /** * Validates the filters , making sure each metric has a filter
* @ throws IllegalArgumentException if one or more parameters were invalid */
private void validateFilters ( ) { } } | Set < String > ids = new HashSet < String > ( ) ; for ( Filter filter : filters ) { ids . add ( filter . getId ( ) ) ; } for ( Metric metric : metrics ) { if ( metric . getFilter ( ) != null && ! metric . getFilter ( ) . isEmpty ( ) && ! ids . contains ( metric . getFilter ( ) ) ) { throw new IllegalArgumentException (... |
public class CronTab { /** * Computes the nearest past timestamp that matched this cron tab .
* More precisely , given the time ' t ' , computes another smallest time x such that :
* < ul >
* < li > x & lt ; = t ( inclusive )
* < li > x matches this crontab
* < / ul >
* Note that if t already matches this c... | Calendar cal = new GregorianCalendar ( Locale . US ) ; cal . setTimeInMillis ( t ) ; return floor ( cal ) ; |
public class Operation { /** * If the variable is a local temporary variable it will be resized so that the operation can complete . If not
* temporary then it will not be reshaped
* @ param mat Variable containing the matrix
* @ param numRows Desired number of rows
* @ param numCols Desired number of columns *... | if ( mat . isTemp ( ) ) { mat . matrix . reshape ( numRows , numCols ) ; } |
public class ZooKeeperUtils { /** * Starts a { @ link CuratorFramework } instance and connects it to the given ZooKeeper
* quorum .
* @ param configuration { @ link Configuration } object containing the configuration values
* @ return { @ link CuratorFramework } instance */
public static CuratorFramework startCur... | Preconditions . checkNotNull ( configuration , "configuration" ) ; String zkQuorum = configuration . getValue ( HighAvailabilityOptions . HA_ZOOKEEPER_QUORUM ) ; if ( zkQuorum == null || StringUtils . isBlank ( zkQuorum ) ) { throw new RuntimeException ( "No valid ZooKeeper quorum has been specified. " + "You can speci... |
public class RuleParser { /** * Set indicated external - xacml3 node to be the leaves of the MIDD
* @ param midd
* @ param extNode */
@ SuppressWarnings ( "rawtypes" ) private void setEffectNode ( AbstractNode midd , ExternalNode3 extNode ) throws MIDDException { } } | // Replace current external nodes in the MIDD with the extNode ( XACML 3 external node )
if ( ! ( midd instanceof InternalNode ) ) { throw new IllegalArgumentException ( "MIDD argument must not be an ExternalNode" ) ; } InternalNode currentNode = ( InternalNode ) midd ; Stack < InternalNode > stackNodes = new Stack < I... |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public MDDXmBase createMDDXmBaseFromString ( EDataType eDataType , String initialValue ) { } } | MDDXmBase result = MDDXmBase . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class AmazonRoute53ResolverClient { /** * Gets information about a specified resolver endpoint , such as whether it ' s an inbound or an outbound resolver
* endpoint , and the current status of the endpoint .
* @ param getResolverEndpointRequest
* @ return Result of the GetResolverEndpoint operation return... | request = beforeClientExecution ( request ) ; return executeGetResolverEndpoint ( request ) ; |
public class AttributeKeyAndValueMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AttributeKeyAndValue attributeKeyAndValue , ProtocolMarshaller protocolMarshaller ) { } } | if ( attributeKeyAndValue == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attributeKeyAndValue . getKey ( ) , KEY_BINDING ) ; protocolMarshaller . marshall ( attributeKeyAndValue . getValue ( ) , VALUE_BINDING ) ; } catch ( Exception e ) ... |
public class MetricsInputStream { /** * { @ inheritDoc }
* Record the read time into the metrics . */
@ Override public int read ( ) throws IOException { } } | if ( metrics != null ) { metrics . startEvent ( Field . HttpSocketReadTime ) ; } try { return in . read ( ) ; } finally { if ( metrics != null ) { metrics . endEvent ( Field . HttpSocketReadTime ) ; } } |
public class TrackerMeanShiftLikelihood { /** * Used to set the location of the track without changing any appearance history .
* @ param location new location */
public void setTrackLocation ( RectangleLength2D_I32 location ) { } } | this . location . set ( location ) ; // massage the rectangle so that it has an odd width and height
// otherwise it could experience a bias when localizing
this . location . width += 1 - this . location . width % 2 ; this . location . height += 1 - this . location . height % 2 ; failed = false ; |
public class ReportServlet { /** * { @ inheritDoc } */
@ Override public void init ( ServletConfig config ) { } } | this . servletConfig = config ; httpAuth = new HttpAuth ( ) ; LOG . debug ( "JavaMelody report servlet initialized" ) ; |
public class ICECandidate { /** * Compare the to other Transport candidate .
* @ param arg another Transport candidate
* @ return a negative integer , zero , or a positive integer as this
* object is less than , equal to , or greater than the specified
* object */
@ Override public int compareTo ( ICECandidate ... | if ( getPreference ( ) < arg . getPreference ( ) ) { return - 1 ; } else if ( getPreference ( ) > arg . getPreference ( ) ) { return 1 ; } return 0 ; |
public class ClassNode { /** * Specify the class represented by this ` ClassNode ` extends
* a class with the name specified
* @ param name the name of the parent class
* @ return this ` ClassNode ` instance */
public ClassNode parent ( String name ) { } } | this . parent = infoBase . node ( name ) ; this . parent . addChild ( this ) ; for ( ClassNode intf : parent . interfaces . values ( ) ) { addInterface ( intf ) ; } return this ; |
public class ExperimentHelper { /** * To check if two input date string is same date with no matter about 2nd
* input ' s separator
* @ param date1 1st input date string with format yyyymmdd
* @ param date2 2nd input date string with format mmdd or mm - dd
* @ param separator The separator used in 2nd string
... | date2 = date2 . replace ( separator , "" ) ; if ( date2 . equals ( "0229" ) ) { try { int year1 = Integer . parseInt ( date1 . substring ( 2 , 4 ) ) ; if ( year1 % 4 != 0 ) { return date1 . endsWith ( "0228" ) ; } } catch ( Exception e ) { return false ; } } return date1 . endsWith ( date2 ) ; |
public class ResourceRecordSet { /** * Information about the resource records to act upon .
* < note >
* If you ' re creating an alias resource record set , omit < code > ResourceRecords < / code > .
* < / note >
* @ param resourceRecords
* Information about the resource records to act upon . < / p > < note >... | if ( resourceRecords == null ) { this . resourceRecords = null ; return ; } this . resourceRecords = new com . amazonaws . internal . SdkInternalList < ResourceRecord > ( resourceRecords ) ; |
public class ElemNumber { /** * This function is called after everything else has been
* recomposed , and allows the template to set remaining
* values that may be based on some other property that
* depends on recomposition . */
public void compose ( StylesheetRoot sroot ) throws TransformerException { } } | super . compose ( sroot ) ; StylesheetRoot . ComposeState cstate = sroot . getComposeState ( ) ; java . util . Vector vnames = cstate . getVariableNames ( ) ; if ( null != m_countMatchPattern ) m_countMatchPattern . fixupVariables ( vnames , cstate . getGlobalsSize ( ) ) ; if ( null != m_format_avt ) m_format_avt . fix... |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcAnnotationSurfaceOccurrence ( ) { } } | if ( ifcAnnotationSurfaceOccurrenceEClass == null ) { ifcAnnotationSurfaceOccurrenceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 18 ) ; } return ifcAnnotationSurfaceOccurrenceEClass ; |
public class Backend { /** * Get information about all registered { @ link IndexProvider } s .
* @ return */
public Map < String , IndexInformation > getIndexInformation ( ) { } } | ImmutableMap . Builder < String , IndexInformation > copy = ImmutableMap . builder ( ) ; copy . putAll ( indexes ) ; return copy . build ( ) ; |
public class LocalTypeDetector { /** * implements the visitor to create and clear the stack and suspectLocals
* @ param classContext
* the context object of the currently parsed class */
@ Override public void visitClassContext ( ClassContext classContext ) { } } | try { stack = new OpcodeStack ( ) ; suspectLocals = new HashMap < > ( ) ; classVersion = classContext . getJavaClass ( ) . getMajor ( ) ; super . visitClassContext ( classContext ) ; } finally { stack = null ; suspectLocals = null ; } |
public class ReflectiveInterceptor { /** * Called to satisfy an invocation of java . lang . Class . getDeclaredAnnotations ( ) .
* @ param clazz the class upon which the original call was being invoked
* @ return array of annotations on the class */
public static Annotation [ ] jlClassGetDeclaredAnnotations ( Class... | if ( TypeRegistry . nothingReloaded ) { return clazz . getDeclaredAnnotations ( ) ; } ReloadableType rtype = getReloadableTypeIfHasBeenReloaded ( clazz ) ; if ( rtype == null ) { return clazz . getDeclaredAnnotations ( ) ; } CurrentLiveVersion clv = rtype . getLiveVersion ( ) ; return clv . getExecutorClass ( ) . getDe... |
public class DateUtils { /** * 生成java . util . Date类型的对象
* @ param year int 年
* @ param month int 月
* @ param day int 日
* @ return Date java . util . Date类型的对象 */
public static Date getDate ( int year , int month , int day ) { } } | GregorianCalendar d = new GregorianCalendar ( year , month - 1 , day ) ; return d . getTime ( ) ; |
public class ExpressionUtils { /** * Convert the given like pattern to a regex pattern
* @ param expr expression to be converted
* @ param matchStartAndEnd if start and end should be matched as well
* @ return converted expression */
@ SuppressWarnings ( "unchecked" ) public static Expression < String > likeToReg... | // TODO : this should take the escape character into account
if ( expr instanceof Constant < ? > ) { final String like = expr . toString ( ) ; final StringBuilder rv = new StringBuilder ( like . length ( ) + 4 ) ; if ( matchStartAndEnd && ! like . startsWith ( "%" ) ) { rv . append ( '^' ) ; } for ( int i = 0 ; i < lik... |
public class ByteBufferUtils { /** * 查看ByteBuffer数组是否还有剩余
* @ param buffers ByteBuffers
* @ return have remaining */
public static final boolean hasRemaining ( ByteBuffer [ ] buffers ) { } } | if ( buffers == null ) { return false ; } for ( int i = 0 ; i < buffers . length ; i ++ ) { if ( buffers [ i ] != null && buffers [ i ] . hasRemaining ( ) ) { return true ; } } return false ; |
public class ManagementVertex { /** * Returns the input gate at the given index .
* @ param index
* the index of the input gate to be returned
* @ return the input gate at the given index or < code > null < / code > if no such input gate exists */
public ManagementGate getInputGate ( final int index ) { } } | if ( index < this . inputGates . size ( ) ) { return this . inputGates . get ( index ) ; } return null ; |
public class SimpleEntry { /** * { @ inheritDoc } */
@ Override public T setValue ( T value ) { } } | T old = array [ actualIndex ] ; array [ actualIndex ] = value ; return old ; |
public class Arrangement { /** * 排列选择 ( 从列表中选择m个排列 )
* @ param m 选择个数
* @ return 所有排列列表 */
public List < String [ ] > select ( int m ) { } } | final List < String [ ] > result = new ArrayList < > ( ( int ) count ( this . datas . length , m ) ) ; select ( new String [ m ] , 0 , result ) ; return result ; |
public class CmsAliasManager { /** * Checks that the user has permissions for a mass edit operation in a given site . < p >
* @ param cms the current CMS context
* @ param siteRoot the site for which the permissions should be checked
* @ throws CmsException if something goes wrong */
private void checkPermissions... | String originalSiteRoot = cms . getRequestContext ( ) . getSiteRoot ( ) ; try { cms . getRequestContext ( ) . setSiteRoot ( siteRoot ) ; checkPermissionsForMassEdit ( cms ) ; } finally { cms . getRequestContext ( ) . setSiteRoot ( originalSiteRoot ) ; } |
public class SameDiff { /** * Evaluation for multiple output networks - one ore more
* See { @ link # evaluate ( MultiDataSetIterator , Map , Map ) } */
public void evaluateMultiple ( DataSetIterator iterator , Map < String , List < IEvaluation > > variableEvals ) { } } | Map < String , Integer > map = new HashMap < > ( ) ; for ( String s : variableEvals . keySet ( ) ) { map . put ( s , 0 ) ; // Only 1 possible output here with DataSetIterator
} evaluate ( new MultiDataSetIteratorAdapter ( iterator ) , variableEvals , map ) ; |
public class FullTextSearchParser { /** * Parse the full - text search criteria given in the supplied string .
* @ param fullTextSearchExpression the full - text search expression ; may not be null
* @ return the term representation of the full - text search , or null if there are no terms
* @ throws ParsingExcep... | CheckArg . isNotNull ( fullTextSearchExpression , "fullTextSearchExpression" ) ; Tokenizer tokenizer = new TermTokenizer ( ) ; TokenStream stream = new TokenStream ( fullTextSearchExpression , tokenizer , false ) ; return parse ( stream . start ( ) ) ; |
public class DefaultDataLoader { /** * Execute a DBUbit operation */
private void executeOperation ( DbUnitDatabasePopulator populator , DataSource dataSource ) throws Exception { } } | Connection connection = null ; try { connection = getConnection ( dataSource ) ; populator . populate ( connection ) ; } finally { if ( connection != null && ! isConnectionTransactional ( connection , dataSource ) ) { // if the connection is transactional , closing it . Otherwise ,
// expects that the framework will do... |
public class LogPanel { /** * Get an existing or create a new progress bar .
* @ param prog Progress
* @ return Associated progress bar . */
private JProgressBar getOrCreateProgressBar ( Progress prog ) { } } | JProgressBar pbar = pbarmap . get ( prog ) ; // Add a new progress bar .
if ( pbar == null ) { synchronized ( pbarmap ) { if ( prog instanceof FiniteProgress ) { pbar = new JProgressBar ( 0 , ( ( FiniteProgress ) prog ) . getTotal ( ) ) ; pbar . setStringPainted ( true ) ; } else if ( prog instanceof IndefiniteProgress... |
public class SURT { /** * Allow class to be used as a command - line tool for converting
* URL lists ( or naked host or host / path fragments implied
* to be HTTP URLs ) to SURT form . Lines that cannot be converted
* are returned unchanged .
* Read from stdin or first file argument . Writes to stdout or
* se... | InputStream in = args . length > 0 ? new BufferedInputStream ( new FileInputStream ( args [ 0 ] ) ) : System . in ; PrintStream out = args . length > 1 ? new PrintStream ( new BufferedOutputStream ( new FileOutputStream ( args [ 1 ] ) ) ) : System . out ; BufferedReader br = new BufferedReader ( new InputStreamReader (... |
public class Treebank { /** * Return various statistics about the treebank ( number of sentences ,
* words , tag set , etc . ) .
* @ param tlp The TreebankLanguagePack used to determine punctuation and an
* appropriate character encoding
* @ return A big string for human consumption describing the treebank */
p... | int numTrees = 0 ; int numTreesLE40 = 0 ; int numNonUnaryRoots = 0 ; Tree nonUnaryEg = null ; ClassicCounter < Tree > nonUnaries = new ClassicCounter < Tree > ( ) ; ClassicCounter < String > roots = new ClassicCounter < String > ( ) ; ClassicCounter < String > starts = new ClassicCounter < String > ( ) ; ClassicCounter... |
public class SerializerObjectMarshallingStrategy { /** * { @ inheritDoc } */
@ Override public Object unmarshal ( Context context , ObjectInputStream is , byte [ ] object , ClassLoader classloader ) throws IOException , ClassNotFoundException { } } | return _serializer . deserialize ( object , Object . class ) ; |
public class DefaultWhenFileSystem { /** * Returns properties of the file - system being used by the specified { @ code path } , asynchronously .
* @ param path path to anywhere on the filesystem
* @ return a promise for the file system properties */
@ Override public Promise < FileSystemProps > fsProps ( String pa... | return adapter . toPromise ( handler -> vertx . fileSystem ( ) . fsProps ( path , handler ) ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIDESize ( ) { } } | if ( ideSizeEClass == null ) { ideSizeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 389 ) ; } return ideSizeEClass ; |
public class LessLookAheadReader { /** * Skip all data until a newline occur or an EOF
* @ throws LessException if an IO error occur */
void skipLine ( ) { } } | int ch ; do { try { ch = reader . read ( ) ; } catch ( IOException ex ) { throw new LessException ( ex ) ; } incLineColumn ( ch ) ; } while ( ch != '\n' && ch != - 1 ) ; |
public class MoskitoHttpServlet { /** * Override this method to react on http put method . */
protected void moskitoDoPut ( HttpServletRequest req , HttpServletResponse res ) throws ServletException , IOException { } } | super . doPut ( req , res ) ; |
public class NotificationHandlerNodeSubregistry { /** * Get or create a new registry child for the given { @ code elementValue } and traverse it to register the entry . */
void registerEntry ( ListIterator < PathElement > iterator , String elementValue , ConcreteNotificationHandlerRegistration . NotificationHandlerEntr... | final NotificationHandlerNodeRegistry newRegistry = new NotificationHandlerNodeRegistry ( elementValue , this ) ; final NotificationHandlerNodeRegistry existingRegistry = childRegistriesUpdater . putIfAbsent ( this , elementValue , newRegistry ) ; final NotificationHandlerNodeRegistry registry = existingRegistry != nul... |
public class PoolablePreparedStatement { /** * Method setClob .
* @ param parameterIndex
* @ param x
* @ throws SQLException
* @ see java . sql . PreparedStatement # setClob ( int , Clob ) */
@ Override public void setClob ( int parameterIndex , Clob x ) throws SQLException { } } | internalStmt . setClob ( parameterIndex , x ) ; |
public class AWSElasticBeanstalkClient { /** * Modifies lifecycle settings for an application .
* @ param updateApplicationResourceLifecycleRequest
* @ return Result of the UpdateApplicationResourceLifecycle operation returned by the service .
* @ throws InsufficientPrivilegesException
* The specified account d... | request = beforeClientExecution ( request ) ; return executeUpdateApplicationResourceLifecycle ( request ) ; |
public class HaltonUniformDistribution { /** * Compute the radical inverse of i .
* @ param i Input long value
* @ return Double radical inverse */
private double radicalInverse ( long i ) { } } | double digit = 1.0 / ( double ) base ; double radical = digit ; double inverse = 0.0 ; while ( i > 0 ) { inverse += digit * ( double ) ( i % base ) ; digit *= radical ; i /= base ; } return inverse ; |
public class DataViewMessageBodyWriter { /** * { @ inheritDoc } */
@ Override public boolean isWriteable ( final Class < ? > type , final Type genericType , final Annotation [ ] annotations , final MediaType mediaType ) { } } | String [ ] p ; return ! dataViewDisabled && - 1 != ListUtils . indexOf ( requestProvider . get ( ) . getAcceptableMediaTypes ( ) , this :: isSupportMediaType ) && ( ( p = TemplateHelper . getProduces ( annotations ) ) == null || - 1 != ArrayUtils . indexOf ( p , ( Predicate < String > ) stringType -> { if ( stringType ... |
public class SipNetworkInterfaceManagerImpl { /** * If the host is Ipv6 , get the host without " [ " and " ] "
* If the host is Ipv4 , get the host as normal .
* @ param host
* @ return host without square brackets */
private String extractIPV6Brackets ( String host ) { } } | String ret = host ; // IPv6 here , remove square brackets
if ( host . indexOf ( ':' ) != - 1 ) { int startPoint = host . indexOf ( '[' ) ; int endPoint = host . indexOf ( ']' ) ; if ( endPoint == - 1 ) endPoint = host . length ( ) ; if ( startPoint != - 1 ) { ret = host . substring ( startPoint + 1 , endPoint ) ; } els... |
public class ST_MakeLine { /** * Constructs a LINESTRING from the given POINTs or MULTIPOINTs
* @ param pointA The first POINT or MULTIPOINT
* @ param optionalPoints Optional POINTs or MULTIPOINTs
* @ return The LINESTRING constructed from the given POINTs or MULTIPOINTs
* @ throws SQLException */
public static... | if ( pointA == null || optionalPoints . length > 0 && optionalPoints [ 0 ] == null ) { return null ; } if ( pointA . getNumGeometries ( ) == 1 && ! atLeastTwoPoints ( optionalPoints , countPoints ( pointA ) ) ) { throw new SQLException ( "At least two points are required to make a line." ) ; } List < Coordinate > coord... |
public class Radar { /** * Adds a new point of interest to the list of poi ' s of the radar
* Keep in mind that only the poi ' s are visible as blips that are
* in the range of the radar .
* @ param BLIP */
public void addPoi ( final Poi BLIP ) { } } | if ( pois . keySet ( ) . contains ( BLIP . getName ( ) ) ) { updatePoi ( BLIP . getName ( ) , BLIP . getLocation ( ) ) ; } else { pois . put ( BLIP . getName ( ) , BLIP ) ; } checkForBlips ( ) ; |
public class AbstractPojoPathNavigator { /** * This method gets the value for the single { @ link CachingPojoPath # getSegment ( ) segment } of the given
* { @ code currentPath } from the { @ link CachingPojoPath # getPojo ( ) pojo } of its { @ link CachingPojoPath # getParent ( )
* parent } . < br >
* If the { @... | "unchecked" , "rawtypes" } ) protected Object get ( CachingPojoPath currentPath , PojoPathContext context , PojoPathState state ) { Object result ; String functionName = currentPath . getFunction ( ) ; if ( functionName != null ) { // current segment is a function . . .
PojoPathFunction function = getFunction ( functio... |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcConstructionEquipmentResourceTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class TwitterEndpointServices { /** * Invokes the { @ value TwitterConstants # TWITTER _ ENDPOINT _ VERIFY _ CREDENTIALS } endpoint in order to obtain a value to use for
* the user subject .
* @ param config
* @ param accessToken
* @ param accessTokenSecret
* @ return */
public Map < String , Object > ... | String endpointUrl = config . getUserApi ( ) ; try { SocialUtil . validateEndpointWithQuery ( endpointUrl ) ; } catch ( SocialLoginException e ) { return createErrorResponse ( "TWITTER_BAD_USER_API_URL" , new Object [ ] { endpointUrl , TwitterLoginConfigImpl . KEY_userApi , config . getUniqueId ( ) , e . getLocalizedMe... |
public class Expressions { /** * Create a new EnumExpression
* @ param value enum
* @ return new EnumExpression */
public static < T extends Enum < T > > EnumExpression < T > asEnum ( T value ) { } } | return asEnum ( constant ( value ) ) ; |
public class SchemasInner { /** * Creates or updates an integration account schema .
* @ param resourceGroupName The resource group name .
* @ param integrationAccountName The integration account name .
* @ param schemaName The integration account schema name .
* @ param schema The integration account schema . ... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , integrationAccountName , schemaName , schema ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class JCusolverSp { /** * < pre >
* - - - - - GPU linear solver by QR factorization
* solve A * x = b , A can be singular
* [ ls ] stands for linear solve
* [ v ] stands for vector
* [ qr ] stands for QR factorization
* < / pre > */
public static int cusolverSpScsrlsvqr ( cusolverSpHandle handle , in... | return checkResult ( cusolverSpScsrlsvqrNative ( handle , m , nnz , descrA , csrVal , csrRowPtr , csrColInd , b , tol , reorder , x , singularity ) ) ; |
public class MatrixFactory { /** * Creates and initializes a new 3D column vector .
* @ param x the x coordinate of the new vector
* @ param y the y coordinate of the new vector
* @ param z the z coordinate of the new vector
* @ return the new vector */
public static Vector3 createVector ( double x , double y ,... | Vector3 v = new Vector3Impl ( ) ; v . setX ( x ) ; v . setY ( y ) ; v . setZ ( z ) ; return v ; |
public class Projection { /** * / / CLAUSES / / / / */
public Clause field ( String field , Object value ) { } } | return new CustomFormatClause ( Operator . FIELD , this , field , cast ( value ) ) ; |
public class EventHandler { /** * Triggers a state transition event to @ newState with an identifier
* ( eg , requestId , jobUUID , etc )
* @ param newState new state
* @ param identifier event id */
void triggerStateTransition ( BasicEvent . QueryState newState , String identifier ) { } } | String msg = "{newState: " + newState . getDescription ( ) + ", " + "info: " + identifier + ", " + "timestamp: " + getCurrentTimestamp ( ) + "}" ; Event triggeredEvent = new BasicEvent ( Event . EventType . STATE_TRANSITION , msg ) ; pushEvent ( triggeredEvent , false ) ; |
public class CPOptionCategoryLocalServiceBaseImpl { /** * Returns all the cp option categories matching the UUID and company .
* @ param uuid the UUID of the cp option categories
* @ param companyId the primary key of the company
* @ return the matching cp option categories , or an empty list if no matches were f... | return cpOptionCategoryPersistence . findByUuid_C ( uuid , companyId ) ; |
public class DoradusServer { /** * Start the Doradus Server in stand - alone mode , overriding doradus . yaml file options
* with the given options . All required services plus default _ services and
* storage _ services configured in doradus . yaml are started . The process blocks until a
* shutdown signal is re... | try { instance ( ) . initStandAlone ( args ) ; instance ( ) . start ( ) ; instance ( ) . waitForShutdown ( ) ; } catch ( Throwable e ) { instance ( ) . m_logger . error ( "Abnormal shutdown" , e ) ; System . exit ( 1 ) ; // invokes shutdown hooks
} |
public class ProofObligation { /** * Create a multiple type bind with a varargs list of pattern variables , like a , b , c : T . This is used by several
* obligations . */
protected PMultipleBind getMultipleTypeBind ( PType patternType , ILexNameToken ... patternNames ) { } } | ATypeMultipleBind typeBind = new ATypeMultipleBind ( ) ; List < PPattern > patternList = new Vector < PPattern > ( ) ; for ( ILexNameToken patternName : patternNames ) { AIdentifierPattern pattern = new AIdentifierPattern ( ) ; pattern . setName ( patternName . clone ( ) ) ; patternList . add ( pattern ) ; } typeBind .... |
public class AbstractContext { /** * Destroy the Contextual Instance of the given Bean .
* @ param bean dictates which bean shall get cleaned up
* @ return < code > true < / code > if the bean was destroyed , < code > false < / code > if there was no such bean . */
public boolean destroy ( Contextual bean ) { } } | ContextualStorage storage = getContextualStorage ( false ) ; if ( storage == null ) { return false ; } ContextualInstanceInfo < ? > contextualInstanceInfo = storage . getStorage ( ) . get ( storage . getBeanKey ( bean ) ) ; if ( contextualInstanceInfo == null ) { return false ; } bean . destroy ( contextualInstanceInfo... |
public class AgentOutput { /** * Write bytes to an { @ link OutputStream } and prepend with four bytes indicating their length .
* @ param out { @ link OutputStream }
* @ param bytes Array of bytes . */
private static void writeField ( final OutputStream out , final byte [ ] bytes ) throws IOException { } } | // All protocol messages are prefixed with their length in bytes , encoded
// as a 32 bit unsigned integer .
final ByteBuffer buffer = ByteBuffer . allocate ( INT_BYTES + bytes . length ) ; buffer . putInt ( bytes . length ) ; buffer . put ( bytes ) ; out . write ( buffer . array ( ) ) ; out . flush ( ) ; |
public class IOUtils { /** * Copy the input stream to the output stream */
public static void copyStream ( OutputStream outs , InputStream ins ) throws IOException { } } | try { byte [ ] bytes = new byte [ 1024 ] ; int r = ins . read ( bytes ) ; while ( r > 0 ) { outs . write ( bytes , 0 , r ) ; r = ins . read ( bytes ) ; } } catch ( IOException e ) { throw e ; } finally { ins . close ( ) ; } |
public class HttpMessage { /** * Gets the Http response status code .
* @ return The status code of the message */
public HttpStatus getStatusCode ( ) { } } | final Object statusCode = getHeader ( HttpMessageHeaders . HTTP_STATUS_CODE ) ; if ( statusCode != null ) { if ( statusCode instanceof HttpStatus ) { return ( HttpStatus ) statusCode ; } else if ( statusCode instanceof Integer ) { return HttpStatus . valueOf ( ( Integer ) statusCode ) ; } else { return HttpStatus . val... |
public class ResponderTask { /** * Set up a chained ResponderTask , where the new instance will use the same input / output streams and buffers .
* However they must both be invoked individually , use { @ link # createSequence ( Responder ,
* ResponderTask . ResultHandler ) } to set up a sequential invocation of
... | return new ResponderTask ( responder , reader , outputStream , resultHandler , partialLineBuffer ) ; |
public class XNElement { /** * Save the tree into the given XML stream writer .
* @ param stream the stream writer
* @ throws XMLStreamException if an error occurs */
public void save ( XMLStreamWriter stream ) throws XMLStreamException { } } | stream . writeStartDocument ( "UTF-8" , "1.0" ) ; saveInternal ( stream ) ; stream . writeEndDocument ( ) ; |
public class CompleteWorkflowExecutionFailedEventAttributesMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CompleteWorkflowExecutionFailedEventAttributes completeWorkflowExecutionFailedEventAttributes , ProtocolMarshaller protocolMarshaller ) { } } | if ( completeWorkflowExecutionFailedEventAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( completeWorkflowExecutionFailedEventAttributes . getCause ( ) , CAUSE_BINDING ) ; protocolMarshaller . marshall ( completeWorkflowExecutio... |
public class DocumentBuilderFactory { /** * < p > Set the { @ link Schema } to be used by parsers created
* from this factory .
* When a { @ link Schema } is non - null , a parser will use a validator
* created from it to validate documents before it passes information
* down to the application .
* < p > When... | throw new UnsupportedOperationException ( "This parser does not support specification \"" + this . getClass ( ) . getPackage ( ) . getSpecificationTitle ( ) + "\" version \"" + this . getClass ( ) . getPackage ( ) . getSpecificationVersion ( ) + "\"" ) ; |
public class S3ObjectWriter { /** * Non - blocking call that will throw any Exceptions in the traditional
* manner on access
* @ param key
* @ param value
* @ return */
public Eval < UploadResult > putAsync ( String key , Object value ) { } } | return Eval . later ( ( ) -> put ( key , value ) ) . map ( t -> t . orElse ( null ) ) . map ( FluentFunctions . ofChecked ( up -> up . waitForUploadResult ( ) ) ) ; |
public class FileUtils { /** * Creates a file system directory with the given { @ link File } path .
* @ param path the given { @ link File } indicating the file system path of the directory to create .
* @ return true if the path represented by the { @ link File } object is not null , is not an existing file ,
*... | return ( path != null && ! path . isFile ( ) && ( path . isDirectory ( ) || path . mkdirs ( ) ) ) ; |
public class PluralCodeGenerator { /** * Builds a method that when called evaluates the rule and returns a PluralCategory . */
private MethodSpec buildRuleMethod ( String methodName , PluralData data , Map < String , FieldSpec > fieldMap ) { } } | MethodSpec . Builder method = MethodSpec . methodBuilder ( methodName ) . addModifiers ( PRIVATE , STATIC ) . addParameter ( NUMBER_OPERANDS , "o" ) . returns ( PLURAL_CATEGORY ) ; for ( Map . Entry < String , PluralData . Rule > entry : data . rules ( ) . entrySet ( ) ) { String category = entry . getKey ( ) ; // Othe... |
public class ExpirationManagerImpl { /** * Deletes the key from the store as well as notifies the cache listeners of the expiration of the given key ,
* value , metadata combination .
* This method must be invoked while holding data container lock for the given key to ensure events are ordered
* properly .
* @ ... | deleteFromStores ( key ) ; CompletionStages . join ( cacheNotifier . notifyCacheEntryExpired ( key , value , metadata , null ) ) ; |
public class Points { /** * Returns the Manhattan distance between the specified two points . */
public static int manhattanDistance ( int x1 , int y1 , int x2 , int y2 ) { } } | return Math . abs ( x2 - x1 ) + Math . abs ( y2 - y1 ) ; |
public class DeviceImpl { /** * Get device description .
* It ' s the master method executed when the device description is requested
* via a CORBA attribute . It updates the device black - box and return the
* device description field
* @ return The device description */
public String description ( ) { } } | Util . out4 . println ( "DeviceImpl.description() arrived" ) ; // Record attribute request in black box
blackbox . insert_attr ( Attr_Description ) ; // Return data to caller
Util . out4 . println ( "Leaving DeviceImpl.description()" ) ; return desc ; |
public class SRTCPCryptoContext { /** * Derive a new SRTPCryptoContext for use with a new SSRC
* This method returns a new SRTPCryptoContext initialized with the data of
* this SRTPCryptoContext . Replacing the SSRC , Roll - over - Counter , and the
* key derivation rate the application cab use this SRTPCryptoCon... | SRTCPCryptoContext pcc = null ; pcc = new SRTCPCryptoContext ( ssrc , masterKey , masterSalt , policy ) ; return pcc ; |
public class XMLSerializer { /** * Creates a JSON value from a File .
* @ param path
* @ return a JSONNull , JSONObject or JSONArray
* @ throws JSONException if the conversion from XML to JSON can ' t be made for
* I / O or format reasons . */
public JSON readFromFile ( String path ) { } } | return readFromStream ( Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( path ) ) ; |
public class GeneralFactory { /** * 获取ThriftServer对象 */
@ Override public ThriftServer getThriftServer ( String serverName , int serverPort , TProcessor processor ) { } } | return new ThreadPoolThriftServerImpl ( serverName , serverPort , thriftServerConfiguration , processor ) ; |
public class BoxFactory { /** * Create the viewport and the underlying box tree from a DOM tree .
* @ param root the root element of the source DOM tree .
* @ param g the root graphic context . Copies of this context will be used for the individual boxes .
* @ param ctx the visual context ( computed style ) . Cop... | Element vp = createAnonymousElement ( root . getOwnerDocument ( ) , "Xdiv" , "block" ) ; viewport = new Viewport ( vp , g , ctx , this , root , width , height ) ; viewport . setConfig ( config ) ; overflowPropagated = false ; BoxTreeCreationStatus stat = new BoxTreeCreationStatus ( viewport ) ; createSubtree ( root , s... |
public class Util { /** * Create a { @ link io . kickflip . sdk . av . SessionConfig }
* corresponding to a 420p video stream
* @ param context the host application Context . Used to access Internal Storage
* @ return the resulting SessionConfig */
public static SessionConfig create420pSessionConfig ( Context con... | String outputPath = new File ( context . getFilesDir ( ) , "index.m3u8" ) . getAbsolutePath ( ) ; SessionConfig config = new SessionConfig . Builder ( outputPath ) . withTitle ( Util . getHumanDateString ( ) ) . withVideoBitrate ( 1 * 1000 * 1000 ) . withPrivateVisibility ( false ) . withLocation ( true ) . withVideoRe... |
public class Tools { /** * Set dialog location to the center of the screen
* @ param dialog the dialog which will be centered
* @ since 2.6 */
public static void centerDialog ( JDialog dialog ) { } } | Dimension screenSize = Toolkit . getDefaultToolkit ( ) . getScreenSize ( ) ; Dimension frameSize = dialog . getSize ( ) ; dialog . setLocation ( screenSize . width / 2 - frameSize . width / 2 , screenSize . height / 2 - frameSize . height / 2 ) ; dialog . setLocationByPlatform ( true ) ; |
public class HazelcastInstanceFactory { /** * Creates a new Hazelcast instance .
* @ param config the configuration to use ; if < code > null < / code > , the set of defaults
* as specified in the XSD for the configuration XML will be used .
* @ param instanceName the name of the { @ link HazelcastInstance }
* ... | if ( config == null ) { config = new XmlConfigBuilder ( ) . build ( ) ; } String name = getInstanceName ( instanceName , config ) ; InstanceFuture future = new InstanceFuture ( ) ; if ( INSTANCE_MAP . putIfAbsent ( name , future ) != null ) { throw new DuplicateInstanceNameException ( "HazelcastInstance with name '" + ... |
public class Redisson { /** * Create Reactive Redisson instance with provided config
* @ param config for Redisson
* @ return Redisson instance */
public static RedissonReactiveClient createReactive ( Config config ) { } } | RedissonReactive react = new RedissonReactive ( config ) ; if ( config . isReferenceEnabled ( ) ) { react . enableRedissonReferenceSupport ( ) ; } return react ; |
public class Polygon { /** * Check the exterior ring and all interior rings for validity . Also checks to see if there are no intersections
* between any of the rings ( both exterior and interior ) . */
public boolean isValid ( ) { } } | if ( isEmpty ( ) ) { return true ; } if ( ! exteriorRing . isValid ( ) ) { return false ; } if ( interiorRings != null ) { LinearRing ring1 ; LinearRing ring2 ; for ( int i = 0 ; i <= interiorRings . length ; i ++ ) { if ( i == interiorRings . length ) { ring1 = exteriorRing ; } else { ring1 = interiorRings [ i ] ; if ... |
public class SwaggerBuilder { /** * Registers a ControllerHandler as a Swagger Operation .
* If the path for the operation is unrecognized , a new Swagger Path is created .
* @ param swagger
* @ param route
* @ param handler */
protected void registerOperation ( Swagger swagger , Route route , ControllerHandler... | Class < ? extends Controller > controller = handler . getControllerClass ( ) ; Method method = handler . getControllerMethod ( ) ; List < String > accepts = ControllerUtil . cleanupFuzzyContentTypes ( handler . getDeclaredConsumes ( ) ) ; List < String > produces = handler . getDeclaredProduces ( ) ; Operation operatio... |
public class CmsToolManager { /** * Redirects to the given page with the given parameters . < p >
* @ param wp the workplace object
* @ param pagePath the path to the page to redirect to
* @ param params the parameters to send
* @ throws IOException in case of errors during forwarding
* @ throws ServletExcept... | Map < String , String [ ] > newParams = createToolParams ( wp , pagePath , params ) ; if ( pagePath . indexOf ( "?" ) > 0 ) { pagePath = pagePath . substring ( 0 , pagePath . indexOf ( "?" ) ) ; } wp . setForwarded ( true ) ; // forward to the requested page uri
CmsRequestUtil . forwardRequest ( wp . getJsp ( ) . link ... |
public class SendDocument { /** * Use this method to set the document to a new file
* @ param file New document file */
public SendDocument setDocument ( File file ) { } } | Objects . requireNonNull ( file , "documentName cannot be null!" ) ; this . document = new InputFile ( file , file . getName ( ) ) ; return this ; |
public class AuthResourceRepresentation { /** * Creates a resource representation for use in authorization of actions pertaining to the specified stream within
* the specified scope .
* @ param scopeName the name of the scope
* @ param streamName the name of the stream
* @ return a string representing the speci... | Exceptions . checkNotNullOrEmpty ( streamName , "streamName" ) ; return String . format ( "%s/%s" , ofStreamsInScope ( scopeName ) , streamName ) ; |
public class Matrix { /** * Powers this matrix of given exponent { code n } .
* @ param n the exponent
* @ return the powered matrix */
public Matrix power ( int n ) { } } | if ( n < 0 ) { fail ( "The exponent should be positive: " + n + "." ) ; } Matrix result = blankOfShape ( rows , rows ) ; Matrix that = this ; for ( int i = 0 ; i < rows ; i ++ ) { result . set ( i , i , 1.0 ) ; } while ( n > 0 ) { if ( n % 2 == 1 ) { result = result . multiply ( that ) ; } n /= 2 ; that = that . multip... |
public class Matrix4 { /** * Sets this to a perspective projection matrix . The formula comes from the OpenGL
* documentation for the glFrustum function .
* @ return a reference to this matrix , for chaining . */
public Matrix4 setToFrustum ( double left , double right , double bottom , double top , double near , d... | return setToFrustum ( left , right , bottom , top , near , far , Vector3 . UNIT_Z ) ; |
public class CmsHtmlConverterJTidy { /** * Parses a byte array containing HTML code with different parsing modes . < p >
* @ param htmlInput a byte array containing raw HTML code
* @ return parsed and cleared HTML code
* @ throws UnsupportedEncodingException if the encoding set for the conversion is not supported... | // prepare the streams
ByteArrayInputStream in = new ByteArrayInputStream ( htmlInput . getBytes ( getEncoding ( ) ) ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; // do the parsing
m_tidy . parse ( in , out ) ; // return the result
byte [ ] result = out . toByteArray ( ) ; return new String ( result ,... |
public class PredicateFilterAxis { /** * { @ inheritDoc } */
@ Override public final boolean hasNext ( ) { } } | resetToLastKey ( ) ; // a predicate has to evaluate to true only once .
if ( mIsFirst ) { mIsFirst = false ; if ( mPredicate . hasNext ( ) ) { if ( isBooleanFalse ( ) ) { resetToStartKey ( ) ; return false ; } // reset is needed , because a predicate works more like a
// filter . It
// does
// not change the current tr... |
public class ReflectionsHelper { /** * OSX contains file : / / resources on the classpath including . mar and . jnilib files .
* Reflections use of Vfs doesn ' t recognize these URLs and logs warns when it sees them . By registering those file endings , we supress the warns . */
public static void registerUrlTypes ( ... | final List < Vfs . UrlType > urlTypes = Lists . newArrayList ( ) ; // include a list of file extensions / filenames to be recognized
urlTypes . add ( new EmptyIfFileEndingsUrlType ( typesToSkip ) ) ; urlTypes . addAll ( Arrays . asList ( Vfs . DefaultUrlTypes . values ( ) ) ) ; Vfs . setDefaultURLTypes ( urlTypes ) ; |
public class MetricsImpl { /** * Retrieve metric data .
* Gets metric values for a single metric .
* @ param appId ID of the application . This is Application ID from the API Access settings blade in the Azure portal .
* @ param metricId ID of the metric . This is either a standard AI metric , or an application -... | return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( appId , metricId ) , serviceCallback ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.