signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DisconfFileCoreProcessorImpl { /** * 更新 一個配置文件 , 下载 、 注入到仓库 、 Watch 三步骤 */
private void updateOneConfFile ( String fileName , DisconfCenterFile disconfCenterFile ) throws Exception { } } | if ( disconfCenterFile == null ) { throw new Exception ( "cannot find disconfCenterFile " + fileName ) ; } String filePath = fileName ; Map < String , Object > dataMap = new HashMap < String , Object > ( ) ; // 开启disconf才需要远程下载 , 否则就本地就好
if ( DisClientConfig . getInstance ( ) . ENABLE_DISCONF ) { // 下载配置
try { String u... |
public class MicroMetaDao { /** * 锟斤拷锟絪ql锟斤拷询 */
public List < Map < String , Object > > queryObjJoinByCondition ( String sql ) { } } | /* JdbcTemplate jdbcTemplate = ( JdbcTemplate ) MicroDbHolder
. getDbSource ( dbName ) ; */
JdbcTemplate jdbcTemplate = getMicroJdbcTemplate ( ) ; logger . debug ( sql ) ; List < Map < String , Object > > retList0 = jdbcTemplate . queryForList ( sql ) ; // add 201807 ning
// List < Map < String , Object > > retList =... |
public class Bzip2Archiver { /** * Creates Stream for decompression
* @ param path
* path to file to uncompress
* @ param encoding
* ecoding to use
* @ return decompression stream
* @ throws IOException */
public InputStreamReader getDecompressionStream ( String path , String encoding ) throws IOException {... | File fileToUncompress = new File ( path ) ; BufferedInputStream fileStream = new BufferedInputStream ( new FileInputStream ( fileToUncompress ) ) ; // read bzip2 prefix : BZ
fileStream . read ( ) ; fileStream . read ( ) ; BufferedInputStream bufferedStream = new BufferedInputStream ( fileStream ) ; CBZip2InputStream in... |
public class AbstractCommandLineRunner { /** * Create a writer with the newer output charset . */
@ GwtIncompatible ( "Unnecessary" ) private Writer streamToOutputWriter2 ( OutputStream stream ) { } } | if ( outputCharset2 == null ) { return new BufferedWriter ( new OutputStreamWriter ( stream , UTF_8 ) ) ; } else { return new BufferedWriter ( new OutputStreamWriter ( stream , outputCharset2 ) ) ; } |
public class LatencyMetric { /** * Exports this object to a plain map structure which can be easily converted into other
* target formats .
* @ return the exported structure . */
public Map < String , Object > export ( ) { } } | Map < String , Object > result = new HashMap < String , Object > ( ) ; result . put ( "min" , min ( ) ) ; result . put ( "max" , max ( ) ) ; result . put ( "count" , count ( ) ) ; result . put ( "percentiles" , percentiles ( ) ) ; result . put ( "timeUnit" , timeUnit ( ) . toString ( ) ) ; return result ; |
public class TriggerConfig { /** * The event type or types for which notifications are triggered .
* @ return The event type or types for which notifications are triggered .
* @ see TriggerEventType */
public java . util . List < String > getTriggerEvents ( ) { } } | if ( triggerEvents == null ) { triggerEvents = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return triggerEvents ; |
public class DeviceManagerClient { /** * Modifies the configuration for the device , which is eventually sent from the Cloud IoT Core
* servers . Returns the modified configuration version and its metadata .
* < p > Sample code :
* < pre > < code >
* try ( DeviceManagerClient deviceManagerClient = DeviceManager... | ModifyCloudToDeviceConfigRequest request = ModifyCloudToDeviceConfigRequest . newBuilder ( ) . setName ( name ) . setBinaryData ( binaryData ) . build ( ) ; return modifyCloudToDeviceConfig ( request ) ; |
public class ResourceController { /** * Of the resource in the given resource list , return the one that ' s
* currently in use .
* If more than one such resource exists , one is chosen and returned .
* This method is used for reporting what ' s causing the blockage . */
public Resource getMissingResource ( final... | try { return _withLock ( new Callable < Resource > ( ) { @ Override public Resource call ( ) { return resources . getConflict ( inUse ) ; } } ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Inner callable does not throw exception" ) ; } |
public class RemoteTopicSpaceControl { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPRemoteTopicSpaceControllable # getRemoteSubscriptions ( ) */
public SIMPIterator getRemoteSubscriptions ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRemoteSubscriptions" ) ; List durableConsumers = new LinkedList ( ) ; if ( _anycastInputHandler != null ) { // we have a durable consumer
durableConsumers . add ( _anycastInputHandler ) ; } AttachedRemoteSubscriberIterat... |
public class VoldemortBuildAndPushJob { /** * Get the sanitized input path . At the moment of writing , this means the
* # LATEST tag is expanded . */
private synchronized Path getInputPath ( ) throws IOException { } } | if ( sanitizedInputPath == null ) { // No need to query Hadoop more than once as this shouldn ' t change mid - run ,
// thus , we can lazily initialize and cache the result .
Path path = new Path ( props . getString ( BUILD_INPUT_PATH ) ) ; sanitizedInputPath = HadoopUtils . getSanitizedPath ( path ) ; } return sanitiz... |
public class ForField { /** * { @ inheritDoc } */
public FieldDescription transform ( TypeDescription instrumentedType , FieldDescription fieldDescription ) { } } | return new TransformedField ( instrumentedType , fieldDescription . getDeclaringType ( ) , transformer . transform ( instrumentedType , fieldDescription . asToken ( none ( ) ) ) , fieldDescription . asDefined ( ) ) ; |
public class EntryController { /** * Called when a patient context change has been requested .
* @ param silent = If true , user interaction is not permitted . */
@ Override public String pending ( boolean silent ) { } } | if ( modified && ! warned ) { if ( silent || ! PromptDialog . confirm ( TX_PROMPT ) ) { return "Vital entry in progress." ; } } return null ; |
public class WakeUpSbb { /** * HELPERS */
private void sendResponse ( RequestEvent event , int responseCode ) throws SipException , InvalidArgumentException , ParseException { } } | event . getServerTransaction ( ) . sendResponse ( sipProvider . getMessageFactory ( ) . createResponse ( responseCode , event . getRequest ( ) ) ) ; |
public class SSLConnectionLink { /** * @ see com . ibm . wsspi . channelfw . base . OutboundProtocolLink # connectAsynch ( java . lang . Object ) */
@ Override public void connectAsynch ( Object address ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "connectAsynch, vc=" + getVCHash ( ) ) ; } // Determine if this is a redundant connect .
if ( connected ) { handleRedundantConnect ( ) ; } this . targetAddress = ( TCPConnectRequestContext ) address ; // Nothing specific to S... |
public class FormatterRequest { /** * Sets the { @ link # textRegionAccess } . If the region has syntax errors and no explicit { @ link ExceptionAcceptor } is
* configured yet , the { @ link ExceptionAcceptor # IGNORING ignoring acceptor } will be configured . */
public FormatterRequest setTextRegionAccess ( ITextReg... | if ( tokens . hasSyntaxError ( ) && this . exceptionHandler == null ) this . exceptionHandler = ExceptionAcceptor . IGNORING ; this . textRegionAccess = tokens ; return this ; |
public class MatchParserImpl { /** * ( < ESCAPE > < STRING _ LITERAL > ) ? */
final public Selector LikePredicate ( ) throws ParseException { } } | Selector id ; Token pat ; Token esc = null ; boolean neg = false ; id = FieldRef ( ) ; switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case NOT : jj_consume_token ( NOT ) ; neg = true ; break ; default : jj_la1 [ 17 ] = jj_gen ; ; } jj_consume_token ( LIKE ) ; pat = jj_consume_token ( STRING_LITERAL ) ; switch ( (... |
public class Importer { /** * Imports the engine from the given file
* @ param file is the file containing the engine to import
* @ return the engine represented by the file
* @ throws IOException if any error occurs upon reading the file */
public Engine fromFile ( File file ) throws IOException { } } | BufferedReader reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( file ) , FuzzyLite . UTF_8 ) ) ; String line ; StringBuilder textEngine = new StringBuilder ( ) ; try { while ( ( line = reader . readLine ( ) ) != null ) { textEngine . append ( line ) . append ( "\n" ) ; } } catch ( IOException... |
public class ObservableAdapterBuilder { /** * Defines the function for evaluating whether two objects have the same identity , for the purpose of determining
* notifications . */
@ NonNull public ObservableAdapterBuilder < T > identityEquality ( @ Nullable EqualityFunction < ? super T > identityEqualityFunction ) { }... | mIdentityEqualityFunction = identityEqualityFunction ; return this ; |
public class HiveSerDeManager { /** * Get an instance of { @ link HiveSerDeManager } .
* @ param props A { @ link State } object . To get a specific implementation of { @ link HiveSerDeManager } , specify either
* one of the values in { @ link Implementation } ( e . g . , AVRO or ORC ) or the name of a class that i... | String type = props . getProp ( HIVE_ROW_FORMAT , Implementation . AVRO . name ( ) ) ; Optional < Implementation > implementation = Enums . getIfPresent ( Implementation . class , type . toUpperCase ( ) ) ; try { if ( implementation . isPresent ( ) ) { return ( HiveSerDeManager ) ConstructorUtils . invokeConstructor ( ... |
public class DeleteCorpusDao { /** * Deletes a top level corpus , when it is already exists .
* @ param corpusName */
@ Transactional ( readOnly = false , propagation = Propagation . REQUIRES_NEW , isolation = Isolation . READ_COMMITTED ) public void checkAndRemoveTopLevelCorpus ( String corpusName ) { } } | if ( existConflictingTopLevelCorpus ( corpusName ) ) { log . info ( "delete conflicting corpus: {}" , corpusName ) ; List < String > corpusNames = new LinkedList < > ( ) ; corpusNames . add ( corpusName ) ; deleteCorpora ( getQueryDao ( ) . mapCorpusNamesToIds ( corpusNames ) , false ) ; } |
public class ApiOvhTelephony { /** * Operations on a telephony service
* REST : GET / telephony / { billingAccount } / service / { serviceName } / task
* @ param action [ required ] Filter the value of action property ( = )
* @ param status [ required ] Filter the value of status property ( = )
* @ param servic... | String qPath = "/telephony/{billingAccount}/service/{serviceName}/task" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; query ( sb , "action" , action ) ; query ( sb , "serviceType" , serviceType ) ; query ( sb , "status" , status ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ... |
public class AESUtils { /** * Encrypt the plain text .
* @ param salt
* salt is used together with the password to construct a 256 bit SecretKey
* @ param password
* the secret key
* @ param plainText
* unencrypted text
* @ return the iv as a hex string followed by ' $ ' followed by the encrypted text . *... | SecretKey secret = getKey ( salt , password ) ; return encryptBouncyCastle ( secret , plainText ) ; |
public class Normalizer { /** * Normalizes a < tt > String < / tt > using the given normalization operation .
* The < tt > options < / tt > parameter specifies which optional
* < tt > Normalizer < / tt > features are to be enabled for this operation .
* Currently the only available option is { @ link # UNICODE _ ... | return mode . getNormalizer2 ( options ) . normalize ( str ) ; |
public class EnvironmentResourceDescription { /** * The Auto Scaling launch configurations in use by this environment .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setLaunchConfigurations ( java . util . Collection ) } or { @ link # withLaunchConfiguratio... | if ( this . launchConfigurations == null ) { setLaunchConfigurations ( new com . amazonaws . internal . SdkInternalList < LaunchConfiguration > ( launchConfigurations . length ) ) ; } for ( LaunchConfiguration ele : launchConfigurations ) { this . launchConfigurations . add ( ele ) ; } return this ; |
public class SortUtil { /** * UTF - 8 supports bytes comparison . */
public static void putStringNormalizedKey ( BinaryString value , MemorySegment target , int offset , int numBytes ) { } } | final int limit = offset + numBytes ; final int end = value . getSizeInBytes ( ) ; for ( int i = 0 ; i < end && offset < limit ; i ++ ) { target . put ( offset ++ , value . getByte ( i ) ) ; } for ( int i = offset ; i < limit ; i ++ ) { target . put ( i , ( byte ) 0 ) ; } |
public class JMLambda { /** * Consume if true .
* @ param < T > the type parameter
* @ param < U > the type parameter
* @ param bool the bool
* @ param target1 the target 1
* @ param target2 the target 2
* @ param biConsumer the bi consumer */
public static < T , U > void consumeIfTrue ( boolean bool , T ta... | if ( bool ) biConsumer . accept ( target1 , target2 ) ; |
public class ResponseParser { /** * Find the index matching the end of the header data .
* @ param data the request data
* @ return the index if found , - 1 otherwise */
private static int findEndOfHeaders ( byte [ ] data ) { } } | for ( int i = 0 ; i < data . length - 3 ; i ++ ) { if ( data [ i ] != CRLF [ 0 ] || data [ i + 1 ] != CRLF [ 1 ] || data [ i + 2 ] != CRLF [ 0 ] || data [ i + 3 ] != CRLF [ 1 ] ) { continue ; } // Headers finish here
return i ; } return - 1 ; |
public class InodeLockList { /** * Unlocks the last locked inode . */
public void unlockLastInode ( ) { } } | Preconditions . checkState ( endsInInode ( ) ) ; Preconditions . checkState ( ! mEntries . isEmpty ( ) ) ; mLockedInodes . remove ( mLockedInodes . size ( ) - 1 ) ; mEntries . remove ( mEntries . size ( ) - 1 ) . mLock . close ( ) ; mLockMode = LockMode . READ ; |
public class EasyRandomParameters { /** * Register a custom randomizer for a given type .
* @ param type class of the type to randomize
* @ param randomizer the custom { @ link Randomizer } to use
* @ param < T > The field type
* @ return the current { @ link EasyRandomParameters } instance for method chaining ... | Objects . requireNonNull ( type , "Type must not be null" ) ; Objects . requireNonNull ( randomizer , "Randomizer must not be null" ) ; customRandomizerRegistry . registerRandomizer ( type , randomizer ) ; return this ; |
public class Calc { /** * Multiply elements of a by s
* @ param a
* @ param s
* @ return A new Atom with s * a */
public static Atom scale ( Atom a , double s ) { } } | double x = a . getX ( ) ; double y = a . getY ( ) ; double z = a . getZ ( ) ; Atom b = new AtomImpl ( ) ; b . setX ( x * s ) ; b . setY ( y * s ) ; b . setZ ( z * s ) ; return b ; |
public class MaterialComboBox { /** * Build the Option Element with provided params */
protected Option buildOption ( String text , T value ) { } } | Option option = new Option ( ) ; option . setText ( text ) ; option . setValue ( keyFactory . generateKey ( value ) ) ; return option ; |
public class XmlEscape { /** * Perform a ( configurable ) XML 1.0 < strong > escape < / strong > operation on a < tt > Reader < / tt > input
* meant to be an XML attribute value , writing results to a < tt > Writer < / tt > .
* This method will perform an escape operation according to the specified
* { @ link org... | escapeXml ( reader , writer , XmlEscapeSymbols . XML10_ATTRIBUTE_SYMBOLS , type , level ) ; |
public class SeleniumDriverFixture { /** * < p > < code >
* | start driver | < i > $ Driver < / i > | on url | < i > http : / / localhost < / i > |
* < / code > < / p >
* @ param webDriver a WebDriver instance
* @ param browserUrl */
public void startDriverOnUrl ( final WebDriver webDriver , final String browse... | setCommandProcessor ( startWebDriverCommandProcessor ( browserUrl , webDriver ) ) ; setTimeoutOnSelenium ( ) ; LOG . debug ( "Started command processor" ) ; |
public class Name { /** * Parse the name string from GEDCOM normal into its component parts . */
public void init ( ) { } } | final String string = getString ( ) ; final int bpos = string . indexOf ( '/' ) ; if ( bpos == - 1 ) { prefix = string ; surname = "" ; suffix = "" ; } else { final int epos = string . indexOf ( '/' , bpos + 1 ) ; prefix = string . substring ( 0 , bpos ) ; surname = string . substring ( bpos + 1 , epos ) ; suffix = str... |
public class BuildState { /** * Load a module from the javac state file . */
public Module loadModule ( String l ) { } } | Module m = Module . load ( l ) ; modules . put ( m . name ( ) , m ) ; return m ; |
public class UrlPatternAnalyzer { public UrlPatternRegexpBox toRegexp ( Method executeMethod , String urlPattern , List < Class < ? > > pathParamTypeList , Map < Integer , Class < ? > > optionalGenericTypeMap ) { } } | final StringBuilder sb = new StringBuilder ( 32 ) ; final char [ ] chars = urlPattern . toCharArray ( ) ; final int length = chars . length ; List < String > varList = null ; int parameterIndex = - 1 ; int index = - 1 ; for ( int i = 0 ; i < length ; i ++ ) { final char currentChar = chars [ i ] ; if ( currentChar == '... |
public class ApiContext { /** * Fetch a new access token . */
private synchronized void fetchAccessToken ( ) throws ConnectionException , HTTPException { } } | if ( accessToken != null ) { return ; } Map < String , String > params = new HashMap < > ( ) ; params . put ( Constants . PARAM_CLIENT_ID , clientId ) ; params . put ( Constants . PARAM_CLIENT_SECRET , clientSecret ) ; if ( isUserAuthFlow ( ) ) { params . put ( Constants . PARAM_GRANT_TYPE , Constants . PARAM_PASSWORD ... |
public class MariaDbDataSource { /** * Attempts to establish a connection with the data source that this < code > DataSource < / code >
* object represents .
* @ return a connection to the data source
* @ throws SQLException if a database access error occurs */
public Connection getConnection ( ) throws SQLExcept... | try { if ( urlParser == null ) { initialize ( ) ; } return MariaDbConnection . newConnection ( urlParser , null ) ; } catch ( SQLException e ) { throw ExceptionMapper . getException ( e , null , null , false ) ; } |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < }
* { @ link CmisExtensionType } { @ code > } */
@ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "extension" , scope = GetContentStream . class ) public JAXBElement < CmisExtension... | return new JAXBElement < CmisExtensionType > ( _GetPropertiesExtension_QNAME , CmisExtensionType . class , GetContentStream . class , value ) ; |
public class LogNormalDistribution { /** * Cumulative probability density function ( CDF ) of a normal distribution .
* @ param x value to evaluate CDF at
* @ param mu Mean value
* @ param sigma Standard deviation .
* @ return The CDF of the given normal distribution at x . */
public static double cdf ( double ... | if ( x <= 0. ) { return 0. ; } return .5 * ( 1 + NormalDistribution . erf ( ( FastMath . log ( x ) - mu ) / ( MathUtil . SQRT2 * sigma ) ) ) ; |
public class StringUtil { /** * Returns a new string based on < code > source < / code > with all instances of < code > before < / code >
* replaced with < code > after < / code > .
* @ deprecated java . lang . String . replace ( ) was added in 1.5 */
@ Deprecated @ ReplacedBy ( value = "java.lang.String.replace()"... | int pos = source . indexOf ( before ) ; if ( pos == - 1 ) { return source ; } StringBuilder sb = new StringBuilder ( source . length ( ) + 32 ) ; int blength = before . length ( ) ; int start = 0 ; while ( pos != - 1 ) { sb . append ( source . substring ( start , pos ) ) ; sb . append ( after ) ; start = pos + blength ... |
public class JobTracker { /** * Check the job if it has invalid requirements and throw and IOException if does have .
* @ param job
* @ throws IOException */
private void checkMemoryRequirements ( JobInProgress job ) throws IOException { } } | if ( ! perTaskMemoryConfigurationSetOnJT ( ) ) { LOG . debug ( "Per-Task memory configuration is not set on JT. " + "Not checking the job for invalid memory requirements." ) ; return ; } boolean invalidJob = false ; String msg = "" ; long maxMemForMapTask = job . getMemoryForMapTask ( ) ; long maxMemForReduceTask = job... |
public class ListRoutingProfilesResult { /** * An array of < code > RoutingProfileSummary < / code > objects that include the ARN , Id , and Name of the routing profile .
* @ param routingProfileSummaryList
* An array of < code > RoutingProfileSummary < / code > objects that include the ARN , Id , and Name of the r... | if ( routingProfileSummaryList == null ) { this . routingProfileSummaryList = null ; return ; } this . routingProfileSummaryList = new java . util . ArrayList < RoutingProfileSummary > ( routingProfileSummaryList ) ; |
public class MapStoredSessionProviderService { /** * ( non - Javadoc )
* @ see
* org . exoplatform . services . jcr . ext . app . SessionProviderService # getSystemSessionProvider ( java . lang
* . Object ) */
public SessionProvider getSystemSessionProvider ( Object key ) { } } | if ( systemProviders . containsKey ( key ) ) { return systemProviders . get ( key ) ; } else { final SessionProvider ssp = SessionProvider . createSystemProvider ( ) ; systemProviders . put ( key , ssp ) ; return ssp ; } |
public class FieldReaderWriter { /** * Return the value of the field for which is reader - writer exists . To improve performance a fieldAccessor can be
* supplied but if it is missing the code will go and discover it .
* @ param instance the instance for which the field should be fetched
* @ param stateManager a... | Object result = null ; String fieldname = theField . getName ( ) ; if ( typeDescriptor . isReloadable ( ) ) { if ( stateManager == null ) { // find it using reflection
stateManager = findInstanceStateManager ( instance ) ; } String declaringTypeName = typeDescriptor . getName ( ) ; Map < String , Object > typeLevelValu... |
public class CredentialsInner { /** * Retrieve the credential identified by credential name .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param credentialName The name of credential .
* @ throws IllegalArgumentException t... | return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , credentialName ) . map ( new Func1 < ServiceResponse < CredentialInner > , CredentialInner > ( ) { @ Override public CredentialInner call ( ServiceResponse < CredentialInner > response ) { return response . body ( ) ; } } ) ; |
public class ControlBean { /** * Returns any formal type parameters that should be bound for the bean ' s superclass ,
* based upon any type bindings that occur on the original interface . */
public String getSuperTypeBinding ( ) { } } | InterfaceType superType = _controlIntf . getSuperType ( ) ; if ( superType != null ) { String typeStr = superType . toString ( ) ; int paramIndex = typeStr . indexOf ( '<' ) ; if ( paramIndex > 0 ) return typeStr . substring ( paramIndex ) ; } return "" ; |
public class GitlabAPI { /** * Get events for a project .
* @ param action If not null , include only events of a particular action type
* @ param targetType If not null , include only events of a particular target type
* @ param before If not null , include only events created before a particular date .
* @ pa... | return getProjectEvents ( projectId , action , targetType , before , after , sort , new Pagination ( ) ) ; |
public class Pegasos { /** * Sets the regularization constant used for learning . The regularization
* must be positive , and the learning rate is proportional to the
* regularization value . This means regularizations very near zero will
* take a long time to converge .
* @ param reg the regularization to appl... | if ( Double . isInfinite ( reg ) || Double . isNaN ( reg ) || reg <= 0.0 ) throw new ArithmeticException ( "Pegasos requires a positive regularization cosntant" ) ; this . reg = reg ; |
public class WickedChartsWicketAppFixturesService { @ Action ( semantics = SemanticsOf . SAFE ) @ MemberOrder ( sequence = "20" ) public Object installFixturesAndReturnFirst ( ) { } } | final List < FixtureResult > run = findFixtureScriptFor ( WickedChartsWicketAppSetUpFixture . class ) . run ( null ) ; return run . get ( 0 ) . getObject ( ) ; |
public class KTypeArrayDeque { /** * / * # if ( $ TemplateOptions . KTypeGeneric ) */
@ SafeVarargs /* # end */
public static < KType > KTypeArrayDeque < KType > from ( KType ... elements ) { } } | final KTypeArrayDeque < KType > coll = new KTypeArrayDeque < KType > ( elements . length ) ; coll . addLast ( elements ) ; return coll ; |
public class ActivityMgr { /** * 反注册activity onPause事件回调 | unregistration activity OnPause Event Callback
* @ param callback 已经注册的 activity onPause事件回调 | Registered Activity OnPause Event callback */
public void unRegisterActivitPauseEvent ( IActivityPauseCallback callback ) { } } | HMSAgentLog . d ( "unRegisterOnPause:" + StrUtils . objDesc ( callback ) ) ; pauseCallbacks . remove ( callback ) ; |
public class BitmapCacheLoader { /** * Load Steps : < br / >
* 1 . load from caches . < br / >
* 2 . if file not exist in caches , then load it from local storage . < br / >
* 3 . if local storage not exist , then load it from temporary directory . < br / >
* 4 . if file not exist in temporary directory . then ... | return loadFile ( fileName , tmpDirectory , imageCallBack , canRemove , - 1 , - 1 ) ; |
public class CmsSolrSpellchecker { /** * Sends the JSON - formatted spellchecking results to the client .
* @ param res The HttpServletResponse object .
* @ param request The spellchecking request object .
* @ throws IOException in case writing the response fails */
private void sendResponse ( final HttpServletRe... | final PrintWriter pw = res . getWriter ( ) ; final JSONObject response = getJsonFormattedSpellcheckResult ( request ) ; pw . println ( response . toString ( ) ) ; pw . close ( ) ; |
public class AbstractCache { /** * This implementation of { @ code getAllPresent } lacks any insight into the internal cache data
* structure , and is thus forced to return the query keys instead of the cached keys . This is only
* possible with an unsafe cast which requires { @ code keys } to actually be of type {... | Map < K , V > result = Maps . newLinkedHashMap ( ) ; for ( Object key : keys ) { if ( ! result . containsKey ( key ) ) { @ SuppressWarnings ( "unchecked" ) K castKey = ( K ) key ; V value = getIfPresent ( key ) ; if ( value != null ) { result . put ( castKey , value ) ; } } } return ImmutableMap . copyOf ( result ) ; |
public class AwsHostNameUtils { /** * Attempts to parse the region name from an endpoint based on conventions
* about the endpoint format .
* @ param host the hostname to parse
* @ param serviceHint an optional hint about the service for the endpoint
* @ return the region parsed from the hostname , or
* & quo... | String region = parseRegion ( host , serviceHint ) ; // If region is null , then endpoint is totally non - standard ;
// guess us - east - 1 for lack of a better option .
return region == null ? "us-east-1" : region ; |
public class Category { /** * Log a message object with the < code > ERROR < / code > level including the
* stack trace of the { @ link Throwable } < code > t < / code > passed as parameter .
* See { @ link # error ( Object ) } form for more detailed information .
* @ param message the message object to log .
*... | if ( m_delegate . isErrorEnabled ( ) ) { if ( message != null ) { m_delegate . error ( message . toString ( ) , t ) ; } else { m_delegate . error ( null , t ) ; } } |
public class CloneUsability { /** * overrides the visitor to look for a CloneNotSupported being thrown
* @ param seen
* the currently parsed opcode */
@ Override public void sawOpcode ( int seen ) { } } | try { if ( ( seen == Const . ATHROW ) && ( stack . getStackDepth ( ) > 0 ) ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; if ( "Ljava/lang/CloneNotSupportedException;" . equals ( item . getSignature ( ) ) ) { throwsCNFE = true ; } } } finally { stack . sawOpcode ( this , seen ) ; } |
public class MappingAssistantPanel { /** * GEN - LAST : event _ txtClassUriTemplateFocusGained */
private void txtClassUriTemplateFocusLost ( java . awt . event . FocusEvent evt ) { } } | // GEN - FIRST : event _ txtClassUriTemplateFocusLost
String uriTemplate = txtClassUriTemplate . getText ( ) ; if ( predicateSubjectMap == null ) { predicateSubjectMap = createPredicateSubjectMap ( ) ; } predicateSubjectMap . setTargetMapping ( uriTemplate ) ; validateClassUri ( ) ; |
public class AbstractBlockBasedDataStore { /** * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . utils . store . ChainedDataStore # delete ( int ) */
@ Override public final int delete ( int handle ) throws DataStoreException { } } | if ( SAFE_MODE ) checkHandle ( handle ) ; int previousHandle = previousBlock [ handle ] ; int current = handle ; int nextHandle = - 1 ; while ( current != - 1 ) { nextHandle = nextBlock [ current ] ; boolean isEndBlock = ( flags [ current ] & FLAG_END_BLOCK ) > 0 ; // Clear block entry
flags [ current ] = 0 ; allocated... |
public class DNFTransformer { /** * Transforms an AQL query to the Disjunctive Normal Form .
* @ param topNode
* @ return */
public static void toDNF ( LogicClause topNode ) { } } | while ( makeDNF ( topNode ) == false ) { // do nothing , just repeat
} cleanEmptyLeafs ( topNode ) ; flattenDNF ( topNode ) ; |
public class XMLFilterBase { /** * Look up the value of a property .
* @ param name The property name .
* @ return The current value of the property .
* @ exception org . xml . sax . SAXNotRecognizedException When the
* XMLReader does not recognize the feature name .
* @ exception org . xml . sax . SAXNotSupp... | for ( int i = 0 ; i < LEXICAL_HANDLER_NAMES . length ; i ++ ) { if ( LEXICAL_HANDLER_NAMES [ i ] . equals ( name ) ) { return getLexicalHandler ( ) ; } } return super . getProperty ( name ) ; |
public class AmazonMTurkClient { /** * The < code > CreateHITType < / code > operation creates a new HIT type . This operation allows you to define a standard
* set of HIT properties to use when creating HITs . If you register a HIT type with values that match an existing
* HIT type , the HIT type ID of the existin... | request = beforeClientExecution ( request ) ; return executeCreateHITType ( request ) ; |
public class AlignmentCoverageCalculatorTask { /** * Set size to the nearest upper 2 ^ n number for quick modulus operation
* @ param size */
public void setRegionCoverageSize ( int size ) { } } | if ( size < 0 ) { return ; } int lg = ( int ) Math . ceil ( Math . log ( size ) / Math . log ( 2 ) ) ; // int lg = 31 - Integer . numberOfLeadingZeros ( size ) ;
int newRegionCoverageSize = 1 << lg ; int newRegionCoverageMask = newRegionCoverageSize - 1 ; RegionCoverage newCoverage = new RegionCoverage ( newRegionCover... |
public class ReadJobRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ReadJobRequest readJobRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( readJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( readJobRequest . getId ( ) , ID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Partial { /** * Does this partial match the specified instant .
* A match occurs when all the fields of this partial are the same as the
* corresponding fields on the specified instant .
* @ param instant an instant to check against , null means now in default zone
* @ return true if this partial m... | long millis = DateTimeUtils . getInstantMillis ( instant ) ; Chronology chrono = DateTimeUtils . getInstantChronology ( instant ) ; for ( int i = 0 ; i < iTypes . length ; i ++ ) { int value = iTypes [ i ] . getField ( chrono ) . get ( millis ) ; if ( value != iValues [ i ] ) { return false ; } } return true ; |
public class AbstractUniqueServiceLoader { /** * Extends the contract for the { @ link AbstractServiceLoader # add ( Object ) } method to require that
* services have unique keys .
* @ throws ServiceConfigurationError
* If another service is defined with the same key as the service to be added . */
@ Override pub... | if ( service == null ) { throw new NullPointerException ( "Service must not be null" ) ; } final K key = this . getKey ( service ) ; if ( key == null ) { throw new NullPointerException ( "Key for service must not be null" ) ; } Collection < S > set = this . services . get ( key ) ; set . add ( service ) ; if ( set . si... |
public class ParquetGroupConverter { /** * convert deprecated parquet int96 nanosecond timestamp to a long , based on
* https : / / github . com / prestodb / presto / blob / master / presto - hive / src / main / java / com / facebook / presto / hive / parquet / ParquetTimestampUtils . java # L56 */
private static lon... | // based on prestodb parquet int96 timestamp conversion
byte [ ] bytes = value . getBytes ( ) ; // little endian encoding - need to invert byte order
long timeOfDayNanos = Longs . fromBytes ( bytes [ 7 ] , bytes [ 6 ] , bytes [ 5 ] , bytes [ 4 ] , bytes [ 3 ] , bytes [ 2 ] , bytes [ 1 ] , bytes [ 0 ] ) ; int julianDay ... |
public class UpdateForClause { /** * Adds a " < code > variable WITHIN path < / code > " section to the clause .
* @ param variable the next variable to add to the clause .
* @ param path the path for the variable , a WITHIN path .
* @ return the clause , for chaining . See { @ link # when ( Expression ) } and { ... | vars . add ( x ( variable + " WITHIN " + path ) ) ; return this ; |
public class ValidatingAction { /** * This method is called if errors are found from validation . < / p >
* This method can be overriden , but don ' t forget to call super . executeOnError if you still want to see error
* messages . < / p >
* @ param event the action event which triggered this action .
* @ para... | errorsBox . setErrors ( diags ) ; errorsBox . setFocussed ( ) ; |
public class RandomAccessStorageModule { /** * { @ inheritDoc } */
@ Override public void read ( byte [ ] bytes , long storageIndex ) throws IOException { } } | randomAccessFile . seek ( storageIndex ) ; randomAccessFile . read ( bytes , 0 , bytes . length ) ; |
public class SpringComponent { /** * Instantiates the non - serializable state . */
protected void init ( Map stormConf , TopologyContext topologyContext ) { } } | setId ( topologyContext . getThisComponentId ( ) ) ; try { method = inputSignature . findMethod ( beanType ) ; logger . info ( "{} uses {}" , this , method . toGenericString ( ) ) ; } catch ( ReflectiveOperationException e ) { throw new IllegalStateException ( "Unusable input signature" , e ) ; } if ( spring == null ) ... |
public class DaoHelper { /** * 设置分页参数
* @ param query
* @ param pageable
* @ return */
public static Query setPageParameter ( Query query , Pageable pageable ) { } } | if ( notNull ( pageable ) ) { query . setFirstResult ( ( pageable . getPageNumber ( ) - 1 ) * pageable . getPageSize ( ) ) ; query . setMaxResults ( pageable . getPageSize ( ) ) ; } return query ; |
public class H2GISFunctions { /** * Register all H2GIS functions
* @ param connection JDBC Connection
* @ param packagePrepend For OSGi environment only , use
* Bundle - SymbolicName : Bundle - Version :
* @ throws SQLException */
private static void registerH2GISFunctions ( Connection connection , String packa... | Statement st = connection . createStatement ( ) ; for ( Function function : getBuiltInsFunctions ( ) ) { try { registerFunction ( st , function , packagePrepend ) ; } catch ( SQLException ex ) { // Catch to register other functions
ex . printStackTrace ( System . err ) ; } } |
public class ZeroLeggedOAuthInterceptor { /** * Get the oauth Authorization string .
* @ param req the request
* @ return the Authorization string */
private String getOAuthAuthString ( HttpRequest req ) throws OAuthException , IOException , URISyntaxException { } } | RealmOAuthConsumer consumer = getConsumer ( ) ; OAuthAccessor accessor = new OAuthAccessor ( consumer ) ; String method = req . getMethod ( ) . name ( ) ; URI uri = req . getURI ( ) ; OAuthMessage msg = accessor . newRequestMessage ( method , uri . toString ( ) , null ) ; return msg . getAuthorizationHeader ( consumer ... |
public class XMLAssert { /** * Assert that two XML documents are NOT similar
* @ param control XML to be compared against
* @ param test XML to be tested
* @ throws SAXException
* @ throws IOException */
public static void assertXMLNotEqual ( InputSource control , InputSource test ) throws SAXException , IOExce... | assertXMLNotEqual ( null , control , test ) ; |
public class AssignmentData { /** * Gets a list of AssignmentRows based on the current Assignments
* @ return */
public List < AssignmentRow > getAssignmentRows ( VariableType varType ) { } } | List < AssignmentRow > rows = new ArrayList < AssignmentRow > ( ) ; List < Variable > handledVariables = new ArrayList < Variable > ( ) ; // Create an AssignmentRow for each Assignment
for ( Assignment assignment : assignments ) { if ( assignment . getVariableType ( ) == varType ) { String dataType = getDisplayNameFrom... |
public class HadoopUtils { /** * A wrapper around { @ link FileSystem # rename ( Path , Path ) } which throws { @ link IOException } if
* { @ link FileSystem # rename ( Path , Path ) } returns False . */
public static void renamePath ( FileSystem fs , Path oldName , Path newName ) throws IOException { } } | renamePath ( fs , oldName , newName , false ) ; |
public class KriptonContentValues { /** * Adds a value to the set .
* @ param key
* the name of the value to put
* @ param value
* the data for the value to put */
public void put ( String key , Short value ) { } } | if ( this . compiledStatement != null ) { if ( value == null ) { this . compiledStatement . bindNull ( compiledStatementBindIndex ++ ) ; } else { compiledStatement . bindLong ( compiledStatementBindIndex ++ , ( short ) value ) ; } } else if ( values != null ) { values . put ( key , value ) ; return ; } names . add ( ke... |
public class CmsHtmlImportConverter { /** * Transforms element nodes and create start tags in output . < p >
* @ param node actual element node
* @ param properties the file properties */
private void transformStartElement ( Node node , Hashtable properties ) { } } | // check hat kind of node we have
String nodeName = node . getNodeName ( ) ; // the < HTML > and < BODY > node must be skipped
if ( nodeName . equals ( NODE_HTML ) || nodeName . equals ( NODE_BODY ) ) { // the < TITLE > node must be read and its value set as properties to
// the imported file
} else if ( nodeName . equ... |
public class RuleRegressionNode { /** * Get learner mode */
public int getLearnerToUse ( int predMode ) { } } | int predictionMode = predMode ; if ( predictionMode == 0 ) { double perceptronError = this . perceptron . getCurrentError ( ) ; double meanTargetError = this . targetMean . getCurrentError ( ) ; if ( perceptronError < meanTargetError ) predictionMode = 1 ; // PERCEPTRON
else predictionMode = 2 ; // TARGET MEAN
} return... |
public class ConsumerGenericFilter { /** * 是否自动加载
* @ param invoker 调用器
* @ return 是否加载本过滤器 */
@ Override public boolean needToLoad ( FilterInvoker invoker ) { } } | ConsumerConfig consumerConfig = ( ConsumerConfig ) invoker . getConfig ( ) ; return consumerConfig . isGeneric ( ) ; |
public class FnBigInteger { /** * Determines whether the target object is null or not .
* @ return false if the target object is null , true if not . */
public static final Function < BigInteger , Boolean > isNotNull ( ) { } } | return ( Function < BigInteger , Boolean > ) ( ( Function ) FnObject . isNotNull ( ) ) ; |
public class ConfluenceGreenPepper { /** * < p > saveExecuteChildren . < / p >
* @ param page a { @ link com . atlassian . confluence . pages . Page } object .
* @ param doExecuteChildren a { @ link java . lang . Boolean } object . */
public void saveExecuteChildren ( Page page , Boolean doExecuteChildren ) { } } | ContentEntityObject entityObject = getContentEntityManager ( ) . getById ( page . getId ( ) ) ; getContentPropertyManager ( ) . setStringProperty ( entityObject , ConfluenceGreenPepper . EXECUTE_CHILDREN , doExecuteChildren != null ? String . valueOf ( doExecuteChildren ) : null ) ; |
public class CachedCounters { /** * Increments counter by given value .
* @ param name a counter name of Increment type .
* @ param value a value to add to the counter . */
public void increment ( String name , int value ) { } } | Counter counter = get ( name , CounterType . Increment ) ; counter . setCount ( counter . getCount ( ) != null ? counter . getCount ( ) + value : value ) ; update ( ) ; |
public class TracingChannelInterceptor { /** * Use this to create a span for processing the given message . Note : the result has no
* name and is not started .
* This creates a child from identifiers extracted from the message headers , or a new
* span if one couldn ' t be extracted .
* @ param message message... | MessageHeaderAccessor headers = mutableHeaderAccessor ( message ) ; TraceContextOrSamplingFlags extracted = this . extractor . extract ( headers ) ; headers . setImmutable ( ) ; Span result = this . tracer . nextSpan ( extracted ) ; if ( extracted . context ( ) == null && ! result . isNoop ( ) ) { addTags ( message , r... |
public class DescribeNetworkInterfacesRequest { /** * One or more network interface IDs .
* Default : Describes all your network interfaces .
* @ param networkInterfaceIds
* One or more network interface IDs . < / p >
* Default : Describes all your network interfaces . */
public void setNetworkInterfaceIds ( ja... | if ( networkInterfaceIds == null ) { this . networkInterfaceIds = null ; return ; } this . networkInterfaceIds = new com . amazonaws . internal . SdkInternalList < String > ( networkInterfaceIds ) ; |
public class ResourceUtil { /** * Returns the { @ link Byte } array message digest of { @ link # getResourceInputStream ( ) } using the given
* { @ link MessageDigest } . */
public static byte [ ] getDigest ( Resource < ? > resource , MessageDigest digest ) { } } | try ( InputStream stream = resource . getResourceInputStream ( ) ; DigestInputStream digestStream = new DigestInputStream ( stream , digest ) ) { byte [ ] buffer = new byte [ 16384 ] ; while ( digestStream . read ( buffer , 0 , buffer . length ) != - 1 ) { } } catch ( IOException e ) { throw new IllegalStateException (... |
public class RocksDBOperationUtils { /** * Creates a column descriptor for sate column family .
* < p > Sets TTL compaction filter if { @ code ttlCompactFiltersManager } is not { @ code null } . */
public static ColumnFamilyDescriptor createColumnFamilyDescriptor ( RegisteredStateMetaInfoBase metaInfoBase , Function ... | ColumnFamilyOptions options = createColumnFamilyOptions ( columnFamilyOptionsFactory , metaInfoBase . getName ( ) ) ; if ( ttlCompactFiltersManager != null ) { ttlCompactFiltersManager . setAndRegisterCompactFilterIfStateTtl ( metaInfoBase , options ) ; } byte [ ] nameBytes = metaInfoBase . getName ( ) . getBytes ( Con... |
public class MathUtil { /** * 词性词频词长 . 计算出来一个分数
* @ param from
* @ param term
* @ return */
public static double compuScoreFreq ( Term from , Term term ) { } } | return from . termNatures ( ) . allFreq + term . termNatures ( ) . allFreq ; |
public class UserDistributionDataPointTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public NotificationChain basicSetParameterValue ( ParameterValue newParameterValue , NotificationChain msgs ) { } } | return ( ( FeatureMap . Internal ) getParameterValueGroup ( ) ) . basicAdd ( BpsimPackage . Literals . USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE , newParameterValue , msgs ) ; |
public class AmazonCloudDirectoryClient { /** * Retrieves a JSON representation of the schema . See < a
* href = " https : / / docs . aws . amazon . com / clouddirectory / latest / developerguide / schemas _ jsonformat . html # schemas _ json " > JSON
* Schema Format < / a > for more information .
* @ param getSc... | request = beforeClientExecution ( request ) ; return executeGetSchemaAsJson ( request ) ; |
public class PropertyBuilder { /** * Build the property documentation .
* @ param node the XML element that specifies which components to document
* @ param memberDetailsTree the content tree to which the documentation will be added
* @ throws DocletException if there is a problem while building the documentation... | if ( writer == null ) { return ; } if ( hasMembersToDocument ( ) ) { Content propertyDetailsTree = writer . getPropertyDetailsTreeHeader ( typeElement , memberDetailsTree ) ; Element lastElement = properties . get ( properties . size ( ) - 1 ) ; for ( Element property : properties ) { currentProperty = ( ExecutableElem... |
public class JavacHandlerUtil { /** * Adds the given new field declaration to the provided type AST Node .
* The field carries the & # 64 ; { @ link SuppressWarnings } ( " all " ) annotation .
* Also takes care of updating the JavacAST . */
public static JavacNode injectFieldAndMarkGenerated ( JavacNode typeNode , ... | return injectField ( typeNode , field , true ) ; |
public class SqlConnRunner { /** * 插入数据 < br >
* 此方法不会关闭Connection
* @ param conn 数据库连接
* @ param record 记录
* @ return 插入行数
* @ throws SQLException SQL执行异常 */
public int insert ( Connection conn , Entity record ) throws SQLException { } } | checkConn ( conn ) ; if ( CollectionUtil . isEmpty ( record ) ) { throw new SQLException ( "Empty entity provided!" ) ; } PreparedStatement ps = null ; try { ps = dialect . psForInsert ( conn , record ) ; return ps . executeUpdate ( ) ; } catch ( SQLException e ) { throw e ; } finally { DbUtil . close ( ps ) ; } |
public class Users { /** * Create a new user using his e - mail and phone . It uses USA country code by default .
* @ param email
* @ param phone
* @ return a User instance */
public com . authy . api . User createUser ( String email , String phone ) { } } | return createUser ( email , phone , DEFAULT_COUNTRY_CODE ) ; |
public class QuantilesHelper { /** * Compute an array of evenly spaced normalized ranks from 0 to 1 inclusive .
* A value of 1 will result in [ 0 ] , 2 will result in [ 0 , 1 ] ,
* 3 will result in [ 0 , . 5 , 1 ] and so on .
* @ param n number of ranks needed ( must be greater than 0)
* @ return array of ranks... | if ( n <= 0 ) { throw new SketchesArgumentException ( "n must be > 0" ) ; } final double [ ] fractions = new double [ n ] ; fractions [ 0 ] = 0.0 ; for ( int i = 1 ; i < n ; i ++ ) { fractions [ i ] = ( double ) i / ( n - 1 ) ; } if ( n > 1 ) { fractions [ n - 1 ] = 1.0 ; } return fractions ; |
public class GVRResourceVolume { /** * Adapt a file path to the current file system .
* @ param filePath The input file path string .
* @ return File path compatible with the file system of this { @ link GVRResourceVolume } . */
protected String adaptFilePath ( String filePath ) { } } | // Convert windows file path to target FS
String targetPath = filePath . replaceAll ( "\\\\" , volumeType . getSeparator ( ) ) ; return targetPath ; |
public class WebContainerBase { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . api . container . WebContainer # addAsWebResource ( org . jboss . shrinkwrap . api . asset . Asset ,
* org . jboss . shrinkwrap . api . ArchivePath ) */
@ Override public T addAsWebResource ( Asset resource , ArchivePath targe... | Validate . notNull ( resource , "Resource should be specified" ) ; Validate . notNull ( target , "Target should be specified" ) ; ArchivePath location = new BasicPath ( getWebPath ( ) , target ) ; return add ( resource , location ) ; |
public class CommerceAvailabilityEstimateUtil { /** * Returns the first commerce availability estimate in the ordered set where groupId = & # 63 ; .
* @ param groupId the group ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching c... | return getPersistence ( ) . findByGroupId_First ( groupId , orderByComparator ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.