signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class UTEHelperImpl { /** * Internal method to do the creation given a name a ddf . */
private void createDestination ( String name , com . ibm . wsspi . sib . core . DestinationType destType , Reliability defaultReliability ) throws JMSException { } } | if ( tcInt . isEntryEnabled ( ) ) SibTr . entry ( tcInt , "createDestination(String, DestinationType)" ) ; if ( tcInt . isDebugEnabled ( ) ) { SibTr . debug ( tcInt , "name: " + name ) ; SibTr . debug ( tcInt , "type: " + destType ) ; } try { try { // Obtain information about the destination from the core connection .
... |
public class RegularPathGraph { /** * Add a path - edge to the path - graph . Edges are only added to the vertex of
* lowest rank ( see . constructor ) .
* @ param edge path edge */
private void add ( final PathEdge edge ) { } } | int u = edge . either ( ) ; int v = edge . other ( u ) ; if ( rank [ u ] < rank [ v ] ) graph [ u ] . add ( edge ) ; else graph [ v ] . add ( edge ) ; |
public class LocalQueueBrowserEnumeration { /** * Fetch the next browsable message in the associated queue
* @ return a message or null
* @ throws JMSException on queue browsing error */
private AbstractMessage fetchNext ( ) throws JMSException { } } | if ( nextMessage != null ) return nextMessage ; // Already fetched
nextMessage = localQueue . browse ( cursor , parsedSelector ) ; // Lookup next candidate
if ( nextMessage == null ) close ( ) ; // Auto - close enumeration at end of queue
return nextMessage ; |
public class JaxbContexts { /** * Get the shared unmarshaller for this context .
* NOTE : Since this is shared , always synchronize on this object .
* @ return */
public Marshaller getMarshaller ( String soapPackage ) throws JAXBException { } } | JAXBContextHolder jAXBContextHolder = this . get ( soapPackage ) ; if ( jAXBContextHolder == null ) return null ; // Never
return jAXBContextHolder . getMarshaller ( ) ; |
public class CodedConstant { /** * get return required field check java expression .
* @ param express java expression
* @ param field java field
* @ return full java expression */
public static String getRetRequiredCheck ( String express , Field field ) { } } | String code = "if (CodedConstant.isNull(" + express + ")) {\n" ; code += "throw new UninitializedMessageException(CodedConstant.asList(\"" + field . getName ( ) + "\"))" + ClassCode . JAVA_LINE_BREAK ; code += "}\n" ; return code ; |
public class MessageValidatorRegistry { /** * Gets the default message header validator .
* @ return */
public MessageValidator getDefaultMessageHeaderValidator ( ) { } } | return messageValidators . stream ( ) . filter ( validator -> DefaultMessageHeaderValidator . class . isAssignableFrom ( validator . getClass ( ) ) ) . findFirst ( ) . orElse ( null ) ; |
public class SerDeState { /** * There for ByteArrayOutputStream cases this can be optimized */
public void writeOutputTo ( OutputStream os ) throws IOException { } } | os . write ( output . getBuffer ( ) , 0 , output . position ( ) ) ; |
public class SqlMapper { /** * 查询返回指定的结果类型
* @ param sql 执行的sql
* @ param resultType 返回的结果类型
* @ param < T > 泛型类型
* @ return result */
public < T > List < T > selectList ( String sql , Class < T > resultType ) { } } | String msId ; if ( resultType == null ) { msId = msUtils . select ( sql ) ; } else { msId = msUtils . select ( sql , resultType ) ; } return sqlSession . selectList ( msId ) ; |
public class FxmlLoader { /** * 加密fxml文件
* @ param url { @ link URL }
* @ return { @ link Scene }
* @ throws IOException 异常 */
public static Scene loadFxml ( URL url ) throws IOException { } } | logger . info ( "load fxml from url: " + url ) ; BorderPane root = FXMLLoader . load ( url ) ; return new Scene ( root ) ; |
public class RDBMEntityGroupStore { /** * Find and return an instance of the group .
* @ param rs the SQL result set
* @ return IEntityGroup */
private IEntityGroup instanceFromResultSet ( ResultSet rs ) throws SQLException , GroupsException { } } | IEntityGroup eg = null ; String key = rs . getString ( 1 ) ; String creatorID = rs . getString ( 2 ) ; Integer entityTypeID = rs . getInt ( 3 ) ; Class entityType = EntityTypesLocator . getEntityTypes ( ) . getEntityTypeFromID ( entityTypeID ) ; String groupName = rs . getString ( 4 ) ; String description = rs . getStr... |
public class PieChart { /** * Update a series by updating the pie slide value
* @ param seriesName
* @ param value
* @ return */
public PieSeries updatePieSeries ( String seriesName , Number value ) { } } | Map < String , PieSeries > seriesMap = getSeriesMap ( ) ; PieSeries series = seriesMap . get ( seriesName ) ; if ( series == null ) { throw new IllegalArgumentException ( "Series name >" + seriesName + "< not found!!!" ) ; } series . replaceData ( value ) ; return series ; |
public class VariableSafeAbsRef { /** * Dereference the variable , and return the reference value . Note that lazy
* evaluation will occur . If a variable within scope is not found , a warning
* will be sent to the error listener , and an empty nodeset will be returned .
* @ param xctxt The runtime execution cont... | XNodeSet xns = ( XNodeSet ) super . execute ( xctxt , destructiveOK ) ; DTMManager dtmMgr = xctxt . getDTMManager ( ) ; int context = xctxt . getContextNode ( ) ; if ( dtmMgr . getDTM ( xns . getRoot ( ) ) . getDocument ( ) != dtmMgr . getDTM ( context ) . getDocument ( ) ) { Expression expr = ( Expression ) xns . getC... |
public class appflowpolicylabel_binding { /** * Use this API to fetch appflowpolicylabel _ binding resource of given name . */
public static appflowpolicylabel_binding get ( nitro_service service , String labelname ) throws Exception { } } | appflowpolicylabel_binding obj = new appflowpolicylabel_binding ( ) ; obj . set_labelname ( labelname ) ; appflowpolicylabel_binding response = ( appflowpolicylabel_binding ) obj . get_resource ( service ) ; return response ; |
public class SemanticVersion { /** * Get the prev logical version in line . For example :
* 1.2.3 becomes 1.2.2
* This gets ugly if we underflow , cause we don ' t know what the top patch version
* for the lower minor version could be . */
public SemanticVersion getPrevVersion ( ) { } } | int major = head . getMajorVersion ( ) ; int minor = head . getMinorVersion ( ) ; int patch = head . getPatchVersion ( ) ; if ( patch > 0 ) { return new SemanticVersion ( major , minor , patch - 1 ) ; } if ( minor > 0 ) { return new SemanticVersion ( major , minor - 1 , 999 ) ; } if ( major > 0 ) { return new SemanticV... |
public class DefaultErrorHandler { /** * Handler methods for HTTP client errors
* @ param requestUri - Request URI
* @ param requestMethod - Request HTTP Method
* @ param statusCode - HTTP status code
* @ param statusMessage - HTTP status message
* @ param errorBody - HTTP response body */
protected void hand... | throw new RestEndpointException ( requestUri , requestMethod , statusCode , statusMessage , errorBody ) ; |
public class ARCoreHelper { /** * Converts from AR world space to GVRf world space . */
private void ar2gvr ( float [ ] poseMatrix , float scale ) { } } | // Real world scale
Matrix . scaleM ( poseMatrix , 0 , scale , scale , scale ) ; poseMatrix [ 12 ] = poseMatrix [ 12 ] * scale ; poseMatrix [ 13 ] = poseMatrix [ 13 ] * scale ; poseMatrix [ 14 ] = poseMatrix [ 14 ] * scale ; |
public class CommerceAccountUserRelPersistenceImpl { /** * Returns the commerce account user rels before and after the current commerce account user rel in the ordered set where commerceAccountId = & # 63 ; .
* @ param commerceAccountUserRelPK the primary key of the current commerce account user rel
* @ param comme... | CommerceAccountUserRel commerceAccountUserRel = findByPrimaryKey ( commerceAccountUserRelPK ) ; Session session = null ; try { session = openSession ( ) ; CommerceAccountUserRel [ ] array = new CommerceAccountUserRelImpl [ 3 ] ; array [ 0 ] = getByCommerceAccountId_PrevAndNext ( session , commerceAccountUserRel , comme... |
public class PieChart { /** * Add a series for a Pie type chart
* @ param seriesName
* @ param value
* @ return */
public PieSeries addSeries ( String seriesName , Number value ) { } } | PieSeries series = new PieSeries ( seriesName , value ) ; if ( seriesMap . keySet ( ) . contains ( seriesName ) ) { throw new IllegalArgumentException ( "Series name >" + seriesName + "< has already been used. Use unique names for each series!!!" ) ; } seriesMap . put ( seriesName , series ) ; return series ; |
public class FeatureWebSecurityConfigImpl { /** * { @ inheritDoc } */
@ Override public String getLoginErrorURL ( ) { } } | WebAppSecurityConfig globalConfig = WebAppSecurityCollaboratorImpl . getGlobalWebAppSecurityConfig ( ) ; if ( globalConfig != null ) return WebAppSecurityCollaboratorImpl . getGlobalWebAppSecurityConfig ( ) . getLoginErrorURL ( ) ; else return null ; |
public class SerializationUtils { /** * Serialize an object into a String . The object is first serialized into a byte array ,
* which is converted into a String using { @ link BaseEncoding # base64 ( ) } .
* @ param obj A { @ link Serializable } object
* @ return A String representing the input object
* @ thro... | return serialize ( obj , DEFAULT_ENCODING ) ; |
public class WSJdbcResultSet { /** * Retrieves the number , types and properties of a ResultSet ' s columns .
* @ return
* the description of a ResultSet ' s columns
* @ throws SQLException if a database access error occurs . */
public ResultSetMetaData getMetaData ( ) throws SQLException { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getMetaData" ) ; // First , check if a ResultSetMetaData wrapper for this ResultSet already exists .
ResultSetMetaData rsetMData = null ; try // get a meta data
{ rsetMData = rsetImpl . getMetaData ( ) ; } catch ( SQLException ex ) { FFDCFilter . processException... |
public class InclusiveByteRange { public long getFirst ( long size ) { } } | if ( first < 0 ) { long tf = size - last ; if ( tf < 0 ) tf = 0 ; return tf ; } return first ; |
public class MeasurementUnitsImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . MEASUREMENT_UNITS__XOA_BASE : return getXoaBase ( ) ; case AfplibPackage . MEASUREMENT_UNITS__YOA_BASE : return getYoaBase ( ) ; case AfplibPackage . MEASUREMENT_UNITS__XOA_UNITS : return getXoaUnits ( ) ; case AfplibPackage . MEASUREMENT_UNITS__YOA_UNITS : return getYoaUnits... |
public class ListHandler { /** * Prepare an objectname patttern from a path ( or " null " if no path is given )
* @ param pPathStack path
* @ return created object name ( either plain or a pattern ) */
private ObjectName objectNameFromPath ( Stack < String > pPathStack ) throws MalformedObjectNameException { } } | if ( pPathStack . empty ( ) ) { return null ; } Stack < String > path = ( Stack < String > ) pPathStack . clone ( ) ; String domain = path . pop ( ) ; if ( path . empty ( ) ) { return new ObjectName ( domain + ":*" ) ; } String props = path . pop ( ) ; ObjectName mbean = new ObjectName ( domain + ":" + props ) ; if ( m... |
public class PostgreSQLLiaison { /** * from DatabaseLiaison */
public void createGenerator ( Connection conn , String tableName , String columnName , int initValue ) throws SQLException { } } | if ( initValue == 1 ) { return ; // that ' s the default ! yay , do nothing
} String seqname = "\"" + tableName + "_" + columnName + "_seq\"" ; Statement stmt = conn . createStatement ( ) ; try { stmt . executeQuery ( "select setval('" + seqname + "', " + initValue + ", false)" ) ; } finally { JDBCUtil . close ( stmt )... |
public class DemoFescarWebLauncher { /** * 订购信息 */
@ Ok ( "json:full" ) @ At ( "/api/purchase" ) public NutMap purchase ( String userId , String commodityCode , int orderCount , boolean dofail ) { } } | try { businessService . purchase ( userId , commodityCode , orderCount , dofail ) ; return new NutMap ( "ok" , true ) ; } catch ( Throwable e ) { log . debug ( "purchase fail" , e ) ; return new NutMap ( "ok" , false ) ; } |
public class CoffeeScriptGenerator { /** * Returns the resource input stream
* @ param path
* the resource path
* @ return the resource input stream */
private InputStream getResourceInputStream ( String path ) { } } | InputStream is = config . getContext ( ) . getResourceAsStream ( path ) ; if ( is == null ) { try { is = ClassLoaderResourceUtils . getResourceAsStream ( path , this ) ; } catch ( FileNotFoundException e ) { throw new BundlingProcessException ( e ) ; } } return is ; |
public class AWSOrganizationsClient { /** * Creates an organizational unit ( OU ) within a root or parent OU . An OU is a container for accounts that enables
* you to organize your accounts to apply policies according to your business requirements . The number of levels
* deep that you can nest OUs is dependent upo... | request = beforeClientExecution ( request ) ; return executeCreateOrganizationalUnit ( request ) ; |
public class Jaxrs20GlobalHandlerServiceImpl { /** * DS - driven component activation */
@ Activate protected void activate ( ComponentContext cContext , Map < String , Object > properties ) throws Exception { } } | this . cContext = cContext ; globalHandlerServiceSR . activate ( cContext ) ; listener = new JaxRSGlobalHandlerBusListener ( ) ; LibertyApplicationBusFactory . getInstance ( ) . registerApplicationBusListener ( listener ) ; |
public class AbstractManagedType { /** * ( non - Javadoc )
* @ see
* javax . persistence . metamodel . ManagedType # getSingularAttribute ( java . lang
* . String , java . lang . Class ) */
@ Override public < Y > SingularAttribute < ? super X , Y > getSingularAttribute ( String paramString , Class < Y > paramCla... | SingularAttribute < ? super X , Y > attribute = getDeclaredSingularAttribute ( paramString , paramClass , false ) ; if ( superClazzType != null && attribute == null ) { return superClazzType . getSingularAttribute ( paramString , paramClass ) ; } checkForValid ( paramString , attribute ) ; return attribute ; |
public class CitrusArchiveProcessor { /** * Adds Citrus archive dependencies and all transitive dependencies to archive .
* @ param archive */
protected void addDependencies ( Archive < ? > archive ) { } } | String version = getConfiguration ( ) . getCitrusVersion ( ) ; CitrusArchiveBuilder archiveBuilder ; if ( version != null ) { archiveBuilder = CitrusArchiveBuilder . version ( version ) ; } else { archiveBuilder = CitrusArchiveBuilder . latestVersion ( ) ; } if ( archive instanceof EnterpriseArchive ) { EnterpriseArchi... |
public class Value { /** * Returns an { @ code ARRAY < BYTES > } value .
* @ param v the source of element values . This may be { @ code null } to produce a value for which
* { @ code isNull ( ) } is { @ code true } . Individual elements may also be { @ code null } . */
public static Value bytesArray ( @ Nullable I... | return new BytesArrayImpl ( v == null , v == null ? null : immutableCopyOf ( v ) ) ; |
public class SomeOfChainMatcher { /** * { @ inheritDoc } */
@ Override public boolean matches ( Object item ) { } } | int count = 0 ; for ( Matcher < ? > m : matchers ) { if ( m . matches ( item ) ) { count ++ ; } } return countMatcher . matches ( count ) ; |
public class IntStreamEx { /** * Folds the elements of this stream using the provided seed object and
* accumulation function , going left to right . This is equivalent to :
* < pre >
* { @ code
* int result = seed ;
* for ( int element : this stream )
* result = accumulator . apply ( result , element )
*... | int [ ] box = new int [ ] { seed } ; forEachOrdered ( t -> box [ 0 ] = accumulator . applyAsInt ( box [ 0 ] , t ) ) ; return box [ 0 ] ; |
public class ConfigReader { /** * Configures component by passing configuration parameters .
* @ param config configuration parameters to be set . */
public void configure ( ConfigParams config ) { } } | ConfigParams parameters = config . getSection ( "parameters" ) ; if ( parameters . size ( ) > 0 ) { _parameters = parameters ; } |
public class Cache { /** * Implementation of the eviction strategy . */
@ Trivial protected synchronized void evictStaleEntries ( ) { } } | /* * final String METHODNAME = " evictStaleEntries " ;
* if ( TraceComponent . isAnyTracingEnabled ( ) & & tc . isDebugEnabled ( ) ) {
* int size = primaryTable . size ( ) + secondaryTable . size ( ) + tertiaryTable . size ( ) ;
* Tr . debug ( tc , METHODNAME + " The current cache size is " + size + " ( " + prima... |
public class ApiOvhSaascsp2 { /** * Changes the tenant administrator ' s password
* REST : POST / saas / csp2 / { serviceName } / changeAdministratorPassword
* @ param newPassword [ required ] New password for the tenant administrator
* @ param serviceName [ required ] The unique identifier of your Office service... | String qPath = "/saas/csp2/{serviceName}/changeAdministratorPassword" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "newPassword" , newPassword ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo (... |
public class BytesWritable { /** * copy the byte array to the dest array , and return the number of bytes
* copied .
* @ param dest
* @ param maxLen
* @ param start
* @ return */
public int copyTo ( byte [ ] dest , int start ) throws BufferTooSmallException { } } | if ( size > ( dest . length - start ) ) { throw new BufferTooSmallException ( "size is " + size + ", buffer availabe size is " + ( dest . length - start ) ) ; } if ( size > 0 ) { System . arraycopy ( bytes , 0 , dest , start , size ) ; } return size ; |
public class ColumnSpec { /** * Parses the encoded column specifications and returns a ColumnSpec object that represents the
* string . Variables are expanded using the given LayoutMap .
* @ param encodedColumnSpec the encoded column specification
* @ param layoutMap expands layout column variables
* @ return a... | checkNotBlank ( encodedColumnSpec , "The encoded column specification must not be null, empty or whitespace." ) ; checkNotNull ( layoutMap , "The LayoutMap must not be null." ) ; String trimmed = encodedColumnSpec . trim ( ) ; String lower = trimmed . toLowerCase ( Locale . ENGLISH ) ; return decodeExpanded ( layoutMap... |
public class TaskGroup { /** * Mark root of this task task group depends on the given task group ' s root .
* This ensure this task group ' s root get picked for execution only after the completion
* of all tasks in the given group .
* @ param dependencyTaskGroup the task group that this task group depends on */
... | if ( dependencyTaskGroup . proxyTaskGroupWrapper . isActive ( ) ) { dependencyTaskGroup . proxyTaskGroupWrapper . addDependentTaskGroup ( this ) ; } else { DAGraph < TaskItem , TaskGroupEntry < TaskItem > > dependencyGraph = dependencyTaskGroup ; super . addDependencyGraph ( dependencyGraph ) ; } |
public class AnyUtils { /** * Finds a matching attribute for a given value .
* @ param meta the metadataobject
* @ param value the value
* @ return the attribute which will accept the given value */
public static MetaAttribute findAttribute ( MetaDataObject meta , Object value ) { } } | if ( value == null ) { throw new IllegalArgumentException ( "null as value not supported" ) ; } for ( MetaAttribute attr : meta . getAttributes ( ) ) { if ( attr . getName ( ) . equals ( TYPE_ATTRIBUTE ) ) { continue ; } if ( attr . isDerived ( ) ) { // we only consider persisted classes , not derived ones like
// " va... |
public class SpinScriptEnv { /** * Get the spin scripting environment
* @ param language the language name
* @ return the environment script as string or null if the language is
* not in the set of languages supported by spin . */
public static String get ( String language ) { } } | language = language . toLowerCase ( ) ; if ( "ecmascript" . equals ( language ) ) { language = "javascript" ; } String extension = extensions . get ( language ) ; if ( extension == null ) { return null ; } else { return loadScriptEnv ( language , extension ) ; } |
public class CmsEncoder { /** * Escapes the wildcard characters in a string which will be used as the pattern for a SQL LIKE clause . < p >
* @ param pattern the pattern
* @ param escapeChar the character which should be used as the escape character
* @ return the escaped pattern */
public static String escapeSql... | char [ ] special = new char [ ] { escapeChar , '%' , '_' } ; String result = pattern ; for ( char charToEscape : special ) { result = result . replaceAll ( "" + charToEscape , "" + escapeChar + charToEscape ) ; } return result ; |
public class Tuples { /** * Create a { @ link Serializer } for tuples of size 2.
* @ param first the serializer for the first slot
* @ param second the serializer for the second slot
* @ return the serializer ; never null */
public static < T1 , T2 > Serializer < Tuple2 < T1 , T2 > > serializer ( Serializer < T1 ... | return new Tuple2Serializer < > ( first , second ) ; |
public class DssatSoilFileHelper { /** * Generate the soil file name for auto - generating ( extend name not
* included )
* @ param soilData soil data holder
* @ return the soil id ( 10 - bit ) */
public String getSoilID ( Map soilData ) { } } | String hash = getObjectOr ( soilData , "soil_id" , "" ) ; if ( hashToName . containsKey ( hash ) ) { return hashToName . get ( hash ) ; } else { String soil_id ; if ( hash . length ( ) > 10 ) { soil_id = hash . substring ( 0 , 6 ) + "0001" ; } else if ( hash . equals ( "" ) ) { soil_id = "AGMIP_0001" ; } else { soil_id... |
public class Dictionary { /** * Gets a property ' s value as a String . Returns null if the value doesn ' t exist , or its value is not a String .
* @ param key the key
* @ return the String or null . */
@ Override public String getString ( @ NonNull String key ) { } } | if ( key == null ) { throw new IllegalArgumentException ( "key cannot be null." ) ; } synchronized ( lock ) { final Object obj = getMValue ( internalDict , key ) . asNative ( internalDict ) ; return obj instanceof String ? ( String ) obj : null ; } |
public class TypeConversion { /** * A utility method to convert the long into bytes in an array .
* @ param value
* The long .
* @ param bytes
* The byte array to which the long should be copied .
* @ param offset
* The index where the long should start . */
public static void longToBytes ( long value , byt... | for ( int i = offset + 7 ; i >= offset ; -- i ) { bytes [ i ] = ( byte ) value ; value = value >> 8 ; } |
public class HppResponse { /** * Creates the security hash from a number of fields and the shared secret .
* @ param secret
* @ return String */
private String generateHash ( String secret ) { } } | // check for any null values and set them to empty string for hashing
String timeStamp = null == this . timeStamp ? "" : this . timeStamp ; String merchantId = null == this . merchantId ? "" : this . merchantId ; String orderId = null == this . orderId ? "" : this . orderId ; String result = null == this . result ? "" ... |
public class RequestHelper { /** * Get the HTTP version associated with the given HTTP request
* @ param aHttpRequest
* The http request to query . May not be < code > null < / code > .
* @ return < code > null < / code > if no supported HTTP version is contained */
@ Nullable public static EHttpVersion getHttpVe... | ValueEnforcer . notNull ( aHttpRequest , "HttpRequest" ) ; final String sProtocol = aHttpRequest . getProtocol ( ) ; return EHttpVersion . getFromNameOrNull ( sProtocol ) ; |
public class EndpointExpander { /** * Given a format string that may contain any of the following conversions
* < ul >
* < li > % t which is replaced with the provided table name < / li >
* < li > % p which is replaced with the provided partition id < / li >
* < li > % g which is replaced with the provided gene... | Preconditions . checkArgument ( tmpl != null && ! tmpl . trim ( ) . isEmpty ( ) , "null or empty format string" ) ; int conversionMask = conversionMaskFor ( tmpl ) ; boolean hasDateConversion = ( conversionMask & DATE ) == DATE ; boolean hasTableConversion = ( conversionMask & TABLE ) == TABLE ; Preconditions . checkAr... |
public class JNPStrategy { /** * { @ inheritDoc } */
public void bind ( String jndiName , Object o ) throws NamingException { } } | if ( jndiName == null ) throw new NamingException ( ) ; if ( o == null ) throw new NamingException ( ) ; Context context = createContext ( ) ; try { String className = o . getClass ( ) . getName ( ) ; if ( trace ) log . trace ( "Binding " + className + " under " + jndiName ) ; Reference ref = new Reference ( className ... |
public class UsersInner { /** * Modify properties of users .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ param labName The name of the lab .
* @ param userName The name of the user .
* @ param user The User registered to a lab
* @ p... | return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , labAccountName , labName , userName , user ) , serviceCallback ) ; |
public class SimpleArangoRepository { /** * Saves the given iterable of entities to the database
* @ param entities
* the iterable of entities to be saved to the database
* @ return the iterable of updated entities with any id / key / rev saved in each entity */
@ SuppressWarnings ( "deprecation" ) @ Override pub... | if ( arangoOperations . getVersion ( ) . getVersion ( ) . compareTo ( "3.4.0" ) < 0 ) { arangoOperations . upsert ( entities , UpsertStrategy . UPDATE ) ; } else { final S first = StreamSupport . stream ( entities . spliterator ( ) , false ) . findFirst ( ) . get ( ) ; arangoOperations . repsert ( entities , ( Class < ... |
public class SAXSerializer { /** * / * Implements XMLReader method . */
@ Override public void parse ( final String mSystemID ) throws IOException , SAXException { } } | emitStartDocument ( ) ; try { super . call ( ) ; } catch ( final Exception exc ) { exc . printStackTrace ( ) ; } emitEndDocument ( ) ; |
public class Singles { /** * Combine the provided Single with the first element ( if present ) in the provided Publisher using the provided BiFunction
* @ param single Single to combine with a Publisher
* @ param fn Publisher to combine with a Single
* @ param app Combining function
* @ return Combined Single *... | Single < R > res = Single . fromPublisher ( Future . fromPublisher ( single . toFlowable ( ) ) . zip ( fn , app ) ) ; return res ; |
public class SyntaxReader { /** * Return the last token read , and also advance by one token . This is equivalent to calling { @ link # lastToken }
* followed by { @ link # nextToken } , but returning the result of lastToken .
* @ return The last token .
* @ throws LexException */
protected LexToken readToken ( )... | LexToken tok = reader . getLast ( ) ; reader . nextToken ( ) ; return tok ; |
public class DefaultPlexusCipher { public String decrypt ( final String str , final String passPhrase ) throws PlexusCipherException { } } | if ( str == null || str . length ( ) < 1 ) { return str ; } return _cipher . decrypt64 ( str , passPhrase ) ; |
public class DagBuilder { /** * Creates a new node and adds it to the DagBuilder .
* @ param name name of the node
* @ param nodeProcessor node processor associated with this node
* @ return a new node
* @ throws DagException if the name is not unique in the DAG . */
public Node createNode ( final String name ,... | checkIsBuilt ( ) ; if ( this . nameToNodeMap . get ( name ) != null ) { throw new DagException ( String . format ( "Node names in %s need to be unique. The name " + "(%s) already exists." , this , name ) ) ; } final Node node = new Node ( name , nodeProcessor , this . dag ) ; this . nameToNodeMap . put ( name , node ) ... |
public class TypeSimplifier { /** * Given a set of referenced types , works out which of them should be imported and what the
* resulting spelling of each one is .
* < p > This method operates on a { @ code Set < TypeMirror > } rather than just a { @ code Set < String > }
* because it is not strictly possible to ... | Map < String , Spelling > imports = new HashMap < > ( ) ; Set < TypeMirror > typesInScope = new TypeMirrorSet ( ) ; typesInScope . addAll ( referenced ) ; typesInScope . addAll ( defined ) ; Set < String > ambiguous = ambiguousNames ( typeUtils , typesInScope ) ; for ( TypeMirror type : referenced ) { TypeElement typeE... |
public class FacesBackingBean { /** * Ensures that any changes to this object will be replicated in a cluster ( for failover ) ,
* even if the replication scheme uses a change - detection algorithm that relies on
* HttpSession . setAttribute to be aware of changes . Note that this method is used by the framework
... | StorageHandler sh = Handlers . get ( getServletContext ( ) ) . getStorageHandler ( ) ; HttpServletRequest unwrappedRequest = PageFlowUtils . unwrapMultipart ( request ) ; RequestContext rc = new RequestContext ( unwrappedRequest , null ) ; String attr = ScopedServletUtils . getScopedSessionAttrName ( InternalConstants ... |
public class Bits { /** * Writes an int to a ByteBuffer
* @ param num the int to be written
* @ param buf the buffer */
public static void writeInt ( int num , ByteBuffer buf ) { } } | if ( num == 0 ) { buf . put ( ( byte ) 0 ) ; return ; } final byte bytes_needed = bytesRequiredFor ( num ) ; buf . put ( bytes_needed ) ; for ( int i = 0 ; i < bytes_needed ; i ++ ) buf . put ( getByteAt ( num , i ) ) ; |
public class Graphics { /** * Sets the RGB value of the ambientLight */
public void setAmbientLight ( float r , float g , float b ) { } } | float ambient [ ] = { r , g , b , 255 } ; normalize ( ambient ) ; gl . glEnable ( GL2 . GL_LIGHTING ) ; gl . glEnable ( GL2 . GL_LIGHT0 ) ; gl . glLightfv ( GL2 . GL_LIGHT0 , GL2 . GL_AMBIENT , ambient , 0 ) ; |
public class FilelistenerWriteTrx { /** * { @ inheritDoc } */
@ Override public synchronized void removeFile ( String pRelativePath ) throws TTException { } } | // If the file already exists we just override it
// and remove the last meta entry since the key won ' t be correct anymore .
getBucketTransaction ( ) . getMetaBucket ( ) . remove ( new MetaKey ( pRelativePath ) ) ; |
public class UIUtils { /** * Format the duration in milliseconds to a human readable String , with " yr " , " days " , " hr " etc prefixes
* @ param durationMs Duration in milliseconds
* @ return Human readable string */
public static String formatDuration ( long durationMs ) { } } | Period period = Period . seconds ( ( int ) ( durationMs / 1000L ) ) ; Period p2 = period . normalizedStandard ( PeriodType . yearMonthDayTime ( ) ) ; PeriodFormatter formatter = new PeriodFormatterBuilder ( ) . appendYears ( ) . appendSuffix ( " yr " ) . appendMonths ( ) . appendSuffix ( " months " ) . appendDays ( ) .... |
public class Packet { /** * Writes a single { @ link String } encoded with the specified { @ link Charset } and { @ link ByteOrder } to this
* { @ link Packet } ' s payload .
* < br > < br >
* A { @ code short } is used to store the length of the { @ link String } in the payload header , which imposes a
* maxim... | var bytes = s . getBytes ( charset ) ; putShort ( bytes . length , order ) ; putBytes ( bytes ) ; return this ; |
public class BaseRecordMessageFilter { /** * Get the name / value pairs in an ordered tree .
* Note : Replace this with a DOM tree when it is available in the basic SDK .
* @ return A matrix with the name , type , etc . */
public Object [ ] [ ] createNameValueTree ( Object mxString [ ] [ ] , Map < String , Object >... | mxString = super . createNameValueTree ( mxString , properties ) ; if ( properties != null ) { mxString = this . addNameValue ( mxString , DB_NAME , properties . get ( DB_NAME ) ) ; mxString = this . addNameValue ( mxString , TABLE_NAME , properties . get ( TABLE_NAME ) ) ; } return mxString ; |
public class BitapPattern { /** * Returns a BitapMatcher preforming a fuzzy search in a whole { @ code sequence } . Search allows no more than { @ code
* maxNumberOfErrors } number of substitutions / insertions / deletions . Matcher will return positions of first matched
* letter in the motif in descending order . ... | return substitutionAndIndelMatcherFirst ( maxNumberOfErrors , sequence , 0 , sequence . size ( ) ) ; |
public class InputMaskRenderer { /** * Translates the client side mask to to a { @ link Pattern } base on :
* https : / / github . com / digitalBush / jquery . maskedinput
* a - Represents an alpha character ( A - Z , a - z )
* 9 - Represents a numeric character ( 0-9)
* * - Represents an alphanumeric character... | StringBuilder regex = SharedStringBuilder . get ( context , SB_PATTERN ) ; boolean optionalFound = false ; for ( char c : mask . toCharArray ( ) ) { if ( c == '?' ) { optionalFound = true ; } else { regex . append ( translateMaskCharIntoRegex ( c , optionalFound ) ) ; } } return Pattern . compile ( regex . toString ( )... |
public class EventServicesImpl { /** * Method that creates the event log based on the passed in params
* @ param pEventName
* @ param pEventCategory
* @ param pEventSource
* @ param pEventOwner
* @ param pEventOwnerId
* @ return EventLog */
public Long createEventLog ( String pEventName , String pEventCateg... | TransactionWrapper transaction = null ; EngineDataAccessDB edao = new EngineDataAccessDB ( ) ; try { transaction = edao . startTransaction ( ) ; Long id = edao . recordEventLog ( pEventName , pEventCategory , pEventSubCat , pEventSource , pEventOwner , pEventOwnerId , user , modUser , comments ) ; return id ; } catch (... |
public class AbstractResourceBundleCli { /** * This method gets the { @ link NlsResourceBundleLocator } .
* @ return the { @ link NlsResourceBundleLocator } . */
public NlsResourceBundleLocator getResourceBundleLocator ( ) { } } | if ( this . resourceBundleLocator == null ) { NlsResourceBundleLocatorImpl impl = new NlsResourceBundleLocatorImpl ( ) ; impl . initialize ( ) ; this . resourceBundleLocator = impl ; } return this . resourceBundleLocator ; |
public class UserPreferences { /** * Helper method to read array of strings out of the properties file , using
* a Findbugs style format .
* @ param props
* The properties file to read the array from .
* @ param keyPrefix
* The key prefix of the array .
* @ return The array of Strings , or an empty array if... | Map < String , Boolean > filters = new TreeMap < > ( ) ; int counter = 0 ; boolean keyFound = true ; while ( keyFound ) { String property = props . getProperty ( keyPrefix + counter ) ; if ( property != null ) { int pipePos = property . indexOf ( BOOL_SEPARATOR ) ; if ( pipePos >= 0 ) { String name = property . substri... |
public class MtasSpanFullyAlignedWithSpans { /** * Go to next start position .
* @ return true , if successful
* @ throws IOException Signals that an I / O exception has occurred . */
private boolean goToNextStartPosition ( ) throws IOException { } } | int nextSpans1StartPosition ; int nextSpans1EndPosition ; int nextSpans2StartPosition ; int nextSpans2EndPosition ; // loop over span1
while ( ( nextSpans1StartPosition = spans1 . spans . nextStartPosition ( ) ) != NO_MORE_POSITIONS ) { nextSpans1EndPosition = spans1 . spans . endPosition ( ) ; if ( noMorePositionsSpan... |
public class AmazonAppStreamClient { /** * Immediately stops the specified streaming session .
* @ param expireSessionRequest
* @ return Result of the ExpireSession operation returned by the service .
* @ sample AmazonAppStream . ExpireSession
* @ see < a href = " http : / / docs . aws . amazon . com / goto / W... | request = beforeClientExecution ( request ) ; return executeExpireSession ( request ) ; |
public class AWSWAFRegionalClient { /** * Returns the status of a < code > ChangeToken < / code > that you got by calling < a > GetChangeToken < / a > .
* < code > ChangeTokenStatus < / code > is one of the following values :
* < ul >
* < li >
* < code > PROVISIONED < / code > : You requested the change token b... | request = beforeClientExecution ( request ) ; return executeGetChangeTokenStatus ( request ) ; |
public class DiagnosticsInner { /** * List Site Detector Responses .
* List Site Detector Responses .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList ... | return listSiteDetectorResponsesNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < DetectorResponseInner > > , Observable < ServiceResponse < Page < DetectorResponseInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DetectorResponseInner > > > call ( Service... |
public class PrimitiveFloatCastExtensions { /** * Convert the given value to { @ code AtomicInteger } .
* @ param number a number of { @ code float } type .
* @ return the equivalent value to { @ code number } of { @ code AtomicInteger } type . */
@ Pure @ Inline ( value = "new $2(($3) $1)" , imported = { } } | AtomicInteger . class , int . class } ) public static AtomicInteger toAtomicInteger ( float number ) { return new AtomicInteger ( ( int ) number ) ; |
public class H2O { /** * package - private for unit tests */
static < T extends RemoteRunnable > T runOnH2ONode ( H2ONode node , T runnable ) { } } | if ( node == H2O . SELF ) { // run directly
runnable . run ( ) ; return runnable ; } else { RunnableWrapperTask < T > task = new RunnableWrapperTask < > ( runnable ) ; try { return new RPC < > ( node , task ) . call ( ) . get ( ) . _runnable ; } catch ( DistributedException e ) { Log . trace ( "Exception in calling run... |
public class FileServersInner { /** * Gets information about the specified Cluster .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param fileServerName The name of the file server within the specified resource group . File server names can only contain a combination of a... | return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , fileServerName ) , serviceCallback ) ; |
public class MockEC2QueryHandler { /** * Parse instance states from query parameters .
* @ param queryParams
* map of query parameters in http request
* @ return a set of instance states in the parameter map */
private Set < String > parseInstanceStates ( final Map < String , String [ ] > queryParams ) { } } | Set < String > instanceStates = new TreeSet < String > ( ) ; for ( String queryKey : queryParams . keySet ( ) ) { // e . g . Filter . 1 . Value . 1 : running , Filter . 1 . Value . 2 : pending
if ( queryKey . startsWith ( "Filter.1.Value" ) ) { for ( String state : queryParams . get ( queryKey ) ) { instanceStates . ad... |
public class ModelsImpl { /** * Gets information about the hierarchical entity models .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param listHierarchicalEntitiesOptionalParameter the object representing the optional parameters to be set before calling this API
* @ param servic... | return ServiceFuture . fromResponse ( listHierarchicalEntitiesWithServiceResponseAsync ( appId , versionId , listHierarchicalEntitiesOptionalParameter ) , serviceCallback ) ; |
public class AbstractRasMethodAdapter { /** * Inject a simple stack map frame and a PUSH NULL , POP . This method
* assumes that the onMethodEntry modified code and returned immediately
* after visiting the target label of a trace guard . */
private void visitFrameAfterOnMethodEntry ( ) { } } | if ( ! visitFramesAfterCallbacks ) return ; // The frame that is required after the trace guard must be
// fully specified as ' this ' is no longer an ' uninitialized this '
if ( isConstructor ( ) ) { List < Object > stackLocals = new ArrayList < Object > ( argTypes . length + 1 ) ; stackLocals . add ( classAdapter . g... |
public class Matrix4x3f { /** * Reset this matrix to the identity .
* Please note that if a call to { @ link # identity ( ) } is immediately followed by a call to :
* { @ link # translate ( float , float , float ) translate } ,
* { @ link # rotate ( float , float , float , float ) rotate } ,
* { @ link # scale ... | if ( ( properties & PROPERTY_IDENTITY ) != 0 ) return this ; MemUtil . INSTANCE . identity ( this ) ; properties = PROPERTY_IDENTITY | PROPERTY_TRANSLATION | PROPERTY_ORTHONORMAL ; return this ; |
public class ObjectOutputStream { /** * Write class descriptor { @ code classDesc } into the receiver . It is
* assumed the class descriptor has not been dumped yet . The class
* descriptors for the superclass chain will be dumped as well . Returns
* the handle for this object ( class descriptor ) which is dumped... | output . writeUTF ( classDesc . getName ( ) ) ; output . writeLong ( classDesc . getSerialVersionUID ( ) ) ; byte flags = classDesc . getFlags ( ) ; boolean externalizable = classDesc . isExternalizable ( ) ; if ( externalizable ) { if ( protocolVersion == PROTOCOL_VERSION_1 ) { flags &= NOT_SC_BLOCK_DATA ; } else { //... |
public class Polynomial { /** * Wraps the polynomial around the array : < br >
* f ( x ) = c [ 0 ] + c [ 1 ] * x + . . . + c [ n ] * x < sup > n - 1 < / sup >
* @ param coefficients Polynomial coefficients
* @ return new instance of a polyonimial which is identical to the input array */
public static Polynomial w... | Polynomial p = new Polynomial ( coefficients . length ) ; p . setTo ( coefficients , coefficients . length ) ; return p ; |
public class FileClassManager { /** * Gets the contents of the specified file , or null if the file does not
* exist .
* @ param file The < code > File < / code > whose contents to obtain .
* @ return The file contents , or null if the file does not exist . */
private byte [ ] getFileContents ( File file ) { } } | if ( file . exists ( ) ) { try { return FileUtil . getFileContents ( file ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return null ; |
public class DOMHelper { /** * Wait for a few milliseconds
* @ param milliseconds */
private static void waiting ( int milliseconds ) { } } | long t0 , t1 ; t0 = System . currentTimeMillis ( ) ; do { t1 = System . currentTimeMillis ( ) ; } while ( ( t1 - t0 ) < milliseconds ) ; |
public class ZooKeeperHelper { /** * Recursively create empty znodes ( if missing ) analogous to { @ code mkdir - p } .
* @ param zookeeper ZooKeeper instance to work with .
* @ param znode Path to create .
* @ throws org . apache . zookeeper . KeeperException
* @ throws InterruptedException */
static void mkdi... | boolean createPath = false ; for ( String path : pathParts ( znode ) ) { if ( ! createPath ) { Stat stat = zookeeper . exists ( path , false ) ; if ( stat == null ) { createPath = true ; } } if ( createPath ) { create ( zookeeper , path ) ; } } |
public class ScrollReader { /** * Same as read ( String , Token , String ) above , but does not include checking the current field name to see if it ' s an array . */
protected Object readListItem ( String fieldName , Token t , String fieldMapping , Parser parser ) { } } | if ( t == Token . START_ARRAY ) { return list ( fieldName , fieldMapping , parser ) ; } // handle nested nodes first
else if ( t == Token . START_OBJECT ) { // Don ' t need special handling for nested fields since this field is already in an array .
return map ( fieldMapping , parser ) ; } FieldType esType = mapping ( ... |
public class ConnectionFactoryService { /** * Indicates whether or not reauthentication of connections is enabled .
* @ return true if reauthentication of connections is enabled . Otherwise false . */
@ Override @ Trivial public boolean getReauthenticationSupport ( ) { } } | return Boolean . TRUE . equals ( bootstrapContextRef . getReference ( ) . getProperty ( REAUTHENTICATION_SUPPORT ) ) ; |
public class SmjpegDecoder { /** * 8 bytes magic - " ^ @ \ nSMJPEG "
* Uint32 version = 0
* Uint32 length of clip in milliseconds */
private void decodeMandatoryHeader ( ) throws IOException { } } | byte [ ] magicBytes = new byte [ 8 ] ; file . readFully ( magicBytes ) ; if ( ! Arrays . equals ( SmjpegMagic . MANDATORY_HEADER , magicBytes ) ) { throw new SmjpegParsingException ( "This is not a SMJPEG file" ) ; } int version = file . readInt ( ) ; if ( version != 0 ) { throw new SmjpegParsingException ( "Unknow ver... |
public class MMFMonitoringDataManager { /** * This method is used to compute the monitoring directory name which will be used by Agrona in order
* to create a file in which to write the data in shared memory .
* The monitoring directory will be dependent of the operating system .
* For Linux we will use the OS im... | String monitoringDirName = IoUtil . tmpDirName ( ) + MONITOR_DIR_NAME ; if ( LINUX . equalsIgnoreCase ( System . getProperty ( OS_NAME_SYSTEM_PROPERTY ) ) ) { final File devShmDir = new File ( LINUX_DEV_SHM_DIRECTORY ) ; if ( devShmDir . exists ( ) ) { monitoringDirName = LINUX_DEV_SHM_DIRECTORY + monitoringDirName ; }... |
public class LatchedObserver { /** * Create a LatchedObserver with the given callback function ( s ) and a shared latch . */
public static < T > LatchedObserver < T > create ( Action1 < ? super T > onNext , CountDownLatch latch ) { } } | return new LatchedObserverImpl < T > ( onNext , Functionals . emptyThrowable ( ) , Functionals . empty ( ) , latch ) ; |
public class Value { /** * intended byte [ ] . Also , the value is NOT on the deserialize ' d machines disk */
public final AutoBuffer write_impl ( AutoBuffer ab ) { } } | return ab . put1 ( _persist ) . put2 ( _type ) . putA1 ( memOrLoad ( ) ) ; |
public class CacheCommandFactory { /** * Add region so that commands can be cleared on shutdown .
* @ param region instance to keep track of */
public void addRegion ( InfinispanBaseRegion region ) { } } | allRegions . put ( ByteString . fromString ( region . getCache ( ) . getName ( ) ) , region ) ; |
public class ObjectUtils { /** * Determine if the given objects are equal , returning { @ code true } if both are { @ code null } or
* { @ code false } if only one is { @ code null } .
* Compares arrays with { @ code Arrays . equals } , performing an equality check based on the array
* elements rather than the ar... | if ( o1 == o2 ) { return true ; } if ( o1 == null || o2 == null ) { return false ; } if ( o1 . equals ( o2 ) ) { return true ; } if ( o1 . getClass ( ) . isArray ( ) && o2 . getClass ( ) . isArray ( ) ) { return ObjectUtils . arrayEquals ( o1 , o2 ) ; } return false ; |
public class MoreCollectors { /** * Applies the specified { @ link Joiner } to the current stream .
* @ throws NullPointerException of { @ code joiner } is { @ code null }
* @ throws IllegalStateException if a merge operation happens because parallel processing has been enabled on the current stream */
public stati... | requireNonNull ( joiner , "Joiner can't be null" ) ; return Collector . of ( ArrayList :: new , List :: add , mergeNotSupportedMerger ( ) , joiner :: join ) ; |
public class RelationalOperations { /** * Returns true if polygon _ a is disjoint from polyline _ b . */
private static boolean polygonDisjointPolyline_ ( Polygon polygon_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { } } | // Quick rasterize test to see whether the the geometries are disjoint ,
// or if one is contained in the other .
int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polyline_b , tolerance , true ) ; if ( relation == Relation . disjoint ) return true ; if ( relation == Relation . contains || relation == Relat... |
public class RealVoltDB { /** * recover the partition assignment from one of lost hosts in the same placement group for rejoin
* Use the placement group of the recovering host to find a matched host from the lost nodes in the topology
* If the partition count from the lost node is the same as the site count of the ... | long version = topology . version ; if ( ! recoverPartitions . isEmpty ( ) ) { // In rejoin case , partition list from the rejoining node could be out of range if the rejoining
// host is a previously elastic removed node or some other used nodes , if out of range , do not restore
if ( Collections . max ( recoverPartit... |
public class Collector { /** * { @ inheritDoc } */
public Object execute ( final Object value , final CsvContext context ) { } } | collection . add ( value ) ; return next . execute ( value , context ) ; |
public class BitVector { /** * Creates a { @ link BitVector } by copying the bits in a < code > BitSet < / code > .
* @ param bitSet
* a < code > BitSet < / code >
* @ param size
* the size of { @ link BitVector } to create , in bits
* @ return a bit vector containing the bits of the bit set .
* @ see Bits ... | if ( bitSet == null ) throw new IllegalArgumentException ( ) ; if ( size < 0 ) throw new IllegalArgumentException ( ) ; final int length = bitSet . length ( ) ; return fromBitSetImpl ( bitSet , size , length ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.